update starter projects

This commit is contained in:
ogabrielluiz 2024-06-03 18:26:15 -03:00
commit 8b4d5ec21a
6 changed files with 872 additions and 595 deletions

View file

@ -107,7 +107,17 @@
"frozen": false,
"field_order": [],
"beta": false,
"error": null
"error": null,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "Prompt-uxBqP",
"description": "Create a prompt template with dynamic variables.",
@ -385,7 +395,17 @@
"system_message",
"stream"
],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "OpenAIModel-k39HS",
"description": "Generates text using OpenAI LLMs.",
@ -418,7 +438,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n def build(\n self,\n sender: Optional[str] = \"Machine\",\n sender_name: Optional[str] = \"AI\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n record_template: Optional[str] = \"{text}\",\n ) -> Union[Text, Record]:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n record_template=record_template or \"\",\n )\n",
"value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"AI\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n Input(name=\"record_template\", type=str, display_name=\"Record Template\", default=\"{text}\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def text_response(self) -> Text:\n result = self.input_value\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self) -> Record:\n record = Record(\n data={\n \"message\": self.input_value,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n \"template\": self.record_template or \"\",\n }\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n",
"fileTypes": [],
"file_path": "",
"password": false,
@ -436,19 +456,20 @@
"list": false,
"show": true,
"multiline": true,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "input_value",
"display_name": "Message",
"advanced": false,
"input_types": [
"Text"
],
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false
"title_case": false,
"input_types": [
"Text"
]
},
"record_template": {
"type": "str",
@ -456,59 +477,40 @@
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"value": "{text}",
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "record_template",
"display_name": "Record Template",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "In case of Message being a Record, this template will be used to convert it to text.",
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"return_record": {
"type": "bool",
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "return_record",
"display_name": "Return Record",
"advanced": true,
"dynamic": false,
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
"load_from_db": false,
"title_case": false
},
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": true,
"show": true,
"multiline": false,
"value": "Machine",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"options": [
"Machine",
"User"
"AI"
],
"name": "sender",
"display_name": "Sender Type",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -524,7 +526,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "AI",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -546,21 +548,22 @@
"list": false,
"show": true,
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "session_id",
"display_name": "Session ID",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "If provided, the message will be stored in the memory.",
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"_type": "CustomComponent"
"_type": "Component"
},
"description": "Display a chat message in the Playground.",
"icon": "ChatOutput",
@ -587,7 +590,23 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"name": "Message",
"method": "text_response"
},
{
"types": [
"Record"
],
"name": "Record",
"method": "record_response"
}
]
},
"id": "ChatOutput-njtka"
},
@ -618,7 +637,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True, input_types=[]),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"User\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def build_config(self):\n build_config = super().build_config()\n build_config[\"input_value\"] = {\n \"input_types\": [],\n \"display_name\": \"Message\",\n \"multiline\": True,\n }\n\n return build_config\n\n def text_response(self):\n result = self.message\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self):\n record = Record(\n data={\n \"message\": self.message,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n }\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n\n def build(\n self,\n sender: Optional[str] = \"User\",\n sender_name: Optional[str] = \"User\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n ) -> Union[Text, Record]:\n return super().build_no_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n )\n",
"value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True, input_types=[]),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"User\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def text_response(self) -> Text:\n result = self.input_value\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self) -> Record:\n record = Record(\n data={\n \"text\": self.input_value,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n },\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n",
"fileTypes": [],
"file_path": "",
"password": false,
@ -636,6 +655,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -646,26 +666,6 @@
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false,
"value": "hi"
},
"return_record": {
"type": "bool",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "return_record",
"display_name": "Return Record",
"advanced": true,
"dynamic": false,
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
"load_from_db": false,
"title_case": false
},
"sender": {
@ -675,7 +675,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "User",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -685,7 +685,7 @@
],
"name": "sender",
"display_name": "Sender Type",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -701,7 +701,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "User",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -723,12 +723,13 @@
"list": false,
"show": true,
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "session_id",
"display_name": "Session ID",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -737,7 +738,7 @@
"Text"
]
},
"_type": "CustomComponent"
"_type": "Component"
},
"description": "Get chat inputs from the Playground.",
"icon": "ChatInput",
@ -763,7 +764,23 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"name": "Message",
"method": "text_response"
},
{
"types": [
"Record"
],
"name": "Record",
"method": "record_response"
}
]
},
"id": "ChatInput-P3fgL"
},
@ -780,7 +797,7 @@
"edges": [
{
"source": "OpenAIModel-k39HS",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-k39HSœ}",
"sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-k39HS\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "ChatOutput-njtka",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-njtkaœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -793,13 +810,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"Text",
"str"
],
"dataType": "OpenAIModel",
"id": "OpenAIModel-k39HS"
"id": "OpenAIModel-k39HS",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {
@ -810,7 +826,7 @@
},
{
"source": "Prompt-uxBqP",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-uxBqPœ}",
"sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-uxBqP\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "OpenAIModel-k39HS",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-k39HSœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -823,13 +839,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"str",
"dataType": "Prompt",
"id": "Prompt-uxBqP",
"output_types": [
"Text"
],
"dataType": "Prompt",
"id": "Prompt-uxBqP"
"name": "Text"
}
},
"style": {
@ -840,7 +855,7 @@
},
{
"source": "ChatInput-P3fgL",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œRecordœ,œstrœ,œTextœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-P3fgLœ}",
"sourceHandle": "{\"dataType\": \"ChatInput\", \"id\": \"ChatInput-P3fgL\", \"output_types\": [\"Text\"], \"name\": \"Message\"}",
"target": "Prompt-uxBqP",
"targetHandle": "{œfieldNameœ:œuser_inputœ,œidœ:œPrompt-uxBqPœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -856,14 +871,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"Record",
"str",
"dataType": "ChatInput",
"id": "ChatInput-P3fgL",
"output_types": [
"Text"
],
"dataType": "ChatInput",
"id": "ChatInput-P3fgL"
"name": "Message"
}
},
"style": {

View file

@ -161,7 +161,17 @@
"frozen": false,
"field_order": [],
"beta": false,
"error": null
"error": null,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "Prompt-Rse03",
"description": "Create a prompt template with dynamic variables.",
@ -247,7 +257,17 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Record"
],
"selected": null,
"name": "Record",
"method": null
}
]
},
"id": "URL-HYPkR"
},
@ -278,7 +298,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n def build(\n self,\n sender: Optional[str] = \"Machine\",\n sender_name: Optional[str] = \"AI\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n record_template: Optional[str] = \"{text}\",\n ) -> Union[Text, Record]:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n record_template=record_template or \"\",\n )\n",
"value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"AI\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n Input(name=\"record_template\", type=str, display_name=\"Record Template\", default=\"{text}\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def text_response(self) -> Text:\n result = self.input_value\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self) -> Record:\n record = Record(\n data={\n \"message\": self.input_value,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n \"template\": self.record_template or \"\",\n }\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n",
"fileTypes": [],
"file_path": "",
"password": false,
@ -296,19 +316,20 @@
"list": false,
"show": true,
"multiline": true,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "input_value",
"display_name": "Message",
"advanced": false,
"input_types": [
"Text"
],
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false
"title_case": false,
"input_types": [
"Text"
]
},
"record_template": {
"type": "str",
@ -316,59 +337,40 @@
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"value": "{text}",
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "record_template",
"display_name": "Record Template",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "In case of Message being a Record, this template will be used to convert it to text.",
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"return_record": {
"type": "bool",
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "return_record",
"display_name": "Return Record",
"advanced": true,
"dynamic": false,
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
"load_from_db": false,
"title_case": false
},
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": true,
"show": true,
"multiline": false,
"value": "Machine",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"options": [
"Machine",
"User"
"AI"
],
"name": "sender",
"display_name": "Sender Type",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -384,7 +386,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "AI",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -406,21 +408,22 @@
"list": false,
"show": true,
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "session_id",
"display_name": "Session ID",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "If provided, the message will be stored in the memory.",
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"_type": "CustomComponent"
"_type": "Component"
},
"description": "Display a chat message in the Playground.",
"icon": "ChatOutput",
@ -447,7 +450,23 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"name": "Message",
"method": "text_response"
},
{
"types": [
"Record"
],
"name": "Record",
"method": "record_response"
}
]
},
"id": "ChatOutput-JPlxl"
},
@ -718,7 +737,17 @@
"system_message",
"stream"
],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "OpenAIModel-gi29P"
},
@ -802,7 +831,17 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Record"
],
"selected": null,
"name": "Record",
"method": null
}
]
},
"id": "URL-2cX90"
},
@ -910,7 +949,16 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"selected": "Text",
"name": "Text"
}
]
},
"id": "TextInput-og8Or"
},
@ -928,7 +976,7 @@
{
"source": "URL-HYPkR",
"target": "Prompt-Rse03",
"sourceHandle": "{œbaseClassesœ:[œRecordœ],œdataTypeœ:œURLœ,œidœ:œURL-HYPkRœ}",
"sourceHandle": "{\"dataType\": \"URL\", \"id\": \"URL-HYPkR\", \"output_types\": [\"Record\"], \"name\": \"Record\"}",
"targetHandle": "{œfieldNameœ:œreference_2œ,œidœ:œPrompt-Rse03œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"id": "reactflow__edge-URL-HYPkR{œbaseClassesœ:[œRecordœ],œdataTypeœ:œURLœ,œidœ:œURL-HYPkRœ}-Prompt-Rse03{œfieldNameœ:œreference_2œ,œidœ:œPrompt-Rse03œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -944,11 +992,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"dataType": "URL",
"id": "URL-HYPkR",
"output_types": [
"Record"
],
"dataType": "URL",
"id": "URL-HYPkR"
"name": "Record"
}
},
"style": {
@ -959,7 +1008,7 @@
},
{
"source": "OpenAIModel-gi29P",
"sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-gi29Pœ}",
"sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-gi29P\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "ChatOutput-JPlxl",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-JPlxlœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -972,13 +1021,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"str",
"Text",
"object"
],
"dataType": "OpenAIModel",
"id": "OpenAIModel-gi29P"
"id": "OpenAIModel-gi29P",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {
@ -989,7 +1037,7 @@
},
{
"source": "URL-2cX90",
"sourceHandle": "{œbaseClassesœ:[œRecordœ],œdataTypeœ:œURLœ,œidœ:œURL-2cX90œ}",
"sourceHandle": "{\"dataType\": \"URL\", \"id\": \"URL-2cX90\", \"output_types\": [\"Record\"], \"name\": \"Record\"}",
"target": "Prompt-Rse03",
"targetHandle": "{œfieldNameœ:œreference_1œ,œidœ:œPrompt-Rse03œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1005,11 +1053,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"dataType": "URL",
"id": "URL-2cX90",
"output_types": [
"Record"
],
"dataType": "URL",
"id": "URL-2cX90"
"name": "Record"
}
},
"style": {
@ -1020,7 +1069,7 @@
},
{
"source": "TextInput-og8Or",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-og8Orœ}",
"sourceHandle": "{\"dataType\": \"TextInput\", \"id\": \"TextInput-og8Or\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "Prompt-Rse03",
"targetHandle": "{œfieldNameœ:œinstructionsœ,œidœ:œPrompt-Rse03œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1036,13 +1085,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"Text",
"str"
],
"dataType": "TextInput",
"id": "TextInput-og8Or"
"id": "TextInput-og8Or",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {
@ -1053,7 +1101,7 @@
},
{
"source": "Prompt-Rse03",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-Rse03œ}",
"sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-Rse03\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "OpenAIModel-gi29P",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-gi29Pœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1066,13 +1114,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"Text",
"str"
],
"dataType": "Prompt",
"id": "Prompt-Rse03"
"id": "Prompt-Rse03",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {

View file

@ -134,7 +134,17 @@
"frozen": false,
"field_order": [],
"beta": false,
"error": null
"error": null,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "Prompt-tHwPf",
"description": "A component for creating prompt templates using dynamic variables.",
@ -246,7 +256,16 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Record"
],
"selected": "Record",
"name": "Record"
}
]
},
"id": "File-6TEsD"
},
@ -277,7 +296,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True, input_types=[]),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"User\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def build_config(self):\n build_config = super().build_config()\n build_config[\"input_value\"] = {\n \"input_types\": [],\n \"display_name\": \"Message\",\n \"multiline\": True,\n }\n\n return build_config\n\n def text_response(self):\n result = self.message\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self):\n record = Record(\n data={\n \"message\": self.message,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n }\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n\n def build(\n self,\n sender: Optional[str] = \"User\",\n sender_name: Optional[str] = \"User\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n ) -> Union[Text, Record]:\n return super().build_no_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n )\n",
"value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True, input_types=[]),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"User\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def text_response(self) -> Text:\n result = self.input_value\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self) -> Record:\n record = Record(\n data={\n \"text\": self.input_value,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n },\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n",
"fileTypes": [],
"file_path": "",
"password": false,
@ -295,6 +314,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -305,26 +325,6 @@
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false,
"value": ""
},
"return_record": {
"type": "bool",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "return_record",
"display_name": "Return Record",
"advanced": true,
"dynamic": false,
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
"load_from_db": false,
"title_case": false
},
"sender": {
@ -334,7 +334,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "User",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -344,7 +344,7 @@
],
"name": "sender",
"display_name": "Sender Type",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -360,7 +360,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "User",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -382,12 +382,13 @@
"list": false,
"show": true,
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "session_id",
"display_name": "Session ID",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -396,7 +397,7 @@
"Text"
]
},
"_type": "CustomComponent"
"_type": "Component"
},
"description": "Get chat inputs from the Playground.",
"icon": "ChatInput",
@ -422,7 +423,23 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"name": "Message",
"method": "text_response"
},
{
"types": [
"Record"
],
"name": "Record",
"method": "record_response"
}
]
},
"id": "ChatInput-MsSJ9"
},
@ -453,7 +470,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n def build(\n self,\n sender: Optional[str] = \"Machine\",\n sender_name: Optional[str] = \"AI\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n record_template: Optional[str] = \"{text}\",\n ) -> Union[Text, Record]:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n record_template=record_template or \"\",\n )\n",
"value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"AI\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n Input(name=\"record_template\", type=str, display_name=\"Record Template\", default=\"{text}\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def text_response(self) -> Text:\n result = self.input_value\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self) -> Record:\n record = Record(\n data={\n \"message\": self.input_value,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n \"template\": self.record_template or \"\",\n }\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n",
"fileTypes": [],
"file_path": "",
"password": false,
@ -471,57 +488,61 @@
"list": false,
"show": true,
"multiline": true,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "input_value",
"display_name": "Message",
"advanced": false,
"input_types": [
"Text"
],
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false
"title_case": false,
"input_types": [
"Text"
]
},
"return_record": {
"type": "bool",
"record_template": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "return_record",
"display_name": "Return Record",
"advanced": true,
"name": "record_template",
"display_name": "Record Template",
"advanced": false,
"dynamic": false,
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
"info": "",
"load_from_db": false,
"title_case": false
"title_case": false,
"input_types": [
"Text"
]
},
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": true,
"list": false,
"show": true,
"multiline": false,
"value": "Machine",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"options": [
"Machine",
"User"
"AI"
],
"name": "sender",
"display_name": "Sender Type",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -537,7 +558,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "AI",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -559,21 +580,22 @@
"list": false,
"show": true,
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "session_id",
"display_name": "Session ID",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "If provided, the message will be stored in the memory.",
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"_type": "CustomComponent"
"_type": "Component"
},
"description": "Display a chat message in the Playground.",
"icon": "ChatOutput",
@ -599,7 +621,23 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"name": "Message",
"method": "text_response"
},
{
"types": [
"Record"
],
"name": "Record",
"method": "record_response"
}
]
},
"id": "ChatOutput-F5Awj"
},
@ -875,7 +913,17 @@
"system_message",
"stream"
],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "OpenAIModel-Bt067"
},
@ -892,7 +940,7 @@
"edges": [
{
"source": "ChatInput-MsSJ9",
"sourceHandle": "{œbaseClassesœ:[œstrœ,œRecordœ,œTextœ,œobjectœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-MsSJ9œ}",
"sourceHandle": "{\"dataType\": \"ChatInput\", \"id\": \"ChatInput-MsSJ9\", \"output_types\": [\"Text\"], \"name\": \"Message\"}",
"target": "Prompt-tHwPf",
"targetHandle": "{œfieldNameœ:œQuestionœ,œidœ:œPrompt-tHwPfœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -908,14 +956,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"str",
"Record",
"Text",
"object"
],
"dataType": "ChatInput",
"id": "ChatInput-MsSJ9"
"id": "ChatInput-MsSJ9",
"output_types": [
"Text"
],
"name": "Message"
}
},
"style": {
@ -926,7 +972,7 @@
},
{
"source": "File-6TEsD",
"sourceHandle": "{œbaseClassesœ:[œRecordœ],œdataTypeœ:œFileœ,œidœ:œFile-6TEsDœ}",
"sourceHandle": "{\"dataType\": \"File\", \"id\": \"File-6TEsD\", \"output_types\": [\"Record\"], \"name\": \"Record\"}",
"target": "Prompt-tHwPf",
"targetHandle": "{œfieldNameœ:œDocumentœ,œidœ:œPrompt-tHwPfœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -942,11 +988,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"dataType": "File",
"id": "File-6TEsD",
"output_types": [
"Record"
],
"dataType": "File",
"id": "File-6TEsD"
"name": "Record"
}
},
"style": {
@ -957,7 +1004,7 @@
},
{
"source": "Prompt-tHwPf",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-tHwPfœ}",
"sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-tHwPf\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "OpenAIModel-Bt067",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-Bt067œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -970,13 +1017,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"str",
"dataType": "Prompt",
"id": "Prompt-tHwPf",
"output_types": [
"Text"
],
"dataType": "Prompt",
"id": "Prompt-tHwPf"
"name": "Text"
}
},
"style": {
@ -987,7 +1033,7 @@
},
{
"source": "OpenAIModel-Bt067",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-Bt067œ}",
"sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-Bt067\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "ChatOutput-F5Awj",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-F5Awjœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1000,13 +1046,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"str",
"dataType": "OpenAIModel",
"id": "OpenAIModel-Bt067",
"output_types": [
"Text"
],
"dataType": "OpenAIModel",
"id": "OpenAIModel-Bt067"
"name": "Text"
}
},
"style": {

View file

@ -22,7 +22,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True, input_types=[]),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"User\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def build_config(self):\n build_config = super().build_config()\n build_config[\"input_value\"] = {\n \"input_types\": [],\n \"display_name\": \"Message\",\n \"multiline\": True,\n }\n\n return build_config\n\n def text_response(self):\n result = self.message\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self):\n record = Record(\n data={\n \"message\": self.message,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n }\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n\n def build(\n self,\n sender: Optional[str] = \"User\",\n sender_name: Optional[str] = \"User\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n ) -> Union[Text, Record]:\n return super().build_no_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n )\n",
"value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True, input_types=[]),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"User\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def text_response(self) -> Text:\n result = self.input_value\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self) -> Record:\n record = Record(\n data={\n \"text\": self.input_value,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n },\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n",
"fileTypes": [],
"file_path": "",
"password": false,
@ -40,6 +40,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -50,26 +51,6 @@
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false,
"value": ""
},
"return_record": {
"type": "bool",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "return_record",
"display_name": "Return Record",
"advanced": true,
"dynamic": false,
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
"load_from_db": false,
"title_case": false
},
"sender": {
@ -79,7 +60,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "User",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -89,7 +70,7 @@
],
"name": "sender",
"display_name": "Sender Type",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -105,7 +86,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "User",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -127,6 +108,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -139,10 +121,9 @@
"title_case": false,
"input_types": [
"Text"
],
"value": "MySessionID"
]
},
"_type": "CustomComponent"
"_type": "Component"
},
"description": "Get chat inputs from the Playground.",
"icon": "ChatInput",
@ -168,7 +149,23 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"name": "Message",
"method": "text_response"
},
{
"types": [
"Record"
],
"name": "Record",
"method": "record_response"
}
]
},
"id": "ChatInput-t7F8v"
},
@ -199,7 +196,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n def build(\n self,\n sender: Optional[str] = \"Machine\",\n sender_name: Optional[str] = \"AI\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n record_template: Optional[str] = \"{text}\",\n ) -> Union[Text, Record]:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n record_template=record_template or \"\",\n )\n",
"value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"AI\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n Input(name=\"record_template\", type=str, display_name=\"Record Template\", default=\"{text}\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def text_response(self) -> Text:\n result = self.input_value\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self) -> Record:\n record = Record(\n data={\n \"message\": self.input_value,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n \"template\": self.record_template or \"\",\n }\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n",
"fileTypes": [],
"file_path": "",
"password": false,
@ -217,57 +214,61 @@
"list": false,
"show": true,
"multiline": true,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "input_value",
"display_name": "Message",
"advanced": false,
"input_types": [
"Text"
],
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false
"title_case": false,
"input_types": [
"Text"
]
},
"return_record": {
"type": "bool",
"record_template": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "return_record",
"display_name": "Return Record",
"advanced": true,
"name": "record_template",
"display_name": "Record Template",
"advanced": false,
"dynamic": false,
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
"info": "",
"load_from_db": false,
"title_case": false
"title_case": false,
"input_types": [
"Text"
]
},
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": true,
"list": false,
"show": true,
"multiline": false,
"value": "Machine",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"options": [
"Machine",
"User"
"AI"
],
"name": "sender",
"display_name": "Sender Type",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -283,7 +284,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "AI",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -305,6 +306,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -312,15 +314,14 @@
"display_name": "Session ID",
"advanced": false,
"dynamic": false,
"info": "If provided, the message will be stored in the memory.",
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
],
"value": "MySessionID"
]
},
"_type": "CustomComponent"
"_type": "Component"
},
"description": "Display a chat message in the Playground.",
"icon": "ChatOutput",
@ -346,7 +347,23 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"name": "Message",
"method": "text_response"
},
{
"types": [
"Record"
],
"name": "Record",
"method": "record_response"
}
]
},
"id": "ChatOutput-P1jEe"
},
@ -550,7 +567,17 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": true
"beta": true,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "MemoryComponent-cdA1J",
"description": "Retrieves stored chat messages given a specific Session ID.",
@ -697,7 +724,17 @@
"frozen": false,
"field_order": [],
"beta": false,
"error": null
"error": null,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "Prompt-ODkUx",
"description": "A component for creating prompt templates using dynamic variables.",
@ -975,7 +1012,17 @@
"system_message",
"stream"
],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "OpenAIModel-9RykF"
},
@ -1100,29 +1147,28 @@
"edges": [
{
"source": "MemoryComponent-cdA1J",
"sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-cdA1Jœ}",
"sourceHandle": "{\"dataType\": \"MemoryComponent\", \"id\": \"MemoryComponent-cdA1J\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "Prompt-ODkUx",
"targetHandle": "{œfieldNameœ:œcontextœ,œidœ:œPrompt-ODkUxœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
"targetHandle": {
"fieldName": "context",
"type": "str",
"id": "Prompt-ODkUx",
"inputTypes": [
"Document",
"BaseOutputParser",
"Record",
"Text"
]
],
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"str",
"Text",
"object"
],
"dataType": "MemoryComponent",
"id": "MemoryComponent-cdA1J"
"id": "MemoryComponent-cdA1J",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {
@ -1134,30 +1180,28 @@
},
{
"source": "ChatInput-t7F8v",
"sourceHandle": "{œbaseClassesœ:[œTextœ,œobjectœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-t7F8vœ}",
"sourceHandle": "{\"dataType\": \"ChatInput\", \"id\": \"ChatInput-t7F8v\", \"output_types\": [\"Text\"], \"name\": \"Message\"}",
"target": "Prompt-ODkUx",
"targetHandle": "{œfieldNameœ:œuser_messageœ,œidœ:œPrompt-ODkUxœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
"targetHandle": {
"fieldName": "user_message",
"type": "str",
"id": "Prompt-ODkUx",
"inputTypes": [
"Document",
"BaseOutputParser",
"Record",
"Text"
]
],
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"Text",
"object",
"Record",
"str"
],
"dataType": "ChatInput",
"id": "ChatInput-t7F8v"
"id": "ChatInput-t7F8v",
"output_types": [
"Text"
],
"name": "Message"
}
},
"style": {
@ -1169,7 +1213,7 @@
},
{
"source": "Prompt-ODkUx",
"sourceHandle": "{œbaseClassesœ:[œTextœ,œstrœ,œobjectœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-ODkUxœ}",
"sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-ODkUx\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "OpenAIModel-9RykF",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-9RykFœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1182,13 +1226,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"Text",
"str",
"object"
],
"dataType": "Prompt",
"id": "Prompt-ODkUx"
"id": "Prompt-ODkUx",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {
@ -1199,7 +1242,7 @@
},
{
"source": "OpenAIModel-9RykF",
"sourceHandle": "{œbaseClassesœ:[œstrœ,œobjectœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-9RykFœ}",
"sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-9RykF\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "ChatOutput-P1jEe",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-P1jEeœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1212,13 +1255,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"str",
"object",
"dataType": "OpenAIModel",
"id": "OpenAIModel-9RykF",
"output_types": [
"Text"
],
"dataType": "OpenAIModel",
"id": "OpenAIModel-9RykF"
"name": "Text"
}
},
"style": {
@ -1229,7 +1271,7 @@
},
{
"source": "MemoryComponent-cdA1J",
"sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-cdA1Jœ}",
"sourceHandle": "{\"dataType\": \"MemoryComponent\", \"id\": \"MemoryComponent-cdA1J\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "TextOutput-vrs6T",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-vrs6Tœ,œinputTypesœ:[œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1243,13 +1285,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"str",
"Text",
"object"
],
"dataType": "MemoryComponent",
"id": "MemoryComponent-cdA1J"
"id": "MemoryComponent-cdA1J",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {

View file

@ -107,7 +107,17 @@
"frozen": false,
"field_order": [],
"beta": false,
"error": null
"error": null,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "Prompt-amqBu",
"description": "Create a prompt template with dynamic variables.",
@ -227,7 +237,17 @@
"frozen": false,
"field_order": [],
"beta": false,
"error": null
"error": null,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "Prompt-gTNiz",
"description": "Create a prompt template with dynamic variables.",
@ -256,7 +276,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n def build(\n self,\n sender: Optional[str] = \"Machine\",\n sender_name: Optional[str] = \"AI\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n record_template: Optional[str] = \"{text}\",\n ) -> Union[Text, Record]:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n record_template=record_template or \"\",\n )\n",
"value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"AI\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n Input(name=\"record_template\", type=str, display_name=\"Record Template\", default=\"{text}\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def text_response(self) -> Text:\n result = self.input_value\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self) -> Record:\n record = Record(\n data={\n \"message\": self.input_value,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n \"template\": self.record_template or \"\",\n }\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n",
"fileTypes": [],
"file_path": "",
"password": false,
@ -274,19 +294,20 @@
"list": false,
"show": true,
"multiline": true,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "input_value",
"display_name": "Message",
"advanced": false,
"input_types": [
"Text"
],
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false
"title_case": false,
"input_types": [
"Text"
]
},
"record_template": {
"type": "str",
@ -294,59 +315,40 @@
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"value": "{text}",
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "record_template",
"display_name": "Record Template",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "In case of Message being a Record, this template will be used to convert it to text.",
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"return_record": {
"type": "bool",
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "return_record",
"display_name": "Return Record",
"advanced": true,
"dynamic": false,
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
"load_from_db": false,
"title_case": false
},
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": true,
"show": true,
"multiline": false,
"value": "Machine",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"options": [
"Machine",
"User"
"AI"
],
"name": "sender",
"display_name": "Sender Type",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -362,7 +364,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "Summarizer",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -384,21 +386,22 @@
"list": false,
"show": true,
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "session_id",
"display_name": "Session ID",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "If provided, the message will be stored in the memory.",
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"_type": "CustomComponent"
"_type": "Component"
},
"description": "Display a chat message in the Playground.",
"icon": "ChatOutput",
@ -425,7 +428,23 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"name": "Message",
"method": "text_response"
},
{
"types": [
"Record"
],
"name": "Record",
"method": "record_response"
}
]
},
"id": "ChatOutput-EJkG3"
},
@ -452,7 +471,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n def build(\n self,\n sender: Optional[str] = \"Machine\",\n sender_name: Optional[str] = \"AI\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n record_template: Optional[str] = \"{text}\",\n ) -> Union[Text, Record]:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n record_template=record_template or \"\",\n )\n",
"value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"AI\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n Input(name=\"record_template\", type=str, display_name=\"Record Template\", default=\"{text}\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def text_response(self) -> Text:\n result = self.input_value\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self) -> Record:\n record = Record(\n data={\n \"message\": self.input_value,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n \"template\": self.record_template or \"\",\n }\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n",
"fileTypes": [],
"file_path": "",
"password": false,
@ -470,19 +489,20 @@
"list": false,
"show": true,
"multiline": true,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "input_value",
"display_name": "Message",
"advanced": false,
"input_types": [
"Text"
],
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false
"title_case": false,
"input_types": [
"Text"
]
},
"record_template": {
"type": "str",
@ -490,59 +510,40 @@
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"value": "{text}",
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "record_template",
"display_name": "Record Template",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "In case of Message being a Record, this template will be used to convert it to text.",
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"return_record": {
"type": "bool",
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "return_record",
"display_name": "Return Record",
"advanced": true,
"dynamic": false,
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
"load_from_db": false,
"title_case": false
},
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": true,
"show": true,
"multiline": false,
"value": "Machine",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"options": [
"Machine",
"User"
"AI"
],
"name": "sender",
"display_name": "Sender Type",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -558,7 +559,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "Question Generator",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -580,21 +581,22 @@
"list": false,
"show": true,
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "session_id",
"display_name": "Session ID",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "If provided, the message will be stored in the memory.",
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"_type": "CustomComponent"
"_type": "Component"
},
"description": "Display a chat message in the Playground.",
"icon": "ChatOutput",
@ -621,7 +623,23 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"name": "Message",
"method": "text_response"
},
{
"types": [
"Record"
],
"name": "Record",
"method": "record_response"
}
]
},
"id": "ChatOutput-DNmvg"
},
@ -647,7 +665,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional\n\nfrom langflow.base.io.text import TextComponent\nfrom langflow.field_typing import Text\n\n\nclass TextInput(TextComponent):\n display_name = \"Text Input\"\n description = \"Get text inputs from the Playground.\"\n icon = \"type\"\n\n def build_config(self):\n return {\n \"input_value\": {\n \"display_name\": \"Value\",\n \"input_types\": [\"Record\", \"Text\"],\n \"info\": \"Text or Record to be passed as input.\",\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(\n self,\n input_value: Optional[Text] = \"\",\n record_template: Optional[str] = \"\",\n ) -> Text:\n return super().build(input_value=input_value, record_template=record_template)\n",
"value": "from langflow.base.io.text import TextComponent\nfrom langflow.field_typing import Text\nfrom langflow.template import Input, Output\n\n\nclass TextInput(TextComponent):\n display_name = \"Text Input\"\n description = \"Get text inputs from the Playground.\"\n icon = \"type\"\n\n inputs = [\n Input(\n name=\"input_value\",\n type=str,\n display_name=\"Value\",\n info=\"Text or Record to be passed as input.\",\n input_types=[\"Record\", \"Text\"],\n ),\n Input(\n name=\"record_template\",\n type=str,\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 outputs = [\n Output(name=\"Text\", method=\"text_response\"),\n ]\n\n def text_response(self) -> Text:\n return self.build(input_value=self.input_value, record_template=self.record_template)\n",
"fileTypes": [],
"file_path": "",
"password": false,
@ -665,7 +683,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "Revolutionary Nano-Battery Technology Unveiled In a groundbreaking announcement yesterday, researchers from the fictional Tech Innovations Institute revealed the development of a new nano-battery technology that promises to revolutionize energy storage. The new battery, dubbed the \"EnerGCell\", uses advanced nanomaterials to achieve unprecedented efficiency and storage capacities. According to lead researcher Dr. Ada Byron, the EnerGCell can store up to ten times more energy than the best lithium-ion batteries available today, while charging in just a fraction of the time. \"We're talking about charging your electric vehicle in just five minutes for a range of over 1,000 miles,\" Dr. Byron stated during the press conference. The technology behind the EnerGCell involves a complex arrangement of nanostructured electrodes that allow for rapid ion transfer and extremely high energy density. This breakthrough was achieved after a decade of research into nanomaterials and their applications in energy storage. The implications of this technology are vast, promising to accelerate the adoption of renewable energy by making it more practical and affordable to store wind and solar power. It could also lead to significant advancements in electric vehicles, mobile devices, and any other technology that relies on batteries. Despite the excitement, some experts are calling for patience, noting that the EnerGCell is still in its early stages of development and may take several years before it's commercially available. However, the potential impact of such a technology on the environment and the global economy is undeniable. Tech Innovations Institute plans to continue refining the EnerGCell and begin pilot projects with select partners in the coming year. If successful, this nano-battery technology could indeed be the breakthrough needed to usher in a new era of clean energy and technology.",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -703,7 +721,7 @@
"Text"
]
},
"_type": "CustomComponent"
"_type": "Component"
},
"description": "Get text inputs from the Playground.",
"icon": "type",
@ -724,7 +742,16 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"name": "Text",
"method": "text_response"
}
]
},
"id": "TextInput-sptaH"
},
@ -1108,7 +1135,17 @@
"system_message",
"stream"
],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "OpenAIModel-uYXZJ"
},
@ -1492,7 +1529,17 @@
"system_message",
"stream"
],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "OpenAIModel-XawYB"
},
@ -1509,7 +1556,7 @@
"edges": [
{
"source": "TextInput-sptaH",
"sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-sptaHœ}",
"sourceHandle": "{\"dataType\": \"TextInput\", \"id\": \"TextInput-sptaH\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "Prompt-amqBu",
"targetHandle": "{œfieldNameœ:œdocumentœ,œidœ:œPrompt-amqBuœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1525,13 +1572,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"str",
"Text",
"object"
],
"dataType": "TextInput",
"id": "TextInput-sptaH"
"id": "TextInput-sptaH",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {
@ -1542,7 +1588,7 @@
},
{
"source": "Prompt-amqBu",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-amqBuœ}",
"sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-amqBu\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "TextOutput-2MS4a",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-2MS4aœ,œinputTypesœ:[œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1556,13 +1602,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"str",
"dataType": "Prompt",
"id": "Prompt-amqBu",
"output_types": [
"Text"
],
"dataType": "Prompt",
"id": "Prompt-amqBu"
"name": "Text"
}
},
"style": {
@ -1573,7 +1618,7 @@
},
{
"source": "Prompt-amqBu",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-amqBuœ}",
"sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-amqBu\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "OpenAIModel-uYXZJ",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-uYXZJœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1586,13 +1631,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"str",
"dataType": "Prompt",
"id": "Prompt-amqBu",
"output_types": [
"Text"
],
"dataType": "Prompt",
"id": "Prompt-amqBu"
"name": "Text"
}
},
"style": {
@ -1603,7 +1647,7 @@
},
{
"source": "OpenAIModel-uYXZJ",
"sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-uYXZJœ}",
"sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-uYXZJ\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "Prompt-gTNiz",
"targetHandle": "{œfieldNameœ:œsummaryœ,œidœ:œPrompt-gTNizœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1619,13 +1663,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"str",
"Text",
"object"
],
"dataType": "OpenAIModel",
"id": "OpenAIModel-uYXZJ"
"id": "OpenAIModel-uYXZJ",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {
@ -1636,7 +1679,7 @@
},
{
"source": "OpenAIModel-uYXZJ",
"sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-uYXZJœ}",
"sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-uYXZJ\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "ChatOutput-EJkG3",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-EJkG3œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1649,13 +1692,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"str",
"Text",
"object"
],
"dataType": "OpenAIModel",
"id": "OpenAIModel-uYXZJ"
"id": "OpenAIModel-uYXZJ",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {
@ -1666,7 +1708,7 @@
},
{
"source": "Prompt-gTNiz",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-gTNizœ}",
"sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-gTNiz\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "TextOutput-MUDOR",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-MUDORœ,œinputTypesœ:[œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1680,13 +1722,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"str",
"dataType": "Prompt",
"id": "Prompt-gTNiz",
"output_types": [
"Text"
],
"dataType": "Prompt",
"id": "Prompt-gTNiz"
"name": "Text"
}
},
"style": {
@ -1697,7 +1738,7 @@
},
{
"source": "Prompt-gTNiz",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-gTNizœ}",
"sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-gTNiz\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "OpenAIModel-XawYB",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-XawYBœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1710,13 +1751,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"str",
"dataType": "Prompt",
"id": "Prompt-gTNiz",
"output_types": [
"Text"
],
"dataType": "Prompt",
"id": "Prompt-gTNiz"
"name": "Text"
}
},
"style": {
@ -1727,7 +1767,7 @@
},
{
"source": "OpenAIModel-XawYB",
"sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-XawYBœ}",
"sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-XawYB\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"target": "ChatOutput-DNmvg",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-DNmvgœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -1740,13 +1780,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"str",
"Text",
"object"
],
"dataType": "OpenAIModel",
"id": "OpenAIModel-XawYB"
"id": "OpenAIModel-XawYB",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {

View file

@ -20,7 +20,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True, input_types=[]),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"User\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def build_config(self):\n build_config = super().build_config()\n build_config[\"input_value\"] = {\n \"input_types\": [],\n \"display_name\": \"Message\",\n \"multiline\": True,\n }\n\n return build_config\n\n def text_response(self):\n result = self.message\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self):\n record = Record(\n data={\n \"message\": self.message,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n }\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n\n def build(\n self,\n sender: Optional[str] = \"User\",\n sender_name: Optional[str] = \"User\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n ) -> Union[Text, Record]:\n return super().build_no_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n )\n",
"value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True, input_types=[]),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"User\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def text_response(self) -> Text:\n result = self.input_value\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self) -> Record:\n record = Record(\n data={\n \"text\": self.input_value,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n },\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n",
"fileTypes": [],
"file_path": "",
"password": false,
@ -38,6 +38,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -48,26 +49,6 @@
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false,
"value": "what is a line"
},
"return_record": {
"type": "bool",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "return_record",
"display_name": "Return Record",
"advanced": true,
"dynamic": false,
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
"load_from_db": false,
"title_case": false
},
"sender": {
@ -77,7 +58,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "User",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -87,7 +68,7 @@
],
"name": "sender",
"display_name": "Sender Type",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -103,7 +84,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "User",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -125,12 +106,13 @@
"list": false,
"show": true,
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "session_id",
"display_name": "Session ID",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -139,7 +121,7 @@
"Text"
]
},
"_type": "CustomComponent"
"_type": "Component"
},
"description": "Get chat inputs from the Playground.",
"icon": "ChatInput",
@ -165,7 +147,23 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"name": "Message",
"method": "text_response"
},
{
"types": [
"Record"
],
"name": "Record",
"method": "record_response"
}
]
},
"id": "ChatInput-yxMKE"
},
@ -268,7 +266,16 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"selected": "Text",
"name": "Text"
}
]
},
"id": "TextOutput-BDknO"
},
@ -803,7 +810,17 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Embeddings"
],
"selected": null,
"name": "Embeddings",
"method": null
}
]
},
"id": "OpenAIEmbeddings-ZlOk1"
},
@ -1075,7 +1092,17 @@
"system_message",
"stream"
],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "OpenAIModel-EjXlN"
},
@ -1220,7 +1247,17 @@
"frozen": false,
"field_order": [],
"beta": false,
"error": null
"error": null,
"outputs": [
{
"types": [
"Text"
],
"selected": null,
"name": "Text",
"method": null
}
]
},
"id": "Prompt-xeI6K",
"description": "Create a prompt template with dynamic variables.",
@ -1253,7 +1290,7 @@
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n def build(\n self,\n sender: Optional[str] = \"Machine\",\n sender_name: Optional[str] = \"AI\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n record_template: Optional[str] = \"{text}\",\n ) -> Union[Text, Record]:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n record_template=record_template or \"\",\n )\n",
"value": "from langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\nfrom langflow.template import Input, Output\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n inputs = [\n Input(name=\"input_value\", type=str, display_name=\"Message\", multiline=True),\n Input(name=\"sender\", type=str, display_name=\"Sender Type\", options=[\"Machine\", \"AI\"]),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\"),\n Input(name=\"session_id\", type=str, display_name=\"Session ID\"),\n Input(name=\"record_template\", type=str, display_name=\"Record Template\", default=\"{text}\"),\n ]\n outputs = [\n Output(name=\"Message\", method=\"text_response\"),\n Output(name=\"Record\", method=\"record_response\"),\n ]\n\n def text_response(self) -> Text:\n result = self.input_value\n if self.session_id and isinstance(result, (Record, str)):\n self.store_message(result, self.session_id, self.sender, self.sender_name)\n return result\n\n def record_response(self) -> Record:\n record = Record(\n data={\n \"message\": self.input_value,\n \"sender\": self.sender,\n \"sender_name\": self.sender_name,\n \"session_id\": self.session_id,\n \"template\": self.record_template or \"\",\n }\n )\n if self.session_id and isinstance(record, (Record, str)):\n self.store_message(record, self.session_id, self.sender, self.sender_name)\n return record\n",
"fileTypes": [],
"file_path": "",
"password": false,
@ -1271,19 +1308,20 @@
"list": false,
"show": true,
"multiline": true,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "input_value",
"display_name": "Message",
"advanced": false,
"input_types": [
"Text"
],
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false
"title_case": false,
"input_types": [
"Text"
]
},
"record_template": {
"type": "str",
@ -1291,59 +1329,40 @@
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"value": "{text}",
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "record_template",
"display_name": "Record Template",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "In case of Message being a Record, this template will be used to convert it to text.",
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"return_record": {
"type": "bool",
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "return_record",
"display_name": "Return Record",
"advanced": true,
"dynamic": false,
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
"load_from_db": false,
"title_case": false
},
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": true,
"show": true,
"multiline": false,
"value": "Machine",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"options": [
"Machine",
"User"
"AI"
],
"name": "sender",
"display_name": "Sender Type",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
@ -1359,7 +1378,7 @@
"list": false,
"show": true,
"multiline": false,
"value": "AI",
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
@ -1381,21 +1400,22 @@
"list": false,
"show": true,
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "session_id",
"display_name": "Session ID",
"advanced": true,
"advanced": false,
"dynamic": false,
"info": "If provided, the message will be stored in the memory.",
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"_type": "CustomComponent"
"_type": "Component"
},
"description": "Display a chat message in the Playground.",
"icon": "ChatOutput",
@ -1422,7 +1442,23 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Text"
],
"name": "Message",
"method": "text_response"
},
{
"types": [
"Record"
],
"name": "Record",
"method": "record_response"
}
]
},
"id": "ChatOutput-Q39I8"
},
@ -1540,7 +1576,17 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Record"
],
"selected": null,
"name": "Record",
"method": null
}
]
},
"id": "File-t0a6a"
},
@ -1686,7 +1732,17 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Record"
],
"selected": null,
"name": "Record",
"method": null
}
]
},
"id": "RecursiveCharacterTextSplitter-tR9QM"
},
@ -2139,7 +2195,17 @@
"input_value",
"embedding"
],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Record"
],
"selected": null,
"name": "Record",
"method": null
}
]
},
"id": "AstraDBSearch-41nRz"
},
@ -2542,7 +2608,25 @@
"inputs",
"embedding"
],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"VectorStore"
],
"selected": null,
"name": "VectorStore",
"method": null
},
{
"types": [
"BaseRetriever"
],
"selected": null,
"name": "BaseRetriever",
"method": null
}
]
},
"id": "AstraDB-eUCSS"
},
@ -3077,7 +3161,17 @@
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
"beta": false,
"outputs": [
{
"types": [
"Embeddings"
],
"selected": null,
"name": "Embeddings",
"method": null
}
]
},
"id": "OpenAIEmbeddings-9TPjc"
},
@ -3095,7 +3189,7 @@
{
"source": "TextOutput-BDknO",
"target": "Prompt-xeI6K",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextOutputœ,œidœ:œTextOutput-BDknOœ}",
"sourceHandle": "{\"dataType\": \"TextOutput\", \"id\": \"TextOutput-BDknO\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"targetHandle": "{œfieldNameœ:œcontextœ,œidœ:œPrompt-xeI6Kœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"id": "reactflow__edge-TextOutput-BDknO{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextOutputœ,œidœ:œTextOutput-BDknOœ}-Prompt-xeI6K{œfieldNameœ:œcontextœ,œidœ:œPrompt-xeI6Kœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -3111,13 +3205,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"Text",
"str"
],
"dataType": "TextOutput",
"id": "TextOutput-BDknO"
"id": "TextOutput-BDknO",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {
@ -3129,7 +3222,7 @@
{
"source": "ChatInput-yxMKE",
"target": "Prompt-xeI6K",
"sourceHandle": "{œbaseClassesœ:[œTextœ,œstrœ,œobjectœ,œRecordœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-yxMKEœ}",
"sourceHandle": "{\"dataType\": \"ChatInput\", \"id\": \"ChatInput-yxMKE\", \"output_types\": [\"Text\"], \"name\": \"Message\"}",
"targetHandle": "{œfieldNameœ:œquestionœ,œidœ:œPrompt-xeI6Kœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"id": "reactflow__edge-ChatInput-yxMKE{œbaseClassesœ:[œTextœ,œstrœ,œobjectœ,œRecordœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-yxMKEœ}-Prompt-xeI6K{œfieldNameœ:œquestionœ,œidœ:œPrompt-xeI6Kœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -3145,14 +3238,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"Text",
"str",
"object",
"Record"
],
"dataType": "ChatInput",
"id": "ChatInput-yxMKE"
"id": "ChatInput-yxMKE",
"output_types": [
"Text"
],
"name": "Message"
}
},
"style": {
@ -3164,7 +3255,7 @@
{
"source": "Prompt-xeI6K",
"target": "OpenAIModel-EjXlN",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-xeI6Kœ}",
"sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-xeI6K\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-EjXlNœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"id": "reactflow__edge-Prompt-xeI6K{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-xeI6Kœ}-OpenAIModel-EjXlN{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-EjXlNœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -3177,13 +3268,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"Text",
"str"
],
"dataType": "Prompt",
"id": "Prompt-xeI6K"
"id": "Prompt-xeI6K",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {
@ -3195,7 +3285,7 @@
{
"source": "OpenAIModel-EjXlN",
"target": "ChatOutput-Q39I8",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-EjXlNœ}",
"sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-EjXlN\", \"output_types\": [\"Text\"], \"name\": \"Text\"}",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-Q39I8œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"id": "reactflow__edge-OpenAIModel-EjXlN{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-EjXlNœ}-ChatOutput-Q39I8{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-Q39I8œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -3208,13 +3298,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"Text",
"str"
],
"dataType": "OpenAIModel",
"id": "OpenAIModel-EjXlN"
"id": "OpenAIModel-EjXlN",
"output_types": [
"Text"
],
"name": "Text"
}
},
"style": {
@ -3226,7 +3315,7 @@
{
"source": "File-t0a6a",
"target": "RecursiveCharacterTextSplitter-tR9QM",
"sourceHandle": "{œbaseClassesœ:[œRecordœ],œdataTypeœ:œFileœ,œidœ:œFile-t0a6aœ}",
"sourceHandle": "{\"dataType\": \"File\", \"id\": \"File-t0a6a\", \"output_types\": [\"Record\"], \"name\": \"Record\"}",
"targetHandle": "{œfieldNameœ:œinputsœ,œidœ:œRecursiveCharacterTextSplitter-tR9QMœ,œinputTypesœ:[œDocumentœ,œRecordœ],œtypeœ:œDocumentœ}",
"id": "reactflow__edge-File-t0a6a{œbaseClassesœ:[œRecordœ],œdataTypeœ:œFileœ,œidœ:œFile-t0a6aœ}-RecursiveCharacterTextSplitter-tR9QM{œfieldNameœ:œinputsœ,œidœ:œRecursiveCharacterTextSplitter-tR9QMœ,œinputTypesœ:[œDocumentœ,œRecordœ],œtypeœ:œDocumentœ}",
"data": {
@ -3240,11 +3329,12 @@
"type": "Document"
},
"sourceHandle": {
"baseClasses": [
"dataType": "File",
"id": "File-t0a6a",
"output_types": [
"Record"
],
"dataType": "File",
"id": "File-t0a6a"
"name": "Record"
}
},
"style": {
@ -3255,7 +3345,7 @@
},
{
"source": "OpenAIEmbeddings-ZlOk1",
"sourceHandle": "{œbaseClassesœ:[œEmbeddingsœ],œdataTypeœ:œOpenAIEmbeddingsœ,œidœ:œOpenAIEmbeddings-ZlOk1œ}",
"sourceHandle": "{\"dataType\": \"OpenAIEmbeddings\", \"id\": \"OpenAIEmbeddings-ZlOk1\", \"output_types\": [\"Embeddings\"], \"name\": \"Embeddings\"}",
"target": "AstraDBSearch-41nRz",
"targetHandle": "{œfieldNameœ:œembeddingœ,œidœ:œAstraDBSearch-41nRzœ,œinputTypesœ:null,œtypeœ:œEmbeddingsœ}",
"data": {
@ -3266,11 +3356,12 @@
"type": "Embeddings"
},
"sourceHandle": {
"baseClasses": [
"dataType": "OpenAIEmbeddings",
"id": "OpenAIEmbeddings-ZlOk1",
"output_types": [
"Embeddings"
],
"dataType": "OpenAIEmbeddings",
"id": "OpenAIEmbeddings-ZlOk1"
"name": "Embeddings"
}
},
"style": {
@ -3281,7 +3372,7 @@
},
{
"source": "ChatInput-yxMKE",
"sourceHandle": "{œbaseClassesœ:[œTextœ,œstrœ,œobjectœ,œRecordœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-yxMKEœ}",
"sourceHandle": "{\"dataType\": \"ChatInput\", \"id\": \"ChatInput-yxMKE\", \"output_types\": [\"Text\"], \"name\": \"Message\"}",
"target": "AstraDBSearch-41nRz",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œAstraDBSearch-41nRzœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
@ -3294,14 +3385,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"Text",
"str",
"object",
"Record"
],
"dataType": "ChatInput",
"id": "ChatInput-yxMKE"
"id": "ChatInput-yxMKE",
"output_types": [
"Text"
],
"name": "Message"
}
},
"style": {
@ -3312,7 +3401,7 @@
},
{
"source": "RecursiveCharacterTextSplitter-tR9QM",
"sourceHandle": "{œbaseClassesœ:[œRecordœ],œdataTypeœ:œRecursiveCharacterTextSplitterœ,œidœ:œRecursiveCharacterTextSplitter-tR9QMœ}",
"sourceHandle": "{\"dataType\": \"RecursiveCharacterTextSplitter\", \"id\": \"RecursiveCharacterTextSplitter-tR9QM\", \"output_types\": [\"Record\"], \"name\": \"Record\"}",
"target": "AstraDB-eUCSS",
"targetHandle": "{œfieldNameœ:œinputsœ,œidœ:œAstraDB-eUCSSœ,œinputTypesœ:null,œtypeœ:œRecordœ}",
"data": {
@ -3323,11 +3412,12 @@
"type": "Record"
},
"sourceHandle": {
"baseClasses": [
"dataType": "RecursiveCharacterTextSplitter",
"id": "RecursiveCharacterTextSplitter-tR9QM",
"output_types": [
"Record"
],
"dataType": "RecursiveCharacterTextSplitter",
"id": "RecursiveCharacterTextSplitter-tR9QM"
"name": "Record"
}
},
"style": {
@ -3339,7 +3429,7 @@
},
{
"source": "OpenAIEmbeddings-9TPjc",
"sourceHandle": "{œbaseClassesœ:[œEmbeddingsœ],œdataTypeœ:œOpenAIEmbeddingsœ,œidœ:œOpenAIEmbeddings-9TPjcœ}",
"sourceHandle": "{\"dataType\": \"OpenAIEmbeddings\", \"id\": \"OpenAIEmbeddings-9TPjc\", \"output_types\": [\"Embeddings\"], \"name\": \"Embeddings\"}",
"target": "AstraDB-eUCSS",
"targetHandle": "{œfieldNameœ:œembeddingœ,œidœ:œAstraDB-eUCSSœ,œinputTypesœ:null,œtypeœ:œEmbeddingsœ}",
"data": {
@ -3350,11 +3440,12 @@
"type": "Embeddings"
},
"sourceHandle": {
"baseClasses": [
"dataType": "OpenAIEmbeddings",
"id": "OpenAIEmbeddings-9TPjc",
"output_types": [
"Embeddings"
],
"dataType": "OpenAIEmbeddings",
"id": "OpenAIEmbeddings-9TPjc"
"name": "Embeddings"
}
},
"style": {
@ -3366,7 +3457,7 @@
},
{
"source": "AstraDBSearch-41nRz",
"sourceHandle": "{œbaseClassesœ:[œRecordœ],œdataTypeœ:œAstraDBSearchœ,œidœ:œAstraDBSearch-41nRzœ}",
"sourceHandle": "{\"dataType\": \"AstraDBSearch\", \"id\": \"AstraDBSearch-41nRz\", \"output_types\": [\"Record\"], \"name\": \"Record\"}",
"target": "TextOutput-BDknO",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-BDknOœ,œinputTypesœ:[œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
@ -3380,11 +3471,12 @@
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"dataType": "AstraDBSearch",
"id": "AstraDBSearch-41nRz",
"output_types": [
"Record"
],
"dataType": "AstraDBSearch",
"id": "AstraDBSearch-41nRz"
"name": "Record"
}
},
"style": {