Update Memory Example
This commit is contained in:
parent
6dbc2c76e4
commit
045cb38cd3
1 changed files with 1079 additions and 1237 deletions
|
|
@ -1,173 +1,10 @@
|
||||||
{
|
{
|
||||||
|
"id": "321b1bab-8691-42da-9689-1f12b5d2a48b",
|
||||||
"data": {
|
"data": {
|
||||||
"edges": [
|
|
||||||
{
|
|
||||||
"className": "stroke-gray-900 stroke-connection",
|
|
||||||
"data": {
|
|
||||||
"sourceHandle": {
|
|
||||||
"baseClasses": [
|
|
||||||
"str",
|
|
||||||
"Text",
|
|
||||||
"object"
|
|
||||||
],
|
|
||||||
"dataType": "MemoryComponent",
|
|
||||||
"id": "MemoryComponent-iDkC0"
|
|
||||||
},
|
|
||||||
"targetHandle": {
|
|
||||||
"fieldName": "context",
|
|
||||||
"id": "Prompt-19lCm",
|
|
||||||
"inputTypes": [
|
|
||||||
"Document",
|
|
||||||
"BaseOutputParser",
|
|
||||||
"Record",
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"type": "str"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"id": "reactflow__edge-MemoryComponent-iDkC0{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-iDkC0œ}-Prompt-19lCm{œfieldNameœ:œcontextœ,œidœ:œPrompt-19lCmœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
|
|
||||||
"selected": false,
|
|
||||||
"source": "MemoryComponent-iDkC0",
|
|
||||||
"sourceHandle": "{œbaseClassesœ: [œstrœ, œTextœ, œobjectœ], œdataTypeœ: œMemoryComponentœ, œidœ: œMemoryComponent-iDkC0œ}",
|
|
||||||
"style": {
|
|
||||||
"stroke": "#555"
|
|
||||||
},
|
|
||||||
"target": "Prompt-19lCm",
|
|
||||||
"targetHandle": "{œfieldNameœ: œcontextœ, œidœ: œPrompt-19lCmœ, œinputTypesœ: [œDocumentœ, œBaseOutputParserœ, œRecordœ, œTextœ], œtypeœ: œstrœ}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"className": "",
|
|
||||||
"data": {
|
|
||||||
"sourceHandle": {
|
|
||||||
"baseClasses": [
|
|
||||||
"Text",
|
|
||||||
"object",
|
|
||||||
"Record",
|
|
||||||
"str"
|
|
||||||
],
|
|
||||||
"dataType": "ChatInput",
|
|
||||||
"id": "ChatInput-Z6G1Z"
|
|
||||||
},
|
|
||||||
"targetHandle": {
|
|
||||||
"fieldName": "user_message",
|
|
||||||
"id": "Prompt-19lCm",
|
|
||||||
"inputTypes": [
|
|
||||||
"Document",
|
|
||||||
"BaseOutputParser",
|
|
||||||
"Record",
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"type": "str"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"id": "reactflow__edge-ChatInput-Z6G1Z{œbaseClassesœ:[œTextœ,œobjectœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-Z6G1Zœ}-Prompt-19lCm{œfieldNameœ:œuser_messageœ,œidœ:œPrompt-19lCmœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
|
|
||||||
"selected": false,
|
|
||||||
"source": "ChatInput-Z6G1Z",
|
|
||||||
"sourceHandle": "{œbaseClassesœ: [œTextœ, œobjectœ, œRecordœ, œstrœ], œdataTypeœ: œChatInputœ, œidœ: œChatInput-Z6G1Zœ}",
|
|
||||||
"style": {
|
|
||||||
"stroke": "#555"
|
|
||||||
},
|
|
||||||
"target": "Prompt-19lCm",
|
|
||||||
"targetHandle": "{œfieldNameœ: œuser_messageœ, œidœ: œPrompt-19lCmœ, œinputTypesœ: [œDocumentœ, œBaseOutputParserœ, œRecordœ, œTextœ], œtypeœ: œstrœ}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"className": "",
|
|
||||||
"data": {
|
|
||||||
"sourceHandle": {
|
|
||||||
"baseClasses": [
|
|
||||||
"Text",
|
|
||||||
"str",
|
|
||||||
"object"
|
|
||||||
],
|
|
||||||
"dataType": "Prompt",
|
|
||||||
"id": "Prompt-19lCm"
|
|
||||||
},
|
|
||||||
"targetHandle": {
|
|
||||||
"fieldName": "input_value",
|
|
||||||
"id": "OpenAIModel-1v5Hz",
|
|
||||||
"inputTypes": [
|
|
||||||
"Text",
|
|
||||||
"Record",
|
|
||||||
"Prompt"
|
|
||||||
],
|
|
||||||
"type": "str"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"id": "reactflow__edge-Prompt-19lCm{œbaseClassesœ:[œTextœ,œstrœ,œobjectœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-19lCmœ}-OpenAIModel-1v5Hz{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-1v5Hzœ,œinputTypesœ:[œTextœ,œRecordœ,œPromptœ],œtypeœ:œstrœ}",
|
|
||||||
"source": "Prompt-19lCm",
|
|
||||||
"sourceHandle": "{œbaseClassesœ: [œTextœ, œstrœ, œobjectœ], œdataTypeœ: œPromptœ, œidœ: œPrompt-19lCmœ}",
|
|
||||||
"style": {
|
|
||||||
"stroke": "#555"
|
|
||||||
},
|
|
||||||
"target": "OpenAIModel-1v5Hz",
|
|
||||||
"targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œOpenAIModel-1v5Hzœ, œinputTypesœ: [œTextœ, œRecordœ, œPromptœ], œtypeœ: œstrœ}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"className": "",
|
|
||||||
"data": {
|
|
||||||
"sourceHandle": {
|
|
||||||
"baseClasses": [
|
|
||||||
"str",
|
|
||||||
"object",
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"dataType": "OpenAIModel",
|
|
||||||
"id": "OpenAIModel-1v5Hz"
|
|
||||||
},
|
|
||||||
"targetHandle": {
|
|
||||||
"fieldName": "input_value",
|
|
||||||
"id": "ChatOutput-i56kN",
|
|
||||||
"inputTypes": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"type": "str"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"id": "reactflow__edge-OpenAIModel-1v5Hz{œbaseClassesœ:[œstrœ,œobjectœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-1v5Hzœ}-ChatOutput-i56kN{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-i56kNœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
|
||||||
"source": "OpenAIModel-1v5Hz",
|
|
||||||
"sourceHandle": "{œbaseClassesœ: [œstrœ, œobjectœ, œTextœ], œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-1v5Hzœ}",
|
|
||||||
"style": {
|
|
||||||
"stroke": "#555"
|
|
||||||
},
|
|
||||||
"target": "ChatOutput-i56kN",
|
|
||||||
"targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-i56kNœ, œinputTypesœ: [œTextœ], œtypeœ: œstrœ}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"className": "",
|
|
||||||
"data": {
|
|
||||||
"sourceHandle": {
|
|
||||||
"baseClasses": [
|
|
||||||
"str",
|
|
||||||
"Text",
|
|
||||||
"object"
|
|
||||||
],
|
|
||||||
"dataType": "MemoryComponent",
|
|
||||||
"id": "MemoryComponent-iDkC0"
|
|
||||||
},
|
|
||||||
"targetHandle": {
|
|
||||||
"fieldName": "input_value",
|
|
||||||
"id": "TextOutput-KuLNK",
|
|
||||||
"inputTypes": [
|
|
||||||
"Record",
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"type": "str"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"id": "reactflow__edge-MemoryComponent-iDkC0{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-iDkC0œ}-TextOutput-KuLNK{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-KuLNKœ,œinputTypesœ:[œRecordœ,œTextœ],œtypeœ:œstrœ}",
|
|
||||||
"source": "MemoryComponent-iDkC0",
|
|
||||||
"sourceHandle": "{œbaseClassesœ: [œstrœ, œTextœ, œobjectœ], œdataTypeœ: œMemoryComponentœ, œidœ: œMemoryComponent-iDkC0œ}",
|
|
||||||
"style": {
|
|
||||||
"stroke": "#555"
|
|
||||||
},
|
|
||||||
"target": "TextOutput-KuLNK",
|
|
||||||
"targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œTextOutput-KuLNKœ, œinputTypesœ: [œRecordœ, œTextœ], œtypeœ: œstrœ}"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"data": {
|
"data": {
|
||||||
"id": "ChatInput-Z6G1Z",
|
"id": "ChatInput-Z9Rn6",
|
||||||
"node": {
|
"node": {
|
||||||
"base_classes": [
|
"base_classes": [
|
||||||
"Text",
|
"Text",
|
||||||
|
|
@ -232,7 +69,7 @@
|
||||||
"show": true,
|
"show": true,
|
||||||
"title_case": false,
|
"title_case": false,
|
||||||
"type": "str",
|
"type": "str",
|
||||||
"value": ""
|
"value": "do you know his name?"
|
||||||
},
|
},
|
||||||
"sender": {
|
"sender": {
|
||||||
"advanced": true,
|
"advanced": true,
|
||||||
|
|
@ -309,8 +146,8 @@
|
||||||
"type": "ChatInput"
|
"type": "ChatInput"
|
||||||
},
|
},
|
||||||
"dragging": false,
|
"dragging": false,
|
||||||
"height": 469,
|
"height": 477,
|
||||||
"id": "ChatInput-Z6G1Z",
|
"id": "ChatInput-Z9Rn6",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 1283.2700598313072,
|
"x": 1283.2700598313072,
|
||||||
"y": 982.5953650473145
|
"y": 982.5953650473145
|
||||||
|
|
@ -325,7 +162,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"data": {
|
"data": {
|
||||||
"id": "ChatOutput-i56kN",
|
"id": "ChatOutput-cVR7W",
|
||||||
"node": {
|
"node": {
|
||||||
"base_classes": [
|
"base_classes": [
|
||||||
"Text",
|
"Text",
|
||||||
|
|
@ -468,8 +305,8 @@
|
||||||
"type": "ChatOutput"
|
"type": "ChatOutput"
|
||||||
},
|
},
|
||||||
"dragging": false,
|
"dragging": false,
|
||||||
"height": 477,
|
"height": 485,
|
||||||
"id": "ChatOutput-i56kN",
|
"id": "ChatOutput-cVR7W",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 3154.916355514023,
|
"x": 3154.916355514023,
|
||||||
"y": 851.051882666333
|
"y": 851.051882666333
|
||||||
|
|
@ -486,7 +323,7 @@
|
||||||
"data": {
|
"data": {
|
||||||
"description": "Retrieves stored chat messages given a specific Session ID.",
|
"description": "Retrieves stored chat messages given a specific Session ID.",
|
||||||
"display_name": "Chat Memory",
|
"display_name": "Chat Memory",
|
||||||
"id": "MemoryComponent-iDkC0",
|
"id": "MemoryComponent-u6m5G",
|
||||||
"node": {
|
"node": {
|
||||||
"base_classes": [
|
"base_classes": [
|
||||||
"str",
|
"str",
|
||||||
|
|
@ -674,8 +511,8 @@
|
||||||
"type": "MemoryComponent"
|
"type": "MemoryComponent"
|
||||||
},
|
},
|
||||||
"dragging": false,
|
"dragging": false,
|
||||||
"height": 489,
|
"height": 505,
|
||||||
"id": "MemoryComponent-iDkC0",
|
"id": "MemoryComponent-u6m5G",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 1289.9606870058817,
|
"x": 1289.9606870058817,
|
||||||
"y": 442.16804561053766
|
"y": 442.16804561053766
|
||||||
|
|
@ -690,38 +527,10 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"data": {
|
"data": {
|
||||||
"description": "A component for creating prompt templates using dynamic variables.",
|
|
||||||
"display_name": "Prompt",
|
|
||||||
"id": "Prompt-19lCm",
|
|
||||||
"node": {
|
|
||||||
"base_classes": [
|
|
||||||
"Text",
|
|
||||||
"str",
|
|
||||||
"object"
|
|
||||||
],
|
|
||||||
"beta": false,
|
|
||||||
"custom_fields": {
|
|
||||||
"template": [
|
|
||||||
"context",
|
|
||||||
"user_message"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": "Create a prompt template with dynamic variables.",
|
"description": "Create a prompt template with dynamic variables.",
|
||||||
"display_name": "Prompt",
|
"display_name": "Prompt",
|
||||||
"documentation": "",
|
"id": "Prompt-kykM2",
|
||||||
"error": null,
|
"node": {
|
||||||
"field_formatters": {},
|
|
||||||
"field_order": [],
|
|
||||||
"frozen": false,
|
|
||||||
"full_path": null,
|
|
||||||
"icon": "prompts",
|
|
||||||
"is_composition": null,
|
|
||||||
"is_input": null,
|
|
||||||
"is_output": null,
|
|
||||||
"name": "",
|
|
||||||
"output_types": [
|
|
||||||
"Prompt"
|
|
||||||
],
|
|
||||||
"template": {
|
"template": {
|
||||||
"_type": "CustomComponent",
|
"_type": "CustomComponent",
|
||||||
"code": {
|
"code": {
|
||||||
|
|
@ -742,32 +551,6 @@
|
||||||
"type": "code",
|
"type": "code",
|
||||||
"value": "from langflow.custom import CustomComponent\nfrom langflow.field_typing import TemplateField\nfrom langflow.field_typing.prompt import Prompt\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": TemplateField(display_name=\"Template\"),\n \"code\": TemplateField(advanced=True),\n }\n\n async def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Prompt:\n prompt = await Prompt.from_template_and_variables(template, kwargs)\n self.status = prompt.format_text()\n return prompt\n"
|
"value": "from langflow.custom import CustomComponent\nfrom langflow.field_typing import TemplateField\nfrom langflow.field_typing.prompt import Prompt\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": TemplateField(display_name=\"Template\"),\n \"code\": TemplateField(advanced=True),\n }\n\n async def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Prompt:\n prompt = await Prompt.from_template_and_variables(template, kwargs)\n self.status = prompt.format_text()\n return prompt\n"
|
||||||
},
|
},
|
||||||
"context": {
|
|
||||||
"advanced": false,
|
|
||||||
"display_name": "context",
|
|
||||||
"dynamic": false,
|
|
||||||
"field_type": "str",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"info": "",
|
|
||||||
"input_types": [
|
|
||||||
"Document",
|
|
||||||
"BaseOutputParser",
|
|
||||||
"Record",
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"list": false,
|
|
||||||
"load_from_db": false,
|
|
||||||
"multiline": true,
|
|
||||||
"name": "context",
|
|
||||||
"password": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"required": false,
|
|
||||||
"show": true,
|
|
||||||
"title_case": false,
|
|
||||||
"type": "str",
|
|
||||||
"value": ""
|
|
||||||
},
|
|
||||||
"template": {
|
"template": {
|
||||||
"advanced": false,
|
"advanced": false,
|
||||||
"display_name": "Template",
|
"display_name": "Template",
|
||||||
|
|
@ -788,56 +571,110 @@
|
||||||
"show": true,
|
"show": true,
|
||||||
"title_case": false,
|
"title_case": false,
|
||||||
"type": "prompt",
|
"type": "prompt",
|
||||||
"value": "{context}\n\nUser: {user_message}\nAI: "
|
"value": "Previous messages:\n{Context}\n\nUser: {UserMessage}\nAI: "
|
||||||
},
|
},
|
||||||
"user_message": {
|
"Context": {
|
||||||
"advanced": false,
|
|
||||||
"display_name": "user_message",
|
|
||||||
"dynamic": false,
|
|
||||||
"field_type": "str",
|
"field_type": "str",
|
||||||
|
"required": false,
|
||||||
|
"placeholder": "",
|
||||||
|
"list": false,
|
||||||
|
"show": true,
|
||||||
|
"multiline": true,
|
||||||
|
"value": "",
|
||||||
"fileTypes": [],
|
"fileTypes": [],
|
||||||
"file_path": "",
|
"file_path": "",
|
||||||
"info": "",
|
"password": false,
|
||||||
|
"name": "Context",
|
||||||
|
"display_name": "Context",
|
||||||
|
"advanced": false,
|
||||||
"input_types": [
|
"input_types": [
|
||||||
"Document",
|
"Document",
|
||||||
"BaseOutputParser",
|
"Message",
|
||||||
"Record",
|
"Record",
|
||||||
"Text"
|
"Text"
|
||||||
],
|
],
|
||||||
"list": false,
|
"dynamic": false,
|
||||||
|
"info": "",
|
||||||
"load_from_db": false,
|
"load_from_db": false,
|
||||||
"multiline": true,
|
|
||||||
"name": "user_message",
|
|
||||||
"password": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"required": false,
|
|
||||||
"show": true,
|
|
||||||
"title_case": false,
|
"title_case": false,
|
||||||
"type": "str",
|
"type": "str"
|
||||||
"value": ""
|
},
|
||||||
}
|
"UserMessage": {
|
||||||
|
"field_type": "str",
|
||||||
|
"required": false,
|
||||||
|
"placeholder": "",
|
||||||
|
"list": false,
|
||||||
|
"show": true,
|
||||||
|
"multiline": true,
|
||||||
|
"value": "",
|
||||||
|
"fileTypes": [],
|
||||||
|
"file_path": "",
|
||||||
|
"password": false,
|
||||||
|
"name": "UserMessage",
|
||||||
|
"display_name": "UserMessage",
|
||||||
|
"advanced": false,
|
||||||
|
"input_types": [
|
||||||
|
"Document",
|
||||||
|
"Message",
|
||||||
|
"Record",
|
||||||
|
"Text"
|
||||||
|
],
|
||||||
|
"dynamic": false,
|
||||||
|
"info": "",
|
||||||
|
"load_from_db": false,
|
||||||
|
"title_case": false,
|
||||||
|
"type": "str"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"description": "Create a prompt template with dynamic variables.",
|
||||||
|
"icon": "prompts",
|
||||||
|
"is_input": null,
|
||||||
|
"is_output": null,
|
||||||
|
"is_composition": null,
|
||||||
|
"base_classes": [
|
||||||
|
"object",
|
||||||
|
"str",
|
||||||
|
"Text"
|
||||||
|
],
|
||||||
|
"name": "",
|
||||||
|
"display_name": "Prompt",
|
||||||
|
"documentation": "",
|
||||||
|
"custom_fields": {
|
||||||
|
"template": [
|
||||||
|
"Context",
|
||||||
|
"UserMessage"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"output_types": [
|
||||||
|
"Prompt"
|
||||||
|
],
|
||||||
|
"full_path": null,
|
||||||
|
"field_formatters": {},
|
||||||
|
"frozen": false,
|
||||||
|
"field_order": [],
|
||||||
|
"beta": false,
|
||||||
|
"error": null
|
||||||
|
},
|
||||||
"type": "Prompt"
|
"type": "Prompt"
|
||||||
},
|
},
|
||||||
"dragging": false,
|
"dragging": false,
|
||||||
"height": 477,
|
"height": 513,
|
||||||
"id": "Prompt-19lCm",
|
"id": "Prompt-kykM2",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 1894.594426342426,
|
"x": 1890.2582485007167,
|
||||||
"y": 753.3797365481901
|
"y": 753.3797365481901
|
||||||
},
|
},
|
||||||
"positionAbsolute": {
|
"positionAbsolute": {
|
||||||
"x": 1894.594426342426,
|
"x": 1890.2582485007167,
|
||||||
"y": 753.3797365481901
|
"y": 753.3797365481901
|
||||||
},
|
},
|
||||||
"selected": false,
|
"selected": true,
|
||||||
"type": "genericNode",
|
"type": "genericNode",
|
||||||
"width": 384
|
"width": 384
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"data": {
|
"data": {
|
||||||
"id": "OpenAIModel-1v5Hz",
|
"id": "OpenAIModel-Neuec",
|
||||||
"node": {
|
"node": {
|
||||||
"base_classes": [
|
"base_classes": [
|
||||||
"str",
|
"str",
|
||||||
|
|
@ -1099,8 +936,8 @@
|
||||||
"type": "OpenAIModel"
|
"type": "OpenAIModel"
|
||||||
},
|
},
|
||||||
"dragging": false,
|
"dragging": false,
|
||||||
"height": 563,
|
"height": 571,
|
||||||
"id": "OpenAIModel-1v5Hz",
|
"id": "OpenAIModel-Neuec",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 2561.5850334731617,
|
"x": 2561.5850334731617,
|
||||||
"y": 553.2745131130916
|
"y": 553.2745131130916
|
||||||
|
|
@ -1112,131 +949,136 @@
|
||||||
"selected": false,
|
"selected": false,
|
||||||
"type": "genericNode",
|
"type": "genericNode",
|
||||||
"width": 384
|
"width": 384
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"className": "",
|
||||||
|
"data": {
|
||||||
|
"sourceHandle": {
|
||||||
|
"baseClasses": [
|
||||||
|
"str",
|
||||||
|
"object",
|
||||||
|
"Text"
|
||||||
|
],
|
||||||
|
"dataType": "OpenAIModel",
|
||||||
|
"id": "OpenAIModel-Neuec"
|
||||||
|
},
|
||||||
|
"targetHandle": {
|
||||||
|
"fieldName": "input_value",
|
||||||
|
"id": "ChatOutput-cVR7W",
|
||||||
|
"inputTypes": [
|
||||||
|
"Text"
|
||||||
|
],
|
||||||
|
"type": "str"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "reactflow__edge-OpenAIModel-Neuec{œbaseClassesœ:[œstrœ,œobjectœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-Neuecœ}-ChatOutput-cVR7W{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-cVR7Wœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||||
|
"source": "OpenAIModel-Neuec",
|
||||||
|
"sourceHandle": "{œbaseClassesœ:[œstrœ,œobjectœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-Neuecœ}",
|
||||||
|
"style": {
|
||||||
|
"stroke": "#555"
|
||||||
|
},
|
||||||
|
"target": "ChatOutput-cVR7W",
|
||||||
|
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-cVR7Wœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"source": "Prompt-kykM2",
|
||||||
|
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-kykM2œ}",
|
||||||
|
"target": "OpenAIModel-Neuec",
|
||||||
|
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-Neuecœ,œinputTypesœ:[œTextœ,œRecordœ,œPromptœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"description": "Display a text output in the Playground.",
|
"targetHandle": {
|
||||||
"display_name": "Inspect Memory",
|
"fieldName": "input_value",
|
||||||
"edited": false,
|
"id": "OpenAIModel-Neuec",
|
||||||
"id": "TextOutput-KuLNK",
|
"inputTypes": [
|
||||||
"node": {
|
"Text",
|
||||||
"base_classes": [
|
"Record",
|
||||||
|
"Prompt"
|
||||||
|
],
|
||||||
|
"type": "str"
|
||||||
|
},
|
||||||
|
"sourceHandle": {
|
||||||
|
"baseClasses": [
|
||||||
"object",
|
"object",
|
||||||
"str",
|
"str",
|
||||||
"Text"
|
"Text"
|
||||||
],
|
],
|
||||||
"beta": false,
|
"dataType": "Prompt",
|
||||||
"custom_fields": {
|
"id": "Prompt-kykM2"
|
||||||
"input_value": null,
|
}
|
||||||
"record_template": null
|
|
||||||
},
|
},
|
||||||
"description": "Display a text output in the Playground.",
|
"id": "reactflow__edge-Prompt-kykM2{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-kykM2œ}-OpenAIModel-Neuec{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-Neuecœ,œinputTypesœ:[œTextœ,œRecordœ,œPromptœ],œtypeœ:œstrœ}",
|
||||||
"display_name": "Inspect Memory",
|
"className": ""
|
||||||
"documentation": "",
|
|
||||||
"edited": true,
|
|
||||||
"field_formatters": {},
|
|
||||||
"field_order": [],
|
|
||||||
"frozen": false,
|
|
||||||
"icon": "type",
|
|
||||||
"output_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"template": {
|
|
||||||
"_type": "CustomComponent",
|
|
||||||
"code": {
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": true,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"info": "",
|
|
||||||
"list": false,
|
|
||||||
"load_from_db": false,
|
|
||||||
"multiline": true,
|
|
||||||
"name": "code",
|
|
||||||
"password": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"required": true,
|
|
||||||
"show": true,
|
|
||||||
"title_case": false,
|
|
||||||
"type": "code",
|
|
||||||
"value": "from typing import Optional\n\nfrom langflow.base.io.text import TextComponent\nfrom langflow.field_typing import Text\n\n\nclass TextOutput(TextComponent):\n display_name = \"Text Output\"\n description = \"Display a text output in the Playground.\"\n icon = \"type\"\n\n def build_config(self):\n return {\n \"input_value\": {\n \"display_name\": \"Text\",\n \"input_types\": [\"Record\", \"Text\"],\n \"info\": \"Text or Record to be passed as output.\",\n },\n \"record_template\": {\n \"display_name\": \"Record Template\",\n \"multiline\": True,\n \"info\": \"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.\",\n \"advanced\": True,\n },\n }\n\n def build(self, input_value: Optional[Text] = \"\", record_template: Optional[str] = \"\") -> Text:\n return super().build(input_value=input_value, record_template=record_template)\n"
|
|
||||||
},
|
},
|
||||||
"input_value": {
|
{
|
||||||
"advanced": false,
|
"source": "ChatInput-Z9Rn6",
|
||||||
"display_name": "Text",
|
"sourceHandle": "{œbaseClassesœ:[œTextœ,œobjectœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-Z9Rn6œ}",
|
||||||
"dynamic": false,
|
"target": "Prompt-kykM2",
|
||||||
"fileTypes": [],
|
"targetHandle": "{œfieldNameœ:œUserMessageœ,œidœ:œPrompt-kykM2œ,œinputTypesœ:[œDocumentœ,œMessageœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
|
||||||
"file_path": "",
|
"data": {
|
||||||
"info": "Text or Record to be passed as output.",
|
"targetHandle": {
|
||||||
"input_types": [
|
"fieldName": "UserMessage",
|
||||||
|
"id": "Prompt-kykM2",
|
||||||
|
"inputTypes": [
|
||||||
|
"Document",
|
||||||
|
"Message",
|
||||||
"Record",
|
"Record",
|
||||||
"Text"
|
"Text"
|
||||||
],
|
],
|
||||||
"list": false,
|
"type": "str"
|
||||||
"load_from_db": false,
|
|
||||||
"multiline": false,
|
|
||||||
"name": "input_value",
|
|
||||||
"password": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"required": false,
|
|
||||||
"show": true,
|
|
||||||
"title_case": false,
|
|
||||||
"type": "str",
|
|
||||||
"value": ""
|
|
||||||
},
|
},
|
||||||
"record_template": {
|
"sourceHandle": {
|
||||||
"advanced": true,
|
"baseClasses": [
|
||||||
"display_name": "Record Template",
|
"Text",
|
||||||
"dynamic": false,
|
"object",
|
||||||
"fileTypes": [],
|
"Record",
|
||||||
"file_path": "",
|
"str"
|
||||||
"info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.",
|
],
|
||||||
"input_types": [
|
"dataType": "ChatInput",
|
||||||
|
"id": "ChatInput-Z9Rn6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "reactflow__edge-ChatInput-Z9Rn6{œbaseClassesœ:[œTextœ,œobjectœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-Z9Rn6œ}-Prompt-kykM2{œfieldNameœ:œUserMessageœ,œidœ:œPrompt-kykM2œ,œinputTypesœ:[œDocumentœ,œMessageœ,œRecordœ,œTextœ],œtypeœ:œstrœ}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "MemoryComponent-u6m5G",
|
||||||
|
"sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-u6m5Gœ}",
|
||||||
|
"target": "Prompt-kykM2",
|
||||||
|
"targetHandle": "{œfieldNameœ:œContextœ,œidœ:œPrompt-kykM2œ,œinputTypesœ:[œDocumentœ,œMessageœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
|
||||||
|
"data": {
|
||||||
|
"targetHandle": {
|
||||||
|
"fieldName": "Context",
|
||||||
|
"id": "Prompt-kykM2",
|
||||||
|
"inputTypes": [
|
||||||
|
"Document",
|
||||||
|
"Message",
|
||||||
|
"Record",
|
||||||
"Text"
|
"Text"
|
||||||
],
|
],
|
||||||
"list": false,
|
"type": "str"
|
||||||
"load_from_db": false,
|
},
|
||||||
"multiline": true,
|
"sourceHandle": {
|
||||||
"name": "record_template",
|
"baseClasses": [
|
||||||
"password": false,
|
"str",
|
||||||
"placeholder": "",
|
"Text",
|
||||||
"required": false,
|
"object"
|
||||||
"show": true,
|
],
|
||||||
"title_case": false,
|
"dataType": "MemoryComponent",
|
||||||
"type": "str",
|
"id": "MemoryComponent-u6m5G"
|
||||||
"value": ""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": "TextOutput"
|
"id": "reactflow__edge-MemoryComponent-u6m5G{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-u6m5Gœ}-Prompt-kykM2{œfieldNameœ:œContextœ,œidœ:œPrompt-kykM2œ,œinputTypesœ:[œDocumentœ,œMessageœ,œRecordœ,œTextœ],œtypeœ:œstrœ}"
|
||||||
},
|
|
||||||
"dragging": false,
|
|
||||||
"height": 289,
|
|
||||||
"id": "TextOutput-KuLNK",
|
|
||||||
"position": {
|
|
||||||
"x": 1911.4785906252087,
|
|
||||||
"y": 247.39079954376987
|
|
||||||
},
|
|
||||||
"positionAbsolute": {
|
|
||||||
"x": 1911.4785906252087,
|
|
||||||
"y": 247.39079954376987
|
|
||||||
},
|
|
||||||
"selected": false,
|
|
||||||
"type": "genericNode",
|
|
||||||
"width": 384
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"viewport": {
|
"viewport": {
|
||||||
"x": -569.862554459756,
|
"x": -511.79726701119625,
|
||||||
"y": -42.08339711050985,
|
"y": 48.514712353620894,
|
||||||
"zoom": 0.4868590524514978
|
"zoom": 0.4612356948928673
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description": "This project can be used as a starting point for building a Chat experience with user specific memory. You can set a different Session ID to start a new message history.",
|
"description": "This project can be used as a starting point for building a Chat experience with user specific memory. You can set a different Session ID to start a new message history.",
|
||||||
"icon": "🤖",
|
"name": "Memory Chatbot",
|
||||||
"icon_bg_color": "#FFD700",
|
"last_tested_version": "1.0.0a54",
|
||||||
"id": "edee50d3-a7e7-4cc7-9448-cc662300e8fb",
|
"is_component": false
|
||||||
"is_component": false,
|
|
||||||
"last_tested_version": "1.0.0a52",
|
|
||||||
"name": "Memory Chatbot"
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue