1 line
22 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-chess", "type": "prompt", "data": {"prompt": "{prompt}", "n": 1, "llms": [{"key": "aa3c0f03-22bd-416e-af4d-4bf5c4278c99", "settings": {"system_msg": "TASK: Read the chess position provided in FEN-notation, then identify the best move to the board position below, in the format A. Your answer should only contain the letter of the correct move. Do not provide any further explanation.", "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: Read the chess position provided in FEN-notation, then identify the best move to the board position below, in the format A. Your answer should only contain the letter of the correct move. Do not provide any further explanation.", "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-chess", "type": "evaluator", "data": {"code": "function evaluate(response) {\n\tlet txt = response.text;\n\tlet ideal = response.meta['Ideal'];\n\treturn ideal.includes(txt) || txt.includes(ideal);\n}", "language": "javascript"}, "position": {"x": 820, "y": 150}, "positionAbsolute": {"x": 820, "y": 150}}, {"width": 228, "height": 196, "id": "vis-chess", "type": "vis", "data": {"input": "eval-chess"}, "position": {"x": 1200, "y": 250}, "positionAbsolute": {"x": 1200, "y": 250}}, {"width": 302, "height": 260, "id": "inspect-chess", "type": "inspect", "data": {"input": "prompt-chess"}, "position": {"x": 820, "y": 400}, "positionAbsolute": {"x": 820, "y": 400}}, {"width": 423, "height": 417, "id": "table-chess", "type": "table", "data": {"rows": [{"prompt": "White to move FEN: 2r3k1/p1q2ppp/1p3n2/1Q2p3/2P5/6P1/P4PKP/3R4 Possible Moves: A: f4, B: Rd2, C: Kg1, D: Qb2 Answer only with the letter of the beset move.", "ideal": "D"}, {"prompt": "Black to move FEN: r1bq1rk1/pp5p/3pp1p1/2p1b2p/2P1P2P/3PQ3/PP3P2/RNB2RK1 Possible Moves: A: h8, B: Qxh4, C: Kg7, D: Bxb2 Answer only with the letter of the beset move.", "ideal": "B"}, {"prompt": "White to move FEN: r12k5/4b3/1p4p1/p3P2p/PP3P1P/2P2KP1/8/8 Possible Moves: A: Ke4, B: g4, C: c3, D: bxa Answer only with the letter of the beset move.", "ideal": "D"}, {"prompt": "White to move FEN: 4r1k1/5pp1/2Nq3p/3PnQ2/8/6PP/5P2/3R2K1 Possible Moves: A: Qf4, B: Kh1, C: Nxe5, D: Rd3 Answer only with the letter of the beset move.", "ideal": "A"}, {"prompt": "Black to move FEN: r3r1k1/p2QBp2/1p4pp/2p1b3/2q1P3/P1P5/1P3PPP/3RR1K1 Possible Moves: A: Qxe8, B: Kh1, C: Qb3, D: Rd3 Answer only with the letter of the beset move.", "ideal": "C"}, {"prompt": "Black to move FEN: 4rqk1/ppp2pp1/5nnp/2b1r3/4N3/P1P2Q1P/1PB2PP1/R1B1R1K1 Possible Moves: A: Nh4, B: R5e6, C: Bxh6, D: Rd1 Answer only with the letter of the beset move.", "ideal": "A"}, {"prompt": "White to move FEN: r3k2r/1b2ppb1/pq1p3p/1pn4P/4P1n1/P1NBBN2/1PP1Q1P1/3R1RK1 Possible Moves: A: Nd5, B: Bxc5, C: g3, D: Bd4 Answer only with the letter of the beset move.", "ideal": "D"}, {"prompt": "Black to move FEN: 2r2bkr/p5p1/1q2pBpp/2p1P3/2Pp1R2/5Q2/PP3PPP/R5K1 Possible Moves: A: Kh7, B: gxf6, C: g3, D: Qe3 Answer only with the letter of the beset move.", "ideal": "B"}, {"prompt": "Black to move FEN: 2r2bkr/p7/1q2pRpp/2p1P3/2Pp4/5Q2/PP3PPP/R5K1 Possible Moves: A: Qxb2, B: Bg7, C: Rh7, D: a6 Answer only with the letter of the beset move.", "ideal": "C"}, {"prompt": "Black to move FEN: 2r4r/p4Qbk/1q2p1Rp/2p1P3/2Pp4/8/PP3PPP/R5K1 Possible Moves: A: Rhg8, B: a6, C: h5, D: d3 Answer only with the letter of the beset move.", "ideal": "A"}, {"prompt": "Black to move FEN: r5k1/4ppb1/p2p3p/1p5P/1P6/P1R2N2/2P2KP1/8 Possible Moves: A: Rd8, B: Bh8, C: h5, D: Bxc3 Answer only with the letter of the