From 1903f607e8bb4ffa896ea9a5dec87e2fa66aa967 Mon Sep 17 00:00:00 2001 From: Eric Hare Date: Tue, 24 Jun 2025 11:12:06 -0700 Subject: [PATCH] fix: Clean up some more base templates (#8706) * fix: Clean up some more base templates * Fix icons in Pokedex Agent * Update Price Deal Finder.json * Update Social Media Agent.json * Update Social Media Agent.json * Update Memory Chatbot.json * Conflict fix * Update Memory Chatbot.json --- .../starter_projects/Memory Chatbot.json | 985 +++++++----------- .../starter_projects/Pokédex Agent.json | 12 - .../starter_projects/Price Deal Finder.json | 686 ++++++------ 3 files changed, 662 insertions(+), 1021 deletions(-) diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json b/src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json index 038b673d4..da2ba38a8 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json @@ -6,28 +6,29 @@ "className": "", "data": { "sourceHandle": { - "dataType": "ChatInput", - "id": "ChatInput-xyuQP", - "name": "message", + "dataType": "Memory", + "id": "Memory-hMFmY", + "name": "messages_text", "output_types": [ "Message" ] }, "targetHandle": { - "fieldName": "input_value", - "id": "OpenAIModel-uwgKb", + "fieldName": "memory", + "id": "Prompt-CixsJ", "inputTypes": [ - "Message" + "Message", + "Text" ], "type": "str" } }, - "id": "reactflow__edge-ChatInput-xyuQP{œdataTypeœ:œChatInputœ,œidœ:œChatInput-xyuQPœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-uwgKb{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-uwgKbœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "id": "xy-edge__Memory-hMFmY{œdataTypeœ:œMemoryœ,œidœ:œMemory-hMFmYœ,œnameœ:œmessages_textœ,œoutput_typesœ:[œMessageœ]}-Prompt-CixsJ{œfieldNameœ:œmemoryœ,œidœ:œPrompt-CixsJœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", "selected": false, - "source": "ChatInput-xyuQP", - "sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-xyuQPœ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}", - "target": "OpenAIModel-uwgKb", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œOpenAIModel-uwgKbœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "source": "Memory-hMFmY", + "sourceHandle": "{œdataTypeœ:œMemoryœ,œidœ:œMemory-hMFmYœ,œnameœ:œmessages_textœ,œoutput_typesœ:[œMessageœ]}", + "target": "Prompt-CixsJ", + "targetHandle": "{œfieldNameœ:œmemoryœ,œidœ:œPrompt-CixsJœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}" }, { "animated": false, @@ -35,7 +36,7 @@ "data": { "sourceHandle": { "dataType": "Prompt", - "id": "Prompt-2aw7O", + "id": "Prompt-CixsJ", "name": "prompt", "output_types": [ "Message" @@ -43,27 +44,55 @@ }, "targetHandle": { "fieldName": "system_message", - "id": "OpenAIModel-uwgKb", + "id": "LanguageModelComponent-vvfAj", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Prompt-2aw7O{œdataTypeœ:œPromptœ,œidœ:œPrompt-2aw7Oœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-uwgKb{œfieldNameœ:œsystem_messageœ,œidœ:œOpenAIModel-uwgKbœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "id": "xy-edge__Prompt-CixsJ{œdataTypeœ:œPromptœ,œidœ:œPrompt-CixsJœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-LanguageModelComponent-vvfAj{œfieldNameœ:œsystem_messageœ,œidœ:œLanguageModelComponent-vvfAjœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", "selected": false, - "source": "Prompt-2aw7O", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-2aw7Oœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "OpenAIModel-uwgKb", - "targetHandle": "{œfieldNameœ: œsystem_messageœ, œidœ: œOpenAIModel-uwgKbœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "source": "Prompt-CixsJ", + "sourceHandle": "{œdataTypeœ:œPromptœ,œidœ:œPrompt-CixsJœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}", + "target": "LanguageModelComponent-vvfAj", + "targetHandle": "{œfieldNameœ:œsystem_messageœ,œidœ:œLanguageModelComponent-vvfAjœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}" }, { "animated": false, "className": "", "data": { "sourceHandle": { - "dataType": "OpenAIModel", - "id": "OpenAIModel-uwgKb", + "dataType": "ChatInput", + "id": "ChatInput-5t3wq", + "name": "message", + "output_types": [ + "Message" + ] + }, + "targetHandle": { + "fieldName": "input_value", + "id": "LanguageModelComponent-vvfAj", + "inputTypes": [ + "Message" + ], + "type": "str" + } + }, + "id": "xy-edge__ChatInput-5t3wq{œdataTypeœ:œChatInputœ,œidœ:œChatInput-5t3wqœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-LanguageModelComponent-vvfAj{œfieldNameœ:œinput_valueœ,œidœ:œLanguageModelComponent-vvfAjœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "selected": false, + "source": "ChatInput-5t3wq", + "sourceHandle": "{œdataTypeœ:œChatInputœ,œidœ:œChatInput-5t3wqœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}", + "target": "LanguageModelComponent-vvfAj", + "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œLanguageModelComponent-vvfAjœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}" + }, + { + "animated": false, + "className": "", + "data": { + "sourceHandle": { + "dataType": "LanguageModelComponent", + "id": "LanguageModelComponent-vvfAj", "name": "text_output", "output_types": [ "Message" @@ -71,7 +100,7 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "ChatOutput-cBToy", + "id": "ChatOutput-CwxcD", "inputTypes": [ "Data", "DataFrame", @@ -80,77 +109,18 @@ "type": "str" } }, - "id": "reactflow__edge-OpenAIModel-uwgKb{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-uwgKbœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-cBToy{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-cBToyœ,œinputTypesœ:[œDataœ,œDataFrameœ,œMessageœ],œtypeœ:œstrœ}", + "id": "xy-edge__LanguageModelComponent-vvfAj{œdataTypeœ:œLanguageModelComponentœ,œidœ:œLanguageModelComponent-vvfAjœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-CwxcD{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-CwxcDœ,œinputTypesœ:[œDataœ,œDataFrameœ,œMessageœ],œtypeœ:œstrœ}", "selected": false, - "source": "OpenAIModel-uwgKb", - "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-uwgKbœ, œnameœ: œtext_outputœ, œoutput_typesœ: [œMessageœ]}", - "target": "ChatOutput-cBToy", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-cBToyœ, œinputTypesœ: [œDataœ, œDataFrameœ, œMessageœ], œtypeœ: œstrœ}" - }, - { - "animated": false, - "className": "", - "data": { - "sourceHandle": { - "dataType": "TypeConverterComponent", - "id": "TypeConverterComponent-6kqHz", - "name": "message_output", - "output_types": [ - "Message" - ] - }, - "targetHandle": { - "fieldName": "memory", - "id": "Prompt-2aw7O", - "inputTypes": [ - "Message", - "Text" - ], - "type": "str" - } - }, - "id": "reactflow__edge-TypeConverterComponent-6kqHz{œdataTypeœ:œTypeConverterComponentœ,œidœ:œTypeConverterComponent-6kqHzœ,œnameœ:œmessage_outputœ,œoutput_typesœ:[œMessageœ]}-Prompt-2aw7O{œfieldNameœ:œmemoryœ,œidœ:œPrompt-2aw7Oœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", - "selected": false, - "source": "TypeConverterComponent-6kqHz", - "sourceHandle": "{œdataTypeœ: œTypeConverterComponentœ, œidœ: œTypeConverterComponent-6kqHzœ, œnameœ: œmessage_outputœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-2aw7O", - "targetHandle": "{œfieldNameœ: œmemoryœ, œidœ: œPrompt-2aw7Oœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" - }, - { - "animated": false, - "className": "", - "data": { - "sourceHandle": { - "dataType": "Memory", - "id": "Memory-Esy2a", - "name": "dataframe", - "output_types": [ - "DataFrame" - ] - }, - "targetHandle": { - "fieldName": "input_data", - "id": "TypeConverterComponent-6kqHz", - "inputTypes": [ - "Message", - "Data", - "DataFrame" - ], - "type": "other" - } - }, - "id": "reactflow__edge-Memory-Esy2a{œdataTypeœ:œMemoryœ,œidœ:œMemory-Esy2aœ,œnameœ:œdataframeœ,œoutput_typesœ:[œDataFrameœ]}-TypeConverterComponent-6kqHz{œfieldNameœ:œinput_dataœ,œidœ:œTypeConverterComponent-6kqHzœ,œinputTypesœ:[œMessageœ,œDataœ,œDataFrameœ],œtypeœ:œotherœ}", - "selected": false, - "source": "Memory-Esy2a", - "sourceHandle": "{œdataTypeœ: œMemoryœ, œidœ: œMemory-Esy2aœ, œnameœ: œdataframeœ, œoutput_typesœ: [œDataFrameœ]}", - "target": "TypeConverterComponent-6kqHz", - "targetHandle": "{œfieldNameœ: œinput_dataœ, œidœ: œTypeConverterComponent-6kqHzœ, œinputTypesœ: [œMessageœ, œDataœ, œDataFrameœ], œtypeœ: œotherœ}" + "source": "LanguageModelComponent-vvfAj", + "sourceHandle": "{œdataTypeœ:œLanguageModelComponentœ,œidœ:œLanguageModelComponent-vvfAjœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}", + "target": "ChatOutput-CwxcD", + "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-CwxcDœ,œinputTypesœ:[œDataœ,œDataFrameœ,œMessageœ],œtypeœ:œstrœ}" } ], "nodes": [ { "data": { - "id": "ChatInput-xyuQP", + "id": "ChatInput-5t3wq", "node": { "base_classes": [ "Message" @@ -435,7 +405,7 @@ }, "dragging": false, "height": 234, - "id": "ChatInput-xyuQP", + "id": "ChatInput-5t3wq", "measured": { "height": 234, "width": 320 @@ -456,7 +426,7 @@ "data": { "description": "Display a chat message in the Playground.", "display_name": "Chat Output", - "id": "ChatOutput-cBToy", + "id": "ChatOutput-CwxcD", "node": { "base_classes": [ "Message" @@ -739,7 +709,7 @@ }, "dragging": true, "height": 234, - "id": "ChatOutput-cBToy", + "id": "ChatOutput-CwxcD", "measured": { "height": 234, "width": 320 @@ -758,7 +728,7 @@ }, { "data": { - "id": "note-WfHA2", + "id": "note-gqfuY", "node": { "description": "# Memory Chatbot\n\nA flexible chatbot implementation featuring advanced conversation memory capabilities. This serves as a foundational tool for building chat experiences with persistent context.\n\n## Core Components\n\n1. **Chat Input**\n - Accepts user messages\n - Configures conversation storage\n - Tracks session identity\n\n2. **Chat Memory**\n - Stores and retrieves up to 100 previous messages\n - Maintains conversation context\n - Tracks separate chat sessions\n - Preserves sender information and message order\n\n3. **Prompt**\n - Creates dynamic prompt templates\n - Integrates memory into conversation flow\n\n4. **OpenAI**\n - Processes user input with context\n - Accesses conversation history\n - Includes options for model configuration and API key setup\n\n5. **Chat Output**\n - Displays formatted responses\n - Maintains conversation flow\n - Syncs with memory storage\n\n## Memory Features\n\n- Stores message history\n- Plans conversation trajectory\n- Differentiates between chat sessions\n- Preserves sender and message metadata\n\n## Quick Start\n\n1. **Initialize** with a clear session ID\n2. **Enter** message in Chat Input\n3. **AI Processes** with context from memory\n4. **Response** appears in Chat Output\n5. Context remains available for follow-ups\n\nThis robust system demonstrates thorough memory integration with minimal complexity. 🧠💬\n", "display_name": "", @@ -769,7 +739,7 @@ }, "dragging": false, "height": 736, - "id": "note-WfHA2", + "id": "note-gqfuY", "measured": { "height": 736, "width": 324 @@ -793,7 +763,7 @@ }, { "data": { - "id": "note-cHuhR", + "id": "note-9LNqT", "node": { "description": "## Get Your OpenAI API Key\n\n**Steps**:\n\n1. **Visit** [OpenAI's API Key Page](https://platform.openai.com/api-keys).\n\n2. **Log In/Sign Up**:\n - Log in or create a new OpenAI account.\n\n3. **Generate API Key**:\n - Click \"Create New Secret Key\" to obtain your key.\n\n4. **Store Your Key Securely**:\n - Note it down as it will only display once.\n\n5. **Enter API Key**:\n - Input your key in the OpenAI API Key field within the component setup.\n\nKeep your key safe and manage it responsibly!", "display_name": "", @@ -806,7 +776,7 @@ }, "dragging": false, "height": 325, - "id": "note-cHuhR", + "id": "note-9LNqT", "measured": { "height": 325, "width": 325 @@ -825,7 +795,7 @@ }, { "data": { - "id": "Prompt-2aw7O", + "id": "Prompt-CixsJ", "node": { "base_classes": [ "Message" @@ -963,7 +933,7 @@ }, "dragging": false, "height": 347, - "id": "Prompt-2aw7O", + "id": "Prompt-CixsJ", "measured": { "height": 347, "width": 320 @@ -982,524 +952,7 @@ }, { "data": { - "id": "OpenAIModel-uwgKb", - "node": { - "base_classes": [ - "LanguageModel", - "Message" - ], - "beta": false, - "category": "models", - "conditional_paths": [], - "custom_fields": {}, - "description": "Generates text using OpenAI LLMs.", - "display_name": "OpenAI", - "documentation": "", - "edited": false, - "field_order": [ - "input_value", - "system_message", - "stream", - "max_tokens", - "model_kwargs", - "json_mode", - "model_name", - "openai_api_base", - "api_key", - "temperature", - "seed" - ], - "frozen": false, - "icon": "OpenAI", - "key": "OpenAIModel", - "legacy": false, - "lf_version": "1.4.3", - "metadata": { - "keywords": [ - "model", - "llm", - "language model", - "large language model" - ] - }, - "minimized": false, - "output_types": [], - "outputs": [ - { - "allows_loop": false, - "cache": true, - "display_name": "Model Response", - "group_outputs": false, - "method": "text_response", - "name": "text_output", - "selected": "Message", - "tool_mode": true, - "types": [ - "Message" - ], - "value": "__UNDEFINED__" - }, - { - "allows_loop": false, - "cache": true, - "display_name": "Language Model", - "group_outputs": false, - "method": "build_model", - "name": "model_output", - "selected": "LanguageModel", - "tool_mode": true, - "types": [ - "LanguageModel" - ], - "value": "__UNDEFINED__" - } - ], - "pinned": false, - "score": 0.14285714285714285, - "template": { - "_type": "Component", - "api_key": { - "_input_type": "SecretStrInput", - "advanced": false, - "display_name": "OpenAI API Key", - "dynamic": false, - "info": "The OpenAI API Key to use for the OpenAI model.", - "input_types": [], - "load_from_db": true, - "name": "api_key", - "password": true, - "placeholder": "", - "required": true, - "show": true, - "title_case": false, - "type": "str", - "value": "OPENAI_API_KEY" - }, - "code": { - "advanced": true, - "dynamic": true, - "fileTypes": [], - "file_path": "", - "info": "", - "list": false, - "load_from_db": false, - "multiline": true, - "name": "code", - "password": false, - "placeholder": "", - "required": true, - "show": true, - "title_case": false, - "type": "code", - "value": "from typing import Any\n\nfrom langchain_openai import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import (\n OPENAI_MODEL_NAMES,\n OPENAI_REASONING_MODEL_NAMES,\n)\nfrom langflow.field_typing import LanguageModel\nfrom langflow.field_typing.range_spec import RangeSpec\nfrom langflow.inputs.inputs import BoolInput, DictInput, DropdownInput, IntInput, SecretStrInput, SliderInput, StrInput\nfrom langflow.logging import logger\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n name = \"OpenAIModel\"\n\n inputs = [\n *LCModelComponent._base_inputs,\n IntInput(\n name=\"max_tokens\",\n display_name=\"Max Tokens\",\n advanced=True,\n info=\"The maximum number of tokens to generate. Set to 0 for unlimited tokens.\",\n range_spec=RangeSpec(min=0, max=128000),\n ),\n DictInput(\n name=\"model_kwargs\",\n display_name=\"Model Kwargs\",\n advanced=True,\n info=\"Additional keyword arguments to pass to the model.\",\n ),\n BoolInput(\n name=\"json_mode\",\n display_name=\"JSON Mode\",\n advanced=True,\n info=\"If True, it will output JSON regardless of passing a schema.\",\n ),\n DropdownInput(\n name=\"model_name\",\n display_name=\"Model Name\",\n advanced=False,\n options=OPENAI_MODEL_NAMES + OPENAI_REASONING_MODEL_NAMES,\n value=OPENAI_MODEL_NAMES[1],\n combobox=True,\n real_time_refresh=True,\n ),\n StrInput(\n name=\"openai_api_base\",\n display_name=\"OpenAI API Base\",\n advanced=True,\n info=\"The base URL of the OpenAI API. \"\n \"Defaults to https://api.openai.com/v1. \"\n \"You can change this to use other APIs like JinaChat, LocalAI and Prem.\",\n ),\n SecretStrInput(\n name=\"api_key\",\n display_name=\"OpenAI API Key\",\n info=\"The OpenAI API Key to use for the OpenAI model.\",\n advanced=False,\n value=\"OPENAI_API_KEY\",\n required=True,\n ),\n SliderInput(\n name=\"temperature\",\n display_name=\"Temperature\",\n value=0.1,\n range_spec=RangeSpec(min=0, max=1, step=0.01),\n show=True,\n ),\n IntInput(\n name=\"seed\",\n display_name=\"Seed\",\n info=\"The seed controls the reproducibility of the job.\",\n advanced=True,\n value=1,\n ),\n IntInput(\n name=\"max_retries\",\n display_name=\"Max Retries\",\n info=\"The maximum number of retries to make when generating.\",\n advanced=True,\n value=5,\n ),\n IntInput(\n name=\"timeout\",\n display_name=\"Timeout\",\n info=\"The timeout for requests to OpenAI completion API.\",\n advanced=True,\n value=700,\n ),\n ]\n\n def build_model(self) -> LanguageModel: # type: ignore[type-var]\n parameters = {\n \"api_key\": SecretStr(self.api_key).get_secret_value() if self.api_key else None,\n \"model_name\": self.model_name,\n \"max_tokens\": self.max_tokens or None,\n \"model_kwargs\": self.model_kwargs or {},\n \"base_url\": self.openai_api_base or \"https://api.openai.com/v1\",\n \"seed\": self.seed,\n \"max_retries\": self.max_retries,\n \"timeout\": self.timeout,\n \"temperature\": self.temperature if self.temperature is not None else 0.1,\n }\n\n logger.info(f\"Model name: {self.model_name}\")\n if self.model_name in OPENAI_REASONING_MODEL_NAMES:\n logger.info(\"Getting reasoning model parameters\")\n parameters.pop(\"temperature\")\n parameters.pop(\"seed\")\n output = ChatOpenAI(**parameters)\n if self.json_mode:\n output = output.bind(response_format={\"type\": \"json_object\"})\n\n return output\n\n def _get_exception_message(self, e: Exception):\n \"\"\"Get a message from an OpenAI exception.\n\n Args:\n e (Exception): The exception to get the message from.\n\n Returns:\n str: The message from the exception.\n \"\"\"\n try:\n from openai import BadRequestError\n except ImportError:\n return None\n if isinstance(e, BadRequestError):\n message = e.body.get(\"message\")\n if message:\n return message\n return None\n\n def update_build_config(self, build_config: dict, field_value: Any, field_name: str | None = None) -> dict:\n if field_name in {\"base_url\", \"model_name\", \"api_key\"} and field_value in OPENAI_REASONING_MODEL_NAMES:\n build_config[\"temperature\"][\"show\"] = False\n build_config[\"seed\"][\"show\"] = False\n if field_name in {\"base_url\", \"model_name\", \"api_key\"} and field_value in OPENAI_MODEL_NAMES:\n build_config[\"temperature\"][\"show\"] = True\n build_config[\"seed\"][\"show\"] = True\n return build_config\n" - }, - "input_value": { - "_input_type": "MessageInput", - "advanced": false, - "display_name": "Input", - "dynamic": false, - "info": "", - "input_types": [ - "Message" - ], - "list": false, - "list_add_label": "Add More", - "load_from_db": false, - "name": "input_value", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "json_mode": { - "_input_type": "BoolInput", - "advanced": true, - "display_name": "JSON Mode", - "dynamic": false, - "info": "If True, it will output JSON regardless of passing a schema.", - "list": false, - "list_add_label": "Add More", - "name": "json_mode", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "bool", - "value": false - }, - "max_retries": { - "_input_type": "IntInput", - "advanced": true, - "display_name": "Max Retries", - "dynamic": false, - "info": "The maximum number of retries to make when generating.", - "list": false, - "list_add_label": "Add More", - "name": "max_retries", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "int", - "value": 5 - }, - "max_tokens": { - "_input_type": "IntInput", - "advanced": true, - "display_name": "Max Tokens", - "dynamic": false, - "info": "The maximum number of tokens to generate. Set to 0 for unlimited tokens.", - "list": false, - "list_add_label": "Add More", - "name": "max_tokens", - "placeholder": "", - "range_spec": { - "max": 128000, - "min": 0, - "step": 0.1, - "step_type": "float" - }, - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "int", - "value": "" - }, - "model_kwargs": { - "_input_type": "DictInput", - "advanced": true, - "display_name": "Model Kwargs", - "dynamic": false, - "info": "Additional keyword arguments to pass to the model.", - "list": false, - "list_add_label": "Add More", - "name": "model_kwargs", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "type": "dict", - "value": {} - }, - "model_name": { - "_input_type": "DropdownInput", - "advanced": false, - "combobox": true, - "dialog_inputs": {}, - "display_name": "Model Name", - "dynamic": false, - "info": "", - "name": "model_name", - "options": [ - "gpt-4o-mini", - "gpt-4o", - "gpt-4.1", - "gpt-4.1-mini", - "gpt-4.1-nano", - "gpt-4.5-preview", - "gpt-4-turbo", - "gpt-4-turbo-preview", - "gpt-4", - "gpt-3.5-turbo", - "o1" - ], - "options_metadata": [], - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "str", - "value": "gpt-4.1-mini" - }, - "openai_api_base": { - "_input_type": "StrInput", - "advanced": true, - "display_name": "OpenAI API Base", - "dynamic": false, - "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.", - "list": false, - "list_add_label": "Add More", - "load_from_db": false, - "name": "openai_api_base", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "seed": { - "_input_type": "IntInput", - "advanced": true, - "display_name": "Seed", - "dynamic": false, - "info": "The seed controls the reproducibility of the job.", - "list": false, - "list_add_label": "Add More", - "name": "seed", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "int", - "value": 1 - }, - "stream": { - "_input_type": "BoolInput", - "advanced": true, - "display_name": "Stream", - "dynamic": false, - "info": "Stream the response from the model. Streaming works only in Chat.", - "list": false, - "list_add_label": "Add More", - "name": "stream", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "bool", - "value": false - }, - "system_message": { - "_input_type": "MultilineInput", - "advanced": false, - "display_name": "System Message", - "dynamic": false, - "info": "System message to pass to the model.", - "input_types": [ - "Message" - ], - "list": false, - "list_add_label": "Add More", - "load_from_db": false, - "multiline": true, - "name": "system_message", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "temperature": { - "_input_type": "SliderInput", - "advanced": false, - "display_name": "Temperature", - "dynamic": false, - "info": "", - "max_label": "", - "max_label_icon": "", - "min_label": "", - "min_label_icon": "", - "name": "temperature", - "placeholder": "", - "range_spec": { - "max": 1, - "min": 0, - "step": 0.01, - "step_type": "float" - }, - "required": false, - "show": true, - "slider_buttons": false, - "slider_buttons_options": [], - "slider_input": false, - "title_case": false, - "tool_mode": false, - "type": "slider", - "value": 0.1 - }, - "timeout": { - "_input_type": "IntInput", - "advanced": true, - "display_name": "Timeout", - "dynamic": false, - "info": "The timeout for requests to OpenAI completion API.", - "list": false, - "list_add_label": "Add More", - "name": "timeout", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "int", - "value": 700 - } - }, - "tool_mode": false - }, - "selected_output": "text_output", - "showNode": true, - "type": "OpenAIModel" - }, - "dragging": false, - "id": "OpenAIModel-uwgKb", - "measured": { - "height": 539, - "width": 320 - }, - "position": { - "x": 2726.7429097065215, - "y": 460.96432586131795 - }, - "selected": false, - "type": "genericNode" - }, - { - "data": { - "id": "TypeConverterComponent-6kqHz", - "node": { - "base_classes": [ - "Message" - ], - "beta": false, - "conditional_paths": [], - "custom_fields": {}, - "description": "Convert between different types (Message, Data, DataFrame)", - "display_name": "Type Convert", - "documentation": "", - "edited": false, - "field_order": [ - "input_data", - "output_type" - ], - "frozen": false, - "icon": "repeat", - "legacy": false, - "lf_version": "1.4.3", - "metadata": {}, - "minimized": false, - "output_types": [], - "outputs": [ - { - "allows_loop": false, - "cache": true, - "display_name": "Message Output", - "group_outputs": false, - "method": "convert_to_message", - "name": "message_output", - "selected": "Message", - "tool_mode": true, - "types": [ - "Message" - ], - "value": "__UNDEFINED__" - } - ], - "pinned": false, - "template": { - "_type": "Component", - "code": { - "advanced": true, - "dynamic": true, - "fileTypes": [], - "file_path": "", - "info": "", - "list": false, - "load_from_db": false, - "multiline": true, - "name": "code", - "password": false, - "placeholder": "", - "required": true, - "show": true, - "title_case": false, - "type": "code", - "value": "from typing import Any\n\nfrom langflow.custom import Component\nfrom langflow.io import HandleInput, Output, TabInput\nfrom langflow.schema import Data, DataFrame, Message\n\n\ndef convert_to_message(v) -> Message:\n \"\"\"Convert input to Message type.\n\n Args:\n v: Input to convert (Message, Data, DataFrame, or dict)\n\n Returns:\n Message: Converted Message object\n \"\"\"\n return v if isinstance(v, Message) else v.to_message()\n\n\ndef convert_to_data(v: DataFrame | Data | Message | dict) -> Data:\n \"\"\"Convert input to Data type.\n\n Args:\n v: Input to convert (Message, Data, DataFrame, or dict)\n\n Returns:\n Data: Converted Data object\n \"\"\"\n if isinstance(v, dict):\n return Data(v)\n return v if isinstance(v, Data) else v.to_data()\n\n\ndef convert_to_dataframe(v: DataFrame | Data | Message | dict) -> DataFrame:\n \"\"\"Convert input to DataFrame type.\n\n Args:\n v: Input to convert (Message, Data, DataFrame, or dict)\n\n Returns:\n DataFrame: Converted DataFrame object\n \"\"\"\n if isinstance(v, dict):\n return DataFrame([v])\n return v if isinstance(v, DataFrame) else v.to_dataframe()\n\n\nclass TypeConverterComponent(Component):\n display_name = \"Type Convert\"\n description = \"Convert between different types (Message, Data, DataFrame)\"\n icon = \"repeat\"\n\n inputs = [\n HandleInput(\n name=\"input_data\",\n display_name=\"Input\",\n input_types=[\"Message\", \"Data\", \"DataFrame\"],\n info=\"Accept Message, Data or DataFrame as input\",\n required=True,\n ),\n TabInput(\n name=\"output_type\",\n display_name=\"Output Type\",\n options=[\"Message\", \"Data\", \"DataFrame\"],\n info=\"Select the desired output data type\",\n real_time_refresh=True,\n value=\"Message\",\n ),\n ]\n\n outputs = [\n Output(\n display_name=\"Message Output\",\n name=\"message_output\",\n method=\"convert_to_message\",\n )\n ]\n\n def update_outputs(self, frontend_node: dict, field_name: str, field_value: Any) -> dict:\n \"\"\"Dynamically show only the relevant output based on the selected output type.\"\"\"\n if field_name == \"output_type\":\n # Start with empty outputs\n frontend_node[\"outputs\"] = []\n\n # Add only the selected output type\n if field_value == \"Message\":\n frontend_node[\"outputs\"].append(\n Output(\n display_name=\"Message Output\",\n name=\"message_output\",\n method=\"convert_to_message\",\n ).to_dict()\n )\n elif field_value == \"Data\":\n frontend_node[\"outputs\"].append(\n Output(\n display_name=\"Data Output\",\n name=\"data_output\",\n method=\"convert_to_data\",\n ).to_dict()\n )\n elif field_value == \"DataFrame\":\n frontend_node[\"outputs\"].append(\n Output(\n display_name=\"DataFrame Output\",\n name=\"dataframe_output\",\n method=\"convert_to_dataframe\",\n ).to_dict()\n )\n\n return frontend_node\n\n def convert_to_message(self) -> Message:\n \"\"\"Convert input to Message type.\"\"\"\n input_value = self.input_data[0] if isinstance(self.input_data, list) else self.input_data\n\n # Handle string input by converting to Message first\n if isinstance(input_value, str):\n input_value = Message(text=input_value)\n\n result = convert_to_message(input_value)\n self.status = result\n return result\n\n def convert_to_data(self) -> Data:\n \"\"\"Convert input to Data type.\"\"\"\n input_value = self.input_data[0] if isinstance(self.input_data, list) else self.input_data\n\n # Handle string input by converting to Message first\n if isinstance(input_value, str):\n input_value = Message(text=input_value)\n\n result = convert_to_data(input_value)\n self.status = result\n return result\n\n def convert_to_dataframe(self) -> DataFrame:\n \"\"\"Convert input to DataFrame type.\"\"\"\n input_value = self.input_data[0] if isinstance(self.input_data, list) else self.input_data\n\n # Handle string input by converting to Message first\n if isinstance(input_value, str):\n input_value = Message(text=input_value)\n\n result = convert_to_dataframe(input_value)\n self.status = result\n return result\n" - }, - "input_data": { - "_input_type": "HandleInput", - "advanced": false, - "display_name": "Input", - "dynamic": false, - "info": "Accept Message, Data or DataFrame as input", - "input_types": [ - "Message", - "Data", - "DataFrame" - ], - "list": false, - "list_add_label": "Add More", - "name": "input_data", - "placeholder": "", - "required": true, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": "" - }, - "output_type": { - "_input_type": "TabInput", - "advanced": false, - "display_name": "Output Type", - "dynamic": false, - "info": "Select the desired output data type", - "name": "output_type", - "options": [ - "Message", - "Data", - "DataFrame" - ], - "placeholder": "", - "real_time_refresh": true, - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "tab", - "value": "Message" - } - }, - "tool_mode": false - }, - "selected_output": "message_output", - "showNode": true, - "type": "TypeConverterComponent" - }, - "dragging": false, - "id": "TypeConverterComponent-6kqHz", - "measured": { - "height": 262, - "width": 320 - }, - "position": { - "x": 1982.2119289336342, - "y": 949.6746561296028 - }, - "selected": false, - "type": "genericNode" - }, - { - "data": { - "id": "Memory-Esy2a", + "id": "Memory-hMFmY", "node": { "base_classes": [ "DataFrame" @@ -1553,7 +1006,6 @@ "group_outputs": false, "method": "retrieve_messages_dataframe", "name": "dataframe", - "selected": "DataFrame", "tool_mode": true, "types": [ "DataFrame" @@ -1813,12 +1265,12 @@ }, "tool_mode": false }, - "selected_output": "dataframe", + "selected_output": "messages_text", "showNode": true, "type": "Memory" }, "dragging": false, - "id": "Memory-Esy2a", + "id": "Memory-hMFmY", "measured": { "height": 217, "width": 320 @@ -1829,17 +1281,310 @@ }, "selected": false, "type": "genericNode" + }, + { + "data": { + "id": "LanguageModelComponent-vvfAj", + "node": { + "base_classes": [ + "LanguageModel", + "Message" + ], + "beta": false, + "conditional_paths": [], + "custom_fields": {}, + "description": "Runs a language model given a specified provider. ", + "display_name": "Language Model", + "documentation": "", + "edited": false, + "field_order": [ + "provider", + "model_name", + "api_key", + "input_value", + "system_message", + "stream", + "temperature" + ], + "frozen": false, + "icon": "brain-circuit", + "legacy": false, + "lf_version": "1.4.3", + "metadata": { + "keywords": [ + "model", + "llm", + "language model", + "large language model" + ] + }, + "minimized": false, + "output_types": [], + "outputs": [ + { + "allows_loop": false, + "cache": true, + "display_name": "Model Response", + "group_outputs": false, + "method": "text_response", + "name": "text_output", + "options": null, + "required_inputs": null, + "selected": "Message", + "tool_mode": true, + "types": [ + "Message" + ], + "value": "__UNDEFINED__" + }, + { + "allows_loop": false, + "cache": true, + "display_name": "Language Model", + "group_outputs": false, + "method": "build_model", + "name": "model_output", + "options": null, + "required_inputs": null, + "selected": "LanguageModel", + "tool_mode": true, + "types": [ + "LanguageModel" + ], + "value": "__UNDEFINED__" + } + ], + "pinned": false, + "priority": 0, + "template": { + "_type": "Component", + "api_key": { + "_input_type": "SecretStrInput", + "advanced": false, + "display_name": "OpenAI API Key", + "dynamic": false, + "info": "Model Provider API key", + "input_types": [], + "load_from_db": true, + "name": "api_key", + "password": true, + "placeholder": "", + "real_time_refresh": true, + "required": false, + "show": true, + "title_case": false, + "type": "str", + "value": "OPENAI_API_KEY" + }, + "code": { + "advanced": true, + "dynamic": true, + "fileTypes": [], + "file_path": "", + "info": "", + "list": false, + "load_from_db": false, + "multiline": true, + "name": "code", + "password": false, + "placeholder": "", + "required": true, + "show": true, + "title_case": false, + "type": "code", + "value": "from typing import Any\n\nfrom langchain_anthropic import ChatAnthropic\nfrom langchain_google_genai import ChatGoogleGenerativeAI\nfrom langchain_openai import ChatOpenAI\n\nfrom langflow.base.models.anthropic_constants import ANTHROPIC_MODELS\nfrom langflow.base.models.google_generative_ai_constants import GOOGLE_GENERATIVE_AI_MODELS\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.base.models.openai_constants import OPENAI_MODEL_NAMES\nfrom langflow.field_typing import LanguageModel\nfrom langflow.field_typing.range_spec import RangeSpec\nfrom langflow.inputs.inputs import BoolInput\nfrom langflow.io import DropdownInput, MessageInput, MultilineInput, SecretStrInput, SliderInput\nfrom langflow.schema.dotdict import dotdict\n\n\nclass LanguageModelComponent(LCModelComponent):\n display_name = \"Language Model\"\n description = \"Runs a language model given a specified provider. \"\n icon = \"brain-circuit\"\n category = \"models\"\n priority = 0 # Set priority to 0 to make it appear first\n\n inputs = [\n DropdownInput(\n name=\"provider\",\n display_name=\"Model Provider\",\n options=[\"OpenAI\", \"Anthropic\", \"Google\"],\n value=\"OpenAI\",\n info=\"Select the model provider\",\n real_time_refresh=True,\n options_metadata=[{\"icon\": \"OpenAI\"}, {\"icon\": \"Anthropic\"}, {\"icon\": \"GoogleGenerativeAI\"}],\n ),\n DropdownInput(\n name=\"model_name\",\n display_name=\"Model Name\",\n options=OPENAI_MODEL_NAMES,\n value=OPENAI_MODEL_NAMES[0],\n info=\"Select the model to use\",\n ),\n SecretStrInput(\n name=\"api_key\",\n display_name=\"OpenAI API Key\",\n info=\"Model Provider API key\",\n required=False,\n show=True,\n real_time_refresh=True,\n ),\n MessageInput(\n name=\"input_value\",\n display_name=\"Input\",\n info=\"The input text to send to the model\",\n ),\n MultilineInput(\n name=\"system_message\",\n display_name=\"System Message\",\n info=\"A system message that helps set the behavior of the assistant\",\n advanced=True,\n ),\n BoolInput(\n name=\"stream\",\n display_name=\"Stream\",\n info=\"Whether to stream the response\",\n value=False,\n advanced=True,\n ),\n SliderInput(\n name=\"temperature\",\n display_name=\"Temperature\",\n value=0.1,\n info=\"Controls randomness in responses\",\n range_spec=RangeSpec(min=0, max=1, step=0.01),\n advanced=True,\n ),\n ]\n\n def build_model(self) -> LanguageModel:\n provider = self.provider\n model_name = self.model_name\n temperature = self.temperature\n stream = self.stream\n\n if provider == \"OpenAI\":\n if not self.api_key:\n msg = \"OpenAI API key is required when using OpenAI provider\"\n raise ValueError(msg)\n return ChatOpenAI(\n model_name=model_name,\n temperature=temperature,\n streaming=stream,\n openai_api_key=self.api_key,\n )\n if provider == \"Anthropic\":\n if not self.api_key:\n msg = \"Anthropic API key is required when using Anthropic provider\"\n raise ValueError(msg)\n return ChatAnthropic(\n model=model_name,\n temperature=temperature,\n streaming=stream,\n anthropic_api_key=self.api_key,\n )\n if provider == \"Google\":\n if not self.api_key:\n msg = \"Google API key is required when using Google provider\"\n raise ValueError(msg)\n return ChatGoogleGenerativeAI(\n model=model_name,\n temperature=temperature,\n streaming=stream,\n google_api_key=self.api_key,\n )\n msg = f\"Unknown provider: {provider}\"\n raise ValueError(msg)\n\n def update_build_config(self, build_config: dotdict, field_value: Any, field_name: str | None = None) -> dotdict:\n if field_name == \"provider\":\n if field_value == \"OpenAI\":\n build_config[\"model_name\"][\"options\"] = OPENAI_MODEL_NAMES\n build_config[\"model_name\"][\"value\"] = OPENAI_MODEL_NAMES[0]\n build_config[\"api_key\"][\"display_name\"] = \"OpenAI API Key\"\n elif field_value == \"Anthropic\":\n build_config[\"model_name\"][\"options\"] = ANTHROPIC_MODELS\n build_config[\"model_name\"][\"value\"] = ANTHROPIC_MODELS[0]\n build_config[\"api_key\"][\"display_name\"] = \"Anthropic API Key\"\n elif field_value == \"Google\":\n build_config[\"model_name\"][\"options\"] = GOOGLE_GENERATIVE_AI_MODELS\n build_config[\"model_name\"][\"value\"] = GOOGLE_GENERATIVE_AI_MODELS[0]\n build_config[\"api_key\"][\"display_name\"] = \"Google API Key\"\n return build_config\n" + }, + "input_value": { + "_input_type": "MessageInput", + "advanced": false, + "display_name": "Input", + "dynamic": false, + "info": "The input text to send to the model", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "input_value", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "" + }, + "model_name": { + "_input_type": "DropdownInput", + "advanced": false, + "combobox": false, + "dialog_inputs": {}, + "display_name": "Model Name", + "dynamic": false, + "info": "Select the model to use", + "name": "model_name", + "options": [ + "gpt-4o-mini", + "gpt-4o", + "gpt-4.1", + "gpt-4.1-mini", + "gpt-4.1-nano", + "gpt-4.5-preview", + "gpt-4-turbo", + "gpt-4-turbo-preview", + "gpt-4", + "gpt-3.5-turbo" + ], + "options_metadata": [], + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "toggle": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "str", + "value": "gpt-4o-mini" + }, + "provider": { + "_input_type": "DropdownInput", + "advanced": false, + "combobox": false, + "dialog_inputs": {}, + "display_name": "Model Provider", + "dynamic": false, + "info": "Select the model provider", + "name": "provider", + "options": [ + "OpenAI", + "Anthropic", + "Google" + ], + "options_metadata": [ + { + "icon": "OpenAI" + }, + { + "icon": "Anthropic" + }, + { + "icon": "GoogleGenerativeAI" + } + ], + "placeholder": "", + "real_time_refresh": true, + "required": false, + "show": true, + "title_case": false, + "toggle": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "str", + "value": "OpenAI" + }, + "stream": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Stream", + "dynamic": false, + "info": "Whether to stream the response", + "list": false, + "list_add_label": "Add More", + "name": "stream", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "bool", + "value": false + }, + "system_message": { + "_input_type": "MultilineInput", + "advanced": false, + "copy_field": false, + "display_name": "System Message", + "dynamic": false, + "info": "A system message that helps set the behavior of the assistant", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "multiline": true, + "name": "system_message", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "" + }, + "temperature": { + "_input_type": "SliderInput", + "advanced": true, + "display_name": "Temperature", + "dynamic": false, + "info": "Controls randomness in responses", + "max_label": "", + "max_label_icon": "", + "min_label": "", + "min_label_icon": "", + "name": "temperature", + "placeholder": "", + "range_spec": { + "max": 1, + "min": 0, + "step": 0.01, + "step_type": "float" + }, + "required": false, + "show": true, + "slider_buttons": false, + "slider_buttons_options": [], + "slider_input": false, + "title_case": false, + "tool_mode": false, + "type": "slider", + "value": 0.1 + } + }, + "tool_mode": false + }, + "showNode": true, + "type": "LanguageModelComponent" + }, + "dragging": false, + "id": "LanguageModelComponent-vvfAj", + "measured": { + "height": 532, + "width": 320 + }, + "position": { + "x": 2726.7653522717746, + "y": 453.1927474431865 + }, + "selected": false, + "type": "genericNode" } ], "viewport": { - "x": -844.2279175744859, - "y": -37.56256528430163, - "zoom": 0.6546453758419618 + "x": -973.6452349689689, + "y": -40.91532970722892, + "zoom": 0.675028833498803 } }, "description": "Create a chatbot that saves and references previous messages, enabling the model to maintain context throughout the conversation.", "endpoint_name": null, - "id": "c4833c20-c17f-40e2-88d9-34dfed9f1fc2", + "id": "0c265260-8489-4304-bd4e-1a672a8441ab", "is_component": false, "last_tested_version": "1.4.3", "name": "Memory Chatbot", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json b/src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json index b6be65be3..31530b028 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json @@ -1394,30 +1394,18 @@ "Custom" ], "options_metadata": [ - { - "icon": "Amazon" - }, { "icon": "Anthropic" }, - { - "icon": "Azure" - }, { "icon": "GoogleGenerativeAI" }, { "icon": "Groq" }, - { - "icon": "NVIDIA" - }, { "icon": "OpenAI" }, - { - "icon": "SambaNova" - }, { "icon": "brain" } diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Price Deal Finder.json b/src/backend/base/langflow/initial_setup/starter_projects/Price Deal Finder.json index 43865e247..47ec12207 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Price Deal Finder.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Price Deal Finder.json @@ -2,12 +2,11 @@ "data": { "edges": [ { - "animated": false, "className": "", "data": { "sourceHandle": { "dataType": "AgentQL", - "id": "AgentQL-reBlu", + "id": "AgentQL-fgRow", "name": "component_as_tool", "output_types": [ "Tool" @@ -15,27 +14,77 @@ }, "targetHandle": { "fieldName": "tools", - "id": "Agent-oRYZX", + "id": "Agent-ghqeP", "inputTypes": [ "Tool" ], "type": "other" } }, - "id": "reactflow__edge-AgentQL-reBlu{œdataTypeœ:œAgentQLœ,œidœ:œAgentQL-reBluœ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-oRYZX{œfieldNameœ:œtoolsœ,œidœ:œAgent-oRYZXœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", - "selected": false, - "source": "AgentQL-reBlu", - "sourceHandle": "{œdataTypeœ: œAgentQLœ, œidœ: œAgentQL-reBluœ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", - "target": "Agent-oRYZX", - "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-oRYZXœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" + "id": "xy-edge__AgentQL-fgRow{œdataTypeœ:œAgentQLœ,œidœ:œAgentQL-fgRowœ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-ghqeP{œfieldNameœ:œtoolsœ,œidœ:œAgent-ghqePœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "source": "AgentQL-fgRow", + "sourceHandle": "{œdataTypeœ: œAgentQLœ, œidœ: œAgentQL-fgRowœ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", + "target": "Agent-ghqeP", + "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-ghqePœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" + }, + { + "className": "", + "data": { + "sourceHandle": { + "dataType": "TavilySearchComponent", + "id": "TavilySearchComponent-L8PP0", + "name": "component_as_tool", + "output_types": [ + "Tool" + ] + }, + "targetHandle": { + "fieldName": "tools", + "id": "Agent-ghqeP", + "inputTypes": [ + "Tool" + ], + "type": "other" + } + }, + "id": "xy-edge__TavilySearchComponent-L8PP0{œdataTypeœ:œTavilySearchComponentœ,œidœ:œTavilySearchComponent-L8PP0œ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-ghqeP{œfieldNameœ:œtoolsœ,œidœ:œAgent-ghqePœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "source": "TavilySearchComponent-L8PP0", + "sourceHandle": "{œdataTypeœ: œTavilySearchComponentœ, œidœ: œTavilySearchComponent-L8PP0œ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", + "target": "Agent-ghqeP", + "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-ghqePœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" + }, + { + "className": "", + "data": { + "sourceHandle": { + "dataType": "ChatInput", + "id": "ChatInput-IrBdK", + "name": "message", + "output_types": [ + "Message" + ] + }, + "targetHandle": { + "fieldName": "input_value", + "id": "Agent-ghqeP", + "inputTypes": [ + "Message" + ], + "type": "str" + } + }, + "id": "xy-edge__ChatInput-IrBdK{œdataTypeœ:œChatInputœ,œidœ:œChatInput-IrBdKœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-Agent-ghqeP{œfieldNameœ:œinput_valueœ,œidœ:œAgent-ghqePœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "ChatInput-IrBdK", + "sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-IrBdKœ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}", + "target": "Agent-ghqeP", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œAgent-ghqePœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { - "animated": false, "className": "", "data": { "sourceHandle": { "dataType": "Agent", - "id": "Agent-oRYZX", + "id": "Agent-ghqeP", "name": "response", "output_types": [ "Message" @@ -43,7 +92,7 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "ChatOutput-hdvqT", + "id": "ChatOutput-jwko6", "inputTypes": [ "Data", "DataFrame", @@ -52,74 +101,17 @@ "type": "str" } }, - "id": "reactflow__edge-Agent-oRYZX{œdataTypeœ:œAgentœ,œidœ:œAgent-oRYZXœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-hdvqT{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-hdvqTœ,œinputTypesœ:[œDataœ,œDataFrameœ,œMessageœ],œtypeœ:œstrœ}", - "selected": false, - "source": "Agent-oRYZX", - "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-oRYZXœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", - "target": "ChatOutput-hdvqT", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-hdvqTœ, œinputTypesœ: [œDataœ, œDataFrameœ, œMessageœ], œtypeœ: œstrœ}" - }, - { - "animated": false, - "className": "", - "data": { - "sourceHandle": { - "dataType": "TavilySearchComponent", - "id": "TavilySearchComponent-STQC5", - "name": "component_as_tool", - "output_types": [ - "Tool" - ] - }, - "targetHandle": { - "fieldName": "tools", - "id": "Agent-oRYZX", - "inputTypes": [ - "Tool" - ], - "type": "other" - } - }, - "id": "reactflow__edge-TavilySearchComponent-STQC5{œdataTypeœ:œTavilySearchComponentœ,œidœ:œTavilySearchComponent-STQC5œ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-oRYZX{œfieldNameœ:œtoolsœ,œidœ:œAgent-oRYZXœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", - "selected": false, - "source": "TavilySearchComponent-STQC5", - "sourceHandle": "{œdataTypeœ: œTavilySearchComponentœ, œidœ: œTavilySearchComponent-STQC5œ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", - "target": "Agent-oRYZX", - "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-oRYZXœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" - }, - { - "animated": false, - "className": "", - "data": { - "sourceHandle": { - "dataType": "ChatInput", - "id": "ChatInput-DwzkZ", - "name": "message", - "output_types": [ - "Message" - ] - }, - "targetHandle": { - "fieldName": "input_value", - "id": "Agent-oRYZX", - "inputTypes": [ - "Message" - ], - "type": "str" - } - }, - "id": "reactflow__edge-ChatInput-DwzkZ{œdataTypeœ:œChatInputœ,œidœ:œChatInput-DwzkZœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-Agent-oRYZX{œfieldNameœ:œinput_valueœ,œidœ:œAgent-oRYZXœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "selected": false, - "source": "ChatInput-DwzkZ", - "sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-DwzkZœ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}", - "target": "Agent-oRYZX", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œAgent-oRYZXœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "xy-edge__Agent-ghqeP{œdataTypeœ:œAgentœ,œidœ:œAgent-ghqePœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-jwko6{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-jwko6œ,œinputTypesœ:[œDataœ,œDataFrameœ,œMessageœ],œtypeœ:œstrœ}", + "source": "Agent-ghqeP", + "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-ghqePœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", + "target": "ChatOutput-jwko6", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-jwko6œ, œinputTypesœ: [œDataœ, œDataFrameœ, œMessageœ], œtypeœ: œstrœ}" } ], "nodes": [ { "data": { - "id": "ChatInput-DwzkZ", + "id": "ChatInput-IrBdK", "node": { "base_classes": [ "Message" @@ -418,9 +410,9 @@ "type": "ChatInput" }, "dragging": false, - "id": "ChatInput-DwzkZ", + "id": "ChatInput-IrBdK", "measured": { - "height": 66, + "height": 48, "width": 192 }, "position": { @@ -432,7 +424,7 @@ }, { "data": { - "id": "ChatOutput-hdvqT", + "id": "ChatOutput-jwko6", "node": { "base_classes": [ "Message" @@ -731,9 +723,9 @@ "type": "ChatOutput" }, "dragging": false, - "id": "ChatOutput-hdvqT", + "id": "ChatOutput-jwko6", "measured": { - "height": 66, + "height": 48, "width": 192 }, "position": { @@ -745,7 +737,7 @@ }, { "data": { - "id": "TavilySearchComponent-STQC5", + "id": "TavilySearchComponent-L8PP0", "node": { "base_classes": [ "Data", @@ -780,9 +772,11 @@ "allows_loop": false, "cache": true, "display_name": "Toolset", + "group_outputs": false, "hidden": null, "method": "to_toolkit", "name": "component_as_tool", + "options": null, "required_inputs": null, "selected": "Tool", "tool_mode": true, @@ -1055,11 +1049,11 @@ "type": "str" }, "tools_metadata": { - "_input_type": "TableInput", + "_input_type": "ToolsInput", "advanced": false, - "display_name": "Edit tools", + "display_name": "Actions", "dynamic": false, - "info": "", + "info": "Modify tool names and descriptions to help agents understand when to use each tool.", "is_list": true, "list_add_label": "Add More", "name": "tools_metadata", @@ -1067,87 +1061,28 @@ "real_time_refresh": true, "required": false, "show": true, - "table_icon": "Hammer", - "table_options": { - "block_add": true, - "block_delete": true, - "block_edit": true, - "block_filter": true, - "block_hide": true, - "block_select": true, - "block_sort": true, - "description": "Modify tool names and descriptions to help agents understand when to use each tool.", - "field_parsers": { - "commands": "commands", - "name": [ - "snake_case", - "no_blank" - ] - }, - "hide_options": true - }, - "table_schema": { - "columns": [ - { - "default": "None", - "description": "Specify the name of the tool.", - "disable_edit": false, - "display_name": "Tool Name", - "edit_mode": "inline", - "filterable": false, - "formatter": "text", - "hidden": false, - "name": "name", - "sortable": false, - "type": "str" - }, - { - "default": "None", - "description": "Describe the purpose of the tool.", - "disable_edit": false, - "display_name": "Tool Description", - "edit_mode": "popover", - "filterable": false, - "formatter": "text", - "hidden": false, - "name": "description", - "sortable": false, - "type": "str" - }, - { - "default": "None", - "description": "The default identifiers for the tools and cannot be changed.", - "disable_edit": true, - "display_name": "Tool Identifiers", - "edit_mode": "inline", - "filterable": false, - "formatter": "text", - "hidden": true, - "name": "tags", - "sortable": false, - "type": "str" - } - ] - }, "title_case": false, "tool_mode": false, "trace_as_metadata": true, - "trigger_icon": "Hammer", - "trigger_text": "", - "type": "table", + "type": "tools", "value": [ { - "description": "fetch_content(api_key: Message) - **Tavily AI** is a search engine optimized for LLMs and RAG, aimed at efficient, quick, and persistent search results.", - "name": "TavilySearchComponent-fetch_content", + "args": { + "query": { + "default": "", + "description": "The search query you want to execute with Tavily.", + "title": "Query", + "type": "string" + } + }, + "description": "**Tavily Search** is a search engine optimized for LLMs and RAG, aimed at efficient, quick, and persistent search results.", + "display_description": "**Tavily Search** is a search engine optimized for LLMs and RAG, aimed at efficient, quick, and persistent search results.", + "display_name": "fetch_content_dataframe", + "name": "fetch_content_dataframe", + "readonly": false, + "status": true, "tags": [ - "TavilySearchComponent-fetch_content" - ] - }, - { - "description": "fetch_content_text(api_key: Message) - **Tavily AI** is a search engine optimized for LLMs and RAG, aimed at efficient, quick, and persistent search results.", - "name": "TavilySearchComponent-fetch_content_text", - "tags": [ - "TavilySearchComponent-fetch_content_text" + "fetch_content_dataframe" ] } ] @@ -1183,9 +1118,9 @@ "type": "TavilySearchComponent" }, "dragging": false, - "id": "TavilySearchComponent-STQC5", + "id": "TavilySearchComponent-L8PP0", "measured": { - "height": 437, + "height": 316, "width": 320 }, "position": { @@ -1199,7 +1134,7 @@ "data": { "description": "Uses AgentQL API to extract structured data from a given URL.", "display_name": "AgentQL Query Data", - "id": "AgentQL-reBlu", + "id": "AgentQL-fgRow", "node": { "base_classes": [ "Data" @@ -1235,6 +1170,7 @@ "allows_loop": false, "cache": true, "display_name": "Toolset", + "group_outputs": false, "hidden": null, "method": "to_toolkit", "name": "component_as_tool", @@ -1432,11 +1368,11 @@ "value": 900 }, "tools_metadata": { - "_input_type": "TableInput", + "_input_type": "ToolsInput", "advanced": false, - "display_name": "Edit tools", + "display_name": "Actions", "dynamic": false, - "info": "", + "info": "Modify tool names and descriptions to help agents understand when to use each tool.", "is_list": true, "list_add_label": "Add More", "name": "tools_metadata", @@ -1444,94 +1380,39 @@ "real_time_refresh": true, "required": false, "show": true, - "table_icon": "Hammer", - "table_options": { - "block_add": true, - "block_delete": true, - "block_edit": true, - "block_filter": true, - "block_hide": true, - "block_select": true, - "block_sort": true, - "description": "Modify tool names and descriptions to help agents understand when to use each tool.", - "field_parsers": { - "commands": "commands", - "name": [ - "snake_case", - "no_blank" - ] - }, - "hide_options": true - }, - "table_schema": { - "columns": [ - { - "default": "None", - "description": "Specify the name of the tool.", - "disable_edit": false, - "display_name": "Tool Name", - "edit_mode": "inline", - "filterable": false, - "formatter": "text", - "hidden": false, - "name": "name", - "sortable": false, - "type": "str" - }, - { - "default": "None", - "description": "Describe the purpose of the tool.", - "disable_edit": false, - "display_name": "Tool Description", - "edit_mode": "popover", - "filterable": false, - "formatter": "text", - "hidden": false, - "name": "description", - "sortable": false, - "type": "str" - }, - { - "default": "None", - "description": "The default identifiers for the tools and cannot be changed.", - "disable_edit": true, - "display_name": "Tool Identifiers", - "edit_mode": "inline", - "filterable": false, - "formatter": "text", - "hidden": true, - "name": "tags", - "sortable": false, - "type": "str" - }, - { - "default": true, - "description": "Indicates whether the tool is currently active. Set to True to activate this tool.", - "disable_edit": false, - "display_name": "Enable", - "edit_mode": "popover", - "filterable": true, - "formatter": "boolean", - "hidden": false, - "name": "status", - "sortable": true, - "type": "boolean" - } - ] - }, "title_case": false, "tool_mode": false, "trace_as_metadata": true, - "trigger_icon": "Hammer", - "trigger_text": "", - "type": "table", + "type": "tools", "value": [ { - "description": "build_output(api_key: Message, url: Message) - Extracts structured data from a web page using an AgentQL query or a Natural Language description.", - "name": "AgentQL-build_output", + "args": { + "prompt": { + "default": "", + "description": "A Natural Language description of the data to extract from the page. Alternative to AgentQL query.", + "title": "Prompt", + "type": "string" + }, + "query": { + "default": "", + "description": "The AgentQL query to execute. Learn more at https://docs.agentql.com/agentql-query or use a prompt.", + "title": "Query", + "type": "string" + }, + "url": { + "description": "The URL of the public web page you want to extract data from.", + "title": "Url", + "type": "string" + } + }, + "description": "Extracts structured data from a web page using an AgentQL query or a Natural Language description.", + "display_description": "Extracts structured data from a web page using an AgentQL query or a Natural Language description.", + "display_name": "build_output", + "name": "build_output", + "readonly": false, "status": true, "tags": [ - "AgentQL-build_output" + "build_output" ] } ] @@ -1591,9 +1472,9 @@ "type": "AgentQL" }, "dragging": false, - "id": "AgentQL-reBlu", + "id": "AgentQL-fgRow", "measured": { - "height": 644, + "height": 316, "width": 320 }, "position": { @@ -1605,12 +1486,122 @@ }, { "data": { - "id": "Agent-oRYZX", + "id": "note-uI2ji", + "node": { + "description": "### 💡 Add your OpenAI API key here", + "display_name": "", + "documentation": "", + "template": { + "backgroundColor": "transparent" + } + }, + "type": "note" + }, + "dragging": false, + "id": "note-uI2ji", + "measured": { + "height": 324, + "width": 324 + }, + "position": { + "x": 798.1532899902708, + "y": 48.63976452163034 + }, + "selected": false, + "type": "noteNode" + }, + { + "data": { + "id": "note-K7Df4", + "node": { + "description": "### 💡 Add your AgentQL API key here", + "display_name": "", + "documentation": "", + "template": { + "backgroundColor": "transparent" + } + }, + "type": "note" + }, + "dragging": false, + "height": 346, + "id": "note-K7Df4", + "measured": { + "height": 346, + "width": 324 + }, + "position": { + "x": 416.2302078823729, + "y": 51.23403819068896 + }, + "selected": false, + "type": "noteNode" + }, + { + "data": { + "id": "note-A4MCV", + "node": { + "description": "# Price Deal Finder \n\nThis flow searches and compares prices of a product on the web.\n## Prerequisites\n\n* **[AgentQL API Key](https://dev.agentql.com/api-keys)**\n* **[OpenAI API Key](https://platform.openai.com/)**\n* **[TavilyAI Search API Key](https://tavily.com/)**\n\n## Quick Start\n\n1. Add your [AgentQL API Key](https://dev.agentql.com/api-keys) to the **AgentQL** component.\n2. Add your [OpenAI API Key](https://platform.openai.com/) to the **Agent** component.\n3. Add your [TavilyAI Search API Key](https://tavily.com/) to the **Tavily AI Search** component.\n4. Click **Playground** and enter a product in chat. For example, search \"iPhone 16 Pro 512 GB\")\n* The **Agent** component populates the **Tavily AI Search** component's **Search Query** field, and the **Agent QL** component's **URL** and **Query** fields. \n\n* The **Agent** returns a structured response to your searcn in the chat.", + "display_name": "", + "documentation": "", + "template": {} + }, + "type": "note" + }, + "dragging": false, + "height": 674, + "id": "note-A4MCV", + "measured": { + "height": 674, + "width": 466 + }, + "position": { + "x": -472.5459222813072, + "y": 102.70113417861305 + }, + "resizing": false, + "selected": false, + "type": "noteNode", + "width": 466 + }, + { + "data": { + "id": "note-AH0tj", + "node": { + "description": "### 💡 Add your Tavily AI Search key here", + "display_name": "", + "documentation": "", + "template": { + "backgroundColor": "transparent" + } + }, + "type": "note" + }, + "dragging": false, + "height": 324, + "id": "note-AH0tj", + "measured": { + "height": 324, + "width": 345 + }, + "position": { + "x": 25.144734571805117, + "y": 126.6122587862217 + }, + "resizing": false, + "selected": false, + "type": "noteNode", + "width": 345 + }, + { + "data": { + "id": "Agent-ghqeP", "node": { "base_classes": [ "Message" ], "beta": false, + "category": "agents", "conditional_paths": [], "custom_fields": {}, "description": "Define the agent's instructions, then enter a task to complete using tools.", @@ -1636,7 +1627,10 @@ "verbose", "max_iterations", "agent_description", + "mode", + "message", "memory", + "sender_type", "sender", "sender_name", "n_messages", @@ -1647,8 +1641,8 @@ ], "frozen": false, "icon": "bot", + "key": "Agent", "legacy": false, - "lf_version": "1.3.2", "metadata": {}, "minimized": false, "output_types": [], @@ -1660,6 +1654,8 @@ "group_outputs": false, "method": "message_response", "name": "response", + "options": null, + "required_inputs": null, "selected": "Message", "tool_mode": true, "types": [ @@ -1669,6 +1665,7 @@ } ], "pinned": false, + "score": 5.283996070936036e-7, "template": { "_type": "Component", "add_current_date_tool": { @@ -1692,6 +1689,7 @@ "agent_description": { "_input_type": "MultilineInput", "advanced": true, + "copy_field": false, "display_name": "Agent Description [Deprecated]", "dynamic": false, "info": "The description of the agent. This is only used when in Tool Mode. Defaults to 'A helpful assistant with access to the following tools:' and tools are added dynamically. This feature is deprecated and will be removed in future versions.", @@ -1730,12 +1728,29 @@ "OpenAI", "Custom" ], - "options_metadata": [], + "options_metadata": [ + { + "icon": "Anthropic" + }, + { + "icon": "GoogleGenerativeAI" + }, + { + "icon": "Groq" + }, + { + "icon": "OpenAI" + }, + { + "icon": "brain" + } + ], "placeholder": "", "real_time_refresh": true, "required": false, "show": true, "title_case": false, + "toggle": false, "tool_mode": false, "trace_as_metadata": true, "type": "str", @@ -1752,6 +1767,7 @@ "name": "api_key", "password": true, "placeholder": "", + "real_time_refresh": true, "required": true, "show": true, "title_case": false, @@ -1919,7 +1935,7 @@ "_input_type": "MessageTextInput", "advanced": true, "display_name": "Message", - "dynamic": false, + "dynamic": true, "info": "The chat message to be stored.", "input_types": [ "Message" @@ -1930,7 +1946,7 @@ "name": "message", "placeholder": "", "required": false, - "show": true, + "show": false, "title_case": false, "tool_mode": true, "trace_as_input": true, @@ -1957,7 +1973,7 @@ "tool_mode": false, "trace_as_metadata": true, "type": "tab", - "value": "Store" + "value": "Retrieve" }, "model_kwargs": { "_input_type": "DictInput", @@ -2005,10 +2021,11 @@ "required": false, "show": true, "title_case": false, + "toggle": false, "tool_mode": false, "trace_as_metadata": true, "type": "str", - "value": "gpt-4.1-mini" + "value": "gpt-4o" }, "n_messages": { "_input_type": "IntInput", @@ -2021,7 +2038,7 @@ "name": "n_messages", "placeholder": "", "required": false, - "show": true, + "show": false, "title_case": false, "tool_mode": false, "trace_as_metadata": true, @@ -2065,6 +2082,7 @@ "required": true, "show": true, "title_case": false, + "toggle": false, "tool_mode": true, "trace_as_metadata": true, "type": "str", @@ -2089,28 +2107,27 @@ "value": 1 }, "sender": { - "_input_type": "DropdownInput", + "_input_type": "MessageTextInput", "advanced": true, - "combobox": false, - "dialog_inputs": {}, "display_name": "Sender", "dynamic": false, "info": "The sender of the message. Might be Machine or User. If empty, the current sender parameter will be used.", - "name": "sender", - "options": [ - "Machine", - "User", - "Machine and User" + "input_types": [ + "Message" ], - "options_metadata": [], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "sender", "placeholder": "", "required": false, "show": true, "title_case": false, "tool_mode": false, + "trace_as_input": true, "trace_as_metadata": true, "type": "str", - "value": "Machine and User" + "value": "" }, "sender_name": { "_input_type": "MessageTextInput", @@ -2127,7 +2144,7 @@ "name": "sender_name", "placeholder": "", "required": false, - "show": true, + "show": false, "title_case": false, "tool_mode": false, "trace_as_input": true, @@ -2186,6 +2203,7 @@ "system_prompt": { "_input_type": "MultilineInput", "advanced": false, + "copy_field": false, "display_name": "Agent Instructions", "dynamic": false, "info": "System Prompt: Initial instructions and context provided to guide the agent's behavior.", @@ -2205,7 +2223,7 @@ "trace_as_input": true, "trace_as_metadata": true, "type": "str", - "value": "You are an deal finder assistant that helps find and compare the prices of products across different e-commerce platforms. You must use the Tavily Search API to find the URLs of the ecommerce platforms that sell these products. Then use the AgentQL tool to extract the prices of the product in those websites. Make sure to include the name of the product, the price of the product, the shop name, and the URL link of the page to where you can add the product to a cart or checkout immediately. The price and URL link has to be retrieved, so if it's not available or doesn't work don't include it.\n\nHere's how to write an AgentQL query:\n\nThe AgentQL query serves as the building block of your script. This guide shows you how AgentQL's query structure works and how to write a valid query.\n\n### Single term query\n\nA **single term query** enables you to retrieve a single element on the webpage. Here is an example of how you can write a single term query to retrieve a search box.\n\n```AgentQL\n{\n search_box\n}\n```\n\n### List term query\n\nA **list term query** enables you to retrieve a list of similar elements on the webpage. Here is an example of how you can write a list term query to retrieve a list of prices of apples.\n\n```AgentQL\n{\n apple_price[]\n}\n```\n\nYou can also specify the exact field you want to return in the list. Here is an example of how you can specify that you want the name and price from the list of products.\n\n```AgentQL\n{\n products[] {\n name\n price(integer)\n }\n}\n```\n\n### Combining single term queries and list term queries\n\nYou can query for both **single terms** and **list terms** by combining the preceding formats.\n\n```AgentQL\n{\n author\n date_of_birth\n book_titles[]\n}\n```\n\n### Giving context to queries\n\nThere two main ways you can provide additional context to your queries.\n\n#### Structural context\n\nYou can nest queries within parent containers to indicate that your target web element is in a particular section of the webpage.\n\n```AgentQL\n{\n footer {\n social_media_links[]\n }\n}\n```\n\n#### Semantic context\n\nYou can also provide a short description within parentheses to guide AgentQL in locating the right element(s).\n\n```AgentQL\n{\n footer {\n social_media_links(The icons that lead to Facebook, Snapchat, etc.)[]\n }\n}\n```\n\n### Syntax guidelines\n\nEnclose all AgentQL query terms within curly braces `{}`. The following query structure isn't valid because the term \"social_media_links\" is wrongly enclosed within parenthesis`()`.\n\n```AgentQL\n( # Should be {\n social_media_links(The icons that lead to Facebook, Snapchat, etc.)[]\n) # Should be }\n```\n\nYou can't include new lines in your semantic context. The following query structure isn't valid because the semantic context isn't contained within one line.\n\n```AgentQL\n{\n social_media_links(The icons that lead\n to Facebook, Snapchat, etc.)[]\n}\n```" + "value": "You are a helpful assistant that can use tools to answer questions and perform tasks." }, "temperature": { "_input_type": "SliderInput", @@ -2238,6 +2256,7 @@ "template": { "_input_type": "MultilineInput", "advanced": true, + "copy_field": false, "display_name": "Template", "dynamic": false, "info": "The template to use for formatting the data. It can contain the keys {text}, {sender} or any other key in the message data.", @@ -2251,7 +2270,7 @@ "name": "template", "placeholder": "", "required": false, - "show": true, + "show": false, "title_case": false, "tool_mode": false, "trace_as_input": true, @@ -2318,145 +2337,34 @@ }, "tool_mode": false }, - "selected_output": "response", "showNode": true, "type": "Agent" }, "dragging": false, - "id": "Agent-oRYZX", + "id": "Agent-ghqeP", "measured": { - "height": 624, + "height": 593, "width": 320 }, "position": { - "x": 806.8155719016273, - "y": 96.34571871117743 + "x": 797.0440572927098, + "y": 100.6793034234862 }, "selected": false, "type": "genericNode" - }, - { - "data": { - "id": "note-4MelF", - "node": { - "description": "### 💡 Add your OpenAI API key here", - "display_name": "", - "documentation": "", - "template": { - "backgroundColor": "transparent" - } - }, - "type": "note" - }, - "dragging": false, - "id": "note-4MelF", - "measured": { - "height": 324, - "width": 324 - }, - "position": { - "x": 798.1532899902708, - "y": 48.63976452163034 - }, - "selected": false, - "type": "noteNode" - }, - { - "data": { - "id": "note-eqCK2", - "node": { - "description": "### 💡 Add your AgentQL API key here", - "display_name": "", - "documentation": "", - "template": { - "backgroundColor": "transparent" - } - }, - "type": "note" - }, - "dragging": false, - "height": 346, - "id": "note-eqCK2", - "measured": { - "height": 346, - "width": 324 - }, - "position": { - "x": 416.2302078823729, - "y": 51.23403819068896 - }, - "selected": false, - "type": "noteNode" - }, - { - "data": { - "id": "note-Dkzfl", - "node": { - "description": "# Price Deal Finder \n\nThis flow searches and compares prices of a product on the web.\n## Prerequisites\n\n* **[AgentQL API Key](https://dev.agentql.com/api-keys)**\n* **[OpenAI API Key](https://platform.openai.com/)**\n* **[TavilyAI Search API Key](https://tavily.com/)**\n\n## Quick Start\n\n1. Add your [AgentQL API Key](https://dev.agentql.com/api-keys) to the **AgentQL** component.\n2. Add your [OpenAI API Key](https://platform.openai.com/) to the **Agent** component.\n3. Add your [TavilyAI Search API Key](https://tavily.com/) to the **Tavily AI Search** component.\n4. Click **Playground** and enter a product in chat. For example, search \"iPhone 16 Pro 512 GB\")\n* The **Agent** component populates the **Tavily AI Search** component's **Search Query** field, and the **Agent QL** component's **URL** and **Query** fields. \n\n* The **Agent** returns a structured response to your searcn in the chat.", - "display_name": "", - "documentation": "", - "template": {} - }, - "type": "note" - }, - "dragging": false, - "height": 674, - "id": "note-Dkzfl", - "measured": { - "height": 674, - "width": 467 - }, - "position": { - "x": -472.5459222813072, - "y": 102.70113417861305 - }, - "resizing": false, - "selected": false, - "type": "noteNode", - "width": 466 - }, - { - "data": { - "id": "note-NQ1ez", - "node": { - "description": "### 💡 Add your Tavily AI Search key here", - "display_name": "", - "documentation": "", - "template": { - "backgroundColor": "transparent" - } - }, - "type": "note" - }, - "dragging": false, - "height": 324, - "id": "note-NQ1ez", - "measured": { - "height": 324, - "width": 344 - }, - "position": { - "x": 25.144734571805117, - "y": 126.6122587862217 - }, - "resizing": false, - "selected": false, - "type": "noteNode", - "width": 345 } ], "viewport": { - "x": 340.94156691373735, - "y": 122.308952499881, - "zoom": 0.5784136824388973 + "x": 419.87135539102786, + "y": 101.46023627307682, + "zoom": 0.7403965178705934 } }, "description": "Searches and compares product prices across multiple e-commerce platforms. ", "endpoint_name": null, - "icon": "DollarSign", - "id": "05ef0b34-a755-4c9e-af28-8cf989d2a9a5", + "id": "a7e19be8-8f6d-4a1d-b74e-d00d50d6fa88", "is_component": false, - "last_tested_version": "1.3.2", + "last_tested_version": "1.4.3", "name": "Price Deal Finder", "tags": [ "web-scraping",