388 Commits

Author SHA1 Message Date
Kayla Z
3d15bc9d17
Add stop button to cancel pending queries (#211)
* Add Stop button

* Replaced QueryTracker stop checks in _prompt_llm in query.ts. Modified _prompt_llm and *gen_responses to take in node id for checking purposes. Added new css class for stopping status.

* Used callback function instead of passing id to the backend, renamed QueryStopper and some of its functions, made custom error

* Added semicolons and one more UserForcedPrematureExit check

* Revise canceler to never clear id, and use unique id Date.now instead

* Make cancel go into call_llm funcs

* Cleanup console logs

* Rebuild app and update package version

---------

Co-authored-by: Kayla Zethelyn <kaylazethelyn@college.harvard.edu>
Co-authored-by: Ian Arawjo <fatso784@gmail.com>
2024-01-13 18:22:08 -05:00
Ian Arawjo
83c49ffe0b Update readme to point to docs v0.2.8.9 2024-01-08 18:43:27 -05:00
Ian Arawjo
cca6205b70 Remove guide and install_guide, as they are outdated and repeats of the docs 2024-01-08 18:35:14 -05:00
ianarawjo
b92c03afb2
Replace Dalai with Ollama (#209)
* Add basic Ollama support (#208)

* Remove trapFocus warning when no OpenAI key set

* Ensure Ollama is only visible in providers list if running locally. 

* Remove Dalai.

* Fix ollama support to include chat models and pass chat history correctly

* Fix bug with debounce on progress bar updates in Prompt/Chat nodes

* Rebuilt app and update package version

---------

Co-authored-by: Laurent Huberdeau <16990250+laurenthuberdeau@users.noreply.github.com>
2024-01-08 18:33:13 -05:00
ianarawjo
5acdfc0677
Add Search Bar to Inspectors (#206)
* Add search bar to Response Inspector

* Added search text highlights using mark tags

* Add filter and case sensitive toggles

* Fixed inspector UI for wide and non-wide formats, to include Find bar

* Escape search string before RegExp. Fix longstanding refresh issue when template var is removed.

* Fix styling inconsistency w border width when displaying LLM responses on Firefox

---------

Co-authored-by: Kayla Zethelyn <kaylazethelyn@college.harvard.edu>
2024-01-05 22:19:50 -05:00
ianarawjo
48f1314d23
Debounce re-renders in prompt node progress listener (#204)
* Debounce rerenders in prompt node progress listener

* Fix debounce lag in genAI for Items nodes

* Rebuild app and update version
2024-01-02 18:33:39 -05:00
ianarawjo
32c62225d2
Debounce text edit callbacks to optimize performance in TFs and Items nodes (#203) 2024-01-02 15:43:13 -05:00
Ian Arawjo
4a45bd6b75 Fix bug with template vars when generating prompt templates w genAI 2024-01-02 11:12:46 -05:00
Ian Arawjo
965b96e451 Fix bug when creating dirs for custom providers 2024-01-02 10:36:43 -05:00
ianarawjo
0af7bdaedd
Bug fix to visibility on TF nodes (#201)
* removed 'source-code-pro' from code css to fix cursor accuracy in code editor (#199)

Co-authored-by: Kayla Zethelyn <kaylazethelyn@college.harvard.edu>

* Refactor duplicate code (#198)

* Refactor common const from JoinNode.js, LLMResponseInspector.js, SplitNode.js and VisNode.js into utils.ts

* unfactor same constant different definition, fixed syntax for multiple imports

---------

Co-authored-by: Kayla Zethelyn <kaylazethelyn@college.harvard.edu>

* Bug fix to update visibility on TF fields

* rebuild react and update version

---------

Co-authored-by: Kayla Z <77540029+kamazet@users.noreply.github.com>
Co-authored-by: Kayla Zethelyn <kaylazethelyn@college.harvard.edu>
2023-12-29 11:18:21 -05:00
ianarawjo
69ff3a1452
Bug fix (#197) 2023-12-20 14:35:38 -05:00
ianarawjo
d6e850e724
Gemini model support and raise error when detecting duplicate var names (v0.2.8.1) (#195)
* Raise error after detecting duplicate variable names (#190)

* Raise error for duplicate variable name

* Created base error class

* Simplified error classes. Made just one `DuplicateVariableNameError` that takes in variable name to have a hard-coded error message

---------

Co-authored-by: Kayla Zethelyn <kaylazethelyn@college.harvard.edu>

* Adding support for Google's Gemini-Pro model.  (#194)

* Refined duplicate var error check code

* Tidy up duplicate var name alerts and error handling, and err message

* Rebuild react and update package version

---------

Co-authored-by: Kayla Z <77540029+kamazet@users.noreply.github.com>
Co-authored-by: Kayla Zethelyn <kaylazethelyn@college.harvard.edu>
Co-authored-by: Priyan Vaithilingam <priyanmuthu@gmail.com>
2023-12-19 16:14:34 -05:00
ianarawjo
ce583a216c
AI for ChainForge BETA: TextFields, Items (#191)
* Implement autofill backend

* Add autofill to ui

* Add argument to getUID to force recalculation of UID's on every call

* Add command fill

* Move popover to the right

* Merge autofill-ui into autofill

* Add minimum rows requirement for autofilling

* Rename local variable in autofill system

* Rename autofill.ts to ai.ts

* Implement generate and replace backend function

* Add purple AI button

* Add ai popover

* Add tabs to ai popover

* Cosmetic changes to AI popover

* Move command fill UI to purple button popover

* Add 'creative' toggle to generateAndReplace

* Generate and replace UI

* Call backend for generate and replace

* Change creative to unconventional in generate and replace system

* Fix generate and replace

* Add loading states

* Cosmetic changes

* Use sparkle icon

* Cosmetic changes

* Add a clarifying sentence to the prompt when the user asks for a prompt

* Change to markdown

* Add error handling to AI system

* Improve prompt prompt

* Remove 'suggestions loading' message

* Change 'pattern' to 'generate a list of' and fix a bug where i forgot to specify unordered markdown list

* Limit output to n in decode()

* Fix bug in error handling

* TEMP: try to fix autofill

* TEMP: disable autofill

* Finally fix autofill's debouncing

* Improve autofill prompt to handle commands

* Fix typo with semicolon

* Implement autofill backend

* Add autofill to ui

* Add argument to getUID to force recalculation of UID's on every call

* Add command fill

* Move popover to the right

* Merge autofill-ui into autofill

* Add minimum rows requirement for autofilling

* Rename local variable in autofill system

* Rename autofill.ts to ai.ts

* Implement generate and replace backend function

* Add purple AI button

* Add ai popover

* Add tabs to ai popover

* Cosmetic changes to AI popover

* Move command fill UI to purple button popover

* Add 'creative' toggle to generateAndReplace

* Generate and replace UI

* Call backend for generate and replace

* Change creative to unconventional in generate and replace system

* Fix generate and replace

* Add loading states

* Cosmetic changes

* Use sparkle icon

* Cosmetic changes

* Add a clarifying sentence to the prompt when the user asks for a prompt

* Change to markdown

* Add error handling to AI system

* Improve prompt prompt

* Remove 'suggestions loading' message

* Change 'pattern' to 'generate a list of' and fix a bug where i forgot to specify unordered markdown list

* Limit output to n in decode()

* Fix bug in error handling

* TEMP: try to fix autofill

* TEMP: disable autofill

* Finally fix autofill's debouncing

* Improve autofill prompt to handle commands

* Fix typo with semicolon

* Refactor the AI Popover into a new component

* Refactor the AI Popover into a new component

* Refactor the autofill functionality into two backend files

* Minor refactoring and styling fixes

* Parse markdown using markdown library

* Add no_cache flag support in backend to ignore cache for AI popover

* trim quotation marks and escape braces in AI autofill

* Add AI Support Tab in Global Settings pane.

* Convert Jinja braces

* Fix typo in AiPopover import

* Handle template variables with Extend and Autocomplete + Check template variable correctness in outputs

* Escape the braces of generate and replace prompts

* Update prompts to strengthen AI support for multiple template variables

* Log the system message

* Reduce minimum rows required to 1 for autocomplete to begin generating

* Reduce min rows to extend to 1 and add warning below 2

* Create a defaultdict utility

* Consider null values as nonexistant in defaultdict

* Make placeholders stick to their assigned text field without using defaultdict

* Make placeholder logic more readable

* Cache rendering of text fields to avoid expensive computation

* Calculate whether to refresh suggestions based on expected suggestions instead of previous suggestions

* Fix bug where LLM was returning templates in generate and replace where none was requested

* Force re-render of text fields on Extend

* Add Sean Yang to README

* Add GenAI support to Items Node

* Pass front-end API keys to AI support features

* Escape braces on Items Node outputs

* Update package to 0.2.8

* Disable autosaving if it takes 1 second or longer to save to localStorage

* Skip autosave when browser tab is inactive

* Fetch environment API keys only once upon load

* Check for OpenAI API key in AIPopover. If not present, display Alert.

---------

Co-authored-by: Sean Yang <53060248+shawseanyang@users.noreply.github.com>
v0.2.8
2023-12-13 11:58:07 -05:00
Ian Arawjo
bacf61be18 Increase max Num Responses per Prompt to 999 2023-12-11 15:37:04 -05:00
Ian Arawjo
2e0ff1d317 Merge branch 'main' of https://github.com/ianarawjo/ChainForge 2023-12-06 21:41:03 -05:00
ianarawjo
ec8fbde392
Add Inspect Drawer (to Prompt and Eval Nodes) (#189)
* Show metavars in Table View

* Remove showing metavar col when var is col-plotted

* Add collapseable drawer to prompt node

* Add inspect drawer to eval nodes

* Rebuild app and package version

* Revise CSS so text in inspect drawer is selectable
2023-12-06 21:40:34 -05:00
Ian Arawjo
118a3db3d1 Remove showing metavar col when var is col-plotted 2023-12-06 15:34:05 -05:00
Ian Arawjo
e2c4636711 Show metavars in Table View 2023-12-06 15:33:48 -05:00
ianarawjo
1f5e0207c9
Disable delete key, use relative paths in FLASK_BASE_URL, rename CSVNode to ItemsNode (#185)
* Disable delete key deleting a node in RF

* Change FLASK_BASE_URL to use relative path except in dev mode

* Rename CSVNode to ItemsNode and replace its icon.

* Update package version and rebuild react

* Add new Claude models
2023-12-04 18:53:57 -05:00
Ian Arawjo
821950d959 Rebuild react and update version 2023-11-27 20:18:32 -05:00
Ian Arawjo
622509188f Update cache for join and split nodes.
Use StorageCache in App.js as safe interface to localStorage.
2023-11-27 20:14:34 -05:00
Ian Arawjo
fddc63338f Fix bug with LLM objs in response inspectors 2023-11-27 19:51:40 -05:00
ianarawjo
7223735b7f
Add Code Processor nodes (#180)
* Add Code Processor nodes.

* Renamed EvaluatorNode to CodeEvaluatorNode.

* Changed the way evaluator nodes pull responses (from grabResponses to pullInputData).

* Fix SimpleEvalNode to be consistent with CodeEvaluatorNode

* Fix Vis Node where no eval resps are connected, but resps are connected.

* Rebuilt react and update package version
2023-11-27 13:57:27 -05:00
Ian Arawjo
a861695c87 Make response reordering more efficient 2023-11-26 21:48:36 -05:00
Ian Arawjo
eb6c39947b Remove log 2023-11-26 21:25:56 -05:00
ianarawjo
a9e1ad691c
Fix numeric table imports and make LLM response order consistent w vars order (#178)
* Convert table values to strings upon export

* Make ordering of LLM responses consistent w vars dict ordering

* Rebuild react and package version

* Make sure ordering considers vars as objects
2023-11-26 21:23:21 -05:00
ianarawjo
1eae5edf89
Add "Continue w prior LLMs" toggle to the base Prompt Node (#168)
* Add support for "continue w prior LLM" toggle on base Prompt Node

* Fix anthropic chat bug

* Detect immediate prompt chaining, and show cont LLM toggle in that case

* Update react build and package
2023-11-19 18:49:52 -05:00
ianarawjo
f7be853554
Add a Split Node (#167)
* Add a split node

* Repair damage to model settings schema

* cleanup

* Fix bug w warning msg in Split node

* Bug fix removing LLM meta key

* Rebuild react and package

* Add markdown parser package dependency
2023-11-19 10:59:37 -05:00
Ian Arawjo
5319f8b5a1 Lock OpenAI package to 3.3.0 2023-11-17 08:56:18 -05:00
Ian Arawjo
4ba0a9f998 Fix bug with new OpenAI models 2023-11-17 08:54:17 -05:00
ianarawjo
0b32792d07
Add newest GPT-4 models (#153) 2023-11-15 13:51:36 -05:00
Ian Arawjo
c5088527bb Remove custom provider MIME type check 2023-11-12 15:45:25 -05:00
ianarawjo
e456ce6f1c
Right-click to Duplicate (v0.2.6.7) (#150)
* Auto-change shortname upon model settings edit

* Adding context menu to nodes on right-click

* Add BaseNode and subclass all CF nodes with BaseNode component

* Add BaseNode to CSVNode

* Move HF and Aleph up in LLM list.

* Rebuild react
2023-11-08 19:11:01 -05:00
ianarawjo
136fe70458
Merge PRs adding two new default HF models and Zoom add node fix (#148)
* Add more recent hf models (#147)

* support zoom (#146)

* Update package version and rebuild react

---------

Co-authored-by: Victor Muštar <victor.mustar@gmail.com>
Co-authored-by: zhaoolee <zhaoolee@gmail.com>
2023-11-06 08:44:38 -05:00
Ian Arawjo
2be5a0a5e5 Add build/ folder back to git repo v0.2.6.5 2023-10-23 16:51:54 -04:00
Ian Arawjo
c1ae6e5319 Escape braces in join node output 2023-10-23 16:43:21 -04:00
Ian Arawjo
e58526f569 Merge branch 'join-node' 2023-10-23 15:13:37 -04:00
ianarawjo
b448e300c5
Add Join node (#144)
* Add Join node

* Bug fix chat histories with undefined content in messages

* Slightly decrease TF width
2023-10-23 15:12:13 -04:00
Ian Arawjo
087ee7578d Rebuild react and update package version 2023-10-23 15:08:11 -04:00
Ian Arawjo
f20ff5534c revert tf width 2023-10-23 14:58:36 -04:00
Ian Arawjo
978214c697 minor tweaks join node 2023-10-23 14:54:54 -04:00
Ian Arawjo
469cfd1604 Add numbered list item 2023-10-22 10:51:14 -04:00
Ian Arawjo
30a099bf20 Reorganize join node logic 2023-10-19 12:37:50 -04:00
Ian Arawjo
9c7b36fa7e Bug fix chat histories with undefined content in messages 2023-10-18 14:30:44 -04:00
Ian Arawjo
061f467e82 more wip 2023-10-16 21:59:31 -04:00
Ian Arawjo
6675189424 edge cases 2023-10-16 14:29:05 -04:00
Ian Arawjo
095d77a71b join node wip 2023-10-16 11:54:51 -04:00
Ian Arawjo
d8e734d778 wip join node UI 2023-10-13 13:13:51 -04:00
ianarawjo
beeffd0ebb
Better edges, ReactFlow v11, AlephAlpha integration, better .gitignores (#139)
* add aleph alpha to installg guide description

* add aleph alpha to settings to add key

* add settings for alephalpha

* add aleph alpha to models

* add aleph alpha api key to keymap

* no visible changes, removed console.log

* current working copy

* added settings for aleph alpha, added test, working api request

* removed console log

* added static build with Aleph Alpha integration

* added static build with Aleph Alpha integration

* Corrected from ALEPH_ALPHA_KEY to ALEPH_ALPHA_API_KEY

* add additional settings requested

* merge conflicts

* add build to gitignore, best practice, reduces conflicts

* remove empty lines

* Delete chainforge/react-server/build directory

build directory should not be in remote

* remove unnecessary changes

* Update backend.ts

* ...

* fixed import

* add aleph alpha to store, remove available llms from modelsettings, remove double palm key input from globalsettings

* Update to ReactFlow v11

* Add remove button to edge on hover

* Quality of life improvements (#133)

* Quality of life improvements for node and python

* Pinned minor version for mantine modules

* Updated package-lock.json

* Added .gitignore to react-server

* Updated .gitignore to python module

---------

Co-authored-by: ianarawjo <fatso784@gmail.com>

* update gitignore

* Minor fixes to AlephAlpha integration code

* Tested npm i and rebuilt react

* Force commit the react build

* Update package version

---------

Co-authored-by: Denise Wagenführ <denise.wagenfuehr@capgemini.com>
Co-authored-by: fguderia <falko.guderian@capgemini.com>
Co-authored-by: denise710 <53524926+denise710@users.noreply.github.com>
Co-authored-by: wday-cs <119377799+wday-cs@users.noreply.github.com>
2023-09-25 09:44:18 -04:00
ianarawjo
41bfef557a
Update README.md - add new BibTeX to arXiv 2023-09-19 09:01:18 -04:00