ChainForge/chainforge/oaievals/last-word-nth.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
23 KiB
Plaintext

{"flow": {"nodes": [{"width": 312, "height": 311, "id": "prompt-last-word-nth", "type": "prompt", "data": {"prompt": "{prompt}", "n": 1, "llms": [{"key": "aa3c0f03-22bd-416e-af4d-4bf5c4278c99", "settings": {"system_msg": "You are a helpful assistant.", "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 helpful assistant.", "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-last-word-nth", "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-last-word-nth", "type": "vis", "data": {"input": "eval-last-word-nth"}, "position": {"x": 1200, "y": 250}, "positionAbsolute": {"x": 1200, "y": 250}}, {"width": 302, "height": 260, "id": "inspect-last-word-nth", "type": "inspect", "data": {"input": "prompt-last-word-nth"}, "position": {"x": 820, "y": 400}, "positionAbsolute": {"x": 820, "y": 400}}, {"width": 423, "height": 417, "id": "table-last-word-nth", "type": "table", "data": {"rows": [{"prompt": "What is the 4th word in \"I am a programmer\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "programmer"}, {"prompt": "What is the 11th word in \"Today is a beautiful day becasue I will go to paris\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "paris"}, {"prompt": "What is the 4th word in \"What is your name\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "name"}, {"prompt": "pip install pre-commit; pre-commit install Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "garden"}, {"prompt": "What is the 5th word in \"It was a sunny day\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "day"}, {"prompt": "What is the 9th word in \"The sky was blue and the birds were singing\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "singing"}, {"prompt": "What is the 5th word in \"The wind was blowing softly\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "softly"}, {"prompt": "What is the 6th word in \"I heard a car passing by\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "by"}, {"prompt": "What is the 5th word in \"I walked down the street\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "street"}, {"prompt": "What is the 5th word in \"I saw a small dog\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "dog"}, {"prompt": "What is the 6th word in \"He was playing with a ball\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "ball"}, {"prompt": "What is the 5th word in \"I stopped to pet him\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "him"}, {"prompt": "What is the 4th word in \"He was so cute\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "cute"}, {"prompt": "What is the 5th word in \"The sun was shining brightly\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "brightly"}, {"prompt": "What is the 7th word in \"The trees were swaying in the wind\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "wind"}, {"prompt": "What is the 5th word in \"I went to the park\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "park"}, {"prompt": "What is the 5th word in \"The grass was so green\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "green"}, {"prompt": "What is the 8th word in \"I saw a couple walking hand in hand\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "hand"}, {"prompt": "What is the 5th word in \"They were smiling and laughing\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "laughing"}, {"prompt": "What is the 5th word in \"It was a lovely sight\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "sight"}, {"prompt": "What is the 6th word in \"I watched them for a while\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "while"}, {"prompt": "What is the 5th word in \"There was a fountain nearby\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "nearby"}, {"prompt": "What is the 7th word in \"The water was sparkling in the sunlight\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "sunlight"}, {"prompt": "What is the 6th word in \"I decided to take a walk\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "walk"}, {"prompt": "What is the 8th word in \"The path was wide and lined with trees\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "trees"}, {"prompt": "What is the 4th word in \"I passed a playground\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "playground"}, {"prompt": "What is the 5th word in \"Children were playing and laughing\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "laughing"}, {"prompt": "What is the 6th word in \"I could hear their joyful voices\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "voices"}, {"prompt": "What is the 7th word in \"The path was leading to a lake\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "lake"}, {"prompt": "What is the 6th word in \"The lake was calm and peaceful\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "peaceful"}, {"prompt": "What is the 8th word in \"I could see ducks swimming in the water\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "water"}, {"prompt": "What is the 7th word in \"The sun was setting behind the hills\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "hills"}, {"prompt": "What is the 10th word in \"The sky was painted in shades of pink and orange\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "orange"}, {"prompt": "What is the 6th word in \"The air was cool and refreshing\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "refreshing"}, {"prompt": "What is the 5th word in \"I smelled the fragrant flowers\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "flowers"}, {"prompt": "What is the 9th word in \"I continued walking and soon came to a bridge\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "bridge"}, {"prompt": "What is the 8th word in \"The bridge was arched and made of stone\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "stone"}, {"prompt": "What is the 5th word in \"It was a beautiful sight\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "sight"}, {"prompt": "What is the 6th word in \"I stopped to take a picture\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "picture"}, {"prompt": "What is the 7th word in \"The sun was low in the sky\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "sky"}, {"prompt": "What is the 9th word in \"I could see the stars twinkling in the dark\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "dark"}, {"prompt": "What is the 6th word in \"The night was silent and still\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "still"}, {"prompt": "What is the 8th word in \"I could hear the sound of the wind\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "wind"}, {"prompt": "What is the 10th word in \"I looked up at the sky and saw the moon\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "moon"}, {"prompt": "What is the 5th word in \"It was a beautiful sight\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "sight"}, {"prompt": "What is the 9th word in \"I stayed for a while and watched the stars\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "stars"}, {"prompt": "What is the 6th word in \"The night was peaceful and serene\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "serene"}, {"prompt": "What is the 10th word in \"I took a deep breath and felt the fresh air\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "air"}, {"prompt": "What is the 8th word in \"I started to feel relaxed and at peace\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "peace"}, {"prompt": "What is the 5th word in \"I decided to go home\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "home"}, {"prompt": "What is the 7th word in \"I walked back slowly and felt content\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "content"}, {"prompt": "What is the 8th word in \"I enjoyed my walk and the peaceful night\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "night"}, {"prompt": "What is the 10th word in \"I made my way back home and went to sleep\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "sleep"}, {"prompt": "What is the 9th word in \"I had a wonderful day and I was happy\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "happy"}, {"prompt": "What is the 7th word in \"I woke up early the next day\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "day"}, {"prompt": "What is the 7th word in \"I could hear the birds chirping outside\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "outside"}, {"prompt": "What is the 7th word in \"The sun was rising in the sky\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "sky"}, {"prompt": "What is the 8th word in \"The sky was a beautiful shade of blue\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "blue"}, {"prompt": "What is the 8th word in \"I went outside and took a deep breath\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "breath"}, {"prompt": "What is the 6th word in \"The air was cool and fresh\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "fresh"}, {"prompt": "What is the 8th word in \"I could smell the flowers in the garden\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "garden"}, {"prompt": "What is the 7th word in \"I started my day with a walk\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "walk"}, {"prompt": "What is the 7th word in \"I followed the path along the river\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "river"}, {"prompt": "What is the 5th word in \"The river was flowing gently\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "gently"}, {"prompt": "What is the 9th word in \"I could see the trees swaying in the breeze\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "breeze"}, {"prompt": "What is the 5th word in \"The sun was shining brightly\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "brightly"}, {"prompt": "What is the 10th word in \"I stopped to watch the ducks swimming in the water\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "water"}, {"prompt": "What is the 8th word in \"I could hear the sound of the river\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "river"}, {"prompt": "What is the 7th word in \"The path led me to a meadow\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "meadow"}, {"prompt": "What is the 6th word in \"The grass was lush and green\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "green"}, {"prompt": "What is the 4th word in \"The wildflowers were blooming\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "blooming"}, {"prompt": "What is the 8th word in \"I could see butterflies fluttering in the air\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "air"}, {"prompt": "What is the 9th word in \"I continued walking and soon came to a bridge\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "bridge"}, {"prompt": "What is the 6th word in \"It was an old wooden bridge\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "bridge"}, {"prompt": "What is the 6th word in \"I stopped to admire the view\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "view"}, {"prompt": "What is the 5th word in \"The river was flowing underneath\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "underneath"}, {"prompt": "What is the 8th word in \"I could see the mountains in the distance\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "distance"}, {"prompt": "What is the 15th word in \"The sun was setting and the sky was painted in shades of orange and pink\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "pink"}, {"prompt": "What is the 7th word in \"I watched the sunset until it disappeared\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "disappeared"}, {"prompt": "What is the 8th word in \"I turned around and started to walk back\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "back"}, {"prompt": "What is the 6th word in \"The night was silent and still\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "still"}, {"prompt": "What is the 8th word in \"I could hear the sound of the crickets\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "crickets"}, {"prompt": "What is the 11th word in \"I looked up at the sky and saw a million stars\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "stars"}, {"prompt": "What is the 6th word in \"I felt so small and insignificant\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "insignificant"}, {"prompt": "What is the 8th word in \"The night was peaceful and I felt content\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "content"}, {"prompt": "What is the 8th word in \"I went back home and went to bed\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "bed"}, {"prompt": "What is the 9th word in \"I had a wonderful day and I was happy\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "happy"}, {"prompt": "What is the 7th word in \"I woke up early the next morning\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "morning"}, {"prompt": "What is the 9th word in \"The sun was shining and the birds were chirping\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "chirping"}, {"prompt": "What is the 10th word in \"I took a deep breath and enjoyed the fresh air\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "air"}, {"prompt": "What is the 6th word in \"The sky was a bright blue\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "blue"}, {"prompt": "What is the 6th word in \"I got ready and went outside\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "outside"}, {"prompt": "What is the 7th word in \"I decided to go for a walk\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "walk"}, {"prompt": "What is the 6th word in \"The streets were quiet and peaceful\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "peaceful"}, {"prompt": "What is the 11th word in \"I looked around and saw the trees swaying in the wind\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "wind"}, {"prompt": "What is the 11th word in \"The flowers were blooming and the grass was a vibrant green\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "green"}, {"prompt": "What is the 9th word in \"I kept walking and soon came to a park\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "park"}, {"prompt": "What is the 10th word in \"The park was full of people enjoying the sunny day\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "day"}, {"prompt": "What is the 7th word in \"I saw children running around and playing\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "playing"}, {"prompt": "What is the 11th word in \"I watched them for a while and then continued my walk\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "walk"}, {"prompt": "What is the 12th word in \"I passed by a lake and saw ducks swimming in the water\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "water"}, {"prompt": "What is the 7th word in \"The lake was so peaceful and serene\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "serene"}, {"prompt": "What is the 9th word in \"I continued walking and soon came to a bridge\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "bridge"}, {"prompt": "What is the 8th word in \"The bridge was old and made of wood\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "wood"}, {"prompt": "What is the 10th word in \"I stopped to take a picture and admired the view\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "view"}, {"prompt": "What is the 15th word in \"The sun was setting and the sky was painted in shades of pink and orange\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "orange"}, {"prompt": "What is the 9th word in \"I stayed for a while and watched the sunset\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "sunset"}, {"prompt": "What is the 13th word in \"The night was peaceful and the stars were twinkling in the dark sky\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "sky"}, {"prompt": "What is the 10th word in \"I took a deep breath and felt the fresh air\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "air"}, {"prompt": "What is the 5th word in \"I decided to go home\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "home"}, {"prompt": "What is the 7th word in \"I walked back slowly and felt content\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "content"}, {"prompt": "What is the 9th word in \"I had a wonderful day and I was happy\"? Answer directly with the word, make no additional comment, don't use quotation marks.", "ideal": "happy"}], "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-last-word-nth", "sourceHandle": "prompt", "target": "eval-last-word-nth", "targetHandle": "responseBatch", "interactionWidth": 100, "markerEnd": {"type": "arrow", "width": "22px", "height": "22px"}, "id": "reactflow__edge-prompt-1686756357355prompt-eval-1686756357355responseBatch"}, {"source": "prompt-last-word-nth", "sourceHandle": "prompt", "target": "inspect-last-word-nth", "targetHandle": "input", "interactionWidth": 100, "markerEnd": {"type": "arrow", "width": "22px", "height": "22px"}, "id": "reactflow__edge-prompt-1686756357355prompt-inspect-1686756357355input"}, {"source": "eval-last-word-nth", "sourceHandle": "output", "target": "vis-last-word-nth", "targetHandle": "input", "interactionWidth": 100, "markerEnd": {"type": "arrow", "width": "22px", "height": "22px"}, "id": "reactflow__edge-eval-1686756357355output-vis-1686756357355input"}, {"source": "table-last-word-nth", "sourceHandle": "Prompt", "target": "prompt-last-word-nth", "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": {}}}