From 666815f9969e5ecd005338d68656a474e24e1f3c Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Mon, 10 Jun 2024 08:09:31 -0300 Subject: [PATCH] Fixed formatting of jsons --- .../Basic Prompting (Hello, world!).json | 156 ++---- .../Langflow Blog Writter.json | 194 ++----- .../Langflow Document QA.json | 176 ++----- .../Langflow Memory Conversation.json | 241 ++------- .../Langflow Prompt Chaining.json | 327 +++--------- .../VectorStore-RAG-Flows.json | 477 ++++-------------- 6 files changed, 349 insertions(+), 1222 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 ca22d72ed..2e122c63c 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 @@ -5,20 +5,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "Text", - "str" - ], + "baseClasses": ["object", "Text", "str"], "dataType": "OpenAIModel", "id": "OpenAIModel-k39HS" }, "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-njtka", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" } }, @@ -35,22 +29,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "Prompt", "id": "Prompt-uxBqP" }, "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-k39HS", - "inputTypes": [ - "Text", - "Record", - "Prompt" - ], + "inputTypes": ["Text", "Record", "Prompt"], "type": "str" } }, @@ -67,24 +53,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "Record", - "str", - "Text" - ], + "baseClasses": ["object", "Record", "str", "Text"], "dataType": "ChatInput", "id": "ChatInput-P3fgL" }, "targetHandle": { "fieldName": "user_input", "id": "Prompt-uxBqP", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" } }, @@ -105,16 +81,10 @@ "display_name": "Prompt", "id": "Prompt-uxBqP", "node": { - "base_classes": [ - "object", - "str", - "Text" - ], + "base_classes": ["object", "str", "Text"], "beta": false, "custom_fields": { - "template": [ - "user_input" - ] + "template": ["user_input"] }, "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", @@ -129,9 +99,7 @@ "is_input": null, "is_output": null, "name": "", - "output_types": [ - "Prompt" - ], + "output_types": ["Prompt"], "template": { "_type": "CustomComponent", "code": { @@ -159,9 +127,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -225,11 +191,7 @@ "display_name": "OpenAI", "id": "OpenAIModel-k39HS", "node": { - "base_classes": [ - "object", - "Text", - "str" - ], + "base_classes": ["object", "Text", "str"], "beta": false, "custom_fields": { "input_value": null, @@ -259,9 +221,7 @@ ], "frozen": false, "icon": "OpenAI", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -280,7 +240,7 @@ "show": true, "title_case": false, "type": "code", - "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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" + "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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-3.5-turbo\",\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" }, "input_value": { "advanced": false, @@ -289,11 +249,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text", - "Record", - "Prompt" - ], + "input_types": ["Text", "Record", "Prompt"], "list": false, "load_from_db": false, "multiline": false, @@ -350,9 +306,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -379,9 +333,7 @@ "fileTypes": [], "file_path": "", "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.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -400,9 +352,7 @@ "fileTypes": [], "file_path": "", "info": "The OpenAI API Key to use for the OpenAI model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": true, "multiline": false, @@ -441,9 +391,7 @@ "fileTypes": [], "file_path": "", "info": "System message to pass to the model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -503,12 +451,7 @@ "data": { "id": "ChatOutput-njtka", "node": { - "base_classes": [ - "Record", - "Text", - "str", - "object" - ], + "base_classes": ["Record", "Text", "str", "object"], "beta": false, "custom_fields": { "input_value": null, @@ -525,9 +468,7 @@ "field_order": [], "frozen": false, "icon": "ChatOutput", - "output_types": [ - "Message" - ], + "output_types": ["Message"], "template": { "_type": "CustomComponent", "code": { @@ -550,14 +491,12 @@ }, "input_value": { "advanced": false, - "display_name": "Message", + "display_name": "Text", "dynamic": false, "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -576,17 +515,12 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "sender", - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "password": false, "placeholder": "", "required": false, @@ -602,9 +536,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -624,9 +556,7 @@ "fileTypes": [], "file_path": "", "info": "If provided, the message will be stored in the memory.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -661,12 +591,7 @@ "data": { "id": "ChatInput-P3fgL", "node": { - "base_classes": [ - "object", - "Record", - "str", - "Text" - ], + "base_classes": ["object", "Record", "str", "Text"], "beta": false, "custom_fields": { "input_value": null, @@ -682,9 +607,7 @@ "field_order": [], "frozen": false, "icon": "ChatInput", - "output_types": [ - "Message" - ], + "output_types": ["Message"], "template": { "_type": "CustomComponent", "code": { @@ -703,11 +626,11 @@ "show": true, "title_case": false, "type": "code", - "value": "from typing import Optional\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.schema.message import Message\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 files: Optional[list[str]] = None,\n session_id: Optional[str] = None,\n ) -> Message:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n files=files,\n session_id=session_id,\n )\n" + "value": "from typing import Optional\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.schema.message import Message\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\": \"Text\",\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 files: Optional[list[str]] = None,\n session_id: Optional[str] = None,\n ) -> Message:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n files=files,\n session_id=session_id,\n )\n" }, "input_value": { "advanced": false, - "display_name": "Message", + "display_name": "Text", "dynamic": false, "fileTypes": [], "file_path": "", @@ -732,17 +655,12 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "sender", - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "password": false, "placeholder": "", "required": false, @@ -758,9 +676,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -780,9 +696,7 @@ "fileTypes": [], "file_path": "", "info": "If provided, the message will be stored in the memory.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -825,4 +739,4 @@ "is_component": false, "last_tested_version": "1.0.0a4", "name": "Basic Prompting (Hello, World)" -} \ 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 4069fa6bd..037c3836c 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 @@ -5,21 +5,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "Record" - ], + "baseClasses": ["Record"], "dataType": "URL", "id": "URL-HYPkR" }, "targetHandle": { "fieldName": "reference_2", "id": "Prompt-Rse03", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" } }, @@ -37,20 +30,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "OpenAIModel", "id": "OpenAIModel-gi29P" }, "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-JPlxl", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" } }, @@ -67,21 +54,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "Record" - ], + "baseClasses": ["Record"], "dataType": "URL", "id": "URL-2cX90" }, "targetHandle": { "fieldName": "reference_1", "id": "Prompt-Rse03", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" } }, @@ -98,23 +78,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "Text", - "str" - ], + "baseClasses": ["object", "Text", "str"], "dataType": "TextInput", "id": "TextInput-og8Or" }, "targetHandle": { "fieldName": "instructions", "id": "Prompt-Rse03", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" } }, @@ -131,22 +102,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "Text", - "str" - ], + "baseClasses": ["object", "Text", "str"], "dataType": "Prompt", "id": "Prompt-Rse03" }, "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-gi29P", - "inputTypes": [ - "Text", - "Record", - "Prompt" - ], + "inputTypes": ["Text", "Record", "Prompt"], "type": "str" } }, @@ -168,18 +131,10 @@ "display_name": "Prompt", "id": "Prompt-Rse03", "node": { - "base_classes": [ - "object", - "Text", - "str" - ], + "base_classes": ["object", "Text", "str"], "beta": false, "custom_fields": { - "template": [ - "reference_1", - "reference_2", - "instructions" - ] + "template": ["reference_1", "reference_2", "instructions"] }, "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", @@ -194,9 +149,7 @@ "is_input": null, "is_output": null, "name": "", - "output_types": [ - "Prompt" - ], + "output_types": ["Prompt"], "template": { "_type": "CustomComponent", "code": { @@ -302,9 +255,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -340,9 +291,7 @@ "data": { "id": "URL-HYPkR", "node": { - "base_classes": [ - "Record" - ], + "base_classes": ["Record"], "beta": false, "custom_fields": { "urls": null @@ -354,9 +303,7 @@ "field_order": [], "frozen": false, "icon": "layout-template", - "output_types": [ - "Record" - ], + "output_types": ["Record"], "template": { "_type": "CustomComponent", "code": { @@ -384,9 +331,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -424,12 +369,7 @@ "data": { "id": "ChatOutput-JPlxl", "node": { - "base_classes": [ - "Text", - "Record", - "object", - "str" - ], + "base_classes": ["Text", "Record", "object", "str"], "beta": false, "custom_fields": { "input_value": null, @@ -446,9 +386,7 @@ "field_order": [], "frozen": false, "icon": "ChatOutput", - "output_types": [ - "Message" - ], + "output_types": ["Message"], "template": { "_type": "CustomComponent", "code": { @@ -471,14 +409,12 @@ }, "input_value": { "advanced": false, - "display_name": "Message", + "display_name": "Text", "dynamic": false, "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -497,17 +433,12 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "sender", - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "password": false, "placeholder": "", "required": false, @@ -523,9 +454,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -545,9 +474,7 @@ "fileTypes": [], "file_path": "", "info": "If provided, the message will be stored in the memory.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -577,11 +504,7 @@ "data": { "id": "OpenAIModel-gi29P", "node": { - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "beta": false, "custom_fields": { "input_value": null, @@ -611,9 +534,7 @@ ], "frozen": false, "icon": "OpenAI", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -632,7 +553,7 @@ "show": true, "title_case": false, "type": "code", - "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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" + "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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-3.5-turbo\",\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" }, "input_value": { "advanced": false, @@ -641,11 +562,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text", - "Record", - "Prompt" - ], + "input_types": ["Text", "Record", "Prompt"], "list": false, "load_from_db": false, "multiline": false, @@ -702,9 +619,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -731,9 +646,7 @@ "fileTypes": [], "file_path": "", "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.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -752,9 +665,7 @@ "fileTypes": [], "file_path": "", "info": "The OpenAI API Key to use for the OpenAI model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": true, "multiline": false, @@ -793,9 +704,7 @@ "fileTypes": [], "file_path": "", "info": "System message to pass to the model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -855,9 +764,7 @@ "data": { "id": "URL-2cX90", "node": { - "base_classes": [ - "Record" - ], + "base_classes": ["Record"], "beta": false, "custom_fields": { "urls": null @@ -869,9 +776,7 @@ "field_order": [], "frozen": false, "icon": "layout-template", - "output_types": [ - "Record" - ], + "output_types": ["Record"], "template": { "_type": "CustomComponent", "code": { @@ -899,9 +804,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -912,9 +815,7 @@ "show": true, "title_case": false, "type": "str", - "value": [ - "https://www.promptingguide.ai/introduction/basics" - ] + "value": ["https://www.promptingguide.ai/introduction/basics"] } } }, @@ -939,11 +840,7 @@ "data": { "id": "TextInput-og8Or", "node": { - "base_classes": [ - "object", - "Text", - "str" - ], + "base_classes": ["object", "Text", "str"], "beta": false, "custom_fields": { "input_value": null, @@ -956,9 +853,7 @@ "field_order": [], "frozen": false, "icon": "type", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -986,10 +881,7 @@ "fileTypes": [], "file_path": "", "info": "Text or Record to be passed as input.", - "input_types": [ - "Record", - "Text" - ], + "input_types": ["Record", "Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1009,9 +901,7 @@ "fileTypes": [], "file_path": "", "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -1055,4 +945,4 @@ "is_component": false, "last_tested_version": "1.0.0a0", "name": "Blog Writer" -} \ 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 ecbcd04d7..256486942 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 @@ -5,24 +5,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "str", - "Record", - "Text", - "object" - ], + "baseClasses": ["str", "Record", "Text", "object"], "dataType": "ChatInput", "id": "ChatInput-MsSJ9" }, "targetHandle": { "fieldName": "Question", "id": "Prompt-tHwPf", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" } }, @@ -39,21 +29,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "Record" - ], + "baseClasses": ["Record"], "dataType": "File", "id": "File-6TEsD" }, "targetHandle": { "fieldName": "Document", "id": "Prompt-tHwPf", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" } }, @@ -70,22 +53,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "Prompt", "id": "Prompt-tHwPf" }, "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-Bt067", - "inputTypes": [ - "Text", - "Record", - "Prompt" - ], + "inputTypes": ["Text", "Record", "Prompt"], "type": "str" } }, @@ -102,20 +77,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "OpenAIModel", "id": "OpenAIModel-Bt067" }, "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-F5Awj", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" } }, @@ -136,17 +105,10 @@ "display_name": "Prompt", "id": "Prompt-tHwPf", "node": { - "base_classes": [ - "object", - "str", - "Text" - ], + "base_classes": ["object", "str", "Text"], "beta": false, "custom_fields": { - "template": [ - "Document", - "Question" - ] + "template": ["Document", "Question"] }, "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", @@ -161,9 +123,7 @@ "is_input": null, "is_output": null, "name": "", - "output_types": [ - "Prompt" - ], + "output_types": ["Prompt"], "template": { "Document": { "advanced": false, @@ -243,9 +203,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -281,9 +239,7 @@ "data": { "id": "File-6TEsD", "node": { - "base_classes": [ - "Record" - ], + "base_classes": ["Record"], "beta": false, "custom_fields": { "path": null, @@ -295,9 +251,7 @@ "field_formatters": {}, "field_order": [], "frozen": false, - "output_types": [ - "Record" - ], + "output_types": ["Record"], "template": { "_type": "CustomComponent", "code": { @@ -391,12 +345,7 @@ "data": { "id": "ChatInput-MsSJ9", "node": { - "base_classes": [ - "str", - "Record", - "Text", - "object" - ], + "base_classes": ["str", "Record", "Text", "object"], "beta": false, "custom_fields": { "input_value": null, @@ -412,9 +361,7 @@ "field_order": [], "frozen": false, "icon": "ChatInput", - "output_types": [ - "Message" - ], + "output_types": ["Message"], "template": { "_type": "CustomComponent", "code": { @@ -433,11 +380,11 @@ "show": true, "title_case": false, "type": "code", - "value": "from typing import Optional\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.schema.message import Message\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 files: Optional[list[str]] = None,\n session_id: Optional[str] = None,\n ) -> Message:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n files=files,\n session_id=session_id,\n )\n" + "value": "from typing import Optional\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.schema.message import Message\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\": \"Text\",\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 files: Optional[list[str]] = None,\n session_id: Optional[str] = None,\n ) -> Message:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n files=files,\n session_id=session_id,\n )\n" }, "input_value": { "advanced": false, - "display_name": "Message", + "display_name": "Text", "dynamic": false, "fileTypes": [], "file_path": "", @@ -462,17 +409,12 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "sender", - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "password": false, "placeholder": "", "required": false, @@ -488,9 +430,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -510,9 +450,7 @@ "fileTypes": [], "file_path": "", "info": "If provided, the message will be stored in the memory.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -547,12 +485,7 @@ "data": { "id": "ChatOutput-F5Awj", "node": { - "base_classes": [ - "str", - "Record", - "Text", - "object" - ], + "base_classes": ["str", "Record", "Text", "object"], "beta": false, "custom_fields": { "input_value": null, @@ -568,9 +501,7 @@ "field_order": [], "frozen": false, "icon": "ChatOutput", - "output_types": [ - "Message" - ], + "output_types": ["Message"], "template": { "_type": "CustomComponent", "code": { @@ -593,14 +524,12 @@ }, "input_value": { "advanced": false, - "display_name": "Message", + "display_name": "Text", "dynamic": false, "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -619,17 +548,12 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "sender", - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "password": false, "placeholder": "", "required": false, @@ -645,9 +569,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -667,9 +589,7 @@ "fileTypes": [], "file_path": "", "info": "If provided, the message will be stored in the memory.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -704,11 +624,7 @@ "data": { "id": "OpenAIModel-Bt067", "node": { - "base_classes": [ - "object", - "str", - "Text" - ], + "base_classes": ["object", "str", "Text"], "beta": false, "custom_fields": { "input_value": null, @@ -738,9 +654,7 @@ ], "frozen": false, "icon": "OpenAI", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -759,7 +673,7 @@ "show": true, "title_case": false, "type": "code", - "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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" + "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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-3.5-turbo\",\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" }, "input_value": { "advanced": false, @@ -768,11 +682,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text", - "Record", - "Prompt" - ], + "input_types": ["Text", "Record", "Prompt"], "list": false, "load_from_db": false, "multiline": false, @@ -829,9 +739,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -858,9 +766,7 @@ "fileTypes": [], "file_path": "", "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.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -879,9 +785,7 @@ "fileTypes": [], "file_path": "", "info": "The OpenAI API Key to use for the OpenAI model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": true, "multiline": false, @@ -920,9 +824,7 @@ "fileTypes": [], "file_path": "", "info": "System message to pass to the model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -990,4 +892,4 @@ "is_component": false, "last_tested_version": "1.0.0a0", "name": "Document QA" -} \ 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 c23f7b08c..f07f5b351 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 @@ -5,23 +5,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "MemoryComponent", "id": "MemoryComponent-cdA1J" }, "targetHandle": { "fieldName": "context", "id": "Prompt-ODkUx", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" } }, @@ -39,24 +30,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "Text", - "object", - "Record", - "str" - ], + "baseClasses": ["Text", "object", "Record", "str"], "dataType": "ChatInput", "id": "ChatInput-t7F8v" }, "targetHandle": { "fieldName": "user_message", "id": "Prompt-ODkUx", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" } }, @@ -74,22 +55,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "Text", - "str", - "object" - ], + "baseClasses": ["Text", "str", "object"], "dataType": "Prompt", "id": "Prompt-ODkUx" }, "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-9RykF", - "inputTypes": [ - "Text", - "Record", - "Prompt" - ], + "inputTypes": ["Text", "Record", "Prompt"], "type": "str" } }, @@ -106,20 +79,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "str", - "object", - "Text" - ], + "baseClasses": ["str", "object", "Text"], "dataType": "OpenAIModel", "id": "OpenAIModel-9RykF" }, "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-P1jEe", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" } }, @@ -136,21 +103,14 @@ "className": "stroke-foreground stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "MemoryComponent", "id": "MemoryComponent-cdA1J" }, "targetHandle": { "fieldName": "input_value", "id": "TextOutput-vrs6T", - "inputTypes": [ - "Record", - "Text" - ], + "inputTypes": ["Record", "Text"], "type": "str" } }, @@ -169,12 +129,7 @@ "data": { "id": "ChatInput-t7F8v", "node": { - "base_classes": [ - "Text", - "object", - "Record", - "str" - ], + "base_classes": ["Text", "object", "Record", "str"], "beta": false, "custom_fields": { "input_value": null, @@ -190,9 +145,7 @@ "field_order": [], "frozen": false, "icon": "ChatInput", - "output_types": [ - "Message" - ], + "output_types": ["Message"], "template": { "_type": "CustomComponent", "code": { @@ -211,11 +164,11 @@ "show": true, "title_case": false, "type": "code", - "value": "from typing import Optional\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.schema.message import Message\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 files: Optional[list[str]] = None,\n session_id: Optional[str] = None,\n ) -> Message:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n files=files,\n session_id=session_id,\n )\n" + "value": "from typing import Optional\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.schema.message import Message\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\": \"Text\",\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 files: Optional[list[str]] = None,\n session_id: Optional[str] = None,\n ) -> Message:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n files=files,\n session_id=session_id,\n )\n" }, "input_value": { "advanced": false, - "display_name": "Message", + "display_name": "Text", "dynamic": false, "fileTypes": [], "file_path": "", @@ -240,17 +193,12 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "sender", - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "password": false, "placeholder": "", "required": false, @@ -266,9 +214,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -288,9 +234,7 @@ "fileTypes": [], "file_path": "", "info": "If provided, the message will be stored in the memory.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -326,12 +270,7 @@ "data": { "id": "ChatOutput-P1jEe", "node": { - "base_classes": [ - "Text", - "object", - "Record", - "str" - ], + "base_classes": ["Text", "object", "Record", "str"], "beta": false, "custom_fields": { "input_value": null, @@ -347,9 +286,7 @@ "field_order": [], "frozen": false, "icon": "ChatOutput", - "output_types": [ - "Message" - ], + "output_types": ["Message"], "template": { "_type": "CustomComponent", "code": { @@ -372,14 +309,12 @@ }, "input_value": { "advanced": false, - "display_name": "Message", + "display_name": "Text", "dynamic": false, "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -398,17 +333,12 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "sender", - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "password": false, "placeholder": "", "required": false, @@ -424,9 +354,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -446,9 +374,7 @@ "fileTypes": [], "file_path": "", "info": "If provided, the message will be stored in the memory.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -486,11 +412,7 @@ "display_name": "Chat Memory", "id": "MemoryComponent-cdA1J", "node": { - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "beta": true, "custom_fields": { "n_messages": null, @@ -507,9 +429,7 @@ "field_order": [], "frozen": false, "icon": "history", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -556,17 +476,12 @@ "fileTypes": [], "file_path": "", "info": "Order of the messages.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "order", - "options": [ - "Ascending", - "Descending" - ], + "options": ["Ascending", "Descending"], "password": false, "placeholder": "", "required": false, @@ -582,9 +497,7 @@ "fileTypes": [], "file_path": "", "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -604,18 +517,12 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "sender", - "options": [ - "Machine", - "User", - "Machine and User" - ], + "options": ["Machine", "User", "Machine and User"], "password": false, "placeholder": "", "required": false, @@ -631,9 +538,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -652,9 +557,7 @@ "fileTypes": [], "file_path": "", "info": "Session ID of the chat history.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -692,17 +595,10 @@ "display_name": "Prompt", "id": "Prompt-ODkUx", "node": { - "base_classes": [ - "Text", - "str", - "object" - ], + "base_classes": ["Text", "str", "object"], "beta": false, "custom_fields": { - "template": [ - "context", - "user_message" - ] + "template": ["context", "user_message"] }, "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", @@ -717,9 +613,7 @@ "is_input": null, "is_output": null, "name": "", - "output_types": [ - "Prompt" - ], + "output_types": ["Prompt"], "template": { "_type": "CustomComponent", "code": { @@ -773,9 +667,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -837,11 +729,7 @@ "data": { "id": "OpenAIModel-9RykF", "node": { - "base_classes": [ - "str", - "object", - "Text" - ], + "base_classes": ["str", "object", "Text"], "beta": false, "custom_fields": { "input_value": null, @@ -871,9 +759,7 @@ ], "frozen": false, "icon": "OpenAI", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -892,7 +778,7 @@ "show": true, "title_case": false, "type": "code", - "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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" + "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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-3.5-turbo\",\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" }, "input_value": { "advanced": false, @@ -901,11 +787,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text", - "Record", - "Prompt" - ], + "input_types": ["Text", "Record", "Prompt"], "list": false, "load_from_db": false, "multiline": false, @@ -962,9 +844,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -991,9 +871,7 @@ "fileTypes": [], "file_path": "", "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.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1012,9 +890,7 @@ "fileTypes": [], "file_path": "", "info": "The OpenAI API Key to use for the OpenAI model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": true, "multiline": false, @@ -1053,9 +929,7 @@ "fileTypes": [], "file_path": "", "info": "System message to pass to the model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1115,11 +989,7 @@ "data": { "id": "TextOutput-vrs6T", "node": { - "base_classes": [ - "str", - "object", - "Text" - ], + "base_classes": ["str", "object", "Text"], "beta": false, "custom_fields": { "input_value": null, @@ -1132,9 +1002,7 @@ "field_order": [], "frozen": false, "icon": "type", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -1162,10 +1030,7 @@ "fileTypes": [], "file_path": "", "info": "Text or Record to be passed as output.", - "input_types": [ - "Record", - "Text" - ], + "input_types": ["Record", "Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1185,9 +1050,7 @@ "fileTypes": [], "file_path": "", "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -1233,4 +1096,4 @@ "is_component": false, "last_tested_version": "1.0.0a0", "name": "Memory Chatbot" -} \ 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 e43723236..5594a9109 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 @@ -5,23 +5,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "TextInput", "id": "TextInput-sptaH" }, "targetHandle": { "fieldName": "document", "id": "Prompt-amqBu", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" } }, @@ -38,21 +29,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "Prompt", "id": "Prompt-amqBu" }, "targetHandle": { "fieldName": "input_value", "id": "TextOutput-2MS4a", - "inputTypes": [ - "Record", - "Text" - ], + "inputTypes": ["Record", "Text"], "type": "str" } }, @@ -69,22 +53,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "Prompt", "id": "Prompt-amqBu" }, "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-uYXZJ", - "inputTypes": [ - "Text", - "Record", - "Prompt" - ], + "inputTypes": ["Text", "Record", "Prompt"], "type": "str" } }, @@ -101,23 +77,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "OpenAIModel", "id": "OpenAIModel-uYXZJ" }, "targetHandle": { "fieldName": "summary", "id": "Prompt-gTNiz", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" } }, @@ -134,20 +101,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "OpenAIModel", "id": "OpenAIModel-uYXZJ" }, "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-EJkG3", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" } }, @@ -164,21 +125,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "Prompt", "id": "Prompt-gTNiz" }, "targetHandle": { "fieldName": "input_value", "id": "TextOutput-MUDOR", - "inputTypes": [ - "Record", - "Text" - ], + "inputTypes": ["Record", "Text"], "type": "str" } }, @@ -195,22 +149,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "Prompt", "id": "Prompt-gTNiz" }, "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-XawYB", - "inputTypes": [ - "Text", - "Record", - "Prompt" - ], + "inputTypes": ["Text", "Record", "Prompt"], "type": "str" } }, @@ -227,20 +173,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "OpenAIModel", "id": "OpenAIModel-XawYB" }, "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-DNmvg", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" } }, @@ -261,16 +201,10 @@ "display_name": "Prompt", "id": "Prompt-amqBu", "node": { - "base_classes": [ - "object", - "str", - "Text" - ], + "base_classes": ["object", "str", "Text"], "beta": false, "custom_fields": { - "template": [ - "document" - ] + "template": ["document"] }, "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", @@ -285,9 +219,7 @@ "is_input": null, "is_output": null, "name": "", - "output_types": [ - "Prompt" - ], + "output_types": ["Prompt"], "template": { "_type": "CustomComponent", "code": { @@ -341,9 +273,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -381,16 +311,10 @@ "display_name": "Prompt", "id": "Prompt-gTNiz", "node": { - "base_classes": [ - "object", - "str", - "Text" - ], + "base_classes": ["object", "str", "Text"], "beta": false, "custom_fields": { - "template": [ - "summary" - ] + "template": ["summary"] }, "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", @@ -405,9 +329,7 @@ "is_input": null, "is_output": null, "name": "", - "output_types": [ - "Prompt" - ], + "output_types": ["Prompt"], "template": { "_type": "CustomComponent", "code": { @@ -461,9 +383,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -495,12 +415,7 @@ "data": { "id": "ChatOutput-EJkG3", "node": { - "base_classes": [ - "object", - "Record", - "Text", - "str" - ], + "base_classes": ["object", "Record", "Text", "str"], "beta": false, "custom_fields": { "input_value": null, @@ -517,9 +432,7 @@ "field_order": [], "frozen": false, "icon": "ChatOutput", - "output_types": [ - "Message" - ], + "output_types": ["Message"], "template": { "_type": "CustomComponent", "code": { @@ -542,14 +455,12 @@ }, "input_value": { "advanced": false, - "display_name": "Message", + "display_name": "Text", "dynamic": false, "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -568,17 +479,12 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "sender", - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "password": false, "placeholder": "", "required": false, @@ -594,9 +500,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -616,9 +520,7 @@ "fileTypes": [], "file_path": "", "info": "If provided, the message will be stored in the memory.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -649,12 +551,7 @@ "data": { "id": "ChatOutput-DNmvg", "node": { - "base_classes": [ - "object", - "Record", - "Text", - "str" - ], + "base_classes": ["object", "Record", "Text", "str"], "beta": false, "custom_fields": { "input_value": null, @@ -671,9 +568,7 @@ "field_order": [], "frozen": false, "icon": "ChatOutput", - "output_types": [ - "Message" - ], + "output_types": ["Message"], "template": { "_type": "CustomComponent", "code": { @@ -696,14 +591,12 @@ }, "input_value": { "advanced": false, - "display_name": "Message", + "display_name": "Text", "dynamic": false, "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -722,17 +615,12 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "sender", - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "password": false, "placeholder": "", "required": false, @@ -748,9 +636,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -770,9 +656,7 @@ "fileTypes": [], "file_path": "", "info": "If provided, the message will be stored in the memory.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -802,11 +686,7 @@ "data": { "id": "TextInput-sptaH", "node": { - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "beta": false, "custom_fields": { "input_value": null, @@ -819,9 +699,7 @@ "field_order": [], "frozen": false, "icon": "type", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -840,19 +718,16 @@ "show": true, "title_case": false, "type": "code", - "value": "from typing import Optional\n\nfrom langflow.base.io.text import TextComponent\nfrom langflow.field_typing import Text\n\n\nclass TextInput(TextComponent):\n display_name = \"Text Input\"\n description = \"Get text inputs from the Playground.\"\n icon = \"type\"\n\n def build_config(self):\n return {\n \"input_value\": {\n \"display_name\": \"Value\",\n \"input_types\": [\"Record\", \"Text\"],\n \"info\": \"Text or Record to be passed as input.\",\n },\n \"record_template\": {\n \"display_name\": \"Record Template\",\n \"multiline\": True,\n \"info\": \"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.\",\n \"advanced\": True,\n },\n }\n\n def build(\n self,\n input_value: Optional[Text] = \"\",\n record_template: Optional[str] = \"\",\n ) -> Text:\n return super().build(input_value=input_value, record_template=record_template)\n" + "value": "from 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\": \"Text\",\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" }, "input_value": { "advanced": false, - "display_name": "Value", + "display_name": "Text", "dynamic": false, "fileTypes": [], "file_path": "", "info": "Text or Record to be passed as input.", - "input_types": [ - "Record", - "Text" - ], + "input_types": ["Record", "Text"], "list": false, "load_from_db": false, "multiline": false, @@ -872,9 +747,7 @@ "fileTypes": [], "file_path": "", "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -910,11 +783,7 @@ "data": { "id": "TextOutput-2MS4a", "node": { - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "beta": false, "custom_fields": { "input_value": null, @@ -927,9 +796,7 @@ "field_order": [], "frozen": false, "icon": "type", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -957,10 +824,7 @@ "fileTypes": [], "file_path": "", "info": "Text or Record to be passed as output.", - "input_types": [ - "Record", - "Text" - ], + "input_types": ["Record", "Text"], "list": false, "load_from_db": false, "multiline": false, @@ -980,9 +844,7 @@ "fileTypes": [], "file_path": "", "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -1018,11 +880,7 @@ "data": { "id": "OpenAIModel-uYXZJ", "node": { - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "beta": false, "custom_fields": { "input_value": null, @@ -1052,9 +910,7 @@ ], "frozen": false, "icon": "OpenAI", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -1073,7 +929,7 @@ "show": true, "title_case": false, "type": "code", - "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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" + "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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-3.5-turbo\",\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" }, "input_value": { "advanced": false, @@ -1082,11 +938,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text", - "Record", - "Prompt" - ], + "input_types": ["Text", "Record", "Prompt"], "list": false, "load_from_db": false, "multiline": false, @@ -1143,9 +995,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -1172,9 +1022,7 @@ "fileTypes": [], "file_path": "", "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.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1193,9 +1041,7 @@ "fileTypes": [], "file_path": "", "info": "The OpenAI API Key to use for the OpenAI model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": true, "multiline": false, @@ -1234,9 +1080,7 @@ "fileTypes": [], "file_path": "", "info": "System message to pass to the model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1296,11 +1140,7 @@ "data": { "id": "TextOutput-MUDOR", "node": { - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "beta": false, "custom_fields": { "input_value": null, @@ -1313,9 +1153,7 @@ "field_order": [], "frozen": false, "icon": "type", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -1343,10 +1181,7 @@ "fileTypes": [], "file_path": "", "info": "Text or Record to be passed as output.", - "input_types": [ - "Record", - "Text" - ], + "input_types": ["Record", "Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1366,9 +1201,7 @@ "fileTypes": [], "file_path": "", "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -1404,11 +1237,7 @@ "data": { "id": "OpenAIModel-XawYB", "node": { - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "beta": false, "custom_fields": { "input_value": null, @@ -1438,9 +1267,7 @@ ], "frozen": false, "icon": "OpenAI", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -1459,7 +1286,7 @@ "show": true, "title_case": false, "type": "code", - "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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" + "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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-3.5-turbo\",\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" }, "input_value": { "advanced": false, @@ -1468,11 +1295,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text", - "Record", - "Prompt" - ], + "input_types": ["Text", "Record", "Prompt"], "list": false, "load_from_db": false, "multiline": false, @@ -1529,9 +1352,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -1558,9 +1379,7 @@ "fileTypes": [], "file_path": "", "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.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1579,9 +1398,7 @@ "fileTypes": [], "file_path": "", "info": "The OpenAI API Key to use for the OpenAI model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1620,9 +1437,7 @@ "fileTypes": [], "file_path": "", "info": "System message to pass to the model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1690,4 +1505,4 @@ "is_component": false, "last_tested_version": "1.0.0a0", "name": "Prompt Chaining" -} \ No newline at end of file +} diff --git a/src/backend/base/langflow/initial_setup/starter_projects/VectorStore-RAG-Flows.json b/src/backend/base/langflow/initial_setup/starter_projects/VectorStore-RAG-Flows.json index 57e164986..5b0ee7a64 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/VectorStore-RAG-Flows.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/VectorStore-RAG-Flows.json @@ -5,23 +5,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "Text", - "str" - ], + "baseClasses": ["object", "Text", "str"], "dataType": "TextOutput", "id": "TextOutput-BDknO" }, "targetHandle": { "fieldName": "context", "id": "Prompt-xeI6K", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" } }, @@ -39,24 +30,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "Text", - "str", - "object", - "Record" - ], + "baseClasses": ["Text", "str", "object", "Record"], "dataType": "ChatInput", "id": "ChatInput-yxMKE" }, "targetHandle": { "fieldName": "question", "id": "Prompt-xeI6K", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" } }, @@ -74,22 +55,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "Text", - "str" - ], + "baseClasses": ["object", "Text", "str"], "dataType": "Prompt", "id": "Prompt-xeI6K" }, "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-EjXlN", - "inputTypes": [ - "Text", - "Record", - "Prompt" - ], + "inputTypes": ["Text", "Record", "Prompt"], "type": "str" } }, @@ -107,20 +80,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "object", - "Text", - "str" - ], + "baseClasses": ["object", "Text", "str"], "dataType": "OpenAIModel", "id": "OpenAIModel-EjXlN" }, "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-Q39I8", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" } }, @@ -138,19 +105,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "Record" - ], + "baseClasses": ["Record"], "dataType": "File", "id": "File-t0a6a" }, "targetHandle": { "fieldName": "inputs", "id": "RecursiveCharacterTextSplitter-tR9QM", - "inputTypes": [ - "Document", - "Record" - ], + "inputTypes": ["Document", "Record"], "type": "Document" } }, @@ -168,9 +130,7 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "Embeddings" - ], + "baseClasses": ["Embeddings"], "dataType": "OpenAIEmbeddings", "id": "OpenAIEmbeddings-ZlOk1" }, @@ -194,21 +154,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "Text", - "str", - "object", - "Record" - ], + "baseClasses": ["Text", "str", "object", "Record"], "dataType": "ChatInput", "id": "ChatInput-yxMKE" }, "targetHandle": { "fieldName": "input_value", "id": "AstraDBSearch-41nRz", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" } }, @@ -225,9 +178,7 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "Record" - ], + "baseClasses": ["Record"], "dataType": "RecursiveCharacterTextSplitter", "id": "RecursiveCharacterTextSplitter-tR9QM" }, @@ -252,9 +203,7 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "Embeddings" - ], + "baseClasses": ["Embeddings"], "dataType": "OpenAIEmbeddings", "id": "OpenAIEmbeddings-9TPjc" }, @@ -279,19 +228,14 @@ "className": "stroke-gray-900 stroke-connection", "data": { "sourceHandle": { - "baseClasses": [ - "Record" - ], + "baseClasses": ["Record"], "dataType": "AstraDBSearch", "id": "AstraDBSearch-41nRz" }, "targetHandle": { "fieldName": "input_value", "id": "TextOutput-BDknO", - "inputTypes": [ - "Record", - "Text" - ], + "inputTypes": ["Record", "Text"], "type": "str" } }, @@ -310,12 +254,7 @@ "data": { "id": "ChatInput-yxMKE", "node": { - "base_classes": [ - "Text", - "str", - "object", - "Record" - ], + "base_classes": ["Text", "str", "object", "Record"], "beta": false, "custom_fields": { "input_value": null, @@ -331,9 +270,7 @@ "field_order": [], "frozen": false, "icon": "ChatInput", - "output_types": [ - "Message" - ], + "output_types": ["Message"], "template": { "_type": "CustomComponent", "code": { @@ -352,11 +289,11 @@ "show": true, "title_case": false, "type": "code", - "value": "from typing import Optional\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.schema.message import Message\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 files: Optional[list[str]] = None,\n session_id: Optional[str] = None,\n ) -> Message:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n files=files,\n session_id=session_id,\n )\n" + "value": "from typing import Optional\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.schema.message import Message\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\": \"Text\",\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 files: Optional[list[str]] = None,\n session_id: Optional[str] = None,\n ) -> Message:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n files=files,\n session_id=session_id,\n )\n" }, "input_value": { "advanced": false, - "display_name": "Message", + "display_name": "Text", "dynamic": false, "fileTypes": [], "file_path": "", @@ -381,17 +318,12 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "sender", - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "password": false, "placeholder": "", "required": false, @@ -407,9 +339,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -429,9 +359,7 @@ "fileTypes": [], "file_path": "", "info": "If provided, the message will be stored in the memory.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -461,11 +389,7 @@ "data": { "id": "TextOutput-BDknO", "node": { - "base_classes": [ - "object", - "Text", - "str" - ], + "base_classes": ["object", "Text", "str"], "beta": false, "custom_fields": { "input_value": null, @@ -478,9 +402,7 @@ "field_order": [], "frozen": false, "icon": "type", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -508,10 +430,7 @@ "fileTypes": [], "file_path": "", "info": "Text or Record to be passed as output.", - "input_types": [ - "Record", - "Text" - ], + "input_types": ["Record", "Text"], "list": false, "load_from_db": false, "multiline": false, @@ -531,9 +450,7 @@ "fileTypes": [], "file_path": "", "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -569,9 +486,7 @@ "data": { "id": "OpenAIEmbeddings-ZlOk1", "node": { - "base_classes": [ - "Embeddings" - ], + "base_classes": ["Embeddings"], "beta": false, "custom_fields": { "allowed_special": null, @@ -603,9 +518,7 @@ "field_formatters": {}, "field_order": [], "frozen": false, - "output_types": [ - "Embeddings" - ], + "output_types": ["Embeddings"], "template": { "_type": "CustomComponent", "allowed_special": { @@ -615,9 +528,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -711,9 +622,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -733,9 +642,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -746,9 +653,7 @@ "show": true, "title_case": false, "type": "str", - "value": [ - "all" - ] + "value": ["all"] }, "embedding_ctx_length": { "advanced": true, @@ -795,9 +700,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -841,9 +744,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -862,9 +763,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": true, "multiline": false, @@ -884,9 +783,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -905,9 +802,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -926,9 +821,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -947,9 +840,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1049,9 +940,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1082,11 +971,7 @@ "data": { "id": "OpenAIModel-EjXlN", "node": { - "base_classes": [ - "object", - "Text", - "str" - ], + "base_classes": ["object", "Text", "str"], "beta": false, "custom_fields": { "input_value": null, @@ -1116,9 +1001,7 @@ ], "frozen": false, "icon": "OpenAI", - "output_types": [ - "Text" - ], + "output_types": ["Text"], "template": { "_type": "CustomComponent", "code": { @@ -1137,7 +1020,7 @@ "show": true, "title_case": false, "type": "code", - "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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" + "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\", \"input_types\": [\"Text\", \"Record\", \"Prompt\"]},\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-3.5-turbo\",\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" }, "input_value": { "advanced": false, @@ -1146,11 +1029,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text", - "Record", - "Prompt" - ], + "input_types": ["Text", "Record", "Prompt"], "list": false, "load_from_db": false, "multiline": false, @@ -1207,9 +1086,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -1236,9 +1113,7 @@ "fileTypes": [], "file_path": "", "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.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1257,9 +1132,7 @@ "fileTypes": [], "file_path": "", "info": "The OpenAI API Key to use for the OpenAI model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": true, "multiline": false, @@ -1298,9 +1171,7 @@ "fileTypes": [], "file_path": "", "info": "System message to pass to the model.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1362,17 +1233,10 @@ "display_name": "Prompt", "id": "Prompt-xeI6K", "node": { - "base_classes": [ - "object", - "Text", - "str" - ], + "base_classes": ["object", "Text", "str"], "beta": false, "custom_fields": { - "template": [ - "context", - "question" - ] + "template": ["context", "question"] }, "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", @@ -1387,9 +1251,7 @@ "is_input": null, "is_output": null, "name": "", - "output_types": [ - "Prompt" - ], + "output_types": ["Prompt"], "template": { "_type": "CustomComponent", "code": { @@ -1469,9 +1331,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1507,12 +1367,7 @@ "data": { "id": "ChatOutput-Q39I8", "node": { - "base_classes": [ - "object", - "Text", - "Record", - "str" - ], + "base_classes": ["object", "Text", "Record", "str"], "beta": false, "custom_fields": { "input_value": null, @@ -1529,9 +1384,7 @@ "field_order": [], "frozen": false, "icon": "ChatOutput", - "output_types": [ - "Message" - ], + "output_types": ["Message"], "template": { "_type": "CustomComponent", "code": { @@ -1554,14 +1407,12 @@ }, "input_value": { "advanced": false, - "display_name": "Message", + "display_name": "Text", "dynamic": false, "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": true, @@ -1580,17 +1431,12 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "sender", - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "password": false, "placeholder": "", "required": false, @@ -1606,9 +1452,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1628,9 +1472,7 @@ "fileTypes": [], "file_path": "", "info": "If provided, the message will be stored in the memory.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -1665,9 +1507,7 @@ "data": { "id": "File-t0a6a", "node": { - "base_classes": [ - "Record" - ], + "base_classes": ["Record"], "beta": false, "custom_fields": { "path": null, @@ -1680,9 +1520,7 @@ "field_order": [], "frozen": false, "icon": "file-text", - "output_types": [ - "Record" - ], + "output_types": ["Record"], "template": { "_type": "CustomComponent", "code": { @@ -1783,9 +1621,7 @@ "data": { "id": "RecursiveCharacterTextSplitter-tR9QM", "node": { - "base_classes": [ - "Record" - ], + "base_classes": ["Record"], "beta": false, "custom_fields": { "chunk_overlap": null, @@ -1799,9 +1635,7 @@ "field_formatters": {}, "field_order": [], "frozen": false, - "output_types": [ - "Record" - ], + "output_types": ["Record"], "template": { "_type": "CustomComponent", "chunk_overlap": { @@ -1867,10 +1701,7 @@ "fileTypes": [], "file_path": "", "info": "The texts to split.", - "input_types": [ - "Document", - "Record" - ], + "input_types": ["Document", "Record"], "list": true, "load_from_db": false, "multiline": false, @@ -1889,9 +1720,7 @@ "fileTypes": [], "file_path": "", "info": "The characters to split on.\nIf left empty defaults to [\"\\n\\n\", \"\\n\", \" \", \"\"].", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -1902,9 +1731,7 @@ "show": true, "title_case": false, "type": "str", - "value": [ - "" - ] + "value": [""] } } }, @@ -1929,9 +1756,7 @@ "data": { "id": "AstraDBSearch-41nRz", "node": { - "base_classes": [ - "Record" - ], + "base_classes": ["Record"], "beta": false, "custom_fields": { "api_endpoint": null, @@ -1966,9 +1791,7 @@ ], "frozen": false, "icon": "AstraDB", - "output_types": [ - "Record" - ], + "output_types": ["Record"], "template": { "_type": "CustomComponent", "api_endpoint": { @@ -1978,9 +1801,7 @@ "fileTypes": [], "file_path": "", "info": "API endpoint URL for the Astra DB service.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": true, "multiline": false, @@ -2108,9 +1929,7 @@ "fileTypes": [], "file_path": "", "info": "The name of the collection within Astra DB where the vectors will be stored.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -2148,9 +1967,7 @@ "fileTypes": [], "file_path": "", "info": "Input value to search", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -2169,9 +1986,7 @@ "fileTypes": [], "file_path": "", "info": "Optional list of metadata fields to exclude from the indexing.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -2190,9 +2005,7 @@ "fileTypes": [], "file_path": "", "info": "Optional list of metadata fields to include in the indexing.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -2211,9 +2024,7 @@ "fileTypes": [], "file_path": "", "info": "Optional distance metric for vector comparisons in the vector store.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -2232,9 +2043,7 @@ "fileTypes": [], "file_path": "", "info": "Optional namespace within Astra DB to use for the collection.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -2291,17 +2100,12 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "search_type", - "options": [ - "Similarity", - "MMR" - ], + "options": ["Similarity", "MMR"], "password": false, "placeholder": "", "required": false, @@ -2317,18 +2121,12 @@ "fileTypes": [], "file_path": "", "info": "Configuration mode for setting up the vector store, with options like “Sync”, “Async”, or “Off”.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "setup_mode", - "options": [ - "Sync", - "Async", - "Off" - ], + "options": ["Sync", "Async", "Off"], "password": false, "placeholder": "", "required": false, @@ -2344,9 +2142,7 @@ "fileTypes": [], "file_path": "", "info": "Authentication token for accessing Astra DB.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": true, "multiline": false, @@ -2382,9 +2178,7 @@ "data": { "id": "AstraDB-eUCSS", "node": { - "base_classes": [ - "VectorStore" - ], + "base_classes": ["VectorStore"], "beta": false, "custom_fields": { "api_endpoint": null, @@ -2417,10 +2211,7 @@ ], "frozen": false, "icon": "AstraDB", - "output_types": [ - "VectorStore", - "BaseRetriever" - ], + "output_types": ["VectorStore", "BaseRetriever"], "template": { "_type": "CustomComponent", "api_endpoint": { @@ -2430,9 +2221,7 @@ "fileTypes": [], "file_path": "", "info": "API endpoint URL for the Astra DB service.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": true, "multiline": false, @@ -2560,9 +2349,7 @@ "fileTypes": [], "file_path": "", "info": "The name of the collection within Astra DB where the vectors will be stored.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -2618,9 +2405,7 @@ "fileTypes": [], "file_path": "", "info": "Optional list of metadata fields to exclude from the indexing.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -2639,9 +2424,7 @@ "fileTypes": [], "file_path": "", "info": "Optional list of metadata fields to include in the indexing.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -2660,9 +2443,7 @@ "fileTypes": [], "file_path": "", "info": "Optional distance metric for vector comparisons in the vector store.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -2681,9 +2462,7 @@ "fileTypes": [], "file_path": "", "info": "Optional namespace within Astra DB to use for the collection.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -2721,18 +2500,12 @@ "fileTypes": [], "file_path": "", "info": "Configuration mode for setting up the vector store, with options like “Sync”, “Async”, or “Off”.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, "name": "setup_mode", - "options": [ - "Sync", - "Async", - "Off" - ], + "options": ["Sync", "Async", "Off"], "password": false, "placeholder": "", "required": false, @@ -2748,9 +2521,7 @@ "fileTypes": [], "file_path": "", "info": "Authentication token for accessing Astra DB.", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": true, "multiline": false, @@ -2786,9 +2557,7 @@ "data": { "id": "OpenAIEmbeddings-9TPjc", "node": { - "base_classes": [ - "Embeddings" - ], + "base_classes": ["Embeddings"], "beta": false, "custom_fields": { "allowed_special": null, @@ -2820,9 +2589,7 @@ "field_formatters": {}, "field_order": [], "frozen": false, - "output_types": [ - "Embeddings" - ], + "output_types": ["Embeddings"], "template": { "_type": "CustomComponent", "allowed_special": { @@ -2832,9 +2599,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -2928,9 +2693,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -2950,9 +2713,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -2963,9 +2724,7 @@ "show": true, "title_case": false, "type": "str", - "value": [ - "all" - ] + "value": ["all"] }, "embedding_ctx_length": { "advanced": true, @@ -3012,9 +2771,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": true, "load_from_db": false, "multiline": false, @@ -3058,9 +2815,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -3079,9 +2834,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": true, "multiline": false, @@ -3101,9 +2854,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -3122,9 +2873,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -3143,9 +2892,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -3164,9 +2911,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -3266,9 +3011,7 @@ "fileTypes": [], "file_path": "", "info": "", - "input_types": [ - "Text" - ], + "input_types": ["Text"], "list": false, "load_from_db": false, "multiline": false, @@ -3311,4 +3054,4 @@ "is_component": false, "last_tested_version": "1.0.0a0", "name": "Vector Store RAG" -} \ No newline at end of file +}