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 f81c6f77c..7ccd3aec4 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 @@ -7,7 +7,7 @@ "data": { "sourceHandle": { "dataType": "ChatInput", - "id": "ChatInput-0hxgs", + "id": "ChatInput-ODlE4", "name": "message", "output_types": [ "Message" @@ -15,7 +15,7 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "Prompt-xI9hs", + "id": "Prompt-0159s", "inputTypes": [ "Message", "Text" @@ -23,12 +23,12 @@ "type": "str" } }, - "id": "reactflow__edge-ChatInput-0hxgs{œdataTypeœ:œChatInputœ,œidœ:œChatInput-0hxgsœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-Prompt-xI9hs{œfieldNameœ:œinput_valueœ,œidœ:œPrompt-xI9hsœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "id": "reactflow__edge-ChatInput-ODlE4{œdataTypeœ:œChatInputœ,œidœ:œChatInput-ODlE4œ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-Prompt-0159s{œfieldNameœ:œinput_valueœ,œidœ:œPrompt-0159sœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", "selected": false, - "source": "ChatInput-0hxgs", - "sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-0hxgsœ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-xI9hs", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œPrompt-xI9hsœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" + "source": "ChatInput-ODlE4", + "sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-ODlE4œ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}", + "target": "Prompt-0159s", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œPrompt-0159sœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" }, { "animated": false, @@ -36,7 +36,7 @@ "data": { "sourceHandle": { "dataType": "Prompt", - "id": "Prompt-Zc4Af", + "id": "Prompt-Lj4w8", "name": "prompt", "output_types": [ "Message" @@ -44,19 +44,19 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "Agent-Gbt8L", + "id": "Agent-gNoaI", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Prompt-Zc4Af{œdataTypeœ:œPromptœ,œidœ:œPrompt-Zc4Afœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-Agent-Gbt8L{œfieldNameœ:œinput_valueœ,œidœ:œAgent-Gbt8Lœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "id": "reactflow__edge-Prompt-Lj4w8{œdataTypeœ:œPromptœ,œidœ:œPrompt-Lj4w8œ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-Agent-gNoaI{œfieldNameœ:œinput_valueœ,œidœ:œAgent-gNoaIœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", "selected": false, - "source": "Prompt-Zc4Af", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-Zc4Afœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "Agent-Gbt8L", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œAgent-Gbt8Lœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "source": "Prompt-Lj4w8", + "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-Lj4w8œ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", + "target": "Agent-gNoaI", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œAgent-gNoaIœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "animated": false, @@ -64,7 +64,7 @@ "data": { "sourceHandle": { "dataType": "Agent", - "id": "Agent-Gbt8L", + "id": "Agent-gNoaI", "name": "response", "output_types": [ "Message" @@ -72,7 +72,7 @@ }, "targetHandle": { "fieldName": "search_results", - "id": "Prompt-xI9hs", + "id": "Prompt-0159s", "inputTypes": [ "Message", "Text" @@ -80,19 +80,19 @@ "type": "str" } }, - "id": "reactflow__edge-Agent-Gbt8L{œdataTypeœ:œAgentœ,œidœ:œAgent-Gbt8Lœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-Prompt-xI9hs{œfieldNameœ:œsearch_resultsœ,œidœ:œPrompt-xI9hsœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "id": "reactflow__edge-Agent-gNoaI{œdataTypeœ:œAgentœ,œidœ:œAgent-gNoaIœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-Prompt-0159s{œfieldNameœ:œsearch_resultsœ,œidœ:œPrompt-0159sœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", "selected": false, - "source": "Agent-Gbt8L", - "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-Gbt8Lœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-xI9hs", - "targetHandle": "{œfieldNameœ: œsearch_resultsœ, œidœ: œPrompt-xI9hsœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" + "source": "Agent-gNoaI", + "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-gNoaIœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", + "target": "Prompt-0159s", + "targetHandle": "{œfieldNameœ: œsearch_resultsœ, œidœ: œPrompt-0159sœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" }, { "className": "", "data": { "sourceHandle": { "dataType": "TavilySearchComponent", - "id": "TavilySearchComponent-622t2", + "id": "TavilySearchComponent-dk7WW", "name": "component_as_tool", "output_types": [ "Tool" @@ -100,25 +100,25 @@ }, "targetHandle": { "fieldName": "tools", - "id": "Agent-Gbt8L", + "id": "Agent-gNoaI", "inputTypes": [ "Tool" ], "type": "other" } }, - "id": "reactflow__edge-TavilySearchComponent-622t2{œdataTypeœ:œTavilySearchComponentœ,œidœ:œTavilySearchComponent-622t2œ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-Gbt8L{œfieldNameœ:œtoolsœ,œidœ:œAgent-Gbt8Lœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", - "source": "TavilySearchComponent-622t2", - "sourceHandle": "{œdataTypeœ: œTavilySearchComponentœ, œidœ: œTavilySearchComponent-622t2œ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", - "target": "Agent-Gbt8L", - "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-Gbt8Lœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" + "id": "reactflow__edge-TavilySearchComponent-dk7WW{œdataTypeœ:œTavilySearchComponentœ,œidœ:œTavilySearchComponent-dk7WWœ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-gNoaI{œfieldNameœ:œtoolsœ,œidœ:œAgent-gNoaIœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "source": "TavilySearchComponent-dk7WW", + "sourceHandle": "{œdataTypeœ: œTavilySearchComponentœ, œidœ: œTavilySearchComponent-dk7WWœ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", + "target": "Agent-gNoaI", + "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-gNoaIœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" }, { "className": "", "data": { "sourceHandle": { "dataType": "Prompt", - "id": "Prompt-bxgAA", + "id": "Prompt-5lo5d", "name": "prompt", "output_types": [ "Message" @@ -126,25 +126,25 @@ }, "targetHandle": { "fieldName": "system_message", - "id": "OpenAIModel-iiRQd", + "id": "OpenAIModel-1sVXW", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Prompt-bxgAA{œdataTypeœ:œPromptœ,œidœ:œPrompt-bxgAAœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-iiRQd{œfieldNameœ:œsystem_messageœ,œidœ:œOpenAIModel-iiRQdœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Prompt-bxgAA", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-bxgAAœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "OpenAIModel-iiRQd", - "targetHandle": "{œfieldNameœ: œsystem_messageœ, œidœ: œOpenAIModel-iiRQdœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Prompt-5lo5d{œdataTypeœ:œPromptœ,œidœ:œPrompt-5lo5dœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-1sVXW{œfieldNameœ:œsystem_messageœ,œidœ:œOpenAIModel-1sVXWœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "Prompt-5lo5d", + "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-5lo5dœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", + "target": "OpenAIModel-1sVXW", + "targetHandle": "{œfieldNameœ: œsystem_messageœ, œidœ: œOpenAIModel-1sVXWœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "className": "", "data": { "sourceHandle": { "dataType": "ChatInput", - "id": "ChatInput-0hxgs", + "id": "ChatInput-ODlE4", "name": "message", "output_types": [ "Message" @@ -152,25 +152,25 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "OpenAIModel-iiRQd", + "id": "OpenAIModel-1sVXW", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-ChatInput-0hxgs{œdataTypeœ:œChatInputœ,œidœ:œChatInput-0hxgsœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-iiRQd{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-iiRQdœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "ChatInput-0hxgs", - "sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-0hxgsœ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}", - "target": "OpenAIModel-iiRQd", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œOpenAIModel-iiRQdœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-ChatInput-ODlE4{œdataTypeœ:œChatInputœ,œidœ:œChatInput-ODlE4œ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-1sVXW{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-1sVXWœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "ChatInput-ODlE4", + "sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-ODlE4œ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}", + "target": "OpenAIModel-1sVXW", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œOpenAIModel-1sVXWœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "className": "", "data": { "sourceHandle": { "dataType": "OpenAIModel", - "id": "OpenAIModel-iiRQd", + "id": "OpenAIModel-1sVXW", "name": "text_output", "output_types": [ "Message" @@ -178,7 +178,7 @@ }, "targetHandle": { "fieldName": "previous_response", - "id": "Prompt-Zc4Af", + "id": "Prompt-Lj4w8", "inputTypes": [ "Message", "Text" @@ -186,18 +186,18 @@ "type": "str" } }, - "id": "reactflow__edge-OpenAIModel-iiRQd{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-iiRQdœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-Prompt-Zc4Af{œfieldNameœ:œprevious_responseœ,œidœ:œPrompt-Zc4Afœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", - "source": "OpenAIModel-iiRQd", - "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-iiRQdœ, œnameœ: œtext_outputœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-Zc4Af", - "targetHandle": "{œfieldNameœ: œprevious_responseœ, œidœ: œPrompt-Zc4Afœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-OpenAIModel-1sVXW{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-1sVXWœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-Prompt-Lj4w8{œfieldNameœ:œprevious_responseœ,œidœ:œPrompt-Lj4w8œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "source": "OpenAIModel-1sVXW", + "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-1sVXWœ, œnameœ: œtext_outputœ, œoutput_typesœ: [œMessageœ]}", + "target": "Prompt-Lj4w8", + "targetHandle": "{œfieldNameœ: œprevious_responseœ, œidœ: œPrompt-Lj4w8œ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" }, { "className": "", "data": { "sourceHandle": { "dataType": "Prompt", - "id": "Prompt-xI9hs", + "id": "Prompt-0159s", "name": "prompt", "output_types": [ "Message" @@ -205,25 +205,25 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "OpenAIModel-rQIeM", + "id": "OpenAIModel-Rg8Kn", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Prompt-xI9hs{œdataTypeœ:œPromptœ,œidœ:œPrompt-xI9hsœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-rQIeM{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-rQIeMœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Prompt-xI9hs", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-xI9hsœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "OpenAIModel-rQIeM", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œOpenAIModel-rQIeMœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Prompt-0159s{œdataTypeœ:œPromptœ,œidœ:œPrompt-0159sœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-Rg8Kn{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-Rg8Knœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "Prompt-0159s", + "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-0159sœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", + "target": "OpenAIModel-Rg8Kn", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œOpenAIModel-Rg8Knœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "className": "", "data": { "sourceHandle": { "dataType": "Prompt", - "id": "Prompt-ZbmDf", + "id": "Prompt-4HHcE", "name": "prompt", "output_types": [ "Message" @@ -231,25 +231,24 @@ }, "targetHandle": { "fieldName": "system_message", - "id": "OpenAIModel-rQIeM", + "id": "OpenAIModel-Rg8Kn", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Prompt-ZbmDf{œdataTypeœ:œPromptœ,œidœ:œPrompt-ZbmDfœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-rQIeM{œfieldNameœ:œsystem_messageœ,œidœ:œOpenAIModel-rQIeMœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Prompt-ZbmDf", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-ZbmDfœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "OpenAIModel-rQIeM", - "targetHandle": "{œfieldNameœ: œsystem_messageœ, œidœ: œOpenAIModel-rQIeMœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Prompt-4HHcE{œdataTypeœ:œPromptœ,œidœ:œPrompt-4HHcEœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-Rg8Kn{œfieldNameœ:œsystem_messageœ,œidœ:œOpenAIModel-Rg8Knœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "Prompt-4HHcE", + "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-4HHcEœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", + "target": "OpenAIModel-Rg8Kn", + "targetHandle": "{œfieldNameœ: œsystem_messageœ, œidœ: œOpenAIModel-Rg8Knœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { - "className": "", "data": { "sourceHandle": { "dataType": "OpenAIModel", - "id": "OpenAIModel-rQIeM", + "id": "OpenAIModel-Rg8Kn", "name": "text_output", "output_types": [ "Message" @@ -257,20 +256,20 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "ChatOutput-joWRG", + "id": "ChatOutput-SIV0E", "inputTypes": [ "Data", "DataFrame", "Message" ], - "type": "str" + "type": "other" } }, - "id": "reactflow__edge-OpenAIModel-zDrcf{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-zDrcfœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-joWRG{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-joWRGœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "OpenAIModel-zDrcf", - "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-zDrcfœ, œnameœ: œtext_outputœ, œoutput_typesœ: [œMessageœ]}", - "target": "ChatOutput-joWRG", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-joWRGœ, œinputTypesœ: [œDataœ, œDataFrameœ, œMessageœ], œtypeœ: œstrœ}" + "id": "xy-edge__OpenAIModel-Rg8Kn{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-Rg8Knœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-SIV0E{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-SIV0Eœ,œinputTypesœ:[œDataœ,œDataFrameœ,œMessageœ],œtypeœ:œotherœ}", + "source": "OpenAIModel-Rg8Kn", + "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-Rg8Knœ, œnameœ: œtext_outputœ, œoutput_typesœ: [œMessageœ]}", + "target": "ChatOutput-SIV0E", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-SIV0Eœ, œinputTypesœ: [œDataœ, œDataFrameœ, œMessageœ], œtypeœ: œotherœ}" } ], "nodes": [ @@ -278,7 +277,7 @@ "data": { "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", - "id": "Prompt-Zc4Af", + "id": "Prompt-Lj4w8", "node": { "base_classes": [ "Message" @@ -409,7 +408,7 @@ }, "dragging": false, "height": 347, - "id": "Prompt-Zc4Af", + "id": "Prompt-Lj4w8", "measured": { "height": 347, "width": 320 @@ -428,7 +427,7 @@ }, { "data": { - "id": "ChatInput-0hxgs", + "id": "ChatInput-ODlE4", "node": { "base_classes": [ "Message" @@ -704,7 +703,7 @@ }, "dragging": false, "height": 234, - "id": "ChatInput-0hxgs", + "id": "ChatInput-ODlE4", "measured": { "height": 234, "width": 320 @@ -721,314 +720,11 @@ "type": "genericNode", "width": 320 }, - { - "data": { - "description": "Display a chat message in the Playground.", - "display_name": "Chat Output", - "id": "ChatOutput-C4LXq", - "node": { - "base_classes": [ - "Message" - ], - "beta": false, - "conditional_paths": [], - "custom_fields": {}, - "description": "Display a chat message in the Playground.", - "display_name": "Chat Output", - "documentation": "", - "edited": false, - "field_order": [ - "input_value", - "should_store_message", - "sender", - "sender_name", - "session_id", - "data_template", - "background_color", - "chat_icon", - "text_color" - ], - "frozen": false, - "icon": "MessagesSquare", - "legacy": false, - "lf_version": "1.0.19.post2", - "metadata": {}, - "output_types": [], - "outputs": [ - { - "allows_loop": false, - "cache": true, - "display_name": "Message", - "method": "message_response", - "name": "message", - "selected": "Message", - "tool_mode": true, - "types": [ - "Message" - ], - "value": "__UNDEFINED__" - } - ], - "pinned": false, - "template": { - "_type": "Component", - "background_color": { - "_input_type": "MessageTextInput", - "advanced": true, - "display_name": "Background Color", - "dynamic": false, - "info": "The background color of the icon.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "name": "background_color", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "chat_icon": { - "_input_type": "MessageTextInput", - "advanced": true, - "display_name": "Icon", - "dynamic": false, - "info": "The icon of the message.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "name": "chat_icon", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "clean_data": { - "_input_type": "BoolInput", - "advanced": true, - "display_name": "Basic Clean Data", - "dynamic": false, - "info": "Whether to clean the data", - "list": false, - "list_add_label": "Add More", - "name": "clean_data", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "bool", - "value": true - }, - "code": { - "advanced": true, - "dynamic": true, - "fileTypes": [], - "file_path": "", - "info": "", - "list": false, - "load_from_db": false, - "multiline": true, - "name": "code", - "password": false, - "placeholder": "", - "required": true, - "show": true, - "title_case": false, - "type": "code", - "value": "from typing import Any\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.inputs import BoolInput\nfrom langflow.inputs.inputs import HandleInput\nfrom langflow.io import DropdownInput, MessageTextInput, Output\nfrom langflow.schema.data import Data\nfrom langflow.schema.dataframe import DataFrame\nfrom langflow.schema.message import Message\nfrom langflow.schema.properties import Source\nfrom langflow.utils.constants import (\n MESSAGE_SENDER_AI,\n MESSAGE_SENDER_NAME_AI,\n MESSAGE_SENDER_USER,\n)\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"MessagesSquare\"\n name = \"ChatOutput\"\n minimized = True\n\n inputs = [\n HandleInput(\n name=\"input_value\",\n display_name=\"Text\",\n info=\"Message to be passed as output.\",\n input_types=[\"Data\", \"DataFrame\", \"Message\"],\n required=True,\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n MessageTextInput(\n name=\"background_color\",\n display_name=\"Background Color\",\n info=\"The background color of the icon.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"chat_icon\",\n display_name=\"Icon\",\n info=\"The icon of the message.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"text_color\",\n display_name=\"Text Color\",\n info=\"The text color of the name\",\n advanced=True,\n ),\n BoolInput(\n name=\"clean_data\",\n display_name=\"Basic Clean Data\",\n value=True,\n info=\"Whether to clean the data\",\n advanced=True,\n ),\n ]\n outputs = [\n Output(\n display_name=\"Message\",\n name=\"message\",\n method=\"message_response\",\n ),\n ]\n\n def _build_source(self, id_: str | None, display_name: str | None, source: str | None) -> Source:\n source_dict = {}\n if id_:\n source_dict[\"id\"] = id_\n if display_name:\n source_dict[\"display_name\"] = display_name\n if source:\n # Handle case where source is a ChatOpenAI object\n if hasattr(source, \"model_name\"):\n source_dict[\"source\"] = source.model_name\n elif hasattr(source, \"model\"):\n source_dict[\"source\"] = str(source.model)\n else:\n source_dict[\"source\"] = str(source)\n return Source(**source_dict)\n\n async def message_response(self) -> Message:\n # First convert the input to string if needed\n text = self.convert_to_string()\n\n # Get source properties\n source, icon, display_name, source_id = self.get_properties_from_source_component()\n background_color = self.background_color\n text_color = self.text_color\n if self.chat_icon:\n icon = self.chat_icon\n\n # Create or use existing Message object\n if isinstance(self.input_value, Message):\n message = self.input_value\n # Update message properties\n message.text = text\n else:\n message = Message(text=text)\n\n # Set message properties\n message.sender = self.sender\n message.sender_name = self.sender_name\n message.session_id = self.session_id\n message.flow_id = self.graph.flow_id if hasattr(self, \"graph\") else None\n message.properties.source = self._build_source(source_id, display_name, source)\n message.properties.icon = icon\n message.properties.background_color = background_color\n message.properties.text_color = text_color\n\n # Store message if needed\n if self.session_id and self.should_store_message:\n stored_message = await self.send_message(message)\n self.message.value = stored_message\n message = stored_message\n\n self.status = message\n return message\n\n def _validate_input(self) -> None:\n \"\"\"Validate the input data and raise ValueError if invalid.\"\"\"\n if self.input_value is None:\n msg = \"Input data cannot be None\"\n raise ValueError(msg)\n if not isinstance(self.input_value, Data | DataFrame | Message | str | list):\n msg = f\"Expected Data or DataFrame or Message or str, got {type(self.input_value).__name__}\"\n raise TypeError(msg)\n\n def _safe_convert(self, data: Any) -> str:\n \"\"\"Safely convert input data to string.\"\"\"\n try:\n if isinstance(data, str):\n return data\n if isinstance(data, Message):\n return data.get_text()\n if isinstance(data, Data):\n if data.get_text() is None:\n msg = \"Empty Data object\"\n raise ValueError(msg)\n return data.get_text()\n if isinstance(data, DataFrame):\n if self.clean_data:\n # Remove empty rows\n data = data.dropna(how=\"all\")\n # Remove empty lines in each cell\n data = data.replace(r\"^\\s*$\", \"\", regex=True)\n # Replace multiple newlines with a single newline\n data = data.replace(r\"\\n+\", \"\\n\", regex=True)\n return data.to_markdown(index=False)\n return str(data)\n except (ValueError, TypeError, AttributeError) as e:\n msg = f\"Error converting data: {e!s}\"\n raise ValueError(msg) from e\n\n def convert_to_string(self) -> str:\n \"\"\"Convert input data to string with proper error handling.\"\"\"\n self._validate_input()\n if isinstance(self.input_value, list):\n return \"\\n\".join([self._safe_convert(item) for item in self.input_value])\n return self._safe_convert(self.input_value)\n" - }, - "data_template": { - "_input_type": "MessageTextInput", - "advanced": true, - "display_name": "Data Template", - "dynamic": false, - "info": "Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "name": "data_template", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "{text}" - }, - "input_value": { - "_input_type": "MessageInput", - "advanced": false, - "display_name": "Text", - "dynamic": false, - "info": "Message to be passed as output.", - "input_types": [ - "Data", - "DataFrame", - "Message" - ], - "list": false, - "load_from_db": false, - "name": "input_value", - "placeholder": "", - "required": true, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "sender": { - "_input_type": "DropdownInput", - "advanced": true, - "combobox": false, - "display_name": "Sender Type", - "dynamic": false, - "info": "Type of sender.", - "name": "sender", - "options": [ - "Machine", - "User" - ], - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "str", - "value": "Machine" - }, - "sender_name": { - "_input_type": "MessageTextInput", - "advanced": true, - "display_name": "Sender Name", - "dynamic": false, - "info": "Name of the sender.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "name": "sender_name", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "AI" - }, - "session_id": { - "_input_type": "MessageTextInput", - "advanced": true, - "display_name": "Session ID", - "dynamic": false, - "info": "The session ID of the chat. If empty, the current session ID parameter will be used.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "name": "session_id", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "should_store_message": { - "_input_type": "BoolInput", - "advanced": true, - "display_name": "Store Messages", - "dynamic": false, - "info": "Store the message in the history.", - "list": false, - "name": "should_store_message", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": true - }, - "text_color": { - "_input_type": "MessageTextInput", - "advanced": true, - "display_name": "Text Color", - "dynamic": false, - "info": "The text color of the name", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "name": "text_color", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - } - }, - "tool_mode": false - }, - "type": "ChatOutput" - }, - "dragging": true, - "height": 234, - "id": "ChatOutput-C4LXq", - "measured": { - "height": 234, - "width": 320 - }, - "position": { - "x": 3235.4806463111895, - "y": 851.4173191525891 - }, - "positionAbsolute": { - "x": 3200.774558432761, - "y": 853.9881404769172 - }, - "selected": false, - "type": "genericNode", - "width": 320 - }, { "data": { "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", - "id": "Prompt-xI9hs", + "id": "Prompt-0159s", "node": { "base_classes": [ "Message" @@ -1183,7 +879,7 @@ }, "dragging": false, "height": 433, - "id": "Prompt-xI9hs", + "id": "Prompt-0159s", "measured": { "height": 433, "width": 320 @@ -1202,7 +898,7 @@ }, { "data": { - "id": "note-opQtx", + "id": "note-466wP", "node": { "description": "# Research Agent \n\nWelcome to the Research Agent! This flow helps you conduct in-depth research on various topics using AI-powered tools and analysis.\n\n## Instructions\n1. Enter Your Research Query\n - Type your research question or topic into the Chat Input node.\n - Be specific and clear about what you want to investigate.\n\n2. Generate Research Plan\n - The system will create a focused research plan based on your query.\n - This plan includes key search queries and priorities.\n\n3. Conduct Web Search\n - The Tavily AI Search tool will perform web searches using the generated queries.\n - It focuses on finding academic and reliable sources.\n\n4. Analyze and Synthesize\n - The AI agent will review the search results and create a comprehensive synthesis.\n - The report includes an executive summary, methodology, findings, and conclusions.\n\n5. Review the Output\n - Read the final report in the Chat Output node.\n - Use this information as a starting point for further research or decision-making.\n\nRemember: You can refine your initial query for more specific results! 🔍📊", "display_name": "", @@ -1215,7 +911,7 @@ }, "dragging": false, "height": 694, - "id": "note-opQtx", + "id": "note-466wP", "measured": { "height": 694, "width": 325 @@ -1241,7 +937,7 @@ "data": { "description": "Define the agent's instructions, then enter a task to complete using tools.", "display_name": "Agent", - "id": "Agent-Gbt8L", + "id": "Agent-gNoaI", "node": { "base_classes": [ "Message" @@ -1391,7 +1087,7 @@ "show": true, "title_case": false, "type": "str", - "value": "OPENAI_API_KEY" + "value": "" }, "code": { "advanced": true, @@ -1840,7 +1536,7 @@ }, "dragging": false, "height": 658, - "id": "Agent-Gbt8L", + "id": "Agent-gNoaI", "measured": { "height": 658, "width": 320 @@ -1861,7 +1557,7 @@ "data": { "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", - "id": "Prompt-bxgAA", + "id": "Prompt-5lo5d", "node": { "base_classes": [ "Message" @@ -1967,7 +1663,7 @@ }, "dragging": false, "height": 260, - "id": "Prompt-bxgAA", + "id": "Prompt-5lo5d", "measured": { "height": 260, "width": 320 @@ -1988,7 +1684,7 @@ "data": { "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", - "id": "Prompt-ZbmDf", + "id": "Prompt-4HHcE", "node": { "base_classes": [ "Message" @@ -2094,7 +1790,7 @@ }, "dragging": false, "height": 260, - "id": "Prompt-ZbmDf", + "id": "Prompt-4HHcE", "measured": { "height": 260, "width": 320 @@ -2113,7 +1809,7 @@ }, { "data": { - "id": "note-6tIRa", + "id": "note-OqZYf", "node": { "description": "# 🔑 Tavily AI Search Needs API Key\n\nYou can get 1000 searches/month free [here](https://tavily.com/) ", "display_name": "", @@ -2126,7 +1822,7 @@ }, "dragging": false, "height": 325, - "id": "note-6tIRa", + "id": "note-OqZYf", "measured": { "height": 325, "width": 326 @@ -2145,7 +1841,7 @@ }, { "data": { - "id": "TavilySearchComponent-622t2", + "id": "TavilySearchComponent-dk7WW", "node": { "base_classes": [ "Data", @@ -2203,7 +1899,7 @@ "input_types": [ "Message" ], - "load_from_db": true, + "load_from_db": false, "name": "api_key", "password": true, "placeholder": "", @@ -2211,7 +1907,7 @@ "show": true, "title_case": false, "type": "str", - "value": "TAVILY_API_KEY" + "value": "" }, "code": { "advanced": true, @@ -2480,9 +2176,9 @@ "type": "TavilySearchComponent" }, "dragging": false, - "id": "TavilySearchComponent-622t2", + "id": "TavilySearchComponent-dk7WW", "measured": { - "height": 435, + "height": 437, "width": 320 }, "position": { @@ -2494,7 +2190,7 @@ }, { "data": { - "id": "OpenAIModel-iiRQd", + "id": "OpenAIModel-1sVXW", "node": { "base_classes": [ "LanguageModel", @@ -2581,7 +2277,7 @@ "show": true, "title_case": false, "type": "str", - "value": "OPENAI_API_KEY" + "value": "" }, "code": { "advanced": true, @@ -2862,9 +2558,9 @@ "type": "OpenAIModel" }, "dragging": false, - "id": "OpenAIModel-iiRQd", + "id": "OpenAIModel-1sVXW", "measured": { - "height": 653, + "height": 656, "width": 320 }, "position": { @@ -2876,7 +2572,7 @@ }, { "data": { - "id": "OpenAIModel-rQIeM", + "id": "OpenAIModel-Rg8Kn", "node": { "base_classes": [ "LanguageModel", @@ -2963,7 +2659,7 @@ "show": true, "title_case": false, "type": "str", - "value": "OPENAI_API_KEY" + "value": "" }, "code": { "advanced": true, @@ -3244,9 +2940,9 @@ "type": "OpenAIModel" }, "dragging": false, - "id": "OpenAIModel-rQIeM", + "id": "OpenAIModel-Rg8Kn", "measured": { - "height": 653, + "height": 656, "width": 320 }, "position": { @@ -3255,21 +2951,329 @@ }, "selected": false, "type": "genericNode" + }, + { + "data": { + "id": "ChatOutput-SIV0E", + "node": { + "base_classes": [ + "Message" + ], + "beta": false, + "category": "outputs", + "conditional_paths": [], + "custom_fields": {}, + "description": "Display a chat message in the Playground.", + "display_name": "Chat Output", + "documentation": "", + "edited": false, + "field_order": [ + "input_value", + "should_store_message", + "sender", + "sender_name", + "session_id", + "data_template", + "background_color", + "chat_icon", + "text_color", + "clean_data" + ], + "frozen": false, + "icon": "MessagesSquare", + "key": "ChatOutput", + "legacy": false, + "metadata": {}, + "minimized": true, + "output_types": [], + "outputs": [ + { + "allows_loop": false, + "cache": true, + "display_name": "Message", + "method": "message_response", + "name": "message", + "selected": "Message", + "tool_mode": true, + "types": [ + "Message" + ], + "value": "__UNDEFINED__" + } + ], + "pinned": false, + "score": 0.003169567463043492, + "template": { + "_type": "Component", + "background_color": { + "_input_type": "MessageTextInput", + "advanced": true, + "display_name": "Background Color", + "dynamic": false, + "info": "The background color of the icon.", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "background_color", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "" + }, + "chat_icon": { + "_input_type": "MessageTextInput", + "advanced": true, + "display_name": "Icon", + "dynamic": false, + "info": "The icon of the message.", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "chat_icon", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "" + }, + "clean_data": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Basic Clean Data", + "dynamic": false, + "info": "Whether to clean the data", + "list": false, + "list_add_label": "Add More", + "name": "clean_data", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "bool", + "value": true + }, + "code": { + "advanced": true, + "dynamic": true, + "fileTypes": [], + "file_path": "", + "info": "", + "list": false, + "load_from_db": false, + "multiline": true, + "name": "code", + "password": false, + "placeholder": "", + "required": true, + "show": true, + "title_case": false, + "type": "code", + "value": "from typing import Any\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.inputs import BoolInput\nfrom langflow.inputs.inputs import HandleInput\nfrom langflow.io import DropdownInput, MessageTextInput, Output\nfrom langflow.schema.data import Data\nfrom langflow.schema.dataframe import DataFrame\nfrom langflow.schema.message import Message\nfrom langflow.schema.properties import Source\nfrom langflow.utils.constants import (\n MESSAGE_SENDER_AI,\n MESSAGE_SENDER_NAME_AI,\n MESSAGE_SENDER_USER,\n)\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"MessagesSquare\"\n name = \"ChatOutput\"\n minimized = True\n\n inputs = [\n HandleInput(\n name=\"input_value\",\n display_name=\"Text\",\n info=\"Message to be passed as output.\",\n input_types=[\"Data\", \"DataFrame\", \"Message\"],\n required=True,\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n MessageTextInput(\n name=\"background_color\",\n display_name=\"Background Color\",\n info=\"The background color of the icon.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"chat_icon\",\n display_name=\"Icon\",\n info=\"The icon of the message.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"text_color\",\n display_name=\"Text Color\",\n info=\"The text color of the name\",\n advanced=True,\n ),\n BoolInput(\n name=\"clean_data\",\n display_name=\"Basic Clean Data\",\n value=True,\n info=\"Whether to clean the data\",\n advanced=True,\n ),\n ]\n outputs = [\n Output(\n display_name=\"Message\",\n name=\"message\",\n method=\"message_response\",\n ),\n ]\n\n def _build_source(self, id_: str | None, display_name: str | None, source: str | None) -> Source:\n source_dict = {}\n if id_:\n source_dict[\"id\"] = id_\n if display_name:\n source_dict[\"display_name\"] = display_name\n if source:\n # Handle case where source is a ChatOpenAI object\n if hasattr(source, \"model_name\"):\n source_dict[\"source\"] = source.model_name\n elif hasattr(source, \"model\"):\n source_dict[\"source\"] = str(source.model)\n else:\n source_dict[\"source\"] = str(source)\n return Source(**source_dict)\n\n async def message_response(self) -> Message:\n # First convert the input to string if needed\n text = self.convert_to_string()\n\n # Get source properties\n source, icon, display_name, source_id = self.get_properties_from_source_component()\n background_color = self.background_color\n text_color = self.text_color\n if self.chat_icon:\n icon = self.chat_icon\n\n # Create or use existing Message object\n if isinstance(self.input_value, Message):\n message = self.input_value\n # Update message properties\n message.text = text\n else:\n message = Message(text=text)\n\n # Set message properties\n message.sender = self.sender\n message.sender_name = self.sender_name\n message.session_id = self.session_id\n message.flow_id = self.graph.flow_id if hasattr(self, \"graph\") else None\n message.properties.source = self._build_source(source_id, display_name, source)\n message.properties.icon = icon\n message.properties.background_color = background_color\n message.properties.text_color = text_color\n\n # Store message if needed\n if self.session_id and self.should_store_message:\n stored_message = await self.send_message(message)\n self.message.value = stored_message\n message = stored_message\n\n self.status = message\n return message\n\n def _validate_input(self) -> None:\n \"\"\"Validate the input data and raise ValueError if invalid.\"\"\"\n if self.input_value is None:\n msg = \"Input data cannot be None\"\n raise ValueError(msg)\n if not isinstance(self.input_value, Data | DataFrame | Message | str | list):\n msg = f\"Expected Data or DataFrame or Message or str, got {type(self.input_value).__name__}\"\n raise TypeError(msg)\n\n def _safe_convert(self, data: Any) -> str:\n \"\"\"Safely convert input data to string.\"\"\"\n try:\n if isinstance(data, str):\n return data\n if isinstance(data, Message):\n return data.get_text()\n if isinstance(data, Data):\n if data.get_text() is None:\n msg = \"Empty Data object\"\n raise ValueError(msg)\n return data.get_text()\n if isinstance(data, DataFrame):\n if self.clean_data:\n # Remove empty rows\n data = data.dropna(how=\"all\")\n # Remove empty lines in each cell\n data = data.replace(r\"^\\s*$\", \"\", regex=True)\n # Replace multiple newlines with a single newline\n data = data.replace(r\"\\n+\", \"\\n\", regex=True)\n return data.to_markdown(index=False)\n return str(data)\n except (ValueError, TypeError, AttributeError) as e:\n msg = f\"Error converting data: {e!s}\"\n raise ValueError(msg) from e\n\n def convert_to_string(self) -> str:\n \"\"\"Convert input data to string with proper error handling.\"\"\"\n self._validate_input()\n if isinstance(self.input_value, list):\n return \"\\n\".join([self._safe_convert(item) for item in self.input_value])\n return self._safe_convert(self.input_value)\n" + }, + "data_template": { + "_input_type": "MessageTextInput", + "advanced": true, + "display_name": "Data Template", + "dynamic": false, + "info": "Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "data_template", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "{text}" + }, + "input_value": { + "_input_type": "HandleInput", + "advanced": false, + "display_name": "Text", + "dynamic": false, + "info": "Message to be passed as output.", + "input_types": [ + "Data", + "DataFrame", + "Message" + ], + "list": false, + "list_add_label": "Add More", + "name": "input_value", + "placeholder": "", + "required": true, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "other", + "value": "" + }, + "sender": { + "_input_type": "DropdownInput", + "advanced": true, + "combobox": false, + "dialog_inputs": {}, + "display_name": "Sender Type", + "dynamic": false, + "info": "Type of sender.", + "name": "sender", + "options": [ + "Machine", + "User" + ], + "options_metadata": [], + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "str", + "value": "Machine" + }, + "sender_name": { + "_input_type": "MessageTextInput", + "advanced": true, + "display_name": "Sender Name", + "dynamic": false, + "info": "Name of the sender.", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "sender_name", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "AI" + }, + "session_id": { + "_input_type": "MessageTextInput", + "advanced": true, + "display_name": "Session ID", + "dynamic": false, + "info": "The session ID of the chat. If empty, the current session ID parameter will be used.", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "session_id", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "" + }, + "should_store_message": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Store Messages", + "dynamic": false, + "info": "Store the message in the history.", + "list": false, + "list_add_label": "Add More", + "name": "should_store_message", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "bool", + "value": true + }, + "text_color": { + "_input_type": "MessageTextInput", + "advanced": true, + "display_name": "Text Color", + "dynamic": false, + "info": "The text color of the name", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "text_color", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "" + } + }, + "tool_mode": false + }, + "showNode": false, + "type": "ChatOutput" + }, + "id": "ChatOutput-SIV0E", + "measured": { + "height": 66, + "width": 192 + }, + "position": { + "x": 3330, + "y": 915 + }, + "selected": false, + "type": "genericNode" } ], "viewport": { - "x": -142.70651359434498, - "y": 380.220352308604, - "zoom": 0.4057953245174196 + "x": -906.5696913524712, + "y": -68.8894615401914, + "zoom": 0.6316332602024672 } }, "description": "Agent that generates focused plans, conducts web searches, and synthesizes findings into comprehensive reports.", "endpoint_name": null, "gradient": "5", "icon": "TextSearchIcon", - "id": "67b16861-1344-465b-963a-c1c338623438", + "id": "a793f011-2a1f-4aba-b813-7a3be49f4ea2", "is_component": false, - "last_tested_version": "1.0.19.post2", + "last_tested_version": "1.1.5", "name": "Research Agent", "tags": [ "assistants", 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 similarity index 96% rename from src/backend/base/langflow/initial_setup/starter_projects/Sequential Tasks Agents .json rename to src/backend/base/langflow/initial_setup/starter_projects/Sequential Tasks Agents.json index 8b1649f3b..85aba0a51 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 @@ -7,7 +7,7 @@ "data": { "sourceHandle": { "dataType": "Prompt", - "id": "Prompt-0tvfj", + "id": "Prompt-KQVLR", "name": "prompt", "output_types": [ "Message" @@ -15,18 +15,18 @@ }, "targetHandle": { "fieldName": "system_prompt", - "id": "Agent-uHv68", + "id": "Agent-mzPNm", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Prompt-0tvfj{œdataTypeœ:œPromptœ,œidœ:œPrompt-0tvfjœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-Agent-uHv68{œfieldNameœ:œsystem_promptœ,œidœ:œAgent-uHv68œ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Prompt-0tvfj", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-0tvfjœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "Agent-uHv68", - "targetHandle": "{œfieldNameœ: œsystem_promptœ, œidœ: œAgent-uHv68œ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Prompt-KQVLR{œdataTypeœ:œPromptœ,œidœ:œPrompt-KQVLRœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-Agent-mzPNm{œfieldNameœ:œsystem_promptœ,œidœ:œAgent-mzPNmœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "Prompt-KQVLR", + "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-KQVLRœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", + "target": "Agent-mzPNm", + "targetHandle": "{œfieldNameœ: œsystem_promptœ, œidœ: œAgent-mzPNmœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "animated": false, @@ -34,7 +34,7 @@ "data": { "sourceHandle": { "dataType": "Prompt", - "id": "Prompt-YbDgD", + "id": "Prompt-zC2bp", "name": "prompt", "output_types": [ "Message" @@ -42,18 +42,18 @@ }, "targetHandle": { "fieldName": "system_prompt", - "id": "Agent-uO2c7", + "id": "Agent-PNvaZ", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Prompt-YbDgD{œdataTypeœ:œPromptœ,œidœ:œPrompt-YbDgDœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-Agent-uO2c7{œfieldNameœ:œsystem_promptœ,œidœ:œAgent-uO2c7œ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Prompt-YbDgD", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-YbDgDœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "Agent-uO2c7", - "targetHandle": "{œfieldNameœ: œsystem_promptœ, œidœ: œAgent-uO2c7œ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Prompt-zC2bp{œdataTypeœ:œPromptœ,œidœ:œPrompt-zC2bpœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-Agent-PNvaZ{œfieldNameœ:œsystem_promptœ,œidœ:œAgent-PNvaZœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "Prompt-zC2bp", + "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-zC2bpœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", + "target": "Agent-PNvaZ", + "targetHandle": "{œfieldNameœ: œsystem_promptœ, œidœ: œAgent-PNvaZœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "animated": false, @@ -61,36 +61,7 @@ "data": { "sourceHandle": { "dataType": "Agent", - "id": "Agent-uHv68", - "name": "response", - "output_types": [ - "Message" - ] - }, - "targetHandle": { - "fieldName": "input_value", - "id": "ChatOutput-DqyyQ", - "inputTypes": [ - "Data", - "DataFrame", - "Message" - ], - "type": "str" - } - }, - "id": "reactflow__edge-Agent-9YXRo{œdataTypeœ:œAgentœ,œidœ:œAgent-9YXRoœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-DqyyQ{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-DqyyQœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Agent-9YXRo", - "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-9YXRoœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", - "target": "ChatOutput-DqyyQ", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-DqyyQœ, œinputTypesœ: [œDataœ, œDataFrameœ, œMessageœ], œtypeœ: œstrœ}" - }, - { - "animated": false, - "className": "", - "data": { - "sourceHandle": { - "dataType": "Agent", - "id": "Agent-uO2c7", + "id": "Agent-PNvaZ", "name": "response", "output_types": [ "Message" @@ -98,7 +69,7 @@ }, "targetHandle": { "fieldName": "finance_agent_output", - "id": "Prompt-0tvfj", + "id": "Prompt-KQVLR", "inputTypes": [ "Message", "Text" @@ -106,11 +77,11 @@ "type": "str" } }, - "id": "reactflow__edge-Agent-uO2c7{œdataTypeœ:œAgentœ,œidœ:œAgent-uO2c7œ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-Prompt-0tvfj{œfieldNameœ:œfinance_agent_outputœ,œidœ:œPrompt-0tvfjœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", - "source": "Agent-uO2c7", - "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-uO2c7œ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-0tvfj", - "targetHandle": "{œfieldNameœ: œfinance_agent_outputœ, œidœ: œPrompt-0tvfjœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Agent-PNvaZ{œdataTypeœ:œAgentœ,œidœ:œAgent-PNvaZœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-Prompt-KQVLR{œfieldNameœ:œfinance_agent_outputœ,œidœ:œPrompt-KQVLRœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "source": "Agent-PNvaZ", + "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-PNvaZœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", + "target": "Prompt-KQVLR", + "targetHandle": "{œfieldNameœ: œfinance_agent_outputœ, œidœ: œPrompt-KQVLRœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" }, { "animated": false, @@ -118,7 +89,7 @@ "data": { "sourceHandle": { "dataType": "ChatInput", - "id": "ChatInput-yzskz", + "id": "ChatInput-ZyZgH", "name": "message", "output_types": [ "Message" @@ -126,18 +97,18 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "Agent-6Gznl", + "id": "Agent-58C6Q", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-ChatInput-yzskz{œdataTypeœ:œChatInputœ,œidœ:œChatInput-yzskzœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-Agent-6Gznl{œfieldNameœ:œinput_valueœ,œidœ:œAgent-6Gznlœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "ChatInput-yzskz", - "sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-yzskzœ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}", - "target": "Agent-6Gznl", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œAgent-6Gznlœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-ChatInput-ZyZgH{œdataTypeœ:œChatInputœ,œidœ:œChatInput-ZyZgHœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-Agent-58C6Q{œfieldNameœ:œinput_valueœ,œidœ:œAgent-58C6Qœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "ChatInput-ZyZgH", + "sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-ZyZgHœ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}", + "target": "Agent-58C6Q", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œAgent-58C6Qœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "animated": false, @@ -145,7 +116,7 @@ "data": { "sourceHandle": { "dataType": "Prompt", - "id": "Prompt-Sxdul", + "id": "Prompt-b9wSh", "name": "prompt", "output_types": [ "Message" @@ -153,18 +124,18 @@ }, "targetHandle": { "fieldName": "system_prompt", - "id": "Agent-6Gznl", + "id": "Agent-58C6Q", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Prompt-Sxdul{œdataTypeœ:œPromptœ,œidœ:œPrompt-Sxdulœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-Agent-6Gznl{œfieldNameœ:œsystem_promptœ,œidœ:œAgent-6Gznlœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Prompt-Sxdul", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-Sxdulœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "Agent-6Gznl", - "targetHandle": "{œfieldNameœ: œsystem_promptœ, œidœ: œAgent-6Gznlœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Prompt-b9wSh{œdataTypeœ:œPromptœ,œidœ:œPrompt-b9wShœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-Agent-58C6Q{œfieldNameœ:œsystem_promptœ,œidœ:œAgent-58C6Qœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "Prompt-b9wSh", + "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-b9wShœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", + "target": "Agent-58C6Q", + "targetHandle": "{œfieldNameœ: œsystem_promptœ, œidœ: œAgent-58C6Qœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "animated": false, @@ -172,7 +143,7 @@ "data": { "sourceHandle": { "dataType": "Agent", - "id": "Agent-6Gznl", + "id": "Agent-58C6Q", "name": "response", "output_types": [ "Message" @@ -180,18 +151,18 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "Agent-uO2c7", + "id": "Agent-PNvaZ", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Agent-6Gznl{œdataTypeœ:œAgentœ,œidœ:œAgent-6Gznlœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-Agent-uO2c7{œfieldNameœ:œinput_valueœ,œidœ:œAgent-uO2c7œ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Agent-6Gznl", - "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-6Gznlœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", - "target": "Agent-uO2c7", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œAgent-uO2c7œ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Agent-58C6Q{œdataTypeœ:œAgentœ,œidœ:œAgent-58C6Qœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-Agent-PNvaZ{œfieldNameœ:œinput_valueœ,œidœ:œAgent-PNvaZœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "Agent-58C6Q", + "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-58C6Qœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", + "target": "Agent-PNvaZ", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œAgent-PNvaZœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "animated": false, @@ -199,7 +170,7 @@ "data": { "sourceHandle": { "dataType": "Agent", - "id": "Agent-6Gznl", + "id": "Agent-58C6Q", "name": "response", "output_types": [ "Message" @@ -207,7 +178,7 @@ }, "targetHandle": { "fieldName": "research_agent_output", - "id": "Prompt-0tvfj", + "id": "Prompt-KQVLR", "inputTypes": [ "Message", "Text" @@ -215,18 +186,18 @@ "type": "str" } }, - "id": "reactflow__edge-Agent-6Gznl{œdataTypeœ:œAgentœ,œidœ:œAgent-6Gznlœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-Prompt-0tvfj{œfieldNameœ:œresearch_agent_outputœ,œidœ:œPrompt-0tvfjœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", - "source": "Agent-6Gznl", - "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-6Gznlœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-0tvfj", - "targetHandle": "{œfieldNameœ: œresearch_agent_outputœ, œidœ: œPrompt-0tvfjœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Agent-58C6Q{œdataTypeœ:œAgentœ,œidœ:œAgent-58C6Qœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-Prompt-KQVLR{œfieldNameœ:œresearch_agent_outputœ,œidœ:œPrompt-KQVLRœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "source": "Agent-58C6Q", + "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-58C6Qœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", + "target": "Prompt-KQVLR", + "targetHandle": "{œfieldNameœ: œresearch_agent_outputœ, œidœ: œPrompt-KQVLRœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" }, { "className": "", "data": { "sourceHandle": { "dataType": "CalculatorComponent", - "id": "CalculatorComponent-WMC2W", + "id": "CalculatorComponent-idZ9Q", "name": "component_as_tool", "output_types": [ "Tool" @@ -234,25 +205,25 @@ }, "targetHandle": { "fieldName": "tools", - "id": "Agent-uHv68", + "id": "Agent-mzPNm", "inputTypes": [ "Tool" ], "type": "other" } }, - "id": "reactflow__edge-CalculatorComponent-WMC2W{œdataTypeœ:œCalculatorComponentœ,œidœ:œCalculatorComponent-WMC2Wœ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-uHv68{œfieldNameœ:œtoolsœ,œidœ:œAgent-uHv68œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", - "source": "CalculatorComponent-WMC2W", - "sourceHandle": "{œdataTypeœ: œCalculatorComponentœ, œidœ: œCalculatorComponent-WMC2Wœ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", - "target": "Agent-uHv68", - "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-uHv68œ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" + "id": "reactflow__edge-CalculatorComponent-idZ9Q{œdataTypeœ:œCalculatorComponentœ,œidœ:œCalculatorComponent-idZ9Qœ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-mzPNm{œfieldNameœ:œtoolsœ,œidœ:œAgent-mzPNmœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "source": "CalculatorComponent-idZ9Q", + "sourceHandle": "{œdataTypeœ: œCalculatorComponentœ, œidœ: œCalculatorComponent-idZ9Qœ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", + "target": "Agent-mzPNm", + "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-mzPNmœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" }, { "className": "", "data": { "sourceHandle": { "dataType": "YfinanceComponent", - "id": "YfinanceComponent-BIM81", + "id": "YfinanceComponent-uJAk8", "name": "component_as_tool", "output_types": [ "Tool" @@ -260,25 +231,25 @@ }, "targetHandle": { "fieldName": "tools", - "id": "Agent-uO2c7", + "id": "Agent-PNvaZ", "inputTypes": [ "Tool" ], "type": "other" } }, - "id": "reactflow__edge-YfinanceComponent-BIM81{œdataTypeœ:œYfinanceComponentœ,œidœ:œYfinanceComponent-BIM81œ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-uO2c7{œfieldNameœ:œtoolsœ,œidœ:œAgent-uO2c7œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", - "source": "YfinanceComponent-BIM81", - "sourceHandle": "{œdataTypeœ: œYfinanceComponentœ, œidœ: œYfinanceComponent-BIM81œ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", - "target": "Agent-uO2c7", - "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-uO2c7œ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" + "id": "reactflow__edge-YfinanceComponent-uJAk8{œdataTypeœ:œYfinanceComponentœ,œidœ:œYfinanceComponent-uJAk8œ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-PNvaZ{œfieldNameœ:œtoolsœ,œidœ:œAgent-PNvaZœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "source": "YfinanceComponent-uJAk8", + "sourceHandle": "{œdataTypeœ: œYfinanceComponentœ, œidœ: œYfinanceComponent-uJAk8œ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", + "target": "Agent-PNvaZ", + "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-PNvaZœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" }, { "className": "", "data": { "sourceHandle": { "dataType": "TavilySearchComponent", - "id": "TavilySearchComponent-YUDsR", + "id": "TavilySearchComponent-UfEaB", "name": "component_as_tool", "output_types": [ "Tool" @@ -286,329 +257,53 @@ }, "targetHandle": { "fieldName": "tools", - "id": "Agent-6Gznl", + "id": "Agent-58C6Q", "inputTypes": [ "Tool" ], "type": "other" } }, - "id": "reactflow__edge-TavilySearchComponent-YUDsR{œdataTypeœ:œTavilySearchComponentœ,œidœ:œTavilySearchComponent-YUDsRœ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-6Gznl{œfieldNameœ:œtoolsœ,œidœ:œAgent-6Gznlœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", - "source": "TavilySearchComponent-YUDsR", - "sourceHandle": "{œdataTypeœ: œTavilySearchComponentœ, œidœ: œTavilySearchComponent-YUDsRœ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", - "target": "Agent-6Gznl", - "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-6Gznlœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" + "id": "reactflow__edge-TavilySearchComponent-UfEaB{œdataTypeœ:œTavilySearchComponentœ,œidœ:œTavilySearchComponent-UfEaBœ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-58C6Q{œfieldNameœ:œtoolsœ,œidœ:œAgent-58C6Qœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "source": "TavilySearchComponent-UfEaB", + "sourceHandle": "{œdataTypeœ: œTavilySearchComponentœ, œidœ: œTavilySearchComponent-UfEaBœ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", + "target": "Agent-58C6Q", + "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-58C6Qœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" + }, + { + "data": { + "sourceHandle": { + "dataType": "Agent", + "id": "Agent-mzPNm", + "name": "response", + "output_types": [ + "Message" + ] + }, + "targetHandle": { + "fieldName": "input_value", + "id": "ChatOutput-6kq7Z", + "inputTypes": [ + "Data", + "DataFrame", + "Message" + ], + "type": "other" + } + }, + "id": "xy-edge__Agent-mzPNm{œdataTypeœ:œAgentœ,œidœ:œAgent-mzPNmœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-6kq7Z{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-6kq7Zœ,œinputTypesœ:[œDataœ,œDataFrameœ,œMessageœ],œtypeœ:œotherœ}", + "source": "Agent-mzPNm", + "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-mzPNmœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", + "target": "ChatOutput-6kq7Z", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-6kq7Zœ, œinputTypesœ: [œDataœ, œDataFrameœ, œMessageœ], œtypeœ: œotherœ}" } ], "nodes": [ - { - "data": { - "description": "Display a chat message in the Playground.", - "display_name": "Chat Output", - "id": "ChatOutput-aOzn2", - "node": { - "base_classes": [ - "Message" - ], - "beta": false, - "conditional_paths": [], - "custom_fields": {}, - "description": "Display a chat message in the Playground.", - "display_name": "Chat Output", - "documentation": "", - "edited": false, - "field_order": [ - "input_value", - "should_store_message", - "sender", - "sender_name", - "session_id", - "data_template", - "background_color", - "chat_icon", - "text_color" - ], - "frozen": false, - "icon": "MessagesSquare", - "legacy": false, - "lf_version": "1.0.19.post2", - "metadata": {}, - "output_types": [], - "outputs": [ - { - "allows_loop": false, - "cache": true, - "display_name": "Message", - "method": "message_response", - "name": "message", - "selected": "Message", - "tool_mode": true, - "types": [ - "Message" - ], - "value": "__UNDEFINED__" - } - ], - "pinned": false, - "template": { - "_type": "Component", - "background_color": { - "_input_type": "MessageTextInput", - "advanced": true, - "display_name": "Background Color", - "dynamic": false, - "info": "The background color of the icon.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "name": "background_color", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "chat_icon": { - "_input_type": "MessageTextInput", - "advanced": true, - "display_name": "Icon", - "dynamic": false, - "info": "The icon of the message.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "name": "chat_icon", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "clean_data": { - "_input_type": "BoolInput", - "advanced": true, - "display_name": "Basic Clean Data", - "dynamic": false, - "info": "Whether to clean the data", - "list": false, - "list_add_label": "Add More", - "name": "clean_data", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "bool", - "value": true - }, - "code": { - "advanced": true, - "dynamic": true, - "fileTypes": [], - "file_path": "", - "info": "", - "list": false, - "load_from_db": false, - "multiline": true, - "name": "code", - "password": false, - "placeholder": "", - "required": true, - "show": true, - "title_case": false, - "type": "code", - "value": "from typing import Any\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.inputs import BoolInput\nfrom langflow.inputs.inputs import HandleInput\nfrom langflow.io import DropdownInput, MessageTextInput, Output\nfrom langflow.schema.data import Data\nfrom langflow.schema.dataframe import DataFrame\nfrom langflow.schema.message import Message\nfrom langflow.schema.properties import Source\nfrom langflow.utils.constants import (\n MESSAGE_SENDER_AI,\n MESSAGE_SENDER_NAME_AI,\n MESSAGE_SENDER_USER,\n)\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"MessagesSquare\"\n name = \"ChatOutput\"\n minimized = True\n\n inputs = [\n HandleInput(\n name=\"input_value\",\n display_name=\"Text\",\n info=\"Message to be passed as output.\",\n input_types=[\"Data\", \"DataFrame\", \"Message\"],\n required=True,\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n MessageTextInput(\n name=\"background_color\",\n display_name=\"Background Color\",\n info=\"The background color of the icon.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"chat_icon\",\n display_name=\"Icon\",\n info=\"The icon of the message.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"text_color\",\n display_name=\"Text Color\",\n info=\"The text color of the name\",\n advanced=True,\n ),\n BoolInput(\n name=\"clean_data\",\n display_name=\"Basic Clean Data\",\n value=True,\n info=\"Whether to clean the data\",\n advanced=True,\n ),\n ]\n outputs = [\n Output(\n display_name=\"Message\",\n name=\"message\",\n method=\"message_response\",\n ),\n ]\n\n def _build_source(self, id_: str | None, display_name: str | None, source: str | None) -> Source:\n source_dict = {}\n if id_:\n source_dict[\"id\"] = id_\n if display_name:\n source_dict[\"display_name\"] = display_name\n if source:\n # Handle case where source is a ChatOpenAI object\n if hasattr(source, \"model_name\"):\n source_dict[\"source\"] = source.model_name\n elif hasattr(source, \"model\"):\n source_dict[\"source\"] = str(source.model)\n else:\n source_dict[\"source\"] = str(source)\n return Source(**source_dict)\n\n async def message_response(self) -> Message:\n # First convert the input to string if needed\n text = self.convert_to_string()\n\n # Get source properties\n source, icon, display_name, source_id = self.get_properties_from_source_component()\n background_color = self.background_color\n text_color = self.text_color\n if self.chat_icon:\n icon = self.chat_icon\n\n # Create or use existing Message object\n if isinstance(self.input_value, Message):\n message = self.input_value\n # Update message properties\n message.text = text\n else:\n message = Message(text=text)\n\n # Set message properties\n message.sender = self.sender\n message.sender_name = self.sender_name\n message.session_id = self.session_id\n message.flow_id = self.graph.flow_id if hasattr(self, \"graph\") else None\n message.properties.source = self._build_source(source_id, display_name, source)\n message.properties.icon = icon\n message.properties.background_color = background_color\n message.properties.text_color = text_color\n\n # Store message if needed\n if self.session_id and self.should_store_message:\n stored_message = await self.send_message(message)\n self.message.value = stored_message\n message = stored_message\n\n self.status = message\n return message\n\n def _validate_input(self) -> None:\n \"\"\"Validate the input data and raise ValueError if invalid.\"\"\"\n if self.input_value is None:\n msg = \"Input data cannot be None\"\n raise ValueError(msg)\n if not isinstance(self.input_value, Data | DataFrame | Message | str | list):\n msg = f\"Expected Data or DataFrame or Message or str, got {type(self.input_value).__name__}\"\n raise TypeError(msg)\n\n def _safe_convert(self, data: Any) -> str:\n \"\"\"Safely convert input data to string.\"\"\"\n try:\n if isinstance(data, str):\n return data\n if isinstance(data, Message):\n return data.get_text()\n if isinstance(data, Data):\n if data.get_text() is None:\n msg = \"Empty Data object\"\n raise ValueError(msg)\n return data.get_text()\n if isinstance(data, DataFrame):\n if self.clean_data:\n # Remove empty rows\n data = data.dropna(how=\"all\")\n # Remove empty lines in each cell\n data = data.replace(r\"^\\s*$\", \"\", regex=True)\n # Replace multiple newlines with a single newline\n data = data.replace(r\"\\n+\", \"\\n\", regex=True)\n return data.to_markdown(index=False)\n return str(data)\n except (ValueError, TypeError, AttributeError) as e:\n msg = f\"Error converting data: {e!s}\"\n raise ValueError(msg) from e\n\n def convert_to_string(self) -> str:\n \"\"\"Convert input data to string with proper error handling.\"\"\"\n self._validate_input()\n if isinstance(self.input_value, list):\n return \"\\n\".join([self._safe_convert(item) for item in self.input_value])\n return self._safe_convert(self.input_value)\n" - }, - "data_template": { - "_input_type": "MessageTextInput", - "advanced": true, - "display_name": "Data Template", - "dynamic": false, - "info": "Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "name": "data_template", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "{text}" - }, - "input_value": { - "_input_type": "MessageInput", - "advanced": false, - "display_name": "Text", - "dynamic": false, - "info": "Message to be passed as output.", - "input_types": [ - "Data", - "DataFrame", - "Message" - ], - "list": false, - "load_from_db": false, - "name": "input_value", - "placeholder": "", - "required": true, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "sender": { - "_input_type": "DropdownInput", - "advanced": true, - "combobox": false, - "display_name": "Sender Type", - "dynamic": false, - "info": "Type of sender.", - "name": "sender", - "options": [ - "Machine", - "User" - ], - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "str", - "value": "Machine" - }, - "sender_name": { - "_input_type": "MessageTextInput", - "advanced": true, - "display_name": "Sender Name", - "dynamic": false, - "info": "Name of the sender.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "name": "sender_name", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "AI" - }, - "session_id": { - "_input_type": "MessageTextInput", - "advanced": true, - "display_name": "Session ID", - "dynamic": false, - "info": "The session ID of the chat. If empty, the current session ID parameter will be used.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "name": "session_id", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "should_store_message": { - "_input_type": "BoolInput", - "advanced": true, - "display_name": "Store Messages", - "dynamic": false, - "info": "Store the message in the history.", - "list": false, - "name": "should_store_message", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": true - }, - "text_color": { - "_input_type": "MessageTextInput", - "advanced": true, - "display_name": "Text Color", - "dynamic": false, - "info": "The text color of the name", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "name": "text_color", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - } - }, - "tool_mode": false - }, - "type": "ChatOutput" - }, - "dragging": false, - "height": 234, - "id": "ChatOutput-aOzn2", - "measured": { - "height": 234, - "width": 320 - }, - "position": { - "x": 1239.222567317785, - "y": -920.0283175735606 - }, - "positionAbsolute": { - "x": 1239.222567317785, - "y": -920.0283175735606 - }, - "selected": false, - "type": "genericNode", - "width": 320 - }, { "data": { "description": "Define the agent's instructions, then enter a task to complete using tools.", "display_name": "Finance Agent", - "id": "Agent-uO2c7", + "id": "Agent-PNvaZ", "node": { "base_classes": [ "Message" @@ -758,7 +453,7 @@ "show": true, "title_case": false, "type": "str", - "value": "OPENAI_API_KEY" + "value": "" }, "code": { "advanced": true, @@ -1207,7 +902,7 @@ }, "dragging": false, "height": 650, - "id": "Agent-uO2c7", + "id": "Agent-PNvaZ", "measured": { "height": 650, "width": 320 @@ -1228,7 +923,7 @@ "data": { "description": "Define the agent's instructions, then enter a task to complete using tools.", "display_name": "Analysis & Editor Agent", - "id": "Agent-uHv68", + "id": "Agent-mzPNm", "node": { "base_classes": [ "Message" @@ -1378,7 +1073,7 @@ "show": true, "title_case": false, "type": "str", - "value": "OPENAI_API_KEY" + "value": "" }, "code": { "advanced": true, @@ -1827,7 +1522,7 @@ }, "dragging": false, "height": 650, - "id": "Agent-uHv68", + "id": "Agent-mzPNm", "measured": { "height": 650, "width": 320 @@ -1848,7 +1543,7 @@ "data": { "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", - "id": "Prompt-Sxdul", + "id": "Prompt-b9wSh", "node": { "base_classes": [ "Message" @@ -1960,7 +1655,7 @@ }, "dragging": false, "height": 260, - "id": "Prompt-Sxdul", + "id": "Prompt-b9wSh", "measured": { "height": 260, "width": 320 @@ -1981,7 +1676,7 @@ "data": { "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", - "id": "Prompt-YbDgD", + "id": "Prompt-zC2bp", "node": { "base_classes": [ "Message" @@ -2093,7 +1788,7 @@ }, "dragging": false, "height": 260, - "id": "Prompt-YbDgD", + "id": "Prompt-zC2bp", "measured": { "height": 260, "width": 320 @@ -2114,7 +1809,7 @@ "data": { "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", - "id": "Prompt-0tvfj", + "id": "Prompt-KQVLR", "node": { "base_classes": [ "Message" @@ -2275,7 +1970,7 @@ }, "dragging": false, "height": 433, - "id": "Prompt-0tvfj", + "id": "Prompt-KQVLR", "measured": { "height": 433, "width": 320 @@ -2294,7 +1989,7 @@ }, { "data": { - "id": "ChatInput-yzskz", + "id": "ChatInput-ZyZgH", "node": { "base_classes": [ "Message" @@ -2576,7 +2271,7 @@ }, "dragging": false, "height": 234, - "id": "ChatInput-yzskz", + "id": "ChatInput-ZyZgH", "measured": { "height": 234, "width": 320 @@ -2595,7 +2290,7 @@ }, { "data": { - "id": "note-925JF", + "id": "note-yWlba", "node": { "description": "# Sequential Tasks Agents\n\n## Overview\nThis flow demonstrates how to chain multiple AI agents for comprehensive research and analysis. Each agent specializes in different aspects of the research process, building upon the previous agent's work.\n\n## How to Use the Flow\n\n1. **Input Your Query** 🎯\n - Be specific and clear\n - Include key aspects you want analyzed\n - Examples:\n ```\n Good: \"Should I invest in Tesla (TSLA)? Focus on AI development impact\"\n Bad: \"Tell me about Tesla\"\n ```\n\n2. **Research Agent Process** 🔍\n - Utilizes Tavily Search for comprehensive research\n\n\n3. **Specialized Analysis** 📊\n - Each agent adds unique value:\n ```\n Research Agent → Deep Research & Context\n ↓\n Finance Agent → Data Analysis & Metrics\n ↓\n Editor Agent → Final Synthesis & Report\n ```\n\n4. **Output Format** 📝\n - Structured report\n - Embedded images and charts\n - Data-backed insights\n - Clear recommendations\n\n## Pro Tips\n\n### Query Construction\n- Include specific points of interest\n- Mention required metrics or data points\n- Specify time frames if relevant\n\n### Flow Customization\n- Modify agent prompts for different use cases\n- Add or remove tools as needed\n\n## Common Applications\n- Investment Research\n- Market Analysis\n- Competitive Intelligence\n- Industry Reports\n- Technology Impact Studies\n\n⚡ **Best Practice**: Start with a test query to understand the flow's capabilities before running complex analyses.\n\n---\n*Note: This flow template uses financial analysis as an example but can be adapted for any research-intensive task requiring multiple perspectives and data sources.*", "display_name": "", @@ -2606,7 +2301,7 @@ }, "dragging": false, "height": 800, - "id": "note-925JF", + "id": "note-yWlba", "measured": { "height": 800, "width": 601 @@ -2630,7 +2325,7 @@ }, { "data": { - "id": "note-nQe4N", + "id": "note-epw2j", "node": { "description": "## What Are Sequential Task Agents?\nA system where multiple AI agents work in sequence, each specializing in specific tasks and passing their output to the next agent in the chain. Think of it as an assembly line where each agent adds value to the final result.\n\n## How It Works\n1. **First Agent** → **Second Agent** → **Third Agent** → **Final Output**\n - Each agent receives input from the previous one\n - Processes and enhances the information\n - Passes refined output forward\n\n## Key Benefits\n- **Specialization**: Each agent focuses on specific tasks\n- **Progressive Refinement**: Information gets enhanced at each step\n- **Structured Output**: Final result combines multiple perspectives\n- **Quality Control**: Each agent validates and improves previous work\n\n## Building Your Own Sequence\n1. **Plan Your Chain**\n - Identify distinct tasks\n - Determine logical order\n - Define input/output requirements\n\n2. **Configure Agents**\n - Give each agent clear instructions\n - Ensure compatible outputs/inputs\n - Set appropriate tools for each agent\n\n3. **Connect the Flow**\n - Link agents in proper order\n - Test data flow between agents\n - Verify final output format\n\n## Example Applications\n- Research → Analysis → Report Writing\n- Data Collection → Processing → Visualization\n- Content Research → Writing → Editing\n- Market Analysis → Financial Review → Investment Advice\n\n⭐ **Pro Tip**: The strength of sequential agents comes from how well they complement each other's capabilities.\n\nThis template uses financial analysis as an example, but you can adapt it for any multi-step process requiring different expertise at each stage.", "display_name": "", @@ -2643,7 +2338,7 @@ }, "dragging": false, "height": 800, - "id": "note-nQe4N", + "id": "note-epw2j", "measured": { "height": 800, "width": 601 @@ -2669,7 +2364,7 @@ "data": { "description": "Define the agent's instructions, then enter a task to complete using tools.", "display_name": "Researcher Agent", - "id": "Agent-6Gznl", + "id": "Agent-58C6Q", "node": { "base_classes": [ "Message" @@ -2819,7 +2514,7 @@ "show": true, "title_case": false, "type": "str", - "value": "OPENAI_API_KEY" + "value": "" }, "code": { "advanced": true, @@ -3268,7 +2963,7 @@ }, "dragging": false, "height": 650, - "id": "Agent-6Gznl", + "id": "Agent-58C6Q", "measured": { "height": 650, "width": 320 @@ -3287,7 +2982,7 @@ }, { "data": { - "id": "note-Lh7q4", + "id": "note-xVdpE", "node": { "description": "## Get your API key at [https://tavily.com](https://tavily.com)\n", "display_name": "", @@ -3300,7 +2995,7 @@ }, "dragging": false, "height": 324, - "id": "note-Lh7q4", + "id": "note-xVdpE", "measured": { "height": 324, "width": 348 @@ -3324,7 +3019,7 @@ }, { "data": { - "id": "note-7B1PU", + "id": "note-EMxHt", "node": { "description": "## Configure the agent by obtaining your OpenAI API key from [platform.openai.com](https://platform.openai.com). Under \"Model Provider\", choose:\n- OpenAI: Default, requires only API key\n- Anthropic/Azure/Groq/NVIDIA/SambaNova: Each requires their own API keys\n- Custom: Use your own model endpoint + authentication\n\nSelect model and input API key before running the flow.", "display_name": "", @@ -3337,7 +3032,7 @@ }, "dragging": false, "height": 324, - "id": "note-7B1PU", + "id": "note-EMxHt", "measured": { "height": 324, "width": 371 @@ -3361,7 +3056,7 @@ }, { "data": { - "id": "YfinanceComponent-BIM81", + "id": "YfinanceComponent-uJAk8", "node": { "base_classes": [ "Data", @@ -3608,9 +3303,9 @@ "type": "YfinanceComponent" }, "dragging": true, - "id": "YfinanceComponent-BIM81", + "id": "YfinanceComponent-uJAk8", "measured": { - "height": 517, + "height": 519, "width": 320 }, "position": { @@ -3622,7 +3317,7 @@ }, { "data": { - "id": "CalculatorComponent-WMC2W", + "id": "CalculatorComponent-idZ9Q", "node": { "base_classes": [ "Data" @@ -3797,9 +3492,9 @@ "type": "CalculatorComponent" }, "dragging": false, - "id": "CalculatorComponent-WMC2W", + "id": "CalculatorComponent-idZ9Q", "measured": { - "height": 333, + "height": 334, "width": 320 }, "position": { @@ -3811,7 +3506,7 @@ }, { "data": { - "id": "TavilySearchComponent-YUDsR", + "id": "TavilySearchComponent-UfEaB", "node": { "base_classes": [ "Data", @@ -3869,7 +3564,7 @@ "input_types": [ "Message" ], - "load_from_db": true, + "load_from_db": false, "name": "api_key", "password": true, "placeholder": "", @@ -3877,7 +3572,7 @@ "show": true, "title_case": false, "type": "str", - "value": "TAVILY_API_KEY" + "value": "" }, "code": { "advanced": true, @@ -4146,9 +3841,9 @@ "type": "TavilySearchComponent" }, "dragging": false, - "id": "TavilySearchComponent-YUDsR", + "id": "TavilySearchComponent-UfEaB", "measured": { - "height": 435, + "height": 437, "width": 320 }, "position": { @@ -4157,21 +3852,330 @@ }, "selected": false, "type": "genericNode" + }, + { + "data": { + "id": "ChatOutput-6kq7Z", + "node": { + "base_classes": [ + "Message" + ], + "beta": false, + "category": "outputs", + "conditional_paths": [], + "custom_fields": {}, + "description": "Display a chat message in the Playground.", + "display_name": "Chat Output", + "documentation": "", + "edited": false, + "field_order": [ + "input_value", + "should_store_message", + "sender", + "sender_name", + "session_id", + "data_template", + "background_color", + "chat_icon", + "text_color", + "clean_data" + ], + "frozen": false, + "icon": "MessagesSquare", + "key": "ChatOutput", + "legacy": false, + "metadata": {}, + "minimized": true, + "output_types": [], + "outputs": [ + { + "allows_loop": false, + "cache": true, + "display_name": "Message", + "method": "message_response", + "name": "message", + "selected": "Message", + "tool_mode": true, + "types": [ + "Message" + ], + "value": "__UNDEFINED__" + } + ], + "pinned": false, + "score": 0.003169567463043492, + "template": { + "_type": "Component", + "background_color": { + "_input_type": "MessageTextInput", + "advanced": true, + "display_name": "Background Color", + "dynamic": false, + "info": "The background color of the icon.", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "background_color", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "" + }, + "chat_icon": { + "_input_type": "MessageTextInput", + "advanced": true, + "display_name": "Icon", + "dynamic": false, + "info": "The icon of the message.", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "chat_icon", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "" + }, + "clean_data": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Basic Clean Data", + "dynamic": false, + "info": "Whether to clean the data", + "list": false, + "list_add_label": "Add More", + "name": "clean_data", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "bool", + "value": true + }, + "code": { + "advanced": true, + "dynamic": true, + "fileTypes": [], + "file_path": "", + "info": "", + "list": false, + "load_from_db": false, + "multiline": true, + "name": "code", + "password": false, + "placeholder": "", + "required": true, + "show": true, + "title_case": false, + "type": "code", + "value": "from typing import Any\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.inputs import BoolInput\nfrom langflow.inputs.inputs import HandleInput\nfrom langflow.io import DropdownInput, MessageTextInput, Output\nfrom langflow.schema.data import Data\nfrom langflow.schema.dataframe import DataFrame\nfrom langflow.schema.message import Message\nfrom langflow.schema.properties import Source\nfrom langflow.utils.constants import (\n MESSAGE_SENDER_AI,\n MESSAGE_SENDER_NAME_AI,\n MESSAGE_SENDER_USER,\n)\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n icon = \"MessagesSquare\"\n name = \"ChatOutput\"\n minimized = True\n\n inputs = [\n HandleInput(\n name=\"input_value\",\n display_name=\"Text\",\n info=\"Message to be passed as output.\",\n input_types=[\"Data\", \"DataFrame\", \"Message\"],\n required=True,\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n MessageTextInput(\n name=\"background_color\",\n display_name=\"Background Color\",\n info=\"The background color of the icon.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"chat_icon\",\n display_name=\"Icon\",\n info=\"The icon of the message.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"text_color\",\n display_name=\"Text Color\",\n info=\"The text color of the name\",\n advanced=True,\n ),\n BoolInput(\n name=\"clean_data\",\n display_name=\"Basic Clean Data\",\n value=True,\n info=\"Whether to clean the data\",\n advanced=True,\n ),\n ]\n outputs = [\n Output(\n display_name=\"Message\",\n name=\"message\",\n method=\"message_response\",\n ),\n ]\n\n def _build_source(self, id_: str | None, display_name: str | None, source: str | None) -> Source:\n source_dict = {}\n if id_:\n source_dict[\"id\"] = id_\n if display_name:\n source_dict[\"display_name\"] = display_name\n if source:\n # Handle case where source is a ChatOpenAI object\n if hasattr(source, \"model_name\"):\n source_dict[\"source\"] = source.model_name\n elif hasattr(source, \"model\"):\n source_dict[\"source\"] = str(source.model)\n else:\n source_dict[\"source\"] = str(source)\n return Source(**source_dict)\n\n async def message_response(self) -> Message:\n # First convert the input to string if needed\n text = self.convert_to_string()\n\n # Get source properties\n source, icon, display_name, source_id = self.get_properties_from_source_component()\n background_color = self.background_color\n text_color = self.text_color\n if self.chat_icon:\n icon = self.chat_icon\n\n # Create or use existing Message object\n if isinstance(self.input_value, Message):\n message = self.input_value\n # Update message properties\n message.text = text\n else:\n message = Message(text=text)\n\n # Set message properties\n message.sender = self.sender\n message.sender_name = self.sender_name\n message.session_id = self.session_id\n message.flow_id = self.graph.flow_id if hasattr(self, \"graph\") else None\n message.properties.source = self._build_source(source_id, display_name, source)\n message.properties.icon = icon\n message.properties.background_color = background_color\n message.properties.text_color = text_color\n\n # Store message if needed\n if self.session_id and self.should_store_message:\n stored_message = await self.send_message(message)\n self.message.value = stored_message\n message = stored_message\n\n self.status = message\n return message\n\n def _validate_input(self) -> None:\n \"\"\"Validate the input data and raise ValueError if invalid.\"\"\"\n if self.input_value is None:\n msg = \"Input data cannot be None\"\n raise ValueError(msg)\n if not isinstance(self.input_value, Data | DataFrame | Message | str | list):\n msg = f\"Expected Data or DataFrame or Message or str, got {type(self.input_value).__name__}\"\n raise TypeError(msg)\n\n def _safe_convert(self, data: Any) -> str:\n \"\"\"Safely convert input data to string.\"\"\"\n try:\n if isinstance(data, str):\n return data\n if isinstance(data, Message):\n return data.get_text()\n if isinstance(data, Data):\n if data.get_text() is None:\n msg = \"Empty Data object\"\n raise ValueError(msg)\n return data.get_text()\n if isinstance(data, DataFrame):\n if self.clean_data:\n # Remove empty rows\n data = data.dropna(how=\"all\")\n # Remove empty lines in each cell\n data = data.replace(r\"^\\s*$\", \"\", regex=True)\n # Replace multiple newlines with a single newline\n data = data.replace(r\"\\n+\", \"\\n\", regex=True)\n return data.to_markdown(index=False)\n return str(data)\n except (ValueError, TypeError, AttributeError) as e:\n msg = f\"Error converting data: {e!s}\"\n raise ValueError(msg) from e\n\n def convert_to_string(self) -> str:\n \"\"\"Convert input data to string with proper error handling.\"\"\"\n self._validate_input()\n if isinstance(self.input_value, list):\n return \"\\n\".join([self._safe_convert(item) for item in self.input_value])\n return self._safe_convert(self.input_value)\n" + }, + "data_template": { + "_input_type": "MessageTextInput", + "advanced": true, + "display_name": "Data Template", + "dynamic": false, + "info": "Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "data_template", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "{text}" + }, + "input_value": { + "_input_type": "HandleInput", + "advanced": false, + "display_name": "Text", + "dynamic": false, + "info": "Message to be passed as output.", + "input_types": [ + "Data", + "DataFrame", + "Message" + ], + "list": false, + "list_add_label": "Add More", + "name": "input_value", + "placeholder": "", + "required": true, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "other", + "value": "" + }, + "sender": { + "_input_type": "DropdownInput", + "advanced": true, + "combobox": false, + "dialog_inputs": {}, + "display_name": "Sender Type", + "dynamic": false, + "info": "Type of sender.", + "name": "sender", + "options": [ + "Machine", + "User" + ], + "options_metadata": [], + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "str", + "value": "Machine" + }, + "sender_name": { + "_input_type": "MessageTextInput", + "advanced": true, + "display_name": "Sender Name", + "dynamic": false, + "info": "Name of the sender.", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "sender_name", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "AI" + }, + "session_id": { + "_input_type": "MessageTextInput", + "advanced": true, + "display_name": "Session ID", + "dynamic": false, + "info": "The session ID of the chat. If empty, the current session ID parameter will be used.", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "session_id", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "" + }, + "should_store_message": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Store Messages", + "dynamic": false, + "info": "Store the message in the history.", + "list": false, + "list_add_label": "Add More", + "name": "should_store_message", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "bool", + "value": true + }, + "text_color": { + "_input_type": "MessageTextInput", + "advanced": true, + "display_name": "Text Color", + "dynamic": false, + "info": "The text color of the name", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "text_color", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "" + } + }, + "tool_mode": false + }, + "showNode": false, + "type": "ChatOutput" + }, + "dragging": false, + "id": "ChatOutput-6kq7Z", + "measured": { + "height": 66, + "width": 192 + }, + "position": { + "x": 1262.4089496614665, + "y": -820.603331268768 + }, + "selected": false, + "type": "genericNode" } ], "viewport": { - "x": 775.7505727867583, - "y": 1003.6897614169809, - "zoom": 0.3362831883623481 + "x": 556.7510301801152, + "y": 940.5287846680051, + "zoom": 0.43409522578672 } }, "description": "This Agent is designed to systematically execute a series of tasks following a meticulously predefined sequence. By adhering to this structured order, the Agent ensures that each task is completed efficiently and effectively, optimizing overall performance and maintaining a high level of accuracy.", "endpoint_name": null, "gradient": "1", "icon": "ListChecks", - "id": "673f26a7-66f4-410a-8ccb-3e635c022023", + "id": "9a7ffc1e-5cbb-4f16-8226-2b68390a4228", "is_component": false, - "last_tested_version": "1.0.19.post2", + "last_tested_version": "1.1.5", "name": "Sequential Tasks Agents", "tags": [ "assistants",