From f5d9d532649a15518a6f5739acbe1b0c795bfd86 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sat, 18 Jan 2025 22:07:23 -0300 Subject: [PATCH] fix: update Tavily component in Instagram Copywriter and Market Research projects and tests (#5789) --- .../Instagram Copywriter.json | 881 ++++++++++-------- .../starter_projects/Market Research.json | 188 ++-- .../integrations/Instagram Copywriter.spec.ts | 9 +- .../core/integrations/Market Research.spec.ts | 2 +- 4 files changed, 573 insertions(+), 507 deletions(-) diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Instagram Copywriter.json b/src/backend/base/langflow/initial_setup/starter_projects/Instagram Copywriter.json index af6031758..223da95cd 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Instagram Copywriter.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Instagram Copywriter.json @@ -3,11 +3,11 @@ "edges": [ { "animated": false, - "className": "not-running", + "className": "", "data": { "sourceHandle": { "dataType": "TextInput", - "id": "TextInput-B04zJ", + "id": "TextInput-KiwSm", "name": "text", "output_types": [ "Message" @@ -15,7 +15,7 @@ }, "targetHandle": { "fieldName": "guidelines", - "id": "Prompt-kqSxX", + "id": "Prompt-z6Dtw", "inputTypes": [ "Message", "Text" @@ -23,19 +23,19 @@ "type": "str" } }, - "id": "reactflow__edge-TextInput-B04zJ{œdataTypeœ:œTextInputœ,œidœ:œTextInput-B04zJœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-kqSxX{œfieldNameœ:œguidelinesœ,œidœ:œPrompt-kqSxXœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", - "source": "TextInput-B04zJ", - "sourceHandle": "{œdataTypeœ: œTextInputœ, œidœ: œTextInput-B04zJœ, œnameœ: œtextœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-kqSxX", - "targetHandle": "{œfieldNameœ: œguidelinesœ, œidœ: œPrompt-kqSxXœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-TextInput-KiwSm{œdataTypeœ:œTextInputœ,œidœ:œTextInput-KiwSmœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-z6Dtw{œfieldNameœ:œguidelinesœ,œidœ:œPrompt-z6Dtwœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "source": "TextInput-KiwSm", + "sourceHandle": "{œdataTypeœ: œTextInputœ, œidœ: œTextInput-KiwSmœ, œnameœ: œtextœ, œoutput_typesœ: [œMessageœ]}", + "target": "Prompt-z6Dtw", + "targetHandle": "{œfieldNameœ: œguidelinesœ, œidœ: œPrompt-z6Dtwœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" }, { "animated": false, - "className": "not-running", + "className": "", "data": { "sourceHandle": { "dataType": "OpenAIModel", - "id": "OpenAIModel-BOLef", + "id": "OpenAIModel-xATVJ", "name": "text_output", "output_types": [ "Message" @@ -43,7 +43,7 @@ }, "targetHandle": { "fieldName": "post", - "id": "Prompt-BwI7e", + "id": "Prompt-8vh0B", "inputTypes": [ "Message", "Text" @@ -51,19 +51,19 @@ "type": "str" } }, - "id": "reactflow__edge-OpenAIModel-BOLef{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-BOLefœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-Prompt-BwI7e{œfieldNameœ:œpostœ,œidœ:œPrompt-BwI7eœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", - "source": "OpenAIModel-BOLef", - "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-BOLefœ, œnameœ: œtext_outputœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-BwI7e", - "targetHandle": "{œfieldNameœ: œpostœ, œidœ: œPrompt-BwI7eœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-OpenAIModel-xATVJ{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-xATVJœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-Prompt-8vh0B{œfieldNameœ:œpostœ,œidœ:œPrompt-8vh0Bœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "source": "OpenAIModel-xATVJ", + "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-xATVJœ, œnameœ: œtext_outputœ, œoutput_typesœ: [œMessageœ]}", + "target": "Prompt-8vh0B", + "targetHandle": "{œfieldNameœ: œpostœ, œidœ: œPrompt-8vh0Bœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" }, { "animated": false, - "className": "not-running", + "className": "", "data": { "sourceHandle": { "dataType": "Prompt", - "id": "Prompt-kqSxX", + "id": "Prompt-z6Dtw", "name": "prompt", "output_types": [ "Message" @@ -71,54 +71,26 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "OpenAIModel-BOLef", + "id": "OpenAIModel-xATVJ", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Prompt-kqSxX{œdataTypeœ:œPromptœ,œidœ:œPrompt-kqSxXœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-BOLef{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-BOLefœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Prompt-kqSxX", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-kqSxXœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "OpenAIModel-BOLef", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œOpenAIModel-BOLefœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Prompt-z6Dtw{œdataTypeœ:œPromptœ,œidœ:œPrompt-z6Dtwœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-xATVJ{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-xATVJœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "Prompt-z6Dtw", + "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-z6Dtwœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", + "target": "OpenAIModel-xATVJ", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œOpenAIModel-xATVJœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "animated": false, - "className": "not-running", - "data": { - "sourceHandle": { - "dataType": "TavilyAISearch", - "id": "TavilyAISearch-HpBaM", - "name": "api_build_tool", - "output_types": [ - "Tool" - ] - }, - "targetHandle": { - "fieldName": "tools", - "id": "Agent-5FFry", - "inputTypes": [ - "Tool" - ], - "type": "other" - } - }, - "id": "reactflow__edge-TavilyAISearch-HpBaM{œdataTypeœ:œTavilyAISearchœ,œidœ:œTavilyAISearch-HpBaMœ,œnameœ:œapi_build_toolœ,œoutput_typesœ:[œToolœ]}-Agent-5FFry{œfieldNameœ:œtoolsœ,œidœ:œAgent-5FFryœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", - "selected": false, - "source": "TavilyAISearch-HpBaM", - "sourceHandle": "{œdataTypeœ: œTavilyAISearchœ, œidœ: œTavilyAISearch-HpBaMœ, œnameœ: œapi_build_toolœ, œoutput_typesœ: [œToolœ]}", - "target": "Agent-5FFry", - "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-5FFryœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" - }, - { - "animated": false, - "className": "not-running", + "className": "", "data": { "sourceHandle": { "dataType": "ChatInput", - "id": "ChatInput-RXwSP", + "id": "ChatInput-Nk5P9", "name": "message", "output_types": [ "Message" @@ -126,26 +98,26 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "Agent-5FFry", + "id": "Agent-IcxoG", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-ChatInput-RXwSP{œdataTypeœ:œChatInputœ,œidœ:œChatInput-RXwSPœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-Agent-5FFry{œfieldNameœ:œinput_valueœ,œidœ:œAgent-5FFryœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "ChatInput-RXwSP", - "sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-RXwSPœ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}", - "target": "Agent-5FFry", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œAgent-5FFryœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-ChatInput-Nk5P9{œdataTypeœ:œChatInputœ,œidœ:œChatInput-Nk5P9œ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-Agent-IcxoG{œfieldNameœ:œinput_valueœ,œidœ:œAgent-IcxoGœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "ChatInput-Nk5P9", + "sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-Nk5P9œ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}", + "target": "Agent-IcxoG", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œAgent-IcxoGœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "animated": false, - "className": "not-running", + "className": "", "data": { "sourceHandle": { "dataType": "Agent", - "id": "Agent-5FFry", + "id": "Agent-IcxoG", "name": "response", "output_types": [ "Message" @@ -153,7 +125,7 @@ }, "targetHandle": { "fieldName": "context", - "id": "Prompt-kqSxX", + "id": "Prompt-z6Dtw", "inputTypes": [ "Message", "Text" @@ -161,19 +133,19 @@ "type": "str" } }, - "id": "reactflow__edge-Agent-5FFry{œdataTypeœ:œAgentœ,œidœ:œAgent-5FFryœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-Prompt-kqSxX{œfieldNameœ:œcontextœ,œidœ:œPrompt-kqSxXœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", - "source": "Agent-5FFry", - "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-5FFryœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-kqSxX", - "targetHandle": "{œfieldNameœ: œcontextœ, œidœ: œPrompt-kqSxXœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Agent-IcxoG{œdataTypeœ:œAgentœ,œidœ:œAgent-IcxoGœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-Prompt-z6Dtw{œfieldNameœ:œcontextœ,œidœ:œPrompt-z6Dtwœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "source": "Agent-IcxoG", + "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-IcxoGœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", + "target": "Prompt-z6Dtw", + "targetHandle": "{œfieldNameœ: œcontextœ, œidœ: œPrompt-z6Dtwœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" }, { "animated": false, - "className": "ran", + "className": "", "data": { "sourceHandle": { "dataType": "Prompt", - "id": "Prompt-BwI7e", + "id": "Prompt-8vh0B", "name": "prompt", "output_types": [ "Message" @@ -181,26 +153,26 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "OpenAIModel-5vp3N", + "id": "OpenAIModel-z4zkm", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Prompt-BwI7e{œdataTypeœ:œPromptœ,œidœ:œPrompt-BwI7eœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-5vp3N{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-5vp3Nœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Prompt-BwI7e", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-BwI7eœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "OpenAIModel-5vp3N", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œOpenAIModel-5vp3Nœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Prompt-8vh0B{œdataTypeœ:œPromptœ,œidœ:œPrompt-8vh0Bœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-OpenAIModel-z4zkm{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-z4zkmœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "Prompt-8vh0B", + "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-8vh0Bœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", + "target": "OpenAIModel-z4zkm", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œOpenAIModel-z4zkmœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "animated": false, - "className": "not-running", + "className": "", "data": { "sourceHandle": { "dataType": "OpenAIModel", - "id": "OpenAIModel-BOLef", + "id": "OpenAIModel-xATVJ", "name": "text_output", "output_types": [ "Message" @@ -208,7 +180,7 @@ }, "targetHandle": { "fieldName": "post", - "id": "Prompt-1yGW4", + "id": "Prompt-TzIMq", "inputTypes": [ "Message", "Text" @@ -216,19 +188,19 @@ "type": "str" } }, - "id": "reactflow__edge-OpenAIModel-BOLef{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-BOLefœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-Prompt-1yGW4{œfieldNameœ:œpostœ,œidœ:œPrompt-1yGW4œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", - "source": "OpenAIModel-BOLef", - "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-BOLefœ, œnameœ: œtext_outputœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-1yGW4", - "targetHandle": "{œfieldNameœ: œpostœ, œidœ: œPrompt-1yGW4œ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-OpenAIModel-xATVJ{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-xATVJœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-Prompt-TzIMq{œfieldNameœ:œpostœ,œidœ:œPrompt-TzIMqœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "source": "OpenAIModel-xATVJ", + "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-xATVJœ, œnameœ: œtext_outputœ, œoutput_typesœ: [œMessageœ]}", + "target": "Prompt-TzIMq", + "targetHandle": "{œfieldNameœ: œpostœ, œidœ: œPrompt-TzIMqœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" }, { "animated": true, - "className": "running", + "className": "", "data": { "sourceHandle": { "dataType": "OpenAIModel", - "id": "OpenAIModel-5vp3N", + "id": "OpenAIModel-z4zkm", "name": "text_output", "output_types": [ "Message" @@ -236,7 +208,7 @@ }, "targetHandle": { "fieldName": "image_description", - "id": "Prompt-1yGW4", + "id": "Prompt-TzIMq", "inputTypes": [ "Message", "Text" @@ -244,19 +216,19 @@ "type": "str" } }, - "id": "reactflow__edge-OpenAIModel-5vp3N{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-5vp3Nœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-Prompt-1yGW4{œfieldNameœ:œimage_descriptionœ,œidœ:œPrompt-1yGW4œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", - "source": "OpenAIModel-5vp3N", - "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-5vp3Nœ, œnameœ: œtext_outputœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-1yGW4", - "targetHandle": "{œfieldNameœ: œimage_descriptionœ, œidœ: œPrompt-1yGW4œ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-OpenAIModel-z4zkm{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-z4zkmœ,œnameœ:œtext_outputœ,œoutput_typesœ:[œMessageœ]}-Prompt-TzIMq{œfieldNameœ:œimage_descriptionœ,œidœ:œPrompt-TzIMqœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "source": "OpenAIModel-z4zkm", + "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-z4zkmœ, œnameœ: œtext_outputœ, œoutput_typesœ: [œMessageœ]}", + "target": "Prompt-TzIMq", + "targetHandle": "{œfieldNameœ: œimage_descriptionœ, œidœ: œPrompt-TzIMqœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" }, { "animated": false, - "className": "not-running", + "className": "", "data": { "sourceHandle": { "dataType": "Prompt", - "id": "Prompt-1yGW4", + "id": "Prompt-TzIMq", "name": "prompt", "output_types": [ "Message" @@ -264,24 +236,49 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "ChatOutput-jWqJJ", + "id": "ChatOutput-XWD0l", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Prompt-1yGW4{œdataTypeœ:œPromptœ,œidœ:œPrompt-1yGW4œ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-jWqJJ{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-jWqJJœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Prompt-1yGW4", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-1yGW4œ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "ChatOutput-jWqJJ", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-jWqJJœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Prompt-TzIMq{œdataTypeœ:œPromptœ,œidœ:œPrompt-TzIMqœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-XWD0l{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-XWD0lœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "Prompt-TzIMq", + "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-TzIMqœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", + "target": "ChatOutput-XWD0l", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-XWD0lœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + }, + { + "data": { + "sourceHandle": { + "dataType": "TavilySearchComponent", + "id": "TavilySearchComponent-cw2iI", + "name": "component_as_tool", + "output_types": [ + "Tool" + ] + }, + "targetHandle": { + "fieldName": "tools", + "id": "Agent-IcxoG", + "inputTypes": [ + "Tool" + ], + "type": "other" + } + }, + "id": "xy-edge__TavilySearchComponent-cw2iI{œdataTypeœ:œTavilySearchComponentœ,œidœ:œTavilySearchComponent-cw2iIœ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-IcxoG{œfieldNameœ:œtoolsœ,œidœ:œAgent-IcxoGœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "source": "TavilySearchComponent-cw2iI", + "sourceHandle": "{œdataTypeœ: œTavilySearchComponentœ, œidœ: œTavilySearchComponent-cw2iIœ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", + "target": "Agent-IcxoG", + "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-IcxoGœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" } ], "nodes": [ { "data": { - "id": "ChatInput-RXwSP", + "id": "ChatInput-Nk5P9", "node": { "base_classes": [ "Message" @@ -553,10 +550,10 @@ }, "dragging": false, "height": 234, - "id": "ChatInput-RXwSP", + "id": "ChatInput-Nk5P9", "measured": { "height": 234, - "width": 360 + "width": 320 }, "position": { "x": 5183.264962599111, @@ -574,7 +571,7 @@ "data": { "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", - "id": "Prompt-kqSxX", + "id": "Prompt-z6Dtw", "node": { "base_classes": [ "Message" @@ -727,10 +724,10 @@ }, "dragging": false, "height": 433, - "id": "Prompt-kqSxX", + "id": "Prompt-z6Dtw", "measured": { "height": 433, - "width": 360 + "width": 320 }, "position": { "x": 6044.447585613556, @@ -746,7 +743,7 @@ }, { "data": { - "id": "TextInput-B04zJ", + "id": "TextInput-KiwSm", "node": { "base_classes": [ "Message" @@ -829,10 +826,10 @@ }, "dragging": false, "height": 234, - "id": "TextInput-B04zJ", + "id": "TextInput-KiwSm", "measured": { "height": 234, - "width": 360 + "width": 320 }, "position": { "x": 5663.277060522892, @@ -850,7 +847,7 @@ "data": { "description": "Generates text using OpenAI LLMs.", "display_name": "OpenAI", - "id": "OpenAIModel-BOLef", + "id": "OpenAIModel-xATVJ", "node": { "base_classes": [ "LanguageModel", @@ -922,7 +919,7 @@ "input_types": [ "Message" ], - "load_from_db": true, + "load_from_db": false, "name": "api_key", "password": true, "placeholder": "", @@ -1145,10 +1142,10 @@ }, "dragging": false, "height": 543, - "id": "OpenAIModel-BOLef", + "id": "OpenAIModel-xATVJ", "measured": { "height": 543, - "width": 360 + "width": 320 }, "position": { "x": 6427.182886017446, @@ -1166,7 +1163,7 @@ "data": { "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", - "id": "Prompt-BwI7e", + "id": "Prompt-8vh0B", "node": { "base_classes": [ "Message" @@ -1295,10 +1292,10 @@ }, "dragging": false, "height": 347, - "id": "Prompt-BwI7e", + "id": "Prompt-8vh0B", "measured": { "height": 347, - "width": 360 + "width": 320 }, "position": { "x": 6822.3853365255445, @@ -1316,7 +1313,7 @@ "data": { "description": "Display a chat message in the Playground.", "display_name": "Chat Output", - "id": "ChatOutput-jWqJJ", + "id": "ChatOutput-XWD0l", "node": { "base_classes": [ "Message" @@ -1575,10 +1572,10 @@ }, "dragging": false, "height": 234, - "id": "ChatOutput-jWqJJ", + "id": "ChatOutput-XWD0l", "measured": { "height": 234, - "width": 360 + "width": 320 }, "position": { "x": 7980.617825443558, @@ -1596,7 +1593,7 @@ "data": { "description": "Define the agent's instructions, then enter a task to complete using tools.", "display_name": "Agent", - "id": "Agent-5FFry", + "id": "Agent-IcxoG", "node": { "base_classes": [ "Message" @@ -1733,7 +1730,7 @@ "input_types": [ "Message" ], - "load_from_db": true, + "load_from_db": false, "name": "api_key", "password": true, "placeholder": "", @@ -2154,10 +2151,10 @@ }, "dragging": false, "height": 650, - "id": "Agent-5FFry", + "id": "Agent-IcxoG", "measured": { "height": 650, - "width": 360 + "width": 320 }, "position": { "x": 5665.465212822881, @@ -2171,258 +2168,11 @@ "type": "genericNode", "width": 320 }, - { - "data": { - "description": "**Tavily AI** is a search engine optimized for LLMs and RAG, aimed at efficient, quick, and persistent search results. It can be used independently or as an agent tool.\n\nNote: Check 'Advanced' for all options.\n", - "display_name": "Tavily AI Search [DEPRECATED]", - "id": "TavilyAISearch-HpBaM", - "node": { - "base_classes": [ - "Data", - "Tool" - ], - "beta": false, - "conditional_paths": [], - "custom_fields": {}, - "description": "**Tavily AI** is a search engine optimized for LLMs and RAG, aimed at efficient, quick, and persistent search results. It can be used independently or as an agent tool.\n\nNote: Check 'Advanced' for all options.\n", - "display_name": "Tavily AI Search [DEPRECATED]", - "documentation": "https://docs.tavily.com/", - "edited": false, - "field_order": [ - "api_key", - "query", - "search_depth", - "topic", - "max_results", - "include_images", - "include_answer" - ], - "frozen": false, - "icon": "TavilyIcon", - "legacy": true, - "metadata": {}, - "minimized": false, - "output_types": [], - "outputs": [ - { - "cache": true, - "display_name": "Data", - "method": "run_model", - "name": "api_run_model", - "required_inputs": [ - "api_key" - ], - "selected": "Data", - "types": [ - "Data" - ], - "value": "__UNDEFINED__" - }, - { - "cache": true, - "display_name": "Tool", - "method": "build_tool", - "name": "api_build_tool", - "required_inputs": [ - "api_key" - ], - "selected": "Tool", - "types": [ - "Tool" - ], - "value": "__UNDEFINED__" - } - ], - "pinned": false, - "template": { - "_type": "Component", - "api_key": { - "_input_type": "SecretStrInput", - "advanced": false, - "display_name": "Tavily API Key", - "dynamic": false, - "info": "Your Tavily API Key.", - "input_types": [ - "Message" - ], - "load_from_db": false, - "name": "api_key", - "password": true, - "placeholder": "", - "required": true, - "show": true, - "title_case": false, - "type": "str", - "value": "" - }, - "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 enum import Enum\n\nimport httpx\nfrom langchain.tools import StructuredTool\nfrom langchain_core.tools import ToolException\nfrom loguru import logger\nfrom pydantic import BaseModel, Field\n\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.field_typing import Tool\nfrom langflow.inputs import BoolInput, DropdownInput, IntInput, MessageTextInput, SecretStrInput\nfrom langflow.schema import Data\n\n\nclass TavilySearchDepth(Enum):\n BASIC = \"basic\"\n ADVANCED = \"advanced\"\n\n\nclass TavilySearchTopic(Enum):\n GENERAL = \"general\"\n NEWS = \"news\"\n\n\nclass TavilySearchSchema(BaseModel):\n query: str = Field(..., description=\"The search query you want to execute with Tavily.\")\n search_depth: TavilySearchDepth = Field(TavilySearchDepth.BASIC, description=\"The depth of the search.\")\n topic: TavilySearchTopic = Field(TavilySearchTopic.GENERAL, description=\"The category of the search.\")\n max_results: int = Field(5, description=\"The maximum number of search results to return.\")\n include_images: bool = Field(default=False, description=\"Include a list of query-related images in the response.\")\n include_answer: bool = Field(default=False, description=\"Include a short answer to original query.\")\n\n\nclass TavilySearchToolComponent(LCToolComponent):\n display_name = \"Tavily AI Search [DEPRECATED]\"\n description = \"\"\"**Tavily AI** is a search engine optimized for LLMs and RAG, \\\n aimed at efficient, quick, and persistent search results. It can be used independently or as an agent tool.\n\nNote: Check 'Advanced' for all options.\n\"\"\"\n icon = \"TavilyIcon\"\n name = \"TavilyAISearch\"\n documentation = \"https://docs.tavily.com/\"\n legacy = True\n\n inputs = [\n SecretStrInput(\n name=\"api_key\",\n display_name=\"Tavily API Key\",\n required=True,\n info=\"Your Tavily API Key.\",\n ),\n MessageTextInput(\n name=\"query\",\n display_name=\"Search Query\",\n info=\"The search query you want to execute with Tavily.\",\n ),\n DropdownInput(\n name=\"search_depth\",\n display_name=\"Search Depth\",\n info=\"The depth of the search.\",\n options=list(TavilySearchDepth),\n value=TavilySearchDepth.ADVANCED,\n advanced=True,\n ),\n DropdownInput(\n name=\"topic\",\n display_name=\"Search Topic\",\n info=\"The category of the search.\",\n options=list(TavilySearchTopic),\n value=TavilySearchTopic.GENERAL,\n advanced=True,\n ),\n IntInput(\n name=\"max_results\",\n display_name=\"Max Results\",\n info=\"The maximum number of search results to return.\",\n value=5,\n advanced=True,\n ),\n BoolInput(\n name=\"include_images\",\n display_name=\"Include Images\",\n info=\"Include a list of query-related images in the response.\",\n value=True,\n advanced=True,\n ),\n BoolInput(\n name=\"include_answer\",\n display_name=\"Include Answer\",\n info=\"Include a short answer to original query.\",\n value=True,\n advanced=True,\n ),\n ]\n\n def run_model(self) -> list[Data]:\n # Convert string values to enum instances with validation\n try:\n search_depth_enum = (\n self.search_depth\n if isinstance(self.search_depth, TavilySearchDepth)\n else TavilySearchDepth(str(self.search_depth).lower())\n )\n except ValueError as e:\n error_message = f\"Invalid search depth value: {e!s}\"\n self.status = error_message\n return [Data(data={\"error\": error_message})]\n\n try:\n topic_enum = (\n self.topic if isinstance(self.topic, TavilySearchTopic) else TavilySearchTopic(str(self.topic).lower())\n )\n except ValueError as e:\n error_message = f\"Invalid topic value: {e!s}\"\n self.status = error_message\n return [Data(data={\"error\": error_message})]\n\n return self._tavily_search(\n self.query,\n search_depth=search_depth_enum,\n topic=topic_enum,\n max_results=self.max_results,\n include_images=self.include_images,\n include_answer=self.include_answer,\n )\n\n def build_tool(self) -> Tool:\n return StructuredTool.from_function(\n name=\"tavily_search\",\n description=\"Perform a web search using the Tavily API.\",\n func=self._tavily_search,\n args_schema=TavilySearchSchema,\n )\n\n def _tavily_search(\n self,\n query: str,\n *,\n search_depth: TavilySearchDepth = TavilySearchDepth.BASIC,\n topic: TavilySearchTopic = TavilySearchTopic.GENERAL,\n max_results: int = 5,\n include_images: bool = False,\n include_answer: bool = False,\n ) -> list[Data]:\n # Validate enum values\n if not isinstance(search_depth, TavilySearchDepth):\n msg = f\"Invalid search_depth value: {search_depth}\"\n raise TypeError(msg)\n if not isinstance(topic, TavilySearchTopic):\n msg = f\"Invalid topic value: {topic}\"\n raise TypeError(msg)\n\n try:\n url = \"https://api.tavily.com/search\"\n headers = {\n \"content-type\": \"application/json\",\n \"accept\": \"application/json\",\n }\n payload = {\n \"api_key\": self.api_key,\n \"query\": query,\n \"search_depth\": search_depth.value,\n \"topic\": topic.value,\n \"max_results\": max_results,\n \"include_images\": include_images,\n \"include_answer\": include_answer,\n }\n\n with httpx.Client() as client:\n response = client.post(url, json=payload, headers=headers)\n\n response.raise_for_status()\n search_results = response.json()\n\n data_results = [\n Data(\n data={\n \"title\": result.get(\"title\"),\n \"url\": result.get(\"url\"),\n \"content\": result.get(\"content\"),\n \"score\": result.get(\"score\"),\n }\n )\n for result in search_results.get(\"results\", [])\n ]\n\n if include_answer and search_results.get(\"answer\"):\n data_results.insert(0, Data(data={\"answer\": search_results[\"answer\"]}))\n\n if include_images and search_results.get(\"images\"):\n data_results.append(Data(data={\"images\": search_results[\"images\"]}))\n\n self.status = data_results # type: ignore[assignment]\n\n except httpx.HTTPStatusError as e:\n error_message = f\"HTTP error: {e.response.status_code} - {e.response.text}\"\n logger.debug(error_message)\n self.status = error_message\n raise ToolException(error_message) from e\n except Exception as e:\n error_message = f\"Unexpected error: {e}\"\n logger.opt(exception=True).debug(\"Error running Tavily Search\")\n self.status = error_message\n raise ToolException(error_message) from e\n return data_results\n" - }, - "include_answer": { - "_input_type": "BoolInput", - "advanced": true, - "display_name": "Include Answer", - "dynamic": false, - "info": "Include a short answer to original query.", - "list": false, - "list_add_label": "Add More", - "name": "include_answer", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "bool", - "value": true - }, - "include_images": { - "_input_type": "BoolInput", - "advanced": true, - "display_name": "Include Images", - "dynamic": false, - "info": "Include a list of query-related images in the response.", - "list": false, - "list_add_label": "Add More", - "name": "include_images", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "bool", - "value": true - }, - "max_results": { - "_input_type": "IntInput", - "advanced": true, - "display_name": "Max Results", - "dynamic": false, - "info": "The maximum number of search results to return.", - "list": false, - "list_add_label": "Add More", - "name": "max_results", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "int", - "value": 5 - }, - "query": { - "_input_type": "MessageTextInput", - "advanced": false, - "display_name": "Search Query", - "dynamic": false, - "info": "The search query you want to execute with Tavily.", - "input_types": [ - "Message" - ], - "list": false, - "list_add_label": "Add More", - "load_from_db": false, - "name": "query", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "search_depth": { - "_input_type": "DropdownInput", - "advanced": true, - "combobox": false, - "display_name": "Search Depth", - "dynamic": false, - "info": "The depth of the search.", - "load_from_db": false, - "name": "search_depth", - "options": [ - "basic", - "advanced" - ], - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "str", - "value": "advanced" - }, - "topic": { - "_input_type": "DropdownInput", - "advanced": true, - "combobox": false, - "display_name": "Search Topic", - "dynamic": false, - "info": "The category of the search.", - "load_from_db": false, - "name": "topic", - "options": [ - "general", - "news" - ], - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "tool_mode": false, - "trace_as_metadata": true, - "type": "str", - "value": "general" - } - }, - "tool_mode": false - }, - "type": "TavilyAISearch" - }, - "dragging": false, - "height": 481, - "id": "TavilyAISearch-HpBaM", - "measured": { - "height": 481, - "width": 360 - }, - "position": { - "x": 5178.005987190226, - "y": 3496.7214582697484 - }, - "positionAbsolute": { - "x": 5178.005987190226, - "y": 3496.7214582697484 - }, - "selected": false, - "type": "genericNode", - "width": 320 - }, { "data": { "description": "Generates text using OpenAI LLMs.", "display_name": "OpenAI", - "id": "OpenAIModel-5vp3N", + "id": "OpenAIModel-z4zkm", "node": { "base_classes": [ "LanguageModel", @@ -2494,7 +2244,7 @@ "input_types": [ "Message" ], - "load_from_db": true, + "load_from_db": false, "name": "api_key", "password": true, "placeholder": "", @@ -2717,10 +2467,10 @@ }, "dragging": false, "height": 543, - "id": "OpenAIModel-5vp3N", + "id": "OpenAIModel-z4zkm", "measured": { "height": 543, - "width": 360 + "width": 320 }, "position": { "x": 7211.829041441037, @@ -2738,7 +2488,7 @@ "data": { "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", - "id": "Prompt-1yGW4", + "id": "Prompt-TzIMq", "node": { "base_classes": [ "Message" @@ -2891,10 +2641,10 @@ }, "dragging": false, "height": 433, - "id": "Prompt-1yGW4", + "id": "Prompt-TzIMq", "measured": { "height": 433, - "width": 360 + "width": 320 }, "position": { "x": 7613.837241084599, @@ -2910,7 +2660,7 @@ }, { "data": { - "id": "note-xa2dd", + "id": "note-WE2lo", "node": { "description": "# Instagram Copywriter \n\nWelcome to the Instagram Copywriter! This flow helps you create compelling Instagram posts with AI-generated content and image prompts.\n\n## Instructions\n1. Enter Your Topic\n - In the Chat Input, enter a brief description of the topic you want to post about.\n - Example: \"Create a post about meditation and its benefits\"\n\n2. Review the Generated Content\n - The flow will use AI to research your topic and generate a formatted Instagram post.\n - The post will include an opening line, main content, emojis, a call-to-action, and hashtags.\n\n3. Check the Image Prompt\n - The flow will also generate a detailed image prompt based on your post content.\n - This prompt can be used with image generation tools to create a matching visual.\n\n4. Copy the Final Output\n - The Chat Output will display the complete Instagram post text followed by the image generation prompt.\n - Copy this output to use in your Instagram content creation process.\n\n5. Refine if Needed\n - If you're not satisfied with the result, you can adjust the input or modify the OpenAI model settings for different outputs.\n\nRemember: Keep your initial topic input clear and concise for best results! 🎨✨", "display_name": "", @@ -2923,10 +2673,10 @@ }, "dragging": false, "height": 648, - "id": "note-xa2dd", + "id": "note-WE2lo", "measured": { "height": 648, - "width": 328 + "width": 325 }, "position": { "x": 4492.051129290571, @@ -2947,7 +2697,7 @@ }, { "data": { - "id": "note-Odqui", + "id": "note-f8PDT", "node": { "description": "**Text Input (Guidelines Prompt)**\n - NOTE: \"Contains Instagram post formatting rules. Don't modify this component as it maintains format consistency.\"\n - Maintains fixed guidelines for:\n * Opening structure\n * Main content\n * Emoji usage\n * Call to Action (CTA)\n * Hashtags\n\n4. **First Prompt + OpenAI Sequence**\n - NOTE: \"Generates initial post content following Instagram guidelines\"\n - Settings:\n * Temperature: 0.7 (good balance between creativity and consistency)\n * Input: Receives research context\n * Output: Generates formatted post text\n\n", "display_name": "", @@ -2960,10 +2710,10 @@ }, "dragging": false, "height": 325, - "id": "note-Odqui", + "id": "note-f8PDT", "measured": { "height": 325, - "width": 328 + "width": 325 }, "position": { "x": 5667.476249937603, @@ -2980,7 +2730,7 @@ }, { "data": { - "id": "note-uwin1", + "id": "note-5ion3", "node": { "description": "**Second Prompt + OpenAI Sequence**\n - NOTE: \"Transforms the generated post into a prompt for image generation\"\n - Settings:\n * Temperature: 0.7\n * Input: Receives generated post\n * Output: Creates detailed description for image generation\n\n", "display_name": "", @@ -2993,10 +2743,10 @@ }, "dragging": false, "height": 325, - "id": "note-uwin1", + "id": "note-5ion3", "measured": { "height": 325, - "width": 328 + "width": 325 }, "position": { "x": 6786.375917286389, @@ -3012,7 +2762,7 @@ }, { "data": { - "id": "note-GVjGk", + "id": "note-9U9ap", "node": { "description": "**Final Prompt**\n - NOTE: \"Combines Instagram post with image prompt in a final format\"\n - Structure:\n * First part: Complete Instagram post\n * Second part: Image generation prompt\n * Separator: Uses \"**Prompt:**\" to divide sections\n\n7. **Chat Output (Final Output)**\n - NOTE: \"Presents the combined final result that can be copied and used directly\"\n\nGENERAL USAGE TIPS:\n- Keep initial inputs clear and specific\n- Don't modify pre-defined Instagram guidelines\n- If style adjustments are needed, only modify the OpenAI models' temperature\n- Verify all connections are correct before running\n- Final result will always have two parts: post + image prompt\n\nFLOW CONSIDERATIONS:\n- All tools connect only to the Tool Calling Agent\n- The flow is unidirectional (no loops)\n- Each prompt template maintains specific formatting\n- Temperatures are set for optimal creativity/consistency balance\n\nTROUBLESHOOTING NOTES:\n- If output is too creative: Lower temperature", "display_name": "", @@ -3025,10 +2775,10 @@ }, "dragging": false, "height": 325, - "id": "note-GVjGk", + "id": "note-9U9ap", "measured": { "height": 325, - "width": 328 + "width": 325 }, "position": { "x": 7606.419013912975, @@ -3044,7 +2794,7 @@ }, { "data": { - "id": "note-PjdDf", + "id": "note-xpbyx", "node": { "description": "# 🔑 Tavily AI Search Needs API Key\n\nYou can get 1000 searches/month free [here](https://tavily.com/) ", "display_name": "", @@ -3057,10 +2807,10 @@ }, "dragging": false, "height": 325, - "id": "note-PjdDf", + "id": "note-xpbyx", "measured": { "height": 325, - "width": 328 + "width": 325 }, "position": { "x": 5174.678177457385, @@ -3073,25 +2823,346 @@ "selected": false, "type": "noteNode", "width": 325 + }, + { + "data": { + "id": "TavilySearchComponent-cw2iI", + "node": { + "base_classes": [ + "Data", + "Message" + ], + "beta": false, + "category": "tools", + "conditional_paths": [], + "custom_fields": {}, + "description": "**Tavily AI** is a search engine optimized for LLMs and RAG, aimed at efficient, quick, and persistent search results.", + "display_name": "Tavily AI Search", + "documentation": "", + "edited": false, + "field_order": [ + "api_key", + "query", + "search_depth", + "topic", + "max_results", + "include_images", + "include_answer" + ], + "frozen": false, + "icon": "TavilyIcon", + "key": "TavilySearchComponent", + "legacy": false, + "metadata": {}, + "minimized": false, + "output_types": [], + "outputs": [ + { + "cache": true, + "display_name": "Toolset", + "hidden": null, + "method": "to_toolkit", + "name": "component_as_tool", + "required_inputs": null, + "selected": "Tool", + "types": [ + "Tool" + ], + "value": "__UNDEFINED__" + } + ], + "pinned": false, + "score": 0.0075846556637275304, + "template": { + "_type": "Component", + "api_key": { + "_input_type": "SecretStrInput", + "advanced": false, + "display_name": "Tavily API Key", + "dynamic": false, + "info": "Your Tavily API Key.", + "input_types": [ + "Message" + ], + "load_from_db": false, + "name": "api_key", + "password": true, + "placeholder": "", + "required": true, + "show": true, + "title_case": false, + "type": "str", + "value": "" + }, + "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": "import httpx\nfrom loguru import logger\n\nfrom langflow.custom import Component\nfrom langflow.helpers.data import data_to_text\nfrom langflow.io import BoolInput, DropdownInput, IntInput, MessageTextInput, Output, SecretStrInput\nfrom langflow.schema import Data\nfrom langflow.schema.message import Message\n\n\nclass TavilySearchComponent(Component):\n display_name = \"Tavily AI Search\"\n description = \"\"\"**Tavily AI** is a search engine optimized for LLMs and RAG, \\\n aimed at efficient, quick, and persistent search results.\"\"\"\n icon = \"TavilyIcon\"\n\n inputs = [\n SecretStrInput(\n name=\"api_key\",\n display_name=\"Tavily API Key\",\n required=True,\n info=\"Your Tavily API Key.\",\n ),\n MessageTextInput(\n name=\"query\",\n display_name=\"Search Query\",\n info=\"The search query you want to execute with Tavily.\",\n tool_mode=True,\n ),\n DropdownInput(\n name=\"search_depth\",\n display_name=\"Search Depth\",\n info=\"The depth of the search.\",\n options=[\"basic\", \"advanced\"],\n value=\"advanced\",\n advanced=True,\n ),\n DropdownInput(\n name=\"topic\",\n display_name=\"Search Topic\",\n info=\"The category of the search.\",\n options=[\"general\", \"news\"],\n value=\"general\",\n advanced=True,\n ),\n IntInput(\n name=\"max_results\",\n display_name=\"Max Results\",\n info=\"The maximum number of search results to return.\",\n value=5,\n advanced=True,\n ),\n BoolInput(\n name=\"include_images\",\n display_name=\"Include Images\",\n info=\"Include a list of query-related images in the response.\",\n value=True,\n advanced=True,\n ),\n BoolInput(\n name=\"include_answer\",\n display_name=\"Include Answer\",\n info=\"Include a short answer to original query.\",\n value=True,\n advanced=True,\n ),\n ]\n\n outputs = [\n Output(display_name=\"Data\", name=\"data\", method=\"fetch_content\"),\n Output(display_name=\"Text\", name=\"text\", method=\"fetch_content_text\"),\n ]\n\n def fetch_content(self) -> list[Data]:\n try:\n url = \"https://api.tavily.com/search\"\n headers = {\n \"content-type\": \"application/json\",\n \"accept\": \"application/json\",\n }\n payload = {\n \"api_key\": self.api_key,\n \"query\": self.query,\n \"search_depth\": self.search_depth,\n \"topic\": self.topic,\n \"max_results\": self.max_results,\n \"include_images\": self.include_images,\n \"include_answer\": self.include_answer,\n }\n\n with httpx.Client() as client:\n response = client.post(url, json=payload, headers=headers)\n\n response.raise_for_status()\n search_results = response.json()\n\n data_results = []\n\n if self.include_answer and search_results.get(\"answer\"):\n data_results.append(Data(text=search_results[\"answer\"]))\n\n for result in search_results.get(\"results\", []):\n content = result.get(\"content\", \"\")\n data_results.append(\n Data(\n text=content,\n data={\n \"title\": result.get(\"title\"),\n \"url\": result.get(\"url\"),\n \"content\": content,\n \"score\": result.get(\"score\"),\n },\n )\n )\n\n if self.include_images and search_results.get(\"images\"):\n data_results.append(Data(text=\"Images found\", data={\"images\": search_results[\"images\"]}))\n except httpx.HTTPStatusError as exc:\n error_message = f\"HTTP error occurred: {exc.response.status_code} - {exc.response.text}\"\n logger.error(error_message)\n return [Data(text=error_message, data={\"error\": error_message})]\n except httpx.RequestError as exc:\n error_message = f\"Request error occurred: {exc}\"\n logger.error(error_message)\n return [Data(text=error_message, data={\"error\": error_message})]\n except ValueError as exc:\n error_message = f\"Invalid response format: {exc}\"\n logger.error(error_message)\n return [Data(text=error_message, data={\"error\": error_message})]\n else:\n self.status = data_results\n return data_results\n\n def fetch_content_text(self) -> Message:\n data = self.fetch_content()\n result_string = data_to_text(\"{text}\", data)\n self.status = result_string\n return Message(text=result_string)\n" + }, + "include_answer": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Include Answer", + "dynamic": false, + "info": "Include a short answer to original query.", + "list": false, + "list_add_label": "Add More", + "name": "include_answer", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "bool", + "value": true + }, + "include_images": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Include Images", + "dynamic": false, + "info": "Include a list of query-related images in the response.", + "list": false, + "list_add_label": "Add More", + "name": "include_images", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "bool", + "value": true + }, + "max_results": { + "_input_type": "IntInput", + "advanced": true, + "display_name": "Max Results", + "dynamic": false, + "info": "The maximum number of search results to return.", + "list": false, + "list_add_label": "Add More", + "name": "max_results", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "int", + "value": 5 + }, + "query": { + "_input_type": "MessageTextInput", + "advanced": false, + "display_name": "Search Query", + "dynamic": false, + "info": "The search query you want to execute with Tavily.", + "input_types": [ + "Message" + ], + "list": false, + "list_add_label": "Add More", + "load_from_db": false, + "name": "query", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": true, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "" + }, + "search_depth": { + "_input_type": "DropdownInput", + "advanced": true, + "combobox": false, + "display_name": "Search Depth", + "dynamic": false, + "info": "The depth of the search.", + "name": "search_depth", + "options": [ + "basic", + "advanced" + ], + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "str", + "value": "advanced" + }, + "tools_metadata": { + "_input_type": "TableInput", + "advanced": false, + "display_name": "Edit tools", + "dynamic": false, + "info": "", + "is_list": true, + "list_add_label": "Add More", + "name": "tools_metadata", + "placeholder": "", + "real_time_refresh": true, + "required": false, + "show": true, + "table_icon": "Hammer", + "table_options": { + "block_add": true, + "block_delete": true, + "block_edit": true, + "block_filter": true, + "block_hide": true, + "block_select": true, + "block_sort": true, + "description": "Modify tool names and descriptions to help agents understand when to use each tool.", + "field_parsers": { + "commands": "commands", + "name": [ + "snake_case", + "no_blank" + ] + }, + "hide_options": true + }, + "table_schema": { + "columns": [ + { + "description": "Specify the name of the tool.", + "disable_edit": false, + "display_name": "Tool Name", + "edit_mode": "inline", + "filterable": false, + "formatter": "text", + "name": "name", + "sortable": false, + "type": "text" + }, + { + "description": "Describe the purpose of the tool.", + "disable_edit": false, + "display_name": "Tool Description", + "edit_mode": "popover", + "filterable": false, + "formatter": "text", + "name": "description", + "sortable": false, + "type": "text" + }, + { + "description": "The default identifiers for the tools and cannot be changed.", + "disable_edit": true, + "display_name": "Tool Identifiers", + "edit_mode": "inline", + "filterable": false, + "formatter": "text", + "name": "tags", + "sortable": false, + "type": "text" + }, + { + "description": "Add commands to the tool. These commands will be used to run the tool. Start all commands with a `/`. You can add multiple commands separated by a comma.\nExample: `/command1`, `/command2`, `/command3`", + "disable_edit": false, + "display_name": "Commands", + "edit_mode": "inline", + "filterable": false, + "formatter": "text", + "name": "commands", + "sortable": false, + "type": "text" + } + ] + }, + "title_case": false, + "tool_mode": false, + "trace_as_metadata": true, + "trigger_icon": "Hammer", + "trigger_text": "", + "type": "table", + "value": [ + { + "description": "fetch_content(api_key: Message) - **Tavily AI** is a search engine optimized for LLMs and RAG, aimed at efficient, quick, and persistent search results.", + "name": "None-fetch_content", + "tags": [ + "None-fetch_content" + ] + }, + { + "description": "fetch_content_text(api_key: Message) - **Tavily AI** is a search engine optimized for LLMs and RAG, aimed at efficient, quick, and persistent search results.", + "name": "None-fetch_content_text", + "tags": [ + "None-fetch_content_text" + ] + } + ] + }, + "topic": { + "_input_type": "DropdownInput", + "advanced": true, + "combobox": false, + "display_name": "Search Topic", + "dynamic": false, + "info": "The category of the search.", + "name": "topic", + "options": [ + "general", + "news" + ], + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "tool_mode": false, + "trace_as_metadata": true, + "type": "str", + "value": "general" + } + } + }, + "showNode": true, + "type": "TavilySearchComponent" + }, + "dragging": false, + "id": "TavilySearchComponent-cw2iI", + "measured": { + "height": 437, + "width": 320 + }, + "position": { + "x": 5176.638828210268, + "y": 3500.9392260830805 + }, + "selected": false, + "type": "genericNode" } ], "viewport": { - "x": -2191.179445453401, - "y": -1055.6007314515284, - "zoom": 0.4477447818995538 + "x": -2990.3235424557174, + "y": -1714.4878057543951, + "zoom": 0.6101920834254135 } }, "description": " Create engaging Instagram posts with AI-generated content and image prompts, streamlining social media content creation.", "endpoint_name": null, - "gradient": "0", - "icon": "InstagramIcon", - "id": "4bb309e6-42b4-4565-b960-8bd0f7e431f2", + "id": "b20d6b1d-ecf0-4fea-bc75-73067dfb272f", "is_component": false, - "last_tested_version": "1.0.19.post2", - "name": "Instagram Copywriter", - "tags": [ - "content-generation", - "chatbots", - "agents" - ] + "last_tested_version": "1.1.1", + "name": "Instagram Copywriter (1)" } \ No newline at end of file diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Market Research.json b/src/backend/base/langflow/initial_setup/starter_projects/Market Research.json index 991a1524d..1e9e077f0 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Market Research.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Market Research.json @@ -7,7 +7,7 @@ "data": { "sourceHandle": { "dataType": "OpenAIModel", - "id": "OpenAIModel-qEjqV", + "id": "OpenAIModel-by2Or", "name": "model_output", "output_types": [ "LanguageModel" @@ -15,19 +15,19 @@ }, "targetHandle": { "fieldName": "llm", - "id": "StructuredOutputComponent-Fk5AM", + "id": "StructuredOutputComponent-JpsG1", "inputTypes": [ "LanguageModel" ], "type": "other" } }, - "id": "reactflow__edge-OpenAIModel-qEjqV{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-qEjqVœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-StructuredOutputComponent-Fk5AM{œfieldNameœ:œllmœ,œidœ:œStructuredOutputComponent-Fk5AMœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", + "id": "reactflow__edge-OpenAIModel-by2Or{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-by2Orœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-StructuredOutputComponent-JpsG1{œfieldNameœ:œllmœ,œidœ:œStructuredOutputComponent-JpsG1œ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", "selected": false, - "source": "OpenAIModel-qEjqV", - "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-qEjqVœ, œnameœ: œmodel_outputœ, œoutput_typesœ: [œLanguageModelœ]}", - "target": "StructuredOutputComponent-Fk5AM", - "targetHandle": "{œfieldNameœ: œllmœ, œidœ: œStructuredOutputComponent-Fk5AMœ, œinputTypesœ: [œLanguageModelœ], œtypeœ: œotherœ}" + "source": "OpenAIModel-by2Or", + "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-by2Orœ, œnameœ: œmodel_outputœ, œoutput_typesœ: [œLanguageModelœ]}", + "target": "StructuredOutputComponent-JpsG1", + "targetHandle": "{œfieldNameœ: œllmœ, œidœ: œStructuredOutputComponent-JpsG1œ, œinputTypesœ: [œLanguageModelœ], œtypeœ: œotherœ}" }, { "animated": false, @@ -35,7 +35,7 @@ "data": { "sourceHandle": { "dataType": "StructuredOutputComponent", - "id": "StructuredOutputComponent-Fk5AM", + "id": "StructuredOutputComponent-JpsG1", "name": "structured_output", "output_types": [ "Data" @@ -43,19 +43,19 @@ }, "targetHandle": { "fieldName": "data", - "id": "ParseData-zFzM6", + "id": "ParseData-pw2fU", "inputTypes": [ "Data" ], "type": "other" } }, - "id": "reactflow__edge-StructuredOutputComponent-Fk5AM{œdataTypeœ:œStructuredOutputComponentœ,œidœ:œStructuredOutputComponent-Fk5AMœ,œnameœ:œstructured_outputœ,œoutput_typesœ:[œDataœ]}-ParseData-zFzM6{œfieldNameœ:œdataœ,œidœ:œParseData-zFzM6œ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", + "id": "reactflow__edge-StructuredOutputComponent-JpsG1{œdataTypeœ:œStructuredOutputComponentœ,œidœ:œStructuredOutputComponent-JpsG1œ,œnameœ:œstructured_outputœ,œoutput_typesœ:[œDataœ]}-ParseData-pw2fU{œfieldNameœ:œdataœ,œidœ:œParseData-pw2fUœ,œinputTypesœ:[œDataœ],œtypeœ:œotherœ}", "selected": false, - "source": "StructuredOutputComponent-Fk5AM", - "sourceHandle": "{œdataTypeœ: œStructuredOutputComponentœ, œidœ: œStructuredOutputComponent-Fk5AMœ, œnameœ: œstructured_outputœ, œoutput_typesœ: [œDataœ]}", - "target": "ParseData-zFzM6", - "targetHandle": "{œfieldNameœ: œdataœ, œidœ: œParseData-zFzM6œ, œinputTypesœ: [œDataœ], œtypeœ: œotherœ}" + "source": "StructuredOutputComponent-JpsG1", + "sourceHandle": "{œdataTypeœ: œStructuredOutputComponentœ, œidœ: œStructuredOutputComponent-JpsG1œ, œnameœ: œstructured_outputœ, œoutput_typesœ: [œDataœ]}", + "target": "ParseData-pw2fU", + "targetHandle": "{œfieldNameœ: œdataœ, œidœ: œParseData-pw2fUœ, œinputTypesœ: [œDataœ], œtypeœ: œotherœ}" }, { "animated": false, @@ -63,7 +63,7 @@ "data": { "sourceHandle": { "dataType": "ParseData", - "id": "ParseData-zFzM6", + "id": "ParseData-pw2fU", "name": "text", "output_types": [ "Message" @@ -71,19 +71,19 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "ChatOutput-NJfzg", + "id": "ChatOutput-fzkT2", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-ParseData-zFzM6{œdataTypeœ:œParseDataœ,œidœ:œParseData-zFzM6œ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-NJfzg{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-NJfzgœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "id": "reactflow__edge-ParseData-pw2fU{œdataTypeœ:œParseDataœ,œidœ:œParseData-pw2fUœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-fzkT2{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-fzkT2œ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", "selected": false, - "source": "ParseData-zFzM6", - "sourceHandle": "{œdataTypeœ: œParseDataœ, œidœ: œParseData-zFzM6œ, œnameœ: œtextœ, œoutput_typesœ: [œMessageœ]}", - "target": "ChatOutput-NJfzg", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-NJfzgœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "source": "ParseData-pw2fU", + "sourceHandle": "{œdataTypeœ: œParseDataœ, œidœ: œParseData-pw2fUœ, œnameœ: œtextœ, œoutput_typesœ: [œMessageœ]}", + "target": "ChatOutput-fzkT2", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-fzkT2œ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "animated": false, @@ -91,7 +91,7 @@ "data": { "sourceHandle": { "dataType": "ChatInput", - "id": "ChatInput-N6esY", + "id": "ChatInput-Ifrc6", "name": "message", "output_types": [ "Message" @@ -99,19 +99,19 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "Agent-axUVK", + "id": "Agent-BFfCq", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-ChatInput-N6esY{œdataTypeœ:œChatInputœ,œidœ:œChatInput-N6esYœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-Agent-axUVK{œfieldNameœ:œinput_valueœ,œidœ:œAgent-axUVKœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "id": "reactflow__edge-ChatInput-Ifrc6{œdataTypeœ:œChatInputœ,œidœ:œChatInput-Ifrc6œ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-Agent-BFfCq{œfieldNameœ:œinput_valueœ,œidœ:œAgent-BFfCqœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", "selected": false, - "source": "ChatInput-N6esY", - "sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-N6esYœ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}", - "target": "Agent-axUVK", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œAgent-axUVKœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "source": "ChatInput-Ifrc6", + "sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-Ifrc6œ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}", + "target": "Agent-BFfCq", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œAgent-BFfCqœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "animated": false, @@ -119,7 +119,7 @@ "data": { "sourceHandle": { "dataType": "Agent", - "id": "Agent-axUVK", + "id": "Agent-BFfCq", "name": "response", "output_types": [ "Message" @@ -127,25 +127,27 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "StructuredOutputComponent-Fk5AM", + "id": "StructuredOutputComponent-JpsG1", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Agent-axUVK{œdataTypeœ:œAgentœ,œidœ:œAgent-axUVKœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-StructuredOutputComponent-Fk5AM{œfieldNameœ:œinput_valueœ,œidœ:œStructuredOutputComponent-Fk5AMœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "id": "reactflow__edge-Agent-BFfCq{œdataTypeœ:œAgentœ,œidœ:œAgent-BFfCqœ,œnameœ:œresponseœ,œoutput_typesœ:[œMessageœ]}-StructuredOutputComponent-JpsG1{œfieldNameœ:œinput_valueœ,œidœ:œStructuredOutputComponent-JpsG1œ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", "selected": false, - "source": "Agent-axUVK", - "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-axUVKœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", - "target": "StructuredOutputComponent-Fk5AM", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œStructuredOutputComponent-Fk5AMœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "source": "Agent-BFfCq", + "sourceHandle": "{œdataTypeœ: œAgentœ, œidœ: œAgent-BFfCqœ, œnameœ: œresponseœ, œoutput_typesœ: [œMessageœ]}", + "target": "StructuredOutputComponent-JpsG1", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œStructuredOutputComponent-JpsG1œ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { + "animated": false, + "className": "", "data": { "sourceHandle": { "dataType": "TavilySearchComponent", - "id": "TavilySearchComponent-J0fu0", + "id": "TavilySearchComponent-3wVdo", "name": "component_as_tool", "output_types": [ "Tool" @@ -153,18 +155,18 @@ }, "targetHandle": { "fieldName": "tools", - "id": "Agent-axUVK", + "id": "Agent-BFfCq", "inputTypes": [ "Tool" ], "type": "other" } }, - "id": "xy-edge__TavilySearchComponent-J0fu0{œdataTypeœ:œTavilySearchComponentœ,œidœ:œTavilySearchComponent-J0fu0œ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-axUVK{œfieldNameœ:œtoolsœ,œidœ:œAgent-axUVKœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", - "source": "TavilySearchComponent-J0fu0", - "sourceHandle": "{œdataTypeœ: œTavilySearchComponentœ, œidœ: œTavilySearchComponent-J0fu0œ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", - "target": "Agent-axUVK", - "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-axUVKœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" + "id": "xy-edge__TavilySearchComponent-3wVdo{œdataTypeœ:œTavilySearchComponentœ,œidœ:œTavilySearchComponent-3wVdoœ,œnameœ:œcomponent_as_toolœ,œoutput_typesœ:[œToolœ]}-Agent-BFfCq{œfieldNameœ:œtoolsœ,œidœ:œAgent-BFfCqœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "source": "TavilySearchComponent-3wVdo", + "sourceHandle": "{œdataTypeœ: œTavilySearchComponentœ, œidœ: œTavilySearchComponent-3wVdoœ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}", + "target": "Agent-BFfCq", + "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-BFfCqœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" } ], "nodes": [ @@ -172,7 +174,7 @@ "data": { "description": "Get chat inputs from the Playground.", "display_name": "Chat Input", - "id": "ChatInput-N6esY", + "id": "ChatInput-Ifrc6", "node": { "base_classes": [ "Message" @@ -444,10 +446,10 @@ }, "dragging": false, "height": 234, - "id": "ChatInput-N6esY", + "id": "ChatInput-Ifrc6", "measured": { "height": 234, - "width": 360 + "width": 320 }, "position": { "x": 472.38251755471583, @@ -465,7 +467,7 @@ "data": { "description": "Display a chat message in the Playground.", "display_name": "Chat Output", - "id": "ChatOutput-NJfzg", + "id": "ChatOutput-fzkT2", "node": { "base_classes": [ "Message" @@ -491,7 +493,7 @@ "frozen": false, "icon": "MessagesSquare", "legacy": false, - "lf_version": "1.0.19.post2", + "lf_version": "1.1.1", "metadata": {}, "output_types": [], "outputs": [ @@ -725,10 +727,10 @@ }, "dragging": false, "height": 234, - "id": "ChatOutput-NJfzg", + "id": "ChatOutput-fzkT2", "measured": { "height": 234, - "width": 360 + "width": 320 }, "position": { "x": 2518.282039019285, @@ -744,7 +746,7 @@ }, { "data": { - "id": "note-40RoE", + "id": "note-3WRHy", "node": { "description": "The StructuredOutputComponent, when utilized with our company information schema, performs the following functions:\n\n1. Accepts an input query regarding a company.\n2. Employs a Language Model (LLM) to analyze the query.\n3. Instructs the LLM to generate a structured response adhering to the predefined schema:\n - Domain\n - LinkedIn URL\n - Cheapest Plan\n - Has Free Trial\n - Has Enterprise Plan\n - Has API\n - Market\n - Pricing Tiers\n - Key Features\n - Target Industries\n\n4. Validates the LLM output against this schema.\n5. Returns a Data object containing the company information structured according to the schema.\n\nIn essence, this component transforms a free-text query about a company into a structured, consistent dataset, facilitating subsequent analysis and application of the information.", "display_name": "", @@ -757,10 +759,10 @@ }, "dragging": false, "height": 403, - "id": "note-40RoE", + "id": "note-3WRHy", "measured": { "height": 403, - "width": 328 + "width": 325 }, "position": { "x": 2089.5869930853464, @@ -781,7 +783,7 @@ }, { "data": { - "id": "note-hgOqR", + "id": "note-erQ7I", "node": { "description": "PURPOSE:\nConverts unstructured company research into standardized JSON format\n\nKEY FUNCTIONS:\n- Extracts specific business data points\n- Validates and formats information\n- Ensures data consistency\n\nINPUT:\n- Raw company research data\n\nOUTPUT:\nStructured JSON with:\n- Domain information\n- Social links\n- Pricing details\n- Feature availability\n- Market classification\n- Product features\n- Industry focus\n\nRULES:\n1. Uses strict boolean values\n2. Standardizes pricing formats\n3. Validates market categories\n4. Handles missing data consistently", "display_name": "", @@ -794,10 +796,10 @@ }, "dragging": false, "height": 382, - "id": "note-hgOqR", + "id": "note-erQ7I", "measured": { "height": 382, - "width": 328 + "width": 325 }, "position": { "x": 1237.6627823432912, @@ -818,7 +820,7 @@ }, { "data": { - "id": "note-ifPGq", + "id": "note-Hvebs", "node": { "description": "# Market Research\nThis flow helps you gather comprehensive information about companies for sales and business intelligence purposes.\n\n## Instructions\n\n1. Enter Company Name\n - In the Chat Input node, type the name of the company you want to research\n - Example inputs: \"Salesforce.com\", \"Shopify\", \"Zoom Video Communications\"\n\n2. Initiate Research\n - The Agent will use the Tavily AI Search tool to gather information\n - It will focus on key areas like pricing, features, and market positioning\n\n3. Review Structured Output\n - The flow will generate a structured JSON output with standardized fields\n - This includes domain, LinkedIn URL, pricing details, and key features\n\n4. Examine Formatted Results\n - The Parse Data component will convert the JSON into a readable format\n - You'll see a comprehensive company profile with organized sections\n\n5. Analyze and Use Data\n - Use the generated information for sales prospecting, competitive analysis, or market research\n - The structured format allows for easy comparison between different companies\n\nRemember: Always verify critical information from official sources before making business decisions! 🔍💼", "display_name": "", @@ -831,10 +833,10 @@ }, "dragging": false, "height": 513, - "id": "note-ifPGq", + "id": "note-Hvebs", "measured": { "height": 513, - "width": 328 + "width": 325 }, "position": { "x": 244.92297036777086, @@ -857,7 +859,7 @@ "data": { "description": "Transforms LLM responses into **structured data formats**. Ideal for extracting specific information or creating consistent outputs.", "display_name": "Structured Output", - "id": "StructuredOutputComponent-Fk5AM", + "id": "StructuredOutputComponent-JpsG1", "node": { "base_classes": [ "Data" @@ -879,7 +881,7 @@ "frozen": false, "icon": "braces", "legacy": false, - "lf_version": "1.0.19.post2", + "lf_version": "1.1.1", "metadata": {}, "output_types": [], "outputs": [ @@ -1117,10 +1119,10 @@ }, "dragging": false, "height": 541, - "id": "StructuredOutputComponent-Fk5AM", + "id": "StructuredOutputComponent-JpsG1", "measured": { "height": 541, - "width": 360 + "width": 320 }, "position": { "x": 1716.7237308033855, @@ -1138,7 +1140,7 @@ "data": { "description": "Generates text using OpenAI LLMs.", "display_name": "OpenAI", - "id": "OpenAIModel-qEjqV", + "id": "OpenAIModel-by2Or", "node": { "base_classes": [ "LanguageModel", @@ -1210,7 +1212,7 @@ "input_types": [ "Message" ], - "load_from_db": true, + "load_from_db": false, "name": "api_key", "password": true, "placeholder": "", @@ -1433,10 +1435,10 @@ }, "dragging": false, "height": 543, - "id": "OpenAIModel-qEjqV", + "id": "OpenAIModel-by2Or", "measured": { "height": 543, - "width": 360 + "width": 320 }, "position": { "x": 1696.6021757625274, @@ -1452,7 +1454,7 @@ }, { "data": { - "id": "ParseData-zFzM6", + "id": "ParseData-pw2fU", "node": { "base_classes": [ "Message" @@ -1474,7 +1476,7 @@ "icon": "braces", "key": "ParseData", "legacy": false, - "lf_version": "1.0.19.post2", + "lf_version": "1.1.1", "metadata": {}, "output_types": [], "outputs": [ @@ -1587,10 +1589,10 @@ }, "dragging": false, "height": 302, - "id": "ParseData-zFzM6", + "id": "ParseData-pw2fU", "measured": { "height": 302, - "width": 360 + "width": 320 }, "position": { "x": 2139.05558520377, @@ -1608,7 +1610,7 @@ "data": { "description": "Define the agent's instructions, then enter a task to complete using tools.", "display_name": "Agent", - "id": "Agent-axUVK", + "id": "Agent-BFfCq", "node": { "base_classes": [ "Message" @@ -1746,7 +1748,7 @@ "input_types": [ "Message" ], - "load_from_db": true, + "load_from_db": false, "name": "api_key", "password": true, "placeholder": "", @@ -2167,10 +2169,10 @@ }, "dragging": false, "height": 650, - "id": "Agent-axUVK", + "id": "Agent-BFfCq", "measured": { "height": 650, - "width": 360 + "width": 320 }, "position": { "x": 1287.5681517817056, @@ -2182,7 +2184,7 @@ }, { "data": { - "id": "note-NrsCo", + "id": "note-hp7gL", "node": { "description": "# 🔑 Tavily AI Search Needs API Key\n\nYou can get 1000 searches/month free [here](https://tavily.com/) ", "display_name": "", @@ -2195,10 +2197,10 @@ }, "dragging": false, "height": 325, - "id": "note-NrsCo", + "id": "note-hp7gL", "measured": { "height": 325, - "width": 328 + "width": 325 }, "position": { "x": 878.7898510090017, @@ -2214,7 +2216,7 @@ }, { "data": { - "id": "TavilySearchComponent-J0fu0", + "id": "TavilySearchComponent-3wVdo", "node": { "base_classes": [ "Data", @@ -2241,6 +2243,7 @@ "icon": "TavilyIcon", "key": "TavilySearchComponent", "legacy": false, + "lf_version": "1.1.1", "metadata": {}, "minimized": false, "output_types": [], @@ -2522,41 +2525,36 @@ "type": "str", "value": "general" } - } + }, + "tool_mode": true }, "showNode": true, "type": "TavilySearchComponent" }, "dragging": false, - "id": "TavilySearchComponent-J0fu0", + "id": "TavilySearchComponent-3wVdo", "measured": { - "height": 489, - "width": 360 + "height": 437, + "width": 320 }, "position": { "x": 875.7686789989679, "y": 798.478848045035 }, - "selected": true, + "selected": false, "type": "genericNode" } ], "viewport": { - "x": -56.57567835815098, - "y": -85.58742561611257, - "zoom": 0.5411592744108725 + "x": -272.7790874888751, + "y": 63.44626914733033, + "zoom": 0.4593805108979444 } }, "description": "Researches companies, extracts key business data, and presents structured information for efficient analysis. ", "endpoint_name": null, - "gradient": "1", - "icon": "PieChart", - "id": "153a05e5-86bd-4de8-b159-2cb4f9f94de5", + "id": "2b5680e5-a393-42d1-9e5e-1602c95a6468", "is_component": false, - "last_tested_version": "1.0.19.post2", - "name": "Market Research", - "tags": [ - "assistants", - "agents" - ] + "last_tested_version": "1.1.1", + "name": "Market Research" } \ No newline at end of file diff --git a/src/frontend/tests/core/integrations/Instagram Copywriter.spec.ts b/src/frontend/tests/core/integrations/Instagram Copywriter.spec.ts index 0ddb91d6f..ef72c7ceb 100644 --- a/src/frontend/tests/core/integrations/Instagram Copywriter.spec.ts +++ b/src/frontend/tests/core/integrations/Instagram Copywriter.spec.ts @@ -1,14 +1,9 @@ import { expect, test } from "@playwright/test"; import * as dotenv from "dotenv"; import path from "path"; -import { addNewApiKeys } from "../../utils/add-new-api-keys"; -import { adjustScreenView } from "../../utils/adjust-screen-view"; import { awaitBootstrapTest } from "../../utils/await-bootstrap-test"; import { getAllResponseMessage } from "../../utils/get-all-response-message"; import { initialGPTsetup } from "../../utils/initialGPTsetup"; -import { removeOldApiKeys } from "../../utils/remove-old-api-keys"; -import { selectGptModel } from "../../utils/select-gpt-model"; -import { updateOldComponents } from "../../utils/update-old-components"; import { waitForOpenModalWithChatInput } from "../../utils/wait-for-open-modal"; test( @@ -41,9 +36,11 @@ test( await initialGPTsetup(page); + // We have to get the rf__node because there are more components with popover-anchor-input-api_key await page + .getByTestId(/rf__node-TavilySearchComponent-[A-Za-z0-9]{5}/) .getByTestId("popover-anchor-input-api_key") - .nth(2) + .nth(0) .fill(process.env.TAVILY_API_KEY ?? ""); await page.getByTestId("button_run_chat output").click(); diff --git a/src/frontend/tests/core/integrations/Market Research.spec.ts b/src/frontend/tests/core/integrations/Market Research.spec.ts index 9ab31a3b1..6df987b52 100644 --- a/src/frontend/tests/core/integrations/Market Research.spec.ts +++ b/src/frontend/tests/core/integrations/Market Research.spec.ts @@ -34,8 +34,8 @@ test( }); await initialGPTsetup(page); - await page + .getByTestId(/rf__node-TavilySearchComponent-[A-Za-z0-9]{5}/) .getByTestId("popover-anchor-input-api_key") .nth(0) .fill(process.env.TAVILY_API_KEY ?? "");