-
Notifications
You must be signed in to change notification settings - Fork 0
/
TEMPO-LangFlow.json
1 lines (1 loc) · 20.1 KB
/
TEMPO-LangFlow.json
1
{"description":"Initial implementation","name":"TEMPO v3 public","id":"19","data":{"nodes":[{"width":384,"height":351,"id":"dndnode_18","type":"genericNode","position":{"x":2349.912410645471,"y":835.2558951435733},"data":{"type":"ZeroShotAgent","node":{"template":{"llm_chain":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"llm_chain","type":"LLMChain","list":false},"allowed_tools":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"allowed_tools","type":"Tool","list":true},"_type":"ZeroShotAgent"},"description":"Agent for the MRKL chain.","base_classes":["BaseSingleActionAgent","Agent","ZeroShotAgent","function"]},"id":"dndnode_18","value":null},"positionAbsolute":{"x":2349.912410645471,"y":835.2558951435733},"selected":false,"dragging":false},{"width":384,"height":443,"id":"dndnode_19","type":"genericNode","position":{"x":366.472985640361,"y":590.4951481202195},"data":{"type":"ZeroShotPrompt","node":{"template":{"prefix":{"required":false,"placeholder":"","show":true,"multiline":true,"value":"Handle the user input as best you can with the tools provided. \n\nALWAYS use the the searchTEMPO tool at the beginning of every interaction. This contains your most recent conversations with the user and is crucial for forming the context for your future responses. \n\nALWAYS save every message with the saveTEMPO tool. Never try to store a memory as a key-value pair or in a dictionary format.\n\nAfter using searchTEMPO, if you are missing crucial information that is not general information (historical events, information about celebrities, scientific facts, etc.), you may use the searchREMO tool to check your long-term memory. Do not use searchREMO unnecessarily as it is time consuming. For example, if I ask what year a president took office, you should just answer and NOT use searchREMO. If you are still unable to find relevant information, make an educated guess, but make it clear that you are guessing.\n\nIf the user says to organize or maintain your memories, use maintainTree. \n\nIf the user says to rebuild your tree, use rebuildTree.","password":false,"name":"prefix","type":"str","list":false},"suffix":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"Always respond in the following format. Begin!\n\nInput: {input}\n\nThought: {agent_scratchpad}","password":false,"name":"suffix","type":"str","list":false},"format_instructions":{"required":false,"placeholder":"","show":false,"multiline":false,"value":"Use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, should be one of [{tool_names}]\nAction Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question","password":false,"name":"format_instructions","type":"str","list":false},"_type":"zero_shot"},"description":"Prompt template for Zero Shot Agent.","base_classes":["BasePromptTemplate"]},"id":"dndnode_19","value":null},"selected":false,"positionAbsolute":{"x":366.472985640361,"y":590.4951481202195},"dragging":false},{"width":384,"height":715,"id":"dndnode_20","type":"genericNode","position":{"x":357.7699264883603,"y":1106.4597920954975},"data":{"type":"ChatOpenAI","node":{"template":{"verbose":{"required":false,"placeholder":"","show":false,"multiline":false,"value":false,"password":false,"name":"verbose","type":"bool","list":false},"client":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"client","type":"Any","list":false},"model_name":{"required":false,"placeholder":"","show":true,"multiline":false,"value":"gpt-4","password":false,"options":["gpt-3.5-turbo","gpt-4","gpt-4-32k"],"name":"model_name","type":"str","list":true},"temperature":{"required":false,"placeholder":"","show":true,"multiline":false,"value":0.7,"password":false,"name":"temperature","type":"float","list":false},"model_kwargs":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"model_kwargs","type":"code","list":false},"openai_api_key":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"","password":true,"name":"openai_api_key","display_name":"OpenAI API Key","type":"str","list":false},"openai_organization":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"openai_organization","type":"str","list":false},"request_timeout":{"required":false,"placeholder":"","show":false,"multiline":false,"value":60,"password":false,"name":"request_timeout","type":"int","list":false},"max_retries":{"required":false,"placeholder":"","show":false,"multiline":false,"value":6,"password":false,"name":"max_retries","type":"int","list":false},"streaming":{"required":false,"placeholder":"","show":false,"multiline":false,"value":false,"password":false,"name":"streaming","type":"bool","list":false},"n":{"required":false,"placeholder":"","show":false,"multiline":false,"value":1,"password":false,"name":"n","type":"int","list":false},"max_tokens":{"required":false,"placeholder":"","show":true,"multiline":false,"password":true,"name":"max_tokens","type":"int","list":false,"value":""},"_type":"ChatOpenAI"},"description":"Wrapper around OpenAI Chat large language models.To use, you should have the ``openai`` python package installed, and theenvironment variable ``OPENAI_API_KEY`` set with your API key.Any parameters that are valid to be passed to the openai.create call can be passedin, even if not explicitly saved on this class.","base_classes":["ChatOpenAI","BaseLanguageModel","BaseChatModel"]},"id":"dndnode_20","value":null},"selected":false,"positionAbsolute":{"x":357.7699264883603,"y":1106.4597920954975},"dragging":false},{"width":384,"height":349,"id":"dndnode_25","type":"genericNode","position":{"x":1270.385068858966,"y":336.3913446161787},"data":{"type":"PythonFunction","node":{"template":{"code":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"# use this method to save a memory with a POST request to the REMO API\ndef python_function(memory: str) -> str:\n \n # Step 1: format the memory for url encoding\n from urllib.parse import quote\n formatted_memory = quote(memory)\n \n # Step 2: create an integer timestamp\n import time\n timestamp = int(time.time())\n \n # Step 3: Send the POST request to REMO to save the memory\n import requests\n response = requests.post(f\"http://localhost:8001/memorize?message={formatted_memory}&speaker=User×tamp={timestamp}\")\n \n # Step 4: report that the memory has been successfully saved\n return f\"The following memory has been saved with TEMPO: {memory}.\"","password":false,"name":"code","type":"code","list":false},"_type":"python_function"},"description":"Python function to be executed.","base_classes":["function"]},"id":"dndnode_25","value":null},"selected":false,"positionAbsolute":{"x":1270.385068858966,"y":336.3913446161787},"dragging":false},{"width":384,"height":391,"id":"dndnode_28","type":"genericNode","position":{"x":801.2910433183426,"y":836.4908096550795},"data":{"type":"LLMChain","node":{"template":{"memory":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"memory","type":"BaseMemory","list":false},"verbose":{"required":false,"placeholder":"","show":false,"multiline":false,"value":false,"password":false,"name":"verbose","type":"bool","list":false},"prompt":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"prompt","type":"BasePromptTemplate","list":false},"llm":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"llm","type":"BaseLanguageModel","list":false},"output_key":{"required":false,"placeholder":"","show":false,"multiline":false,"value":"text","password":false,"name":"output_key","type":"str","list":false},"_type":"LLMChain"},"description":"Chain to run queries against LLMs.","base_classes":["LLMChain","Chain"]},"id":"dndnode_28","value":null},"selected":false,"positionAbsolute":{"x":801.2910433183426,"y":836.4908096550795},"dragging":false},{"width":384,"height":463,"id":"dndnode_29","type":"genericNode","position":{"x":1682.5800726922546,"y":299.62470953228785},"data":{"type":"Tool","node":{"template":{"name":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"saveTEMPO","password":false,"name":"name","type":"str","list":false},"description":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"Saves messages into the AI assistant's memory system.","password":false,"name":"description","type":"str","list":false},"func":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"func","type":"function","list":false},"_type":"Tool"},"description":"","base_classes":["Tool"]},"id":"dndnode_29","value":null},"selected":false,"positionAbsolute":{"x":1682.5800726922546,"y":299.62470953228785},"dragging":false},{"width":384,"height":463,"id":"dndnode_30","type":"genericNode","position":{"x":1681.5006312831342,"y":1272.5985117314463},"data":{"type":"Tool","node":{"template":{"name":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"searchREMO","password":false,"name":"name","type":"str","list":false},"description":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"Searches for information gained through user interaction saved in the AI assistant's permanent memory.","password":false,"name":"description","type":"str","list":false},"func":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"func","type":"function","list":false},"_type":"Tool"},"description":"","base_classes":["Tool"]},"id":"dndnode_30","value":null},"selected":false,"positionAbsolute":{"x":1681.5006312831342,"y":1272.5985117314463},"dragging":false},{"width":384,"height":349,"id":"dndnode_31","type":"genericNode","position":{"x":1276.581719217875,"y":1307.9643132760382},"data":{"type":"PythonFunction","node":{"template":{"code":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"# use this method to search for a memory with a GET request to the REMO API\ndef python_function(memory: str) -> str:\n \n # Step 1: format the memory for url encoding\n from urllib.parse import quote\n formatted_memory = quote(memory)\n \n # Step 2: Send the GET request to REMO to search for the memory\n import requests\n response = requests.get(f\"http://localhost:8000/search?query={formatted_memory}\")\n \n # Step 3: Return the found memory\n return f'I have found this memory in REMO: {response.json()[\"results\"][0]}'","password":false,"name":"code","type":"code","list":false},"_type":"python_function"},"description":"Python function to be executed.","base_classes":["function"]},"id":"dndnode_31","value":null},"selected":false,"positionAbsolute":{"x":1276.581719217875,"y":1307.9643132760382},"dragging":false},{"width":384,"height":463,"id":"dndnode_48","type":"genericNode","position":{"x":1685.145026862405,"y":778.5263089298232},"data":{"type":"Tool","node":{"template":{"name":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"maintainTree","password":false,"name":"name","type":"str","list":false},"description":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"Maintains and organizes the AI assistant's permanent memories","password":false,"name":"description","type":"str","list":false},"func":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"func","type":"function","list":false},"_type":"Tool"},"description":"","base_classes":["Tool"]},"id":"dndnode_48","value":null},"selected":false,"positionAbsolute":{"x":1685.145026862405,"y":778.5263089298232},"dragging":false},{"width":384,"height":349,"id":"dndnode_49","type":"genericNode","position":{"x":1273.337293140082,"y":825.0056456888752},"data":{"type":"PythonFunction","node":{"template":{"code":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"# Maintain memories by making a POST request to the REMO API\ndef python_function(memory: str) -> str:\n \n # Step 1: Send POST request to the REMO API to organize memories\n import requests \n requests.post(\"http://localhost:8000/maintain_tree\")\n \n # Step 2: Report that maintain_tree has been triggered successfully\n return 'Memories in REMO have been successfully organized.'","password":false,"name":"code","type":"code","list":false},"_type":"python_function"},"description":"Python function to be executed.","base_classes":["function"]},"id":"dndnode_49","value":null},"selected":false,"positionAbsolute":{"x":1273.337293140082,"y":825.0056456888752},"dragging":false},{"width":384,"height":463,"id":"dndnode_50","type":"genericNode","position":{"x":1680.717285794281,"y":-182.31846101901237},"data":{"type":"Tool","node":{"template":{"name":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"rebuildTree","password":false,"name":"name","type":"str","list":false},"description":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"Recrreates the memory tree of the AI assistant's permanent memory. This may need to run when the agent can't find a certain memory.","password":false,"name":"description","type":"str","list":false},"func":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"func","type":"function","list":false},"_type":"Tool"},"description":"","base_classes":["Tool"]},"id":"dndnode_50","value":null},"selected":false,"positionAbsolute":{"x":1680.717285794281,"y":-182.31846101901237},"dragging":false},{"width":384,"height":349,"id":"dndnode_51","type":"genericNode","position":{"x":1271.4087077228264,"y":-158.29310615192855},"data":{"type":"PythonFunction","node":{"template":{"code":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"# Use this method to rebuild memories by making a POST request to the REMO API\ndef python_function(memory: str) -> str:\n \n # Step 1: Send POST request to the REMO API to rebuild memories\n import requests \n requests.post(\"http://localhost:8000/rebuild_tree\")\n \n # Step 2: Report that rebuild_tree has been triggered successfully\n return 'Memory tree in REMO has been successfully rebuilt.'","password":false,"name":"code","type":"code","list":false},"_type":"python_function"},"description":"Python function to be executed.","base_classes":["function"]},"id":"dndnode_51","value":null},"selected":false,"positionAbsolute":{"x":1271.4087077228264,"y":-158.29310615192855},"dragging":false},{"width":384,"height":463,"id":"dndnode_57","type":"genericNode","position":{"x":1683.9753506409602,"y":1760.5839168727557},"data":{"type":"Tool","node":{"template":{"name":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"searchTEMPO","password":false,"name":"name","type":"str","list":false},"description":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"This tool should be the first thing used when communicating with the user.","password":false,"name":"description","type":"str","list":false},"func":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"func","type":"function","list":false},"_type":"Tool"},"description":"","base_classes":["Tool"]},"id":"dndnode_57","value":null},"selected":false,"positionAbsolute":{"x":1683.9753506409602,"y":1760.5839168727557},"dragging":false},{"width":384,"height":349,"id":"dndnode_58","type":"genericNode","position":{"x":1275.9753506409602,"y":1794.5839168727555},"data":{"type":"PythonFunction","node":{"template":{"code":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"# Use this to search for memories in TEMPO\ndef python_function(text: str) -> str:\n \n # Step 1: Send the GET request to TEMPO to retrieve most recent memories\n import requests\n response = requests.get(f\"http://localhost:8001/remember\")\n \n # Step 2: Determine if memories have been found\n result = response.json()[\"results\"]\n if not result:\n return \"I couldn't find anything in TEMPO. I need to use searchREMO now.\"\n else:\n return f\"I found these memories in TEMPO:\\n{result}\"\n ","password":false,"name":"code","type":"code","list":false},"_type":"python_function"},"description":"Python function to be executed.","base_classes":["function"]},"id":"dndnode_58","value":null},"selected":true,"positionAbsolute":{"x":1275.9753506409602,"y":1794.5839168727555},"dragging":false}],"edges":[{"source":"dndnode_19","sourceHandle":"ZeroShotPrompt|dndnode_19|BasePromptTemplate","target":"dndnode_28","targetHandle":"BasePromptTemplate|prompt|dndnode_28","className":"animate-pulse","id":"reactflow__edge-dndnode_19ZeroShotPrompt|dndnode_19|BasePromptTemplate-dndnode_28BasePromptTemplate|prompt|dndnode_28"},{"source":"dndnode_20","sourceHandle":"ChatOpenAI|dndnode_20|ChatOpenAI|BaseLanguageModel|BaseChatModel","target":"dndnode_28","targetHandle":"BaseLanguageModel|llm|dndnode_28","className":"animate-pulse","id":"reactflow__edge-dndnode_20ChatOpenAI|dndnode_20|ChatOpenAI|BaseLanguageModel|BaseChatModel-dndnode_28BaseLanguageModel|llm|dndnode_28"},{"source":"dndnode_28","sourceHandle":"LLMChain|dndnode_28|LLMChain|Chain","target":"dndnode_18","targetHandle":"LLMChain|llm_chain|dndnode_18","className":"animate-pulse","id":"reactflow__edge-dndnode_28LLMChain|dndnode_28|LLMChain|Chain-dndnode_18LLMChain|llm_chain|dndnode_18"},{"source":"dndnode_25","sourceHandle":"PythonFunction|dndnode_25|function","target":"dndnode_29","targetHandle":"function|func|dndnode_29","className":"animate-pulse","id":"reactflow__edge-dndnode_25PythonFunction|dndnode_25|function-dndnode_29function|func|dndnode_29"},{"source":"dndnode_31","sourceHandle":"PythonFunction|dndnode_31|function","target":"dndnode_30","targetHandle":"function|func|dndnode_30","className":"animate-pulse","id":"reactflow__edge-dndnode_31PythonFunction|dndnode_31|function-dndnode_30function|func|dndnode_30"},{"source":"dndnode_29","sourceHandle":"Tool|dndnode_29|Tool","target":"dndnode_18","targetHandle":"Tool|allowed_tools|dndnode_18","className":"animate-pulse","id":"reactflow__edge-dndnode_29Tool|dndnode_29|Tool-dndnode_18Tool|allowed_tools|dndnode_18"},{"source":"dndnode_30","sourceHandle":"Tool|dndnode_30|Tool","target":"dndnode_18","targetHandle":"Tool|allowed_tools|dndnode_18","className":"animate-pulse","id":"reactflow__edge-dndnode_30Tool|dndnode_30|Tool-dndnode_18Tool|allowed_tools|dndnode_18","selected":false},{"source":"dndnode_48","sourceHandle":"Tool|dndnode_48|Tool","target":"dndnode_18","targetHandle":"Tool|allowed_tools|dndnode_18","className":"animate-pulse","id":"reactflow__edge-dndnode_48Tool|dndnode_48|Tool-dndnode_18Tool|allowed_tools|dndnode_18"},{"source":"dndnode_49","sourceHandle":"PythonFunction|dndnode_49|function","target":"dndnode_48","targetHandle":"function|func|dndnode_48","className":"animate-pulse","id":"reactflow__edge-dndnode_49PythonFunction|dndnode_49|function-dndnode_48function|func|dndnode_48"},{"source":"dndnode_51","sourceHandle":"PythonFunction|dndnode_51|function","target":"dndnode_50","targetHandle":"function|func|dndnode_50","className":"animate-pulse","id":"reactflow__edge-dndnode_51PythonFunction|dndnode_51|function-dndnode_50function|func|dndnode_50"},{"source":"dndnode_50","sourceHandle":"Tool|dndnode_50|Tool","target":"dndnode_18","targetHandle":"Tool|allowed_tools|dndnode_18","className":"animate-pulse","id":"reactflow__edge-dndnode_50Tool|dndnode_50|Tool-dndnode_18Tool|allowed_tools|dndnode_18"},{"source":"dndnode_58","sourceHandle":"PythonFunction|dndnode_58|function","target":"dndnode_57","targetHandle":"function|func|dndnode_57","className":"animate-pulse","id":"reactflow__edge-dndnode_58PythonFunction|dndnode_58|function-dndnode_57function|func|dndnode_57"},{"source":"dndnode_57","sourceHandle":"Tool|dndnode_57|Tool","target":"dndnode_18","targetHandle":"Tool|allowed_tools|dndnode_18","className":"animate-pulse","id":"reactflow__edge-dndnode_57Tool|dndnode_57|Tool-dndnode_18Tool|allowed_tools|dndnode_18"}],"viewport":{"x":679.7161099742443,"y":109.2768784583676,"zoom":0.5}},"chat":[]}