Update Basic Prompting starter project
This commit is contained in:
parent
b585088f17
commit
64c4bf0c3c
1 changed files with 143 additions and 142 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"id": "4ac1ae80-b818-4fdf-b72c-f22dace784a5",
|
"id": "8e544e5b-d4a7-487a-afe3-b271e3cb9e5c",
|
||||||
"icon": "📝",
|
"icon": "📝",
|
||||||
"icon_bg_color": "#FFD700",
|
"icon_bg_color": "#FFD700",
|
||||||
"data": {
|
"data": {
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"id": "ChatInput-WcFzs",
|
"id": "ChatInput-5Jp60",
|
||||||
"type": "genericNode",
|
"type": "genericNode",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 86.66131544226482,
|
"x": 86.66131544226482,
|
||||||
|
|
@ -22,12 +22,12 @@
|
||||||
"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 = \"Used to get user input from the chat.\"\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 = \"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",
|
||||||
"fileTypes": [],
|
"fileTypes": [],
|
||||||
"file_path": "",
|
"file_path": "",
|
||||||
"password": false,
|
"password": false,
|
||||||
"name": "code",
|
"name": "code",
|
||||||
"advanced": false,
|
"advanced": true,
|
||||||
"dynamic": true,
|
"dynamic": true,
|
||||||
"info": "",
|
"info": "",
|
||||||
"title_case": false
|
"title_case": false
|
||||||
|
|
@ -164,11 +164,11 @@
|
||||||
"field_order": [],
|
"field_order": [],
|
||||||
"beta": true
|
"beta": true
|
||||||
},
|
},
|
||||||
"id": "ChatInput-WcFzs"
|
"id": "ChatInput-5Jp60"
|
||||||
},
|
},
|
||||||
"selected": false,
|
"selected": false,
|
||||||
"width": 384,
|
"width": 384,
|
||||||
"height": 667,
|
"height": 675,
|
||||||
"positionAbsolute": {
|
"positionAbsolute": {
|
||||||
"x": 86.66131544226482,
|
"x": 86.66131544226482,
|
||||||
"y": 69.51987428063671
|
"y": 69.51987428063671
|
||||||
|
|
@ -176,7 +176,7 @@
|
||||||
"dragging": false
|
"dragging": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Prompt-QtWOn",
|
"id": "Prompt-adTHU",
|
||||||
"type": "genericNode",
|
"type": "genericNode",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 731.5380376186406,
|
"x": 731.5380376186406,
|
||||||
|
|
@ -193,7 +193,7 @@
|
||||||
"list": false,
|
"list": false,
|
||||||
"show": true,
|
"show": true,
|
||||||
"multiline": 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 beta = True\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 prompt_template = PromptTemplate.from_template(Text(template))\n\n attributes_to_check = [\"text\", \"page_content\"]\n for key, value in kwargs.copy().items():\n for attribute in attributes_to_check:\n if hasattr(value, attribute):\n kwargs[key] = getattr(value, attribute)\n\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: \"{formated_prompt}\"'\n return formated_prompt\n",
|
"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",
|
||||||
"fileTypes": [],
|
"fileTypes": [],
|
||||||
"file_path": "",
|
"file_path": "",
|
||||||
"password": false,
|
"password": false,
|
||||||
|
|
@ -331,17 +331,17 @@
|
||||||
"beta": true,
|
"beta": true,
|
||||||
"error": null
|
"error": null
|
||||||
},
|
},
|
||||||
"id": "Prompt-QtWOn",
|
"id": "Prompt-adTHU",
|
||||||
"description": "A component for creating prompts using templates",
|
"description": "A component for creating prompts using templates",
|
||||||
"display_name": "Prompt"
|
"display_name": "Prompt"
|
||||||
},
|
},
|
||||||
"selected": false,
|
"selected": false,
|
||||||
"width": 384,
|
"width": 384,
|
||||||
"height": 571,
|
"height": 595,
|
||||||
"dragging": false
|
"dragging": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "TextInput-xUQ9w",
|
"id": "TextInput-fha43",
|
||||||
"type": "genericNode",
|
"type": "genericNode",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 91.73477837172948,
|
"x": 91.73477837172948,
|
||||||
|
|
@ -412,11 +412,11 @@
|
||||||
],
|
],
|
||||||
"beta": true
|
"beta": true
|
||||||
},
|
},
|
||||||
"id": "TextInput-xUQ9w"
|
"id": "TextInput-fha43"
|
||||||
},
|
},
|
||||||
"selected": false,
|
"selected": false,
|
||||||
"width": 384,
|
"width": 384,
|
||||||
"height": 289,
|
"height": 297,
|
||||||
"positionAbsolute": {
|
"positionAbsolute": {
|
||||||
"x": 91.73477837172948,
|
"x": 91.73477837172948,
|
||||||
"y": 787.6263883143245
|
"y": 787.6263883143245
|
||||||
|
|
@ -424,7 +424,7 @@
|
||||||
"dragging": false
|
"dragging": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "TextInput-l4zQt",
|
"id": "TextInput-SncwS",
|
||||||
"type": "genericNode",
|
"type": "genericNode",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 93.56470545178581,
|
"x": 93.56470545178581,
|
||||||
|
|
@ -495,11 +495,11 @@
|
||||||
],
|
],
|
||||||
"beta": true
|
"beta": true
|
||||||
},
|
},
|
||||||
"id": "TextInput-l4zQt"
|
"id": "TextInput-SncwS"
|
||||||
},
|
},
|
||||||
"selected": false,
|
"selected": false,
|
||||||
"width": 384,
|
"width": 384,
|
||||||
"height": 289,
|
"height": 297,
|
||||||
"positionAbsolute": {
|
"positionAbsolute": {
|
||||||
"x": 93.56470545178581,
|
"x": 93.56470545178581,
|
||||||
"y": 1125.2986229040628
|
"y": 1125.2986229040628
|
||||||
|
|
@ -507,7 +507,7 @@
|
||||||
"dragging": false
|
"dragging": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "TextOutput-fTp5e",
|
"id": "TextOutput-A6XkD",
|
||||||
"type": "genericNode",
|
"type": "genericNode",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 1242.6494961686594,
|
"x": 1242.6494961686594,
|
||||||
|
|
@ -578,7 +578,7 @@
|
||||||
],
|
],
|
||||||
"beta": true
|
"beta": true
|
||||||
},
|
},
|
||||||
"id": "TextOutput-fTp5e"
|
"id": "TextOutput-A6XkD"
|
||||||
},
|
},
|
||||||
"selected": false,
|
"selected": false,
|
||||||
"width": 384,
|
"width": 384,
|
||||||
|
|
@ -590,7 +590,7 @@
|
||||||
"dragging": false
|
"dragging": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "ChatOutput-AVN8s",
|
"id": "ChatOutput-HgY4l",
|
||||||
"type": "genericNode",
|
"type": "genericNode",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 2299.2806014585203,
|
"x": 2299.2806014585203,
|
||||||
|
|
@ -607,12 +607,12 @@
|
||||||
"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 = \"Used to send a message to the chat.\"\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 = \"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",
|
||||||
"fileTypes": [],
|
"fileTypes": [],
|
||||||
"file_path": "",
|
"file_path": "",
|
||||||
"password": false,
|
"password": false,
|
||||||
"name": "code",
|
"name": "code",
|
||||||
"advanced": false,
|
"advanced": true,
|
||||||
"dynamic": true,
|
"dynamic": true,
|
||||||
"info": "",
|
"info": "",
|
||||||
"title_case": false
|
"title_case": false
|
||||||
|
|
@ -748,11 +748,11 @@
|
||||||
"field_order": [],
|
"field_order": [],
|
||||||
"beta": true
|
"beta": true
|
||||||
},
|
},
|
||||||
"id": "ChatOutput-AVN8s"
|
"id": "ChatOutput-HgY4l"
|
||||||
},
|
},
|
||||||
"selected": false,
|
"selected": true,
|
||||||
"width": 384,
|
"width": 384,
|
||||||
"height": 667,
|
"height": 675,
|
||||||
"positionAbsolute": {
|
"positionAbsolute": {
|
||||||
"x": 2299.2806014585203,
|
"x": 2299.2806014585203,
|
||||||
"y": 449.2461295937437
|
"y": 449.2461295937437
|
||||||
|
|
@ -760,11 +760,11 @@
|
||||||
"dragging": false
|
"dragging": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "OpenAIModel-IRzsd",
|
"id": "OpenAIModel-gaDoA",
|
||||||
"type": "genericNode",
|
"type": "genericNode",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 1735.1051821296949,
|
"x": 1726.999321719415,
|
||||||
"y": 246.4955882724468
|
"y": 349.13963064653507
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"type": "OpenAIModel",
|
"type": "OpenAIModel",
|
||||||
|
|
@ -797,12 +797,12 @@
|
||||||
"list": false,
|
"list": false,
|
||||||
"show": true,
|
"show": true,
|
||||||
"multiline": true,
|
"multiline": true,
|
||||||
"value": "from typing import Optional\n\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\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 Model\"\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 if openai_api_key:\n secret_key = SecretStr(openai_api_key)\n else:\n secret_key = None\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=secret_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.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",
|
||||||
"fileTypes": [],
|
"fileTypes": [],
|
||||||
"file_path": "",
|
"file_path": "",
|
||||||
"password": false,
|
"password": false,
|
||||||
"name": "code",
|
"name": "code",
|
||||||
"advanced": false,
|
"advanced": true,
|
||||||
"dynamic": true,
|
"dynamic": true,
|
||||||
"info": "",
|
"info": "",
|
||||||
"title_case": false
|
"title_case": false
|
||||||
|
|
@ -910,16 +910,17 @@
|
||||||
"title_case": false,
|
"title_case": false,
|
||||||
"input_types": [
|
"input_types": [
|
||||||
"Text"
|
"Text"
|
||||||
]
|
],
|
||||||
|
"value": ""
|
||||||
},
|
},
|
||||||
"stream": {
|
"stream": {
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"required": true,
|
"required": false,
|
||||||
"placeholder": "",
|
"placeholder": "",
|
||||||
"list": false,
|
"list": false,
|
||||||
"show": true,
|
"show": true,
|
||||||
"multiline": false,
|
"multiline": false,
|
||||||
"value": true,
|
"value": false,
|
||||||
"fileTypes": [],
|
"fileTypes": [],
|
||||||
"file_path": "",
|
"file_path": "",
|
||||||
"password": false,
|
"password": false,
|
||||||
|
|
@ -959,10 +960,10 @@
|
||||||
"icon": "OpenAI",
|
"icon": "OpenAI",
|
||||||
"base_classes": [
|
"base_classes": [
|
||||||
"object",
|
"object",
|
||||||
"Text",
|
"str",
|
||||||
"str"
|
"Text"
|
||||||
],
|
],
|
||||||
"display_name": "OpenAI Model",
|
"display_name": "OpenAI",
|
||||||
"documentation": "",
|
"documentation": "",
|
||||||
"custom_fields": {
|
"custom_fields": {
|
||||||
"input_value": null,
|
"input_value": null,
|
||||||
|
|
@ -980,30 +981,30 @@
|
||||||
"field_formatters": {},
|
"field_formatters": {},
|
||||||
"frozen": false,
|
"frozen": false,
|
||||||
"field_order": [],
|
"field_order": [],
|
||||||
"beta": true
|
"beta": false
|
||||||
},
|
},
|
||||||
"id": "OpenAIModel-IRzsd"
|
"id": "OpenAIModel-gaDoA"
|
||||||
},
|
},
|
||||||
"selected": false,
|
"selected": false,
|
||||||
"width": 384,
|
"width": 384,
|
||||||
"height": 847,
|
"height": 845,
|
||||||
"positionAbsolute": {
|
"positionAbsolute": {
|
||||||
"x": 1735.1051821296949,
|
"x": 1726.999321719415,
|
||||||
"y": 246.4955882724468
|
"y": 349.13963064653507
|
||||||
},
|
},
|
||||||
"dragging": false
|
"dragging": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"edges": [
|
"edges": [
|
||||||
{
|
{
|
||||||
"source": "ChatInput-WcFzs",
|
"source": "ChatInput-5Jp60",
|
||||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-WcFzsœ}",
|
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-5Jp60œ}",
|
||||||
"target": "Prompt-QtWOn",
|
"target": "Prompt-adTHU",
|
||||||
"targetHandle": "{œfieldNameœ:œrequestœ,œidœ:œPrompt-QtWOnœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}",
|
"targetHandle": "{œfieldNameœ:œrequestœ,œidœ:œPrompt-adTHUœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "request",
|
"fieldName": "request",
|
||||||
"id": "Prompt-QtWOn",
|
"id": "Prompt-adTHU",
|
||||||
"inputTypes": [
|
"inputTypes": [
|
||||||
"Document",
|
"Document",
|
||||||
"BaseOutputParser",
|
"BaseOutputParser",
|
||||||
|
|
@ -1020,24 +1021,24 @@
|
||||||
"str"
|
"str"
|
||||||
],
|
],
|
||||||
"dataType": "ChatInput",
|
"dataType": "ChatInput",
|
||||||
"id": "ChatInput-WcFzs"
|
"id": "ChatInput-5Jp60"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"style": {
|
"style": {
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-foreground stroke-connection",
|
"className": "stroke-gray-900 stroke-connection",
|
||||||
"id": "reactflow__edge-ChatInput-WcFzs{œbaseClassesœ:[œobjectœ,œTextœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-WcFzsœ}-Prompt-QtWOn{œfieldNameœ:œrequestœ,œidœ:œPrompt-QtWOnœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}"
|
"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œ}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "Prompt-QtWOn",
|
"source": "Prompt-adTHU",
|
||||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-QtWOnœ}",
|
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-adTHUœ}",
|
||||||
"target": "TextOutput-fTp5e",
|
"target": "TextOutput-A6XkD",
|
||||||
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-fTp5eœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-A6XkDœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "input_value",
|
"fieldName": "input_value",
|
||||||
"id": "TextOutput-fTp5e",
|
"id": "TextOutput-A6XkD",
|
||||||
"inputTypes": [
|
"inputTypes": [
|
||||||
"Text"
|
"Text"
|
||||||
],
|
],
|
||||||
|
|
@ -1050,24 +1051,90 @@
|
||||||
"str"
|
"str"
|
||||||
],
|
],
|
||||||
"dataType": "Prompt",
|
"dataType": "Prompt",
|
||||||
"id": "Prompt-QtWOn"
|
"id": "Prompt-adTHU"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"style": {
|
"style": {
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-foreground stroke-connection",
|
"className": "stroke-gray-900 stroke-connection",
|
||||||
"id": "reactflow__edge-Prompt-QtWOn{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-QtWOnœ}-TextOutput-fTp5e{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-fTp5eœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
"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œ}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "TextOutput-fTp5e",
|
"source": "TextInput-SncwS",
|
||||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextOutputœ,œidœ:œTextOutput-fTp5eœ}",
|
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-SncwSœ}",
|
||||||
"target": "OpenAIModel-IRzsd",
|
"target": "Prompt-adTHU",
|
||||||
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-IRzsdœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
"targetHandle": "{œfieldNameœ:œtopic_2œ,œidœ:œPrompt-adTHUœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}",
|
||||||
|
"data": {
|
||||||
|
"targetHandle": {
|
||||||
|
"fieldName": "topic_2",
|
||||||
|
"id": "Prompt-adTHU",
|
||||||
|
"inputTypes": [
|
||||||
|
"Document",
|
||||||
|
"BaseOutputParser",
|
||||||
|
"Text",
|
||||||
|
"Record"
|
||||||
|
],
|
||||||
|
"type": "str"
|
||||||
|
},
|
||||||
|
"sourceHandle": {
|
||||||
|
"baseClasses": [
|
||||||
|
"object",
|
||||||
|
"Text",
|
||||||
|
"str"
|
||||||
|
],
|
||||||
|
"dataType": "TextInput",
|
||||||
|
"id": "TextInput-SncwS"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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œ}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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œ}",
|
||||||
|
"data": {
|
||||||
|
"targetHandle": {
|
||||||
|
"fieldName": "topic_1",
|
||||||
|
"id": "Prompt-adTHU",
|
||||||
|
"inputTypes": [
|
||||||
|
"Document",
|
||||||
|
"BaseOutputParser",
|
||||||
|
"Text",
|
||||||
|
"Record"
|
||||||
|
],
|
||||||
|
"type": "str"
|
||||||
|
},
|
||||||
|
"sourceHandle": {
|
||||||
|
"baseClasses": [
|
||||||
|
"object",
|
||||||
|
"Text",
|
||||||
|
"str"
|
||||||
|
],
|
||||||
|
"dataType": "TextInput",
|
||||||
|
"id": "TextInput-fha43"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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œ}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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œ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "input_value",
|
"fieldName": "input_value",
|
||||||
"id": "OpenAIModel-IRzsd",
|
"id": "OpenAIModel-gaDoA",
|
||||||
"inputTypes": [
|
"inputTypes": [
|
||||||
"Text"
|
"Text"
|
||||||
],
|
],
|
||||||
|
|
@ -1080,24 +1147,24 @@
|
||||||
"str"
|
"str"
|
||||||
],
|
],
|
||||||
"dataType": "TextOutput",
|
"dataType": "TextOutput",
|
||||||
"id": "TextOutput-fTp5e"
|
"id": "TextOutput-A6XkD"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"style": {
|
"style": {
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-foreground stroke-connection",
|
"className": "stroke-foreground stroke-connection",
|
||||||
"id": "reactflow__edge-TextOutput-fTp5e{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextOutputœ,œidœ:œTextOutput-fTp5eœ}-OpenAIModel-IRzsd{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-IRzsdœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
"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œ}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "OpenAIModel-IRzsd",
|
"source": "OpenAIModel-gaDoA",
|
||||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-IRzsdœ}",
|
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-gaDoAœ}",
|
||||||
"target": "ChatOutput-AVN8s",
|
"target": "ChatOutput-HgY4l",
|
||||||
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-AVN8sœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-HgY4lœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
|
||||||
"data": {
|
"data": {
|
||||||
"targetHandle": {
|
"targetHandle": {
|
||||||
"fieldName": "input_value",
|
"fieldName": "input_value",
|
||||||
"id": "ChatOutput-AVN8s",
|
"id": "ChatOutput-HgY4l",
|
||||||
"inputTypes": [
|
"inputTypes": [
|
||||||
"Text"
|
"Text"
|
||||||
],
|
],
|
||||||
|
|
@ -1106,94 +1173,28 @@
|
||||||
"sourceHandle": {
|
"sourceHandle": {
|
||||||
"baseClasses": [
|
"baseClasses": [
|
||||||
"object",
|
"object",
|
||||||
"Text",
|
"str",
|
||||||
"str"
|
"Text"
|
||||||
],
|
],
|
||||||
"dataType": "OpenAIModel",
|
"dataType": "OpenAIModel",
|
||||||
"id": "OpenAIModel-IRzsd"
|
"id": "OpenAIModel-gaDoA"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"style": {
|
"style": {
|
||||||
"stroke": "#555"
|
"stroke": "#555"
|
||||||
},
|
},
|
||||||
"className": "stroke-foreground stroke-connection",
|
"className": "stroke-foreground stroke-connection",
|
||||||
"id": "reactflow__edge-OpenAIModel-IRzsd{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-IRzsdœ}-ChatOutput-AVN8s{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-AVN8sœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
|
"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œ}"
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "TextInput-l4zQt",
|
|
||||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-l4zQtœ}",
|
|
||||||
"target": "Prompt-QtWOn",
|
|
||||||
"targetHandle": "{œfieldNameœ:œtopic_2œ,œidœ:œPrompt-QtWOnœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}",
|
|
||||||
"data": {
|
|
||||||
"targetHandle": {
|
|
||||||
"fieldName": "topic_2",
|
|
||||||
"id": "Prompt-QtWOn",
|
|
||||||
"inputTypes": [
|
|
||||||
"Document",
|
|
||||||
"BaseOutputParser",
|
|
||||||
"Text",
|
|
||||||
"Record"
|
|
||||||
],
|
|
||||||
"type": "str"
|
|
||||||
},
|
|
||||||
"sourceHandle": {
|
|
||||||
"baseClasses": [
|
|
||||||
"object",
|
|
||||||
"Text",
|
|
||||||
"str"
|
|
||||||
],
|
|
||||||
"dataType": "TextInput",
|
|
||||||
"id": "TextInput-l4zQt"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"style": {
|
|
||||||
"stroke": "#555"
|
|
||||||
},
|
|
||||||
"className": "stroke-foreground stroke-connection",
|
|
||||||
"id": "reactflow__edge-TextInput-l4zQt{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-l4zQtœ}-Prompt-QtWOn{œfieldNameœ:œtopic_2œ,œidœ:œPrompt-QtWOnœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "TextInput-xUQ9w",
|
|
||||||
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-xUQ9wœ}",
|
|
||||||
"target": "Prompt-QtWOn",
|
|
||||||
"targetHandle": "{œfieldNameœ:œtopic_1œ,œidœ:œPrompt-QtWOnœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}",
|
|
||||||
"data": {
|
|
||||||
"targetHandle": {
|
|
||||||
"fieldName": "topic_1",
|
|
||||||
"id": "Prompt-QtWOn",
|
|
||||||
"inputTypes": [
|
|
||||||
"Document",
|
|
||||||
"BaseOutputParser",
|
|
||||||
"Text",
|
|
||||||
"Record"
|
|
||||||
],
|
|
||||||
"type": "str"
|
|
||||||
},
|
|
||||||
"sourceHandle": {
|
|
||||||
"baseClasses": [
|
|
||||||
"object",
|
|
||||||
"Text",
|
|
||||||
"str"
|
|
||||||
],
|
|
||||||
"dataType": "TextInput",
|
|
||||||
"id": "TextInput-xUQ9w"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"style": {
|
|
||||||
"stroke": "#555"
|
|
||||||
},
|
|
||||||
"className": "stroke-foreground stroke-connection",
|
|
||||||
"id": "reactflow__edge-TextInput-xUQ9w{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œTextInputœ,œidœ:œTextInput-xUQ9wœ}-Prompt-QtWOn{œfieldNameœ:œtopic_1œ,œidœ:œPrompt-QtWOnœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œTextœ,œRecordœ],œtypeœ:œstrœ}"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"viewport": {
|
"viewport": {
|
||||||
"x": 81.87154098468557,
|
"x": -259.90018287199223,
|
||||||
"y": 266.8627952720353,
|
"y": 115.26167092636672,
|
||||||
"zoom": 0.315125847895746
|
"zoom": 0.4123667743050418
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"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.",
|
"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.",
|
||||||
"name": "Basic Prompting",
|
"name": "Basic Prompting",
|
||||||
"last_tested_version": "0.6.8",
|
"last_tested_version": "1.0.0a0",
|
||||||
"is_component": false
|
"is_component": false
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue