From ef6c179bd1f5e14dfef0e6cf4b7954bbd53d1e71 Mon Sep 17 00:00:00 2001 From: ogabrielluiz Date: Fri, 7 Jun 2024 14:41:15 -0300 Subject: [PATCH] merge projects --- .../Basic Prompting (Hello, world!).json | 1921 +++++++---------- .../Langflow Blog Writter.json | 279 +-- .../Langflow Document QA.json | 295 +-- .../Langflow Memory Conversation.json | 357 +-- .../Langflow Prompt Chaining.json | 480 +--- 5 files changed, 793 insertions(+), 2539 deletions(-) diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting (Hello, world!).json b/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting (Hello, world!).json index 3d81a80c7..c3014eab4 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting (Hello, world!).json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting (Hello, world!).json @@ -45,15 +45,9 @@ "name": "template", "display_name": "Template", "advanced": false, -<<<<<<< HEAD "input_types": [ "Text" ], -======= - "input_types": [ - "Text" - ], ->>>>>>> origin/dev "dynamic": false, "info": "", "load_from_db": false, @@ -92,24 +86,15 @@ "is_input": null, "is_output": null, "is_composition": null, -<<<<<<< HEAD "base_classes": [ "object", "str", "Text" ], -======= - "base_classes": [ - "object", - "str", - "Text" - ], ->>>>>>> origin/dev "name": "", "display_name": "Prompt", "documentation": "", "custom_fields": { -<<<<<<< HEAD "template": [ "user_input" ] @@ -117,1136 +102,808 @@ "output_types": [ "Text" ], -======= - "template": [ - "user_input" + "full_path": null, + "field_formatters": {}, + "frozen": false, + "field_order": [], + "beta": false, + "error": null, + "outputs": [ + { + "types": [ + "Text" + ], + "selected": null, + "display_name": null, + "name": "Text", + "method": null + } ] }, - "output_types": [ - "Text" - ], ->>>>>>> origin/dev - "full_path": null, - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false, -<<<<<<< HEAD - "error": null, - "outputs": [ - { - "types": [ - "Text" - ], - "selected": null, - "display_name": null, - "name": "Text", - "method": null - } - ] -======= - "error": null ->>>>>>> origin/dev + "id": "Prompt-uxBqP", + "description": "Create a prompt template with dynamic variables.", + "display_name": "Prompt" }, - "id": "Prompt-uxBqP", - "description": "Create a prompt template with dynamic variables.", - "display_name": "Prompt" - }, - "selected": true, - "width": 384, - "height": 383, - "dragging": false, - "positionAbsolute": { - "x": 53.588791333410654, - "y": -107.07318910019967 - } - }, - { - "id": "OpenAIModel-k39HS", - "type": "genericNode", - "position": { - "x": 634.8148772766217, - "y": 27.035057029045305 - }, - "data": { - "type": "OpenAIModel", - "node": { - "template": { - "input_value": { - "type": "str", - "required": true, - "placeholder": "", - "list": false, - "show": true, - "multiline": false, - "fileTypes": [], - "file_path": "", - "password": false, - "name": "input_value", - "display_name": "Input", - "advanced": false, - "dynamic": false, - "info": "", - "load_from_db": false, - "title_case": false, -<<<<<<< HEAD - "input_types": [ - "Text" - ] -======= - "input_types": [ - "Text" - ] ->>>>>>> origin/dev - }, - "code": { - "type": "code", - "required": true, - "placeholder": "", - "list": false, - "show": true, - "multiline": true, - "value": "from typing import Optional\n\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.constants import STREAM_INFO_TEXT\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import MODEL_NAMES\nfrom langflow.field_typing import NestedDict, Text\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n\n field_order = [\n \"max_tokens\",\n \"model_kwargs\",\n \"model_name\",\n \"openai_api_base\",\n \"openai_api_key\",\n \"temperature\",\n \"input_value\",\n \"system_message\",\n \"stream\",\n ]\n\n def build_config(self):\n return {\n \"input_value\": {\"display_name\": \"Input\"},\n \"max_tokens\": {\n \"display_name\": \"Max Tokens\",\n \"advanced\": True,\n \"info\": \"The maximum number of tokens to generate. Set to 0 for unlimited tokens.\",\n },\n \"model_kwargs\": {\n \"display_name\": \"Model Kwargs\",\n \"advanced\": True,\n },\n \"model_name\": {\n \"display_name\": \"Model Name\",\n \"advanced\": False,\n \"options\": MODEL_NAMES,\n },\n \"openai_api_base\": {\n \"display_name\": \"OpenAI API Base\",\n \"advanced\": True,\n \"info\": (\n \"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\\n\\n\"\n \"You can change this to use other APIs like JinaChat, LocalAI and Prem.\"\n ),\n },\n \"openai_api_key\": {\n \"display_name\": \"OpenAI API Key\",\n \"info\": \"The OpenAI API Key to use for the OpenAI model.\",\n \"advanced\": False,\n \"password\": True,\n },\n \"temperature\": {\n \"display_name\": \"Temperature\",\n \"advanced\": False,\n \"value\": 0.1,\n },\n \"stream\": {\n \"display_name\": \"Stream\",\n \"info\": STREAM_INFO_TEXT,\n \"advanced\": True,\n },\n \"system_message\": {\n \"display_name\": \"System Message\",\n \"info\": \"System message to pass to the model.\",\n \"advanced\": True,\n },\n }\n\n def build(\n self,\n input_value: Text,\n openai_api_key: str,\n temperature: float = 0.1,\n model_name: str = \"gpt-4o\",\n max_tokens: Optional[int] = 256,\n model_kwargs: NestedDict = {},\n openai_api_base: Optional[str] = None,\n stream: bool = False,\n system_message: Optional[str] = None,\n ) -> Text:\n if not openai_api_base:\n openai_api_base = \"https://api.openai.com/v1\"\n if openai_api_key:\n api_key = SecretStr(openai_api_key)\n else:\n api_key = None\n\n output = ChatOpenAI(\n max_tokens=max_tokens or None,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=api_key,\n temperature=temperature,\n )\n\n return self.get_chat_result(output, stream, input_value, system_message)\n", - "fileTypes": [], - "file_path": "", - "password": false, - "name": "code", - "advanced": true, - "dynamic": true, - "info": "", - "load_from_db": false, - "title_case": false - }, - "max_tokens": { - "type": "int", - "required": false, - "placeholder": "", - "list": false, - "show": true, - "multiline": false, - "value": 256, - "fileTypes": [], - "file_path": "", - "password": false, - "name": "max_tokens", - "display_name": "Max Tokens", - "advanced": true, - "dynamic": false, - "info": "The maximum number of tokens to generate. Set to 0 for unlimited tokens.", - "load_from_db": false, - "title_case": false - }, - "model_kwargs": { - "type": "NestedDict", - "required": false, - "placeholder": "", - "list": false, - "show": true, - "multiline": false, - "value": {}, - "fileTypes": [], - "file_path": "", - "password": false, - "name": "model_kwargs", - "display_name": "Model Kwargs", - "advanced": true, - "dynamic": false, - "info": "", - "load_from_db": false, - "title_case": false - }, - "model_name": { - "type": "str", - "required": false, - "placeholder": "", - "list": true, - "show": true, - "multiline": false, - "value": "gpt-3.5-turbo", - "fileTypes": [], - "file_path": "", - "password": false, - "options": [ - "gpt-4o", - "gpt-4-turbo", - "gpt-4-turbo-preview", - "gpt-3.5-turbo", - "gpt-3.5-turbo-0125" - ], - "name": "model_name", - "display_name": "Model Name", - "advanced": false, - "dynamic": false, - "info": "", - "load_from_db": false, - "title_case": false, -<<<<<<< HEAD - "input_types": [ - "Text" - ] -======= - "input_types": [ - "Text" - ] ->>>>>>> origin/dev - }, - "openai_api_base": { - "type": "str", - "required": false, - "placeholder": "", - "list": false, - "show": true, - "multiline": false, - "fileTypes": [], - "file_path": "", - "password": false, - "name": "openai_api_base", - "display_name": "OpenAI API Base", - "advanced": true, - "dynamic": false, - "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", - "load_from_db": false, - "title_case": false, -<<<<<<< HEAD - "input_types": [ - "Text" - ] -======= - "input_types": [ - "Text" - ] ->>>>>>> origin/dev - }, - "openai_api_key": { - "type": "str", - "required": true, - "placeholder": "", - "list": false, - "show": true, - "multiline": false, - "fileTypes": [], - "file_path": "", - "password": true, - "name": "openai_api_key", - "display_name": "OpenAI API Key", - "advanced": false, - "dynamic": false, - "info": "The OpenAI API Key to use for the OpenAI model.", - "load_from_db": true, - "title_case": false, -<<<<<<< HEAD - "input_types": [ - "Text" - ], -======= - "input_types": [ - "Text" - ], ->>>>>>> origin/dev - "value": "OPENAI_API_KEY" - }, - "stream": { - "type": "bool", - "required": false, - "placeholder": "", - "list": false, - "show": true, - "multiline": false, - "value": true, - "fileTypes": [], - "file_path": "", - "password": false, - "name": "stream", - "display_name": "Stream", - "advanced": true, - "dynamic": false, - "info": "Stream the response from the model. Streaming works only in Chat.", - "load_from_db": false, - "title_case": false - }, - "system_message": { - "type": "str", - "required": false, - "placeholder": "", - "list": false, - "show": true, - "multiline": false, - "fileTypes": [], - "file_path": "", - "password": false, - "name": "system_message", - "display_name": "System Message", - "advanced": true, - "dynamic": false, - "info": "System message to pass to the model.", - "load_from_db": false, - "title_case": false, -<<<<<<< HEAD - "input_types": [ - "Text" - ] -======= - "input_types": [ - "Text" - ] ->>>>>>> origin/dev - }, - "temperature": { - "type": "float", - "required": false, - "placeholder": "", - "list": false, - "show": true, - "multiline": false, - "value": 0.1, - "fileTypes": [], - "file_path": "", - "password": false, - "name": "temperature", - "display_name": "Temperature", - "advanced": false, - "dynamic": false, - "info": "", - "rangeSpec": { - "step_type": "float", - "min": -1, - "max": 1, - "step": 0.1 - }, - "load_from_db": false, - "title_case": false - }, - "_type": "CustomComponent" - }, - "description": "Generates text using OpenAI LLMs.", - "icon": "OpenAI", -<<<<<<< HEAD - "base_classes": [ - "object", - "Text", - "str" - ], -======= - "base_classes": [ - "object", - "Text", - "str" - ], ->>>>>>> origin/dev - "display_name": "OpenAI", - "documentation": "", - "custom_fields": { - "input_value": null, - "openai_api_key": null, - "temperature": null, - "model_name": null, - "max_tokens": null, - "model_kwargs": null, - "openai_api_base": null, - "stream": null, - "system_message": null - }, -<<<<<<< HEAD - "output_types": [ - "Text" - ], -======= - "output_types": [ - "Text" - ], ->>>>>>> origin/dev - "field_formatters": {}, - "frozen": false, - "field_order": [ - "max_tokens", - "model_kwargs", - "model_name", - "openai_api_base", - "openai_api_key", - "temperature", - "input_value", - "system_message", - "stream" - ], -<<<<<<< HEAD - "beta": false, - "outputs": [ - { - "types": [ - "Text" - ], - "selected": null, - "display_name": null, - "name": "Text", - "method": null - } - ] -======= - "beta": false ->>>>>>> origin/dev - }, - "id": "OpenAIModel-k39HS", - "description": "Generates text using OpenAI LLMs.", - "display_name": "OpenAI" - }, - "selected": false, - "width": 384, - "height": 563, - "positionAbsolute": { - "x": 634.8148772766217, - "y": 27.035057029045305 - }, - "dragging": false - }, - { - "id": "ChatOutput-njtka", - "type": "genericNode", - "position": { - "x": 1193.250417197867, - "y": 71.88476890163852 - }, - "data": { - "type": "ChatOutput", - "node": { - "template": { - "code": { - "type": "code", - "required": true, - "placeholder": "", - "list": false, - "show": true, - "multiline": true, -<<<<<<< HEAD - "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(\n name=\"input_value\", type=str, display_name=\"Message\", multiline=True, info=\"Message to be passed as output.\"\n ),\n Input(\n name=\"sender\",\n type=str,\n display_name=\"Sender Type\",\n options=[\"Machine\", \"User\"],\n value=\"Machine\",\n advanced=True,\n info=\"Type of sender.\",\n ),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\", info=\"Name of the sender.\", value=\"AI\"),\n Input(\n name=\"session_id\", type=str, display_name=\"Session ID\", info=\"Session ID for the message.\", advanced=True\n ),\n Input(\n name=\"record_template\",\n type=str,\n display_name=\"Record Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"text_response\"),\n Output(display_name=\"Record\", 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", -======= - "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", ->>>>>>> origin/dev - "fileTypes": [], - "file_path": "", - "password": false, - "name": "code", - "advanced": true, - "dynamic": true, - "info": "", - "load_from_db": false, - "title_case": false - }, - "input_value": { - "type": "str", - "required": false, - "placeholder": "", - "list": false, - "show": true, - "multiline": true, -<<<<<<< HEAD - "value": "", -======= ->>>>>>> origin/dev - "fileTypes": [], - "file_path": "", - "password": false, - "name": "input_value", - "display_name": "Message", - "advanced": false, -<<<<<<< HEAD - "dynamic": false, - "info": "Message to be passed as output.", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] -======= - "input_types": [ - "Text" - ], - "dynamic": false, - "info": "", - "load_from_db": false, - "title_case": false ->>>>>>> origin/dev - }, - "record_template": { - "type": "str", - "required": false, - "placeholder": "", - "list": false, - "show": true, -<<<<<<< HEAD - "multiline": false, - "value": "", -======= - "multiline": true, - "value": "{text}", ->>>>>>> origin/dev - "fileTypes": [], - "file_path": "", - "password": false, - "name": "record_template", - "display_name": "Record Template", - "advanced": true, - "dynamic": false, -<<<<<<< HEAD - "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] -======= - "info": "In case of Message being a Record, this template will be used to convert it to text.", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] - }, - "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 ->>>>>>> origin/dev - }, - "sender": { - "type": "str", - "required": false, - "placeholder": "", - "list": true, - "show": true, - "multiline": false, - "value": "Machine", - "fileTypes": [], - "file_path": "", - "password": false, -<<<<<<< HEAD - "options": [ - "Machine", - "User" - ], -======= - "options": [ - "Machine", - "User" - ], ->>>>>>> origin/dev - "name": "sender", - "display_name": "Sender Type", - "advanced": true, - "dynamic": false, -<<<<<<< HEAD - "info": "Type of sender.", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] ->>>>>>> origin/dev - }, - "sender_name": { - "type": "str", - "required": false, - "placeholder": "", - "list": false, - "show": true, - "multiline": false, - "value": "AI", - "fileTypes": [], - "file_path": "", - "password": false, - "name": "sender_name", - "display_name": "Sender Name", - "advanced": false, - "dynamic": false, -<<<<<<< HEAD - "info": "Name of the sender.", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] ->>>>>>> origin/dev - }, - "session_id": { - "type": "str", - "required": false, - "placeholder": "", - "list": false, - "show": true, - "multiline": false, -<<<<<<< HEAD - "value": "", -======= ->>>>>>> origin/dev - "fileTypes": [], - "file_path": "", - "password": false, - "name": "session_id", - "display_name": "Session ID", - "advanced": true, - "dynamic": false, -<<<<<<< HEAD - "info": "Session ID for the message.", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] - }, - "_type": "Component" - }, - "description": "Display a chat message in the Playground.", - "icon": "ChatOutput", - "base_classes": [ - "Record", - "Text", - "str", - "object" - ], -======= - "info": "If provided, the message will be stored in the memory.", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] - }, - "_type": "CustomComponent" - }, - "description": "Display a chat message in the Playground.", - "icon": "ChatOutput", - "base_classes": [ - "Record", - "Text", - "str", - "object" - ], ->>>>>>> origin/dev - "display_name": "Chat Output", - "documentation": "", - "custom_fields": { - "sender": null, - "sender_name": null, - "input_value": null, - "session_id": null, - "return_record": null, - "record_template": null - }, -<<<<<<< HEAD - "output_types": [ - "Text", - "Record" - ], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false, - "outputs": [ - { - "types": [ - "Text" - ], - "selected": "Text", - "display_name": "Message", - "name": "message", - "method": "text_response" - }, - { - "types": [ - "Record" - ], - "selected": "Record", - "display_name": "Record", - "name": "record", - "method": "record_response" + "selected": true, + "width": 384, + "height": 383, + "dragging": false, + "positionAbsolute": { + "x": 53.588791333410654, + "y": -107.07318910019967 } - ] -======= - "output_types": [ - "Text", - "Record" - ], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev - }, - "id": "ChatOutput-njtka" - }, - "selected": false, - "width": 384, - "height": 383, - "positionAbsolute": { - "x": 1193.250417197867, - "y": 71.88476890163852 - }, - "dragging": false -}, -{ - "id": "ChatInput-P3fgL", - "type": "genericNode", - "position": { - "x": -495.2223093083827, - "y": -232.56998443685862 - }, - "data": { - "type": "ChatInput", - "node": { - "template": { - "code": { - "type": "code", - "required": true, - "placeholder": "", - "list": false, - "show": true, - "multiline": true, -<<<<<<< HEAD - "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(\n name=\"input_value\",\n type=str,\n display_name=\"Message\",\n multiline=True,\n input_types=[],\n info=\"Message to be passed as input.\",\n ),\n Input(\n name=\"sender\",\n type=str,\n display_name=\"Sender Type\",\n options=[\"Machine\", \"User\"],\n value=\"User\",\n info=\"Type of sender.\",\n advanced=True,\n ),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\", info=\"Name of the sender.\", value=\"User\"),\n Input(\n name=\"session_id\", type=str, display_name=\"Session ID\", info=\"Session ID for the message.\", advanced=True\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"text_response\"),\n Output(display_name=\"Record\", 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", -======= - "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 ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\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 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", ->>>>>>> origin/dev - "fileTypes": [], - "file_path": "", - "password": false, - "name": "code", - "advanced": true, - "dynamic": true, - "info": "", - "load_from_db": false, - "title_case": false - }, - "input_value": { - "type": "str", - "required": false, - "placeholder": "", - "list": false, - "show": true, - "multiline": true, -<<<<<<< HEAD - "value": "Hello, world!", -======= ->>>>>>> origin/dev - "fileTypes": [], - "file_path": "", - "password": false, - "name": "input_value", - "display_name": "Message", - "advanced": false, - "input_types": [], - "dynamic": false, -<<<<<<< HEAD - "info": "Message to be passed as input.", -======= - "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.", ->>>>>>> origin/dev - "load_from_db": false, - "title_case": false - }, - "sender": { - "type": "str", - "required": false, - "placeholder": "", - "list": true, - "show": true, - "multiline": false, - "value": "User", - "fileTypes": [], - "file_path": "", - "password": false, -<<<<<<< HEAD - "options": [ - "Machine", - "User" - ], -======= - "options": [ - "Machine", - "User" - ], ->>>>>>> origin/dev - "name": "sender", - "display_name": "Sender Type", - "advanced": true, - "dynamic": false, -<<<<<<< HEAD - "info": "Type of sender.", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] ->>>>>>> origin/dev - }, - "sender_name": { - "type": "str", - "required": false, - "placeholder": "", - "list": false, - "show": true, - "multiline": false, - "value": "User", - "fileTypes": [], - "file_path": "", - "password": false, - "name": "sender_name", - "display_name": "Sender Name", - "advanced": false, - "dynamic": false, -<<<<<<< HEAD - "info": "Name of the sender.", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] ->>>>>>> origin/dev - }, - "session_id": { - "type": "str", - "required": false, - "placeholder": "", - "list": false, - "show": true, - "multiline": false, -<<<<<<< HEAD - "value": "", -======= ->>>>>>> origin/dev - "fileTypes": [], - "file_path": "", - "password": false, - "name": "session_id", - "display_name": "Session ID", - "advanced": true, - "dynamic": false, -<<<<<<< HEAD - "info": "Session ID for the message.", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] - }, - "_type": "Component" }, - "description": "Get chat inputs from the Playground.", - "icon": "ChatInput", - "base_classes": [ - "object", - "Record", - "str", - "Text" - ], -======= - "info": "If provided, the message will be stored in the memory.", - "load_from_db": false, - "title_case": false, - "input_types": [ - "Text" - ] - }, - "_type": "CustomComponent" - }, - "description": "Get chat inputs from the Playground.", - "icon": "ChatInput", - "base_classes": [ - "object", - "Record", - "str", - "Text" - ], ->>>>>>> origin/dev + { + "id": "OpenAIModel-k39HS", + "type": "genericNode", + "position": { + "x": 634.8148772766217, + "y": 27.035057029045305 + }, + "data": { + "type": "OpenAIModel", + "node": { + "template": { + "input_value": { + "type": "str", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": false, + "fileTypes": [], + "file_path": "", + "password": false, + "name": "input_value", + "display_name": "Input", + "advanced": false, + "dynamic": false, + "info": "", + "load_from_db": false, + "title_case": false, + "input_types": [ + "Text" + ] + }, + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "from typing import Optional\n\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.constants import STREAM_INFO_TEXT\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import MODEL_NAMES\nfrom langflow.field_typing import NestedDict, Text\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n\n field_order = [\n \"max_tokens\",\n \"model_kwargs\",\n \"model_name\",\n \"openai_api_base\",\n \"openai_api_key\",\n \"temperature\",\n \"input_value\",\n \"system_message\",\n \"stream\",\n ]\n\n def build_config(self):\n return {\n \"input_value\": {\"display_name\": \"Input\"},\n \"max_tokens\": {\n \"display_name\": \"Max Tokens\",\n \"advanced\": True,\n \"info\": \"The maximum number of tokens to generate. Set to 0 for unlimited tokens.\",\n },\n \"model_kwargs\": {\n \"display_name\": \"Model Kwargs\",\n \"advanced\": True,\n },\n \"model_name\": {\n \"display_name\": \"Model Name\",\n \"advanced\": False,\n \"options\": MODEL_NAMES,\n },\n \"openai_api_base\": {\n \"display_name\": \"OpenAI API Base\",\n \"advanced\": True,\n \"info\": (\n \"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\\n\\n\"\n \"You can change this to use other APIs like JinaChat, LocalAI and Prem.\"\n ),\n },\n \"openai_api_key\": {\n \"display_name\": \"OpenAI API Key\",\n \"info\": \"The OpenAI API Key to use for the OpenAI model.\",\n \"advanced\": False,\n \"password\": True,\n },\n \"temperature\": {\n \"display_name\": \"Temperature\",\n \"advanced\": False,\n \"value\": 0.1,\n },\n \"stream\": {\n \"display_name\": \"Stream\",\n \"info\": STREAM_INFO_TEXT,\n \"advanced\": True,\n },\n \"system_message\": {\n \"display_name\": \"System Message\",\n \"info\": \"System message to pass to the model.\",\n \"advanced\": True,\n },\n }\n\n def build(\n self,\n input_value: Text,\n openai_api_key: str,\n temperature: float = 0.1,\n model_name: str = \"gpt-4o\",\n max_tokens: Optional[int] = 256,\n model_kwargs: NestedDict = {},\n openai_api_base: Optional[str] = None,\n stream: bool = False,\n system_message: Optional[str] = None,\n ) -> Text:\n if not openai_api_base:\n openai_api_base = \"https://api.openai.com/v1\"\n if openai_api_key:\n api_key = SecretStr(openai_api_key)\n else:\n api_key = None\n\n output = ChatOpenAI(\n max_tokens=max_tokens or None,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=api_key,\n temperature=temperature,\n )\n\n return self.get_chat_result(output, stream, input_value, system_message)\n", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "max_tokens": { + "type": "int", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": false, + "value": 256, + "fileTypes": [], + "file_path": "", + "password": false, + "name": "max_tokens", + "display_name": "Max Tokens", + "advanced": true, + "dynamic": false, + "info": "The maximum number of tokens to generate. Set to 0 for unlimited tokens.", + "load_from_db": false, + "title_case": false + }, + "model_kwargs": { + "type": "NestedDict", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": false, + "value": {}, + "fileTypes": [], + "file_path": "", + "password": false, + "name": "model_kwargs", + "display_name": "Model Kwargs", + "advanced": true, + "dynamic": false, + "info": "", + "load_from_db": false, + "title_case": false + }, + "model_name": { + "type": "str", + "required": false, + "placeholder": "", + "list": true, + "show": true, + "multiline": false, + "value": "gpt-3.5-turbo", + "fileTypes": [], + "file_path": "", + "password": false, + "options": [ + "gpt-4o", + "gpt-4-turbo", + "gpt-4-turbo-preview", + "gpt-3.5-turbo", + "gpt-3.5-turbo-0125" + ], + "name": "model_name", + "display_name": "Model Name", + "advanced": false, + "dynamic": false, + "info": "", + "load_from_db": false, + "title_case": false, + "input_types": [ + "Text" + ] + }, + "openai_api_base": { + "type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": false, + "fileTypes": [], + "file_path": "", + "password": false, + "name": "openai_api_base", + "display_name": "OpenAI API Base", + "advanced": true, + "dynamic": false, + "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", + "load_from_db": false, + "title_case": false, + "input_types": [ + "Text" + ] + }, + "openai_api_key": { + "type": "str", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": false, + "fileTypes": [], + "file_path": "", + "password": true, + "name": "openai_api_key", + "display_name": "OpenAI API Key", + "advanced": false, + "dynamic": false, + "info": "The OpenAI API Key to use for the OpenAI model.", + "load_from_db": true, + "title_case": false, + "input_types": [ + "Text" + ], + "value": "OPENAI_API_KEY" + }, + "stream": { + "type": "bool", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": false, + "value": true, + "fileTypes": [], + "file_path": "", + "password": false, + "name": "stream", + "display_name": "Stream", + "advanced": true, + "dynamic": false, + "info": "Stream the response from the model. Streaming works only in Chat.", + "load_from_db": false, + "title_case": false + }, + "system_message": { + "type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": false, + "fileTypes": [], + "file_path": "", + "password": false, + "name": "system_message", + "display_name": "System Message", + "advanced": true, + "dynamic": false, + "info": "System message to pass to the model.", + "load_from_db": false, + "title_case": false, + "input_types": [ + "Text" + ] + }, + "temperature": { + "type": "float", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": false, + "value": 0.1, + "fileTypes": [], + "file_path": "", + "password": false, + "name": "temperature", + "display_name": "Temperature", + "advanced": false, + "dynamic": false, + "info": "", + "rangeSpec": { + "step_type": "float", + "min": -1, + "max": 1, + "step": 0.1 + }, + "load_from_db": false, + "title_case": false + }, + "_type": "CustomComponent" + }, + "description": "Generates text using OpenAI LLMs.", + "icon": "OpenAI", + "base_classes": [ + "object", + "Text", + "str" + ], + "display_name": "OpenAI", + "documentation": "", + "custom_fields": { + "input_value": null, + "openai_api_key": null, + "temperature": null, + "model_name": null, + "max_tokens": null, + "model_kwargs": null, + "openai_api_base": null, + "stream": null, + "system_message": null + }, + "output_types": [ + "Text" + ], + "field_formatters": {}, + "frozen": false, + "field_order": [ + "max_tokens", + "model_kwargs", + "model_name", + "openai_api_base", + "openai_api_key", + "temperature", + "input_value", + "system_message", + "stream" + ], + "beta": false, + "outputs": [ + { + "types": [ + "Text" + ], + "selected": null, + "display_name": null, + "name": "Text", + "method": null + } + ] + }, + "id": "OpenAIModel-k39HS", + "description": "Generates text using OpenAI LLMs.", + "display_name": "OpenAI" + }, + "selected": false, + "width": 384, + "height": 563, + "positionAbsolute": { + "x": 634.8148772766217, + "y": 27.035057029045305 + }, + "dragging": false + }, + { + "id": "ChatOutput-njtka", + "type": "genericNode", + "position": { + "x": 1193.250417197867, + "y": 71.88476890163852 + }, + "data": { + "type": "ChatOutput", + "node": { + "template": { + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "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(\n name=\"input_value\", type=str, display_name=\"Message\", multiline=True, info=\"Message to be passed as output.\"\n ),\n Input(\n name=\"sender\",\n type=str,\n display_name=\"Sender Type\",\n options=[\"Machine\", \"User\"],\n value=\"Machine\",\n advanced=True,\n info=\"Type of sender.\",\n ),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\", info=\"Name of the sender.\", value=\"AI\"),\n Input(\n name=\"session_id\", type=str, display_name=\"Session ID\", info=\"Session ID for the message.\", advanced=True\n ),\n Input(\n name=\"record_template\",\n type=str,\n display_name=\"Record Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"text_response\"),\n Output(display_name=\"Record\", 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, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "input_value": { + "type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "input_value", + "display_name": "Message", + "advanced": false, + "dynamic": false, + "info": "Message to be passed as output.", + "load_from_db": false, + "title_case": false, + "input_types": [ + "Text" + ] + }, + "record_template": { + "type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": false, + "value": "", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "record_template", + "display_name": "Record Template", + "advanced": true, + "dynamic": false, + "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", + "load_from_db": false, + "title_case": false, + "input_types": [ + "Text" + ] + }, + "sender": { + "type": "str", + "required": false, + "placeholder": "", + "list": true, + "show": true, + "multiline": false, + "value": "Machine", + "fileTypes": [], + "file_path": "", + "password": false, + "options": [ + "Machine", + "User" + ], + "name": "sender", + "display_name": "Sender Type", + "advanced": true, + "dynamic": false, + "info": "Type of sender.", + "load_from_db": false, + "title_case": false, + "input_types": [ + "Text" + ] + }, + "sender_name": { + "type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": false, + "value": "AI", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "sender_name", + "display_name": "Sender Name", + "advanced": false, + "dynamic": false, + "info": "Name of the sender.", + "load_from_db": false, + "title_case": false, + "input_types": [ + "Text" + ] + }, + "session_id": { + "type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": false, + "value": "", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "session_id", + "display_name": "Session ID", + "advanced": true, + "dynamic": false, + "info": "Session ID for the message.", + "load_from_db": false, + "title_case": false, + "input_types": [ + "Text" + ] + }, + "_type": "Component" + }, + "description": "Display a chat message in the Playground.", + "icon": "ChatOutput", + "base_classes": [ + "Record", + "Text", + "str", + "object" + ], + "display_name": "Chat Output", + "documentation": "", + "custom_fields": { + "sender": null, + "sender_name": null, + "input_value": null, + "session_id": null, + "return_record": null, + "record_template": null + }, + "output_types": [ + "Text", + "Record" + ], + "field_formatters": {}, + "frozen": false, + "field_order": [], + "beta": false, + "outputs": [ + { + "types": [ + "Text" + ], + "selected": "Text", + "display_name": "Message", + "name": "message", + "method": "text_response" + }, + { + "types": [ + "Record" + ], + "selected": "Record", + "display_name": "Record", + "name": "record", + "method": "record_response" + } + ] + }, + "id": "ChatOutput-njtka" + }, + "selected": false, + "width": 384, + "height": 383, + "positionAbsolute": { + "x": 1193.250417197867, + "y": 71.88476890163852 + }, + "dragging": false + }, + { + "id": "ChatInput-P3fgL", + "type": "genericNode", + "position": { + "x": -495.2223093083827, + "y": -232.56998443685862 + }, + "data": { + "type": "ChatInput", + "node": { + "template": { + "code": { + "type": "code", + "required": true, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "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(\n name=\"input_value\",\n type=str,\n display_name=\"Message\",\n multiline=True,\n input_types=[],\n info=\"Message to be passed as input.\",\n ),\n Input(\n name=\"sender\",\n type=str,\n display_name=\"Sender Type\",\n options=[\"Machine\", \"User\"],\n value=\"User\",\n info=\"Type of sender.\",\n advanced=True,\n ),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\", info=\"Name of the sender.\", value=\"User\"),\n Input(\n name=\"session_id\", type=str, display_name=\"Session ID\", info=\"Session ID for the message.\", advanced=True\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"text_response\"),\n Output(display_name=\"Record\", 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, + "name": "code", + "advanced": true, + "dynamic": true, + "info": "", + "load_from_db": false, + "title_case": false + }, + "input_value": { + "type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": true, + "value": "Hello, world!", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "input_value", + "display_name": "Message", + "advanced": false, + "input_types": [], + "dynamic": false, + "info": "Message to be passed as input.", + "load_from_db": false, + "title_case": false + }, + "sender": { + "type": "str", + "required": false, + "placeholder": "", + "list": true, + "show": true, + "multiline": false, + "value": "User", + "fileTypes": [], + "file_path": "", + "password": false, + "options": [ + "Machine", + "User" + ], + "name": "sender", + "display_name": "Sender Type", + "advanced": true, + "dynamic": false, + "info": "Type of sender.", + "load_from_db": false, + "title_case": false, + "input_types": [ + "Text" + ] + }, + "sender_name": { + "type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": false, + "value": "User", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "sender_name", + "display_name": "Sender Name", + "advanced": false, + "dynamic": false, + "info": "Name of the sender.", + "load_from_db": false, + "title_case": false, + "input_types": [ + "Text" + ] + }, + "session_id": { + "type": "str", + "required": false, + "placeholder": "", + "list": false, + "show": true, + "multiline": false, + "value": "", + "fileTypes": [], + "file_path": "", + "password": false, + "name": "session_id", + "display_name": "Session ID", + "advanced": true, + "dynamic": false, + "info": "Session ID for the message.", + "load_from_db": false, + "title_case": false, + "input_types": [ + "Text" + ] + }, + "_type": "Component" + }, + "description": "Get chat inputs from the Playground.", + "icon": "ChatInput", + "base_classes": [ + "object", + "Record", + "str", + "Text" + ], "display_name": "Chat Input", - "documentation": "", - "custom_fields": { - "sender": null, - "sender_name": null, - "input_value": null, - "session_id": null, - "return_record": null - }, -<<<<<<< HEAD + "documentation": "", + "custom_fields": { + "sender": null, + "sender_name": null, + "input_value": null, + "session_id": null, + "return_record": null + }, "output_types": [ - "Text", - "Record" - ], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false, - "outputs": [ - { - "types": [ - "Text" - ], - "selected": "Text", - "display_name": "Message", - "name": "message", - "method": "text_response" - }, - { - "types": [ - "Record" - ], - "selected": "Record", - "display_name": "Record", - "name": "record", - "method": "record_response" - } - ] -======= - "output_types": [ - "Text", - "Record" - ], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev -}, -"id": "ChatInput-P3fgL" -}, -"selected": false, -"width": 384, -"height": 375, -"positionAbsolute": { -"x": -495.2223093083827, -"y": -232.56998443685862 -}, -"dragging": false -} -], -"edges": [ -{ -"source": "OpenAIModel-k39HS", -<<<<<<< HEAD + "Text", + "Record" + ], + "field_formatters": {}, + "frozen": false, + "field_order": [], + "beta": false, + "outputs": [ + { + "types": [ + "Text" + ], + "selected": "Text", + "display_name": "Message", + "name": "message", + "method": "text_response" + }, + { + "types": [ + "Record" + ], + "selected": "Record", + "display_name": "Record", + "name": "record", + "method": "record_response" + } + ] + }, + "id": "ChatInput-P3fgL" + }, + "selected": false, + "width": 384, + "height": 375, + "positionAbsolute": { + "x": -495.2223093083827, + "y": -232.56998443685862 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "OpenAIModel-k39HS", "sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-k39HS\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-k39HSœ}", ->>>>>>> origin/dev "target": "ChatOutput-njtka", -"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-njtkaœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", -"data": { -"targetHandle": { - "fieldName": "input_value", - "id": "ChatOutput-njtka", -<<<<<<< HEAD + "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-njtkaœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "input_value", + "id": "ChatOutput-njtka", "inputTypes": [ - "Text" - ], - "type": "str" -}, -"sourceHandle": { - "dataType": "OpenAIModel", - "id": "OpenAIModel-k39HS", - "output_types": [ - "Text" - ], - "name": "Text" -======= - "inputTypes": [ - "Text" - ], - "type": "str" -}, -"sourceHandle": { - "baseClasses": [ - "object", - "Text", - "str" - ], - "dataType": "OpenAIModel", - "id": "OpenAIModel-k39HS" ->>>>>>> origin/dev -} -}, -"style": { -"stroke": "#555" -}, -"className": "stroke-gray-900 stroke-connection", -"id": "reactflow__edge-OpenAIModel-k39HS{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-k39HSœ}-ChatOutput-njtka{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-njtkaœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}" -}, -{ -"source": "Prompt-uxBqP", -<<<<<<< HEAD + "Text" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "OpenAIModel", + "id": "OpenAIModel-k39HS", + "output_types": [ + "Text" + ], + "name": "Text" + } + }, + "style": { + "stroke": "#555" + }, + "className": "stroke-gray-900 stroke-connection", + "id": "reactflow__edge-OpenAIModel-k39HS{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-k39HSœ}-ChatOutput-njtka{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-njtkaœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}" + }, + { + "source": "Prompt-uxBqP", "sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-uxBqP\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-uxBqPœ}", ->>>>>>> origin/dev "target": "OpenAIModel-k39HS", -"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-k39HSœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", -"data": { -"targetHandle": { - "fieldName": "input_value", - "id": "OpenAIModel-k39HS", -<<<<<<< HEAD + "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-k39HSœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "input_value", + "id": "OpenAIModel-k39HS", "inputTypes": [ - "Text" - ], - "type": "str" -}, -"sourceHandle": { - "dataType": "Prompt", - "id": "Prompt-uxBqP", - "output_types": [ - "Text" - ], - "name": "Text" -======= - "inputTypes": [ - "Text" - ], - "type": "str" -}, -"sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], - "dataType": "Prompt", - "id": "Prompt-uxBqP" ->>>>>>> origin/dev -} -}, -"style": { -"stroke": "#555" -}, -"className": "stroke-gray-900 stroke-connection", -"id": "reactflow__edge-Prompt-uxBqP{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-uxBqPœ}-OpenAIModel-k39HS{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-k39HSœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}" -}, -{ -"source": "ChatInput-P3fgL", -<<<<<<< HEAD + "Text" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "Prompt", + "id": "Prompt-uxBqP", + "output_types": [ + "Text" + ], + "name": "Text" + } + }, + "style": { + "stroke": "#555" + }, + "className": "stroke-gray-900 stroke-connection", + "id": "reactflow__edge-Prompt-uxBqP{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-uxBqPœ}-OpenAIModel-k39HS{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-k39HSœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}" + }, + { + "source": "ChatInput-P3fgL", "sourceHandle": "{\"dataType\": \"ChatInput\", \"id\": \"ChatInput-P3fgL\", \"output_types\": [\"Text\"], \"name\": \"message\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œobjectœ,œRecordœ,œstrœ,œTextœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-P3fgLœ}", ->>>>>>> origin/dev "target": "Prompt-uxBqP", -"targetHandle": "{œfieldNameœ:œuser_inputœ,œidœ:œPrompt-uxBqPœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", -"data": { -"targetHandle": { - "fieldName": "user_input", - "id": "Prompt-uxBqP", -<<<<<<< HEAD + "targetHandle": "{œfieldNameœ:œuser_inputœ,œidœ:œPrompt-uxBqPœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", + "data": { + "targetHandle": { + "fieldName": "user_input", + "id": "Prompt-uxBqP", "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], - "type": "str" -}, -"sourceHandle": { - "dataType": "ChatInput", - "id": "ChatInput-P3fgL", - "output_types": [ - "Text" - ], - "name": "message" -======= - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], - "type": "str" -}, -"sourceHandle": { - "baseClasses": [ - "object", - "Record", - "str", - "Text" - ], - "dataType": "ChatInput", - "id": "ChatInput-P3fgL" ->>>>>>> origin/dev -} -}, -"style": { -"stroke": "#555" -}, -"className": "stroke-gray-900 stroke-connection", -"id": "reactflow__edge-ChatInput-P3fgL{œbaseClassesœ:[œobjectœ,œRecordœ,œstrœ,œTextœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-P3fgLœ}-Prompt-uxBqP{œfieldNameœ:œuser_inputœ,œidœ:œPrompt-uxBqPœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}" -} -], -"viewport": { -"x": 260.58251815500563, -"y": 318.2261172111936, -"zoom": 0.43514115784696294 -} -}, -"description": "This flow will get you experimenting with the basics of the UI, the Chat and the Prompt component. \n\nTry changing the Template in it to see how the model behaves. \nYou can change it to this and a Text Input into the `type_of_person` variable : \"Answer the user as if you were a pirate.\n\nUser: {user_input}\n\nAnswer: \" ", -"name": "Basic Prompting (Hello, World)", -"last_tested_version": "1.0.0a4", -"is_component": false -<<<<<<< HEAD -} -======= -} ->>>>>>> origin/dev + "Document", + "BaseOutputParser", + "Record", + "Text" + ], + "type": "str" + }, + "sourceHandle": { + "dataType": "ChatInput", + "id": "ChatInput-P3fgL", + "output_types": [ + "Text" + ], + "name": "message" + } + }, + "style": { + "stroke": "#555" + }, + "className": "stroke-gray-900 stroke-connection", + "id": "reactflow__edge-ChatInput-P3fgL{œbaseClassesœ:[œobjectœ,œRecordœ,œstrœ,œTextœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-P3fgLœ}-Prompt-uxBqP{œfieldNameœ:œuser_inputœ,œidœ:œPrompt-uxBqPœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}" + } + ], + "viewport": { + "x": 260.58251815500563, + "y": 318.2261172111936, + "zoom": 0.43514115784696294 + } + }, + "description": "This flow will get you experimenting with the basics of the UI, the Chat and the Prompt component. \n\nTry changing the Template in it to see how the model behaves. \nYou can change it to this and a Text Input into the `type_of_person` variable : \"Answer the user as if you were a pirate.\n\nUser: {user_input}\n\nAnswer: \" ", + "name": "Basic Prompting (Hello, World)", + "last_tested_version": "1.0.0a4", + "is_component": false +} \ No newline at end of file diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Blog Writter.json b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Blog Writter.json index 534cb60da..36b512f55 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Blog Writter.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Blog Writter.json @@ -20,11 +20,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import Input, Prompt, Text\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": Input(display_name=\"Template\"),\n \"code\": Input(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n", -======= - "value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import Prompt, TemplateField, Text\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": TemplateField(display_name=\"Template\"),\n \"code\": TemplateField(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -49,13 +45,9 @@ "name": "template", "display_name": "Template", "advanced": false, -<<<<<<< HEAD "input_types": [ "Text" ], -======= - "input_types": ["Text"], ->>>>>>> origin/dev "dynamic": false, "info": "", "load_from_db": false, @@ -146,20 +138,15 @@ "is_input": null, "is_output": null, "is_composition": null, -<<<<<<< HEAD "base_classes": [ "object", "Text", "str" ], -======= - "base_classes": ["object", "Text", "str"], ->>>>>>> origin/dev "name": "", "display_name": "Prompt", "documentation": "", "custom_fields": { -<<<<<<< HEAD "template": [ "reference_1", "reference_2", @@ -169,17 +156,11 @@ "output_types": [ "Text" ], -======= - "template": ["reference_1", "reference_2", "instructions"] - }, - "output_types": ["Text"], ->>>>>>> origin/dev "full_path": null, "field_formatters": {}, "frozen": false, "field_order": [], "beta": false, -<<<<<<< HEAD "error": null, "outputs": [ { @@ -192,9 +173,6 @@ "method": null } ] -======= - "error": null ->>>>>>> origin/dev }, "id": "Prompt-Rse03", "description": "Create a prompt template with dynamic variables.", @@ -255,13 +233,9 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ], -======= - "input_types": ["Text"], ->>>>>>> origin/dev "value": [ "https://www.promptingguide.ai/techniques/prompt_chaining" ] @@ -270,19 +244,14 @@ }, "description": "Fetch content from one or more URLs.", "icon": "layout-template", -<<<<<<< HEAD "base_classes": [ "Record" ], -======= - "base_classes": ["Record"], ->>>>>>> origin/dev "display_name": "URL", "documentation": "", "custom_fields": { "urls": null }, -<<<<<<< HEAD "output_types": [ "Record" ], @@ -301,13 +270,6 @@ "method": null } ] -======= - "output_types": ["Record"], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev }, "id": "URL-HYPkR" }, @@ -338,11 +300,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "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(\n name=\"input_value\", type=str, display_name=\"Message\", multiline=True, info=\"Message to be passed as output.\"\n ),\n Input(\n name=\"sender\",\n type=str,\n display_name=\"Sender Type\",\n options=[\"Machine\", \"User\"],\n value=\"Machine\",\n advanced=True,\n info=\"Type of sender.\",\n ),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\", info=\"Name of the sender.\", value=\"AI\"),\n Input(\n name=\"session_id\", type=str, display_name=\"Session ID\", info=\"Session ID for the message.\", advanced=True\n ),\n Input(\n name=\"record_template\",\n type=str,\n display_name=\"Record Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"text_response\"),\n Output(display_name=\"Record\", 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", -======= - "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", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -360,17 +318,13 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, "name": "input_value", "display_name": "Message", "advanced": false, -<<<<<<< HEAD "dynamic": false, "info": "Message to be passed as output.", "load_from_db": false, @@ -378,13 +332,6 @@ "input_types": [ "Text" ] -======= - "input_types": ["Text"], - "dynamic": false, - "info": "", - "load_from_db": false, - "title_case": false ->>>>>>> origin/dev }, "record_template": { "type": "str", @@ -392,13 +339,8 @@ "placeholder": "", "list": false, "show": true, -<<<<<<< HEAD "multiline": false, "value": "", -======= - "multiline": true, - "value": "{text}", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -406,38 +348,12 @@ "display_name": "Record Template", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "In case of Message being a Record, this template will be used to convert it to text.", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] - }, - "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 ->>>>>>> origin/dev }, "sender": { "type": "str", @@ -446,7 +362,6 @@ "list": true, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", "fileTypes": [], "file_path": "", @@ -455,30 +370,16 @@ "Machine", "User" ], -======= - "value": "Machine", - "fileTypes": [], - "file_path": "", - "password": false, - "options": ["Machine", "User"], ->>>>>>> origin/dev "name": "sender", "display_name": "Sender Type", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Type of sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "sender_name": { "type": "str", @@ -487,11 +388,7 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= - "value": "AI", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -499,19 +396,12 @@ "display_name": "Sender Name", "advanced": false, "dynamic": false, -<<<<<<< HEAD "info": "Name of the sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "session_id": { "type": "str", @@ -520,10 +410,7 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -531,7 +418,6 @@ "display_name": "Session ID", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Session ID for the message.", "load_from_db": false, "title_case": false, @@ -549,18 +435,6 @@ "object", "str" ], -======= - "info": "If provided, the message will be stored in the memory.", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] - }, - "_type": "CustomComponent" - }, - "description": "Display a chat message in the Playground.", - "icon": "ChatOutput", - "base_classes": ["Text", "Record", "object", "str"], ->>>>>>> origin/dev "display_name": "Chat Output", "documentation": "", "custom_fields": { @@ -571,7 +445,6 @@ "return_record": null, "record_template": null }, -<<<<<<< HEAD "output_types": [ "Text", "Record" @@ -600,13 +473,6 @@ "method": "record_response" } ] -======= - "output_types": ["Text", "Record"], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev }, "id": "ChatOutput-JPlxl" }, @@ -642,13 +508,9 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "code": { "type": "code", @@ -731,13 +593,9 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "openai_api_base": { "type": "str", @@ -756,13 +614,9 @@ "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "openai_api_key": { "type": "str", @@ -781,13 +635,9 @@ "info": "The OpenAI API Key to use for the OpenAI model.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ], -======= - "input_types": ["Text"], ->>>>>>> origin/dev "value": "OPENAI_API_KEY" }, "stream": { @@ -826,13 +676,9 @@ "info": "System message to pass to the model.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "temperature": { "type": "float", @@ -863,15 +709,11 @@ }, "description": "Generates text using OpenAI LLMs.", "icon": "OpenAI", -<<<<<<< HEAD "base_classes": [ "str", "Text", "object" ], -======= - "base_classes": ["str", "Text", "object"], ->>>>>>> origin/dev "display_name": "OpenAI", "documentation": "", "custom_fields": { @@ -885,13 +727,9 @@ "stream": null, "system_message": null }, -<<<<<<< HEAD "output_types": [ "Text" ], -======= - "output_types": ["Text"], ->>>>>>> origin/dev "field_formatters": {}, "frozen": false, "field_order": [ @@ -905,7 +743,6 @@ "system_message", "stream" ], -<<<<<<< HEAD "beta": false, "outputs": [ { @@ -918,9 +755,6 @@ "method": null } ] -======= - "beta": false ->>>>>>> origin/dev }, "id": "OpenAIModel-gi29P" }, @@ -979,35 +813,25 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ], "value": [ "https://www.promptingguide.ai/introduction/basics" ] -======= - "input_types": ["Text"], - "value": ["https://www.promptingguide.ai/introduction/basics"] ->>>>>>> origin/dev }, "_type": "CustomComponent" }, "description": "Fetch content from one or more URLs.", "icon": "layout-template", -<<<<<<< HEAD "base_classes": [ "Record" ], -======= - "base_classes": ["Record"], ->>>>>>> origin/dev "display_name": "URL", "documentation": "", "custom_fields": { "urls": null }, -<<<<<<< HEAD "output_types": [ "Record" ], @@ -1026,13 +850,6 @@ "method": null } ] -======= - "output_types": ["Record"], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev }, "id": "URL-2cX90" }, @@ -1088,14 +905,10 @@ "name": "input_value", "display_name": "Value", "advanced": false, -<<<<<<< HEAD "input_types": [ "Record", "Text" ], -======= - "input_types": ["Record", "Text"], ->>>>>>> origin/dev "dynamic": false, "info": "Text or Record to be passed as input.", "load_from_db": false, @@ -1119,34 +932,25 @@ "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "_type": "CustomComponent" }, "description": "Get text inputs from the Playground.", "icon": "type", -<<<<<<< HEAD "base_classes": [ "object", "Text", "str" ], -======= - "base_classes": ["object", "Text", "str"], ->>>>>>> origin/dev "display_name": "Instructions", "documentation": "", "custom_fields": { "input_value": null, "record_template": null }, -<<<<<<< HEAD "output_types": [ "Text" ], @@ -1163,13 +967,6 @@ "name": "Text" } ] -======= - "output_types": ["Text"], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev }, "id": "TextInput-og8Or" }, @@ -1187,18 +984,13 @@ { "source": "URL-HYPkR", "target": "Prompt-Rse03", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"URL\", \"id\": \"URL-HYPkR\", \"output_types\": [\"Record\"], \"name\": \"Record\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œRecordœ],œdataTypeœ:œURLœ,œidœ:œURL-HYPkRœ}", ->>>>>>> origin/dev "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": { "targetHandle": { "fieldName": "reference_2", "id": "Prompt-Rse03", -<<<<<<< HEAD "inputTypes": [ "Document", "BaseOutputParser", @@ -1214,15 +1006,6 @@ "Record" ], "name": "Record" -======= - "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["Record"], - "dataType": "URL", - "id": "URL-HYPkR" ->>>>>>> origin/dev } }, "style": { @@ -1233,18 +1016,13 @@ }, { "source": "OpenAIModel-gi29P", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-gi29P\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-gi29Pœ}", ->>>>>>> origin/dev "target": "ChatOutput-JPlxl", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-JPlxlœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-JPlxl", -<<<<<<< HEAD "inputTypes": [ "Text" ], @@ -1257,15 +1035,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["str", "Text", "object"], - "dataType": "OpenAIModel", - "id": "OpenAIModel-gi29P" ->>>>>>> origin/dev } }, "style": { @@ -1276,18 +1045,13 @@ }, { "source": "URL-2cX90", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"URL\", \"id\": \"URL-2cX90\", \"output_types\": [\"Record\"], \"name\": \"Record\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œRecordœ],œdataTypeœ:œURLœ,œidœ:œURL-2cX90œ}", ->>>>>>> origin/dev "target": "Prompt-Rse03", "targetHandle": "{œfieldNameœ:œreference_1œ,œidœ:œPrompt-Rse03œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "reference_1", "id": "Prompt-Rse03", -<<<<<<< HEAD "inputTypes": [ "Document", "BaseOutputParser", @@ -1303,15 +1067,6 @@ "Record" ], "name": "Record" -======= - "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["Record"], - "dataType": "URL", - "id": "URL-2cX90" ->>>>>>> origin/dev } }, "style": { @@ -1322,18 +1077,13 @@ }, { "source": "TextInput-og8Or", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"TextInput\", \"id\": \"TextInput-og8Or\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-og8Orœ}", ->>>>>>> origin/dev "target": "Prompt-Rse03", "targetHandle": "{œfieldNameœ:œinstructionsœ,œidœ:œPrompt-Rse03œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "instructions", "id": "Prompt-Rse03", -<<<<<<< HEAD "inputTypes": [ "Document", "BaseOutputParser", @@ -1349,15 +1099,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["object", "Text", "str"], - "dataType": "TextInput", - "id": "TextInput-og8Or" ->>>>>>> origin/dev } }, "style": { @@ -1368,18 +1109,13 @@ }, { "source": "Prompt-Rse03", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-Rse03\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-Rse03œ}", ->>>>>>> origin/dev "target": "OpenAIModel-gi29P", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-gi29Pœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-gi29P", -<<<<<<< HEAD "inputTypes": [ "Text" ], @@ -1392,15 +1128,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["object", "Text", "str"], - "dataType": "Prompt", - "id": "Prompt-Rse03" ->>>>>>> origin/dev } }, "style": { @@ -1421,8 +1148,4 @@ "name": "Blog Writer", "last_tested_version": "1.0.0a0", "is_component": false -<<<<<<< HEAD -} -======= -} ->>>>>>> origin/dev +} \ No newline at end of file diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Document QA.json b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Document QA.json index 3b2cf65af..df07a7a58 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Document QA.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Document QA.json @@ -20,11 +20,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import Input, Prompt, Text\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": Input(display_name=\"Template\"),\n \"code\": Input(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n", -======= - "value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import Prompt, TemplateField, Text\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": TemplateField(display_name=\"Template\"),\n \"code\": TemplateField(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -49,13 +45,9 @@ "name": "template", "display_name": "Template", "advanced": false, -<<<<<<< HEAD "input_types": [ "Text" ], -======= - "input_types": ["Text"], ->>>>>>> origin/dev "dynamic": false, "info": "", "load_from_db": false, @@ -120,20 +112,15 @@ "is_input": null, "is_output": null, "is_composition": null, -<<<<<<< HEAD "base_classes": [ "object", "str", "Text" ], -======= - "base_classes": ["object", "str", "Text"], ->>>>>>> origin/dev "name": "", "display_name": "Prompt", "documentation": "", "custom_fields": { -<<<<<<< HEAD "template": [ "Document", "Question" @@ -142,17 +129,11 @@ "output_types": [ "Text" ], -======= - "template": ["Document", "Question"] - }, - "output_types": ["Text"], ->>>>>>> origin/dev "full_path": null, "field_formatters": {}, "frozen": false, "field_order": [], "beta": false, -<<<<<<< HEAD "error": null, "outputs": [ { @@ -165,9 +146,6 @@ "method": null } ] -======= - "error": null ->>>>>>> origin/dev }, "id": "Prompt-tHwPf", "description": "A component for creating prompt templates using dynamic variables.", @@ -264,20 +242,15 @@ "_type": "CustomComponent" }, "description": "A generic file loader.", -<<<<<<< HEAD "base_classes": [ "Record" ], -======= - "base_classes": ["Record"], ->>>>>>> origin/dev "display_name": "Files", "documentation": "", "custom_fields": { "path": null, "silent_errors": null }, -<<<<<<< HEAD "output_types": [ "Record" ], @@ -294,13 +267,6 @@ "name": "Record" } ] -======= - "output_types": ["Record"], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev }, "id": "File-6TEsD" }, @@ -331,11 +297,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "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(\n name=\"input_value\",\n type=str,\n display_name=\"Message\",\n multiline=True,\n input_types=[],\n info=\"Message to be passed as input.\",\n ),\n Input(\n name=\"sender\",\n type=str,\n display_name=\"Sender Type\",\n options=[\"Machine\", \"User\"],\n value=\"User\",\n info=\"Type of sender.\",\n advanced=True,\n ),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\", info=\"Name of the sender.\", value=\"User\"),\n Input(\n name=\"session_id\", type=str, display_name=\"Session ID\", info=\"Session ID for the message.\", advanced=True\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"text_response\"),\n Output(display_name=\"Record\", 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", -======= - "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 ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\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 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", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -353,10 +315,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -365,31 +324,7 @@ "advanced": false, "input_types": [], "dynamic": false, -<<<<<<< HEAD "info": "Message to be passed as input.", -======= - "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.", ->>>>>>> origin/dev "load_from_db": false, "title_case": false }, @@ -400,7 +335,6 @@ "list": true, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", "fileTypes": [], "file_path": "", @@ -409,30 +343,16 @@ "Machine", "User" ], -======= - "value": "User", - "fileTypes": [], - "file_path": "", - "password": false, - "options": ["Machine", "User"], ->>>>>>> origin/dev "name": "sender", "display_name": "Sender Type", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Type of sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "sender_name": { "type": "str", @@ -441,11 +361,7 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= - "value": "User", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -453,19 +369,12 @@ "display_name": "Sender Name", "advanced": false, "dynamic": false, -<<<<<<< HEAD "info": "Name of the sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "session_id": { "type": "str", @@ -474,10 +383,7 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -485,7 +391,6 @@ "display_name": "Session ID", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Session ID for the message.", "load_from_db": false, "title_case": false, @@ -503,18 +408,6 @@ "Text", "object" ], -======= - "info": "If provided, the message will be stored in the memory.", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] - }, - "_type": "CustomComponent" - }, - "description": "Get chat inputs from the Playground.", - "icon": "ChatInput", - "base_classes": ["str", "Record", "Text", "object"], ->>>>>>> origin/dev "display_name": "Chat Input", "documentation": "", "custom_fields": { @@ -524,7 +417,6 @@ "session_id": null, "return_record": null }, -<<<<<<< HEAD "output_types": [ "Text", "Record" @@ -553,13 +445,6 @@ "method": "record_response" } ] -======= - "output_types": ["Text", "Record"], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev }, "id": "ChatInput-MsSJ9" }, @@ -590,11 +475,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "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(\n name=\"input_value\", type=str, display_name=\"Message\", multiline=True, info=\"Message to be passed as output.\"\n ),\n Input(\n name=\"sender\",\n type=str,\n display_name=\"Sender Type\",\n options=[\"Machine\", \"User\"],\n value=\"Machine\",\n advanced=True,\n info=\"Type of sender.\",\n ),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\", info=\"Name of the sender.\", value=\"AI\"),\n Input(\n name=\"session_id\", type=str, display_name=\"Session ID\", info=\"Session ID for the message.\", advanced=True\n ),\n Input(\n name=\"record_template\",\n type=str,\n display_name=\"Record Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"text_response\"),\n Output(display_name=\"Record\", 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", -======= - "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", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -612,17 +493,13 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, "name": "input_value", "display_name": "Message", "advanced": false, -<<<<<<< HEAD "dynamic": false, "info": "Message to be passed as output.", "load_from_db": false, @@ -633,22 +510,11 @@ }, "record_template": { "type": "str", -======= - "input_types": ["Text"], - "dynamic": false, - "info": "", - "load_from_db": false, - "title_case": false - }, - "return_record": { - "type": "bool", ->>>>>>> origin/dev "required": false, "placeholder": "", "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", "fileTypes": [], "file_path": "", @@ -663,19 +529,6 @@ "input_types": [ "Text" ] -======= - "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 ->>>>>>> origin/dev }, "sender": { "type": "str", @@ -684,7 +537,6 @@ "list": true, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", "fileTypes": [], "file_path": "", @@ -693,30 +545,16 @@ "Machine", "User" ], -======= - "value": "Machine", - "fileTypes": [], - "file_path": "", - "password": false, - "options": ["Machine", "User"], ->>>>>>> origin/dev "name": "sender", "display_name": "Sender Type", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Type of sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "sender_name": { "type": "str", @@ -725,11 +563,7 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= - "value": "AI", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -737,19 +571,12 @@ "display_name": "Sender Name", "advanced": false, "dynamic": false, -<<<<<<< HEAD "info": "Name of the sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "session_id": { "type": "str", @@ -758,10 +585,7 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -769,7 +593,6 @@ "display_name": "Session ID", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Session ID for the message.", "load_from_db": false, "title_case": false, @@ -787,18 +610,6 @@ "Text", "object" ], -======= - "info": "If provided, the message will be stored in the memory.", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] - }, - "_type": "CustomComponent" - }, - "description": "Display a chat message in the Playground.", - "icon": "ChatOutput", - "base_classes": ["str", "Record", "Text", "object"], ->>>>>>> origin/dev "display_name": "Chat Output", "documentation": "", "custom_fields": { @@ -808,7 +619,6 @@ "session_id": null, "return_record": null }, -<<<<<<< HEAD "output_types": [ "Text", "Record" @@ -837,13 +647,6 @@ "method": "record_response" } ] -======= - "output_types": ["Text", "Record"], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev }, "id": "ChatOutput-F5Awj" }, @@ -884,13 +687,9 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "code": { "type": "code", @@ -973,13 +772,9 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "openai_api_base": { "type": "str", @@ -998,13 +793,9 @@ "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "openai_api_key": { "type": "str", @@ -1023,13 +814,9 @@ "info": "The OpenAI API Key to use for the OpenAI model.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ], -======= - "input_types": ["Text"], ->>>>>>> origin/dev "value": "OPENAI_API_KEY" }, "stream": { @@ -1045,11 +832,7 @@ "password": false, "name": "stream", "display_name": "Stream", -<<<<<<< HEAD "advanced": true, -======= - "advanced": false, ->>>>>>> origin/dev "dynamic": false, "info": "Stream the response from the model. Streaming works only in Chat.", "load_from_db": false, @@ -1072,13 +855,9 @@ "info": "System message to pass to the model.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "temperature": { "type": "float", @@ -1109,15 +888,11 @@ }, "description": "Generates text using OpenAI LLMs.", "icon": "OpenAI", -<<<<<<< HEAD "base_classes": [ "object", "str", "Text" ], -======= - "base_classes": ["object", "str", "Text"], ->>>>>>> origin/dev "display_name": "OpenAI", "documentation": "", "custom_fields": { @@ -1131,13 +906,9 @@ "stream": null, "system_message": null }, -<<<<<<< HEAD "output_types": [ "Text" ], -======= - "output_types": ["Text"], ->>>>>>> origin/dev "field_formatters": {}, "frozen": false, "field_order": [ @@ -1151,7 +922,6 @@ "system_message", "stream" ], -<<<<<<< HEAD "beta": false, "outputs": [ { @@ -1164,9 +934,6 @@ "method": null } ] -======= - "beta": false ->>>>>>> origin/dev }, "id": "OpenAIModel-Bt067" }, @@ -1183,18 +950,13 @@ "edges": [ { "source": "ChatInput-MsSJ9", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"ChatInput\", \"id\": \"ChatInput-MsSJ9\", \"output_types\": [\"Text\"], \"name\": \"message\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œstrœ,œRecordœ,œTextœ,œobjectœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-MsSJ9œ}", ->>>>>>> origin/dev "target": "Prompt-tHwPf", "targetHandle": "{œfieldNameœ:œQuestionœ,œidœ:œPrompt-tHwPfœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "Question", "id": "Prompt-tHwPf", -<<<<<<< HEAD "inputTypes": [ "Document", "BaseOutputParser", @@ -1210,15 +972,6 @@ "Text" ], "name": "message" -======= - "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["str", "Record", "Text", "object"], - "dataType": "ChatInput", - "id": "ChatInput-MsSJ9" ->>>>>>> origin/dev } }, "style": { @@ -1229,18 +982,13 @@ }, { "source": "File-6TEsD", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"File\", \"id\": \"File-6TEsD\", \"output_types\": [\"Record\"], \"name\": \"Record\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œRecordœ],œdataTypeœ:œFileœ,œidœ:œFile-6TEsDœ}", ->>>>>>> origin/dev "target": "Prompt-tHwPf", "targetHandle": "{œfieldNameœ:œDocumentœ,œidœ:œPrompt-tHwPfœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "Document", "id": "Prompt-tHwPf", -<<<<<<< HEAD "inputTypes": [ "Document", "BaseOutputParser", @@ -1256,15 +1004,6 @@ "Record" ], "name": "Record" -======= - "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["Record"], - "dataType": "File", - "id": "File-6TEsD" ->>>>>>> origin/dev } }, "style": { @@ -1275,18 +1014,13 @@ }, { "source": "Prompt-tHwPf", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-tHwPf\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-tHwPfœ}", ->>>>>>> origin/dev "target": "OpenAIModel-Bt067", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-Bt067œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-Bt067", -<<<<<<< HEAD "inputTypes": [ "Text" ], @@ -1299,15 +1033,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["object", "str", "Text"], - "dataType": "Prompt", - "id": "Prompt-tHwPf" ->>>>>>> origin/dev } }, "style": { @@ -1318,18 +1043,13 @@ }, { "source": "OpenAIModel-Bt067", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-Bt067\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-Bt067œ}", ->>>>>>> origin/dev "target": "ChatOutput-F5Awj", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-F5Awjœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-F5Awj", -<<<<<<< HEAD "inputTypes": [ "Text" ], @@ -1342,15 +1062,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["object", "str", "Text"], - "dataType": "OpenAIModel", - "id": "OpenAIModel-Bt067" ->>>>>>> origin/dev } }, "style": { @@ -1370,8 +1081,4 @@ "name": "Document QA", "last_tested_version": "1.0.0a0", "is_component": false -<<<<<<< HEAD -} -======= -} ->>>>>>> origin/dev +} \ No newline at end of file diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Memory Conversation.json b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Memory Conversation.json index bbc425c1e..8ad3c73d1 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Memory Conversation.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Memory Conversation.json @@ -22,11 +22,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "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(\n name=\"input_value\",\n type=str,\n display_name=\"Message\",\n multiline=True,\n input_types=[],\n info=\"Message to be passed as input.\",\n ),\n Input(\n name=\"sender\",\n type=str,\n display_name=\"Sender Type\",\n options=[\"Machine\", \"User\"],\n value=\"User\",\n info=\"Type of sender.\",\n advanced=True,\n ),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\", info=\"Name of the sender.\", value=\"User\"),\n Input(\n name=\"session_id\", type=str, display_name=\"Session ID\", info=\"Session ID for the message.\", advanced=True\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"text_response\"),\n Output(display_name=\"Record\", 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", -======= - "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 ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\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 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", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -44,10 +40,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -56,31 +49,7 @@ "advanced": false, "input_types": [], "dynamic": false, -<<<<<<< HEAD "info": "Message to be passed as input.", -======= - "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.", ->>>>>>> origin/dev "load_from_db": false, "title_case": false }, @@ -91,7 +60,6 @@ "list": true, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", "fileTypes": [], "file_path": "", @@ -100,30 +68,16 @@ "Machine", "User" ], -======= - "value": "User", - "fileTypes": [], - "file_path": "", - "password": false, - "options": ["Machine", "User"], ->>>>>>> origin/dev "name": "sender", "display_name": "Sender Type", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Type of sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "sender_name": { "type": "str", @@ -132,11 +86,7 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= - "value": "User", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -144,19 +94,12 @@ "display_name": "Sender Name", "advanced": false, "dynamic": false, -<<<<<<< HEAD "info": "Name of the sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "session_id": { "type": "str", @@ -165,16 +108,12 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, "name": "session_id", "display_name": "Session ID", -<<<<<<< HEAD "advanced": true, "dynamic": false, "info": "Session ID for the message.", @@ -194,21 +133,6 @@ "Record", "str" ], -======= - "advanced": false, - "dynamic": false, - "info": "If provided, the message will be stored in the memory.", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"], - "value": "MySessionID" - }, - "_type": "CustomComponent" - }, - "description": "Get chat inputs from the Playground.", - "icon": "ChatInput", - "base_classes": ["Text", "object", "Record", "str"], ->>>>>>> origin/dev "display_name": "Chat Input", "documentation": "", "custom_fields": { @@ -218,7 +142,6 @@ "session_id": null, "return_record": null }, -<<<<<<< HEAD "output_types": [ "Text", "Record" @@ -247,13 +170,6 @@ "method": "record_response" } ] -======= - "output_types": ["Text", "Record"], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev }, "id": "ChatInput-t7F8v" }, @@ -284,11 +200,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "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(\n name=\"input_value\", type=str, display_name=\"Message\", multiline=True, info=\"Message to be passed as output.\"\n ),\n Input(\n name=\"sender\",\n type=str,\n display_name=\"Sender Type\",\n options=[\"Machine\", \"User\"],\n value=\"Machine\",\n advanced=True,\n info=\"Type of sender.\",\n ),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\", info=\"Name of the sender.\", value=\"AI\"),\n Input(\n name=\"session_id\", type=str, display_name=\"Session ID\", info=\"Session ID for the message.\", advanced=True\n ),\n Input(\n name=\"record_template\",\n type=str,\n display_name=\"Record Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"text_response\"),\n Output(display_name=\"Record\", 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", -======= - "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", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -306,17 +218,13 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, "name": "input_value", "display_name": "Message", "advanced": false, -<<<<<<< HEAD "dynamic": false, "info": "Message to be passed as output.", "load_from_db": false, @@ -327,22 +235,11 @@ }, "record_template": { "type": "str", -======= - "input_types": ["Text"], - "dynamic": false, - "info": "", - "load_from_db": false, - "title_case": false - }, - "return_record": { - "type": "bool", ->>>>>>> origin/dev "required": false, "placeholder": "", "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", "fileTypes": [], "file_path": "", @@ -357,19 +254,6 @@ "input_types": [ "Text" ] -======= - "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 ->>>>>>> origin/dev }, "sender": { "type": "str", @@ -378,7 +262,6 @@ "list": true, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", "fileTypes": [], "file_path": "", @@ -387,30 +270,16 @@ "Machine", "User" ], -======= - "value": "Machine", - "fileTypes": [], - "file_path": "", - "password": false, - "options": ["Machine", "User"], ->>>>>>> origin/dev "name": "sender", "display_name": "Sender Type", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Type of sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "sender_name": { "type": "str", @@ -419,11 +288,7 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= - "value": "AI", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -431,19 +296,12 @@ "display_name": "Sender Name", "advanced": false, "dynamic": false, -<<<<<<< HEAD "info": "Name of the sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "session_id": { "type": "str", @@ -452,16 +310,12 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, "name": "session_id", "display_name": "Session ID", -<<<<<<< HEAD "advanced": true, "dynamic": false, "info": "Session ID for the message.", @@ -481,21 +335,6 @@ "Record", "str" ], -======= - "advanced": false, - "dynamic": false, - "info": "If provided, the message will be stored in the memory.", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"], - "value": "MySessionID" - }, - "_type": "CustomComponent" - }, - "description": "Display a chat message in the Playground.", - "icon": "ChatOutput", - "base_classes": ["Text", "object", "Record", "str"], ->>>>>>> origin/dev "display_name": "Chat Output", "documentation": "", "custom_fields": { @@ -505,7 +344,6 @@ "session_id": null, "return_record": null }, -<<<<<<< HEAD "output_types": [ "Text", "Record" @@ -534,13 +372,6 @@ "method": "record_response" } ] -======= - "output_types": ["Text", "Record"], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev }, "id": "ChatOutput-P1jEe" }, @@ -612,14 +443,10 @@ "fileTypes": [], "file_path": "", "password": false, -<<<<<<< HEAD "options": [ "Ascending", "Descending" ], -======= - "options": ["Ascending", "Descending"], ->>>>>>> origin/dev "name": "order", "display_name": "Order", "advanced": true, @@ -627,13 +454,9 @@ "info": "Order of the messages.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "record_template": { "type": "str", @@ -653,13 +476,9 @@ "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "sender": { "type": "str", @@ -672,15 +491,11 @@ "fileTypes": [], "file_path": "", "password": false, -<<<<<<< HEAD "options": [ "Machine", "User", "Machine and User" ], -======= - "options": ["Machine", "User", "Machine and User"], ->>>>>>> origin/dev "name": "sender", "display_name": "Sender Type", "advanced": false, @@ -688,13 +503,9 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "sender_name": { "type": "str", @@ -713,13 +524,9 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "session_id": { "type": "str", @@ -734,13 +541,9 @@ "name": "session_id", "display_name": "Session ID", "advanced": false, -<<<<<<< HEAD "input_types": [ "Text" ], -======= - "input_types": ["Text"], ->>>>>>> origin/dev "dynamic": false, "info": "Session ID of the chat history.", "load_from_db": false, @@ -751,15 +554,11 @@ }, "description": "Retrieves stored chat messages given a specific Session ID.", "icon": "history", -<<<<<<< HEAD "base_classes": [ "str", "Text", "object" ], -======= - "base_classes": ["str", "Text", "object"], ->>>>>>> origin/dev "display_name": "Chat Memory", "documentation": "", "custom_fields": { @@ -770,7 +569,6 @@ "order": null, "record_template": null }, -<<<<<<< HEAD "output_types": [ "Text" ], @@ -789,13 +587,6 @@ "method": null } ] -======= - "output_types": ["Text"], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": true ->>>>>>> origin/dev }, "id": "MemoryComponent-cdA1J", "description": "Retrieves stored chat messages given a specific Session ID.", @@ -828,11 +619,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import Input, Prompt, Text\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": Input(display_name=\"Template\"),\n \"code\": Input(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n", -======= - "value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import Prompt, TemplateField, Text\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": TemplateField(display_name=\"Template\"),\n \"code\": TemplateField(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -857,13 +644,9 @@ "name": "template", "display_name": "Template", "advanced": false, -<<<<<<< HEAD "input_types": [ "Text" ], -======= - "input_types": ["Text"], ->>>>>>> origin/dev "dynamic": false, "info": "", "load_from_db": false, @@ -928,20 +711,15 @@ "is_input": null, "is_output": null, "is_composition": null, -<<<<<<< HEAD "base_classes": [ "Text", "str", "object" ], -======= - "base_classes": ["Text", "str", "object"], ->>>>>>> origin/dev "name": "", "display_name": "Prompt", "documentation": "", "custom_fields": { -<<<<<<< HEAD "template": [ "context", "user_message" @@ -950,17 +728,11 @@ "output_types": [ "Text" ], -======= - "template": ["context", "user_message"] - }, - "output_types": ["Text"], ->>>>>>> origin/dev "full_path": null, "field_formatters": {}, "frozen": false, "field_order": [], "beta": false, -<<<<<<< HEAD "error": null, "outputs": [ { @@ -973,9 +745,6 @@ "method": null } ] -======= - "error": null ->>>>>>> origin/dev }, "id": "Prompt-ODkUx", "description": "A component for creating prompt templates using dynamic variables.", @@ -1018,13 +787,9 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "code": { "type": "code", @@ -1107,13 +872,9 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "openai_api_base": { "type": "str", @@ -1132,13 +893,9 @@ "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "openai_api_key": { "type": "str", @@ -1157,13 +914,9 @@ "info": "The OpenAI API Key to use for the OpenAI model.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ], -======= - "input_types": ["Text"], ->>>>>>> origin/dev "value": "OPENAI_API_KEY" }, "stream": { @@ -1202,13 +955,9 @@ "info": "System message to pass to the model.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "temperature": { "type": "float", @@ -1239,15 +988,11 @@ }, "description": "Generates text using OpenAI LLMs.", "icon": "OpenAI", -<<<<<<< HEAD "base_classes": [ "str", "object", "Text" ], -======= - "base_classes": ["str", "object", "Text"], ->>>>>>> origin/dev "display_name": "OpenAI", "documentation": "", "custom_fields": { @@ -1261,13 +1006,9 @@ "stream": null, "system_message": null }, -<<<<<<< HEAD "output_types": [ "Text" ], -======= - "output_types": ["Text"], ->>>>>>> origin/dev "field_formatters": {}, "frozen": false, "field_order": [ @@ -1281,7 +1022,6 @@ "system_message", "stream" ], -<<<<<<< HEAD "beta": false, "outputs": [ { @@ -1294,9 +1034,6 @@ "method": null } ] -======= - "beta": false ->>>>>>> origin/dev }, "id": "OpenAIModel-9RykF" }, @@ -1334,14 +1071,10 @@ "name": "input_value", "display_name": "Value", "advanced": false, -<<<<<<< HEAD "input_types": [ "Record", "Text" ], -======= - "input_types": ["Record", "Text"], ->>>>>>> origin/dev "dynamic": false, "info": "Text or Record to be passed as output.", "load_from_db": false, @@ -1383,40 +1116,28 @@ "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "_type": "CustomComponent" }, "description": "Display a text output in the Playground.", "icon": "type", -<<<<<<< HEAD "base_classes": [ "str", "object", "Text" ], -======= - "base_classes": ["str", "object", "Text"], ->>>>>>> origin/dev "display_name": "Inspect Memory", "documentation": "", "custom_fields": { "input_value": null, "record_template": null }, -<<<<<<< HEAD "output_types": [ "Text" ], -======= - "output_types": ["Text"], ->>>>>>> origin/dev "field_formatters": {}, "frozen": false, "field_order": [], @@ -1437,17 +1158,12 @@ "edges": [ { "source": "MemoryComponent-cdA1J", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"MemoryComponent\", \"id\": \"MemoryComponent-cdA1J\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-cdA1Jœ}", ->>>>>>> origin/dev "target": "Prompt-ODkUx", "targetHandle": "{œfieldNameœ:œcontextœ,œidœ:œPrompt-ODkUxœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "context", -<<<<<<< HEAD "id": "Prompt-ODkUx", "inputTypes": [ "Document", @@ -1464,16 +1180,6 @@ "Text" ], "name": "Text" -======= - "type": "str", - "id": "Prompt-ODkUx", - "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"] - }, - "sourceHandle": { - "baseClasses": ["str", "Text", "object"], - "dataType": "MemoryComponent", - "id": "MemoryComponent-cdA1J" ->>>>>>> origin/dev } }, "style": { @@ -1485,17 +1191,12 @@ }, { "source": "ChatInput-t7F8v", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"ChatInput\", \"id\": \"ChatInput-t7F8v\", \"output_types\": [\"Text\"], \"name\": \"message\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œTextœ,œobjectœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-t7F8vœ}", ->>>>>>> origin/dev "target": "Prompt-ODkUx", "targetHandle": "{œfieldNameœ:œuser_messageœ,œidœ:œPrompt-ODkUxœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "user_message", -<<<<<<< HEAD "id": "Prompt-ODkUx", "inputTypes": [ "Document", @@ -1512,16 +1213,6 @@ "Text" ], "name": "message" -======= - "type": "str", - "id": "Prompt-ODkUx", - "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"] - }, - "sourceHandle": { - "baseClasses": ["Text", "object", "Record", "str"], - "dataType": "ChatInput", - "id": "ChatInput-t7F8v" ->>>>>>> origin/dev } }, "style": { @@ -1533,18 +1224,13 @@ }, { "source": "Prompt-ODkUx", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-ODkUx\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œTextœ,œstrœ,œobjectœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-ODkUxœ}", ->>>>>>> origin/dev "target": "OpenAIModel-9RykF", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-9RykFœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-9RykF", -<<<<<<< HEAD "inputTypes": [ "Text" ], @@ -1557,15 +1243,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["Text", "str", "object"], - "dataType": "Prompt", - "id": "Prompt-ODkUx" ->>>>>>> origin/dev } }, "style": { @@ -1576,18 +1253,13 @@ }, { "source": "OpenAIModel-9RykF", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-9RykF\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œstrœ,œobjectœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-9RykFœ}", ->>>>>>> origin/dev "target": "ChatOutput-P1jEe", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-P1jEeœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-P1jEe", -<<<<<<< HEAD "inputTypes": [ "Text" ], @@ -1600,15 +1272,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["str", "object", "Text"], - "dataType": "OpenAIModel", - "id": "OpenAIModel-9RykF" ->>>>>>> origin/dev } }, "style": { @@ -1619,18 +1282,13 @@ }, { "source": "MemoryComponent-cdA1J", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"MemoryComponent\", \"id\": \"MemoryComponent-cdA1J\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-cdA1Jœ}", ->>>>>>> origin/dev "target": "TextOutput-vrs6T", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-vrs6Tœ,œinputTypesœ:[œRecordœ,œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "input_value", "id": "TextOutput-vrs6T", -<<<<<<< HEAD "inputTypes": [ "Record", "Text" @@ -1644,15 +1302,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Record", "Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["str", "Text", "object"], - "dataType": "MemoryComponent", - "id": "MemoryComponent-cdA1J" ->>>>>>> origin/dev } }, "style": { @@ -1672,8 +1321,4 @@ "name": "Memory Chatbot", "last_tested_version": "1.0.0a0", "is_component": false -<<<<<<< HEAD -} -======= -} ->>>>>>> origin/dev +} \ No newline at end of file diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Prompt Chaining.json b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Prompt Chaining.json index 81f2bfd18..3234512c8 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Prompt Chaining.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Prompt Chaining.json @@ -20,11 +20,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import Input, Prompt, Text\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": Input(display_name=\"Template\"),\n \"code\": Input(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n", -======= - "value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import Prompt, TemplateField, Text\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": TemplateField(display_name=\"Template\"),\n \"code\": TemplateField(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -49,13 +45,9 @@ "name": "template", "display_name": "Template", "advanced": false, -<<<<<<< HEAD "input_types": [ "Text" ], -======= - "input_types": ["Text"], ->>>>>>> origin/dev "dynamic": false, "info": "", "load_from_db": false, @@ -94,20 +86,15 @@ "is_input": null, "is_output": null, "is_composition": null, -<<<<<<< HEAD "base_classes": [ "object", "str", "Text" ], -======= - "base_classes": ["object", "str", "Text"], ->>>>>>> origin/dev "name": "", "display_name": "Prompt", "documentation": "", "custom_fields": { -<<<<<<< HEAD "template": [ "document" ] @@ -115,17 +102,11 @@ "output_types": [ "Text" ], -======= - "template": ["document"] - }, - "output_types": ["Text"], ->>>>>>> origin/dev "full_path": null, "field_formatters": {}, "frozen": false, "field_order": [], "beta": false, -<<<<<<< HEAD "error": null, "outputs": [ { @@ -138,9 +119,6 @@ "method": null } ] -======= - "error": null ->>>>>>> origin/dev }, "id": "Prompt-amqBu", "description": "Create a prompt template with dynamic variables.", @@ -173,11 +151,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import Input, Prompt, Text\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": Input(display_name=\"Template\"),\n \"code\": Input(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n", -======= - "value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.custom import CustomComponent\nfrom langflow.field_typing import Prompt, TemplateField, Text\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": TemplateField(display_name=\"Template\"),\n \"code\": TemplateField(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -202,13 +176,9 @@ "name": "template", "display_name": "Template", "advanced": false, -<<<<<<< HEAD "input_types": [ "Text" ], -======= - "input_types": ["Text"], ->>>>>>> origin/dev "dynamic": false, "info": "", "load_from_db": false, @@ -247,20 +217,15 @@ "is_input": null, "is_output": null, "is_composition": null, -<<<<<<< HEAD "base_classes": [ "object", "str", "Text" ], -======= - "base_classes": ["object", "str", "Text"], ->>>>>>> origin/dev "name": "", "display_name": "Prompt", "documentation": "", "custom_fields": { -<<<<<<< HEAD "template": [ "summary" ] @@ -268,17 +233,11 @@ "output_types": [ "Text" ], -======= - "template": ["summary"] - }, - "output_types": ["Text"], ->>>>>>> origin/dev "full_path": null, "field_formatters": {}, "frozen": false, "field_order": [], "beta": false, -<<<<<<< HEAD "error": null, "outputs": [ { @@ -291,9 +250,6 @@ "method": null } ] -======= - "error": null ->>>>>>> origin/dev }, "id": "Prompt-gTNiz", "description": "Create a prompt template with dynamic variables.", @@ -322,11 +278,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "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(\n name=\"input_value\", type=str, display_name=\"Message\", multiline=True, info=\"Message to be passed as output.\"\n ),\n Input(\n name=\"sender\",\n type=str,\n display_name=\"Sender Type\",\n options=[\"Machine\", \"User\"],\n value=\"Machine\",\n advanced=True,\n info=\"Type of sender.\",\n ),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\", info=\"Name of the sender.\", value=\"AI\"),\n Input(\n name=\"session_id\", type=str, display_name=\"Session ID\", info=\"Session ID for the message.\", advanced=True\n ),\n Input(\n name=\"record_template\",\n type=str,\n display_name=\"Record Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"text_response\"),\n Output(display_name=\"Record\", 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", -======= - "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", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -344,17 +296,13 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, "name": "input_value", "display_name": "Message", "advanced": false, -<<<<<<< HEAD "dynamic": false, "info": "Message to be passed as output.", "load_from_db": false, @@ -362,13 +310,6 @@ "input_types": [ "Text" ] -======= - "input_types": ["Text"], - "dynamic": false, - "info": "", - "load_from_db": false, - "title_case": false ->>>>>>> origin/dev }, "record_template": { "type": "str", @@ -376,13 +317,8 @@ "placeholder": "", "list": false, "show": true, -<<<<<<< HEAD "multiline": false, "value": "", -======= - "multiline": true, - "value": "{text}", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -390,38 +326,12 @@ "display_name": "Record Template", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "In case of Message being a Record, this template will be used to convert it to text.", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] - }, - "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 ->>>>>>> origin/dev }, "sender": { "type": "str", @@ -430,7 +340,6 @@ "list": true, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", "fileTypes": [], "file_path": "", @@ -439,30 +348,16 @@ "Machine", "User" ], -======= - "value": "Machine", - "fileTypes": [], - "file_path": "", - "password": false, - "options": ["Machine", "User"], ->>>>>>> origin/dev "name": "sender", "display_name": "Sender Type", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Type of sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "sender_name": { "type": "str", @@ -471,11 +366,7 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= - "value": "Summarizer", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -483,19 +374,12 @@ "display_name": "Sender Name", "advanced": false, "dynamic": false, -<<<<<<< HEAD "info": "Name of the sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "session_id": { "type": "str", @@ -504,10 +388,7 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -515,7 +396,6 @@ "display_name": "Session ID", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Session ID for the message.", "load_from_db": false, "title_case": false, @@ -533,18 +413,6 @@ "Text", "str" ], -======= - "info": "If provided, the message will be stored in the memory.", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] - }, - "_type": "CustomComponent" - }, - "description": "Display a chat message in the Playground.", - "icon": "ChatOutput", - "base_classes": ["object", "Record", "Text", "str"], ->>>>>>> origin/dev "display_name": "Chat Output", "documentation": "", "custom_fields": { @@ -555,7 +423,6 @@ "return_record": null, "record_template": null }, -<<<<<<< HEAD "output_types": [ "Text", "Record" @@ -584,13 +451,6 @@ "method": "record_response" } ] -======= - "output_types": ["Text", "Record"], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev }, "id": "ChatOutput-EJkG3" }, @@ -617,11 +477,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "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(\n name=\"input_value\", type=str, display_name=\"Message\", multiline=True, info=\"Message to be passed as output.\"\n ),\n Input(\n name=\"sender\",\n type=str,\n display_name=\"Sender Type\",\n options=[\"Machine\", \"User\"],\n value=\"Machine\",\n advanced=True,\n info=\"Type of sender.\",\n ),\n Input(name=\"sender_name\", type=str, display_name=\"Sender Name\", info=\"Name of the sender.\", value=\"AI\"),\n Input(\n name=\"session_id\", type=str, display_name=\"Session ID\", info=\"Session ID for the message.\", advanced=True\n ),\n Input(\n name=\"record_template\",\n type=str,\n display_name=\"Record Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.\",\n ),\n ]\n outputs = [\n Output(display_name=\"Message\", name=\"message\", method=\"text_response\"),\n Output(display_name=\"Record\", 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", -======= - "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", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -639,17 +495,13 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, "name": "input_value", "display_name": "Message", "advanced": false, -<<<<<<< HEAD "dynamic": false, "info": "Message to be passed as output.", "load_from_db": false, @@ -657,13 +509,6 @@ "input_types": [ "Text" ] -======= - "input_types": ["Text"], - "dynamic": false, - "info": "", - "load_from_db": false, - "title_case": false ->>>>>>> origin/dev }, "record_template": { "type": "str", @@ -671,13 +516,8 @@ "placeholder": "", "list": false, "show": true, -<<<<<<< HEAD "multiline": false, "value": "", -======= - "multiline": true, - "value": "{text}", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -685,38 +525,12 @@ "display_name": "Record Template", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "In case of Message being a Record, this template will be used to convert it to text.", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] - }, - "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 ->>>>>>> origin/dev }, "sender": { "type": "str", @@ -725,7 +539,6 @@ "list": true, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", "fileTypes": [], "file_path": "", @@ -734,30 +547,16 @@ "Machine", "User" ], -======= - "value": "Machine", - "fileTypes": [], - "file_path": "", - "password": false, - "options": ["Machine", "User"], ->>>>>>> origin/dev "name": "sender", "display_name": "Sender Type", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Type of sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "sender_name": { "type": "str", @@ -766,11 +565,7 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= - "value": "Question Generator", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -778,19 +573,12 @@ "display_name": "Sender Name", "advanced": false, "dynamic": false, -<<<<<<< HEAD "info": "Name of the sender.", "load_from_db": false, "title_case": false, "input_types": [ "Text" ] -======= - "info": "", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] ->>>>>>> origin/dev }, "session_id": { "type": "str", @@ -799,10 +587,7 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -810,7 +595,6 @@ "display_name": "Session ID", "advanced": true, "dynamic": false, -<<<<<<< HEAD "info": "Session ID for the message.", "load_from_db": false, "title_case": false, @@ -828,18 +612,6 @@ "Text", "str" ], -======= - "info": "If provided, the message will be stored in the memory.", - "load_from_db": false, - "title_case": false, - "input_types": ["Text"] - }, - "_type": "CustomComponent" - }, - "description": "Display a chat message in the Playground.", - "icon": "ChatOutput", - "base_classes": ["object", "Record", "Text", "str"], ->>>>>>> origin/dev "display_name": "Chat Output", "documentation": "", "custom_fields": { @@ -850,7 +622,6 @@ "return_record": null, "record_template": null }, -<<<<<<< HEAD "output_types": [ "Text", "Record" @@ -879,13 +650,6 @@ "method": "record_response" } ] -======= - "output_types": ["Text", "Record"], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev }, "id": "ChatOutput-DNmvg" }, @@ -911,11 +675,7 @@ "list": false, "show": true, "multiline": true, -<<<<<<< HEAD "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(display_name=\"Text\", 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", -======= - "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", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, @@ -933,25 +693,17 @@ "list": false, "show": true, "multiline": false, -<<<<<<< HEAD "value": "", -======= - "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.", ->>>>>>> origin/dev "fileTypes": [], "file_path": "", "password": false, "name": "input_value", "display_name": "Value", "advanced": false, -<<<<<<< HEAD "input_types": [ "Record", "Text" ], -======= - "input_types": ["Record", "Text"], ->>>>>>> origin/dev "dynamic": false, "info": "Text or Record to be passed as input.", "load_from_db": false, @@ -975,7 +727,6 @@ "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] @@ -989,22 +740,12 @@ "Text", "object" ], -======= - "input_types": ["Text"] - }, - "_type": "CustomComponent" - }, - "description": "Get text inputs from the Playground.", - "icon": "type", - "base_classes": ["str", "Text", "object"], ->>>>>>> origin/dev "display_name": "Text Input", "documentation": "", "custom_fields": { "input_value": null, "record_template": null }, -<<<<<<< HEAD "output_types": [ "Text" ], @@ -1023,13 +764,6 @@ "method": "text_response" } ] -======= - "output_types": ["Text"], - "field_formatters": {}, - "frozen": false, - "field_order": [], - "beta": false ->>>>>>> origin/dev }, "id": "TextInput-sptaH" }, @@ -1067,14 +801,10 @@ "name": "input_value", "display_name": "Value", "advanced": false, -<<<<<<< HEAD "input_types": [ "Record", "Text" ], -======= - "input_types": ["Record", "Text"], ->>>>>>> origin/dev "dynamic": false, "info": "Text or Record to be passed as output.", "load_from_db": false, @@ -1116,40 +846,28 @@ "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "_type": "CustomComponent" }, "description": "Display a text output in the Playground.", "icon": "type", -<<<<<<< HEAD "base_classes": [ "str", "Text", "object" ], -======= - "base_classes": ["str", "Text", "object"], ->>>>>>> origin/dev "display_name": "First Prompt", "documentation": "", "custom_fields": { "input_value": null, "record_template": null }, -<<<<<<< HEAD "output_types": [ "Text" ], -======= - "output_types": ["Text"], ->>>>>>> origin/dev "field_formatters": {}, "frozen": false, "field_order": [], @@ -1194,13 +912,9 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "code": { "type": "code", @@ -1283,13 +997,9 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "openai_api_base": { "type": "str", @@ -1308,13 +1018,9 @@ "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "openai_api_key": { "type": "str", @@ -1333,13 +1039,9 @@ "info": "The OpenAI API Key to use for the OpenAI model.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ], -======= - "input_types": ["Text"], ->>>>>>> origin/dev "value": "OPENAI_API_KEY" }, "stream": { @@ -1378,13 +1080,9 @@ "info": "System message to pass to the model.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "temperature": { "type": "float", @@ -1415,15 +1113,11 @@ }, "description": "Generates text using OpenAI LLMs.", "icon": "OpenAI", -<<<<<<< HEAD "base_classes": [ "str", "Text", "object" ], -======= - "base_classes": ["str", "Text", "object"], ->>>>>>> origin/dev "display_name": "OpenAI", "documentation": "", "custom_fields": { @@ -1437,13 +1131,9 @@ "stream": null, "system_message": null }, -<<<<<<< HEAD "output_types": [ "Text" ], -======= - "output_types": ["Text"], ->>>>>>> origin/dev "field_formatters": {}, "frozen": false, "field_order": [ @@ -1457,7 +1147,6 @@ "system_message", "stream" ], -<<<<<<< HEAD "beta": false, "outputs": [ { @@ -1470,9 +1159,6 @@ "method": null } ] -======= - "beta": false ->>>>>>> origin/dev }, "id": "OpenAIModel-uYXZJ" }, @@ -1510,14 +1196,10 @@ "name": "input_value", "display_name": "Value", "advanced": false, -<<<<<<< HEAD "input_types": [ "Record", "Text" ], -======= - "input_types": ["Record", "Text"], ->>>>>>> origin/dev "dynamic": false, "info": "Text or Record to be passed as output.", "load_from_db": false, @@ -1559,40 +1241,28 @@ "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "_type": "CustomComponent" }, "description": "Display a text output in the Playground.", "icon": "type", -<<<<<<< HEAD "base_classes": [ "str", "Text", "object" ], -======= - "base_classes": ["str", "Text", "object"], ->>>>>>> origin/dev "display_name": "Second Prompt", "documentation": "", "custom_fields": { "input_value": null, "record_template": null }, -<<<<<<< HEAD "output_types": [ "Text" ], -======= - "output_types": ["Text"], ->>>>>>> origin/dev "field_formatters": {}, "frozen": false, "field_order": [], @@ -1637,13 +1307,9 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "code": { "type": "code", @@ -1726,13 +1392,9 @@ "info": "", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "openai_api_base": { "type": "str", @@ -1751,13 +1413,9 @@ "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "openai_api_key": { "type": "str", @@ -1776,13 +1434,9 @@ "info": "The OpenAI API Key to use for the OpenAI model.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ], -======= - "input_types": ["Text"], ->>>>>>> origin/dev "value": "" }, "stream": { @@ -1821,13 +1475,9 @@ "info": "System message to pass to the model.", "load_from_db": false, "title_case": false, -<<<<<<< HEAD "input_types": [ "Text" ] -======= - "input_types": ["Text"] ->>>>>>> origin/dev }, "temperature": { "type": "float", @@ -1858,15 +1508,11 @@ }, "description": "Generates text using OpenAI LLMs.", "icon": "OpenAI", -<<<<<<< HEAD "base_classes": [ "str", "Text", "object" ], -======= - "base_classes": ["str", "Text", "object"], ->>>>>>> origin/dev "display_name": "OpenAI", "documentation": "", "custom_fields": { @@ -1880,13 +1526,9 @@ "stream": null, "system_message": null }, -<<<<<<< HEAD "output_types": [ "Text" ], -======= - "output_types": ["Text"], ->>>>>>> origin/dev "field_formatters": {}, "frozen": false, "field_order": [ @@ -1900,7 +1542,6 @@ "system_message", "stream" ], -<<<<<<< HEAD "beta": false, "outputs": [ { @@ -1913,9 +1554,6 @@ "method": null } ] -======= - "beta": false ->>>>>>> origin/dev }, "id": "OpenAIModel-XawYB" }, @@ -1932,18 +1570,13 @@ "edges": [ { "source": "TextInput-sptaH", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"TextInput\", \"id\": \"TextInput-sptaH\", \"output_types\": [\"Text\"], \"name\": \"text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-sptaHœ}", ->>>>>>> origin/dev "target": "Prompt-amqBu", "targetHandle": "{œfieldNameœ:œdocumentœ,œidœ:œPrompt-amqBuœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "document", "id": "Prompt-amqBu", -<<<<<<< HEAD "inputTypes": [ "Document", "BaseOutputParser", @@ -1959,15 +1592,6 @@ "Text" ], "name": "text" -======= - "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["str", "Text", "object"], - "dataType": "TextInput", - "id": "TextInput-sptaH" ->>>>>>> origin/dev } }, "style": { @@ -1978,18 +1602,13 @@ }, { "source": "Prompt-amqBu", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-amqBu\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-amqBuœ}", ->>>>>>> origin/dev "target": "TextOutput-2MS4a", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-2MS4aœ,œinputTypesœ:[œRecordœ,œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "input_value", "id": "TextOutput-2MS4a", -<<<<<<< HEAD "inputTypes": [ "Record", "Text" @@ -2003,15 +1622,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Record", "Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["object", "str", "Text"], - "dataType": "Prompt", - "id": "Prompt-amqBu" ->>>>>>> origin/dev } }, "style": { @@ -2022,18 +1632,13 @@ }, { "source": "Prompt-amqBu", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-amqBu\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-amqBuœ}", ->>>>>>> origin/dev "target": "OpenAIModel-uYXZJ", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-uYXZJœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-uYXZJ", -<<<<<<< HEAD "inputTypes": [ "Text" ], @@ -2046,15 +1651,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["object", "str", "Text"], - "dataType": "Prompt", - "id": "Prompt-amqBu" ->>>>>>> origin/dev } }, "style": { @@ -2065,18 +1661,13 @@ }, { "source": "OpenAIModel-uYXZJ", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-uYXZJ\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-uYXZJœ}", ->>>>>>> origin/dev "target": "Prompt-gTNiz", "targetHandle": "{œfieldNameœ:œsummaryœ,œidœ:œPrompt-gTNizœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "summary", "id": "Prompt-gTNiz", -<<<<<<< HEAD "inputTypes": [ "Document", "BaseOutputParser", @@ -2092,15 +1683,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["str", "Text", "object"], - "dataType": "OpenAIModel", - "id": "OpenAIModel-uYXZJ" ->>>>>>> origin/dev } }, "style": { @@ -2111,18 +1693,13 @@ }, { "source": "OpenAIModel-uYXZJ", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-uYXZJ\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-uYXZJœ}", ->>>>>>> origin/dev "target": "ChatOutput-EJkG3", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-EJkG3œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-EJkG3", -<<<<<<< HEAD "inputTypes": [ "Text" ], @@ -2135,15 +1712,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["str", "Text", "object"], - "dataType": "OpenAIModel", - "id": "OpenAIModel-uYXZJ" ->>>>>>> origin/dev } }, "style": { @@ -2154,18 +1722,13 @@ }, { "source": "Prompt-gTNiz", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-gTNiz\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-gTNizœ}", ->>>>>>> origin/dev "target": "TextOutput-MUDOR", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-MUDORœ,œinputTypesœ:[œRecordœ,œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "input_value", "id": "TextOutput-MUDOR", -<<<<<<< HEAD "inputTypes": [ "Record", "Text" @@ -2179,15 +1742,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Record", "Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["object", "str", "Text"], - "dataType": "Prompt", - "id": "Prompt-gTNiz" ->>>>>>> origin/dev } }, "style": { @@ -2198,18 +1752,13 @@ }, { "source": "Prompt-gTNiz", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"Prompt\", \"id\": \"Prompt-gTNiz\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-gTNizœ}", ->>>>>>> origin/dev "target": "OpenAIModel-XawYB", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-XawYBœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-XawYB", -<<<<<<< HEAD "inputTypes": [ "Text" ], @@ -2222,15 +1771,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["object", "str", "Text"], - "dataType": "Prompt", - "id": "Prompt-gTNiz" ->>>>>>> origin/dev } }, "style": { @@ -2241,18 +1781,13 @@ }, { "source": "OpenAIModel-XawYB", -<<<<<<< HEAD "sourceHandle": "{\"dataType\": \"OpenAIModel\", \"id\": \"OpenAIModel-XawYB\", \"output_types\": [\"Text\"], \"name\": \"Text\"}", -======= - "sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-XawYBœ}", ->>>>>>> origin/dev "target": "ChatOutput-DNmvg", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-DNmvgœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", "data": { "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-DNmvg", -<<<<<<< HEAD "inputTypes": [ "Text" ], @@ -2265,15 +1800,6 @@ "Text" ], "name": "Text" -======= - "inputTypes": ["Text"], - "type": "str" - }, - "sourceHandle": { - "baseClasses": ["str", "Text", "object"], - "dataType": "OpenAIModel", - "id": "OpenAIModel-XawYB" ->>>>>>> origin/dev } }, "style": { @@ -2293,8 +1819,4 @@ "name": "Prompt Chaining", "last_tested_version": "1.0.0a0", "is_component": false -<<<<<<< HEAD -} -======= -} ->>>>>>> origin/dev +} \ No newline at end of file