ChainForge/chainforge/oaievals/chess-piece-count.cforge

1 line
114 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-piece-count", "type": "prompt", "data": {"prompt": "{prompt}", "n": 1, "llms": [{"key": "aa3c0f03-22bd-416e-af4d-4bf5c4278c99", "settings": {"system_msg": "You are ChessGPT. A helpful AI chatbot that understands chess fundamental and helps people analyse their moves. Follow the instructions given to the point.", "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 are ChessGPT. A helpful AI chatbot that understands chess fundamental and helps people analyse their moves. Follow the instructions given to the point.", "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-piece-count", "type": "evaluator", "data": {"code": "function evaluate(response) {\n\tlet txt = response.text;\n\tlet ideals = JSON.parse(response.meta['Ideal']);\n\treturn ideals.some(i => (i.includes(txt) || txt.includes(i)));\n}", "language": "javascript"}, "position": {"x": 820, "y": 150}, "positionAbsolute": {"x": 820, "y": 150}}, {"width": 228, "height": 196, "id": "vis-chess-piece-count", "type": "vis", "data": {"input": "eval-chess-piece-count"}, "position": {"x": 1200, "y": 250}, "positionAbsolute": {"x": 1200, "y": 250}}, {"width": 302, "height": 260, "id": "inspect-chess-piece-count", "type": "inspect", "data": {"input": "prompt-chess-piece-count"}, "position": {"x": 820, "y": 400}, "positionAbsolute": {"x": 820, "y": 400}}, {"width": 423, "height": 417, "id": "table-chess-piece-count", "type": "table", "data": {"rows": [{"prompt": "Imagine a standard chess board and play out the following moves one by one on it as described in the PGN notation format.\nAfter playing these moves tell me the number of pieces that are left on the board.\nMoves: 1. d4 d5 2. c4 e6 3. Nf3 Nf6 4. Nc3 Bb4 5. Qa4+ Nc6 6. a3 Bxc3+ 7. bxc3 Ne4 8. cxd5 exd5 9. c4 O-O 10. e3 dxc4 11. Bxc4 Be6 12. Bb2 Bxc4 13. Qxc4 Na5 14. Qa2 c5 15. dxc5 Qd3 16. Qb1 Nxc5 17. Bd4 Rfc8 18. Qxd3 Nxd3+ 19. Ke2 Nc5 20. Bxc5 Rxc5 21. Rhc1 Rac8 22. Rxc5 Rxc5 23. Nd4 Kf8 24. g4 g6 25. h3 Ke7 26. Kd3 Nc4 27. Rb1 Nd6 28. e4 Ra5 29. Rb3 Kd7 30. f4 b6 31. Rc3 Ra4 32. e5 Nb7 33. f5 Nc5+ 34. Ke3 gxf5\nYour answer should strictly only contain a single number, no additional words.", "ideal": "[\"15\"]"}, {"prompt": "Imagine a standard chess board and play out the following moves one by one on it as described in the PGN notation format.\nAfter playing these moves tell me the number of pieces that are left on the board.\nMoves: 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c6 5. Bg5 dxc4 6. e4 b5 7. e5 h6 8. Bh4 g5 9. Nxg5 hxg5 10. Bxg5 Nbd7 11. exf6 Bb7 12. Be2 Nxf6 13. Bf3 Be7 14. Qd2 Nd5 15. Bxe7 Qxe7 16. a4 a6 17. Ne4 O-O-O 18. axb5 cxb5 19. Nc5 e5 20. Kf1 exd4 21. Nxb7 Qxb7 22. Qxd4 Qb6 23. Qxb6 Nxb6 24. Rxa6 Na4 25. g3 Nxb2 26. Kg2 Kc7 27. Rha1 Rb8 28. Rf6 Na4 29. Rd1 Rbd8 30. Rc6+ Kb8 31. Rb1 Nc3 32. Ra1 Na4 33. Ra6 Kc7 34. h4 Rd6 35. Ra7+ Kb6 36. Rb7+ Kc5 37. Rxf7 c3 38. h5 Kb4 39. g4 Kb3 40. g5 Kb2 41. Re1 c2 42. Rc7 Nc3 43. g6 Re8 44. Rxe8 c1=Q 45. Re3 b4 46. g7 Rd8\nYour answer should strictly only contain a single number, no additional words.", "ideal": "[\"12\"]"}, {"prompt": "Imagine a standard chess board and play out the following moves one by one on it as described in the PGN notation format.\nAfter playing these moves tell me the number of pieces that are left on the board.\nMoves: 1. e4 c5 2. Nf3 Nc6 3. Bb5 e6 4. O-O Nge7 5. c3 a6 6. Ba4 b5 7. Bc2 Bb7 8. Re1 g6 9. d4 cxd4 10. cxd4 Bg7 11. d5 Na5 12. d6 Nec6 13. Nbd2 g5 14. Nb3 Nxb3 15. Bxb3 g4 16. Nd2 h5 17. e5 Nxe5 18. Ne4 Bxe4 19. Rxe4 f5\nYour answer should strictly only contain a