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 <gabriel@langflow.org>

* [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 <lucas.edu.oli@hotmail.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
This commit is contained in:
Deon Sanchez 2025-06-13 09:51:37 -06:00 committed by GitHub
commit f091d6373c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 361 additions and 162 deletions

View file

@ -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) | \

View file

@ -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,
},

View file

@ -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",

View file

@ -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,

View file

@ -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"
},

View file

@ -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": {

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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"
},

View file

@ -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",

View file

@ -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"
},

View file

@ -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"
},

View file

@ -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",

View file

@ -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": {

View file

@ -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"
},

View file

@ -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": {

View file

@ -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"
},

View file

@ -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",

View file

@ -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",

View file

@ -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"
},

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -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"
},

View file

@ -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",

View file

@ -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];

View file

@ -259,7 +259,10 @@ function GenericNode({
}, [data.node?.outputs]);
const [selectedOutput, setSelectedOutput] = useState<OutputFieldType | null>(
() => data.node?.outputs?.find((output) => output.selected) || null,
() =>
data.node?.outputs?.find(
(output) => output.name === data?.selected_output,
) || null,
);
const handleSelectOutput = useCallback(

View file

@ -68,6 +68,7 @@ export type NodeDataType = {
output_types?: string[];
selected_output_type?: string;
buildStatus?: BuildStatus;
selected_output?: string;
};
export type EdgeType = Edge<EdgeDataType, "default">;

View file

@ -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();