🔧 chore(conftest.py): add one_grouped_chat_json_flow fixture to read and return the contents of the one_group_chat.json file 📝 chore(one_group_chat.json): add one_group_chat.json test data file This commit adds the one_group_chat.json file to the tests/data directory. The file contains a simple chat with a custom prompt template and conversational memory buffer. It is used for testing purposes. 🔧 chore: update node configuration for ConversationBufferMemory, ChatOpenAI, and LLMChain 📝 docs: update documentation links for ConversationBufferMemory and LLMChain 🔧 fix: update prompt template in LLMChain to include conversation history and text input variables 🔧 fix: update ConversationBufferMemory node to include description and documentation links 🎨 style: format and organize code for better readability and maintainability
1302 lines
No EOL
84 KiB
JSON
1302 lines
No EOL
84 KiB
JSON
{
|
|
"description": "A simple chat with a custom prompt template and conversational memory buffer",
|
|
"name": "One Group",
|
|
"data": {
|
|
"nodes": [
|
|
{
|
|
"width": 384,
|
|
"height": 485,
|
|
"data": {
|
|
"id": "LLMChain-7wD4b",
|
|
"type": "LLMChain",
|
|
"node": {
|
|
"display_name": "group Node",
|
|
"documentation": "",
|
|
"base_classes": [
|
|
"Chain",
|
|
"LLMChain",
|
|
"function"
|
|
],
|
|
"description": "double click to edit description",
|
|
"template": {
|
|
"max_tokens_ChatOpenAI-WlIXw": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"password": true,
|
|
"name": "max_tokens",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "int",
|
|
"list": false,
|
|
"proxy": {
|
|
"id": "ChatOpenAI-WlIXw",
|
|
"field": "max_tokens"
|
|
},
|
|
"display_name": "Max Tokens - ChatOpenAI",
|
|
"value": ""
|
|
},
|
|
"model_kwargs_ChatOpenAI-WlIXw": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "model_kwargs",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "code",
|
|
"list": false,
|
|
"proxy": {
|
|
"id": "ChatOpenAI-WlIXw",
|
|
"field": "model_kwargs"
|
|
},
|
|
"display_name": "Model Kwargs - ChatOpenAI"
|
|
},
|
|
"model_name_ChatOpenAI-WlIXw": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"value": "gpt-3.5-turbo",
|
|
"password": false,
|
|
"options": [
|
|
"gpt-3.5-turbo-0613",
|
|
"gpt-3.5-turbo",
|
|
"gpt-3.5-turbo-16k-0613",
|
|
"gpt-3.5-turbo-16k",
|
|
"gpt-4-0613",
|
|
"gpt-4-32k-0613",
|
|
"gpt-4",
|
|
"gpt-4-32k"
|
|
],
|
|
"name": "model_name",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": true,
|
|
"proxy": {
|
|
"id": "ChatOpenAI-WlIXw",
|
|
"field": "model_name"
|
|
},
|
|
"display_name": "Model Name - ChatOpenAI"
|
|
},
|
|
"openai_api_base_ChatOpenAI-WlIXw": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "openai_api_base",
|
|
"display_name": "OpenAI API Base - ChatOpenAI",
|
|
"advanced": true,
|
|
"dynamic": 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,
|
|
"proxy": {
|
|
"id": "ChatOpenAI-WlIXw",
|
|
"field": "openai_api_base"
|
|
}
|
|
},
|
|
"openai_api_key_ChatOpenAI-WlIXw": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"value": "test",
|
|
"password": true,
|
|
"name": "openai_api_key",
|
|
"display_name": "OpenAI API Key - ChatOpenAI",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": false,
|
|
"proxy": {
|
|
"id": "ChatOpenAI-WlIXw",
|
|
"field": "openai_api_key"
|
|
}
|
|
},
|
|
"temperature_ChatOpenAI-WlIXw": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"value": 0.7,
|
|
"password": false,
|
|
"name": "temperature",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "float",
|
|
"list": false,
|
|
"proxy": {
|
|
"id": "ChatOpenAI-WlIXw",
|
|
"field": "temperature"
|
|
},
|
|
"display_name": "Temperature - ChatOpenAI"
|
|
},
|
|
"output_key_LLMChain-qaGdJ": {
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"value": "text",
|
|
"password": false,
|
|
"name": "output_key",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": false,
|
|
"proxy": {
|
|
"id": "LLMChain-qaGdJ",
|
|
"field": "output_key"
|
|
},
|
|
"display_name": "Output Key - LLMChain"
|
|
},
|
|
"chat_memory_ConversationBufferMemory-WkJkh": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "chat_memory",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "BaseChatMessageHistory",
|
|
"list": false,
|
|
"proxy": {
|
|
"id": "ConversationBufferMemory-WkJkh",
|
|
"field": "chat_memory"
|
|
},
|
|
"display_name": "Chat Memory - ConversationBuf..."
|
|
},
|
|
"input_key_ConversationBufferMemory-WkJkh": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"value": "",
|
|
"password": false,
|
|
"name": "input_key",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "The variable to be used as Chat Input when more than one variable is available.",
|
|
"type": "str",
|
|
"list": false,
|
|
"proxy": {
|
|
"id": "ConversationBufferMemory-WkJkh",
|
|
"field": "input_key"
|
|
},
|
|
"display_name": "Input Key - ConversationBuf..."
|
|
},
|
|
"memory_key_ConversationBufferMemory-WkJkh": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"value": "history",
|
|
"password": false,
|
|
"name": "memory_key",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": false,
|
|
"proxy": {
|
|
"id": "ConversationBufferMemory-WkJkh",
|
|
"field": "memory_key"
|
|
},
|
|
"display_name": "Memory Key - ConversationBuf..."
|
|
},
|
|
"output_key_ConversationBufferMemory-WkJkh": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"value": "",
|
|
"password": false,
|
|
"name": "output_key",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "The variable to be used as Chat Output (e.g. answer in a ConversationalRetrievalChain)",
|
|
"type": "str",
|
|
"list": false,
|
|
"proxy": {
|
|
"id": "ConversationBufferMemory-WkJkh",
|
|
"field": "output_key"
|
|
},
|
|
"display_name": "Output Key - ConversationBuf..."
|
|
},
|
|
"return_messages_ConversationBufferMemory-WkJkh": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "return_messages",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "bool",
|
|
"list": false,
|
|
"proxy": {
|
|
"id": "ConversationBufferMemory-WkJkh",
|
|
"field": "return_messages"
|
|
},
|
|
"display_name": "Return Messages - ConversationBuf..."
|
|
},
|
|
"template_PromptTemplate-h1IlH": {
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": true,
|
|
"password": false,
|
|
"name": "template",
|
|
"advanced": false,
|
|
"dynamic": true,
|
|
"info": "",
|
|
"type": "prompt",
|
|
"list": false,
|
|
"value": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n\nCurrent conversation:\n\n{history}\nHuman: {text}\nAI:",
|
|
"proxy": {
|
|
"id": "PromptTemplate-h1IlH",
|
|
"field": "template"
|
|
},
|
|
"display_name": "Template - PromptTemplate"
|
|
},
|
|
"history_PromptTemplate-h1IlH": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": true,
|
|
"value": "",
|
|
"password": false,
|
|
"name": "history",
|
|
"display_name": "history - PromptTemplate",
|
|
"advanced": false,
|
|
"input_types": [
|
|
"Document",
|
|
"BaseOutputParser"
|
|
],
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": false,
|
|
"proxy": {
|
|
"id": "PromptTemplate-h1IlH",
|
|
"field": "history"
|
|
}
|
|
},
|
|
"text_PromptTemplate-h1IlH": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": true,
|
|
"value": "",
|
|
"password": false,
|
|
"name": "text",
|
|
"display_name": "text - PromptTemplate",
|
|
"advanced": false,
|
|
"input_types": [
|
|
"Document",
|
|
"BaseOutputParser"
|
|
],
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": false,
|
|
"proxy": {
|
|
"id": "PromptTemplate-h1IlH",
|
|
"field": "text"
|
|
}
|
|
}
|
|
},
|
|
"flow": {
|
|
"data": {
|
|
"nodes": [
|
|
{
|
|
"width": 384,
|
|
"height": 621,
|
|
"id": "ChatOpenAI-WlIXw",
|
|
"type": "genericNode",
|
|
"position": {
|
|
"x": 170.87326389541306,
|
|
"y": 465.8628482073749
|
|
},
|
|
"data": {
|
|
"type": "ChatOpenAI",
|
|
"node": {
|
|
"template": {
|
|
"callbacks": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "callbacks",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "langchain.callbacks.base.BaseCallbackHandler",
|
|
"list": true
|
|
},
|
|
"cache": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "cache",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "bool",
|
|
"list": false
|
|
},
|
|
"client": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "client",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "Any",
|
|
"list": false
|
|
},
|
|
"max_retries": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"value": 6,
|
|
"password": false,
|
|
"name": "max_retries",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "int",
|
|
"list": false
|
|
},
|
|
"max_tokens": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"password": true,
|
|
"name": "max_tokens",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "int",
|
|
"list": false
|
|
},
|
|
"metadata": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "metadata",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "code",
|
|
"list": false
|
|
},
|
|
"model_kwargs": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "model_kwargs",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "code",
|
|
"list": false
|
|
},
|
|
"model_name": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"value": "gpt-3.5-turbo",
|
|
"password": false,
|
|
"options": [
|
|
"gpt-3.5-turbo-0613",
|
|
"gpt-3.5-turbo",
|
|
"gpt-3.5-turbo-16k-0613",
|
|
"gpt-3.5-turbo-16k",
|
|
"gpt-4-0613",
|
|
"gpt-4-32k-0613",
|
|
"gpt-4",
|
|
"gpt-4-32k"
|
|
],
|
|
"name": "model_name",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": true
|
|
},
|
|
"n": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"value": 1,
|
|
"password": false,
|
|
"name": "n",
|
|
"advanced": false,
|
|
"dynamic": 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,
|
|
"dynamic": 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,
|
|
"dynamic": 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,
|
|
"dynamic": 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,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": false
|
|
},
|
|
"request_timeout": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "request_timeout",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "float",
|
|
"list": false,
|
|
"value": 60
|
|
},
|
|
"streaming": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"value": false,
|
|
"password": false,
|
|
"name": "streaming",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "bool",
|
|
"list": false
|
|
},
|
|
"tags": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "tags",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": true
|
|
},
|
|
"temperature": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"value": 0.7,
|
|
"password": false,
|
|
"name": "temperature",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "float",
|
|
"list": false
|
|
},
|
|
"tiktoken_model_name": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "tiktoken_model_name",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": false
|
|
},
|
|
"verbose": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"value": false,
|
|
"password": false,
|
|
"name": "verbose",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "bool",
|
|
"list": false
|
|
},
|
|
"_type": "ChatOpenAI"
|
|
},
|
|
"description": "`OpenAI` Chat large language models API.",
|
|
"base_classes": [
|
|
"ChatOpenAI",
|
|
"BaseLanguageModel",
|
|
"BaseChatModel",
|
|
"BaseLLM"
|
|
],
|
|
"display_name": "ChatOpenAI",
|
|
"documentation": "https://python.langchain.com/docs/modules/model_io/models/chat/integrations/openai"
|
|
},
|
|
"id": "ChatOpenAI-WlIXw",
|
|
"value": null
|
|
},
|
|
"selected": true,
|
|
"dragging": false,
|
|
"positionAbsolute": {
|
|
"x": 170.87326389541306,
|
|
"y": 465.8628482073749
|
|
}
|
|
},
|
|
{
|
|
"width": 384,
|
|
"height": 307,
|
|
"id": "LLMChain-qaGdJ",
|
|
"type": "genericNode",
|
|
"position": {
|
|
"x": 1250.1806448178158,
|
|
"y": 588.4657451068704
|
|
},
|
|
"data": {
|
|
"type": "LLMChain",
|
|
"node": {
|
|
"template": {
|
|
"callbacks": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "callbacks",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "langchain.callbacks.base.BaseCallbackHandler",
|
|
"list": true
|
|
},
|
|
"llm": {
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "llm",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "BaseLanguageModel",
|
|
"list": false
|
|
},
|
|
"memory": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "memory",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "BaseMemory",
|
|
"list": false
|
|
},
|
|
"output_parser": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "output_parser",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "BaseLLMOutputParser",
|
|
"list": false
|
|
},
|
|
"prompt": {
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "prompt",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "BasePromptTemplate",
|
|
"list": false
|
|
},
|
|
"llm_kwargs": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "llm_kwargs",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "code",
|
|
"list": false
|
|
},
|
|
"metadata": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "metadata",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "code",
|
|
"list": false
|
|
},
|
|
"output_key": {
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"value": "text",
|
|
"password": false,
|
|
"name": "output_key",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"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,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "bool",
|
|
"list": false
|
|
},
|
|
"tags": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "tags",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": true
|
|
},
|
|
"verbose": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"value": false,
|
|
"password": false,
|
|
"name": "verbose",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "bool",
|
|
"list": false
|
|
},
|
|
"_type": "LLMChain"
|
|
},
|
|
"description": "Chain to run queries against LLMs.",
|
|
"base_classes": [
|
|
"Chain",
|
|
"LLMChain",
|
|
"function"
|
|
],
|
|
"display_name": "LLMChain",
|
|
"documentation": "https://python.langchain.com/docs/modules/chains/foundational/llm_chain"
|
|
},
|
|
"id": "LLMChain-qaGdJ",
|
|
"value": null
|
|
},
|
|
"selected": true,
|
|
"positionAbsolute": {
|
|
"x": 1250.1806448178158,
|
|
"y": 588.4657451068704
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"width": 384,
|
|
"height": 561,
|
|
"id": "ConversationBufferMemory-WkJkh",
|
|
"type": "genericNode",
|
|
"position": {
|
|
"x": 802.1806448178158,
|
|
"y": 43.265745106870426
|
|
},
|
|
"data": {
|
|
"type": "ConversationBufferMemory",
|
|
"node": {
|
|
"template": {
|
|
"chat_memory": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "chat_memory",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "BaseChatMessageHistory",
|
|
"list": false
|
|
},
|
|
"ai_prefix": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"value": "AI",
|
|
"password": false,
|
|
"name": "ai_prefix",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": false
|
|
},
|
|
"human_prefix": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"value": "Human",
|
|
"password": false,
|
|
"name": "human_prefix",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": false
|
|
},
|
|
"input_key": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"value": "",
|
|
"password": false,
|
|
"name": "input_key",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "The variable to be used as Chat Input when more than one variable is available.",
|
|
"type": "str",
|
|
"list": false
|
|
},
|
|
"memory_key": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"value": "history",
|
|
"password": false,
|
|
"name": "memory_key",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": false
|
|
},
|
|
"output_key": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"value": "",
|
|
"password": false,
|
|
"name": "output_key",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "The variable to be used as Chat Output (e.g. answer in a ConversationalRetrievalChain)",
|
|
"type": "str",
|
|
"list": false
|
|
},
|
|
"return_messages": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "return_messages",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "bool",
|
|
"list": false
|
|
},
|
|
"_type": "ConversationBufferMemory"
|
|
},
|
|
"description": "Buffer for storing conversation memory.",
|
|
"base_classes": [
|
|
"BaseChatMemory",
|
|
"BaseMemory",
|
|
"ConversationBufferMemory"
|
|
],
|
|
"display_name": "ConversationBufferMemory",
|
|
"documentation": "https://python.langchain.com/docs/modules/memory/how_to/buffer"
|
|
},
|
|
"id": "ConversationBufferMemory-WkJkh",
|
|
"value": null
|
|
},
|
|
"selected": true,
|
|
"positionAbsolute": {
|
|
"x": 802.1806448178158,
|
|
"y": 43.265745106870426
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"width": 384,
|
|
"height": 445,
|
|
"id": "PromptTemplate-h1IlH",
|
|
"type": "genericNode",
|
|
"position": {
|
|
"x": 190.53285757241179,
|
|
"y": 6.073885727980169
|
|
},
|
|
"data": {
|
|
"type": "PromptTemplate",
|
|
"node": {
|
|
"template": {
|
|
"output_parser": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "output_parser",
|
|
"advanced": false,
|
|
"dynamic": true,
|
|
"info": "",
|
|
"type": "BaseOutputParser",
|
|
"list": false
|
|
},
|
|
"input_variables": {
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "input_variables",
|
|
"advanced": false,
|
|
"dynamic": true,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": true,
|
|
"value": [
|
|
"history",
|
|
"text"
|
|
]
|
|
},
|
|
"partial_variables": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"password": false,
|
|
"name": "partial_variables",
|
|
"advanced": false,
|
|
"dynamic": true,
|
|
"info": "",
|
|
"type": "code",
|
|
"list": false
|
|
},
|
|
"template": {
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": true,
|
|
"password": false,
|
|
"name": "template",
|
|
"advanced": false,
|
|
"dynamic": true,
|
|
"info": "",
|
|
"type": "prompt",
|
|
"list": false,
|
|
"value": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n\nCurrent conversation:\n\n{history}\nHuman: {text}\nAI:"
|
|
},
|
|
"template_format": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"value": "f-string",
|
|
"password": false,
|
|
"name": "template_format",
|
|
"advanced": false,
|
|
"dynamic": true,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": false
|
|
},
|
|
"validate_template": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": false,
|
|
"multiline": false,
|
|
"value": true,
|
|
"password": false,
|
|
"name": "validate_template",
|
|
"advanced": false,
|
|
"dynamic": true,
|
|
"info": "",
|
|
"type": "bool",
|
|
"list": false
|
|
},
|
|
"_type": "PromptTemplate",
|
|
"history": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": true,
|
|
"value": "",
|
|
"password": false,
|
|
"name": "history",
|
|
"display_name": "history",
|
|
"advanced": false,
|
|
"input_types": [
|
|
"Document",
|
|
"BaseOutputParser"
|
|
],
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": false
|
|
},
|
|
"text": {
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"multiline": true,
|
|
"value": "",
|
|
"password": false,
|
|
"name": "text",
|
|
"display_name": "text",
|
|
"advanced": false,
|
|
"input_types": [
|
|
"Document",
|
|
"BaseOutputParser"
|
|
],
|
|
"dynamic": false,
|
|
"info": "",
|
|
"type": "str",
|
|
"list": false
|
|
}
|
|
},
|
|
"description": "A prompt template for a language model.",
|
|
"base_classes": [
|
|
"BasePromptTemplate",
|
|
"PromptTemplate",
|
|
"StringPromptTemplate"
|
|
],
|
|
"name": "",
|
|
"display_name": "PromptTemplate",
|
|
"documentation": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/",
|
|
"custom_fields": {
|
|
"": [
|
|
"history",
|
|
"text"
|
|
],
|
|
"template": [
|
|
"history",
|
|
"text"
|
|
]
|
|
},
|
|
"output_types": [],
|
|
"field_formatters": {
|
|
"formatters": {
|
|
"openai_api_key": {}
|
|
},
|
|
"base_formatters": {
|
|
"kwargs": {},
|
|
"optional": {},
|
|
"list": {},
|
|
"dict": {},
|
|
"union": {},
|
|
"multiline": {},
|
|
"show": {},
|
|
"password": {},
|
|
"default": {},
|
|
"headers": {},
|
|
"dict_code_file": {},
|
|
"model_fields": {
|
|
"MODEL_DICT": {
|
|
"OpenAI": [
|
|
"text-davinci-003",
|
|
"text-davinci-002",
|
|
"text-curie-001",
|
|
"text-babbage-001",
|
|
"text-ada-001"
|
|
],
|
|
"ChatOpenAI": [
|
|
"gpt-3.5-turbo-0613",
|
|
"gpt-3.5-turbo",
|
|
"gpt-3.5-turbo-16k-0613",
|
|
"gpt-3.5-turbo-16k",
|
|
"gpt-4-0613",
|
|
"gpt-4-32k-0613",
|
|
"gpt-4",
|
|
"gpt-4-32k"
|
|
],
|
|
"Anthropic": [
|
|
"claude-v1",
|
|
"claude-v1-100k",
|
|
"claude-instant-v1",
|
|
"claude-instant-v1-100k",
|
|
"claude-v1.3",
|
|
"claude-v1.3-100k",
|
|
"claude-v1.2",
|
|
"claude-v1.0",
|
|
"claude-instant-v1.1",
|
|
"claude-instant-v1.1-100k",
|
|
"claude-instant-v1.0"
|
|
],
|
|
"ChatAnthropic": [
|
|
"claude-v1",
|
|
"claude-v1-100k",
|
|
"claude-instant-v1",
|
|
"claude-instant-v1-100k",
|
|
"claude-v1.3",
|
|
"claude-v1.3-100k",
|
|
"claude-v1.2",
|
|
"claude-v1.0",
|
|
"claude-instant-v1.1",
|
|
"claude-instant-v1.1-100k",
|
|
"claude-instant-v1.0"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"beta": false,
|
|
"error": null
|
|
},
|
|
"id": "PromptTemplate-h1IlH"
|
|
},
|
|
"selected": true,
|
|
"positionAbsolute": {
|
|
"x": 190.53285757241179,
|
|
"y": 6.073885727980169
|
|
},
|
|
"dragging": false
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "ChatOpenAI-WlIXw",
|
|
"sourceHandle": "{œbaseClassesœ:[œChatOpenAIœ,œBaseLanguageModelœ,œBaseChatModelœ,œBaseLLMœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-WlIXwœ}",
|
|
"target": "LLMChain-qaGdJ",
|
|
"targetHandle": "{œfieldNameœ:œllmœ,œidœ:œLLMChain-qaGdJœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}",
|
|
"className": "stroke-gray-900 stroke-connection",
|
|
"id": "reactflow__edge-ChatOpenAI-WlIXw{œbaseClassesœ:[œChatOpenAIœ,œBaseLanguageModelœ,œBaseChatModelœ,œBaseLLMœ],œdataTypeœ:œChatOpenAIœ,œidœ:œChatOpenAI-WlIXwœ}-LLMChain-qaGdJ{œfieldNameœ:œllmœ,œidœ:œLLMChain-qaGdJœ,œinputTypesœ:null,œtypeœ:œBaseLanguageModelœ}",
|
|
"selected": true,
|
|
"animated": false,
|
|
"style": {
|
|
"stroke": "#555"
|
|
},
|
|
"data": {
|
|
"sourceHandle": {
|
|
"baseClasses": [
|
|
"ChatOpenAI",
|
|
"BaseLanguageModel",
|
|
"BaseChatModel",
|
|
"BaseLLM"
|
|
],
|
|
"dataType": "ChatOpenAI",
|
|
"id": "ChatOpenAI-WlIXw"
|
|
},
|
|
"targetHandle": {
|
|
"fieldName": "llm",
|
|
"id": "LLMChain-qaGdJ",
|
|
"inputTypes": null,
|
|
"type": "BaseLanguageModel"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"source": "ConversationBufferMemory-WkJkh",
|
|
"sourceHandle": "{œbaseClassesœ:[œBaseChatMemoryœ,œBaseMemoryœ,œConversationBufferMemoryœ],œdataTypeœ:œConversationBufferMemoryœ,œidœ:œConversationBufferMemory-WkJkhœ}",
|
|
"target": "LLMChain-qaGdJ",
|
|
"targetHandle": "{œfieldNameœ:œmemoryœ,œidœ:œLLMChain-qaGdJœ,œinputTypesœ:null,œtypeœ:œBaseMemoryœ}",
|
|
"className": "stroke-gray-900 stroke-connection",
|
|
"id": "reactflow__edge-ConversationBufferMemory-WkJkh{œbaseClassesœ:[œBaseChatMemoryœ,œBaseMemoryœ,œConversationBufferMemoryœ],œdataTypeœ:œConversationBufferMemoryœ,œidœ:œConversationBufferMemory-WkJkhœ}-LLMChain-qaGdJ{œfieldNameœ:œmemoryœ,œidœ:œLLMChain-qaGdJœ,œinputTypesœ:null,œtypeœ:œBaseMemoryœ}",
|
|
"animated": false,
|
|
"style": {
|
|
"stroke": "#555"
|
|
},
|
|
"data": {
|
|
"sourceHandle": {
|
|
"baseClasses": [
|
|
"BaseChatMemory",
|
|
"BaseMemory",
|
|
"ConversationBufferMemory"
|
|
],
|
|
"dataType": "ConversationBufferMemory",
|
|
"id": "ConversationBufferMemory-WkJkh"
|
|
},
|
|
"targetHandle": {
|
|
"fieldName": "memory",
|
|
"id": "LLMChain-qaGdJ",
|
|
"inputTypes": null,
|
|
"type": "BaseMemory"
|
|
}
|
|
},
|
|
"selected": true
|
|
},
|
|
{
|
|
"source": "PromptTemplate-h1IlH",
|
|
"sourceHandle": "{œbaseClassesœ:[œBasePromptTemplateœ,œPromptTemplateœ,œStringPromptTemplateœ],œdataTypeœ:œPromptTemplateœ,œidœ:œPromptTemplate-h1IlHœ}",
|
|
"target": "LLMChain-qaGdJ",
|
|
"targetHandle": "{œfieldNameœ:œpromptœ,œidœ:œLLMChain-qaGdJœ,œinputTypesœ:null,œtypeœ:œBasePromptTemplateœ}",
|
|
"style": {
|
|
"stroke": "#555"
|
|
},
|
|
"className": "stroke-gray-900 stroke-connection",
|
|
"animated": false,
|
|
"id": "reactflow__edge-PromptTemplate-h1IlH{œbaseClassesœ:[œBasePromptTemplateœ,œPromptTemplateœ,œStringPromptTemplateœ],œdataTypeœ:œPromptTemplateœ,œidœ:œPromptTemplate-h1IlHœ}-LLMChain-qaGdJ{œfieldNameœ:œpromptœ,œidœ:œLLMChain-qaGdJœ,œinputTypesœ:null,œtypeœ:œBasePromptTemplateœ}",
|
|
"data": {
|
|
"sourceHandle": {
|
|
"baseClasses": [
|
|
"BasePromptTemplate",
|
|
"PromptTemplate",
|
|
"StringPromptTemplate"
|
|
],
|
|
"dataType": "PromptTemplate",
|
|
"id": "PromptTemplate-h1IlH"
|
|
},
|
|
"targetHandle": {
|
|
"fieldName": "prompt",
|
|
"id": "LLMChain-qaGdJ",
|
|
"inputTypes": null,
|
|
"type": "BasePromptTemplate"
|
|
}
|
|
},
|
|
"selected": true
|
|
}
|
|
],
|
|
"viewport": {
|
|
"x": 51.18733552370577,
|
|
"y": 64.73969994910271,
|
|
"zoom": 0.5175724661902371
|
|
}
|
|
},
|
|
"name": "Peppy Cori",
|
|
"description": "",
|
|
"id": "fmpGP"
|
|
}
|
|
}
|
|
},
|
|
"id": "LLMChain-7wD4b",
|
|
"position": {
|
|
"x": 603.4418527758642,
|
|
"y": 275.91705603727394
|
|
},
|
|
"type": "genericNode",
|
|
"selected": true,
|
|
"dragging": false,
|
|
"positionAbsolute": {
|
|
"x": 603.4418527758642,
|
|
"y": 275.91705603727394
|
|
}
|
|
}
|
|
],
|
|
"edges": [],
|
|
"viewport": {
|
|
"x": -248.3019876307386,
|
|
"y": -114.01962984298234,
|
|
"zoom": 0.8178072603465967
|
|
}
|
|
},
|
|
"id": "70a5f5a3-53c8-4e1c-996c-d9c46ae40220"
|
|
} |