update projects
This commit is contained in:
parent
8b1234f6ca
commit
fcdef335ca
6 changed files with 4469 additions and 9936 deletions
|
|
@ -344,341 +344,6 @@
|
||||||
"max": 1,
|
"max": 1,
|
||||||
"step": 0.1
|
"step": 0.1
|
||||||
},
|
},
|
||||||
"data": {
|
|
||||||
"type": "Prompt",
|
|
||||||
"node": {
|
|
||||||
"template": {
|
|
||||||
"code": {
|
|
||||||
"type": "code",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.field_typing import Prompt, TemplateField, Text\nfrom langflow.interface.custom.custom_component import CustomComponent\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": TemplateField(display_name=\"Template\"),\n \"code\": TemplateField(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "code",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": true,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"template": {
|
|
||||||
"type": "prompt",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": "Answer the user as if you were a pirate.\n\nUser: {user_input}\n\nAnswer: ",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "template",
|
|
||||||
"display_name": "Template",
|
|
||||||
"advanced": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"_type": "CustomComponent",
|
|
||||||
"user_input": {
|
|
||||||
"field_type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "user_input",
|
|
||||||
"display_name": "user_input",
|
|
||||||
"advanced": false,
|
|
||||||
"input_types": [
|
|
||||||
"Document",
|
|
||||||
"BaseOutputParser",
|
|
||||||
"Record",
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"type": "str"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"description": "Create a prompt template with dynamic variables.",
|
|
||||||
"icon": "prompts",
|
|
||||||
"is_input": null,
|
|
||||||
"is_output": null,
|
|
||||||
"is_composition": null,
|
|
||||||
"base_classes": [
|
|
||||||
"object",
|
|
||||||
"str",
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"name": "",
|
|
||||||
"display_name": "Prompt",
|
|
||||||
"documentation": "",
|
|
||||||
"custom_fields": {
|
|
||||||
"template": [
|
|
||||||
"user_input"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"output_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"full_path": null,
|
|
||||||
"field_formatters": {},
|
|
||||||
"frozen": false,
|
|
||||||
"field_order": [],
|
|
||||||
"beta": false,
|
|
||||||
"error": null
|
|
||||||
},
|
|
||||||
"id": "Prompt-uxBqP",
|
|
||||||
"description": "Create a prompt template with dynamic variables.",
|
|
||||||
"display_name": "Prompt"
|
|
||||||
},
|
|
||||||
"selected": true,
|
|
||||||
"width": 384,
|
|
||||||
"height": 383,
|
|
||||||
"dragging": false,
|
|
||||||
"positionAbsolute": {
|
|
||||||
"x": 53.588791333410654,
|
|
||||||
"y": -107.07318910019967
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "OpenAIModel-k39HS",
|
|
||||||
"type": "genericNode",
|
|
||||||
"position": {
|
|
||||||
"x": 634.8148772766217,
|
|
||||||
"y": 27.035057029045305
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"type": "OpenAIModel",
|
|
||||||
"node": {
|
|
||||||
"template": {
|
|
||||||
"input_value": {
|
|
||||||
"type": "str",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "input_value",
|
|
||||||
"display_name": "Input",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"code": {
|
|
||||||
"type": "code",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "from typing import Optional\n\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.constants import STREAM_INFO_TEXT\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import MODEL_NAMES\nfrom langflow.field_typing import NestedDict, Text\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n\n field_order = [\n \"max_tokens\",\n \"model_kwargs\",\n \"model_name\",\n \"openai_api_base\",\n \"openai_api_key\",\n \"temperature\",\n \"input_value\",\n \"system_message\",\n \"stream\",\n ]\n\n def build_config(self):\n return {\n \"input_value\": {\"display_name\": \"Input\"},\n \"max_tokens\": {\n \"display_name\": \"Max Tokens\",\n \"advanced\": True,\n },\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,\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,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=api_key,\n temperature=temperature,\n )\n\n return self.get_chat_result(output, stream, input_value, system_message)\n",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "code",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": true,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"max_tokens": {
|
|
||||||
"type": "int",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": 256,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "max_tokens",
|
|
||||||
"display_name": "Max Tokens",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"model_kwargs": {
|
|
||||||
"type": "NestedDict",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": {},
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "model_kwargs",
|
|
||||||
"display_name": "Model Kwargs",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"model_name": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": true,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": "gpt-3.5-turbo",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"options": [
|
|
||||||
"gpt-4o",
|
|
||||||
"gpt-4-turbo",
|
|
||||||
"gpt-4-turbo-preview",
|
|
||||||
"gpt-3.5-turbo",
|
|
||||||
"gpt-3.5-turbo-0125"
|
|
||||||
],
|
|
||||||
"name": "model_name",
|
|
||||||
"display_name": "Model Name",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"openai_api_base": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "openai_api_base",
|
|
||||||
"display_name": "OpenAI API Base",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"openai_api_key": {
|
|
||||||
"type": "str",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": true,
|
|
||||||
"name": "openai_api_key",
|
|
||||||
"display_name": "OpenAI API Key",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "The OpenAI API Key to use for the OpenAI model.",
|
|
||||||
"load_from_db": true,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"value": ""
|
|
||||||
},
|
|
||||||
"stream": {
|
|
||||||
"type": "bool",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": true,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "stream",
|
|
||||||
"display_name": "Stream",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "Stream the response from the model. Streaming works only in Chat.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"system_message": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "system_message",
|
|
||||||
"display_name": "System Message",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "System message to pass to the model.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"temperature": {
|
|
||||||
"type": "float",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": 0.1,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "temperature",
|
|
||||||
"display_name": "Temperature",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"rangeSpec": {
|
|
||||||
"step_type": "float",
|
|
||||||
"min": -1,
|
|
||||||
"max": 1,
|
|
||||||
"step": 0.1
|
|
||||||
},
|
|
||||||
"load_from_db": false,
|
"load_from_db": false,
|
||||||
"title_case": false
|
"title_case": false
|
||||||
},
|
},
|
||||||
|
|
@ -753,7 +418,7 @@
|
||||||
"list": false,
|
"list": false,
|
||||||
"show": true,
|
"show": true,
|
||||||
"multiline": true,
|
"multiline": true,
|
||||||
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n def build(\n self,\n sender: Optional[str] = \"Machine\",\n sender_name: Optional[str] = \"AI\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n record_template: Optional[str] = \"{text}\",\n files: Optional[list[str]] = None,\n ) -> Union[Text, Record]:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n record_template=record_template or \"\",\n files=files,\n )\n",
|
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n def build(\n self,\n sender: Optional[str] = \"Machine\",\n sender_name: Optional[str] = \"AI\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n record_template: Optional[str] = \"{text}\",\n ) -> Union[Text, Record]:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n record_template=record_template or \"\",\n )\n",
|
||||||
"fileTypes": [],
|
"fileTypes": [],
|
||||||
"file_path": "",
|
"file_path": "",
|
||||||
"password": false,
|
"password": false,
|
||||||
|
|
@ -953,7 +618,7 @@
|
||||||
"list": false,
|
"list": false,
|
||||||
"show": true,
|
"show": true,
|
||||||
"multiline": true,
|
"multiline": true,
|
||||||
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass 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 return_record: Optional[bool] = False,\n ) -> Union[Text, Record]:\n return super().build_no_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n files=files,\n session_id=session_id,\n return_record=return_record,\n )\n",
|
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Playground.\"\n icon = \"ChatInput\"\n\n def build_config(self):\n build_config = super().build_config()\n build_config[\"input_value\"] = {\n \"input_types\": [],\n \"display_name\": \"Message\",\n \"multiline\": True,\n }\n\n return build_config\n\n def build(\n self,\n sender: Optional[str] = \"User\",\n sender_name: Optional[str] = \"User\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n ) -> Union[Text, Record]:\n return super().build_no_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n )\n",
|
||||||
"fileTypes": [],
|
"fileTypes": [],
|
||||||
"file_path": "",
|
"file_path": "",
|
||||||
"password": false,
|
"password": false,
|
||||||
|
|
@ -1115,9 +780,9 @@
|
||||||
"edges": [
|
"edges": [
|
||||||
{
|
{
|
||||||
"source": "OpenAIModel-k39HS",
|
"source": "OpenAIModel-k39HS",
|
||||||
"sourceHandle": "{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153Text\u0153,\u0153str\u0153],\u0153dataType\u0153:\u0153OpenAIModel\u0153,\u0153id\u0153:\u0153OpenAIModel-k39HS\u0153}",
|
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-k39HSœ}",
|
||||||
"target": "ChatOutput-njtka",
|
"target": "ChatOutput-njtka",
|
||||||
"targetHandle": "{\u0153fieldName\u0153:\u0153input_value\u0153,\u0153id\u0153:\u0153ChatOutput-njtka\u0153,\u0153inputTypes\u0153:[\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-njtkaœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "input_value",
|
"fieldName": "input_value",
|
||||||
|
|
@ -1141,13 +806,13 @@
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-gray-900 stroke-connection",
|
"className": "stroke-gray-900 stroke-connection",
|
||||||
"id": "reactflow__edge-OpenAIModel-k39HS{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153Text\u0153,\u0153str\u0153],\u0153dataType\u0153:\u0153OpenAIModel\u0153,\u0153id\u0153:\u0153OpenAIModel-k39HS\u0153}-ChatOutput-njtka{\u0153fieldName\u0153:\u0153input_value\u0153,\u0153id\u0153:\u0153ChatOutput-njtka\u0153,\u0153inputTypes\u0153:[\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}"
|
"id": "reactflow__edge-OpenAIModel-k39HS{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-k39HSœ}-ChatOutput-njtka{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-njtkaœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "Prompt-uxBqP",
|
"source": "Prompt-uxBqP",
|
||||||
"sourceHandle": "{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153str\u0153,\u0153Text\u0153],\u0153dataType\u0153:\u0153Prompt\u0153,\u0153id\u0153:\u0153Prompt-uxBqP\u0153}",
|
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-uxBqPœ}",
|
||||||
"target": "OpenAIModel-k39HS",
|
"target": "OpenAIModel-k39HS",
|
||||||
"targetHandle": "{\u0153fieldName\u0153:\u0153input_value\u0153,\u0153id\u0153:\u0153OpenAIModel-k39HS\u0153,\u0153inputTypes\u0153:[\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-k39HSœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "input_value",
|
"fieldName": "input_value",
|
||||||
|
|
@ -1171,13 +836,13 @@
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-gray-900 stroke-connection",
|
"className": "stroke-gray-900 stroke-connection",
|
||||||
"id": "reactflow__edge-Prompt-uxBqP{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153str\u0153,\u0153Text\u0153],\u0153dataType\u0153:\u0153Prompt\u0153,\u0153id\u0153:\u0153Prompt-uxBqP\u0153}-OpenAIModel-k39HS{\u0153fieldName\u0153:\u0153input_value\u0153,\u0153id\u0153:\u0153OpenAIModel-k39HS\u0153,\u0153inputTypes\u0153:[\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}"
|
"id": "reactflow__edge-Prompt-uxBqP{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-uxBqPœ}-OpenAIModel-k39HS{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-k39HSœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "ChatInput-P3fgL",
|
"source": "ChatInput-P3fgL",
|
||||||
"sourceHandle": "{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153Record\u0153,\u0153str\u0153,\u0153Text\u0153],\u0153dataType\u0153:\u0153ChatInput\u0153,\u0153id\u0153:\u0153ChatInput-P3fgL\u0153}",
|
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œRecordœ,œstrœ,œTextœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-P3fgLœ}",
|
||||||
"target": "Prompt-uxBqP",
|
"target": "Prompt-uxBqP",
|
||||||
"targetHandle": "{\u0153fieldName\u0153:\u0153user_input\u0153,\u0153id\u0153:\u0153Prompt-uxBqP\u0153,\u0153inputTypes\u0153:[\u0153Document\u0153,\u0153BaseOutputParser\u0153,\u0153Record\u0153,\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"targetHandle": "{œfieldNameœ:œuser_inputœ,œidœ:œPrompt-uxBqPœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "user_input",
|
"fieldName": "user_input",
|
||||||
|
|
@ -1205,7 +870,7 @@
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-gray-900 stroke-connection",
|
"className": "stroke-gray-900 stroke-connection",
|
||||||
"id": "reactflow__edge-ChatInput-P3fgL{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153Record\u0153,\u0153str\u0153,\u0153Text\u0153],\u0153dataType\u0153:\u0153ChatInput\u0153,\u0153id\u0153:\u0153ChatInput-P3fgL\u0153}-Prompt-uxBqP{\u0153fieldName\u0153:\u0153user_input\u0153,\u0153id\u0153:\u0153Prompt-uxBqP\u0153,\u0153inputTypes\u0153:[\u0153Document\u0153,\u0153BaseOutputParser\u0153,\u0153Record\u0153,\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}"
|
"id": "reactflow__edge-ChatInput-P3fgL{œbaseClassesœ:[œobjectœ,œRecordœ,œstrœ,œTextœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-P3fgLœ}-Prompt-uxBqP{œfieldNameœ:œuser_inputœ,œidœ:œPrompt-uxBqPœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"viewport": {
|
"viewport": {
|
||||||
|
|
|
||||||
|
|
@ -677,563 +677,6 @@
|
||||||
"max": 1,
|
"max": 1,
|
||||||
"step": 0.1
|
"step": 0.1
|
||||||
},
|
},
|
||||||
"data": {
|
|
||||||
"type": "Prompt",
|
|
||||||
"node": {
|
|
||||||
"template": {
|
|
||||||
"code": {
|
|
||||||
"type": "code",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.field_typing import Prompt, TemplateField, Text\nfrom langflow.interface.custom.custom_component import CustomComponent\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": TemplateField(display_name=\"Template\"),\n \"code\": TemplateField(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "code",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": true,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"template": {
|
|
||||||
"type": "prompt",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": "Reference 1:\n\n{reference_1}\n\n---\n\nReference 2:\n\n{reference_2}\n\n---\n\n{instructions}\n\nBlog: \n\n\n",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "template",
|
|
||||||
"display_name": "Template",
|
|
||||||
"advanced": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"_type": "CustomComponent",
|
|
||||||
"reference_1": {
|
|
||||||
"field_type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "reference_1",
|
|
||||||
"display_name": "reference_1",
|
|
||||||
"advanced": false,
|
|
||||||
"input_types": [
|
|
||||||
"Document",
|
|
||||||
"BaseOutputParser",
|
|
||||||
"Record",
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"type": "str"
|
|
||||||
},
|
|
||||||
"reference_2": {
|
|
||||||
"field_type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "reference_2",
|
|
||||||
"display_name": "reference_2",
|
|
||||||
"advanced": false,
|
|
||||||
"input_types": [
|
|
||||||
"Document",
|
|
||||||
"BaseOutputParser",
|
|
||||||
"Record",
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"type": "str"
|
|
||||||
},
|
|
||||||
"instructions": {
|
|
||||||
"field_type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "instructions",
|
|
||||||
"display_name": "instructions",
|
|
||||||
"advanced": false,
|
|
||||||
"input_types": [
|
|
||||||
"Document",
|
|
||||||
"BaseOutputParser",
|
|
||||||
"Record",
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"type": "str"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"description": "Create a prompt template with dynamic variables.",
|
|
||||||
"icon": "prompts",
|
|
||||||
"is_input": null,
|
|
||||||
"is_output": null,
|
|
||||||
"is_composition": null,
|
|
||||||
"base_classes": [
|
|
||||||
"object",
|
|
||||||
"Text",
|
|
||||||
"str"
|
|
||||||
],
|
|
||||||
"name": "",
|
|
||||||
"display_name": "Prompt",
|
|
||||||
"documentation": "",
|
|
||||||
"custom_fields": {
|
|
||||||
"template": [
|
|
||||||
"reference_1",
|
|
||||||
"reference_2",
|
|
||||||
"instructions"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"output_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"full_path": null,
|
|
||||||
"field_formatters": {},
|
|
||||||
"frozen": false,
|
|
||||||
"field_order": [],
|
|
||||||
"beta": false,
|
|
||||||
"error": null
|
|
||||||
},
|
|
||||||
"id": "Prompt-Rse03",
|
|
||||||
"description": "Create a prompt template with dynamic variables.",
|
|
||||||
"display_name": "Prompt"
|
|
||||||
},
|
|
||||||
"selected": false,
|
|
||||||
"width": 384,
|
|
||||||
"height": 571,
|
|
||||||
"dragging": false,
|
|
||||||
"positionAbsolute": {
|
|
||||||
"x": 1331.381712783371,
|
|
||||||
"y": 535.0279854229713
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "URL-HYPkR",
|
|
||||||
"type": "genericNode",
|
|
||||||
"position": {
|
|
||||||
"x": 568.2971412887712,
|
|
||||||
"y": 700.9983368007821
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"type": "URL",
|
|
||||||
"node": {
|
|
||||||
"template": {
|
|
||||||
"code": {
|
|
||||||
"type": "code",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "from typing import Any, Dict\n\nfrom langchain_community.document_loaders.web_base import WebBaseLoader\n\nfrom langflow.interface.custom.custom_component import CustomComponent\nfrom langflow.schema import Record\n\n\nclass URLComponent(CustomComponent):\n display_name = \"URL\"\n description = \"Fetch content from one or more URLs.\"\n icon = \"layout-template\"\n\n def build_config(self) -> Dict[str, Any]:\n return {\n \"urls\": {\"display_name\": \"URL\"},\n }\n\n def build(\n self,\n urls: list[str],\n ) -> list[Record]:\n loader = WebBaseLoader(web_paths=urls)\n docs = loader.load()\n records = self.to_records(docs)\n self.status = records\n return records\n",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "code",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": true,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"urls": {
|
|
||||||
"type": "str",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": true,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "urls",
|
|
||||||
"display_name": "URL",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"value": [
|
|
||||||
"https://www.promptingguide.ai/techniques/prompt_chaining"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"_type": "CustomComponent"
|
|
||||||
},
|
|
||||||
"description": "Fetch content from one or more URLs.",
|
|
||||||
"icon": "layout-template",
|
|
||||||
"base_classes": [
|
|
||||||
"Record"
|
|
||||||
],
|
|
||||||
"display_name": "URL",
|
|
||||||
"documentation": "",
|
|
||||||
"custom_fields": {
|
|
||||||
"urls": null
|
|
||||||
},
|
|
||||||
"output_types": [
|
|
||||||
"Record"
|
|
||||||
],
|
|
||||||
"field_formatters": {},
|
|
||||||
"frozen": false,
|
|
||||||
"field_order": [],
|
|
||||||
"beta": false
|
|
||||||
},
|
|
||||||
"id": "URL-HYPkR"
|
|
||||||
},
|
|
||||||
"selected": false,
|
|
||||||
"width": 384,
|
|
||||||
"height": 281,
|
|
||||||
"positionAbsolute": {
|
|
||||||
"x": 568.2971412887712,
|
|
||||||
"y": 700.9983368007821
|
|
||||||
},
|
|
||||||
"dragging": false
|
|
||||||
},
|
|
||||||
"output_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"field_formatters": {},
|
|
||||||
"frozen": false,
|
|
||||||
"field_order": [
|
|
||||||
"max_tokens",
|
|
||||||
"model_kwargs",
|
|
||||||
"model_name",
|
|
||||||
"openai_api_base",
|
|
||||||
"openai_api_key",
|
|
||||||
"temperature",
|
|
||||||
"input_value",
|
|
||||||
"system_message",
|
|
||||||
"stream"
|
|
||||||
],
|
|
||||||
"beta": false
|
|
||||||
},
|
|
||||||
"id": "OpenAIModel-gi29P"
|
|
||||||
},
|
|
||||||
"selected": false,
|
|
||||||
"width": 384,
|
|
||||||
"height": 563,
|
|
||||||
"positionAbsolute": {
|
|
||||||
"x": 1917.7089968570963,
|
|
||||||
"y": 575.9186499244129
|
|
||||||
},
|
|
||||||
"dragging": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "URL-2cX90",
|
|
||||||
"type": "genericNode",
|
|
||||||
"position": {
|
|
||||||
"x": 573.961301764604,
|
|
||||||
"y": 336.41463436122086
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"type": "URL",
|
|
||||||
"node": {
|
|
||||||
"template": {
|
|
||||||
"code": {
|
|
||||||
"type": "code",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "from typing import Any, Dict\n\nfrom langchain_community.document_loaders.web_base import WebBaseLoader\n\nfrom langflow.custom import CustomComponent\nfrom langflow.schema import Record\n\n\nclass URLComponent(CustomComponent):\n display_name = \"URL\"\n description = \"Fetch content from one or more URLs.\"\n icon = \"layout-template\"\n\n def build_config(self) -> Dict[str, Any]:\n return {\n \"urls\": {\"display_name\": \"URL\"},\n }\n\n def build(\n self,\n urls: list[str],\n ) -> list[Record]:\n loader = WebBaseLoader(web_paths=urls)\n docs = loader.load()\n records = self.to_records(docs)\n self.status = records\n return records\n",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "code",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": true,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"urls": {
|
|
||||||
"type": "str",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": true,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "urls",
|
|
||||||
"display_name": "URL",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"value": [
|
|
||||||
"https://www.promptingguide.ai/introduction/basics"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"_type": "CustomComponent"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "OpenAIModel-gi29P",
|
|
||||||
"type": "genericNode",
|
|
||||||
"position": {
|
|
||||||
"x": 1917.7089968570963,
|
|
||||||
"y": 575.9186499244129
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"type": "OpenAIModel",
|
|
||||||
"node": {
|
|
||||||
"template": {
|
|
||||||
"input_value": {
|
|
||||||
"type": "str",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "input_value",
|
|
||||||
"display_name": "Input",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"code": {
|
|
||||||
"type": "code",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "from typing import Optional\n\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.constants import STREAM_INFO_TEXT\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import MODEL_NAMES\nfrom langflow.field_typing import NestedDict, Text\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n\n field_order = [\n \"max_tokens\",\n \"model_kwargs\",\n \"model_name\",\n \"openai_api_base\",\n \"openai_api_key\",\n \"temperature\",\n \"input_value\",\n \"system_message\",\n \"stream\",\n ]\n\n def build_config(self):\n return {\n \"input_value\": {\"display_name\": \"Input\"},\n \"max_tokens\": {\n \"display_name\": \"Max Tokens\",\n \"advanced\": True,\n },\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,\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,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=api_key,\n temperature=temperature,\n )\n\n return self.get_chat_result(output, stream, input_value, system_message)\n",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "code",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": true,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"max_tokens": {
|
|
||||||
"type": "int",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": "1024",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "max_tokens",
|
|
||||||
"display_name": "Max Tokens",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"model_kwargs": {
|
|
||||||
"type": "NestedDict",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": {},
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "model_kwargs",
|
|
||||||
"display_name": "Model Kwargs",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"model_name": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": true,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": "gpt-3.5-turbo-0125",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"options": [
|
|
||||||
"gpt-4o",
|
|
||||||
"gpt-4-turbo",
|
|
||||||
"gpt-4-turbo-preview",
|
|
||||||
"gpt-3.5-turbo",
|
|
||||||
"gpt-3.5-turbo-0125"
|
|
||||||
],
|
|
||||||
"name": "model_name",
|
|
||||||
"display_name": "Model Name",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"openai_api_base": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "openai_api_base",
|
|
||||||
"display_name": "OpenAI API Base",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"openai_api_key": {
|
|
||||||
"type": "str",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": true,
|
|
||||||
"name": "openai_api_key",
|
|
||||||
"display_name": "OpenAI API Key",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "The OpenAI API Key to use for the OpenAI model.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"value": ""
|
|
||||||
},
|
|
||||||
"stream": {
|
|
||||||
"type": "bool",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": true,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "stream",
|
|
||||||
"display_name": "Stream",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "Stream the response from the model. Streaming works only in Chat.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"system_message": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "system_message",
|
|
||||||
"display_name": "System Message",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "System message to pass to the model.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"temperature": {
|
|
||||||
"type": "float",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": "0.1",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "temperature",
|
|
||||||
"display_name": "Temperature",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"rangeSpec": {
|
|
||||||
"step_type": "float",
|
|
||||||
"min": -1,
|
|
||||||
"max": 1,
|
|
||||||
"step": 0.1
|
|
||||||
},
|
|
||||||
"load_from_db": false,
|
"load_from_db": false,
|
||||||
"title_case": false
|
"title_case": false
|
||||||
},
|
},
|
||||||
|
|
@ -1306,7 +749,7 @@
|
||||||
"list": false,
|
"list": false,
|
||||||
"show": true,
|
"show": true,
|
||||||
"multiline": true,
|
"multiline": true,
|
||||||
"value": "from typing import Any, Dict\n\nfrom langchain_community.document_loaders.web_base import WebBaseLoader\n\nfrom langflow.interface.custom.custom_component import CustomComponent\nfrom langflow.schema import Record\n\n\nclass URLComponent(CustomComponent):\n display_name = \"URL\"\n description = \"Fetch content from one or more URLs.\"\n icon = \"layout-template\"\n\n def build_config(self) -> Dict[str, Any]:\n return {\n \"urls\": {\"display_name\": \"URL\"},\n }\n\n def build(\n self,\n urls: list[str],\n ) -> list[Record]:\n loader = WebBaseLoader(web_paths=urls)\n docs = loader.load()\n records = self.to_records(docs)\n self.status = records\n return records\n",
|
"value": "from typing import Any, Dict\n\nfrom langchain_community.document_loaders.web_base import WebBaseLoader\n\nfrom langflow.custom import CustomComponent\nfrom langflow.schema import Record\n\n\nclass URLComponent(CustomComponent):\n display_name = \"URL\"\n description = \"Fetch content from one or more URLs.\"\n icon = \"layout-template\"\n\n def build_config(self) -> Dict[str, Any]:\n return {\n \"urls\": {\"display_name\": \"URL\"},\n }\n\n def build(\n self,\n urls: list[str],\n ) -> list[Record]:\n loader = WebBaseLoader(web_paths=urls)\n docs = loader.load()\n records = self.to_records(docs)\n self.status = records\n return records\n",
|
||||||
"fileTypes": [],
|
"fileTypes": [],
|
||||||
"file_path": "",
|
"file_path": "",
|
||||||
"password": false,
|
"password": false,
|
||||||
|
|
@ -1485,9 +928,9 @@
|
||||||
{
|
{
|
||||||
"source": "URL-HYPkR",
|
"source": "URL-HYPkR",
|
||||||
"target": "Prompt-Rse03",
|
"target": "Prompt-Rse03",
|
||||||
"sourceHandle": "{\u0153baseClasses\u0153:[\u0153Record\u0153],\u0153dataType\u0153:\u0153URL\u0153,\u0153id\u0153:\u0153URL-HYPkR\u0153}",
|
"sourceHandle": "{œbaseClassesœ:[œRecordœ],œdataTypeœ:œURLœ,œidœ:œURL-HYPkRœ}",
|
||||||
"targetHandle": "{\u0153fieldName\u0153:\u0153reference_2\u0153,\u0153id\u0153:\u0153Prompt-Rse03\u0153,\u0153inputTypes\u0153:[\u0153Document\u0153,\u0153BaseOutputParser\u0153,\u0153Record\u0153,\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"targetHandle": "{œfieldNameœ:œreference_2œ,œidœ:œPrompt-Rse03œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
|
||||||
"id": "reactflow__edge-URL-HYPkR{\u0153baseClasses\u0153:[\u0153Record\u0153],\u0153dataType\u0153:\u0153URL\u0153,\u0153id\u0153:\u0153URL-HYPkR\u0153}-Prompt-Rse03{\u0153fieldName\u0153:\u0153reference_2\u0153,\u0153id\u0153:\u0153Prompt-Rse03\u0153,\u0153inputTypes\u0153:[\u0153Document\u0153,\u0153BaseOutputParser\u0153,\u0153Record\u0153,\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"id": "reactflow__edge-URL-HYPkR{œbaseClassesœ:[œRecordœ],œdataTypeœ:œURLœ,œidœ:œURL-HYPkRœ}-Prompt-Rse03{œfieldNameœ:œreference_2œ,œidœ:œPrompt-Rse03œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "reference_2",
|
"fieldName": "reference_2",
|
||||||
|
|
@ -1516,9 +959,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "OpenAIModel-gi29P",
|
"source": "OpenAIModel-gi29P",
|
||||||
"sourceHandle": "{\u0153baseClasses\u0153:[\u0153str\u0153,\u0153Text\u0153,\u0153object\u0153],\u0153dataType\u0153:\u0153OpenAIModel\u0153,\u0153id\u0153:\u0153OpenAIModel-gi29P\u0153}",
|
"sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-gi29Pœ}",
|
||||||
"target": "ChatOutput-JPlxl",
|
"target": "ChatOutput-JPlxl",
|
||||||
"targetHandle": "{\u0153fieldName\u0153:\u0153input_value\u0153,\u0153id\u0153:\u0153ChatOutput-JPlxl\u0153,\u0153inputTypes\u0153:[\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-JPlxlœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "input_value",
|
"fieldName": "input_value",
|
||||||
|
|
@ -1542,13 +985,13 @@
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-gray-900 stroke-connection",
|
"className": "stroke-gray-900 stroke-connection",
|
||||||
"id": "reactflow__edge-OpenAIModel-gi29P{\u0153baseClasses\u0153:[\u0153str\u0153,\u0153Text\u0153,\u0153object\u0153],\u0153dataType\u0153:\u0153OpenAIModel\u0153,\u0153id\u0153:\u0153OpenAIModel-gi29P\u0153}-ChatOutput-JPlxl{\u0153fieldName\u0153:\u0153input_value\u0153,\u0153id\u0153:\u0153ChatOutput-JPlxl\u0153,\u0153inputTypes\u0153:[\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}"
|
"id": "reactflow__edge-OpenAIModel-gi29P{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-gi29Pœ}-ChatOutput-JPlxl{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-JPlxlœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "URL-2cX90",
|
"source": "URL-2cX90",
|
||||||
"sourceHandle": "{\u0153baseClasses\u0153:[\u0153Record\u0153],\u0153dataType\u0153:\u0153URL\u0153,\u0153id\u0153:\u0153URL-2cX90\u0153}",
|
"sourceHandle": "{œbaseClassesœ:[œRecordœ],œdataTypeœ:œURLœ,œidœ:œURL-2cX90œ}",
|
||||||
"target": "Prompt-Rse03",
|
"target": "Prompt-Rse03",
|
||||||
"targetHandle": "{\u0153fieldName\u0153:\u0153reference_1\u0153,\u0153id\u0153:\u0153Prompt-Rse03\u0153,\u0153inputTypes\u0153:[\u0153Document\u0153,\u0153BaseOutputParser\u0153,\u0153Record\u0153,\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"targetHandle": "{œfieldNameœ:œreference_1œ,œidœ:œPrompt-Rse03œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "reference_1",
|
"fieldName": "reference_1",
|
||||||
|
|
@ -1573,13 +1016,13 @@
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-gray-900 stroke-connection",
|
"className": "stroke-gray-900 stroke-connection",
|
||||||
"id": "reactflow__edge-URL-2cX90{\u0153baseClasses\u0153:[\u0153Record\u0153],\u0153dataType\u0153:\u0153URL\u0153,\u0153id\u0153:\u0153URL-2cX90\u0153}-Prompt-Rse03{\u0153fieldName\u0153:\u0153reference_1\u0153,\u0153id\u0153:\u0153Prompt-Rse03\u0153,\u0153inputTypes\u0153:[\u0153Document\u0153,\u0153BaseOutputParser\u0153,\u0153Record\u0153,\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}"
|
"id": "reactflow__edge-URL-2cX90{œbaseClassesœ:[œRecordœ],œdataTypeœ:œURLœ,œidœ:œURL-2cX90œ}-Prompt-Rse03{œfieldNameœ:œreference_1œ,œidœ:œPrompt-Rse03œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "TextInput-og8Or",
|
"source": "TextInput-og8Or",
|
||||||
"sourceHandle": "{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153Text\u0153,\u0153str\u0153],\u0153dataType\u0153:\u0153TextInput\u0153,\u0153id\u0153:\u0153TextInput-og8Or\u0153}",
|
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-og8Orœ}",
|
||||||
"target": "Prompt-Rse03",
|
"target": "Prompt-Rse03",
|
||||||
"targetHandle": "{\u0153fieldName\u0153:\u0153instructions\u0153,\u0153id\u0153:\u0153Prompt-Rse03\u0153,\u0153inputTypes\u0153:[\u0153Document\u0153,\u0153BaseOutputParser\u0153,\u0153Record\u0153,\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"targetHandle": "{œfieldNameœ:œinstructionsœ,œidœ:œPrompt-Rse03œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "instructions",
|
"fieldName": "instructions",
|
||||||
|
|
@ -1606,13 +1049,13 @@
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-gray-900 stroke-connection",
|
"className": "stroke-gray-900 stroke-connection",
|
||||||
"id": "reactflow__edge-TextInput-og8Or{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153Text\u0153,\u0153str\u0153],\u0153dataType\u0153:\u0153TextInput\u0153,\u0153id\u0153:\u0153TextInput-og8Or\u0153}-Prompt-Rse03{\u0153fieldName\u0153:\u0153instructions\u0153,\u0153id\u0153:\u0153Prompt-Rse03\u0153,\u0153inputTypes\u0153:[\u0153Document\u0153,\u0153BaseOutputParser\u0153,\u0153Record\u0153,\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}"
|
"id": "reactflow__edge-TextInput-og8Or{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-og8Orœ}-Prompt-Rse03{œfieldNameœ:œinstructionsœ,œidœ:œPrompt-Rse03œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "Prompt-Rse03",
|
"source": "Prompt-Rse03",
|
||||||
"sourceHandle": "{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153Text\u0153,\u0153str\u0153],\u0153dataType\u0153:\u0153Prompt\u0153,\u0153id\u0153:\u0153Prompt-Rse03\u0153}",
|
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-Rse03œ}",
|
||||||
"target": "OpenAIModel-gi29P",
|
"target": "OpenAIModel-gi29P",
|
||||||
"targetHandle": "{\u0153fieldName\u0153:\u0153input_value\u0153,\u0153id\u0153:\u0153OpenAIModel-gi29P\u0153,\u0153inputTypes\u0153:[\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-gi29Pœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "input_value",
|
"fieldName": "input_value",
|
||||||
|
|
@ -1636,7 +1079,7 @@
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-gray-900 stroke-connection",
|
"className": "stroke-gray-900 stroke-connection",
|
||||||
"id": "reactflow__edge-Prompt-Rse03{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153Text\u0153,\u0153str\u0153],\u0153dataType\u0153:\u0153Prompt\u0153,\u0153id\u0153:\u0153Prompt-Rse03\u0153}-OpenAIModel-gi29P{\u0153fieldName\u0153:\u0153input_value\u0153,\u0153id\u0153:\u0153OpenAIModel-gi29P\u0153,\u0153inputTypes\u0153:[\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"id": "reactflow__edge-Prompt-Rse03{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-Rse03œ}-OpenAIModel-gi29P{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-gi29Pœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||||
"selected": false
|
"selected": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -834,831 +834,6 @@
|
||||||
"max": 1,
|
"max": 1,
|
||||||
"step": 0.1
|
"step": 0.1
|
||||||
},
|
},
|
||||||
"data": {
|
|
||||||
"type": "Prompt",
|
|
||||||
"node": {
|
|
||||||
"template": {
|
|
||||||
"code": {
|
|
||||||
"type": "code",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.field_typing import Prompt, TemplateField, Text\nfrom langflow.interface.custom.custom_component import CustomComponent\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": TemplateField(display_name=\"Template\"),\n \"code\": TemplateField(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "code",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": true,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"template": {
|
|
||||||
"type": "prompt",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": "Answer user's questions based on the document below:\n\n---\n\n{Document}\n\n---\n\nQuestion:\n{Question}\n\nAnswer:\n",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "template",
|
|
||||||
"display_name": "Template",
|
|
||||||
"advanced": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"_type": "CustomComponent",
|
|
||||||
"Document": {
|
|
||||||
"field_type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "Document",
|
|
||||||
"display_name": "Document",
|
|
||||||
"advanced": false,
|
|
||||||
"input_types": [
|
|
||||||
"Document",
|
|
||||||
"BaseOutputParser",
|
|
||||||
"Record",
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"type": "str"
|
|
||||||
},
|
|
||||||
"Question": {
|
|
||||||
"field_type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "Question",
|
|
||||||
"display_name": "Question",
|
|
||||||
"advanced": false,
|
|
||||||
"input_types": [
|
|
||||||
"Document",
|
|
||||||
"BaseOutputParser",
|
|
||||||
"Record",
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"type": "str"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"description": "Create a prompt template with dynamic variables.",
|
|
||||||
"icon": "prompts",
|
|
||||||
"is_input": null,
|
|
||||||
"is_output": null,
|
|
||||||
"is_composition": null,
|
|
||||||
"base_classes": [
|
|
||||||
"object",
|
|
||||||
"str",
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"name": "",
|
|
||||||
"display_name": "Prompt",
|
|
||||||
"documentation": "",
|
|
||||||
"custom_fields": {
|
|
||||||
"template": [
|
|
||||||
"Document",
|
|
||||||
"Question"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"output_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"full_path": null,
|
|
||||||
"field_formatters": {},
|
|
||||||
"frozen": false,
|
|
||||||
"field_order": [],
|
|
||||||
"beta": false,
|
|
||||||
"error": null
|
|
||||||
},
|
|
||||||
"id": "Prompt-tHwPf",
|
|
||||||
"description": "A component for creating prompt templates using dynamic variables.",
|
|
||||||
"display_name": "Prompt"
|
|
||||||
},
|
|
||||||
"selected": false,
|
|
||||||
"width": 384,
|
|
||||||
"height": 479,
|
|
||||||
"positionAbsolute": {
|
|
||||||
"x": 585.7906101139403,
|
|
||||||
"y": 117.52115876762832
|
|
||||||
},
|
|
||||||
"dragging": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "File-6TEsD",
|
|
||||||
"type": "genericNode",
|
|
||||||
"position": {
|
|
||||||
"x": -18.636536329280602,
|
|
||||||
"y": 3.951948774836353
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"type": "File",
|
|
||||||
"node": {
|
|
||||||
"template": {
|
|
||||||
"path": {
|
|
||||||
"type": "file",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [
|
|
||||||
".txt",
|
|
||||||
".md",
|
|
||||||
".mdx",
|
|
||||||
".csv",
|
|
||||||
".json",
|
|
||||||
".yaml",
|
|
||||||
".yml",
|
|
||||||
".xml",
|
|
||||||
".html",
|
|
||||||
".htm",
|
|
||||||
".pdf",
|
|
||||||
".docx"
|
|
||||||
],
|
|
||||||
"password": false,
|
|
||||||
"name": "path",
|
|
||||||
"display_name": "Path",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "Supported file types: txt, md, mdx, csv, json, yaml, yml, xml, html, htm, pdf, docx",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"value": ""
|
|
||||||
},
|
|
||||||
"code": {
|
|
||||||
"type": "code",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "from pathlib import Path\nfrom typing import Any, Dict\n\nfrom langflow.base.data.utils import TEXT_FILE_TYPES, parse_text_file_to_record\nfrom langflow.interface.custom.custom_component import CustomComponent\nfrom langflow.schema import Record\n\n\nclass FileComponent(CustomComponent):\n display_name = \"Files\"\n description = \"A generic file loader.\"\n\n def build_config(self) -> Dict[str, Any]:\n return {\n \"path\": {\n \"display_name\": \"Path\",\n \"field_type\": \"file\",\n \"file_types\": TEXT_FILE_TYPES,\n \"info\": f\"Supported file types: {', '.join(TEXT_FILE_TYPES)}\",\n },\n \"silent_errors\": {\n \"display_name\": \"Silent Errors\",\n \"advanced\": True,\n \"info\": \"If true, errors will not raise an exception.\",\n },\n }\n\n def load_file(self, path: str, silent_errors: bool = False) -> Record:\n resolved_path = self.resolve_path(path)\n path_obj = Path(resolved_path)\n extension = path_obj.suffix[1:].lower()\n if extension == \"doc\":\n raise ValueError(\"doc files are not supported. Please save as .docx\")\n if extension not in TEXT_FILE_TYPES:\n raise ValueError(f\"Unsupported file type: {extension}\")\n record = parse_text_file_to_record(resolved_path, silent_errors)\n self.status = record if record else \"No data\"\n return record or Record()\n\n def build(\n self,\n path: str,\n silent_errors: bool = False,\n ) -> Record:\n record = self.load_file(path, silent_errors)\n self.status = record\n return record\n",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "code",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": true,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"silent_errors": {
|
|
||||||
"type": "bool",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "silent_errors",
|
|
||||||
"display_name": "Silent Errors",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "If true, errors will not raise an exception.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"_type": "CustomComponent"
|
|
||||||
},
|
|
||||||
"description": "A generic file loader.",
|
|
||||||
"base_classes": [
|
|
||||||
"Record"
|
|
||||||
],
|
|
||||||
"display_name": "Files",
|
|
||||||
"documentation": "",
|
|
||||||
"custom_fields": {
|
|
||||||
"path": null,
|
|
||||||
"silent_errors": null
|
|
||||||
},
|
|
||||||
"output_types": [
|
|
||||||
"Record"
|
|
||||||
],
|
|
||||||
"field_formatters": {},
|
|
||||||
"frozen": false,
|
|
||||||
"field_order": [],
|
|
||||||
"beta": false
|
|
||||||
},
|
|
||||||
"id": "File-6TEsD"
|
|
||||||
},
|
|
||||||
"selected": false,
|
|
||||||
"width": 384,
|
|
||||||
"height": 282,
|
|
||||||
"positionAbsolute": {
|
|
||||||
"x": -18.636536329280602,
|
|
||||||
"y": 3.951948774836353
|
|
||||||
},
|
|
||||||
"dragging": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "ChatInput-MsSJ9",
|
|
||||||
"type": "genericNode",
|
|
||||||
"position": {
|
|
||||||
"x": -28.80036300619821,
|
|
||||||
"y": 379.81180230285355
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"type": "ChatInput",
|
|
||||||
"node": {
|
|
||||||
"template": {
|
|
||||||
"code": {
|
|
||||||
"type": "code",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass 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 return_record: Optional[bool] = False,\n ) -> Union[Text, Record]:\n return super().build_no_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n files=files,\n session_id=session_id,\n return_record=return_record,\n )\n",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "code",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": true,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"input_value": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "input_value",
|
|
||||||
"display_name": "Message",
|
|
||||||
"advanced": false,
|
|
||||||
"input_types": [],
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"value": ""
|
|
||||||
},
|
|
||||||
"return_record": {
|
|
||||||
"type": "bool",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "return_record",
|
|
||||||
"display_name": "Return Record",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"sender": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": true,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": "User",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"options": [
|
|
||||||
"Machine",
|
|
||||||
"User"
|
|
||||||
],
|
|
||||||
"name": "sender",
|
|
||||||
"display_name": "Sender Type",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"sender_name": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": "User",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "sender_name",
|
|
||||||
"display_name": "Sender Name",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"session_id": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "session_id",
|
|
||||||
"display_name": "Session ID",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "If provided, the message will be stored in the memory.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"_type": "CustomComponent"
|
|
||||||
},
|
|
||||||
"description": "Get chat inputs from the Playground.",
|
|
||||||
"icon": "ChatInput",
|
|
||||||
"base_classes": [
|
|
||||||
"str",
|
|
||||||
"Record",
|
|
||||||
"Text",
|
|
||||||
"object"
|
|
||||||
],
|
|
||||||
"display_name": "Chat Input",
|
|
||||||
"documentation": "",
|
|
||||||
"custom_fields": {
|
|
||||||
"sender": null,
|
|
||||||
"sender_name": null,
|
|
||||||
"input_value": null,
|
|
||||||
"session_id": null,
|
|
||||||
"return_record": null
|
|
||||||
},
|
|
||||||
"output_types": [
|
|
||||||
"Text",
|
|
||||||
"Record"
|
|
||||||
],
|
|
||||||
"field_formatters": {},
|
|
||||||
"frozen": false,
|
|
||||||
"field_order": [],
|
|
||||||
"beta": false
|
|
||||||
},
|
|
||||||
"id": "ChatInput-MsSJ9"
|
|
||||||
},
|
|
||||||
"selected": true,
|
|
||||||
"width": 384,
|
|
||||||
"height": 377,
|
|
||||||
"positionAbsolute": {
|
|
||||||
"x": -28.80036300619821,
|
|
||||||
"y": 379.81180230285355
|
|
||||||
},
|
|
||||||
"dragging": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "ChatOutput-F5Awj",
|
|
||||||
"type": "genericNode",
|
|
||||||
"position": {
|
|
||||||
"x": 1733.3012915204283,
|
|
||||||
"y": 168.76098809939327
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"type": "ChatOutput",
|
|
||||||
"node": {
|
|
||||||
"template": {
|
|
||||||
"code": {
|
|
||||||
"type": "code",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"ChatOutput\"\n\n def build(\n self,\n sender: Optional[str] = \"Machine\",\n sender_name: Optional[str] = \"AI\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n record_template: Optional[str] = \"{text}\",\n files: Optional[list[str]] = None,\n ) -> Union[Text, Record]:\n return super().build_with_record(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n record_template=record_template or \"\",\n files=files,\n )\n",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "code",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": true,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"input_value": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "input_value",
|
|
||||||
"display_name": "Message",
|
|
||||||
"advanced": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"return_record": {
|
|
||||||
"type": "bool",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "return_record",
|
|
||||||
"display_name": "Return Record",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"sender": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": true,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": "Machine",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"options": [
|
|
||||||
"Machine",
|
|
||||||
"User"
|
|
||||||
],
|
|
||||||
"name": "sender",
|
|
||||||
"display_name": "Sender Type",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"sender_name": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": "AI",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "sender_name",
|
|
||||||
"display_name": "Sender Name",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"session_id": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "session_id",
|
|
||||||
"display_name": "Session ID",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "If provided, the message will be stored in the memory.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"_type": "CustomComponent"
|
|
||||||
},
|
|
||||||
"description": "Display a chat message in the Playground.",
|
|
||||||
"icon": "ChatOutput",
|
|
||||||
"base_classes": [
|
|
||||||
"str",
|
|
||||||
"Record",
|
|
||||||
"Text",
|
|
||||||
"object"
|
|
||||||
],
|
|
||||||
"display_name": "Chat Output",
|
|
||||||
"documentation": "",
|
|
||||||
"custom_fields": {
|
|
||||||
"sender": null,
|
|
||||||
"sender_name": null,
|
|
||||||
"input_value": null,
|
|
||||||
"session_id": null,
|
|
||||||
"return_record": null
|
|
||||||
},
|
|
||||||
"output_types": [
|
|
||||||
"Text",
|
|
||||||
"Record"
|
|
||||||
],
|
|
||||||
"field_formatters": {},
|
|
||||||
"frozen": false,
|
|
||||||
"field_order": [],
|
|
||||||
"beta": false
|
|
||||||
},
|
|
||||||
"id": "ChatOutput-F5Awj"
|
|
||||||
},
|
|
||||||
"selected": false,
|
|
||||||
"width": 384,
|
|
||||||
"height": 385,
|
|
||||||
"positionAbsolute": {
|
|
||||||
"x": 1733.3012915204283,
|
|
||||||
"y": 168.76098809939327
|
|
||||||
},
|
|
||||||
"dragging": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "OpenAIModel-Bt067",
|
|
||||||
"type": "genericNode",
|
|
||||||
"position": {
|
|
||||||
"x": 1137.6078582863759,
|
|
||||||
"y": -14.41920034020356
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"type": "OpenAIModel",
|
|
||||||
"node": {
|
|
||||||
"template": {
|
|
||||||
"input_value": {
|
|
||||||
"type": "str",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "input_value",
|
|
||||||
"display_name": "Input",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"code": {
|
|
||||||
"type": "code",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": true,
|
|
||||||
"value": "from typing import Optional\n\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.constants import STREAM_INFO_TEXT\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import MODEL_NAMES\nfrom langflow.field_typing import NestedDict, Text\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n\n field_order = [\n \"max_tokens\",\n \"model_kwargs\",\n \"model_name\",\n \"openai_api_base\",\n \"openai_api_key\",\n \"temperature\",\n \"input_value\",\n \"system_message\",\n \"stream\",\n ]\n\n def build_config(self):\n return {\n \"input_value\": {\"display_name\": \"Input\"},\n \"max_tokens\": {\n \"display_name\": \"Max Tokens\",\n \"advanced\": True,\n },\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,\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,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=api_key,\n temperature=temperature,\n )\n\n return self.get_chat_result(output, stream, input_value, system_message)\n",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "code",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": true,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"max_tokens": {
|
|
||||||
"type": "int",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": 256,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "max_tokens",
|
|
||||||
"display_name": "Max Tokens",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"model_kwargs": {
|
|
||||||
"type": "NestedDict",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": {},
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "model_kwargs",
|
|
||||||
"display_name": "Model Kwargs",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"model_name": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": true,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": "gpt-4-turbo-preview",
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"options": [
|
|
||||||
"gpt-4o",
|
|
||||||
"gpt-4-turbo",
|
|
||||||
"gpt-4-turbo-preview",
|
|
||||||
"gpt-3.5-turbo",
|
|
||||||
"gpt-3.5-turbo-0125"
|
|
||||||
],
|
|
||||||
"name": "model_name",
|
|
||||||
"display_name": "Model Name",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"openai_api_base": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "openai_api_base",
|
|
||||||
"display_name": "OpenAI API Base",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"openai_api_key": {
|
|
||||||
"type": "str",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": true,
|
|
||||||
"name": "openai_api_key",
|
|
||||||
"display_name": "OpenAI API Key",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "The OpenAI API Key to use for the OpenAI model.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
],
|
|
||||||
"value": ""
|
|
||||||
},
|
|
||||||
"stream": {
|
|
||||||
"type": "bool",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": true,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "stream",
|
|
||||||
"display_name": "Stream",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "Stream the response from the model. Streaming works only in Chat.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false
|
|
||||||
},
|
|
||||||
"system_message": {
|
|
||||||
"type": "str",
|
|
||||||
"required": false,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "system_message",
|
|
||||||
"display_name": "System Message",
|
|
||||||
"advanced": true,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "System message to pass to the model.",
|
|
||||||
"load_from_db": false,
|
|
||||||
"title_case": false,
|
|
||||||
"input_types": [
|
|
||||||
"Text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"temperature": {
|
|
||||||
"type": "float",
|
|
||||||
"required": true,
|
|
||||||
"placeholder": "",
|
|
||||||
"list": false,
|
|
||||||
"show": true,
|
|
||||||
"multiline": false,
|
|
||||||
"value": 0.1,
|
|
||||||
"fileTypes": [],
|
|
||||||
"file_path": "",
|
|
||||||
"password": false,
|
|
||||||
"name": "temperature",
|
|
||||||
"display_name": "Temperature",
|
|
||||||
"advanced": false,
|
|
||||||
"dynamic": false,
|
|
||||||
"info": "",
|
|
||||||
"rangeSpec": {
|
|
||||||
"step_type": "float",
|
|
||||||
"min": -1,
|
|
||||||
"max": 1,
|
|
||||||
"step": 0.1
|
|
||||||
},
|
|
||||||
"load_from_db": false,
|
"load_from_db": false,
|
||||||
"title_case": false
|
"title_case": false
|
||||||
},
|
},
|
||||||
|
|
@ -1717,9 +892,9 @@
|
||||||
"edges": [
|
"edges": [
|
||||||
{
|
{
|
||||||
"source": "ChatInput-MsSJ9",
|
"source": "ChatInput-MsSJ9",
|
||||||
"sourceHandle": "{\u0153baseClasses\u0153:[\u0153str\u0153,\u0153Record\u0153,\u0153Text\u0153,\u0153object\u0153],\u0153dataType\u0153:\u0153ChatInput\u0153,\u0153id\u0153:\u0153ChatInput-MsSJ9\u0153}",
|
"sourceHandle": "{œbaseClassesœ:[œstrœ,œRecordœ,œTextœ,œobjectœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-MsSJ9œ}",
|
||||||
"target": "Prompt-tHwPf",
|
"target": "Prompt-tHwPf",
|
||||||
"targetHandle": "{\u0153fieldName\u0153:\u0153Question\u0153,\u0153id\u0153:\u0153Prompt-tHwPf\u0153,\u0153inputTypes\u0153:[\u0153Document\u0153,\u0153BaseOutputParser\u0153,\u0153Record\u0153,\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"targetHandle": "{œfieldNameœ:œQuestionœ,œidœ:œPrompt-tHwPfœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "Question",
|
"fieldName": "Question",
|
||||||
|
|
@ -1747,13 +922,13 @@
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-gray-900 stroke-connection",
|
"className": "stroke-gray-900 stroke-connection",
|
||||||
"id": "reactflow__edge-ChatInput-MsSJ9{\u0153baseClasses\u0153:[\u0153str\u0153,\u0153Record\u0153,\u0153Text\u0153,\u0153object\u0153],\u0153dataType\u0153:\u0153ChatInput\u0153,\u0153id\u0153:\u0153ChatInput-MsSJ9\u0153}-Prompt-tHwPf{\u0153fieldName\u0153:\u0153Question\u0153,\u0153id\u0153:\u0153Prompt-tHwPf\u0153,\u0153inputTypes\u0153:[\u0153Document\u0153,\u0153BaseOutputParser\u0153,\u0153Record\u0153,\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}"
|
"id": "reactflow__edge-ChatInput-MsSJ9{œbaseClassesœ:[œstrœ,œRecordœ,œTextœ,œobjectœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-MsSJ9œ}-Prompt-tHwPf{œfieldNameœ:œQuestionœ,œidœ:œPrompt-tHwPfœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "File-6TEsD",
|
"source": "File-6TEsD",
|
||||||
"sourceHandle": "{\u0153baseClasses\u0153:[\u0153Record\u0153],\u0153dataType\u0153:\u0153File\u0153,\u0153id\u0153:\u0153File-6TEsD\u0153}",
|
"sourceHandle": "{œbaseClassesœ:[œRecordœ],œdataTypeœ:œFileœ,œidœ:œFile-6TEsDœ}",
|
||||||
"target": "Prompt-tHwPf",
|
"target": "Prompt-tHwPf",
|
||||||
"targetHandle": "{\u0153fieldName\u0153:\u0153Document\u0153,\u0153id\u0153:\u0153Prompt-tHwPf\u0153,\u0153inputTypes\u0153:[\u0153Document\u0153,\u0153BaseOutputParser\u0153,\u0153Record\u0153,\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"targetHandle": "{œfieldNameœ:œDocumentœ,œidœ:œPrompt-tHwPfœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "Document",
|
"fieldName": "Document",
|
||||||
|
|
@ -1778,13 +953,13 @@
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-gray-900 stroke-connection",
|
"className": "stroke-gray-900 stroke-connection",
|
||||||
"id": "reactflow__edge-File-6TEsD{\u0153baseClasses\u0153:[\u0153Record\u0153],\u0153dataType\u0153:\u0153File\u0153,\u0153id\u0153:\u0153File-6TEsD\u0153}-Prompt-tHwPf{\u0153fieldName\u0153:\u0153Document\u0153,\u0153id\u0153:\u0153Prompt-tHwPf\u0153,\u0153inputTypes\u0153:[\u0153Document\u0153,\u0153BaseOutputParser\u0153,\u0153Record\u0153,\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}"
|
"id": "reactflow__edge-File-6TEsD{œbaseClassesœ:[œRecordœ],œdataTypeœ:œFileœ,œidœ:œFile-6TEsDœ}-Prompt-tHwPf{œfieldNameœ:œDocumentœ,œidœ:œPrompt-tHwPfœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "Prompt-tHwPf",
|
"source": "Prompt-tHwPf",
|
||||||
"sourceHandle": "{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153str\u0153,\u0153Text\u0153],\u0153dataType\u0153:\u0153Prompt\u0153,\u0153id\u0153:\u0153Prompt-tHwPf\u0153}",
|
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-tHwPfœ}",
|
||||||
"target": "OpenAIModel-Bt067",
|
"target": "OpenAIModel-Bt067",
|
||||||
"targetHandle": "{\u0153fieldName\u0153:\u0153input_value\u0153,\u0153id\u0153:\u0153OpenAIModel-Bt067\u0153,\u0153inputTypes\u0153:[\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-Bt067œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "input_value",
|
"fieldName": "input_value",
|
||||||
|
|
@ -1808,13 +983,13 @@
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-gray-900 stroke-connection",
|
"className": "stroke-gray-900 stroke-connection",
|
||||||
"id": "reactflow__edge-Prompt-tHwPf{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153str\u0153,\u0153Text\u0153],\u0153dataType\u0153:\u0153Prompt\u0153,\u0153id\u0153:\u0153Prompt-tHwPf\u0153}-OpenAIModel-Bt067{\u0153fieldName\u0153:\u0153input_value\u0153,\u0153id\u0153:\u0153OpenAIModel-Bt067\u0153,\u0153inputTypes\u0153:[\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}"
|
"id": "reactflow__edge-Prompt-tHwPf{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-tHwPfœ}-OpenAIModel-Bt067{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-Bt067œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "OpenAIModel-Bt067",
|
"source": "OpenAIModel-Bt067",
|
||||||
"sourceHandle": "{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153str\u0153,\u0153Text\u0153],\u0153dataType\u0153:\u0153OpenAIModel\u0153,\u0153id\u0153:\u0153OpenAIModel-Bt067\u0153}",
|
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-Bt067œ}",
|
||||||
"target": "ChatOutput-F5Awj",
|
"target": "ChatOutput-F5Awj",
|
||||||
"targetHandle": "{\u0153fieldName\u0153:\u0153input_value\u0153,\u0153id\u0153:\u0153ChatOutput-F5Awj\u0153,\u0153inputTypes\u0153:[\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}",
|
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-F5Awjœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "input_value",
|
"fieldName": "input_value",
|
||||||
|
|
@ -1838,7 +1013,7 @@
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-gray-900 stroke-connection",
|
"className": "stroke-gray-900 stroke-connection",
|
||||||
"id": "reactflow__edge-OpenAIModel-Bt067{\u0153baseClasses\u0153:[\u0153object\u0153,\u0153str\u0153,\u0153Text\u0153],\u0153dataType\u0153:\u0153OpenAIModel\u0153,\u0153id\u0153:\u0153OpenAIModel-Bt067\u0153}-ChatOutput-F5Awj{\u0153fieldName\u0153:\u0153input_value\u0153,\u0153id\u0153:\u0153ChatOutput-F5Awj\u0153,\u0153inputTypes\u0153:[\u0153Text\u0153],\u0153type\u0153:\u0153str\u0153}"
|
"id": "reactflow__edge-OpenAIModel-Bt067{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-Bt067œ}-ChatOutput-F5Awj{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-F5Awjœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"viewport": {
|
"viewport": {
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue