Spaces:
Running
Running
{"description":"Chain the Words, Master Language!","name":"complex_example","data":{"nodes":[{"width":384,"height":267,"id":"ZeroShotAgent-UQytQ","type":"genericNode","position":{"x":1444.3029693177525,"y":769.2195451536553},"data":{"type":"ZeroShotAgent","node":{"template":{"allowed_tools":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"allowed_tools","advanced":false,"info":"","type":"Tool","list":true},"llm_chain":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"llm_chain","advanced":false,"info":"","type":"LLMChain","list":false},"output_parser":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"output_parser","advanced":false,"info":"","type":"AgentOutputParser","list":false},"_type":"ZeroShotAgent"},"description":"Agent for the MRKL chain.","base_classes":["BaseSingleActionAgent","ZeroShotAgent","Agent","function"],"display_name":"ZeroShotAgent","documentation":"https://python.langchain.com/docs/modules/agents/how_to/custom_mrkl_agent"},"id":"ZeroShotAgent-UQytQ","value":null},"selected":false,"positionAbsolute":{"x":1444.3029693177525,"y":769.2195451536553},"dragging":false},{"width":384,"height":267,"id":"ZeroShotAgent-4Yl9Q","type":"genericNode","position":{"x":2507.5134255411913,"y":703.4268189022047},"data":{"type":"ZeroShotAgent","node":{"template":{"allowed_tools":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"allowed_tools","advanced":false,"info":"","type":"Tool","list":true},"llm_chain":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"llm_chain","advanced":false,"info":"","type":"LLMChain","list":false},"output_parser":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"output_parser","advanced":false,"info":"","type":"AgentOutputParser","list":false},"_type":"ZeroShotAgent"},"description":"Agent for the MRKL chain.","base_classes":["BaseSingleActionAgent","ZeroShotAgent","Agent","function"],"display_name":"ZeroShotAgent","documentation":"https://python.langchain.com/docs/modules/agents/how_to/custom_mrkl_agent"},"id":"ZeroShotAgent-4Yl9Q","value":null},"selected":false,"positionAbsolute":{"x":2507.5134255411913,"y":703.4268189022047},"dragging":false},{"width":384,"height":475,"id":"Tool-Ssk4g","type":"genericNode","position":{"x":1990.4155792278825,"y":894.4563316029999},"data":{"type":"Tool","node":{"template":{"func":{"required":true,"placeholder":"","show":true,"multiline":true,"password":false,"name":"func","advanced":false,"info":"","type":"function","list":false},"description":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"AgentTool","password":false,"name":"description","advanced":false,"info":"","type":"str","list":false},"name":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"AgentTool","password":false,"name":"name","advanced":false,"info":"","type":"str","list":false},"return_direct":{"required":true,"placeholder":"","show":true,"multiline":false,"value":false,"password":false,"name":"return_direct","advanced":false,"info":"","type":"bool","list":false},"_type":"Tool"},"description":"Converts a chain, agent or function into a tool.","base_classes":["Tool"],"display_name":"Tool","documentation":""},"id":"Tool-Ssk4g","value":null},"selected":false,"positionAbsolute":{"x":1990.4155792278825,"y":894.4563316029999},"dragging":false},{"width":384,"height":513,"id":"PythonFunctionTool-qSfC8","type":"genericNode","position":{"x":881.9234666781165,"y":717.4260855419674},"data":{"type":"PythonFunctionTool","node":{"template":{"code":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"\ndef python_function(text: str) -> str:\n \"\"\"This is a default python function that returns the input text\"\"\"\n return text\n","password":false,"name":"code","advanced":false,"info":"","type":"code","list":false},"description":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"Uppercases","password":false,"name":"description","advanced":false,"info":"","type":"str","list":false},"name":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"Uppercase","password":false,"name":"name","advanced":false,"info":"","type":"str","list":false},"return_direct":{"required":true,"placeholder":"","show":true,"multiline":false,"value":false,"password":false,"name":"return_direct","advanced":false,"info":"","type":"bool","list":false},"_type":"PythonFunctionTool"},"description":"Python function to be executed.","base_classes":["Tool"],"display_name":"PythonFunctionTool","documentation":""},"id":"PythonFunctionTool-qSfC8","value":null},"selected":false,"dragging":false,"positionAbsolute":{"x":881.9234666781165,"y":717.4260855419674}},{"width":384,"height":307,"id":"LLMChain-5pPr3","type":"genericNode","position":{"x":952.8848633792611,"y":205.91268432121848},"data":{"type":"LLMChain","node":{"template":{"callbacks":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"callbacks","advanced":false,"info":"","type":"langchain.callbacks.base.BaseCallbackHandler","list":true},"llm":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"llm","advanced":false,"info":"","type":"BaseLanguageModel","list":false},"memory":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"memory","advanced":false,"info":"","type":"BaseMemory","list":false},"output_parser":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"output_parser","advanced":false,"info":"","type":"BaseLLMOutputParser","list":false},"prompt":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"prompt","advanced":false,"info":"","type":"BasePromptTemplate","list":false},"llm_kwargs":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"llm_kwargs","advanced":false,"info":"","type":"code","list":false},"output_key":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"text","password":false,"name":"output_key","advanced":true,"info":"","type":"str","list":false},"return_final_only":{"required":false,"placeholder":"","show":false,"multiline":false,"value":true,"password":false,"name":"return_final_only","advanced":false,"info":"","type":"bool","list":false},"tags":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"tags","advanced":false,"info":"","type":"str","list":true},"verbose":{"required":false,"placeholder":"","show":true,"multiline":false,"value":false,"password":false,"name":"verbose","advanced":true,"info":"","type":"bool","list":false},"_type":"LLMChain"},"description":"Chain to run queries against LLMs.","base_classes":["LLMChain","Chain","function"],"display_name":"LLMChain","documentation":"https://python.langchain.com/docs/modules/chains/foundational/llm_chain"},"id":"LLMChain-5pPr3","value":null},"selected":false,"positionAbsolute":{"x":952.8848633792611,"y":205.91268432121848},"dragging":false},{"width":384,"height":421,"id":"ZeroShotPrompt-KeA26","type":"genericNode","position":{"x":284.2531445624355,"y":99.41468159745108},"data":{"type":"ZeroShotPrompt","node":{"template":{"format_instructions":{"required":true,"placeholder":"","show":true,"multiline":true,"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","advanced":false,"info":"","type":"prompt","list":false},"prefix":{"required":false,"placeholder":"","show":true,"multiline":true,"value":"Answer the following questions as best you can. You have access to the following tools:","password":false,"name":"prefix","advanced":false,"info":"","type":"prompt","list":false},"suffix":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"Begin!\n\nQuestion: {input}\nThought:{agent_scratchpad}","password":false,"name":"suffix","advanced":false,"info":"","type":"prompt","list":false},"_type":"ZeroShotPrompt"},"description":"Prompt template for Zero Shot Agent.","base_classes":["BasePromptTemplate"],"display_name":"ZeroShotPrompt","documentation":"https://python.langchain.com/docs/modules/agents/how_to/custom_mrkl_agent"},"id":"ZeroShotPrompt-KeA26","value":null},"selected":false,"positionAbsolute":{"x":284.2531445624355,"y":99.41468159745108},"dragging":false},{"width":384,"height":611,"id":"OpenAI-YKFjJ","type":"genericNode","position":{"x":151.61242562883945,"y":646.4646888408231},"data":{"type":"OpenAI","node":{"template":{"allowed_special":{"required":false,"placeholder":"","show":false,"multiline":false,"value":[],"password":false,"name":"allowed_special","advanced":false,"info":"","type":"Literal'all'","list":true},"callbacks":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"callbacks","advanced":false,"info":"","type":"langchain.callbacks.base.BaseCallbackHandler","list":true},"disallowed_special":{"required":false,"placeholder":"","show":false,"multiline":false,"value":"all","password":false,"name":"disallowed_special","advanced":false,"info":"","type":"Literal'all'","list":false},"batch_size":{"required":false,"placeholder":"","show":false,"multiline":false,"value":20,"password":false,"name":"batch_size","advanced":false,"info":"","type":"int","list":false},"best_of":{"required":false,"placeholder":"","show":false,"multiline":false,"value":1,"password":false,"name":"best_of","advanced":false,"info":"","type":"int","list":false},"cache":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"cache","advanced":false,"info":"","type":"bool","list":false},"client":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"client","advanced":false,"info":"","type":"Any","list":false},"frequency_penalty":{"required":false,"placeholder":"","show":false,"multiline":false,"value":0,"password":false,"name":"frequency_penalty","advanced":false,"info":"","type":"float","list":false},"logit_bias":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"logit_bias","advanced":false,"info":"","type":"code","list":false},"max_retries":{"required":false,"placeholder":"","show":false,"multiline":false,"value":6,"password":false,"name":"max_retries","advanced":false,"info":"","type":"int","list":false},"max_tokens":{"required":false,"placeholder":"","show":true,"multiline":false,"value":"","password":true,"name":"max_tokens","advanced":false,"info":"","type":"int","list":false},"model_kwargs":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"model_kwargs","advanced":true,"info":"","type":"code","list":false},"model_name":{"required":false,"placeholder":"","show":true,"multiline":false,"value":"text-davinci-003","password":false,"options":["text-davinci-003","text-davinci-002","text-curie-001","text-babbage-001","text-ada-001"],"name":"model_name","advanced":false,"info":"","type":"str","list":true},"n":{"required":false,"placeholder":"","show":false,"multiline":false,"value":1,"password":false,"name":"n","advanced":false,"info":"","type":"int","list":false},"openai_api_base":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"openai_api_base","display_name":"OpenAI API Base","advanced":false,"info":"\nThe base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.\n","type":"str","list":false},"openai_api_key":{"required":false,"placeholder":"","show":true,"multiline":false,"value":"","password":true,"name":"openai_api_key","display_name":"OpenAI API Key","advanced":false,"info":"","type":"str","list":false},"openai_organization":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"openai_organization","display_name":"OpenAI Organization","advanced":false,"info":"","type":"str","list":false},"openai_proxy":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"openai_proxy","display_name":"OpenAI Proxy","advanced":false,"info":"","type":"str","list":false},"presence_penalty":{"required":false,"placeholder":"","show":false,"multiline":false,"value":0,"password":false,"name":"presence_penalty","advanced":false,"info":"","type":"float","list":false},"request_timeout":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"request_timeout","advanced":false,"info":"","type":"float","list":false},"streaming":{"required":false,"placeholder":"","show":false,"multiline":false,"value":false,"password":false,"name":"streaming","advanced":false,"info":"","type":"bool","list":false},"tags":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"tags","advanced":false,"info":"","type":"str","list":true},"temperature":{"required":false,"placeholder":"","show":true,"multiline":false,"value":0.7,"password":false,"name":"temperature","advanced":false,"info":"","type":"float","list":false},"tiktoken_model_name":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"tiktoken_model_name","advanced":false,"info":"","type":"str","list":false},"top_p":{"required":false,"placeholder":"","show":false,"multiline":false,"value":1,"password":false,"name":"top_p","advanced":false,"info":"","type":"float","list":false},"verbose":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"verbose","advanced":false,"info":"","type":"bool","list":false},"_type":"OpenAI"},"description":"Wrapper around OpenAI large language models.","base_classes":["BaseOpenAI","BaseLLM","OpenAI","BaseLanguageModel"],"display_name":"OpenAI","documentation":"https://python.langchain.com/docs/modules/model_io/models/llms/integrations/openai"},"id":"OpenAI-YKFjJ","value":null},"selected":false,"positionAbsolute":{"x":151.61242562883945,"y":646.4646888408231},"dragging":false}],"edges":[{"source":"Tool-Ssk4g","sourceHandle":"Tool|Tool-Ssk4g|Tool","target":"ZeroShotAgent-4Yl9Q","targetHandle":"Tool|allowed_tools|ZeroShotAgent-4Yl9Q","style":{"stroke":"inherit"},"className":"stroke-gray-900 dark:stroke-gray-200","animated":false,"id":"reactflow__edge-Tool-Ssk4gTool|Tool-Ssk4g|Tool-ZeroShotAgent-4Yl9QTool|allowed_tools|ZeroShotAgent-4Yl9Q","selected":false},{"source":"ZeroShotAgent-UQytQ","sourceHandle":"ZeroShotAgent|ZeroShotAgent-UQytQ|BaseSingleActionAgent|ZeroShotAgent|Agent|function","target":"Tool-Ssk4g","targetHandle":"function|func|Tool-Ssk4g","style":{"stroke":"inherit"},"className":"stroke-gray-900 dark:stroke-gray-200","animated":false,"id":"reactflow__edge-ZeroShotAgent-UQytQZeroShotAgent|ZeroShotAgent-UQytQ|BaseSingleActionAgent|ZeroShotAgent|Agent|function-Tool-Ssk4gfunction|func|Tool-Ssk4g","selected":false},{"source":"PythonFunctionTool-qSfC8","sourceHandle":"PythonFunctionTool|PythonFunctionTool-qSfC8|Tool","target":"ZeroShotAgent-UQytQ","targetHandle":"Tool|allowed_tools|ZeroShotAgent-UQytQ","style":{"stroke":"inherit"},"className":"stroke-gray-900 dark:stroke-gray-200","animated":false,"id":"reactflow__edge-PythonFunctionTool-qSfC8PythonFunctionTool|PythonFunctionTool-qSfC8|Tool-ZeroShotAgent-UQytQTool|allowed_tools|ZeroShotAgent-UQytQ","selected":false},{"source":"ZeroShotPrompt-KeA26","sourceHandle":"ZeroShotPrompt|ZeroShotPrompt-KeA26|BasePromptTemplate","target":"LLMChain-5pPr3","targetHandle":"BasePromptTemplate|prompt|LLMChain-5pPr3","style":{"stroke":"inherit"},"className":"stroke-gray-900 dark:stroke-gray-200","animated":false,"id":"reactflow__edge-ZeroShotPrompt-KeA26ZeroShotPrompt|ZeroShotPrompt-KeA26|BasePromptTemplate-LLMChain-5pPr3BasePromptTemplate|prompt|LLMChain-5pPr3","selected":false},{"source":"OpenAI-YKFjJ","sourceHandle":"OpenAI|OpenAI-YKFjJ|BaseOpenAI|BaseLLM|OpenAI|BaseLanguageModel","target":"LLMChain-5pPr3","targetHandle":"BaseLanguageModel|llm|LLMChain-5pPr3","style":{"stroke":"inherit"},"className":"stroke-gray-900 dark:stroke-gray-200","animated":false,"id":"reactflow__edge-OpenAI-YKFjJOpenAI|OpenAI-YKFjJ|BaseOpenAI|BaseLLM|OpenAI|BaseLanguageModel-LLMChain-5pPr3BaseLanguageModel|llm|LLMChain-5pPr3","selected":false},{"source":"LLMChain-5pPr3","sourceHandle":"LLMChain|LLMChain-5pPr3|LLMChain|Chain|function","target":"ZeroShotAgent-4Yl9Q","targetHandle":"LLMChain|llm_chain|ZeroShotAgent-4Yl9Q","style":{"stroke":"inherit"},"className":"stroke-gray-900 dark:stroke-gray-200","animated":false,"id":"reactflow__edge-LLMChain-5pPr3LLMChain|LLMChain-5pPr3|LLMChain|Chain|function-ZeroShotAgent-4Yl9QLLMChain|llm_chain|ZeroShotAgent-4Yl9Q","selected":false},{"source":"LLMChain-5pPr3","sourceHandle":"LLMChain|LLMChain-5pPr3|LLMChain|Chain|function","target":"ZeroShotAgent-UQytQ","targetHandle":"LLMChain|llm_chain|ZeroShotAgent-UQytQ","style":{"stroke":"inherit"},"className":"stroke-gray-900 dark:stroke-gray-200","animated":false,"id":"reactflow__edge-LLMChain-5pPr3LLMChain|LLMChain-5pPr3|LLMChain|Chain|function-ZeroShotAgent-UQytQLLMChain|llm_chain|ZeroShotAgent-UQytQ","selected":false}],"viewport":{"x":-77.90141289801102,"y":58.94201890632064,"zoom":0.3906639400861592}},"id":"e5213457-cb4c-48b5-b2bf-a6bc5b63f625"} |