From f091d6373c7687e637fdaf87a05860a5484c212b Mon Sep 17 00:00:00 2001 From: Deon Sanchez <69873175+deon-sanchez@users.noreply.github.com> Date: Fri, 13 Jun 2025 09:51:37 -0600 Subject: [PATCH] fix: add selected_output field to components & templates to prevent disconnected edges (#8444) * feat: add selected_output property to Component and update validation logic * feat: add selected_output property to various components and update related logic * fix: improve error handling in JSON processing and update type hints * refactor: clean up Makefile and reorder JSON properties in Vector Store RAG.json * Removed the update_selected_outputs target from the Makefile to streamline the build process. * Reordered properties in Vector Store RAG.json for consistency, ensuring "selected_output" appears before "type" in multiple entries. * chore: remove add_selected_outputs.py script * Deleted the add_selected_outputs.py script, which was responsible for adding selected_output fields to Langflow JSON template files. This script is no longer needed as part of the project. * chore: clean up Makefile by removing unnecessary blank line * Removed an extra blank line in the Makefile to improve readability and maintain consistency. * chore: tidy up Makefile by adding a blank line for better readability * Added a blank line before the help target in the Makefile to enhance readability and maintain consistency in formatting. * chore: remove unnecessary blank line in Makefile * Eliminated an extra blank line before the help target in the Makefile to enhance readability and maintain consistency in formatting. * [autofix.ci] apply automated fixes * fix(GenericNode): update output selection logic to use selected_output name * Modified the logic for selecting the initial output in GenericNode to match the selected_output name from the data object. * Adjusted the return logic in NodeOutputs to ensure it correctly handles the selected output state. * fix(GenericNode): refine output selection logic to prioritize selected outputs * Updated the output selection logic in the cleanEdges function to filter for selected outputs before finding the matching output by name. This change enhances the accuracy of output handling for generic nodes. * updated blog writer * fix: update Memory Chatbot configuration for improved message handling - Adjusted JSON structure for Memory Chatbot to ensure correct output types and display names. - Added new input fields for sender type and refined existing fields for clarity. - Enhanced message retrieval methods to support dynamic output based on selected modes. - Improved overall structure for better integration with Langflow components. * Update src/backend/base/langflow/custom/custom_component/component.py Co-authored-by: Gabriel Luiz Freitas Almeida * [autofix.ci] apply automated fixes * Ruff linting error fix * [autofix.ci] apply automated fixes * fix: Update test to reflect change in heading from "OpenAi" to "Language Model" --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Lucas Oliveira Co-authored-by: Cristhian Zanforlin Lousa Co-authored-by: Gabriel Luiz Freitas Almeida Co-authored-by: Eric Hare --- Makefile | 1 - .../custom/custom_component/component.py | 14 ++++++-- .../Basic Prompt Chaining.json | 21 ++++++++---- .../starter_projects/Basic Prompting.json | 6 ++-- .../starter_projects/Blog Writer.json | 5 +++ .../Custom Component Maker.json | 24 +++++++++----- .../starter_projects/Diet Analysis.json | 9 ++++-- .../starter_projects/Document Q&A.json | 15 ++++++--- .../starter_projects/Financial Agent.json | 29 +++++++++++------ .../Financial Report Parser.json | 4 +++ .../starter_projects/Gmail Agent.json | 9 ++++-- .../starter_projects/Hybrid Search RAG.json | 6 ++++ .../Image Sentiment Analysis.json | 5 +++ .../Instagram Copywriter.json | 27 ++++++++++------ .../starter_projects/Invoice Summarizer.json | 14 +++++--- .../starter_projects/Market Research.json | 6 ++++ .../starter_projects/Meeting Summary.json | 32 ++++++++++++------- .../starter_projects/Memory Chatbot.json | 5 +++ .../starter_projects/News Aggregator.json | 12 ++++--- .../starter_projects/Pokédex Agent.json | 9 ++++-- .../Portfolio Website Code Generator.json | 7 ++++ .../starter_projects/Price Deal Finder.json | 12 ++++--- .../starter_projects/Research Agent.json | 27 ++++++++++------ .../Research Translation Loop.json | 18 +++++++---- .../SEO Keyword Generator.json | 9 ++++-- .../starter_projects/SaaS Pricing.json | 9 ++++-- .../starter_projects/Search agent.json | 11 ++++--- .../Sequential Tasks Agents.json | 30 +++++++++++------ .../starter_projects/Simple Agent.json | 12 ++++--- .../starter_projects/Social Media Agent.json | 12 ++++--- .../Text Sentiment Analysis.json | 21 ++++++++---- .../Travel Planning Agents.json | 21 ++++++++---- .../Twitter Thread Generator.json | 27 ++++++++++------ .../starter_projects/Vector Store RAG.json | 10 ++++++ .../starter_projects/Youtube Analysis.json | 27 ++++++++++------ .../NodeOutputParameter/NodeOutputs.tsx | 9 +----- .../src/CustomNodes/GenericNode/index.tsx | 5 ++- src/frontend/src/types/flow/index.ts | 1 + .../tests/core/features/tweaksTest.spec.ts | 2 +- 39 files changed, 361 insertions(+), 162 deletions(-) diff --git a/Makefile b/Makefile index b802aa217..1584017b0 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,6 @@ check_tools: @command -v npm >/dev/null 2>&1 || { echo >&2 "$(RED)NPM is not installed. Aborting.$(NC)"; exit 1; } @echo "$(GREEN)All required tools are installed.$(NC)" - help: ## show this help message @echo '----' @grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | \ diff --git a/src/backend/base/langflow/custom/custom_component/component.py b/src/backend/base/langflow/custom/custom_component/component.py index 7cc440d5b..8006f4d95 100644 --- a/src/backend/base/langflow/custom/custom_component/component.py +++ b/src/backend/base/langflow/custom/custom_component/component.py @@ -94,6 +94,7 @@ class PlaceholderGraph(NamedTuple): class Component(CustomComponent): inputs: list[InputTypes] = [] outputs: list[Output] = [] + selected_output: str | None = None code_class_base_inheritance: ClassVar[str] = "Component" def __init__(self, **kwargs) -> None: @@ -786,7 +787,10 @@ class Component(CustomComponent): def _validate_outputs(self) -> None: # Raise Error if some rule isn't met - pass + if self.selected_output is not None and self.selected_output not in self._outputs_map: + output_names = ", ".join(list(self._outputs_map.keys())) + msg = f"selected_output '{self.selected_output}' is not valid. Must be one of: {output_names}" + raise ValueError(msg) def _map_parameters_on_frontend_node(self, frontend_node: ComponentFrontendNode) -> None: for name, value in self._parameters.items(): @@ -852,9 +856,15 @@ class Component(CustomComponent): frontend_node.validate_component() frontend_node.set_base_classes_from_outputs() + + # Get the node dictionary and add selected_output if specified + node_dict = frontend_node.to_dict(keep_name=False) + if self.selected_output is not None: + node_dict["selected_output"] = self.selected_output + return { "data": { - "node": frontend_node.to_dict(keep_name=False), + "node": node_dict, "type": self.name or self.__class__.__name__, "id": self._id, }, diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json b/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json index c98fcee7d..d107e731d 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json @@ -301,7 +301,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 260, @@ -598,7 +599,8 @@ } } }, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "height": 234, @@ -1030,7 +1032,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 260, @@ -1158,7 +1161,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 260, @@ -1627,7 +1631,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "dragging": false, "id": "OpenAIModel-lL9HA", @@ -2016,7 +2021,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "dragging": false, "id": "OpenAIModel-JieGw", @@ -2405,7 +2411,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "dragging": false, "id": "OpenAIModel-dXMRv", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json b/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json index b0354dc1a..830617f62 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json @@ -382,7 +382,8 @@ } } }, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "height": 234, @@ -512,7 +513,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 260, diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json b/src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json index 3bcfc9d9c..845a4a800 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json @@ -303,6 +303,7 @@ } } }, + "selected_output": "prompt", "type": "Prompt" }, "dragging": false, @@ -410,6 +411,7 @@ } } }, + "selected_output": "text", "type": "TextInput" }, "dragging": false, @@ -1127,6 +1129,7 @@ }, "tool_mode": false }, + "selected_output": "text_output", "showNode": true, "type": "OpenAIModel" }, @@ -1303,6 +1306,7 @@ }, "tool_mode": false }, + "selected_output": "parsed_text", "showNode": true, "type": "ParserComponent" }, @@ -1670,6 +1674,7 @@ }, "tool_mode": false }, + "selected_output": "page_results", "showNode": true, "type": "URLComponent" }, diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json b/src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json index 0234339e8..2d2e416e4 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json @@ -524,7 +524,8 @@ }, "tool_mode": false }, - "type": "Memory" + "type": "Memory", + "selected_output": "dataframe" }, "dragging": false, "height": 262, @@ -773,7 +774,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 685, @@ -1194,7 +1196,8 @@ }, "tool_mode": false }, - "type": "URL" + "type": "URL", + "selected_output": "text" }, "dragging": false, "height": 365, @@ -1556,7 +1559,8 @@ }, "tool_mode": false }, - "type": "URL" + "type": "URL", + "selected_output": "text" }, "dragging": false, "height": 661, @@ -1912,7 +1916,8 @@ }, "tool_mode": false }, - "type": "URL" + "type": "URL", + "selected_output": "text" }, "dragging": false, "height": 365, @@ -2255,7 +2260,8 @@ "tool_mode": false }, "showNode": true, - "type": "AnthropicModel" + "type": "AnthropicModel", + "selected_output": "text_output" }, "dragging": false, "id": "AnthropicModel-I7I40", @@ -2567,7 +2573,8 @@ "tool_mode": false }, "showNode": false, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "id": "ChatInput-gwwtq", @@ -3004,7 +3011,8 @@ "tool_mode": false }, "showNode": true, - "type": "TypeConverterComponent" + "type": "TypeConverterComponent", + "selected_output": "message_output" }, "id": "TypeConverterComponent-Vb89B", "measured": { diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Diet Analysis.json b/src/backend/base/langflow/initial_setup/starter_projects/Diet Analysis.json index 4ff7c9bb3..bd1a1ff10 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Diet Analysis.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Diet Analysis.json @@ -384,7 +384,8 @@ "tool_mode": false }, "showNode": false, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "id": "ChatInput-Enwwh", @@ -514,7 +515,8 @@ "tool_mode": false }, "showNode": true, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "id": "Prompt-YubZ1", @@ -889,7 +891,8 @@ "tool_mode": false }, "showNode": true, - "type": "NovitaModel" + "type": "NovitaModel", + "selected_output": "text_output" }, "dragging": false, "id": "NovitaModel-20MWu", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json b/src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json index f95bf34ce..25487f833 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json @@ -412,7 +412,8 @@ } } }, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "height": 234, @@ -1029,7 +1030,8 @@ }, "tool_mode": false }, - "type": "File" + "type": "File", + "selected_output": "dataframe" }, "dragging": false, "height": 232, @@ -1186,7 +1188,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 347, @@ -1581,7 +1584,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "dragging": false, "id": "OpenAIModel-Xctjl", @@ -1755,7 +1759,8 @@ "tool_mode": false }, "showNode": true, - "type": "parser" + "type": "parser", + "selected_output": "parsed_text" }, "dragging": false, "id": "parser-mO32W", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Financial Agent.json b/src/backend/base/langflow/initial_setup/starter_projects/Financial Agent.json index 290a8319f..a44da0ed4 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Financial Agent.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Financial Agent.json @@ -607,7 +607,8 @@ "tool_mode": false }, "showNode": false, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "id": "ChatInput-X83ni", @@ -1073,7 +1074,8 @@ "tool_mode": true }, "showNode": true, - "type": "TavilySearchComponent" + "type": "TavilySearchComponent", + "selected_output": "component_as_tool" }, "dragging": false, "id": "TavilySearchComponent-7Y3yy", @@ -1322,7 +1324,8 @@ "tool_mode": true }, "showNode": true, - "type": "YfinanceComponent" + "type": "YfinanceComponent", + "selected_output": "component_as_tool" }, "dragging": false, "id": "YfinanceComponent-KpeWR", @@ -2060,7 +2063,8 @@ "tool_mode": true }, "showNode": true, - "type": "URL" + "type": "URL", + "selected_output": "component_as_tool" }, "dragging": false, "id": "URL-N9CXl", @@ -2409,7 +2413,8 @@ "tool_mode": false }, "showNode": true, - "type": "SambaNovaModel" + "type": "SambaNovaModel", + "selected_output": "text_output" }, "dragging": false, "id": "SambaNovaModel-NEyqD", @@ -3184,7 +3189,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "id": "Agent-cGZsD", @@ -3266,7 +3272,7 @@ } ], "pinned": false, - "score": 5.283996070936036e-7, + "score": 5.283996070936036e-07, "template": { "_type": "Component", "add_current_date_tool": { @@ -3959,7 +3965,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "id": "Agent-wqbpC", @@ -4136,7 +4143,8 @@ "tool_mode": false }, "showNode": true, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "id": "Prompt-er8QV", @@ -4313,7 +4321,8 @@ "tool_mode": false }, "showNode": true, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "id": "Prompt-AdpTy", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json b/src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json index a98777c97..316bf6479 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json @@ -494,6 +494,7 @@ }, "tool_mode": false }, + "selected_output": "model_output", "showNode": true, "type": "OpenAIModel" }, @@ -1119,6 +1120,7 @@ }, "tool_mode": false }, + "selected_output": "message", "showNode": false, "type": "ChatInput" }, @@ -1444,6 +1446,7 @@ }, "tool_mode": false }, + "selected_output": "structured_output_dataframe", "showNode": true, "type": "StructuredOutput" }, @@ -1619,6 +1622,7 @@ }, "tool_mode": false }, + "selected_output": "parsed_text", "showNode": true, "type": "parser" }, diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Gmail Agent.json b/src/backend/base/langflow/initial_setup/starter_projects/Gmail Agent.json index a7f82ccf5..94c49bb0e 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Gmail Agent.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Gmail Agent.json @@ -812,7 +812,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "id": "Agent-BxJm3", @@ -1125,7 +1126,8 @@ "tool_mode": false }, "showNode": false, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "id": "ChatInput-buyiB", @@ -2941,7 +2943,8 @@ "tool_mode": true }, "showNode": true, - "type": "GmailAPI" + "type": "GmailAPI", + "selected_output": "component_as_tool" }, "dragging": false, "id": "GmailAPI-J65iP", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Hybrid Search RAG.json b/src/backend/base/langflow/initial_setup/starter_projects/Hybrid Search RAG.json index e7fbd07e4..30a79acee 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Hybrid Search RAG.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Hybrid Search RAG.json @@ -524,6 +524,7 @@ }, "tool_mode": false }, + "selected_output": "message", "showNode": false, "type": "ChatInput" }, @@ -802,6 +803,7 @@ }, "tool_mode": false }, + "selected_output": "structured_output_dataframe", "showNode": true, "type": "StructuredOutput" }, @@ -1195,6 +1197,7 @@ }, "tool_mode": false }, + "selected_output": "text_output", "showNode": true, "type": "OpenAIModel" }, @@ -1972,6 +1975,7 @@ }, "tool_mode": false }, + "selected_output": "dataframe", "showNode": true, "type": "AstraDB" }, @@ -2145,6 +2149,7 @@ }, "tool_mode": false }, + "selected_output": "parsed_text", "showNode": true, "type": "ParserComponent" }, @@ -2626,6 +2631,7 @@ }, "tool_mode": false }, + "selected_output": "parsed_text", "showNode": true, "type": "ParserComponent" }, diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json b/src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json index 7d4fbfae1..b27552bd1 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json @@ -456,6 +456,7 @@ }, "tool_mode": false }, + "selected_output": "message", "type": "ChatInput" }, "dragging": false, @@ -923,6 +924,7 @@ }, "tool_mode": false }, + "selected_output": "prompt", "type": "Prompt" }, "dragging": false, @@ -1318,6 +1320,7 @@ }, "tool_mode": false }, + "selected_output": "text_output", "showNode": true, "type": "OpenAIModel" }, @@ -1596,6 +1599,7 @@ }, "tool_mode": false }, + "selected_output": "structured_output_dataframe", "showNode": true, "type": "StructuredOutput" }, @@ -1771,6 +1775,7 @@ }, "tool_mode": false }, + "selected_output": "parsed_text", "showNode": true, "type": "parser" }, diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Instagram Copywriter.json b/src/backend/base/langflow/initial_setup/starter_projects/Instagram Copywriter.json index 9217ec5cd..42f7746fe 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Instagram Copywriter.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Instagram Copywriter.json @@ -564,7 +564,8 @@ } } }, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "height": 234, @@ -741,7 +742,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 433, @@ -846,7 +848,8 @@ } } }, - "type": "TextInput" + "type": "TextInput", + "selected_output": "text" }, "dragging": false, "height": 234, @@ -999,7 +1002,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 347, @@ -1993,7 +1997,8 @@ }, "tool_mode": false }, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "height": 650, @@ -2170,7 +2175,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 433, @@ -2806,7 +2812,8 @@ "tool_mode": true }, "showNode": true, - "type": "TavilySearchComponent" + "type": "TavilySearchComponent", + "selected_output": "component_as_tool" }, "dragging": false, "id": "TavilySearchComponent-HW6b0", @@ -3195,7 +3202,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "dragging": false, "id": "OpenAIModel-dqLbl", @@ -3584,7 +3592,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "dragging": false, "id": "OpenAIModel-7yVxU", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Invoice Summarizer.json b/src/backend/base/langflow/initial_setup/starter_projects/Invoice Summarizer.json index b16cef751..8538642f9 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Invoice Summarizer.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Invoice Summarizer.json @@ -260,7 +260,8 @@ "tool_mode": false }, "showNode": true, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "id": "Prompt-0aGkQ", @@ -687,7 +688,7 @@ } ], "pinned": false, - "score": 7.568328950209746e-6, + "score": 7.568328950209746e-06, "template": { "_type": "Component", "code": { @@ -824,7 +825,8 @@ "tool_mode": true }, "showNode": true, - "type": "needle" + "type": "needle", + "selected_output": "component_as_tool" }, "id": "needle-5GYmd", "measured": { @@ -1135,7 +1137,8 @@ "tool_mode": false }, "showNode": true, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "id": "ChatInput-cKEM6", @@ -1921,7 +1924,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "id": "Agent-DBNrp", "measured": { diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Market Research.json b/src/backend/base/langflow/initial_setup/starter_projects/Market Research.json index ae9b61242..3d905b1c7 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Market Research.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Market Research.json @@ -444,6 +444,7 @@ } } }, + "selected_output": "message", "type": "ChatInput" }, "dragging": false, @@ -1116,6 +1117,7 @@ }, "tool_mode": false }, + "selected_output": "structured_output_dataframe", "type": "StructuredOutput" }, "dragging": false, @@ -1808,6 +1810,7 @@ }, "tool_mode": false }, + "selected_output": "response", "type": "Agent" }, "dragging": false, @@ -2276,6 +2279,7 @@ }, "tool_mode": true }, + "selected_output": "component_as_tool", "showNode": true, "type": "TavilySearchComponent" }, @@ -2666,6 +2670,7 @@ }, "tool_mode": false }, + "selected_output": "model_output", "showNode": true, "type": "OpenAIModel" }, @@ -2840,6 +2845,7 @@ }, "tool_mode": false }, + "selected_output": "parsed_text", "showNode": true, "type": "parser" }, diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json b/src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json index e0ac6f848..890353c73 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json @@ -447,7 +447,8 @@ "tool_mode": false }, "showNode": true, - "type": "AssemblyAITranscriptionJobPoller" + "type": "AssemblyAITranscriptionJobPoller", + "selected_output": "transcription_result" }, "id": "AssemblyAITranscriptionJobPoller-VCkre", "measured": { @@ -998,7 +999,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "id": "OpenAIModel-adSHw", "measured": { @@ -1150,7 +1152,8 @@ "tool_mode": false }, "showNode": true, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "id": "Prompt-Vzk5z", "measured": { @@ -2142,7 +2145,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "id": "OpenAIModel-A8LqG", "measured": { @@ -2620,7 +2624,8 @@ "tool_mode": false }, "showNode": true, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "id": "Prompt-iKEvN", "measured": { @@ -2944,7 +2949,8 @@ "tool_mode": false }, "showNode": true, - "type": "Memory" + "type": "Memory", + "selected_output": "dataframe" }, "id": "Memory-YN8aN", "measured": { @@ -3243,7 +3249,8 @@ "tool_mode": false }, "showNode": false, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "id": "ChatInput-xfgsq", "measured": { @@ -3421,7 +3428,7 @@ } ], "pinned": false, - "score": 0.000018578044550916993, + "score": 1.8578044550916993e-05, "template": { "_type": "Component", "api_key": { @@ -3686,7 +3693,8 @@ "tool_mode": false }, "showNode": true, - "type": "AssemblyAITranscriptionJobCreator" + "type": "AssemblyAITranscriptionJobCreator", + "selected_output": "transcript_id" }, "dragging": false, "id": "AssemblyAITranscriptionJobCreator-hXp0S", @@ -3887,7 +3895,8 @@ "tool_mode": false }, "showNode": true, - "type": "parser" + "type": "parser", + "selected_output": "parsed_text" }, "dragging": false, "id": "parser-uRyvX", @@ -4014,7 +4023,8 @@ "tool_mode": false }, "showNode": true, - "type": "TypeConverterComponent" + "type": "TypeConverterComponent", + "selected_output": "message_output" }, "id": "TypeConverterComponent-MzSbu", "measured": { 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 94fc4999d..149a9abcc 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 @@ -427,6 +427,7 @@ }, "tool_mode": false }, + "selected_output": "message", "type": "ChatInput" }, "dragging": false, @@ -1273,6 +1274,7 @@ }, "tool_mode": false }, + "selected_output": "prompt", "type": "Prompt" }, "dragging": false, @@ -1667,6 +1669,7 @@ }, "tool_mode": false }, + "selected_output": "text_output", "showNode": true, "type": "OpenAIModel" }, @@ -1791,6 +1794,7 @@ }, "tool_mode": false }, + "selected_output": "message_output", "showNode": true, "type": "TypeConverterComponent" }, @@ -2122,6 +2126,7 @@ }, "tool_mode": false }, + "selected_output": "dataframe", "showNode": true, "type": "Memory" }, diff --git a/src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json b/src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json index 860400092..57a88febd 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json @@ -562,7 +562,8 @@ "tool_mode": true }, "showNode": true, - "type": "AgentQL" + "type": "AgentQL", + "selected_output": "component_as_tool" }, "dragging": false, "id": "AgentQL-TCADj", @@ -875,7 +876,8 @@ "tool_mode": false }, "showNode": false, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "id": "ChatInput-LwqUD", @@ -1638,7 +1640,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "id": "Agent-x50rv", @@ -2131,7 +2134,8 @@ "tool_mode": false }, "showNode": false, - "type": "ChatOutput" + "type": "ChatOutput", + "selected_output": "message" }, "dragging": false, "id": "ChatOutput-RB2DM", 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 c33bc2402..973cfadfb 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 @@ -384,7 +384,8 @@ "tool_mode": false }, "showNode": false, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "id": "ChatInput-ZNO2E", @@ -1247,7 +1248,8 @@ "tool_mode": true }, "showNode": true, - "type": "APIRequest" + "type": "APIRequest", + "selected_output": "component_as_tool" }, "dragging": false, "id": "APIRequest-Yr0ij", @@ -2018,7 +2020,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "id": "Agent-iU8sJ", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json b/src/backend/base/langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json index 6efcff25a..26b35d566 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json @@ -292,6 +292,7 @@ }, "tool_mode": false }, + "selected_output": "text", "showNode": true, "type": "TextInput" }, @@ -630,6 +631,7 @@ }, "tool_mode": false }, + "selected_output": "model_output", "showNode": true, "type": "AnthropicModel" }, @@ -968,6 +970,7 @@ }, "tool_mode": false }, + "selected_output": "text_output", "showNode": true, "type": "AnthropicModel" }, @@ -1760,6 +1763,7 @@ }, "tool_mode": false }, + "selected_output": "structured_output_dataframe", "showNode": true, "type": "StructuredOutput" }, @@ -2056,6 +2060,7 @@ }, "tool_mode": false }, + "selected_output": "dataframe", "showNode": true, "type": "File" }, @@ -2232,6 +2237,7 @@ }, "tool_mode": false }, + "selected_output": "parsed_text", "showNode": true, "type": "ParserComponent" }, @@ -2407,6 +2413,7 @@ }, "tool_mode": false }, + "selected_output": "parsed_text", "showNode": true, "type": "parser" }, 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 e3abac5cd..f8f601d6e 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 @@ -414,7 +414,8 @@ "tool_mode": false }, "showNode": false, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "id": "ChatInput-DwzkZ", @@ -1178,7 +1179,8 @@ "tool_mode": true }, "showNode": true, - "type": "TavilySearchComponent" + "type": "TavilySearchComponent", + "selected_output": "component_as_tool" }, "dragging": false, "id": "TavilySearchComponent-STQC5", @@ -1585,7 +1587,8 @@ "tool_mode": true }, "showNode": true, - "type": "AgentQL" + "type": "AgentQL", + "selected_output": "component_as_tool" }, "dragging": false, "id": "AgentQL-reBlu", @@ -2320,7 +2323,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "id": "Agent-oRYZX", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Research Agent.json b/src/backend/base/langflow/initial_setup/starter_projects/Research Agent.json index 07c695108..975999597 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Research Agent.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Research Agent.json @@ -420,7 +420,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 347, @@ -717,7 +718,8 @@ } } }, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "height": 234, @@ -894,7 +896,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 433, @@ -1623,7 +1626,8 @@ }, "tool_mode": false }, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "height": 658, @@ -1751,7 +1755,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 260, @@ -1879,7 +1884,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 260, @@ -2381,7 +2387,8 @@ "tool_mode": true }, "showNode": true, - "type": "TavilySearchComponent" + "type": "TavilySearchComponent", + "selected_output": "component_as_tool" }, "dragging": false, "id": "TavilySearchComponent-okHYL", @@ -2770,7 +2777,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "dragging": false, "id": "OpenAIModel-sO8rf", @@ -3159,7 +3167,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "dragging": false, "id": "OpenAIModel-1pnlf", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Research Translation Loop.json b/src/backend/base/langflow/initial_setup/starter_projects/Research Translation Loop.json index a6ab9f1cd..25dd2e909 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Research Translation Loop.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Research Translation Loop.json @@ -336,7 +336,8 @@ "tool_mode": false }, "showNode": true, - "type": "ArXivComponent" + "type": "ArXivComponent", + "selected_output": "dataframe" }, "dragging": false, "id": "ArXivComponent-ylKFb", @@ -674,7 +675,8 @@ "tool_mode": false }, "showNode": true, - "type": "AnthropicModel" + "type": "AnthropicModel", + "selected_output": "text_output" }, "dragging": false, "id": "AnthropicModel-G2MkR", @@ -780,7 +782,8 @@ "tool_mode": false }, "showNode": true, - "type": "MessagetoData" + "type": "MessagetoData", + "selected_output": "data" }, "dragging": false, "id": "MessagetoData-jYebP", @@ -1399,7 +1402,8 @@ "tool_mode": false }, "showNode": true, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "id": "ChatInput-5o3G0", @@ -1631,7 +1635,8 @@ "tool_mode": false }, "showNode": true, - "type": "ParserComponent" + "type": "ParserComponent", + "selected_output": "parsed_text" }, "dragging": false, "id": "ParserComponent-ZhlLQ", @@ -1749,7 +1754,8 @@ "tool_mode": false }, "showNode": true, - "type": "LoopComponent" + "type": "LoopComponent", + "selected_output": "done" }, "dragging": false, "id": "LoopComponent-9BK8B", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/SEO Keyword Generator.json b/src/backend/base/langflow/initial_setup/starter_projects/SEO Keyword Generator.json index 4bf65f1cd..7893dbecc 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/SEO Keyword Generator.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/SEO Keyword Generator.json @@ -341,7 +341,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 779, @@ -504,7 +505,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 260, @@ -1233,7 +1235,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "dragging": false, "id": "OpenAIModel-xbTZw", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/SaaS Pricing.json b/src/backend/base/langflow/initial_setup/starter_projects/SaaS Pricing.json index c025d4717..c8c4c6c76 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/SaaS Pricing.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/SaaS Pricing.json @@ -313,7 +313,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 693, @@ -1344,7 +1345,8 @@ }, "tool_mode": false }, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "height": 650, @@ -1540,7 +1542,8 @@ "tool_mode": true }, "showNode": true, - "type": "CalculatorComponent" + "type": "CalculatorComponent", + "selected_output": "component_as_tool" }, "dragging": false, "id": "CalculatorComponent-LyoFm", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Search agent.json b/src/backend/base/langflow/initial_setup/starter_projects/Search agent.json index 532bdfa8b..87bdae5dd 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Search agent.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Search agent.json @@ -291,7 +291,8 @@ "tool_mode": true }, "showNode": true, - "type": "ScrapeGraphSearchApi" + "type": "ScrapeGraphSearchApi", + "selected_output": "component_as_tool" }, "dragging": false, "id": "ScrapeGraphSearchApi-vo1Yo", @@ -600,7 +601,8 @@ "tool_mode": false }, "showNode": false, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "id": "ChatInput-v88Su", @@ -1071,7 +1073,7 @@ } ], "pinned": false, - "score": 5.283996070936036e-7, + "score": 5.283996070936036e-07, "template": { "_type": "Component", "add_current_date_tool": { @@ -1757,7 +1759,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "id": "Agent-xgcha", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Sequential Tasks Agents.json b/src/backend/base/langflow/initial_setup/starter_projects/Sequential Tasks Agents.json index 6723ff92f..c6c889ee6 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Sequential Tasks Agents.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Sequential Tasks Agents.json @@ -986,7 +986,8 @@ }, "tool_mode": false }, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "height": 650, @@ -1678,7 +1679,8 @@ }, "tool_mode": false }, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "height": 650, @@ -1812,7 +1814,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 260, @@ -1946,7 +1949,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 260, @@ -2129,7 +2133,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 433, @@ -2432,7 +2437,8 @@ }, "tool_mode": false }, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "height": 234, @@ -3196,7 +3202,8 @@ }, "tool_mode": false }, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "height": 650, @@ -3571,7 +3578,8 @@ "tool_mode": true }, "showNode": true, - "type": "YfinanceComponent" + "type": "YfinanceComponent", + "selected_output": "component_as_tool" }, "dragging": true, "id": "YfinanceComponent-Adjq6", @@ -3760,7 +3768,8 @@ "tool_mode": true }, "showNode": true, - "type": "CalculatorComponent" + "type": "CalculatorComponent", + "selected_output": "component_as_tool" }, "dragging": false, "id": "CalculatorComponent-9O7Ap", @@ -4224,7 +4233,8 @@ "tool_mode": true }, "showNode": true, - "type": "TavilySearchComponent" + "type": "TavilySearchComponent", + "selected_output": "component_as_tool" }, "dragging": false, "id": "TavilySearchComponent-6ezaX", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Simple Agent.json b/src/backend/base/langflow/initial_setup/starter_projects/Simple Agent.json index 3b237f4e9..5c0e1c10a 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Simple Agent.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Simple Agent.json @@ -525,7 +525,8 @@ }, "tool_mode": true }, - "type": "URL" + "type": "URL", + "selected_output": "component_as_tool" }, "dragging": false, "id": "URL-o7GEq", @@ -722,7 +723,8 @@ "tool_mode": true }, "showNode": true, - "type": "CalculatorComponent" + "type": "CalculatorComponent", + "selected_output": "component_as_tool" }, "dragging": false, "id": "CalculatorComponent-15FSE", @@ -1035,7 +1037,8 @@ "tool_mode": false }, "showNode": false, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "id": "ChatInput-2YUmA", @@ -2115,7 +2118,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "id": "Agent-qYZ9W", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Social Media Agent.json b/src/backend/base/langflow/initial_setup/starter_projects/Social Media Agent.json index 422ad07f5..695a36178 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Social Media Agent.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Social Media Agent.json @@ -304,7 +304,8 @@ "tool_mode": false }, "showNode": true, - "type": "ApifyActors" + "type": "ApifyActors", + "selected_output": "tool" }, "dragging": false, "id": "ApifyActors-t44sy", @@ -506,7 +507,8 @@ "tool_mode": false }, "showNode": true, - "type": "ApifyActors" + "type": "ApifyActors", + "selected_output": "tool" }, "dragging": false, "id": "ApifyActors-n0Tjo", @@ -900,7 +902,8 @@ "tool_mode": false }, "showNode": false, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "id": "ChatInput-9joxW", @@ -2001,7 +2004,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "id": "Agent-EePDq", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Text Sentiment Analysis.json b/src/backend/base/langflow/initial_setup/starter_projects/Text Sentiment Analysis.json index 48b578818..5638895cc 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Text Sentiment Analysis.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Text Sentiment Analysis.json @@ -512,7 +512,8 @@ "tool_mode": false }, "showNode": true, - "type": "File" + "type": "File", + "selected_output": "message" }, "dragging": false, "id": "File-m5GWE", @@ -666,7 +667,8 @@ "tool_mode": false }, "showNode": true, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "id": "Prompt-nmNbi", @@ -820,7 +822,8 @@ "tool_mode": false }, "showNode": true, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "id": "Prompt-AJxY8", @@ -1209,7 +1212,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "dragging": false, "id": "OpenAIModel-zVeWr", @@ -1598,7 +1602,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "dragging": false, "id": "OpenAIModel-Izkdb", @@ -1728,7 +1733,8 @@ "tool_mode": false }, "showNode": true, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "id": "Prompt-LXvg7", @@ -2117,7 +2123,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "dragging": false, "id": "OpenAIModel-Hl8vG", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Travel Planning Agents.json b/src/backend/base/langflow/initial_setup/starter_projects/Travel Planning Agents.json index 3a69e3390..fc8d9b093 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Travel Planning Agents.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Travel Planning Agents.json @@ -470,7 +470,8 @@ } } }, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "height": 262, @@ -1389,7 +1390,8 @@ "tool_mode": true }, "showNode": true, - "type": "URL" + "type": "URL", + "selected_output": "component_as_tool" }, "dragging": false, "id": "URL-4LSRv", @@ -1535,7 +1537,8 @@ "tool_mode": true }, "showNode": true, - "type": "CalculatorComponent" + "type": "CalculatorComponent", + "selected_output": "component_as_tool" }, "dragging": false, "id": "CalculatorComponent-hlWP4", @@ -1799,7 +1802,8 @@ "tool_mode": true }, "showNode": true, - "type": "SearchComponent" + "type": "SearchComponent", + "selected_output": "component_as_tool" }, "dragging": false, "id": "SearchComponent-kgsWf", @@ -2567,7 +2571,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "id": "Agent-H916j", @@ -3335,7 +3340,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "id": "Agent-zFKST", @@ -4103,7 +4109,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "id": "Agent-3tuWs", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Twitter Thread Generator.json b/src/backend/base/langflow/initial_setup/starter_projects/Twitter Thread Generator.json index 461e3d6d7..332017d31 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Twitter Thread Generator.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Twitter Thread Generator.json @@ -534,7 +534,8 @@ } } }, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "height": 234, @@ -639,7 +640,8 @@ } } }, - "type": "TextInput" + "type": "TextInput", + "selected_output": "text" }, "dragging": false, "height": 234, @@ -1048,7 +1050,8 @@ } } }, - "type": "TextInput" + "type": "TextInput", + "selected_output": "text" }, "dragging": false, "height": 234, @@ -1153,7 +1156,8 @@ } } }, - "type": "TextInput" + "type": "TextInput", + "selected_output": "text" }, "dragging": false, "height": 234, @@ -1258,7 +1262,8 @@ } } }, - "type": "TextInput" + "type": "TextInput", + "selected_output": "text" }, "dragging": false, "height": 234, @@ -1363,7 +1368,8 @@ } } }, - "type": "TextInput" + "type": "TextInput", + "selected_output": "text" }, "dragging": false, "height": 234, @@ -1468,7 +1474,8 @@ } } }, - "type": "TextInput" + "type": "TextInput", + "selected_output": "text" }, "dragging": false, "height": 234, @@ -1778,7 +1785,8 @@ }, "tool_mode": false }, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "height": 779, @@ -2173,7 +2181,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "text_output" }, "dragging": false, "id": "OpenAIModel-p0R9m", diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Vector Store RAG.json b/src/backend/base/langflow/initial_setup/starter_projects/Vector Store RAG.json index 34128b02e..d93e804c3 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Vector Store RAG.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Vector Store RAG.json @@ -553,6 +553,7 @@ } } }, + "selected_output": "message", "type": "ChatInput" }, "dragging": false, @@ -734,6 +735,7 @@ }, "tool_mode": false }, + "selected_output": "prompt", "type": "Prompt" }, "dragging": false, @@ -939,6 +941,7 @@ } } }, + "selected_output": "chunks", "type": "SplitText" }, "dragging": false, @@ -1812,6 +1815,7 @@ }, "tool_mode": false }, + "selected_output": "embeddings", "type": "OpenAIEmbeddings" }, "dragging": false, @@ -2344,6 +2348,7 @@ }, "tool_mode": false }, + "selected_output": "embeddings", "type": "OpenAIEmbeddings" }, "dragging": false, @@ -2623,6 +2628,7 @@ }, "tool_mode": false }, + "selected_output": "dataframe", "type": "File" }, "dragging": false, @@ -3113,6 +3119,7 @@ }, "tool_mode": false }, + "selected_output": "text_output", "showNode": true, "type": "OpenAIModel" }, @@ -3288,6 +3295,7 @@ }, "tool_mode": false }, + "selected_output": "parsed_text", "showNode": true, "type": "parser" }, @@ -3396,6 +3404,7 @@ } ], "pinned": false, + "selected_output": "dataframe", "template": { "_type": "Component", "advanced_search_filter": { @@ -4058,6 +4067,7 @@ }, "tool_mode": false }, + "selected_output": "dataframe", "showNode": true, "type": "AstraDB" }, diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Youtube Analysis.json b/src/backend/base/langflow/initial_setup/starter_projects/Youtube Analysis.json index ac0b9ba3c..c3fc0ac18 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Youtube Analysis.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Youtube Analysis.json @@ -509,7 +509,8 @@ "tool_mode": false }, "showNode": true, - "type": "BatchRunComponent" + "type": "BatchRunComponent", + "selected_output": "batch_results" }, "dragging": false, "id": "BatchRunComponent-kxOUU", @@ -714,7 +715,8 @@ "tool_mode": false }, "showNode": true, - "type": "YouTubeCommentsComponent" + "type": "YouTubeCommentsComponent", + "selected_output": "comments" }, "dragging": false, "id": "YouTubeCommentsComponent-g4VZV", @@ -1104,7 +1106,8 @@ "tool_mode": false }, "showNode": true, - "type": "OpenAIModel" + "type": "OpenAIModel", + "selected_output": "model_output" }, "dragging": false, "id": "OpenAIModel-0iBkZ", @@ -1839,7 +1842,8 @@ "tool_mode": false }, "showNode": true, - "type": "Agent" + "type": "Agent", + "selected_output": "response" }, "dragging": false, "id": "Agent-0gW4Y", @@ -2016,7 +2020,8 @@ "tool_mode": false }, "showNode": true, - "type": "Prompt" + "type": "Prompt", + "selected_output": "prompt" }, "dragging": false, "id": "Prompt-UAMac", @@ -2608,7 +2613,8 @@ "tool_mode": true }, "showNode": true, - "type": "YouTubeTranscripts" + "type": "YouTubeTranscripts", + "selected_output": "component_as_tool" }, "dragging": false, "id": "YouTubeTranscripts-QMIjk", @@ -2921,7 +2927,8 @@ "tool_mode": false }, "showNode": true, - "type": "ChatInput" + "type": "ChatInput", + "selected_output": "message" }, "dragging": false, "id": "ChatInput-XErsc", @@ -3267,7 +3274,8 @@ "tool_mode": false }, "showNode": true, - "type": "ConditionalRouter" + "type": "ConditionalRouter", + "selected_output": "true_result" }, "dragging": false, "id": "ConditionalRouter-7lzPh", @@ -3441,7 +3449,8 @@ "tool_mode": false }, "showNode": true, - "type": "parser" + "type": "parser", + "selected_output": "parsed_text" }, "dragging": false, "id": "parser-r3iNU", diff --git a/src/frontend/src/CustomNodes/GenericNode/components/NodeOutputParameter/NodeOutputs.tsx b/src/frontend/src/CustomNodes/GenericNode/components/NodeOutputParameter/NodeOutputs.tsx index 2a0c24bf4..eb8e556d4 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/NodeOutputParameter/NodeOutputs.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/NodeOutputParameter/NodeOutputs.tsx @@ -79,15 +79,8 @@ export default function NodeOutputs({ ? outputs.filter((output) => output.hidden) : outputs.filter((output) => !output.hidden); - if (selectedOutput) { - return ( - filteredOutputs.find((output) => output.name === selectedOutput.name) || - filteredOutputs[0] - ); - } - const outputWithSelection = filteredOutputs.find( - (output) => output.selected, + (output) => output.name === selectedOutput?.name, ); return outputWithSelection || filteredOutputs[0]; diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 6e5cb7b36..31c9c7d8b 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -259,7 +259,10 @@ function GenericNode({ }, [data.node?.outputs]); const [selectedOutput, setSelectedOutput] = useState( - () => data.node?.outputs?.find((output) => output.selected) || null, + () => + data.node?.outputs?.find( + (output) => output.name === data?.selected_output, + ) || null, ); const handleSelectOutput = useCallback( diff --git a/src/frontend/src/types/flow/index.ts b/src/frontend/src/types/flow/index.ts index 814198178..455778105 100644 --- a/src/frontend/src/types/flow/index.ts +++ b/src/frontend/src/types/flow/index.ts @@ -68,6 +68,7 @@ export type NodeDataType = { output_types?: string[]; selected_output_type?: string; buildStatus?: BuildStatus; + selected_output?: string; }; export type EdgeType = Edge; diff --git a/src/frontend/tests/core/features/tweaksTest.spec.ts b/src/frontend/tests/core/features/tweaksTest.spec.ts index f628b1d55..9f6734324 100644 --- a/src/frontend/tests/core/features/tweaksTest.spec.ts +++ b/src/frontend/tests/core/features/tweaksTest.spec.ts @@ -22,7 +22,7 @@ test( expect(clipboardContent.length).toBeGreaterThan(0); await page.getByTestId("tweaks-button").click(); await page - .getByRole("heading", { name: "OpenAi" }) + .getByRole("heading", { name: "Language Model" }) .locator("div") .first() .click();