ChainForge/chainforge/oaievals/poker_analysis.cforge

1 line
384 KiB
Plaintext
Raw Permalink Normal View History

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
{"flow": {"nodes": [{"width": 312, "height": 311, "id": "prompt-poker_analysis", "type": "prompt", "data": {"prompt": "{prompt}", "n": 1, "llms": [{"key": "aa3c0f03-22bd-416e-af4d-4bf5c4278c99", "settings": {"system_msg": "TASK: You will prompted with a texas hold'em hand. Which player has the highest probability of winning the hand? Answer with exactly one number 1-9 and no additional information or context.", "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": "TASK: You will prompted with a texas hold'em hand. Which player has the highest probability of winning the hand? Answer with exactly one number 1-9 and no additional information or context.", "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-poker_analysis", "type": "evaluator", "data": {"code": "function evaluate(response) {\n\tlet ideal = response.meta['Ideal'];\n\treturn response.text.startsWith(ideal);\n}", "language": "javascript"}, "position": {"x": 820, "y": 150}, "positionAbsolute": {"x": 820, "y": 150}}, {"width": 228, "height": 196, "id": "vis-poker_analysis", "type": "vis", "data": {"input": "eval-poker_analysis"}, "position": {"x": 1200, "y": 250}, "positionAbsolute": {"x": 1200, "y": 250}}, {"width": 302, "height": 260, "id": "inspect-poker_analysis", "type": "inspect", "data": {"input": "prompt-poker_analysis"}, "position": {"x": 820, "y": 400}, "positionAbsolute": {"x": 820, "y": 400}}, {"width": 423, "height": 417, "id": "table-poker_analysis", "type": "table", "data": {"rows": [{"prompt": "Player 1 Hole: (4h, 7h), Player 2 Hole: (4d, Js), Player 3 Hole: (3d, 6h), Player 4 Hole: (Kd, 8d), Player 5 Hole: (7c, 9d), Community: Th, 8c, 2s", "ideal": "4"}, {"prompt": "Player 1 Hole: (6h, 9c), Player 2 Hole: (Ts, 4s), Community: Tc, 9d, 7s, 4d", "ideal": "2"}, {"prompt": "Player 1 Hole: (3h, 4d), Player 2 Hole: (2c, Ac), Player 3 Hole: (Kd, Td), Player 4 Hole: (Jc, 9h), Player 5 Hole: (Tc, 6d), Player 6 Hole: (5d, 5c), Community: Th, Kc, As, 2h, Qh", "ideal": "4"}, {"prompt": "Player 1 Hole: (6h, Qh), Player 2 Hole: (3d, 9s), Player 3 Hole: (Ah, 5s), Player 4 Hole: (Qd, Kh), Player 5 Hole: (5c, Jd), Player 6 Hole: (Ks, Jc), Player 7 Hole: (8h, Ac), Community: Qs, 6s, Tc, 9d, 5h", "ideal": "6"}, {"prompt": "Player 1 Hole: (3h, Th), Player 2 Hole: (Kc, 6d), Player 3 Hole: (2h, Ts), Player 4 Hole: (Ad, 9c), Player 5 Hole: (Tc, 2c), Player 6 Hole: (3s, 5s), Player 7 Hole: (Qd, Qh), Player 8 Hole: (5c, 8c), Player 9 Hole: (8d, Ks), Community: Ac, Jd, 8h", "ideal": "4"}, {"prompt": "Player 1 Hole: (6c, 3s), Player 2 Hole: (4d, Td), Player 3 Hole: (Ts, 3d), Player 4 Hole: (5h, 7c), Player 5 Hole: (7d, Qc), Community: Qh, As, 6h, Tc", "ideal": "5"}, {"prompt": "Player 1 Hole: (4s, 7c), Player 2 Hole: (9h, 9d), Player 3 Hole: (3c, 4d), Player 4 Hole: (4h, Ac), Player 5 Hole: (As, 5c), Player 6 Hole: (9c, 8s), Player 7 Hole: (7d, Ad), Player 8 Hole: (Qc, 2c), Community: 7s, Tc, Ts, 6h", "ideal": "6"}, {"prompt": "Player 1 Hole: (Kh, 8h), Player 2 Hole: (2c, Ah), Player 3 Hole: (5s, Kd), Player 4 Hole: (2s, Ks), Player 5 Hole: (Jd, Qs), Player 6 Hole: (Tc, 9c), Player 7 Hole: (8s, 7s), Community: 7c, Kc, 7d", "ideal": "7"}, {"prompt": "Player 1 Hole: (Qd, 5d), Player 2 Hole: (Th, Tc), Player 3 Hole: (3s, Js), Player 4 Hole: (5c, Td), Player 5 Hole: (8c, 7h), Player 6 Hole: (3c, Jc), Player 7 Hole: (Ac, 4d), Player 8 Hole: (Qc, Ah), Player 9 Hole: (9h, Ks), Community: 8h, 6h, Ad", "ideal": "8"}, {"prompt": "Player 1 Hole: (6s, 2s), Player 2 Hole: (Tc, Jc), Player 3 Hole: (Td, Ah), Player 4 Hole: (9h, 4d), Community: 6h, 5d, Th, 7s", "ideal": "3"}, {"prompt": "Player 1 Hol