update starter projects
This commit is contained in:
parent
dd6ece6700
commit
4b052776ed
3 changed files with 1175 additions and 980 deletions
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"id": "8e544e5b-d4a7-487a-afe3-b271e3cb9e5c",
|
||||
"id": "4cd8b920-a12d-4d98-b4e5-75b537f03316",
|
||||
"icon": "📝",
|
||||
"icon_bg_color": "#FFD700",
|
||||
"data": {
|
||||
"nodes": [
|
||||
{
|
||||
"id": "ChatInput-5Jp60",
|
||||
"id": "ChatInput-HTY3h",
|
||||
"type": "genericNode",
|
||||
"position": {
|
||||
"x": 86.66131544226482,
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
"list": false,
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Used to get user input from the chat.\"\n icon = \"ChatInput\"\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(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n )\n",
|
||||
"value": "from 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 Interaction Panel.\"\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(\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": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
|
|
@ -30,6 +30,7 @@
|
|||
"advanced": true,
|
||||
"dynamic": true,
|
||||
"info": "",
|
||||
"load_from_db": false,
|
||||
"title_case": false
|
||||
},
|
||||
"input_value": {
|
||||
|
|
@ -164,7 +165,7 @@
|
|||
"field_order": [],
|
||||
"beta": true
|
||||
},
|
||||
"id": "ChatInput-5Jp60"
|
||||
"id": "ChatInput-HTY3h"
|
||||
},
|
||||
"selected": false,
|
||||
"width": 384,
|
||||
|
|
@ -176,7 +177,7 @@
|
|||
"dragging": false
|
||||
},
|
||||
{
|
||||
"id": "Prompt-adTHU",
|
||||
"id": "Prompt-BbuIE",
|
||||
"type": "genericNode",
|
||||
"position": {
|
||||
"x": 731.5380376186406,
|
||||
|
|
@ -193,7 +194,7 @@
|
|||
"list": false,
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow import CustomComponent\nfrom langflow.field_typing import Prompt, TemplateField, Text\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"A component for creating prompts using templates\"\n icon = \"terminal-square\"\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",
|
||||
"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,
|
||||
|
|
@ -201,6 +202,7 @@
|
|||
"advanced": true,
|
||||
"dynamic": true,
|
||||
"info": "",
|
||||
"load_from_db": false,
|
||||
"title_case": false
|
||||
},
|
||||
"template": {
|
||||
|
|
@ -331,7 +333,7 @@
|
|||
"beta": true,
|
||||
"error": null
|
||||
},
|
||||
"id": "Prompt-adTHU",
|
||||
"id": "Prompt-BbuIE",
|
||||
"description": "A component for creating prompts using templates",
|
||||
"display_name": "Prompt"
|
||||
},
|
||||
|
|
@ -341,11 +343,11 @@
|
|||
"dragging": false
|
||||
},
|
||||
{
|
||||
"id": "TextInput-fha43",
|
||||
"id": "TextInput-DMvJK",
|
||||
"type": "genericNode",
|
||||
"position": {
|
||||
"x": 91.73477837172948,
|
||||
"y": 787.6263883143245
|
||||
"x": 72.39693609771552,
|
||||
"y": 782.101290521749
|
||||
},
|
||||
"data": {
|
||||
"type": "TextInput",
|
||||
|
|
@ -375,7 +377,7 @@
|
|||
"list": false,
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "Cars",
|
||||
"value": "Inputs and Outputs definition in Langflow's latest major release",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
|
|
@ -412,23 +414,23 @@
|
|||
],
|
||||
"beta": true
|
||||
},
|
||||
"id": "TextInput-fha43"
|
||||
"id": "TextInput-DMvJK"
|
||||
},
|
||||
"selected": false,
|
||||
"width": 384,
|
||||
"height": 297,
|
||||
"positionAbsolute": {
|
||||
"x": 91.73477837172948,
|
||||
"y": 787.6263883143245
|
||||
"x": 72.39693609771552,
|
||||
"y": 782.101290521749
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"id": "TextInput-SncwS",
|
||||
"id": "TextInput-qQVvJ",
|
||||
"type": "genericNode",
|
||||
"position": {
|
||||
"x": 93.56470545178581,
|
||||
"y": 1125.2986229040628
|
||||
"x": 61.631382957038454,
|
||||
"y": 1128.0611718003504
|
||||
},
|
||||
"data": {
|
||||
"type": "TextInput",
|
||||
|
|
@ -458,7 +460,7 @@
|
|||
"list": false,
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "Bottle",
|
||||
"value": "Renaming Langflow Components to make it easier to identify them in the Interaction Panel",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
|
|
@ -495,23 +497,23 @@
|
|||
],
|
||||
"beta": true
|
||||
},
|
||||
"id": "TextInput-SncwS"
|
||||
"id": "TextInput-qQVvJ"
|
||||
},
|
||||
"selected": false,
|
||||
"selected": true,
|
||||
"width": 384,
|
||||
"height": 297,
|
||||
"positionAbsolute": {
|
||||
"x": 93.56470545178581,
|
||||
"y": 1125.2986229040628
|
||||
"x": 61.631382957038454,
|
||||
"y": 1128.0611718003504
|
||||
},
|
||||
"dragging": false
|
||||
"dragging": true
|
||||
},
|
||||
{
|
||||
"id": "TextOutput-A6XkD",
|
||||
"id": "TextOutput-MtLP2",
|
||||
"type": "genericNode",
|
||||
"position": {
|
||||
"x": 1242.6494961686594,
|
||||
"y": 100.3023112016921
|
||||
"x": 1212.7643867035406,
|
||||
"y": 503.75128898079595
|
||||
},
|
||||
"data": {
|
||||
"type": "TextOutput",
|
||||
|
|
@ -578,19 +580,19 @@
|
|||
],
|
||||
"beta": true
|
||||
},
|
||||
"id": "TextOutput-A6XkD"
|
||||
"id": "TextOutput-MtLP2"
|
||||
},
|
||||
"selected": false,
|
||||
"width": 384,
|
||||
"height": 297,
|
||||
"positionAbsolute": {
|
||||
"x": 1242.6494961686594,
|
||||
"y": 100.3023112016921
|
||||
"x": 1212.7643867035406,
|
||||
"y": 503.75128898079595
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"id": "ChatOutput-HgY4l",
|
||||
"id": "ChatOutput-zRrJz",
|
||||
"type": "genericNode",
|
||||
"position": {
|
||||
"x": 2299.2806014585203,
|
||||
|
|
@ -607,7 +609,7 @@
|
|||
"list": false,
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Used to send a message to the chat.\"\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 ) -> Union[Text, Record]:\n return super().build(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n )\n",
|
||||
"value": "from 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 Interaction Panel.\"\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(\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,\n )\n",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
|
|
@ -615,6 +617,7 @@
|
|||
"advanced": true,
|
||||
"dynamic": true,
|
||||
"info": "",
|
||||
"load_from_db": false,
|
||||
"title_case": false
|
||||
},
|
||||
"input_value": {
|
||||
|
|
@ -748,9 +751,9 @@
|
|||
"field_order": [],
|
||||
"beta": true
|
||||
},
|
||||
"id": "ChatOutput-HgY4l"
|
||||
"id": "ChatOutput-zRrJz"
|
||||
},
|
||||
"selected": true,
|
||||
"selected": false,
|
||||
"width": 384,
|
||||
"height": 675,
|
||||
"positionAbsolute": {
|
||||
|
|
@ -760,11 +763,11 @@
|
|||
"dragging": false
|
||||
},
|
||||
{
|
||||
"id": "OpenAIModel-gaDoA",
|
||||
"id": "OpenAIModel-mDfsk",
|
||||
"type": "genericNode",
|
||||
"position": {
|
||||
"x": 1726.999321719415,
|
||||
"y": 349.13963064653507
|
||||
"x": 1698.5020965619854,
|
||||
"y": 213.01669602012862
|
||||
},
|
||||
"data": {
|
||||
"type": "OpenAIModel",
|
||||
|
|
@ -785,6 +788,7 @@
|
|||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"load_from_db": false,
|
||||
"title_case": false,
|
||||
"input_types": [
|
||||
"Text"
|
||||
|
|
@ -797,7 +801,7 @@
|
|||
"list": false,
|
||||
"show": true,
|
||||
"multiline": true,
|
||||
"value": "from typing import Optional\n\nfrom langchain_openai import ChatOpenAI\n\nfrom langflow.components.models.base.model import LCModelComponent\nfrom langflow.field_typing import NestedDict, Text\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI's models.\"\n icon = \"OpenAI\"\n\n def build_config(self):\n return {\n \"input_value\": {\"display_name\": \"Input\"},\n \"max_tokens\": {\n \"display_name\": \"Max Tokens\",\n \"advanced\": False,\n \"required\": False,\n },\n \"model_kwargs\": {\n \"display_name\": \"Model Kwargs\",\n \"advanced\": True,\n \"required\": False,\n },\n \"model_name\": {\n \"display_name\": \"Model Name\",\n \"advanced\": False,\n \"required\": False,\n \"options\": [\n \"gpt-4-turbo-preview\",\n \"gpt-4-0125-preview\",\n \"gpt-4-1106-preview\",\n \"gpt-4-vision-preview\",\n \"gpt-3.5-turbo-0125\",\n \"gpt-3.5-turbo-1106\",\n ],\n },\n \"openai_api_base\": {\n \"display_name\": \"OpenAI API Base\",\n \"advanced\": False,\n \"required\": False,\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 \"advanced\": False,\n \"required\": False,\n \"password\": True,\n },\n \"temperature\": {\n \"display_name\": \"Temperature\",\n \"advanced\": False,\n \"required\": False,\n \"value\": 0.7,\n },\n \"stream\": {\n \"display_name\": \"Stream\",\n \"info\": \"Stream the response from the model.\",\n },\n }\n\n def build(\n self,\n input_value: Text,\n max_tokens: Optional[int] = 256,\n model_kwargs: NestedDict = {},\n model_name: str = \"gpt-4-1106-preview\",\n openai_api_base: Optional[str] = None,\n openai_api_key: Optional[str] = None,\n temperature: float = 0.7,\n stream: bool = False,\n ) -> Text:\n if not openai_api_base:\n openai_api_base = \"https://api.openai.com/v1\"\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=openai_api_key,\n temperature=temperature,\n )\n\n return self.get_result(output=output, stream=stream, input_value=input_value)\n",
|
||||
"value": "from typing import Optional\n\nfrom langchain_openai import ChatOpenAI\n\nfrom langflow.base.models.model import LCModelComponent\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\": [\n \"gpt-4-turbo-preview\",\n \"gpt-3.5-turbo\",\n \"gpt-4-0125-preview\",\n \"gpt-4-1106-preview\",\n \"gpt-4-vision-preview\",\n \"gpt-3.5-turbo-0125\",\n \"gpt-3.5-turbo-1106\",\n ],\n \"value\": \"gpt-4-turbo-preview\",\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 the response from the model.\",\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,\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 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=openai_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,
|
||||
|
|
@ -805,6 +809,7 @@
|
|||
"advanced": true,
|
||||
"dynamic": true,
|
||||
"info": "",
|
||||
"load_from_db": false,
|
||||
"title_case": false
|
||||
},
|
||||
"max_tokens": {
|
||||
|
|
@ -820,9 +825,10 @@
|
|||
"password": false,
|
||||
"name": "max_tokens",
|
||||
"display_name": "Max Tokens",
|
||||
"advanced": false,
|
||||
"advanced": true,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"load_from_db": false,
|
||||
"title_case": false
|
||||
},
|
||||
"model_kwargs": {
|
||||
|
|
@ -841,21 +847,23 @@
|
|||
"advanced": true,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"load_from_db": false,
|
||||
"title_case": false
|
||||
},
|
||||
"model_name": {
|
||||
"type": "str",
|
||||
"required": false,
|
||||
"required": true,
|
||||
"placeholder": "",
|
||||
"list": true,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"value": "gpt-4-1106-preview",
|
||||
"value": "gpt-4-turbo-preview",
|
||||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"password": false,
|
||||
"options": [
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-3.5-turbo",
|
||||
"gpt-4-0125-preview",
|
||||
"gpt-4-1106-preview",
|
||||
"gpt-4-vision-preview",
|
||||
|
|
@ -867,6 +875,7 @@
|
|||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"load_from_db": false,
|
||||
"title_case": false,
|
||||
"input_types": [
|
||||
"Text"
|
||||
|
|
@ -884,9 +893,10 @@
|
|||
"password": false,
|
||||
"name": "openai_api_base",
|
||||
"display_name": "OpenAI API Base",
|
||||
"advanced": false,
|
||||
"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"
|
||||
|
|
@ -894,7 +904,7 @@
|
|||
},
|
||||
"openai_api_key": {
|
||||
"type": "str",
|
||||
"required": false,
|
||||
"required": true,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
|
|
@ -906,7 +916,8 @@
|
|||
"display_name": "OpenAI API Key",
|
||||
"advanced": false,
|
||||
"dynamic": false,
|
||||
"info": "",
|
||||
"info": "The OpenAI API Key to use for the OpenAI model.",
|
||||
"load_from_db": false,
|
||||
"title_case": false,
|
||||
"input_types": [
|
||||
"Text"
|
||||
|
|
@ -926,19 +937,41 @@
|
|||
"password": false,
|
||||
"name": "stream",
|
||||
"display_name": "Stream",
|
||||
"advanced": false,
|
||||
"advanced": true,
|
||||
"dynamic": false,
|
||||
"info": "Stream the response from the model.",
|
||||
"load_from_db": false,
|
||||
"title_case": false
|
||||
},
|
||||
"temperature": {
|
||||
"type": "float",
|
||||
"system_message": {
|
||||
"type": "str",
|
||||
"required": false,
|
||||
"placeholder": "",
|
||||
"list": false,
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"value": "0.2",
|
||||
"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,
|
||||
|
|
@ -948,15 +981,17 @@
|
|||
"dynamic": false,
|
||||
"info": "",
|
||||
"rangeSpec": {
|
||||
"step_type": "float",
|
||||
"min": -1,
|
||||
"max": 1,
|
||||
"step": 0.1
|
||||
},
|
||||
"load_from_db": false,
|
||||
"title_case": false
|
||||
},
|
||||
"_type": "CustomComponent"
|
||||
},
|
||||
"description": "Generates text using OpenAI's models.",
|
||||
"description": "Generates text using OpenAI LLMs.",
|
||||
"icon": "OpenAI",
|
||||
"base_classes": [
|
||||
"object",
|
||||
|
|
@ -967,44 +1002,55 @@
|
|||
"documentation": "",
|
||||
"custom_fields": {
|
||||
"input_value": null,
|
||||
"max_tokens": null,
|
||||
"model_kwargs": null,
|
||||
"model_name": null,
|
||||
"openai_api_base": null,
|
||||
"openai_api_key": null,
|
||||
"temperature": null,
|
||||
"stream": null
|
||||
"model_name": null,
|
||||
"max_tokens": null,
|
||||
"model_kwargs": null,
|
||||
"openai_api_base": null,
|
||||
"stream": null,
|
||||
"system_message": null
|
||||
},
|
||||
"output_types": [
|
||||
"Text"
|
||||
],
|
||||
"field_formatters": {},
|
||||
"frozen": false,
|
||||
"field_order": [],
|
||||
"field_order": [
|
||||
"max_tokens",
|
||||
"model_kwargs",
|
||||
"model_name",
|
||||
"openai_api_base",
|
||||
"openai_api_key",
|
||||
"temperature",
|
||||
"input_value",
|
||||
"system_message",
|
||||
"stream"
|
||||
],
|
||||
"beta": false
|
||||
},
|
||||
"id": "OpenAIModel-gaDoA"
|
||||
"id": "OpenAIModel-mDfsk"
|
||||
},
|
||||
"selected": false,
|
||||
"width": 384,
|
||||
"height": 845,
|
||||
"height": 563,
|
||||
"positionAbsolute": {
|
||||
"x": 1726.999321719415,
|
||||
"y": 349.13963064653507
|
||||
"x": 1698.5020965619854,
|
||||
"y": 213.01669602012862
|
||||
},
|
||||
"dragging": false
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "ChatInput-5Jp60",
|
||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-5Jp60œ}",
|
||||
"target": "Prompt-adTHU",
|
||||
"targetHandle": "{œfieldNameœ:œrequestœ,œidœ:œPrompt-adTHUœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}",
|
||||
"source": "ChatInput-HTY3h",
|
||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-HTY3hœ}",
|
||||
"target": "Prompt-BbuIE",
|
||||
"targetHandle": "{œfieldNameœ:œrequestœ,œidœ:œPrompt-BbuIEœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}",
|
||||
"data": {
|
||||
"targetHandle": {
|
||||
"fieldName": "request",
|
||||
"id": "Prompt-adTHU",
|
||||
"id": "Prompt-BbuIE",
|
||||
"inputTypes": [
|
||||
"Document",
|
||||
"BaseOutputParser",
|
||||
|
|
@ -1021,24 +1067,24 @@
|
|||
"str"
|
||||
],
|
||||
"dataType": "ChatInput",
|
||||
"id": "ChatInput-5Jp60"
|
||||
"id": "ChatInput-HTY3h"
|
||||
}
|
||||
},
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"id": "reactflow__edge-ChatInput-5Jp60{œbaseClassesœ:[œobjectœ,œTextœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-5Jp60œ}-Prompt-adTHU{œfieldNameœ:œrequestœ,œidœ:œPrompt-adTHUœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}"
|
||||
"id": "reactflow__edge-ChatInput-HTY3h{œbaseClassesœ:[œobjectœ,œTextœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-HTY3hœ}-Prompt-BbuIE{œfieldNameœ:œrequestœ,œidœ:œPrompt-BbuIEœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}"
|
||||
},
|
||||
{
|
||||
"source": "Prompt-adTHU",
|
||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-adTHUœ}",
|
||||
"target": "TextOutput-A6XkD",
|
||||
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-A6XkDœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||
"source": "Prompt-BbuIE",
|
||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-BbuIEœ}",
|
||||
"target": "TextOutput-MtLP2",
|
||||
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-MtLP2œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||
"data": {
|
||||
"targetHandle": {
|
||||
"fieldName": "input_value",
|
||||
"id": "TextOutput-A6XkD",
|
||||
"id": "TextOutput-MtLP2",
|
||||
"inputTypes": [
|
||||
"Text"
|
||||
],
|
||||
|
|
@ -1051,24 +1097,24 @@
|
|||
"str"
|
||||
],
|
||||
"dataType": "Prompt",
|
||||
"id": "Prompt-adTHU"
|
||||
"id": "Prompt-BbuIE"
|
||||
}
|
||||
},
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"id": "reactflow__edge-Prompt-adTHU{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-adTHUœ}-TextOutput-A6XkD{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-A6XkDœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
||||
"id": "reactflow__edge-Prompt-BbuIE{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-BbuIEœ}-TextOutput-MtLP2{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-MtLP2œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
||||
},
|
||||
{
|
||||
"source": "TextInput-SncwS",
|
||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-SncwSœ}",
|
||||
"target": "Prompt-adTHU",
|
||||
"targetHandle": "{œfieldNameœ:œtopic_2œ,œidœ:œPrompt-adTHUœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}",
|
||||
"source": "TextInput-qQVvJ",
|
||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-qQVvJœ}",
|
||||
"target": "Prompt-BbuIE",
|
||||
"targetHandle": "{œfieldNameœ:œtopic_2œ,œidœ:œPrompt-BbuIEœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}",
|
||||
"data": {
|
||||
"targetHandle": {
|
||||
"fieldName": "topic_2",
|
||||
"id": "Prompt-adTHU",
|
||||
"id": "Prompt-BbuIE",
|
||||
"inputTypes": [
|
||||
"Document",
|
||||
"BaseOutputParser",
|
||||
|
|
@ -1084,24 +1130,24 @@
|
|||
"str"
|
||||
],
|
||||
"dataType": "TextInput",
|
||||
"id": "TextInput-SncwS"
|
||||
"id": "TextInput-qQVvJ"
|
||||
}
|
||||
},
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"id": "reactflow__edge-TextInput-SncwS{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-SncwSœ}-Prompt-adTHU{œfieldNameœ:œtopic_2œ,œidœ:œPrompt-adTHUœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}"
|
||||
"id": "reactflow__edge-TextInput-qQVvJ{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-qQVvJœ}-Prompt-BbuIE{œfieldNameœ:œtopic_2œ,œidœ:œPrompt-BbuIEœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}"
|
||||
},
|
||||
{
|
||||
"source": "TextInput-fha43",
|
||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-fha43œ}",
|
||||
"target": "Prompt-adTHU",
|
||||
"targetHandle": "{œfieldNameœ:œtopic_1œ,œidœ:œPrompt-adTHUœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}",
|
||||
"source": "TextInput-DMvJK",
|
||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-DMvJKœ}",
|
||||
"target": "Prompt-BbuIE",
|
||||
"targetHandle": "{œfieldNameœ:œtopic_1œ,œidœ:œPrompt-BbuIEœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}",
|
||||
"data": {
|
||||
"targetHandle": {
|
||||
"fieldName": "topic_1",
|
||||
"id": "Prompt-adTHU",
|
||||
"id": "Prompt-BbuIE",
|
||||
"inputTypes": [
|
||||
"Document",
|
||||
"BaseOutputParser",
|
||||
|
|
@ -1117,24 +1163,24 @@
|
|||
"str"
|
||||
],
|
||||
"dataType": "TextInput",
|
||||
"id": "TextInput-fha43"
|
||||
"id": "TextInput-DMvJK"
|
||||
}
|
||||
},
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-gray-900 stroke-connection",
|
||||
"id": "reactflow__edge-TextInput-fha43{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-fha43œ}-Prompt-adTHU{œfieldNameœ:œtopic_1œ,œidœ:œPrompt-adTHUœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}"
|
||||
"id": "reactflow__edge-TextInput-DMvJK{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-DMvJKœ}-Prompt-BbuIE{œfieldNameœ:œtopic_1œ,œidœ:œPrompt-BbuIEœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}"
|
||||
},
|
||||
{
|
||||
"source": "TextOutput-A6XkD",
|
||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextOutputœ,œidœ:œTextOutput-A6XkDœ}",
|
||||
"target": "OpenAIModel-gaDoA",
|
||||
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-gaDoAœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||
"source": "TextOutput-MtLP2",
|
||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextOutputœ,œidœ:œTextOutput-MtLP2œ}",
|
||||
"target": "OpenAIModel-mDfsk",
|
||||
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-mDfskœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||
"data": {
|
||||
"targetHandle": {
|
||||
"fieldName": "input_value",
|
||||
"id": "OpenAIModel-gaDoA",
|
||||
"id": "OpenAIModel-mDfsk",
|
||||
"inputTypes": [
|
||||
"Text"
|
||||
],
|
||||
|
|
@ -1147,24 +1193,24 @@
|
|||
"str"
|
||||
],
|
||||
"dataType": "TextOutput",
|
||||
"id": "TextOutput-A6XkD"
|
||||
"id": "TextOutput-MtLP2"
|
||||
}
|
||||
},
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-foreground stroke-connection",
|
||||
"id": "reactflow__edge-TextOutput-A6XkD{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextOutputœ,œidœ:œTextOutput-A6XkDœ}-OpenAIModel-gaDoA{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-gaDoAœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
||||
"id": "reactflow__edge-TextOutput-MtLP2{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextOutputœ,œidœ:œTextOutput-MtLP2œ}-OpenAIModel-mDfsk{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-mDfskœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
||||
},
|
||||
{
|
||||
"source": "OpenAIModel-gaDoA",
|
||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-gaDoAœ}",
|
||||
"target": "ChatOutput-HgY4l",
|
||||
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-HgY4lœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||
"source": "OpenAIModel-mDfsk",
|
||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-mDfskœ}",
|
||||
"target": "ChatOutput-zRrJz",
|
||||
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-zRrJzœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||
"data": {
|
||||
"targetHandle": {
|
||||
"fieldName": "input_value",
|
||||
"id": "ChatOutput-HgY4l",
|
||||
"id": "ChatOutput-zRrJz",
|
||||
"inputTypes": [
|
||||
"Text"
|
||||
],
|
||||
|
|
@ -1177,20 +1223,20 @@
|
|||
"Text"
|
||||
],
|
||||
"dataType": "OpenAIModel",
|
||||
"id": "OpenAIModel-gaDoA"
|
||||
"id": "OpenAIModel-mDfsk"
|
||||
}
|
||||
},
|
||||
"style": {
|
||||
"stroke": "#555"
|
||||
},
|
||||
"className": "stroke-foreground stroke-connection",
|
||||
"id": "reactflow__edge-OpenAIModel-gaDoA{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-gaDoAœ}-ChatOutput-HgY4l{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-HgY4lœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
||||
"id": "reactflow__edge-OpenAIModel-mDfsk{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-mDfskœ}-ChatOutput-zRrJz{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-zRrJzœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
||||
}
|
||||
],
|
||||
"viewport": {
|
||||
"x": -259.90018287199223,
|
||||
"y": 115.26167092636672,
|
||||
"zoom": 0.4123667743050418
|
||||
"x": 25.006295501767738,
|
||||
"y": 121.09135278538275,
|
||||
"zoom": 0.3619845430948907
|
||||
}
|
||||
},
|
||||
"description": "Use a language model to generate text based on a prompt. \n\nIn this project, you'll be able to generate text based on a request and some topics.\n\nThe Topic 1 and Topic 2 components are actually Text Input, while the Prompt Output component is a Text Output. Changing the name of the component makes them easier to identify when interacting with them.",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue