ChainForge/chainforge/oaievals/date-calculator.cforge

1 line
8.8 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-date-calculator", "type": "prompt", "data": {"prompt": "{prompt}", "n": 1, "llms": [{"key": "aa3c0f03-22bd-416e-af4d-4bf5c4278c99", "settings": {"system_msg": "You are a date calculator. I'll give you a date in the format of month, date and year, and ask you to add or subtract days, months or years to it. You'll give me the result date in the format of mm/dd/yyyy. Respond with your date only and no other additional words.", "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 a date calculator. I'll give you a date in the format of month, date and year, and ask you to add or subtract days, months or years to it. You'll give me the result date in the format of mm/dd/yyyy. Respond with your date only and no other additional words.", "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-date-calculator", "type": "evaluator", "data": {"code": "function evaluate(response) {\n\tlet ideals = JSON.parse(response.meta['Ideal']);\n\treturn ideals.some(i => response.text.startsWith(i));\n}", "language": "javascript"}, "position": {"x": 820, "y": 150}, "positionAbsolute": {"x": 820, "y": 150}}, {"width": 228, "height": 196, "id": "vis-date-calculator", "type": "vis", "data": {"input": "eval-date-calculator"}, "position": {"x": 1200, "y": 250}, "positionAbsolute": {"x": 1200, "y": 250}}, {"width": 302, "height": 260, "id": "inspect-date-calculator", "type": "inspect", "data": {"input": "prompt-date-calculator"}, "position": {"x": 820, "y": 400}, "positionAbsolute": {"x": 820, "y": 400}}, {"width": 423, "height": 417, "id": "table-date-calculator", "type": "table", "data": {"rows": [{"prompt": "What is 4/13/2023 subtract 12 weeks?", "ideal": "[\"2/2/2022\"]"}, {"prompt": "What is 2/1/2022 add 10 weeks?", "ideal": "[\"4/12/2022\", \"04/12/2022\"]"}, {"prompt": "What is 12/15/1997 add 21 weeks?", "ideal": "[\"5/11/1998\", \"05/11/1998\"]"}, {"prompt": "What is 10/23/2008 add 35 weeks?", "ideal": "[\"6/25/2009\", \"06/25/2009\"]"}, {"prompt": "What is 01/18/1986 add 9 weeks?", "ideal": "[\"3/22/1896\", \"03/22/1896\"]"}, {"prompt": "What is 08/05/2018 add 48 weeks?", "ideal": "[\"7/7/2019\"]"}, {"prompt": "What is 11/29/2003 add 17 weeks?", "ideal": "[\"3/27/2004\", \"03/27/2004\"]"}, {"prompt": "What is 9/10/2016 add 13 weeks?", "ideal": "[\"12/10/2016\"]"}, {"prompt": "What is 05/25/2000 add 28 weeks?", "ideal": "[\"12/7/2000\"]"}, {"prompt": "What is 11/21/1994 subtract 11 weeks?", "ideal": "[\"09/05/1994\", \"9/5/1994\"]"}, {"prompt": "What is 02/17/2007 subtract 15 weeks?", "ideal": "[\"11/04/2006\", \"11/4/2006\"]"}, {"prompt": "What is 08/08/1982 subtract 6 weeks?", "ideal": "[\"06/27/1982\", \"6/27/1982\"]"}, {"prompt": "What is 10/13/2010 subtract 17 weeks?", "ideal": "[\"06/16/2010\", \"6/16/2010\"]"}, {"prompt": "What is 03/19/2001 subtract 9 weeks?", "ideal": "[\"01/15/2001\", \"1/15/2001\"]"}, {"prompt": "What is 09/06/1988 subtract 12 weeks?", "ideal": "[\"06/14/1988\", \"6/14/1988\"]"}, {"prompt": "What is 06/30/1993 subtract 45 days?", "ideal": "[\"05/16/1993\", \"5/16/1991\"]"}, {"prompt": "What is 01/23/2004 subtract 87 days?", "ideal": "[\"10/28/2003\"]"}, {"prompt": "What is 09/15/1985 subtract 14 days?", "ideal": "[\"09/01/1985\", \"9/1/1985\"]"}, {"prompt": "What is 12/12/2015 subtract 26 days?", "ideal": "[\"11/16/2015\"]"}, {"prompt": "What is 03/28/1997 subtract 40 days?", "ideal": "[\"02/16/1997\", \"2/16/1997\"]"}, {"prompt": "What is 07/19/2000 subtract 58 days?", "ideal": "[\"05/22/2000\", \"5/22/2000\"]"}, {"prompt": "What is 06/30/1993 add 245 days