13 Commits

Author SHA1 Message Date
ianarawjo
ff813c7255
Revamped Example Flows (#316)
* Fix Try Me button spacing

* Added new examples

* Updated package version
2024-12-27 18:47:32 -05:00
ianarawjo
1641abe975
Structured outputs support for Ollama, OpenAI, and Anthropic models (#313)
* Add structured outputs support for OpenAI and Ollama

* Extract outputs from tool_calls and refusal in OpenAI API responses

* Add tool use for Anthropic API. Add new Anthropic models.

* Add num_ctx to Ollama API call

* Update package version

* Update function calling example
2024-12-16 16:24:55 -05:00
ianarawjo
bdfeb5c26f
Add human ratings to inspectors (#244)
* Add human ratings to inspectors

* Store human labels in cache, not resp objs

* Change rating UI to pull from Zustand store

* Lazy load inspectors

* Update version and rebuild app
2024-03-14 13:02:47 -04:00
ianarawjo
7e1f43688f
"Small" changes (#213)
* Remove notification dots

* Add batch uids to response objects.

* Regroup responses by batch ids in inspectors. Add batch ids to resp objs. Update examples.

* Bug fix: clear RF state first before loading a flow

* Add random sample toggle to Tabular Data node

* Make sample UI loc conditional on num cols and fit nicer into whitespace

* Adds 'settings template vars' to parametrize on model settings.

* Typecast settings vars params

* Rebuild app and update version
2024-01-19 20:23:24 -05:00
ianarawjo
0134dbf59b
Custom providers (#122)
* Removed Python backend files that are no longer used (everything in `promptengine`)

* Added `providers` subdomain, with `CustomProviderProtocol`, `provider` decorator, and global singleton `ProviderRegistry`

* Added a tab for custom providers, and a dropzone, in ChainForge global settings UI

* List custom providers in the Global Settings screen once added. 

* Added ability to remove custom providers by clicking X. 

* Make custom funcs sync but call them async'ly.

* Add Cohere custom provider example in examples/

*Cache the custom provider scripts and load them upon page load

* Rebuild react and update package version

* Bug fix when custom provider is deleted and settings screen is opened on the deleted custom provider
2023-08-27 15:11:42 -04:00
ianarawjo
f43861f075
Add Simple Eval Node. Other minor UI improvements. (#121)
* Add red dot in Inspect Responses footer to indicate something changed

* Abstract out inspect footer button to component

* Add tooltips to AddNode menu items.

* Simple eval wip

* Add menu sections to Add Node. Minor tweaks to simple eval.

* Save state of simple eval when editing fields

* Add 'only show scores' toggle to response inspector

* Change 2 example flows to use simple evals. Fix bg of toolbar buttons.

* Update version and rebuild react
2023-08-19 16:50:11 -04:00
ianarawjo
f7fab1d76d
Update 0.2.5: Add Chat Turns, LLM Scorers (#109)
* Add LLM scorer node (#107)

* Modularize the LLM list container, extracting it from prompt node

* Working LLM scorer node

* Bug and minor fixes

* Change modals to use perc left. 

* Add inspect response footer to LLMEvalNode.

* Make Play buttons light green

* Fix React errors w keys in JSX arrays

* Add Chat Turn node and support for chat history (#108)

* Adds chat_history across backend's cache and querying mechanisms.

* Adds Chat Turn nodes, which allow for continuing a conversation.

* Adds automatic conversions of ChatHistory (in OpenAI format) to Anthropic and Google PaLM's chat formats. Converts chat history to appropriate format and passes it as context in the API call.

* Bug fix and error popup when missing past convo in Chat Turn

* Bug squashing to progress in chat turn node

* bug squashing

* Color false scores bright red in eval inspector

* fix tooltip when cont chat present

* Rebuild react

* bug fix llm eval node

* Add HF chat model support.

* Show multiple response objs in table inspector view

* Fix LLM item deletion bug

* Rebuild react and update package version

* Fix obscure bug when LLM outputs have no 'llm' property (due to prior CF version)

* Fix isLooselyEqual bug

* Update examples so that their cached 'fields' include llm nicknames

* rebuild react

* Add Chelse to readme
2023-07-26 12:06:09 -04:00
ianarawjo
3657609c32
Add prompt preview tooltip, add ability to disable textfields selectively, bug fixes (#97)
* Add tooltip to prompt preview button

* Focus scrollwheel on textfields textareas

* Replace escaped { and } with their bare versions

* Escape braces in tabular data by default. Ignore empty rows.

* Add ability to disable fields on textfields

* Make sure deleting a field deletes its fields_visibility

* Add withinPortal to Tooltips on side-buttons in text fields

* Add Anthropic model Claude-2.
2023-07-12 17:12:16 -04:00
ianarawjo
b33397930b
TypeScript backend, HuggingFace models, JavaScript evaluators, Comment Nodes, and more (#81)
* Beginning to convert Python backend to Typescript

* Change all fetch() calls to fetch_from_backend switcher

* wip converting query.py to query.ts

* wip started utils.js conversion. Tested that OpenAI API call works

* more progress on converting utils.py to Typescript

* jest tests for query, utils, template.ts. Confirmed PromptPipeline works.

* wip converting queryLLM in flask_app to TS

* Tested queryLLM and StorageCache compressed saving/loading

* wip execute() in backend.ts

* Added execute() and tested w concrete func. Need to test eval()

* Added craco for optional webpack config. Config'd for TypeScript with Node.js packages browserify'd

* Execute JS code on iframe sandbox

* Tested and working JS Evaluator execution.

* wip swapping backends

* Tested TypeScript backendgit status! :) woot

* Added fetchEnvironAPIKeys to Flask server to fetch os.environ keys when running locally

* Route Anthropic calls through Flask when running locally

* Added info button to Eval nodes. Rebuilt react

* Edits to info modal on Eval node

* Remove/error out on Python eval nodes when not running locally.

* Check browser compat and display error if not supported

* Changed all example flows to use JS. Bug fix in query.ts

* Refactored to LLMProvider to streamline model additions

* Added HuggingFace models API

* Added back Dalai call support, routing through Flask

* Remove flask app calls and socketio server that are no longer used

* Added Comment Nodes. Rebuilt react.

* Fix PaLM temp=0 build, update package vers and rebuild react
2023-06-30 15:11:20 -04:00
ianarawjo
ea3d730bba
Merge 0.1.7 (#76)
* Added asMarkdownAST to ResponseInfo

* Increased margin between LLM responses in response inspector

* Added Inspect Results footer to eval node after run

* Fixed bug when cacheing responses after deleting a model and adding a new one

* Fixed bug in catching error in PromptTemplate's `is_concrete()` method

* Improvements to response inspector UI

* Ensured eval results (scores) are sorted alongside their responses the response inspector UI

* Removed response previews footer, replaced with Inspect responses button

* Prompt and eval nodes now load cached responses upon initialization

* Rebuilt React and raised package version
2023-06-21 10:05:46 -04:00
ianarawjo
e5b940b96b
Add basic support for OpenAI function calls (#73)
* Also includes start of categorical variables support in vis node

* Collapses same model responses (within `n` responses requested) and provides number of times they appeared

* Adds basic support for OpenAI function calls.

* Adds example flow illustrating OpenAI func calls
2023-06-13 17:33:15 -04:00
ianarawjo
915f30988d
v0.1.5: Tabular Data Node, Evaluator Print Output (#66)
* Use Mantine Textarea controlled for Textfields node, instead of textarea

* Added Tabular data node

* TabularData context menus

* Make TabularData template hooks responsive to column name changes.

* Reduced spacing between template hooks

* Better table styling and rename column popup

* Add 'carry with' feature to Prompt Permutation recursive generation using `associate_id`

* Much nicer var tags on inspect window

* Nicer styling for LLM group headers in inspect screen

* Pass metavars around in the backend to surface them to front-end

* Set min-height on inspect node to be larger

* Added in-line print in Eval nodes

* Append error message to print output

* Minor inspect node CSS tweaks and fixes

* Removed mix-blend-mode due to performance issues scrolling large text

* Added ground truth eval example for math problems

* Updated React build and version number
2023-06-11 11:48:27 -04:00
ianarawjo
c6da2314e7
Add Example flows pane and other minor improvements (#59)
* Example flows pane.

* Better Add+ Node UI.

* Added system message comparison example (see .

* Let user switch to gpt4 if initial model is gpt3.5
2023-06-03 14:32:37 -04:00