ChainForge/chainforge/oaievals/points-on-line.cforge
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

1 line
12 KiB
Plaintext

{"flow": {"nodes": [{"width": 312, "height": 311, "id": "prompt-points-on-line", "type": "prompt", "data": {"prompt": "{prompt}", "n": 1, "llms": [{"key": "aa3c0f03-22bd-416e-af4d-4bf5c4278c99", "settings": {"system_msg": "You will be provided with the end points of a line in 3 dimensions. Please calculate and return only the midpoint of this line, in this format: (x, y, z)", "temperature": 1, "functions": [], "function_call": "", "top_p": 1, "stop": [], "presence_penalty": 0, "frequency_penalty": 0}, "name": "GPT3.5", "emoji": "\ud83d\ude42", "model": "gpt-3.5-turbo", "base_model": "gpt-3.5-turbo", "temp": 1, "formData": {"shortname": "GPT3.5", "model": "gpt-3.5-turbo", "system_msg": "You will be provided with the end points of a line in 3 dimensions. Please calculate and return only the midpoint of this line, in this format: (x, y, z)", "temperature": 1, "functions": "", "function_call": "", "top_p": 1, "stop": "", "presence_penalty": 0, "frequency_penalty": 0}}]}, "position": {"x": 448, "y": 224}, "selected": false, "positionAbsolute": {"x": 448, "y": 224}, "dragging": false}, {"width": 333, "height": 182, "id": "eval-points-on-line", "type": "evaluator", "data": {"code": "function evaluate(response) {\n\tlet ideal = response.meta['Ideal'];\n\treturn response.text.includes(ideal);\n}", "language": "javascript"}, "position": {"x": 820, "y": 150}, "positionAbsolute": {"x": 820, "y": 150}}, {"width": 228, "height": 196, "id": "vis-points-on-line", "type": "vis", "data": {"input": "eval-points-on-line"}, "position": {"x": 1200, "y": 250}, "positionAbsolute": {"x": 1200, "y": 250}}, {"width": 302, "height": 260, "id": "inspect-points-on-line", "type": "inspect", "data": {"input": "prompt-points-on-line"}, "position": {"x": 820, "y": 400}, "positionAbsolute": {"x": 820, "y": 400}}, {"width": 423, "height": 417, "id": "table-points-on-line", "type": "table", "data": {"rows": [{"prompt": "(4.10, -4.98, -6.99), (14.28, -23.12, 4.89)", "ideal": "(9.19, -14.05, -1.05)"}, {"prompt": "(-1.98, -5.97, -9.94), (-21.94, -19.87, 2.02)", "ideal": "(-11.96, -12.92, -3.96)"}, {"prompt": "(2.09, 9.92, 1.06), (4.13, 27.90, -5.14)", "ideal": "(3.11, 18.91, -2.04)"}, {"prompt": "(7.07, -1.05, 0.94), (-13.07, -11.17, 17.10)", "ideal": "(-3.00, -6.11, 9.02)"}, {"prompt": "(6.90, 4.92, 1.93), (0.74, -11.14, -4.11)", "ideal": "(3.82, -3.11, -1.09)"}, {"prompt": "(-3.96, 9.93, -3.97), (-21.84, 15.81, -8.03)", "ideal": "(-12.90, 12.87, -6.00)"}, {"prompt": "(-1.90, -3.06, 0.96), (-3.84, -2.94, -19.08)", "ideal": "(-2.87, -3.00, -9.06)"}, {"prompt": "(-4.05, -5.06, -1.95), (7.91, -17.06, -21.95)", "ideal": "(1.93, -11.06, -11.95)"}, {"prompt": "(-2.92, -8.00, 8.90), (-14.90, -5.92, 1.04)", "ideal": "(-8.91, -6.96, 4.97)"}, {"prompt": "(2.01, 1.07, -10.05), (15.81, -0.89, -18.13)", "ideal": "(8.91, 0.09, -14.09)"}, {"prompt": "(-1.00, -1.93, -0.97), (16.88, 16.19, -6.99)", "ideal": "(7.94, 7.13, -3.98)"}, {"prompt": "(9.93, 7.05, 4.06), (15.77, -10.79, 11.90)", "ideal": "(12.85, -1.87, 7.98)"}, {"prompt": "(6.08, -1.10, -3.06), (6.12, -1.16, 5.04)", "ideal": "(6.10, -1.13, 0.99)"}, {"prompt": "(7.94, 7.04, 7.97), (3.88, 5.08, -2.17)", "ideal": "(5.91, 6.06, 2.90)"}, {"prompt": "(-4.92, -1.09, -10.03), (0.92, -18.95, -10.01)", "ideal": "(-2.00, -10.02, -10.02)"}, {"prompt": "(3.09, -9.01, 8.99), (-14.93, 5.13, 22.85)", "ideal": "(-5.92, -1.94, 15.92)"}, {"prompt": "(-8.99, -3.03, -0.08), (-17.01, -9.13, -6.20)", "ideal": "(-13.00, -6.08, -3.14)"}, {"prompt": "(-7.07, 6.97, -2.98), (-13.15, 7.07, -14.90)", "ideal": "(-10.11, 7.02, -8.94)"}, {"prompt": "(10.00, 5.01, -2.00), (1.82, -3.15, -3.96)", "ideal": "(5.91, 0.93, -2.98)"}, {"prompt": "(-5.95, 3.00, 0.03), (-10.03, -14.88, 6.19)", "ideal": "(-7.99, -5.94, 3.11)"}, {"prompt": "(-0.92, -2.07, 9.06), (9.20, -10.09, 29.00)", "ideal": "(4.14, -6.08, 19.03)"}, {"prompt": "(-9.03, 5.91, 8.95), (8.95, 1.95, 1.11)", "ideal": "(-0.04, 3.93, 5.03)"}, {"prompt": "(-9.91, -3.09, -5.98), (-18.01, 17.09, 2.12)", "ideal": "(-13.96, 7.00, -1.93)"}, {"prompt": "(-7.04, 6.94, 5.02), (-14.90, 12.98, 3.02)", "ideal": "(-10.97, 9.96, 4.02)"}, {"prompt": "(-1.91, 2.03, 5.02), (-11.97, 2.09, -9.12)", "ideal": "(-6.94, 2.06, -2.05)"}, {"prompt": "(0.94, 5.95, -1.99), (-13.26, 26.03, -16.07)", "ideal": "(-6.16, 15.99, -9.03)"}, {"prompt": "(-5.94, -2.07, -5.07), (-23.88, 7.93, -13.17)", "ideal": "(-14.91, 2.93, -9.12)"}, {"prompt": "(1.92, 5.05, 9.09), (17.82, -4.75, 23.13)", "ideal": "(9.87, 0.15, 16.11)"}, {"prompt": "(-9.08, 2.91, -0.97), (-27.20, -1.09, -14.95)", "ideal": "(-18.14, 0.91, -7.96)"}, {"prompt": "(9.01, -5.98, 7.10), (22.95, 10.16, 0.94)", "ideal": "(15.98, 2.09, 4.02)"}, {"prompt": "(2.07, 5.10, 5.91), (13.95, 9.08, 19.71)", "ideal": "(8.01, 7.09, 12.81)"}, {"prompt": "(0.06, 7.06, 6.06), (-15.88, 15.02, 0.06)", "ideal": "(-7.91, 11.04, 3.06)"}, {"prompt": "(-2.99, 0.01, 4.99), (-13.13, 8.07, 12.99)", "ideal": "(-8.06, 4.04, 8.99)"}, {"prompt": "(-2.01, -3.03, -7.06), (-9.89, -19.21, 0.84)", "ideal": "(-5.95, -11.12, -3.11)"}, {"prompt": "(-6.08, 4.97, 5.99), (12.08, 10.93, 23.79)", "ideal": "(3.00, 7.95, 14.89)"}, {"prompt": "(7.09, 0.97, -1.04), (-6.85, -14.89, -11.20)", "ideal": "(0.12, -6.96, -6.12)"}, {"prompt": "(-8.91, -9.93, 10.10), (-17.09, -7.85, 4.16)", "ideal": "(-13.00, -8.89, 7.13)"}, {"prompt": "(3.02, 9.10, 7.02), (-11.02, 9.16, 8.86)", "ideal": "(-4.00, 9.13, 7.94)"}, {"prompt": "(1.91, 4.99, -3.93), (7.89, -6.95, 0.17)", "ideal": "(4.90, -0.98, -1.88)"}, {"prompt": "(-3.09, -5.99, -1.93), (-7.25, -10.05, -10.09)", "ideal": "(-5.17, -8.02, -6.01)"}, {"prompt": "(-9.02, 6.01, -3.02), (-17.16, 20.15, -13.04)", "ideal": "(-13.09, 13.08, -8.03)"}, {"prompt": "(-1.05, -5.05, -8.04), (9.05, -21.07, -17.98)", "ideal": "(4.00, -13.06, -13.01)"}, {"prompt": "(0.98, -5.99, -1.93), (-4.98, -19.81, -11.73)", "ideal": "(-2.00, -12.90, -6.83)"}, {"prompt": "(6.05, 6.00, -7.97), (20.07, 3.98, -21.83)", "ideal": "(13.06, 4.99, -14.90)"}, {"prompt": "(2.07, 7.03, 2.09), (22.17, 24.95, -8.09)", "ideal": "(12.12, 15.99, -3.00)"}, {"prompt": "(0.00, 10.07, 0.04), (10.00, 3.89, 6.02)", "ideal": "(5.00, 6.98, 3.03)"}, {"prompt": "(5.94, -8.95, -0.90), (19.90, -1.09, -0.80)", "ideal": "(12.92, -5.02, -0.85)"}, {"prompt": "(-6.97, -0.02, -2.06), (-17.01, -0.20, 17.86)", "ideal": "(-11.99, -0.11, 7.90)"}, {"prompt": "(-2.93, -3.04, -10.06), (-23.09, 11.02, -29.90)", "ideal": "(-13.01, 3.99, -19.98)"}, {"prompt": "(1.96, -1.92, 4.00), (7.98, 10.16, -7.96)", "ideal": "(4.97, 4.12, -1.98)"}, {"prompt": "(8.09, 1.07, -9.05), (8.17, 4.91, 5.15)", "ideal": "(8.13, 2.99, -1.95)"}, {"prompt": "(2.06, 0.93, -0.08), (-7.86, 4.91, 16.12)", "ideal": "(-2.90, 2.92, 8.02)"}, {"prompt": "(10.04, -1.97, 9.95), (7.92, 8.13, 1.95)", "ideal": "(8.98, 3.08, 5.95)"}, {"prompt": "(9.01, 8.04, 8.10), (8.85, 27.94, 22.18)", "ideal": "(8.93, 17.99, 15.14)"}, {"prompt": "(10.05, -6.96, -3.92), (7.93, -19.08, -3.76)", "ideal": "(8.99, -13.02, -3.84)"}, {"prompt": "(-7.97, -1.06, -10.08), (8.15, 2.80, -5.98)", "ideal": "(0.09, 0.87, -8.03)"}, {"prompt": "(-0.91, 4.07, -4.97), (19.23, 8.17, 5.11)", "ideal": "(9.16, 6.12, 0.07)"}, {"prompt": "(-3.03, -6.99, 1.05), (12.81, -25.15, -9.11)", "ideal": "(4.89, -16.07, -4.03)"}, {"prompt": "(-8.01, -4.10, 3.96), (10.03, -6.00, 11.80)", "ideal": "(1.01, -5.05, 7.88)"}, {"prompt": "(3.03, 1.92, -9.01), (-4.93, 11.90, -14.83)", "ideal": "(-0.95, 6.91, -11.92)"}, {"prompt": "(-3.92, 3.08, -6.08), (6.22, -3.04, 12.00)", "ideal": "(1.15, 0.02, 2.96)"}, {"prompt": "(7.99, -8.00, -0.03), (15.97, -28.00, -4.03)", "ideal": "(11.98, -18.00, -2.03)"}, {"prompt": "(1.93, -8.03, 0.00), (11.87, -20.11, -6.00)", "ideal": "(6.90, -14.07, -3.00)"}, {"prompt": "(6.09, 5.98, -10.09), (-11.99, 11.88, -12.25)", "ideal": "(-2.95, 8.93, -11.17)"}, {"prompt": "(4.05, 4.93, 4.92), (2.25, -6.97, -5.24)", "ideal": "(3.15, -1.02, -0.16)"}, {"prompt": "(3.10, 4.96, -10.06), (17.12, -13.06, 4.14)", "ideal": "(10.11, -4.05, -2.96)"}, {"prompt": "(-4.01, 8.01, 8.96), (0.15, 6.21, 8.92)", "ideal": "(-1.93, 7.11, 8.94)"}, {"prompt": "(-0.07, 10.07, 2.03), (-12.13, -4.09, -3.85)", "ideal": "(-6.10, 2.99, -0.91)"}, {"prompt": "(2.96, -3.06, 4.02), (-4.90, -5.12, 13.94)", "ideal": "(-0.97, -4.09, 8.98)"}, {"prompt": "(0.96, 1.08, -0.98), (2.92, 15.04, 12.94)", "ideal": "(1.94, 8.06, 5.98)"}, {"prompt": "(4.06, 4.07, -4.92), (7.96, 20.25, -2.90)", "ideal": "(6.01, 12.16, -3.91)"}, {"prompt": "(-3.09, 1.99, 5.92), (-13.09, 22.11, 19.78)", "ideal": "(-8.09, 12.05, 12.85)"}, {"prompt": "(-2.97, -7.06, -7.92), (9.01, -5.14, -20.04)", "ideal": "(3.02, -6.10, -13.98)"}, {"prompt": "(-10.04, -4.94, -3.98), (-30.22, -14.76, 10.06)", "ideal": "(-20.13, -9.85, 3.04)"}, {"prompt": "(8.95, -5.92, -3.90), (-8.87, -13.86, -19.86)", "ideal": "(0.04, -9.89, -11.88)"}, {"prompt": "(-9.07, 3.95, 0.02), (3.11, -6.19, -10.16)", "ideal": "(-2.98, -1.12, -5.07)"}, {"prompt": "(-0.09, -8.04, 6.97), (11.99, -5.94, -4.85)", "ideal": "(5.95, -6.99, 1.06)"}, {"prompt": "(-5.04, -5.00, -0.04), (-2.86, -6.80, -18.00)", "ideal": "(-3.95, -5.90, -9.02)"}, {"prompt": "(-6.96, 3.98, -7.09), (-0.92, 1.78, 5.01)", "ideal": "(-3.94, 2.88, -1.04)"}, {"prompt": "(10.01, -5.94, 7.02), (-4.15, -8.06, 9.00)", "ideal": "(2.93, -7.00, 8.01)"}, {"prompt": "(-2.93, -1.92, -5.96), (-16.83, -13.86, 11.92)", "ideal": "(-9.88, -7.89, 2.98)"}, {"prompt": "(-3.97, -4.09, -2.07), (-7.87, -23.93, 3.99)", "ideal": "(-5.92, -14.01, 0.96)"}, {"prompt": "(-5.92, 1.92, 1.08), (14.16, 19.74, 9.28)", "ideal": "(4.12, 10.83, 5.18)"}, {"prompt": "(6.08, -4.06, 6.09), (-0.08, 3.96, 25.93)", "ideal": "(3.00, -0.05, 16.01)"}, {"prompt": "(3.97, 5.01, -6.93), (23.79, 2.85, 13.05)", "ideal": "(13.88, 3.93, 3.06)"}, {"prompt": "(-6.02, -4.95, 10.05), (-13.86, 9.17, -9.85)", "ideal": "(-9.94, 2.11, 0.10)"}, {"prompt": "(-1.01, 8.98, 0.03), (-21.15, 11.08, -15.85)", "ideal": "(-11.08, 10.03, -7.91)"}, {"prompt": "(0.98, 9.03, -1.95), (13.14, 11.07, 14.13)", "ideal": "(7.06, 10.05, 6.09)"}, {"prompt": "(-8.95, 1.01, -5.06), (-22.95, -2.81, -20.96)", "ideal": "(-15.95, -0.90, -13.01)"}, {"prompt": "(6.95, -6.94, 7.91), (26.99, 7.14, 11.91)", "ideal": "(16.97, 0.10, 9.91)"}, {"prompt": "(-0.08, 7.08, 9.94), (-20.12, 9.00, 22.12)", "ideal": "(-10.10, 8.04, 16.03)"}, {"prompt": "(-6.03, 3.08, 0.08), (12.05, 11.00, -7.84)", "ideal": "(3.01, 7.04, -3.88)"}, {"prompt": "(3.02, -10.06, -5.05), (-17.14, -12.04, -5.11)", "ideal": "(-7.06, -11.05, -5.08)"}, {"prompt": "(1.06, 5.05, -10.09), (9.02, 7.11, -11.91)", "ideal": "(5.04, 6.08, -11.00)"}, {"prompt": "(-2.03, 7.08, -6.08), (-6.03, 25.20, -18.14)", "ideal": "(-4.03, 16.14, -12.11)"}, {"prompt": "(-8.05, 7.97, 3.95), (-24.09, 6.09, -8.07)", "ideal": "(-16.07, 7.03, -2.06)"}, {"prompt": "(-0.03, -4.07, 10.06), (13.83, 15.81, 26.26)", "ideal": "(6.90, 5.87, 18.16)"}, {"prompt": "(-3.08, 1.05, 3.03), (-14.90, 19.03, 3.11)", "ideal": "(-8.99, 10.04, 3.07)"}, {"prompt": "(-9.92, 7.96, 5.98), (-5.88, 1.94, -14.22)", "ideal": "(-7.90, 4.95, -4.12)"}, {"prompt": "(-8.97, 7.97, 4.08), (7.03, 6.13, 20.18)", "ideal": "(-0.97, 7.05, 12.13)"}], "columns": [{"key": "prompt", "header": "Prompt"}, {"key": "ideal", "header": "Ideal"}]}, "position": {"x": -16, "y": 160}, "selected": false, "positionAbsolute": {"x": -16, "y": 160}, "dragging": false}], "edges": [{"source": "prompt-points-on-line", "sourceHandle": "prompt", "target": "eval-points-on-line", "targetHandle": "responseBatch", "interactionWidth": 100, "markerEnd": {"type": "arrow", "width": "22px", "height": "22px"}, "id": "reactflow__edge-prompt-1686756357355prompt-eval-1686756357355responseBatch"}, {"source": "prompt-points-on-line", "sourceHandle": "prompt", "target": "inspect-points-on-line", "targetHandle": "input", "interactionWidth": 100, "markerEnd": {"type": "arrow", "width": "22px", "height": "22px"}, "id": "reactflow__edge-prompt-1686756357355prompt-inspect-1686756357355input"}, {"source": "eval-points-on-line", "sourceHandle": "output", "target": "vis-points-on-line", "targetHandle": "input", "interactionWidth": 100, "markerEnd": {"type": "arrow", "width": "22px", "height": "22px"}, "id": "reactflow__edge-eval-1686756357355output-vis-1686756357355input"}, {"source": "table-points-on-line", "sourceHandle": "Prompt", "target": "prompt-points-on-line", "targetHandle": "prompt", "interactionWidth": 100, "markerEnd": {"type": "arrow", "width": "22px", "height": "22px"}, "id": "reactflow__edge-table-1686756385002Prompt-prompt-1686756357355prompt"}], "viewport": {"x": 144, "y": 37, "zoom": 1}}, "cache": {"eval-1686756357355.json": {}, "inspect-1686756357355.json": {}, "prompt-1686756357355.json": {}, "table-1686756385002.json": {}, "vis-1686756357355.json": {}}}