From 0db81f01f78c35126045eb44a3a304131d46836f Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 21 Aug 2024 09:24:01 -0300 Subject: [PATCH] feat: update sequential tasks agent starter project (#3449) * feat: update sequential tasks starter project * feat: Refactor task agents for Researcher, Editor, and Comedian on Sequential Tasks Agent. * refactor(langflow): Update Sequential Crew component * refactor: Add SequentialCrewComponent for better organization. --- .../starter_projects/Sequential Agent.json | 3105 +++++++---------- .../sequential_tasks_agent.py | 79 +- 2 files changed, 1362 insertions(+), 1822 deletions(-) diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Sequential Agent.json b/src/backend/base/langflow/initial_setup/starter_projects/Sequential Agent.json index b46cfe2ee..4ed68a306 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Sequential Agent.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Sequential Agent.json @@ -1,246 +1,12 @@ { "data": { "edges": [ - { - "className": "", - "data": { - "sourceHandle": { - "dataType": "CrewAIAgentComponent", - "id": "CrewAIAgentComponent-iOzyS", - "name": "output", - "output_types": [ - "Agent" - ] - }, - "targetHandle": { - "fieldName": "agent", - "id": "SequentialTaskComponent-QyS1W", - "inputTypes": [ - "Agent" - ], - "type": "other" - } - }, - "id": "reactflow__edge-CrewAIAgentComponent-iOzyS{œdataTypeœ:œCrewAIAgentComponentœ,œidœ:œCrewAIAgentComponent-iOzySœ,œnameœ:œoutputœ,œoutput_typesœ:[œAgentœ]}-SequentialTaskComponent-QyS1W{œfieldNameœ:œagentœ,œidœ:œSequentialTaskComponent-QyS1Wœ,œinputTypesœ:[œAgentœ],œtypeœ:œotherœ}", - "source": "CrewAIAgentComponent-iOzyS", - "sourceHandle": "{œdataTypeœ: œCrewAIAgentComponentœ, œidœ: œCrewAIAgentComponent-iOzySœ, œnameœ: œoutputœ, œoutput_typesœ: [œAgentœ]}", - "target": "SequentialTaskComponent-QyS1W", - "targetHandle": "{œfieldNameœ: œagentœ, œidœ: œSequentialTaskComponent-QyS1Wœ, œinputTypesœ: [œAgentœ], œtypeœ: œotherœ}" - }, - { - "className": "", - "data": { - "sourceHandle": { - "dataType": "SequentialTaskComponent", - "id": "SequentialTaskComponent-GstqT", - "name": "task_output", - "output_types": [ - "SequentialTask" - ] - }, - "targetHandle": { - "fieldName": "task", - "id": "SequentialTaskComponent-PMvGd", - "inputTypes": [ - "SequentialTask" - ], - "type": "other" - } - }, - "id": "reactflow__edge-SequentialTaskComponent-GstqT{œdataTypeœ:œSequentialTaskComponentœ,œidœ:œSequentialTaskComponent-GstqTœ,œnameœ:œtask_outputœ,œoutput_typesœ:[œSequentialTaskœ]}-SequentialTaskComponent-PMvGd{œfieldNameœ:œtaskœ,œidœ:œSequentialTaskComponent-PMvGdœ,œinputTypesœ:[œSequentialTaskœ],œtypeœ:œotherœ}", - "source": "SequentialTaskComponent-GstqT", - "sourceHandle": "{œdataTypeœ: œSequentialTaskComponentœ, œidœ: œSequentialTaskComponent-GstqTœ, œnameœ: œtask_outputœ, œoutput_typesœ: [œSequentialTaskœ]}", - "target": "SequentialTaskComponent-PMvGd", - "targetHandle": "{œfieldNameœ: œtaskœ, œidœ: œSequentialTaskComponent-PMvGdœ, œinputTypesœ: [œSequentialTaskœ], œtypeœ: œotherœ}" - }, - { - "className": "", - "data": { - "sourceHandle": { - "dataType": "SequentialTaskComponent", - "id": "SequentialTaskComponent-QyS1W", - "name": "task_output", - "output_types": [ - "SequentialTask" - ] - }, - "targetHandle": { - "fieldName": "task", - "id": "SequentialTaskComponent-GstqT", - "inputTypes": [ - "SequentialTask" - ], - "type": "other" - } - }, - "id": "reactflow__edge-SequentialTaskComponent-QyS1W{œdataTypeœ:œSequentialTaskComponentœ,œidœ:œSequentialTaskComponent-QyS1Wœ,œnameœ:œtask_outputœ,œoutput_typesœ:[œSequentialTaskœ]}-SequentialTaskComponent-GstqT{œfieldNameœ:œtaskœ,œidœ:œSequentialTaskComponent-GstqTœ,œinputTypesœ:[œSequentialTaskœ],œtypeœ:œotherœ}", - "source": "SequentialTaskComponent-QyS1W", - "sourceHandle": "{œdataTypeœ: œSequentialTaskComponentœ, œidœ: œSequentialTaskComponent-QyS1Wœ, œnameœ: œtask_outputœ, œoutput_typesœ: [œSequentialTaskœ]}", - "target": "SequentialTaskComponent-GstqT", - "targetHandle": "{œfieldNameœ: œtaskœ, œidœ: œSequentialTaskComponent-GstqTœ, œinputTypesœ: [œSequentialTaskœ], œtypeœ: œotherœ}" - }, - { - "className": "", - "data": { - "sourceHandle": { - "dataType": "SequentialTaskComponent", - "id": "SequentialTaskComponent-PMvGd", - "name": "task_output", - "output_types": [ - "SequentialTask" - ] - }, - "targetHandle": { - "fieldName": "tasks", - "id": "SequentialCrewComponent-2ms90", - "inputTypes": [ - "SequentialTask" - ], - "type": "other" - } - }, - "id": "reactflow__edge-SequentialTaskComponent-PMvGd{œdataTypeœ:œSequentialTaskComponentœ,œidœ:œSequentialTaskComponent-PMvGdœ,œnameœ:œtask_outputœ,œoutput_typesœ:[œSequentialTaskœ]}-SequentialCrewComponent-2ms90{œfieldNameœ:œtasksœ,œidœ:œSequentialCrewComponent-2ms90œ,œinputTypesœ:[œSequentialTaskœ],œtypeœ:œotherœ}", - "source": "SequentialTaskComponent-PMvGd", - "sourceHandle": "{œdataTypeœ: œSequentialTaskComponentœ, œidœ: œSequentialTaskComponent-PMvGdœ, œnameœ: œtask_outputœ, œoutput_typesœ: [œSequentialTaskœ]}", - "target": "SequentialCrewComponent-2ms90", - "targetHandle": "{œfieldNameœ: œtasksœ, œidœ: œSequentialCrewComponent-2ms90œ, œinputTypesœ: [œSequentialTaskœ], œtypeœ: œotherœ}" - }, - { - "className": "", - "data": { - "sourceHandle": { - "dataType": "CrewAIAgentComponent", - "id": "CrewAIAgentComponent-jrjAi", - "name": "output", - "output_types": [ - "Agent" - ] - }, - "targetHandle": { - "fieldName": "agent", - "id": "SequentialTaskComponent-GstqT", - "inputTypes": [ - "Agent" - ], - "type": "other" - } - }, - "id": "reactflow__edge-CrewAIAgentComponent-jrjAi{œdataTypeœ:œCrewAIAgentComponentœ,œidœ:œCrewAIAgentComponent-jrjAiœ,œnameœ:œoutputœ,œoutput_typesœ:[œAgentœ]}-SequentialTaskComponent-GstqT{œfieldNameœ:œagentœ,œidœ:œSequentialTaskComponent-GstqTœ,œinputTypesœ:[œAgentœ],œtypeœ:œotherœ}", - "source": "CrewAIAgentComponent-jrjAi", - "sourceHandle": "{œdataTypeœ: œCrewAIAgentComponentœ, œidœ: œCrewAIAgentComponent-jrjAiœ, œnameœ: œoutputœ, œoutput_typesœ: [œAgentœ]}", - "target": "SequentialTaskComponent-GstqT", - "targetHandle": "{œfieldNameœ: œagentœ, œidœ: œSequentialTaskComponent-GstqTœ, œinputTypesœ: [œAgentœ], œtypeœ: œotherœ}" - }, - { - "className": "", - "data": { - "sourceHandle": { - "dataType": "CrewAIAgentComponent", - "id": "CrewAIAgentComponent-bvJAv", - "name": "output", - "output_types": [ - "Agent" - ] - }, - "targetHandle": { - "fieldName": "agent", - "id": "SequentialTaskComponent-PMvGd", - "inputTypes": [ - "Agent" - ], - "type": "other" - } - }, - "id": "reactflow__edge-CrewAIAgentComponent-bvJAv{œdataTypeœ:œCrewAIAgentComponentœ,œidœ:œCrewAIAgentComponent-bvJAvœ,œnameœ:œoutputœ,œoutput_typesœ:[œAgentœ]}-SequentialTaskComponent-PMvGd{œfieldNameœ:œagentœ,œidœ:œSequentialTaskComponent-PMvGdœ,œinputTypesœ:[œAgentœ],œtypeœ:œotherœ}", - "source": "CrewAIAgentComponent-bvJAv", - "sourceHandle": "{œdataTypeœ: œCrewAIAgentComponentœ, œidœ: œCrewAIAgentComponent-bvJAvœ, œnameœ: œoutputœ, œoutput_typesœ: [œAgentœ]}", - "target": "SequentialTaskComponent-PMvGd", - "targetHandle": "{œfieldNameœ: œagentœ, œidœ: œSequentialTaskComponent-PMvGdœ, œinputTypesœ: [œAgentœ], œtypeœ: œotherœ}" - }, - { - "className": "", - "data": { - "sourceHandle": { - "dataType": "OpenAIModel", - "id": "OpenAIModel-ZmR42", - "name": "model_output", - "output_types": [ - "LanguageModel" - ] - }, - "targetHandle": { - "fieldName": "llm", - "id": "CrewAIAgentComponent-iOzyS", - "inputTypes": [ - "LanguageModel" - ], - "type": "other" - } - }, - "id": "reactflow__edge-OpenAIModel-ZmR42{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-ZmR42œ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-CrewAIAgentComponent-iOzyS{œfieldNameœ:œllmœ,œidœ:œCrewAIAgentComponent-iOzySœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", - "source": "OpenAIModel-ZmR42", - "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-ZmR42œ, œnameœ: œmodel_outputœ, œoutput_typesœ: [œLanguageModelœ]}", - "target": "CrewAIAgentComponent-iOzyS", - "targetHandle": "{œfieldNameœ: œllmœ, œidœ: œCrewAIAgentComponent-iOzySœ, œinputTypesœ: [œLanguageModelœ], œtypeœ: œotherœ}" - }, - { - "className": "", - "data": { - "sourceHandle": { - "dataType": "OpenAIModel", - "id": "OpenAIModel-ZmR42", - "name": "model_output", - "output_types": [ - "LanguageModel" - ] - }, - "targetHandle": { - "fieldName": "llm", - "id": "CrewAIAgentComponent-jrjAi", - "inputTypes": [ - "LanguageModel" - ], - "type": "other" - } - }, - "id": "reactflow__edge-OpenAIModel-ZmR42{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-ZmR42œ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-CrewAIAgentComponent-jrjAi{œfieldNameœ:œllmœ,œidœ:œCrewAIAgentComponent-jrjAiœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", - "source": "OpenAIModel-ZmR42", - "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-ZmR42œ, œnameœ: œmodel_outputœ, œoutput_typesœ: [œLanguageModelœ]}", - "target": "CrewAIAgentComponent-jrjAi", - "targetHandle": "{œfieldNameœ: œllmœ, œidœ: œCrewAIAgentComponent-jrjAiœ, œinputTypesœ: [œLanguageModelœ], œtypeœ: œotherœ}" - }, - { - "className": "", - "data": { - "sourceHandle": { - "dataType": "OpenAIModel", - "id": "OpenAIModel-ZmR42", - "name": "model_output", - "output_types": [ - "LanguageModel" - ] - }, - "targetHandle": { - "fieldName": "llm", - "id": "CrewAIAgentComponent-bvJAv", - "inputTypes": [ - "LanguageModel" - ], - "type": "other" - } - }, - "id": "reactflow__edge-OpenAIModel-ZmR42{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-ZmR42œ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-CrewAIAgentComponent-bvJAv{œfieldNameœ:œllmœ,œidœ:œCrewAIAgentComponent-bvJAvœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", - "source": "OpenAIModel-ZmR42", - "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-ZmR42œ, œnameœ: œmodel_outputœ, œoutput_typesœ: [œLanguageModelœ]}", - "target": "CrewAIAgentComponent-bvJAv", - "targetHandle": "{œfieldNameœ: œllmœ, œidœ: œCrewAIAgentComponent-bvJAvœ, œinputTypesœ: [œLanguageModelœ], œtypeœ: œotherœ}" - }, { "className": "", "data": { "sourceHandle": { "dataType": "SequentialCrewComponent", - "id": "SequentialCrewComponent-2ms90", + "id": "SequentialCrewComponent-3dbbB", "name": "output", "output_types": [ "Message" @@ -248,77 +14,25 @@ }, "targetHandle": { "fieldName": "input_value", - "id": "ChatOutput-NP7N3", + "id": "ChatOutput-nwCjg", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-SequentialCrewComponent-2ms90{œdataTypeœ:œSequentialCrewComponentœ,œidœ:œSequentialCrewComponent-2ms90œ,œnameœ:œoutputœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-NP7N3{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-NP7N3œ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "SequentialCrewComponent-2ms90", - "sourceHandle": "{œdataTypeœ: œSequentialCrewComponentœ, œidœ: œSequentialCrewComponent-2ms90œ, œnameœ: œoutputœ, œoutput_typesœ: [œMessageœ]}", - "target": "ChatOutput-NP7N3", - "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-NP7N3œ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" - }, - { - "className": "", - "data": { - "sourceHandle": { - "dataType": "Prompt", - "id": "Prompt-6dDdF", - "name": "prompt", - "output_types": [ - "Message" - ] - }, - "targetHandle": { - "fieldName": "task_description", - "id": "SequentialTaskComponent-GstqT", - "inputTypes": [ - "Message" - ], - "type": "str" - } - }, - "id": "reactflow__edge-Prompt-6dDdF{œdataTypeœ:œPromptœ,œidœ:œPrompt-6dDdFœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-SequentialTaskComponent-GstqT{œfieldNameœ:œtask_descriptionœ,œidœ:œSequentialTaskComponent-GstqTœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Prompt-6dDdF", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-6dDdFœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "SequentialTaskComponent-GstqT", - "targetHandle": "{œfieldNameœ: œtask_descriptionœ, œidœ: œSequentialTaskComponent-GstqTœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" - }, - { - "className": "", - "data": { - "sourceHandle": { - "dataType": "Prompt", - "id": "Prompt-ByPrr", - "name": "prompt", - "output_types": [ - "Message" - ] - }, - "targetHandle": { - "fieldName": "task_description", - "id": "SequentialTaskComponent-PMvGd", - "inputTypes": [ - "Message" - ], - "type": "str" - } - }, - "id": "reactflow__edge-Prompt-ByPrr{œdataTypeœ:œPromptœ,œidœ:œPrompt-ByPrrœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-SequentialTaskComponent-PMvGd{œfieldNameœ:œtask_descriptionœ,œidœ:œSequentialTaskComponent-PMvGdœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Prompt-ByPrr", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-ByPrrœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "SequentialTaskComponent-PMvGd", - "targetHandle": "{œfieldNameœ: œtask_descriptionœ, œidœ: œSequentialTaskComponent-PMvGdœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-SequentialCrewComponent-3dbbB{œdataTypeœ:œSequentialCrewComponentœ,œidœ:œSequentialCrewComponent-3dbbBœ,œnameœ:œoutputœ,œoutput_typesœ:[œMessageœ]}-ChatOutput-nwCjg{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-nwCjgœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "SequentialCrewComponent-3dbbB", + "sourceHandle": "{œdataTypeœ: œSequentialCrewComponentœ, œidœ: œSequentialCrewComponent-3dbbBœ, œnameœ: œoutputœ, œoutput_typesœ: [œMessageœ]}", + "target": "ChatOutput-nwCjg", + "targetHandle": "{œfieldNameœ: œinput_valueœ, œidœ: œChatOutput-nwCjgœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" }, { "className": "", "data": { "sourceHandle": { "dataType": "TextInput", - "id": "TextInput-gf86E", + "id": "TextInput-6QUGr", "name": "text", "output_types": [ "Message" @@ -326,7 +40,7 @@ }, "targetHandle": { "fieldName": "topic", - "id": "Prompt-apr7e", + "id": "Prompt-GOdlL", "inputTypes": [ "Message", "Text" @@ -334,18 +48,18 @@ "type": "str" } }, - "id": "reactflow__edge-TextInput-gf86E{œdataTypeœ:œTextInputœ,œidœ:œTextInput-gf86Eœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-apr7e{œfieldNameœ:œtopicœ,œidœ:œPrompt-apr7eœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", - "source": "TextInput-gf86E", - "sourceHandle": "{œdataTypeœ: œTextInputœ, œidœ: œTextInput-gf86Eœ, œnameœ: œtextœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-apr7e", - "targetHandle": "{œfieldNameœ: œtopicœ, œidœ: œPrompt-apr7eœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-TextInput-6QUGr{œdataTypeœ:œTextInputœ,œidœ:œTextInput-6QUGrœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-GOdlL{œfieldNameœ:œtopicœ,œidœ:œPrompt-GOdlLœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "source": "TextInput-6QUGr", + "sourceHandle": "{œdataTypeœ: œTextInputœ, œidœ: œTextInput-6QUGrœ, œnameœ: œtextœ, œoutput_typesœ: [œMessageœ]}", + "target": "Prompt-GOdlL", + "targetHandle": "{œfieldNameœ: œtopicœ, œidœ: œPrompt-GOdlLœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" }, { "className": "", "data": { "sourceHandle": { "dataType": "TextInput", - "id": "TextInput-gf86E", + "id": "TextInput-6QUGr", "name": "text", "output_types": [ "Message" @@ -353,7 +67,7 @@ }, "targetHandle": { "fieldName": "topic", - "id": "Prompt-6dDdF", + "id": "Prompt-824D7", "inputTypes": [ "Message", "Text" @@ -361,18 +75,18 @@ "type": "str" } }, - "id": "reactflow__edge-TextInput-gf86E{œdataTypeœ:œTextInputœ,œidœ:œTextInput-gf86Eœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-6dDdF{œfieldNameœ:œtopicœ,œidœ:œPrompt-6dDdFœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", - "source": "TextInput-gf86E", - "sourceHandle": "{œdataTypeœ: œTextInputœ, œidœ: œTextInput-gf86Eœ, œnameœ: œtextœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-6dDdF", - "targetHandle": "{œfieldNameœ: œtopicœ, œidœ: œPrompt-6dDdFœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-TextInput-6QUGr{œdataTypeœ:œTextInputœ,œidœ:œTextInput-6QUGrœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-824D7{œfieldNameœ:œtopicœ,œidœ:œPrompt-824D7œ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "source": "TextInput-6QUGr", + "sourceHandle": "{œdataTypeœ: œTextInputœ, œidœ: œTextInput-6QUGrœ, œnameœ: œtextœ, œoutput_typesœ: [œMessageœ]}", + "target": "Prompt-824D7", + "targetHandle": "{œfieldNameœ: œtopicœ, œidœ: œPrompt-824D7œ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" }, { "className": "", "data": { "sourceHandle": { "dataType": "TextInput", - "id": "TextInput-gf86E", + "id": "TextInput-6QUGr", "name": "text", "output_types": [ "Message" @@ -380,7 +94,7 @@ }, "targetHandle": { "fieldName": "topic", - "id": "Prompt-ByPrr", + "id": "Prompt-0vHob", "inputTypes": [ "Message", "Text" @@ -388,18 +102,18 @@ "type": "str" } }, - "id": "reactflow__edge-TextInput-gf86E{œdataTypeœ:œTextInputœ,œidœ:œTextInput-gf86Eœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-ByPrr{œfieldNameœ:œtopicœ,œidœ:œPrompt-ByPrrœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", - "source": "TextInput-gf86E", - "sourceHandle": "{œdataTypeœ: œTextInputœ, œidœ: œTextInput-gf86Eœ, œnameœ: œtextœ, œoutput_typesœ: [œMessageœ]}", - "target": "Prompt-ByPrr", - "targetHandle": "{œfieldNameœ: œtopicœ, œidœ: œPrompt-ByPrrœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-TextInput-6QUGr{œdataTypeœ:œTextInputœ,œidœ:œTextInput-6QUGrœ,œnameœ:œtextœ,œoutput_typesœ:[œMessageœ]}-Prompt-0vHob{œfieldNameœ:œtopicœ,œidœ:œPrompt-0vHobœ,œinputTypesœ:[œMessageœ,œTextœ],œtypeœ:œstrœ}", + "source": "TextInput-6QUGr", + "sourceHandle": "{œdataTypeœ: œTextInputœ, œidœ: œTextInput-6QUGrœ, œnameœ: œtextœ, œoutput_typesœ: [œMessageœ]}", + "target": "Prompt-0vHob", + "targetHandle": "{œfieldNameœ: œtopicœ, œidœ: œPrompt-0vHobœ, œinputTypesœ: [œMessageœ, œTextœ], œtypeœ: œstrœ}" }, { "className": "", "data": { "sourceHandle": { "dataType": "Prompt", - "id": "Prompt-apr7e", + "id": "Prompt-GOdlL", "name": "prompt", "output_types": [ "Message" @@ -407,43 +121,244 @@ }, "targetHandle": { "fieldName": "task_description", - "id": "SequentialTaskComponent-QyS1W", + "id": "SequentialTaskAgentComponent-GWMA1", "inputTypes": [ "Message" ], "type": "str" } }, - "id": "reactflow__edge-Prompt-apr7e{œdataTypeœ:œPromptœ,œidœ:œPrompt-apr7eœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-SequentialTaskComponent-QyS1W{œfieldNameœ:œtask_descriptionœ,œidœ:œSequentialTaskComponent-QyS1Wœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", - "source": "Prompt-apr7e", - "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-apr7eœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", - "target": "SequentialTaskComponent-QyS1W", - "targetHandle": "{œfieldNameœ: œtask_descriptionœ, œidœ: œSequentialTaskComponent-QyS1Wœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + "id": "reactflow__edge-Prompt-GOdlL{œdataTypeœ:œPromptœ,œidœ:œPrompt-GOdlLœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-SequentialTaskAgentComponent-GWMA1{œfieldNameœ:œtask_descriptionœ,œidœ:œSequentialTaskAgentComponent-GWMA1œ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "Prompt-GOdlL", + "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-GOdlLœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", + "target": "SequentialTaskAgentComponent-GWMA1", + "targetHandle": "{œfieldNameœ: œtask_descriptionœ, œidœ: œSequentialTaskAgentComponent-GWMA1œ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + }, + { + "className": "", + "data": { + "sourceHandle": { + "dataType": "OpenAIModel", + "id": "OpenAIModel-lQ5HF", + "name": "model_output", + "output_types": [ + "LanguageModel" + ] + }, + "targetHandle": { + "fieldName": "llm", + "id": "SequentialTaskAgentComponent-GWMA1", + "inputTypes": [ + "LanguageModel" + ], + "type": "other" + } + }, + "id": "reactflow__edge-OpenAIModel-lQ5HF{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-lQ5HFœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-SequentialTaskAgentComponent-GWMA1{œfieldNameœ:œllmœ,œidœ:œSequentialTaskAgentComponent-GWMA1œ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", + "source": "OpenAIModel-lQ5HF", + "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-lQ5HFœ, œnameœ: œmodel_outputœ, œoutput_typesœ: [œLanguageModelœ]}", + "target": "SequentialTaskAgentComponent-GWMA1", + "targetHandle": "{œfieldNameœ: œllmœ, œidœ: œSequentialTaskAgentComponent-GWMA1œ, œinputTypesœ: [œLanguageModelœ], œtypeœ: œotherœ}" }, { "data": { "sourceHandle": { - "dataType": "SearchAPI", - "id": "SearchAPI-yyOHb", - "name": "api_build_tool", + "dataType": "OpenAIModel", + "id": "OpenAIModel-lQ5HF", + "name": "model_output", + "output_types": [ + "LanguageModel" + ] + }, + "targetHandle": { + "fieldName": "llm", + "id": "SequentialTaskAgentComponent-5i4Wg", + "inputTypes": [ + "LanguageModel" + ], + "type": "other" + } + }, + "id": "reactflow__edge-OpenAIModel-lQ5HF{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-lQ5HFœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-SequentialTaskAgentComponent-5i4Wg{œfieldNameœ:œllmœ,œidœ:œSequentialTaskAgentComponent-5i4Wgœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", + "source": "OpenAIModel-lQ5HF", + "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-lQ5HFœ, œnameœ: œmodel_outputœ, œoutput_typesœ: [œLanguageModelœ]}", + "target": "SequentialTaskAgentComponent-5i4Wg", + "targetHandle": "{œfieldNameœ: œllmœ, œidœ: œSequentialTaskAgentComponent-5i4Wgœ, œinputTypesœ: [œLanguageModelœ], œtypeœ: œotherœ}" + }, + { + "data": { + "sourceHandle": { + "dataType": "Prompt", + "id": "Prompt-824D7", + "name": "prompt", + "output_types": [ + "Message" + ] + }, + "targetHandle": { + "fieldName": "task_description", + "id": "SequentialTaskAgentComponent-5i4Wg", + "inputTypes": [ + "Message" + ], + "type": "str" + } + }, + "id": "reactflow__edge-Prompt-824D7{œdataTypeœ:œPromptœ,œidœ:œPrompt-824D7œ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-SequentialTaskAgentComponent-5i4Wg{œfieldNameœ:œtask_descriptionœ,œidœ:œSequentialTaskAgentComponent-5i4Wgœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "Prompt-824D7", + "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-824D7œ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", + "target": "SequentialTaskAgentComponent-5i4Wg", + "targetHandle": "{œfieldNameœ: œtask_descriptionœ, œidœ: œSequentialTaskAgentComponent-5i4Wgœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + }, + { + "data": { + "sourceHandle": { + "dataType": "SequentialTaskAgentComponent", + "id": "SequentialTaskAgentComponent-GWMA1", + "name": "task_output", + "output_types": [ + "SequentialTask" + ] + }, + "targetHandle": { + "fieldName": "previous_task", + "id": "SequentialTaskAgentComponent-5i4Wg", + "inputTypes": [ + "SequentialTask" + ], + "type": "other" + } + }, + "id": "reactflow__edge-SequentialTaskAgentComponent-GWMA1{œdataTypeœ:œSequentialTaskAgentComponentœ,œidœ:œSequentialTaskAgentComponent-GWMA1œ,œnameœ:œtask_outputœ,œoutput_typesœ:[œSequentialTaskœ]}-SequentialTaskAgentComponent-5i4Wg{œfieldNameœ:œprevious_taskœ,œidœ:œSequentialTaskAgentComponent-5i4Wgœ,œinputTypesœ:[œSequentialTaskœ],œtypeœ:œotherœ}", + "source": "SequentialTaskAgentComponent-GWMA1", + "sourceHandle": "{œdataTypeœ: œSequentialTaskAgentComponentœ, œidœ: œSequentialTaskAgentComponent-GWMA1œ, œnameœ: œtask_outputœ, œoutput_typesœ: [œSequentialTaskœ]}", + "target": "SequentialTaskAgentComponent-5i4Wg", + "targetHandle": "{œfieldNameœ: œprevious_taskœ, œidœ: œSequentialTaskAgentComponent-5i4Wgœ, œinputTypesœ: [œSequentialTaskœ], œtypeœ: œotherœ}" + }, + { + "data": { + "sourceHandle": { + "dataType": "SequentialTaskAgentComponent", + "id": "SequentialTaskAgentComponent-5i4Wg", + "name": "task_output", + "output_types": [ + "SequentialTask" + ] + }, + "targetHandle": { + "fieldName": "previous_task", + "id": "SequentialTaskAgentComponent-TPEWE", + "inputTypes": [ + "SequentialTask" + ], + "type": "other" + } + }, + "id": "reactflow__edge-SequentialTaskAgentComponent-5i4Wg{œdataTypeœ:œSequentialTaskAgentComponentœ,œidœ:œSequentialTaskAgentComponent-5i4Wgœ,œnameœ:œtask_outputœ,œoutput_typesœ:[œSequentialTaskœ]}-SequentialTaskAgentComponent-TPEWE{œfieldNameœ:œprevious_taskœ,œidœ:œSequentialTaskAgentComponent-TPEWEœ,œinputTypesœ:[œSequentialTaskœ],œtypeœ:œotherœ}", + "source": "SequentialTaskAgentComponent-5i4Wg", + "sourceHandle": "{œdataTypeœ: œSequentialTaskAgentComponentœ, œidœ: œSequentialTaskAgentComponent-5i4Wgœ, œnameœ: œtask_outputœ, œoutput_typesœ: [œSequentialTaskœ]}", + "target": "SequentialTaskAgentComponent-TPEWE", + "targetHandle": "{œfieldNameœ: œprevious_taskœ, œidœ: œSequentialTaskAgentComponent-TPEWEœ, œinputTypesœ: [œSequentialTaskœ], œtypeœ: œotherœ}" + }, + { + "data": { + "sourceHandle": { + "dataType": "Prompt", + "id": "Prompt-0vHob", + "name": "prompt", + "output_types": [ + "Message" + ] + }, + "targetHandle": { + "fieldName": "task_description", + "id": "SequentialTaskAgentComponent-TPEWE", + "inputTypes": [ + "Message" + ], + "type": "str" + } + }, + "id": "reactflow__edge-Prompt-0vHob{œdataTypeœ:œPromptœ,œidœ:œPrompt-0vHobœ,œnameœ:œpromptœ,œoutput_typesœ:[œMessageœ]}-SequentialTaskAgentComponent-TPEWE{œfieldNameœ:œtask_descriptionœ,œidœ:œSequentialTaskAgentComponent-TPEWEœ,œinputTypesœ:[œMessageœ],œtypeœ:œstrœ}", + "source": "Prompt-0vHob", + "sourceHandle": "{œdataTypeœ: œPromptœ, œidœ: œPrompt-0vHobœ, œnameœ: œpromptœ, œoutput_typesœ: [œMessageœ]}", + "target": "SequentialTaskAgentComponent-TPEWE", + "targetHandle": "{œfieldNameœ: œtask_descriptionœ, œidœ: œSequentialTaskAgentComponent-TPEWEœ, œinputTypesœ: [œMessageœ], œtypeœ: œstrœ}" + }, + { + "data": { + "sourceHandle": { + "dataType": "SequentialTaskAgentComponent", + "id": "SequentialTaskAgentComponent-TPEWE", + "name": "task_output", + "output_types": [ + "SequentialTask" + ] + }, + "targetHandle": { + "fieldName": "tasks", + "id": "SequentialCrewComponent-3dbbB", + "inputTypes": [ + "SequentialTask" + ], + "type": "other" + } + }, + "id": "reactflow__edge-SequentialTaskAgentComponent-TPEWE{œdataTypeœ:œSequentialTaskAgentComponentœ,œidœ:œSequentialTaskAgentComponent-TPEWEœ,œnameœ:œtask_outputœ,œoutput_typesœ:[œSequentialTaskœ]}-SequentialCrewComponent-3dbbB{œfieldNameœ:œtasksœ,œidœ:œSequentialCrewComponent-3dbbBœ,œinputTypesœ:[œSequentialTaskœ],œtypeœ:œotherœ}", + "source": "SequentialTaskAgentComponent-TPEWE", + "sourceHandle": "{œdataTypeœ: œSequentialTaskAgentComponentœ, œidœ: œSequentialTaskAgentComponent-TPEWEœ, œnameœ: œtask_outputœ, œoutput_typesœ: [œSequentialTaskœ]}", + "target": "SequentialCrewComponent-3dbbB", + "targetHandle": "{œfieldNameœ: œtasksœ, œidœ: œSequentialCrewComponent-3dbbBœ, œinputTypesœ: [œSequentialTaskœ], œtypeœ: œotherœ}" + }, + { + "data": { + "sourceHandle": { + "dataType": "OpenAIModel", + "id": "OpenAIModel-lQ5HF", + "name": "model_output", + "output_types": [ + "LanguageModel" + ] + }, + "targetHandle": { + "fieldName": "llm", + "id": "SequentialTaskAgentComponent-TPEWE", + "inputTypes": [ + "LanguageModel" + ], + "type": "other" + } + }, + "id": "reactflow__edge-OpenAIModel-lQ5HF{œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-lQ5HFœ,œnameœ:œmodel_outputœ,œoutput_typesœ:[œLanguageModelœ]}-SequentialTaskAgentComponent-TPEWE{œfieldNameœ:œllmœ,œidœ:œSequentialTaskAgentComponent-TPEWEœ,œinputTypesœ:[œLanguageModelœ],œtypeœ:œotherœ}", + "source": "OpenAIModel-lQ5HF", + "sourceHandle": "{œdataTypeœ: œOpenAIModelœ, œidœ: œOpenAIModel-lQ5HFœ, œnameœ: œmodel_outputœ, œoutput_typesœ: [œLanguageModelœ]}", + "target": "SequentialTaskAgentComponent-TPEWE", + "targetHandle": "{œfieldNameœ: œllmœ, œidœ: œSequentialTaskAgentComponent-TPEWEœ, œinputTypesœ: [œLanguageModelœ], œtypeœ: œotherœ}" + }, + { + "data": { + "sourceHandle": { + "dataType": "YFinanceTool", + "id": "YFinanceTool-Asoka", + "name": "tool", "output_types": [ "Tool" ] }, "targetHandle": { "fieldName": "tools", - "id": "CrewAIAgentComponent-iOzyS", + "id": "SequentialTaskAgentComponent-GWMA1", "inputTypes": [ "Tool" ], "type": "other" } }, - "id": "reactflow__edge-SearchAPI-yyOHb{œdataTypeœ:œSearchAPIœ,œidœ:œSearchAPI-yyOHbœ,œnameœ:œapi_build_toolœ,œoutput_typesœ:[œToolœ]}-CrewAIAgentComponent-iOzyS{œfieldNameœ:œtoolsœ,œidœ:œCrewAIAgentComponent-iOzySœ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", - "source": "SearchAPI-yyOHb", - "sourceHandle": "{œdataTypeœ: œSearchAPIœ, œidœ: œSearchAPI-yyOHbœ, œnameœ: œapi_build_toolœ, œoutput_typesœ: [œToolœ]}", - "target": "CrewAIAgentComponent-iOzyS", - "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œCrewAIAgentComponent-iOzySœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" + "id": "reactflow__edge-YFinanceTool-Asoka{œdataTypeœ:œYFinanceToolœ,œidœ:œYFinanceTool-Asokaœ,œnameœ:œtoolœ,œoutput_typesœ:[œToolœ]}-SequentialTaskAgentComponent-GWMA1{œfieldNameœ:œtoolsœ,œidœ:œSequentialTaskAgentComponent-GWMA1œ,œinputTypesœ:[œToolœ],œtypeœ:œotherœ}", + "source": "YFinanceTool-Asoka", + "sourceHandle": "{œdataTypeœ: œYFinanceToolœ, œidœ: œYFinanceTool-Asokaœ, œnameœ: œtoolœ, œoutput_typesœ: [œToolœ]}", + "target": "SequentialTaskAgentComponent-GWMA1", + "targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œSequentialTaskAgentComponent-GWMA1œ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}" } ], "nodes": [ @@ -451,7 +366,7 @@ "data": { "description": "Represents a group of agents, defining how they should collaborate and the tasks they should perform.", "display_name": "Sequential Crew", - "id": "SequentialCrewComponent-2ms90", + "id": "SequentialCrewComponent-3dbbB", "node": { "base_classes": [ "Message" @@ -474,6 +389,7 @@ ], "frozen": false, "icon": "CrewAI", + "lf_version": "1.0.15", "output_types": [], "outputs": [ { @@ -625,15 +541,15 @@ "type": "SequentialCrewComponent" }, "dragging": false, - "height": 315, - "id": "SequentialCrewComponent-2ms90", + "height": 284, + "id": "SequentialCrewComponent-3dbbB", "position": { - "x": 1496.0834127531327, - "y": 252.03224104884515 + "x": 1452.9740869513873, + "y": 217.5447804074488 }, "positionAbsolute": { - "x": 1496.0834127531327, - "y": 252.03224104884515 + "x": 1452.9740869513873, + "y": 217.5447804074488 }, "selected": false, "type": "genericNode", @@ -641,1357 +557,7 @@ }, { "data": { - "description": "Represents an agent of CrewAI.", - "display_name": "CrewAI Agent", - "id": "CrewAIAgentComponent-iOzyS", - "node": { - "base_classes": [ - "Agent" - ], - "beta": false, - "conditional_paths": [], - "custom_fields": {}, - "description": "Represents an agent of CrewAI.", - "display_name": "CrewAI Agent", - "documentation": "https://docs.crewai.com/how-to/LLM-Connections/", - "edited": false, - "field_order": [ - "role", - "goal", - "backstory", - "tools", - "llm", - "memory", - "verbose", - "allow_delegation", - "allow_code_execution", - "kwargs" - ], - "frozen": false, - "icon": "CrewAI", - "output_types": [], - "outputs": [ - { - "cache": true, - "display_name": "Agent", - "method": "build_output", - "name": "output", - "selected": "Agent", - "types": [ - "Agent" - ], - "value": "__UNDEFINED__" - } - ], - "pinned": false, - "template": { - "_type": "Component", - "allow_code_execution": { - "advanced": true, - "display_name": "Allow Code Execution", - "dynamic": false, - "info": "Whether the agent is allowed to execute code.", - "list": false, - "name": "allow_code_execution", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": false - }, - "allow_delegation": { - "advanced": false, - "display_name": "Allow Delegation", - "dynamic": false, - "info": "Whether the agent is allowed to delegate tasks to other agents.", - "list": false, - "load_from_db": false, - "name": "allow_delegation", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": false - }, - "backstory": { - "advanced": false, - "display_name": "Backstory", - "dynamic": false, - "info": "The backstory of the agent.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "backstory", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "Research has always been your thing. You can quickly find things on the web because of your skills." - }, - "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 crewai import Agent # type: ignore\n\nfrom langflow.custom import Component\nfrom langflow.io import BoolInput, DictInput, HandleInput, MultilineInput, Output\n\n\nclass CrewAIAgentComponent(Component):\n display_name = \"CrewAI Agent\"\n description = \"Represents an agent of CrewAI.\"\n documentation: str = \"https://docs.crewai.com/how-to/LLM-Connections/\"\n icon = \"CrewAI\"\n\n inputs = [\n MultilineInput(name=\"role\", display_name=\"Role\", info=\"The role of the agent.\"),\n MultilineInput(name=\"goal\", display_name=\"Goal\", info=\"The objective of the agent.\"),\n MultilineInput(name=\"backstory\", display_name=\"Backstory\", info=\"The backstory of the agent.\"),\n HandleInput(\n name=\"tools\",\n display_name=\"Tools\",\n input_types=[\"Tool\"],\n is_list=True,\n info=\"Tools at agents disposal\",\n value=[],\n ),\n HandleInput(\n name=\"llm\",\n display_name=\"Language Model\",\n info=\"Language model that will run the agent.\",\n input_types=[\"LanguageModel\"],\n ),\n BoolInput(\n name=\"memory\",\n display_name=\"Memory\",\n info=\"Whether the agent should have memory or not\",\n advanced=True,\n value=True,\n ),\n BoolInput(\n name=\"verbose\",\n display_name=\"Verbose\",\n advanced=True,\n value=False,\n ),\n BoolInput(\n name=\"allow_delegation\",\n display_name=\"Allow Delegation\",\n info=\"Whether the agent is allowed to delegate tasks to other agents.\",\n value=True,\n ),\n BoolInput(\n name=\"allow_code_execution\",\n display_name=\"Allow Code Execution\",\n info=\"Whether the agent is allowed to execute code.\",\n value=False,\n advanced=True,\n ),\n DictInput(\n name=\"kwargs\",\n display_name=\"kwargs\",\n info=\"kwargs of agent.\",\n is_list=True,\n advanced=True,\n ),\n ]\n\n outputs = [\n Output(display_name=\"Agent\", name=\"output\", method=\"build_output\"),\n ]\n\n def build_output(self) -> Agent:\n kwargs = self.kwargs if self.kwargs else {}\n agent = Agent(\n role=self.role,\n goal=self.goal,\n backstory=self.backstory,\n llm=self.llm,\n verbose=self.verbose,\n memory=self.memory,\n tools=self.tools if self.tools else [],\n allow_delegation=self.allow_delegation,\n allow_code_execution=self.allow_code_execution,\n **kwargs,\n )\n self.status = repr(agent)\n return agent\n" - }, - "goal": { - "advanced": false, - "display_name": "Goal", - "dynamic": false, - "info": "The objective of the agent.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "goal", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "Search Google to find information to complete the task." - }, - "kwargs": { - "advanced": true, - "display_name": "kwargs", - "dynamic": false, - "info": "kwargs of agent.", - "list": true, - "name": "kwargs", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "type": "dict", - "value": {} - }, - "llm": { - "advanced": false, - "display_name": "Language Model", - "dynamic": false, - "info": "Language model that will run the agent.", - "input_types": [ - "LanguageModel" - ], - "list": false, - "name": "llm", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": "" - }, - "memory": { - "advanced": true, - "display_name": "Memory", - "dynamic": false, - "info": "Whether the agent should have memory or not", - "list": false, - "name": "memory", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": true - }, - "role": { - "advanced": false, - "display_name": "Role", - "dynamic": false, - "info": "The role of the agent.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "role", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "Researcher" - }, - "tools": { - "advanced": false, - "display_name": "Tools", - "dynamic": false, - "info": "Tools at agents disposal", - "input_types": [ - "Tool" - ], - "list": true, - "name": "tools", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": [] - }, - "verbose": { - "advanced": true, - "display_name": "Verbose", - "dynamic": false, - "info": "", - "list": false, - "name": "verbose", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": false - } - } - }, - "type": "CrewAIAgentComponent" - }, - "dragging": false, - "height": 665, - "id": "CrewAIAgentComponent-iOzyS", - "position": { - "x": -1550.7778579481528, - "y": -518.39242270897 - }, - "positionAbsolute": { - "x": -1550.7778579481528, - "y": -518.39242270897 - }, - "selected": false, - "type": "genericNode", - "width": 384 - }, - { - "data": { - "description": "Each task must have a description, an expected output and an agent responsible for execution.", - "display_name": "Sequential Task", - "id": "SequentialTaskComponent-QyS1W", - "node": { - "base_classes": [ - "SequentialTask" - ], - "beta": false, - "conditional_paths": [], - "custom_fields": {}, - "description": "Each task must have a description, an expected output and an agent responsible for execution.", - "display_name": "Sequential Task", - "documentation": "", - "edited": false, - "field_order": [ - "task_description", - "expected_output", - "tools", - "agent", - "task", - "async_execution" - ], - "frozen": false, - "icon": "CrewAI", - "output_types": [], - "outputs": [ - { - "cache": true, - "display_name": "Task", - "method": "build_task", - "name": "task_output", - "selected": "SequentialTask", - "types": [ - "SequentialTask" - ], - "value": "__UNDEFINED__" - } - ], - "pinned": false, - "template": { - "_type": "Component", - "agent": { - "advanced": false, - "display_name": "Agent", - "dynamic": false, - "info": "CrewAI Agent that will perform the task", - "input_types": [ - "Agent" - ], - "list": false, - "name": "agent", - "placeholder": "", - "required": true, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": "" - }, - "async_execution": { - "advanced": true, - "display_name": "Async Execution", - "dynamic": false, - "info": "Boolean flag indicating asynchronous task execution.", - "list": false, - "name": "async_execution", - "placeholder": "", - "required": false, - "show": true, - "title_case": 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 langflow.base.agents.crewai.tasks import SequentialTask\nfrom langflow.custom import Component\nfrom langflow.io import BoolInput, HandleInput, MultilineInput, Output\n\n\nclass SequentialTaskComponent(Component):\n display_name: str = \"Sequential Task\"\n description: str = \"Each task must have a description, an expected output and an agent responsible for execution.\"\n icon = \"CrewAI\"\n inputs = [\n MultilineInput(\n name=\"task_description\",\n display_name=\"Description\",\n info=\"Descriptive text detailing task's purpose and execution.\",\n ),\n MultilineInput(\n name=\"expected_output\",\n display_name=\"Expected Output\",\n info=\"Clear definition of expected task outcome.\",\n ),\n HandleInput(\n name=\"tools\",\n display_name=\"Tools\",\n input_types=[\"Tool\"],\n is_list=True,\n info=\"List of tools/resources limited for task execution. Uses the Agent tools by default.\",\n required=False,\n advanced=True,\n ),\n HandleInput(\n name=\"agent\",\n display_name=\"Agent\",\n input_types=[\"Agent\"],\n info=\"CrewAI Agent that will perform the task\",\n required=True,\n ),\n HandleInput(\n name=\"task\",\n display_name=\"Task\",\n input_types=[\"SequentialTask\"],\n info=\"CrewAI Task that will perform the task\",\n ),\n BoolInput(\n name=\"async_execution\",\n display_name=\"Async Execution\",\n value=True,\n advanced=True,\n info=\"Boolean flag indicating asynchronous task execution.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Task\", name=\"task_output\", method=\"build_task\"),\n ]\n\n def build_task(self) -> list[SequentialTask]:\n tasks: list[SequentialTask] = []\n task = SequentialTask(\n description=self.task_description,\n expected_output=self.expected_output,\n tools=self.agent.tools,\n async_execution=False,\n agent=self.agent,\n )\n tasks.append(task)\n self.status = task\n if self.task:\n if isinstance(self.task, list) and all(isinstance(task, SequentialTask) for task in self.task):\n tasks = self.task + tasks\n elif isinstance(self.task, SequentialTask):\n tasks = [self.task] + tasks\n return tasks\n" - }, - "expected_output": { - "advanced": false, - "display_name": "Expected Output", - "dynamic": false, - "info": "Clear definition of expected task outcome.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "expected_output", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "Bullet points and small phrases about the research topic." - }, - "task": { - "advanced": false, - "display_name": "Task", - "dynamic": false, - "info": "CrewAI Task that will perform the task", - "input_types": [ - "SequentialTask" - ], - "list": false, - "name": "task", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": "" - }, - "task_description": { - "advanced": false, - "display_name": "Description", - "dynamic": false, - "info": "Descriptive text detailing task's purpose and execution.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "task_description", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "tools": { - "advanced": true, - "display_name": "Tools", - "dynamic": false, - "info": "List of tools/resources limited for task execution. Uses the Agent tools by default.", - "input_types": [ - "Tool" - ], - "list": true, - "name": "tools", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": "" - } - } - }, - "type": "SequentialTaskComponent" - }, - "dragging": false, - "height": 551, - "id": "SequentialTaskComponent-QyS1W", - "position": { - "x": -983.4355350416582, - "y": 148.59988576915515 - }, - "positionAbsolute": { - "x": -983.4355350416582, - "y": 148.59988576915515 - }, - "selected": false, - "type": "genericNode", - "width": 384 - }, - { - "data": { - "description": "Each task must have a description, an expected output and an agent responsible for execution.", - "display_name": "Sequential Task", - "id": "SequentialTaskComponent-GstqT", - "node": { - "base_classes": [ - "SequentialTask" - ], - "beta": false, - "conditional_paths": [], - "custom_fields": {}, - "description": "Each task must have a description, an expected output and an agent responsible for execution.", - "display_name": "Sequential Task", - "documentation": "", - "edited": false, - "field_order": [ - "task_description", - "expected_output", - "tools", - "agent", - "task", - "async_execution" - ], - "frozen": false, - "icon": "CrewAI", - "output_types": [], - "outputs": [ - { - "cache": true, - "display_name": "Task", - "method": "build_task", - "name": "task_output", - "selected": "SequentialTask", - "types": [ - "SequentialTask" - ], - "value": "__UNDEFINED__" - } - ], - "pinned": false, - "template": { - "_type": "Component", - "agent": { - "advanced": false, - "display_name": "Agent", - "dynamic": false, - "info": "CrewAI Agent that will perform the task", - "input_types": [ - "Agent" - ], - "list": false, - "name": "agent", - "placeholder": "", - "required": true, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": "" - }, - "async_execution": { - "advanced": true, - "display_name": "Async Execution", - "dynamic": false, - "info": "Boolean flag indicating asynchronous task execution.", - "list": false, - "name": "async_execution", - "placeholder": "", - "required": false, - "show": true, - "title_case": 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 langflow.base.agents.crewai.tasks import SequentialTask\nfrom langflow.custom import Component\nfrom langflow.io import BoolInput, HandleInput, MultilineInput, Output\n\n\nclass SequentialTaskComponent(Component):\n display_name: str = \"Sequential Task\"\n description: str = \"Each task must have a description, an expected output and an agent responsible for execution.\"\n icon = \"CrewAI\"\n inputs = [\n MultilineInput(\n name=\"task_description\",\n display_name=\"Description\",\n info=\"Descriptive text detailing task's purpose and execution.\",\n ),\n MultilineInput(\n name=\"expected_output\",\n display_name=\"Expected Output\",\n info=\"Clear definition of expected task outcome.\",\n ),\n HandleInput(\n name=\"tools\",\n display_name=\"Tools\",\n input_types=[\"Tool\"],\n is_list=True,\n info=\"List of tools/resources limited for task execution. Uses the Agent tools by default.\",\n required=False,\n advanced=True,\n ),\n HandleInput(\n name=\"agent\",\n display_name=\"Agent\",\n input_types=[\"Agent\"],\n info=\"CrewAI Agent that will perform the task\",\n required=True,\n ),\n HandleInput(\n name=\"task\",\n display_name=\"Task\",\n input_types=[\"SequentialTask\"],\n info=\"CrewAI Task that will perform the task\",\n ),\n BoolInput(\n name=\"async_execution\",\n display_name=\"Async Execution\",\n value=True,\n advanced=True,\n info=\"Boolean flag indicating asynchronous task execution.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Task\", name=\"task_output\", method=\"build_task\"),\n ]\n\n def build_task(self) -> list[SequentialTask]:\n tasks: list[SequentialTask] = []\n task = SequentialTask(\n description=self.task_description,\n expected_output=self.expected_output,\n tools=self.agent.tools,\n async_execution=False,\n agent=self.agent,\n )\n tasks.append(task)\n self.status = task\n if self.task:\n if isinstance(self.task, list) and all(isinstance(task, SequentialTask) for task in self.task):\n tasks = self.task + tasks\n elif isinstance(self.task, SequentialTask):\n tasks = [self.task] + tasks\n return tasks\n" - }, - "expected_output": { - "advanced": false, - "display_name": "Expected Output", - "dynamic": false, - "info": "Clear definition of expected task outcome.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "expected_output", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "Small paragraphs and bullet points with the corrected content." - }, - "task": { - "advanced": false, - "display_name": "Task", - "dynamic": false, - "info": "CrewAI Task that will perform the task", - "input_types": [ - "SequentialTask" - ], - "list": false, - "name": "task", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": "" - }, - "task_description": { - "advanced": false, - "display_name": "Description", - "dynamic": false, - "info": "Descriptive text detailing task's purpose and execution.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "task_description", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "tools": { - "advanced": true, - "display_name": "Tools", - "dynamic": false, - "info": "List of tools/resources limited for task execution. Uses the Agent tools by default.", - "input_types": [ - "Tool" - ], - "list": true, - "name": "tools", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": "" - } - } - }, - "type": "SequentialTaskComponent" - }, - "dragging": false, - "height": 551, - "id": "SequentialTaskComponent-GstqT", - "position": { - "x": -77.94104937963255, - "y": 157.6447364692444 - }, - "positionAbsolute": { - "x": -77.94104937963255, - "y": 157.6447364692444 - }, - "selected": false, - "type": "genericNode", - "width": 384 - }, - { - "data": { - "description": "Each task must have a description, an expected output and an agent responsible for execution.", - "display_name": "Sequential Task", - "id": "SequentialTaskComponent-PMvGd", - "node": { - "base_classes": [ - "SequentialTask" - ], - "beta": false, - "conditional_paths": [], - "custom_fields": {}, - "description": "Each task must have a description, an expected output and an agent responsible for execution.", - "display_name": "Sequential Task", - "documentation": "", - "edited": false, - "field_order": [ - "task_description", - "expected_output", - "tools", - "agent", - "task", - "async_execution" - ], - "frozen": false, - "icon": "CrewAI", - "output_types": [], - "outputs": [ - { - "cache": true, - "display_name": "Task", - "method": "build_task", - "name": "task_output", - "selected": "SequentialTask", - "types": [ - "SequentialTask" - ], - "value": "__UNDEFINED__" - } - ], - "pinned": false, - "template": { - "_type": "Component", - "agent": { - "advanced": false, - "display_name": "Agent", - "dynamic": false, - "info": "CrewAI Agent that will perform the task", - "input_types": [ - "Agent" - ], - "list": false, - "name": "agent", - "placeholder": "", - "required": true, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": "" - }, - "async_execution": { - "advanced": true, - "display_name": "Async Execution", - "dynamic": false, - "info": "Boolean flag indicating asynchronous task execution.", - "list": false, - "name": "async_execution", - "placeholder": "", - "required": false, - "show": true, - "title_case": 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 langflow.base.agents.crewai.tasks import SequentialTask\nfrom langflow.custom import Component\nfrom langflow.io import BoolInput, HandleInput, MultilineInput, Output\n\n\nclass SequentialTaskComponent(Component):\n display_name: str = \"Sequential Task\"\n description: str = \"Each task must have a description, an expected output and an agent responsible for execution.\"\n icon = \"CrewAI\"\n inputs = [\n MultilineInput(\n name=\"task_description\",\n display_name=\"Description\",\n info=\"Descriptive text detailing task's purpose and execution.\",\n ),\n MultilineInput(\n name=\"expected_output\",\n display_name=\"Expected Output\",\n info=\"Clear definition of expected task outcome.\",\n ),\n HandleInput(\n name=\"tools\",\n display_name=\"Tools\",\n input_types=[\"Tool\"],\n is_list=True,\n info=\"List of tools/resources limited for task execution. Uses the Agent tools by default.\",\n required=False,\n advanced=True,\n ),\n HandleInput(\n name=\"agent\",\n display_name=\"Agent\",\n input_types=[\"Agent\"],\n info=\"CrewAI Agent that will perform the task\",\n required=True,\n ),\n HandleInput(\n name=\"task\",\n display_name=\"Task\",\n input_types=[\"SequentialTask\"],\n info=\"CrewAI Task that will perform the task\",\n ),\n BoolInput(\n name=\"async_execution\",\n display_name=\"Async Execution\",\n value=True,\n advanced=True,\n info=\"Boolean flag indicating asynchronous task execution.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Task\", name=\"task_output\", method=\"build_task\"),\n ]\n\n def build_task(self) -> list[SequentialTask]:\n tasks: list[SequentialTask] = []\n task = SequentialTask(\n description=self.task_description,\n expected_output=self.expected_output,\n tools=self.agent.tools,\n async_execution=False,\n agent=self.agent,\n )\n tasks.append(task)\n self.status = task\n if self.task:\n if isinstance(self.task, list) and all(isinstance(task, SequentialTask) for task in self.task):\n tasks = self.task + tasks\n elif isinstance(self.task, SequentialTask):\n tasks = [self.task] + tasks\n return tasks\n" - }, - "expected_output": { - "advanced": false, - "display_name": "Expected Output", - "dynamic": false, - "info": "Clear definition of expected task outcome.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "expected_output", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "A small blog about the topic." - }, - "task": { - "advanced": false, - "display_name": "Task", - "dynamic": false, - "info": "CrewAI Task that will perform the task", - "input_types": [ - "SequentialTask" - ], - "list": false, - "name": "task", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": "" - }, - "task_description": { - "advanced": false, - "display_name": "Description", - "dynamic": false, - "info": "Descriptive text detailing task's purpose and execution.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "task_description", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "" - }, - "tools": { - "advanced": true, - "display_name": "Tools", - "dynamic": false, - "info": "List of tools/resources limited for task execution. Uses the Agent tools by default.", - "input_types": [ - "Tool" - ], - "list": true, - "name": "tools", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": "" - } - } - }, - "type": "SequentialTaskComponent" - }, - "dragging": false, - "height": 551, - "id": "SequentialTaskComponent-PMvGd", - "position": { - "x": 935.4416416450226, - "y": 140.14908065805054 - }, - "positionAbsolute": { - "x": 935.4416416450226, - "y": 140.14908065805054 - }, - "selected": false, - "type": "genericNode", - "width": 384 - }, - { - "data": { - "description": "Represents an agent of CrewAI.", - "display_name": "CrewAI Agent", - "id": "CrewAIAgentComponent-jrjAi", - "node": { - "base_classes": [ - "Agent" - ], - "beta": false, - "conditional_paths": [], - "custom_fields": {}, - "description": "Represents an agent of CrewAI.", - "display_name": "CrewAI Agent", - "documentation": "https://docs.crewai.com/how-to/LLM-Connections/", - "edited": false, - "field_order": [ - "role", - "goal", - "backstory", - "tools", - "llm", - "memory", - "verbose", - "allow_delegation", - "allow_code_execution", - "kwargs" - ], - "frozen": false, - "icon": "CrewAI", - "output_types": [], - "outputs": [ - { - "cache": true, - "display_name": "Agent", - "method": "build_output", - "name": "output", - "selected": "Agent", - "types": [ - "Agent" - ], - "value": "__UNDEFINED__" - } - ], - "pinned": false, - "template": { - "_type": "Component", - "allow_code_execution": { - "advanced": true, - "display_name": "Allow Code Execution", - "dynamic": false, - "info": "Whether the agent is allowed to execute code.", - "list": false, - "name": "allow_code_execution", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": false - }, - "allow_delegation": { - "advanced": false, - "display_name": "Allow Delegation", - "dynamic": false, - "info": "Whether the agent is allowed to delegate tasks to other agents.", - "list": false, - "load_from_db": false, - "name": "allow_delegation", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": false - }, - "backstory": { - "advanced": false, - "display_name": "Backstory", - "dynamic": false, - "info": "The backstory of the agent.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "backstory", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "You are the editor of the most reputable journal in the world." - }, - "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 crewai import Agent # type: ignore\n\nfrom langflow.custom import Component\nfrom langflow.io import BoolInput, DictInput, HandleInput, MultilineInput, Output\n\n\nclass CrewAIAgentComponent(Component):\n display_name = \"CrewAI Agent\"\n description = \"Represents an agent of CrewAI.\"\n documentation: str = \"https://docs.crewai.com/how-to/LLM-Connections/\"\n icon = \"CrewAI\"\n\n inputs = [\n MultilineInput(name=\"role\", display_name=\"Role\", info=\"The role of the agent.\"),\n MultilineInput(name=\"goal\", display_name=\"Goal\", info=\"The objective of the agent.\"),\n MultilineInput(name=\"backstory\", display_name=\"Backstory\", info=\"The backstory of the agent.\"),\n HandleInput(\n name=\"tools\",\n display_name=\"Tools\",\n input_types=[\"Tool\"],\n is_list=True,\n info=\"Tools at agents disposal\",\n value=[],\n ),\n HandleInput(\n name=\"llm\",\n display_name=\"Language Model\",\n info=\"Language model that will run the agent.\",\n input_types=[\"LanguageModel\"],\n ),\n BoolInput(\n name=\"memory\",\n display_name=\"Memory\",\n info=\"Whether the agent should have memory or not\",\n advanced=True,\n value=True,\n ),\n BoolInput(\n name=\"verbose\",\n display_name=\"Verbose\",\n advanced=True,\n value=False,\n ),\n BoolInput(\n name=\"allow_delegation\",\n display_name=\"Allow Delegation\",\n info=\"Whether the agent is allowed to delegate tasks to other agents.\",\n value=True,\n ),\n BoolInput(\n name=\"allow_code_execution\",\n display_name=\"Allow Code Execution\",\n info=\"Whether the agent is allowed to execute code.\",\n value=False,\n advanced=True,\n ),\n DictInput(\n name=\"kwargs\",\n display_name=\"kwargs\",\n info=\"kwargs of agent.\",\n is_list=True,\n advanced=True,\n ),\n ]\n\n outputs = [\n Output(display_name=\"Agent\", name=\"output\", method=\"build_output\"),\n ]\n\n def build_output(self) -> Agent:\n kwargs = self.kwargs if self.kwargs else {}\n agent = Agent(\n role=self.role,\n goal=self.goal,\n backstory=self.backstory,\n llm=self.llm,\n verbose=self.verbose,\n memory=self.memory,\n tools=self.tools if self.tools else [],\n allow_delegation=self.allow_delegation,\n allow_code_execution=self.allow_code_execution,\n **kwargs,\n )\n self.status = repr(agent)\n return agent\n" - }, - "goal": { - "advanced": false, - "display_name": "Goal", - "dynamic": false, - "info": "The objective of the agent.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "goal", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "You should edit the Information provided by the Researcher to make it more palatable and to not contain misleading information." - }, - "kwargs": { - "advanced": true, - "display_name": "kwargs", - "dynamic": false, - "info": "kwargs of agent.", - "list": true, - "name": "kwargs", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "type": "dict", - "value": {} - }, - "llm": { - "advanced": false, - "display_name": "Language Model", - "dynamic": false, - "info": "Language model that will run the agent.", - "input_types": [ - "LanguageModel" - ], - "list": false, - "name": "llm", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": "" - }, - "memory": { - "advanced": true, - "display_name": "Memory", - "dynamic": false, - "info": "Whether the agent should have memory or not", - "list": false, - "name": "memory", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": true - }, - "role": { - "advanced": false, - "display_name": "Role", - "dynamic": false, - "info": "The role of the agent.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "role", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "Editor" - }, - "tools": { - "advanced": false, - "display_name": "Tools", - "dynamic": false, - "info": "Tools at agents disposal", - "input_types": [ - "Tool" - ], - "list": true, - "name": "tools", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": [] - }, - "verbose": { - "advanced": true, - "display_name": "Verbose", - "dynamic": false, - "info": "", - "list": false, - "name": "verbose", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": false - } - } - }, - "type": "CrewAIAgentComponent" - }, - "dragging": false, - "height": 665, - "id": "CrewAIAgentComponent-jrjAi", - "position": { - "x": -566.581107287448, - "y": -551.0185388065037 - }, - "positionAbsolute": { - "x": -566.581107287448, - "y": -551.0185388065037 - }, - "selected": false, - "type": "genericNode", - "width": 384 - }, - { - "data": { - "description": "Represents an agent of CrewAI.", - "display_name": "CrewAI Agent", - "id": "CrewAIAgentComponent-bvJAv", - "node": { - "base_classes": [ - "Agent" - ], - "beta": false, - "conditional_paths": [], - "custom_fields": {}, - "description": "Represents an agent of CrewAI.", - "display_name": "CrewAI Agent", - "documentation": "https://docs.crewai.com/how-to/LLM-Connections/", - "edited": false, - "field_order": [ - "role", - "goal", - "backstory", - "tools", - "llm", - "memory", - "verbose", - "allow_delegation", - "allow_code_execution", - "kwargs" - ], - "frozen": false, - "icon": "CrewAI", - "output_types": [], - "outputs": [ - { - "cache": true, - "display_name": "Agent", - "method": "build_output", - "name": "output", - "selected": "Agent", - "types": [ - "Agent" - ], - "value": "__UNDEFINED__" - } - ], - "pinned": false, - "template": { - "_type": "Component", - "allow_code_execution": { - "advanced": true, - "display_name": "Allow Code Execution", - "dynamic": false, - "info": "Whether the agent is allowed to execute code.", - "list": false, - "name": "allow_code_execution", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": false - }, - "allow_delegation": { - "advanced": false, - "display_name": "Allow Delegation", - "dynamic": false, - "info": "Whether the agent is allowed to delegate tasks to other agents.", - "list": false, - "load_from_db": false, - "name": "allow_delegation", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": false - }, - "backstory": { - "advanced": false, - "display_name": "Backstory", - "dynamic": false, - "info": "The backstory of the agent.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "backstory", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "Your formal occupation is Comedian-in-Chief. You write jokes, do standup comedy and write funny articles." - }, - "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 crewai import Agent # type: ignore\n\nfrom langflow.custom import Component\nfrom langflow.io import BoolInput, DictInput, HandleInput, MultilineInput, Output\n\n\nclass CrewAIAgentComponent(Component):\n display_name = \"CrewAI Agent\"\n description = \"Represents an agent of CrewAI.\"\n documentation: str = \"https://docs.crewai.com/how-to/LLM-Connections/\"\n icon = \"CrewAI\"\n\n inputs = [\n MultilineInput(name=\"role\", display_name=\"Role\", info=\"The role of the agent.\"),\n MultilineInput(name=\"goal\", display_name=\"Goal\", info=\"The objective of the agent.\"),\n MultilineInput(name=\"backstory\", display_name=\"Backstory\", info=\"The backstory of the agent.\"),\n HandleInput(\n name=\"tools\",\n display_name=\"Tools\",\n input_types=[\"Tool\"],\n is_list=True,\n info=\"Tools at agents disposal\",\n value=[],\n ),\n HandleInput(\n name=\"llm\",\n display_name=\"Language Model\",\n info=\"Language model that will run the agent.\",\n input_types=[\"LanguageModel\"],\n ),\n BoolInput(\n name=\"memory\",\n display_name=\"Memory\",\n info=\"Whether the agent should have memory or not\",\n advanced=True,\n value=True,\n ),\n BoolInput(\n name=\"verbose\",\n display_name=\"Verbose\",\n advanced=True,\n value=False,\n ),\n BoolInput(\n name=\"allow_delegation\",\n display_name=\"Allow Delegation\",\n info=\"Whether the agent is allowed to delegate tasks to other agents.\",\n value=True,\n ),\n BoolInput(\n name=\"allow_code_execution\",\n display_name=\"Allow Code Execution\",\n info=\"Whether the agent is allowed to execute code.\",\n value=False,\n advanced=True,\n ),\n DictInput(\n name=\"kwargs\",\n display_name=\"kwargs\",\n info=\"kwargs of agent.\",\n is_list=True,\n advanced=True,\n ),\n ]\n\n outputs = [\n Output(display_name=\"Agent\", name=\"output\", method=\"build_output\"),\n ]\n\n def build_output(self) -> Agent:\n kwargs = self.kwargs if self.kwargs else {}\n agent = Agent(\n role=self.role,\n goal=self.goal,\n backstory=self.backstory,\n llm=self.llm,\n verbose=self.verbose,\n memory=self.memory,\n tools=self.tools if self.tools else [],\n allow_delegation=self.allow_delegation,\n allow_code_execution=self.allow_code_execution,\n **kwargs,\n )\n self.status = repr(agent)\n return agent\n" - }, - "goal": { - "advanced": false, - "display_name": "Goal", - "dynamic": false, - "info": "The objective of the agent.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "goal", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "You write comedic content based on the information provided by the editor." - }, - "kwargs": { - "advanced": true, - "display_name": "kwargs", - "dynamic": false, - "info": "kwargs of agent.", - "list": true, - "name": "kwargs", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "type": "dict", - "value": {} - }, - "llm": { - "advanced": false, - "display_name": "Language Model", - "dynamic": false, - "info": "Language model that will run the agent.", - "input_types": [ - "LanguageModel" - ], - "list": false, - "name": "llm", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": "" - }, - "memory": { - "advanced": true, - "display_name": "Memory", - "dynamic": false, - "info": "Whether the agent should have memory or not", - "list": false, - "name": "memory", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": true - }, - "role": { - "advanced": false, - "display_name": "Role", - "dynamic": false, - "info": "The role of the agent.", - "input_types": [ - "Message" - ], - "list": false, - "load_from_db": false, - "multiline": true, - "name": "role", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_input": true, - "trace_as_metadata": true, - "type": "str", - "value": "Comedian" - }, - "tools": { - "advanced": false, - "display_name": "Tools", - "dynamic": false, - "info": "Tools at agents disposal", - "input_types": [ - "Tool" - ], - "list": true, - "name": "tools", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "other", - "value": [] - }, - "verbose": { - "advanced": true, - "display_name": "Verbose", - "dynamic": false, - "info": "", - "list": false, - "name": "verbose", - "placeholder": "", - "required": false, - "show": true, - "title_case": false, - "trace_as_metadata": true, - "type": "bool", - "value": false - } - } - }, - "type": "CrewAIAgentComponent" - }, - "dragging": false, - "height": 665, - "id": "CrewAIAgentComponent-bvJAv", - "position": { - "x": 384.54483643099843, - "y": -561.9446476261819 - }, - "positionAbsolute": { - "x": 384.54483643099843, - "y": -561.9446476261819 - }, - "selected": false, - "type": "genericNode", - "width": 384 - }, - { - "data": { - "id": "OpenAIModel-ZmR42", + "id": "OpenAIModel-lQ5HF", "node": { "base_classes": [ "LanguageModel", @@ -2020,6 +586,7 @@ ], "frozen": false, "icon": "OpenAI", + "lf_version": "1.0.15", "output_types": [], "outputs": [ { @@ -2065,7 +632,7 @@ "show": true, "title_case": false, "type": "str", - "value": "OPENAI_API_KEY" + "value": "" }, "code": { "advanced": true, @@ -2270,15 +837,15 @@ "type": "OpenAIModel" }, "dragging": false, - "height": 623, - "id": "OpenAIModel-ZmR42", + "height": 601, + "id": "OpenAIModel-lQ5HF", "position": { - "x": -2154.0102660814805, - "y": 154.82377091716774 + "x": -2046.2369515771168, + "y": -396.97559934517443 }, "positionAbsolute": { - "x": -2154.0102660814805, - "y": 154.82377091716774 + "x": -2046.2369515771168, + "y": -396.97559934517443 }, "selected": false, "type": "genericNode", @@ -2288,7 +855,7 @@ "data": { "description": "Display a chat message in the Playground.", "display_name": "Chat Output", - "id": "ChatOutput-NP7N3", + "id": "ChatOutput-nwCjg", "node": { "base_classes": [ "Message" @@ -2310,6 +877,7 @@ ], "frozen": false, "icon": "ChatOutput", + "lf_version": "1.0.15", "output_types": [], "outputs": [ { @@ -2462,8 +1030,9 @@ }, "type": "ChatOutput" }, - "height": 309, - "id": "ChatOutput-NP7N3", + "dragging": false, + "height": 298, + "id": "ChatOutput-nwCjg", "position": { "x": 1938.1856451557874, "y": 227.4117341237682 @@ -2474,7 +1043,7 @@ }, { "data": { - "id": "TextInput-gf86E", + "id": "TextInput-6QUGr", "node": { "base_classes": [ "Message" @@ -2491,6 +1060,7 @@ ], "frozen": false, "icon": "type", + "lf_version": "1.0.15", "output_types": [], "outputs": [ { @@ -2551,15 +1121,15 @@ "type": "TextInput" }, "dragging": false, - "height": 309, - "id": "TextInput-gf86E", + "height": 298, + "id": "TextInput-6QUGr", "position": { - "x": -2151.7161598742287, - "y": 910.3944767665381 + "x": -2044.1039646921665, + "y": 291.77565151149054 }, "positionAbsolute": { - "x": -2151.7161598742287, - "y": 910.3944767665381 + "x": -2044.1039646921665, + "y": 291.77565151149054 }, "selected": false, "type": "genericNode", @@ -2569,7 +1139,7 @@ "data": { "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", - "id": "Prompt-apr7e", + "id": "Prompt-GOdlL", "node": { "base_classes": [ "Message" @@ -2590,6 +1160,7 @@ ], "frozen": false, "icon": "prompts", + "lf_version": "1.0.15", "output_types": [], "outputs": [ { @@ -2670,15 +1241,15 @@ "type": "Prompt" }, "dragging": false, - "height": 423, - "id": "Prompt-apr7e", + "height": 412, + "id": "Prompt-GOdlL", "position": { - "x": -1604.9048763843534, - "y": 834.802255206785 + "x": -1154.4124217561132, + "y": 813.2475923059123 }, "positionAbsolute": { - "x": -1604.9048763843534, - "y": 834.802255206785 + "x": -1154.4124217561132, + "y": 813.2475923059123 }, "selected": false, "type": "genericNode", @@ -2688,7 +1259,7 @@ "data": { "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", - "id": "Prompt-6dDdF", + "id": "Prompt-824D7", "node": { "base_classes": [ "Message" @@ -2709,6 +1280,7 @@ ], "frozen": false, "icon": "prompts", + "lf_version": "1.0.15", "output_types": [], "outputs": [ { @@ -2789,15 +1361,15 @@ "type": "Prompt" }, "dragging": false, - "height": 423, - "id": "Prompt-6dDdF", + "height": 412, + "id": "Prompt-824D7", "position": { - "x": -578.6435948714756, - "y": 880.8183199139718 + "x": -369.56336473301, + "y": 790.2887357303061 }, "positionAbsolute": { - "x": -578.6435948714756, - "y": 880.8183199139718 + "x": -369.56336473301, + "y": 790.2887357303061 }, "selected": false, "type": "genericNode", @@ -2807,7 +1379,7 @@ "data": { "description": "Create a prompt template with dynamic variables.", "display_name": "Prompt", - "id": "Prompt-ByPrr", + "id": "Prompt-0vHob", "node": { "base_classes": [ "Message" @@ -2828,6 +1400,7 @@ ], "frozen": false, "icon": "prompts", + "lf_version": "1.0.15", "output_types": [], "outputs": [ { @@ -2908,15 +1481,15 @@ "type": "Prompt" }, "dragging": false, - "height": 423, - "id": "Prompt-ByPrr", + "height": 412, + "id": "Prompt-0vHob", "position": { - "x": 336.06150756666204, - "y": 796.1616400043475 + "x": 383.48176594858205, + "y": 804.7835051646966 }, "positionAbsolute": { - "x": 336.06150756666204, - "y": 796.1616400043475 + "x": 383.48176594858205, + "y": 804.7835051646966 }, "selected": false, "type": "genericNode", @@ -2924,47 +1497,47 @@ }, { "data": { - "id": "SearchAPI-yyOHb", + "id": "SequentialTaskAgentComponent-GWMA1", "node": { "base_classes": [ - "Data", - "Tool" + "SequentialTask" ], "beta": false, "conditional_paths": [], "custom_fields": {}, - "description": "Call the searchapi.io API", - "display_name": "Search API", - "documentation": "https://www.searchapi.io/docs/google", + "description": "Creates a CrewAI Task and its associated Agent.", + "display_name": "Sequential Task Agent", + "documentation": "https://docs.crewai.com/how-to/LLM-Connections/", "edited": false, "field_order": [ - "engine", - "api_key", - "input_value", - "search_params" + "role", + "goal", + "backstory", + "tools", + "llm", + "memory", + "verbose", + "allow_delegation", + "allow_code_execution", + "agent_kwargs", + "task_description", + "expected_output", + "async_execution", + "previous_task" ], "frozen": false, + "icon": "CrewAI", + "lf_version": "1.0.15", "output_types": [], "outputs": [ { "cache": true, - "display_name": "Data", - "method": "run_model", - "name": "api_run_model", - "selected": "Data", + "display_name": "Sequential Task", + "method": "build_agent_and_task", + "name": "task_output", + "selected": "SequentialTask", "types": [ - "Data" - ], - "value": "__UNDEFINED__" - }, - { - "cache": true, - "display_name": "Tool", - "method": "build_tool", - "name": "api_build_tool", - "selected": "Tool", - "types": [ - "Tool" + "SequentialTask" ], "value": "__UNDEFINED__" } @@ -2972,23 +1545,91 @@ "pinned": false, "template": { "_type": "Component", - "api_key": { - "advanced": false, - "display_name": "SearchAPI API Key", + "agent_kwargs": { + "_input_type": "DictInput", + "advanced": true, + "display_name": "Agent kwargs", "dynamic": false, - "info": "", + "info": "Additional kwargs for the agent.", + "list": true, + "name": "agent_kwargs", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "type": "dict", + "value": {} + }, + "allow_code_execution": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Allow Code Execution", + "dynamic": false, + "info": "Whether the agent is allowed to execute code.", + "list": false, + "name": "allow_code_execution", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": false + }, + "allow_delegation": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Allow Delegation", + "dynamic": false, + "info": "Whether the agent is allowed to delegate tasks to other agents.", + "list": false, + "name": "allow_delegation", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": false + }, + "async_execution": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Async Execution", + "dynamic": false, + "info": "Boolean flag indicating asynchronous task execution.", + "list": false, + "name": "async_execution", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": false + }, + "backstory": { + "_input_type": "MultilineInput", + "advanced": false, + "display_name": "Backstory", + "dynamic": false, + "info": "The backstory of the agent.", "input_types": [ "Message" ], - "load_from_db": true, - "name": "api_key", - "password": true, + "list": false, + "load_from_db": false, + "multiline": true, + "name": "backstory", "placeholder": "", - "required": true, + "required": false, "show": true, "title_case": false, + "trace_as_input": true, + "trace_as_metadata": true, "type": "str", - "value": "" + "value": "Research has always been your thing. You can quickly find things on the web because of your skills." }, "code": { "advanced": true, @@ -3006,19 +1647,21 @@ "show": true, "title_case": false, "type": "code", - "value": "from typing import Union\n\nfrom langchain_community.utilities.searchapi import SearchApiAPIWrapper\n\nfrom langflow.base.langchain_utilities.model import LCToolComponent\nfrom langflow.inputs import SecretStrInput, MultilineInput, DictInput, MessageTextInput\nfrom langflow.schema import Data\nfrom langflow.field_typing import Tool\n\n\nclass SearchAPIComponent(LCToolComponent):\n display_name: str = \"Search API\"\n description: str = \"Call the searchapi.io API\"\n name = \"SearchAPI\"\n documentation: str = \"https://www.searchapi.io/docs/google\"\n\n inputs = [\n MessageTextInput(name=\"engine\", display_name=\"Engine\", value=\"google\"),\n SecretStrInput(name=\"api_key\", display_name=\"SearchAPI API Key\", required=True),\n MultilineInput(\n name=\"input_value\",\n display_name=\"Input\",\n ),\n DictInput(name=\"search_params\", display_name=\"Search parameters\", advanced=True, is_list=True),\n ]\n\n def run_model(self) -> Union[Data, list[Data]]:\n wrapper = self._build_wrapper()\n results = wrapper.results(query=self.input_value, **(self.search_params or {}))\n list_results = results.get(\"organic_results\", [])\n data = [Data(data=result, text=result[\"snippet\"]) for result in list_results]\n self.status = data\n return data\n\n def build_tool(self) -> Tool:\n wrapper = self._build_wrapper()\n return Tool(\n name=\"search_api\",\n description=\"Search for recent results.\",\n func=lambda x: wrapper.run(query=x, **(self.search_params or {})),\n )\n\n def _build_wrapper(self):\n return SearchApiAPIWrapper(engine=self.engine, searchapi_api_key=self.api_key)\n" + "value": "from crewai import Agent, Task\n\nfrom langflow.base.agents.crewai.tasks import SequentialTask\nfrom langflow.custom import Component\nfrom langflow.io import BoolInput, DictInput, HandleInput, MultilineInput, Output\n\n\nclass SequentialTaskAgentComponent(Component):\n display_name = \"Sequential Task Agent\"\n description = \"Creates a CrewAI Task and its associated Agent.\"\n documentation = \"https://docs.crewai.com/how-to/LLM-Connections/\"\n icon = \"CrewAI\"\n\n inputs = [\n # Agent inputs\n MultilineInput(name=\"role\", display_name=\"Role\", info=\"The role of the agent.\"),\n MultilineInput(name=\"goal\", display_name=\"Goal\", info=\"The objective of the agent.\"),\n MultilineInput(\n name=\"backstory\",\n display_name=\"Backstory\",\n info=\"The backstory of the agent.\",\n ),\n HandleInput(\n name=\"tools\",\n display_name=\"Tools\",\n input_types=[\"Tool\"],\n is_list=True,\n info=\"Tools at agent's disposal\",\n value=[],\n ),\n HandleInput(\n name=\"llm\",\n display_name=\"Language Model\",\n info=\"Language model that will run the agent.\",\n input_types=[\"LanguageModel\"],\n ),\n BoolInput(\n name=\"memory\",\n display_name=\"Memory\",\n info=\"Whether the agent should have memory or not\",\n advanced=True,\n value=True,\n ),\n BoolInput(\n name=\"verbose\",\n display_name=\"Verbose\",\n advanced=True,\n value=True,\n ),\n BoolInput(\n name=\"allow_delegation\",\n display_name=\"Allow Delegation\",\n info=\"Whether the agent is allowed to delegate tasks to other agents.\",\n value=False,\n advanced=True,\n ),\n BoolInput(\n name=\"allow_code_execution\",\n display_name=\"Allow Code Execution\",\n info=\"Whether the agent is allowed to execute code.\",\n value=False,\n advanced=True,\n ),\n DictInput(\n name=\"agent_kwargs\",\n display_name=\"Agent kwargs\",\n info=\"Additional kwargs for the agent.\",\n is_list=True,\n advanced=True,\n ),\n # Task inputs\n MultilineInput(\n name=\"task_description\",\n display_name=\"Task Description\",\n info=\"Descriptive text detailing task's purpose and execution.\",\n ),\n MultilineInput(\n name=\"expected_output\",\n display_name=\"Expected Task Output\",\n info=\"Clear definition of expected task outcome.\",\n ),\n BoolInput(\n name=\"async_execution\",\n display_name=\"Async Execution\",\n value=False,\n advanced=True,\n info=\"Boolean flag indicating asynchronous task execution.\",\n ),\n # Chaining input\n HandleInput(\n name=\"previous_task\",\n display_name=\"Previous Task\",\n input_types=[\"SequentialTask\"],\n info=\"The previous task in the sequence (for chaining).\",\n required=False,\n ),\n ]\n\n outputs = [\n Output(\n display_name=\"Sequential Task\",\n name=\"task_output\",\n method=\"build_agent_and_task\",\n ),\n ]\n\n def build_agent_and_task(self) -> list[SequentialTask]:\n # Build the agent\n agent_kwargs = self.agent_kwargs or {}\n agent = Agent(\n role=self.role,\n goal=self.goal,\n backstory=self.backstory,\n llm=self.llm,\n verbose=self.verbose,\n memory=self.memory,\n tools=self.tools if self.tools else [],\n allow_delegation=self.allow_delegation,\n allow_code_execution=self.allow_code_execution,\n **agent_kwargs,\n )\n\n # Build the task\n task = Task(\n description=self.task_description,\n expected_output=self.expected_output,\n agent=agent,\n async_execution=self.async_execution,\n )\n\n # If there's a previous task, create a list of tasks\n if self.previous_task:\n if isinstance(self.previous_task, list):\n tasks = self.previous_task + [task]\n else:\n tasks = [self.previous_task, task]\n else:\n tasks = [task]\n\n self.status = f\"Agent: {repr(agent)}\\nTask: {repr(task)}\"\n return tasks\n" }, - "engine": { + "expected_output": { + "_input_type": "MultilineInput", "advanced": false, - "display_name": "Engine", + "display_name": "Expected Task Output", "dynamic": false, - "info": "", + "info": "Clear definition of expected task outcome.", "input_types": [ "Message" ], "list": false, "load_from_db": false, - "name": "engine", + "multiline": true, + "name": "expected_output", "placeholder": "", "required": false, "show": true, @@ -3026,20 +1669,119 @@ "trace_as_input": true, "trace_as_metadata": true, "type": "str", - "value": "google" + "value": "Bullet points and small phrases about the research topic." }, - "input_value": { + "goal": { + "_input_type": "MultilineInput", "advanced": false, - "display_name": "Input", + "display_name": "Goal", "dynamic": false, - "info": "", + "info": "The objective of the agent.", "input_types": [ "Message" ], "list": false, "load_from_db": false, "multiline": true, - "name": "input_value", + "name": "goal", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "Search Google to find information to complete the task." + }, + "llm": { + "_input_type": "HandleInput", + "advanced": false, + "display_name": "Language Model", + "dynamic": false, + "info": "Language model that will run the agent.", + "input_types": [ + "LanguageModel" + ], + "list": false, + "name": "llm", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "other", + "value": "" + }, + "memory": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Memory", + "dynamic": false, + "info": "Whether the agent should have memory or not", + "list": false, + "name": "memory", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": true + }, + "previous_task": { + "_input_type": "HandleInput", + "advanced": false, + "display_name": "Previous Task", + "dynamic": false, + "info": "The previous task in the sequence (for chaining).", + "input_types": [ + "SequentialTask" + ], + "list": false, + "name": "previous_task", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "other", + "value": "" + }, + "role": { + "_input_type": "MultilineInput", + "advanced": false, + "display_name": "Role", + "dynamic": false, + "info": "The role of the agent.", + "input_types": [ + "Message" + ], + "list": false, + "load_from_db": false, + "multiline": true, + "name": "role", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "Researcher" + }, + "task_description": { + "_input_type": "MultilineInput", + "advanced": false, + "display_name": "Task Description", + "dynamic": false, + "info": "Descriptive text detailing task's purpose and execution.", + "input_types": [ + "Message" + ], + "list": false, + "load_from_db": false, + "multiline": true, + "name": "task_description", "placeholder": "", "required": false, "show": true, @@ -3049,13 +1791,118 @@ "type": "str", "value": "" }, - "search_params": { + "tools": { + "_input_type": "HandleInput", + "advanced": false, + "display_name": "Tools", + "dynamic": false, + "info": "Tools at agent's disposal", + "input_types": [ + "Tool" + ], + "list": true, + "name": "tools", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "other", + "value": [] + }, + "verbose": { + "_input_type": "BoolInput", "advanced": true, - "display_name": "Search parameters", + "display_name": "Verbose", "dynamic": false, "info": "", + "list": false, + "name": "verbose", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": true + } + } + }, + "type": "SequentialTaskAgentComponent" + }, + "dragging": false, + "height": 810, + "id": "SequentialTaskAgentComponent-GWMA1", + "position": { + "x": -742.6676461208307, + "y": -336.7987303380612 + }, + "positionAbsolute": { + "x": -742.6676461208307, + "y": -336.7987303380612 + }, + "selected": false, + "type": "genericNode", + "width": 384 + }, + { + "data": { + "id": "SequentialTaskAgentComponent-5i4Wg", + "node": { + "base_classes": [ + "SequentialTask" + ], + "beta": false, + "conditional_paths": [], + "custom_fields": {}, + "description": "Creates a CrewAI Task and its associated Agent.", + "display_name": "Sequential Task Agent", + "documentation": "https://docs.crewai.com/how-to/LLM-Connections/", + "edited": false, + "field_order": [ + "role", + "goal", + "backstory", + "tools", + "llm", + "memory", + "verbose", + "allow_delegation", + "allow_code_execution", + "agent_kwargs", + "task_description", + "expected_output", + "async_execution", + "previous_task" + ], + "frozen": false, + "icon": "CrewAI", + "lf_version": "1.0.15", + "output_types": [], + "outputs": [ + { + "cache": true, + "display_name": "Sequential Task", + "method": "build_agent_and_task", + "name": "task_output", + "selected": "SequentialTask", + "types": [ + "SequentialTask" + ], + "value": "__UNDEFINED__" + } + ], + "pinned": false, + "template": { + "_type": "Component", + "agent_kwargs": { + "_input_type": "DictInput", + "advanced": true, + "display_name": "Agent kwargs", + "dynamic": false, + "info": "Additional kwargs for the agent.", "list": true, - "name": "search_params", + "name": "agent_kwargs", "placeholder": "", "required": false, "show": true, @@ -3063,21 +1910,707 @@ "trace_as_input": true, "type": "dict", "value": {} + }, + "allow_code_execution": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Allow Code Execution", + "dynamic": false, + "info": "Whether the agent is allowed to execute code.", + "list": false, + "name": "allow_code_execution", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": false + }, + "allow_delegation": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Allow Delegation", + "dynamic": false, + "info": "Whether the agent is allowed to delegate tasks to other agents.", + "list": false, + "name": "allow_delegation", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": false + }, + "async_execution": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Async Execution", + "dynamic": false, + "info": "Boolean flag indicating asynchronous task execution.", + "list": false, + "name": "async_execution", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": false + }, + "backstory": { + "_input_type": "MultilineInput", + "advanced": false, + "display_name": "Backstory", + "dynamic": false, + "info": "The backstory of the agent.", + "input_types": [ + "Message" + ], + "list": false, + "load_from_db": false, + "multiline": true, + "name": "backstory", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "You are the editor of the most reputable journal in the world." + }, + "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 crewai import Agent, Task\n\nfrom langflow.base.agents.crewai.tasks import SequentialTask\nfrom langflow.custom import Component\nfrom langflow.io import BoolInput, DictInput, HandleInput, MultilineInput, Output\n\n\nclass SequentialTaskAgentComponent(Component):\n display_name = \"Sequential Task Agent\"\n description = \"Creates a CrewAI Task and its associated Agent.\"\n documentation = \"https://docs.crewai.com/how-to/LLM-Connections/\"\n icon = \"CrewAI\"\n\n inputs = [\n # Agent inputs\n MultilineInput(name=\"role\", display_name=\"Role\", info=\"The role of the agent.\"),\n MultilineInput(name=\"goal\", display_name=\"Goal\", info=\"The objective of the agent.\"),\n MultilineInput(\n name=\"backstory\",\n display_name=\"Backstory\",\n info=\"The backstory of the agent.\",\n ),\n HandleInput(\n name=\"tools\",\n display_name=\"Tools\",\n input_types=[\"Tool\"],\n is_list=True,\n info=\"Tools at agent's disposal\",\n value=[],\n ),\n HandleInput(\n name=\"llm\",\n display_name=\"Language Model\",\n info=\"Language model that will run the agent.\",\n input_types=[\"LanguageModel\"],\n ),\n BoolInput(\n name=\"memory\",\n display_name=\"Memory\",\n info=\"Whether the agent should have memory or not\",\n advanced=True,\n value=True,\n ),\n BoolInput(\n name=\"verbose\",\n display_name=\"Verbose\",\n advanced=True,\n value=True,\n ),\n BoolInput(\n name=\"allow_delegation\",\n display_name=\"Allow Delegation\",\n info=\"Whether the agent is allowed to delegate tasks to other agents.\",\n value=False,\n advanced=True,\n ),\n BoolInput(\n name=\"allow_code_execution\",\n display_name=\"Allow Code Execution\",\n info=\"Whether the agent is allowed to execute code.\",\n value=False,\n advanced=True,\n ),\n DictInput(\n name=\"agent_kwargs\",\n display_name=\"Agent kwargs\",\n info=\"Additional kwargs for the agent.\",\n is_list=True,\n advanced=True,\n ),\n # Task inputs\n MultilineInput(\n name=\"task_description\",\n display_name=\"Task Description\",\n info=\"Descriptive text detailing task's purpose and execution.\",\n ),\n MultilineInput(\n name=\"expected_output\",\n display_name=\"Expected Task Output\",\n info=\"Clear definition of expected task outcome.\",\n ),\n BoolInput(\n name=\"async_execution\",\n display_name=\"Async Execution\",\n value=False,\n advanced=True,\n info=\"Boolean flag indicating asynchronous task execution.\",\n ),\n # Chaining input\n HandleInput(\n name=\"previous_task\",\n display_name=\"Previous Task\",\n input_types=[\"SequentialTask\"],\n info=\"The previous task in the sequence (for chaining).\",\n required=False,\n ),\n ]\n\n outputs = [\n Output(\n display_name=\"Sequential Task\",\n name=\"task_output\",\n method=\"build_agent_and_task\",\n ),\n ]\n\n def build_agent_and_task(self) -> list[SequentialTask]:\n # Build the agent\n agent_kwargs = self.agent_kwargs or {}\n agent = Agent(\n role=self.role,\n goal=self.goal,\n backstory=self.backstory,\n llm=self.llm,\n verbose=self.verbose,\n memory=self.memory,\n tools=self.tools if self.tools else [],\n allow_delegation=self.allow_delegation,\n allow_code_execution=self.allow_code_execution,\n **agent_kwargs,\n )\n\n # Build the task\n task = Task(\n description=self.task_description,\n expected_output=self.expected_output,\n agent=agent,\n async_execution=self.async_execution,\n )\n\n # If there's a previous task, create a list of tasks\n if self.previous_task:\n if isinstance(self.previous_task, list):\n tasks = self.previous_task + [task]\n else:\n tasks = [self.previous_task, task]\n else:\n tasks = [task]\n\n self.status = f\"Agent: {repr(agent)}\\nTask: {repr(task)}\"\n return tasks\n" + }, + "expected_output": { + "_input_type": "MultilineInput", + "advanced": false, + "display_name": "Expected Task Output", + "dynamic": false, + "info": "Clear definition of expected task outcome.", + "input_types": [ + "Message" + ], + "list": false, + "load_from_db": false, + "multiline": true, + "name": "expected_output", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "Small paragraphs and bullet points with the corrected content." + }, + "goal": { + "_input_type": "MultilineInput", + "advanced": false, + "display_name": "Goal", + "dynamic": false, + "info": "The objective of the agent.", + "input_types": [ + "Message" + ], + "list": false, + "load_from_db": false, + "multiline": true, + "name": "goal", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "You should edit the Information provided by the Researcher to make it more palatable and to not contain misleading information." + }, + "llm": { + "_input_type": "HandleInput", + "advanced": false, + "display_name": "Language Model", + "dynamic": false, + "info": "Language model that will run the agent.", + "input_types": [ + "LanguageModel" + ], + "list": false, + "name": "llm", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "other", + "value": "" + }, + "memory": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Memory", + "dynamic": false, + "info": "Whether the agent should have memory or not", + "list": false, + "name": "memory", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": true + }, + "previous_task": { + "_input_type": "HandleInput", + "advanced": false, + "display_name": "Previous Task", + "dynamic": false, + "info": "The previous task in the sequence (for chaining).", + "input_types": [ + "SequentialTask" + ], + "list": false, + "name": "previous_task", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "other", + "value": "" + }, + "role": { + "_input_type": "MultilineInput", + "advanced": false, + "display_name": "Role", + "dynamic": false, + "info": "The role of the agent.", + "input_types": [ + "Message" + ], + "list": false, + "load_from_db": false, + "multiline": true, + "name": "role", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "Editor" + }, + "task_description": { + "_input_type": "MultilineInput", + "advanced": false, + "display_name": "Task Description", + "dynamic": false, + "info": "Descriptive text detailing task's purpose and execution.", + "input_types": [ + "Message" + ], + "list": false, + "load_from_db": false, + "multiline": true, + "name": "task_description", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "" + }, + "tools": { + "_input_type": "HandleInput", + "advanced": false, + "display_name": "Tools", + "dynamic": false, + "info": "Tools at agent's disposal", + "input_types": [ + "Tool" + ], + "list": true, + "name": "tools", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "other", + "value": [] + }, + "verbose": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Verbose", + "dynamic": false, + "info": "", + "list": false, + "name": "verbose", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": true } } }, - "type": "SearchAPI" + "type": "SequentialTaskAgentComponent" }, "dragging": false, - "height": 545, - "id": "SearchAPI-yyOHb", + "height": 810, + "id": "SequentialTaskAgentComponent-5i4Wg", "position": { - "x": -2192.078202097823, - "y": -582.8319710595279 + "x": 62.10105154443647, + "y": -336.82282969954827 }, "positionAbsolute": { - "x": -2192.078202097823, - "y": -582.8319710595279 + "x": 62.10105154443647, + "y": -336.82282969954827 + }, + "selected": false, + "type": "genericNode", + "width": 384 + }, + { + "data": { + "id": "SequentialTaskAgentComponent-TPEWE", + "node": { + "base_classes": [ + "SequentialTask" + ], + "beta": false, + "conditional_paths": [], + "custom_fields": {}, + "description": "Creates a CrewAI Task and its associated Agent.", + "display_name": "Sequential Task Agent", + "documentation": "https://docs.crewai.com/how-to/LLM-Connections/", + "edited": false, + "field_order": [ + "role", + "goal", + "backstory", + "tools", + "llm", + "memory", + "verbose", + "allow_delegation", + "allow_code_execution", + "agent_kwargs", + "task_description", + "expected_output", + "async_execution", + "previous_task" + ], + "frozen": false, + "icon": "CrewAI", + "lf_version": "1.0.15", + "output_types": [], + "outputs": [ + { + "cache": true, + "display_name": "Sequential Task", + "method": "build_agent_and_task", + "name": "task_output", + "selected": "SequentialTask", + "types": [ + "SequentialTask" + ], + "value": "__UNDEFINED__" + } + ], + "pinned": false, + "template": { + "_type": "Component", + "agent_kwargs": { + "_input_type": "DictInput", + "advanced": true, + "display_name": "Agent kwargs", + "dynamic": false, + "info": "Additional kwargs for the agent.", + "list": true, + "name": "agent_kwargs", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "type": "dict", + "value": {} + }, + "allow_code_execution": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Allow Code Execution", + "dynamic": false, + "info": "Whether the agent is allowed to execute code.", + "list": false, + "name": "allow_code_execution", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": false + }, + "allow_delegation": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Allow Delegation", + "dynamic": false, + "info": "Whether the agent is allowed to delegate tasks to other agents.", + "list": false, + "name": "allow_delegation", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": false + }, + "async_execution": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Async Execution", + "dynamic": false, + "info": "Boolean flag indicating asynchronous task execution.", + "list": false, + "name": "async_execution", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": false + }, + "backstory": { + "_input_type": "MultilineInput", + "advanced": false, + "display_name": "Backstory", + "dynamic": false, + "info": "The backstory of the agent.", + "input_types": [ + "Message" + ], + "list": false, + "load_from_db": false, + "multiline": true, + "name": "backstory", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "Your formal occupation is Comedian-in-Chief. You write jokes, do standup comedy and write funny articles." + }, + "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 crewai import Agent, Task\n\nfrom langflow.base.agents.crewai.tasks import SequentialTask\nfrom langflow.custom import Component\nfrom langflow.io import BoolInput, DictInput, HandleInput, MultilineInput, Output\n\n\nclass SequentialTaskAgentComponent(Component):\n display_name = \"Sequential Task Agent\"\n description = \"Creates a CrewAI Task and its associated Agent.\"\n documentation = \"https://docs.crewai.com/how-to/LLM-Connections/\"\n icon = \"CrewAI\"\n\n inputs = [\n # Agent inputs\n MultilineInput(name=\"role\", display_name=\"Role\", info=\"The role of the agent.\"),\n MultilineInput(name=\"goal\", display_name=\"Goal\", info=\"The objective of the agent.\"),\n MultilineInput(\n name=\"backstory\",\n display_name=\"Backstory\",\n info=\"The backstory of the agent.\",\n ),\n HandleInput(\n name=\"tools\",\n display_name=\"Tools\",\n input_types=[\"Tool\"],\n is_list=True,\n info=\"Tools at agent's disposal\",\n value=[],\n ),\n HandleInput(\n name=\"llm\",\n display_name=\"Language Model\",\n info=\"Language model that will run the agent.\",\n input_types=[\"LanguageModel\"],\n ),\n BoolInput(\n name=\"memory\",\n display_name=\"Memory\",\n info=\"Whether the agent should have memory or not\",\n advanced=True,\n value=True,\n ),\n BoolInput(\n name=\"verbose\",\n display_name=\"Verbose\",\n advanced=True,\n value=True,\n ),\n BoolInput(\n name=\"allow_delegation\",\n display_name=\"Allow Delegation\",\n info=\"Whether the agent is allowed to delegate tasks to other agents.\",\n value=False,\n advanced=True,\n ),\n BoolInput(\n name=\"allow_code_execution\",\n display_name=\"Allow Code Execution\",\n info=\"Whether the agent is allowed to execute code.\",\n value=False,\n advanced=True,\n ),\n DictInput(\n name=\"agent_kwargs\",\n display_name=\"Agent kwargs\",\n info=\"Additional kwargs for the agent.\",\n is_list=True,\n advanced=True,\n ),\n # Task inputs\n MultilineInput(\n name=\"task_description\",\n display_name=\"Task Description\",\n info=\"Descriptive text detailing task's purpose and execution.\",\n ),\n MultilineInput(\n name=\"expected_output\",\n display_name=\"Expected Task Output\",\n info=\"Clear definition of expected task outcome.\",\n ),\n BoolInput(\n name=\"async_execution\",\n display_name=\"Async Execution\",\n value=False,\n advanced=True,\n info=\"Boolean flag indicating asynchronous task execution.\",\n ),\n # Chaining input\n HandleInput(\n name=\"previous_task\",\n display_name=\"Previous Task\",\n input_types=[\"SequentialTask\"],\n info=\"The previous task in the sequence (for chaining).\",\n required=False,\n ),\n ]\n\n outputs = [\n Output(\n display_name=\"Sequential Task\",\n name=\"task_output\",\n method=\"build_agent_and_task\",\n ),\n ]\n\n def build_agent_and_task(self) -> list[SequentialTask]:\n # Build the agent\n agent_kwargs = self.agent_kwargs or {}\n agent = Agent(\n role=self.role,\n goal=self.goal,\n backstory=self.backstory,\n llm=self.llm,\n verbose=self.verbose,\n memory=self.memory,\n tools=self.tools if self.tools else [],\n allow_delegation=self.allow_delegation,\n allow_code_execution=self.allow_code_execution,\n **agent_kwargs,\n )\n\n # Build the task\n task = Task(\n description=self.task_description,\n expected_output=self.expected_output,\n agent=agent,\n async_execution=self.async_execution,\n )\n\n # If there's a previous task, create a list of tasks\n if self.previous_task:\n if isinstance(self.previous_task, list):\n tasks = self.previous_task + [task]\n else:\n tasks = [self.previous_task, task]\n else:\n tasks = [task]\n\n self.status = f\"Agent: {repr(agent)}\\nTask: {repr(task)}\"\n return tasks\n" + }, + "expected_output": { + "_input_type": "MultilineInput", + "advanced": false, + "display_name": "Expected Task Output", + "dynamic": false, + "info": "Clear definition of expected task outcome.", + "input_types": [ + "Message" + ], + "list": false, + "load_from_db": false, + "multiline": true, + "name": "expected_output", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "A small blog about the topic." + }, + "goal": { + "_input_type": "MultilineInput", + "advanced": false, + "display_name": "Goal", + "dynamic": false, + "info": "The objective of the agent.", + "input_types": [ + "Message" + ], + "list": false, + "load_from_db": false, + "multiline": true, + "name": "goal", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "You write comedic content based on the information provided by the editor." + }, + "llm": { + "_input_type": "HandleInput", + "advanced": false, + "display_name": "Language Model", + "dynamic": false, + "info": "Language model that will run the agent.", + "input_types": [ + "LanguageModel" + ], + "list": false, + "name": "llm", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "other", + "value": "" + }, + "memory": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Memory", + "dynamic": false, + "info": "Whether the agent should have memory or not", + "list": false, + "name": "memory", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": true + }, + "previous_task": { + "_input_type": "HandleInput", + "advanced": false, + "display_name": "Previous Task", + "dynamic": false, + "info": "The previous task in the sequence (for chaining).", + "input_types": [ + "SequentialTask" + ], + "list": false, + "name": "previous_task", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "other", + "value": "" + }, + "role": { + "_input_type": "MultilineInput", + "advanced": false, + "display_name": "Role", + "dynamic": false, + "info": "The role of the agent.", + "input_types": [ + "Message" + ], + "list": false, + "load_from_db": false, + "multiline": true, + "name": "role", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "Comedian" + }, + "task_description": { + "_input_type": "MultilineInput", + "advanced": false, + "display_name": "Task Description", + "dynamic": false, + "info": "Descriptive text detailing task's purpose and execution.", + "input_types": [ + "Message" + ], + "list": false, + "load_from_db": false, + "multiline": true, + "name": "task_description", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_input": true, + "trace_as_metadata": true, + "type": "str", + "value": "" + }, + "tools": { + "_input_type": "HandleInput", + "advanced": false, + "display_name": "Tools", + "dynamic": false, + "info": "Tools at agent's disposal", + "input_types": [ + "Tool" + ], + "list": true, + "name": "tools", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "other", + "value": [] + }, + "verbose": { + "_input_type": "BoolInput", + "advanced": true, + "display_name": "Verbose", + "dynamic": false, + "info": "", + "list": false, + "name": "verbose", + "placeholder": "", + "required": false, + "show": true, + "title_case": false, + "trace_as_metadata": true, + "type": "bool", + "value": true + } + } + }, + "type": "SequentialTaskAgentComponent" + }, + "dragging": false, + "height": 810, + "id": "SequentialTaskAgentComponent-TPEWE", + "position": { + "x": 800.6536575540351, + "y": -345.48877618011403 + }, + "positionAbsolute": { + "x": 800.6536575540351, + "y": -345.48877618011403 + }, + "selected": false, + "type": "genericNode", + "width": 384 + }, + { + "data": { + "id": "YFinanceTool-Asoka", + "node": { + "base_classes": [ + "Tool" + ], + "beta": false, + "conditional_paths": [], + "custom_fields": {}, + "description": "Tool for interacting with Yahoo Finance News.", + "display_name": "Yahoo Finance News Tool", + "documentation": "", + "edited": false, + "field_order": [], + "frozen": false, + "lf_version": "1.0.15", + "output_types": [], + "outputs": [ + { + "cache": true, + "display_name": "Tool", + "method": "build_tool", + "name": "tool", + "selected": "Tool", + "types": [ + "Tool" + ], + "value": "__UNDEFINED__" + } + ], + "pinned": false, + "template": { + "_type": "Component", + "code": { + "advanced": true, + "dynamic": true, + "fileTypes": [], + "file_path": "", + "info": "", + "list": false, + "load_from_db": false, + "multiline": true, + "name": "code", + "password": false, + "placeholder": "", + "required": true, + "show": true, + "title_case": false, + "type": "code", + "value": "from typing import cast\n\nfrom langchain_community.tools.yahoo_finance_news import YahooFinanceNewsTool\n\nfrom langflow.custom import Component\nfrom langflow.field_typing import Tool\nfrom langflow.io import Output\n\n\nclass YfinanceToolComponent(Component):\n display_name = \"Yahoo Finance News Tool\"\n description = \"Tool for interacting with Yahoo Finance News.\"\n name = \"YFinanceTool\"\n\n outputs = [\n Output(display_name=\"Tool\", name=\"tool\", method=\"build_tool\"),\n ]\n\n def build_tool(self) -> Tool:\n return cast(Tool, YahooFinanceNewsTool())\n" + } + } + }, + "type": "YFinanceTool" + }, + "dragging": false, + "height": 216, + "id": "YFinanceTool-Asoka", + "position": { + "x": -1395.322640611045, + "y": -397.3732940326163 + }, + "positionAbsolute": { + "x": -1395.322640611045, + "y": -397.3732940326163 }, "selected": false, "type": "genericNode", @@ -3085,15 +2618,15 @@ } ], "viewport": { - "x": 745.0493235780729, - "y": 264.30201167310815, - "zoom": 0.21080777756253458 + "x": 573.0114453101413, + "y": 469.2263376930288, + "zoom": 0.29771421234125156 } }, "description": "This Agent runs tasks in a predefined sequence.", "endpoint_name": null, - "id": "21592072-529d-424c-ae48-e7daaaf5b72c", + "id": "c2e3229c-813e-43eb-9041-cdfcfab90e08", "is_component": false, - "last_tested_version": "1.0.9", + "last_tested_version": "1.0.15", "name": "Sequential Tasks Agent" } \ No newline at end of file diff --git a/src/backend/base/langflow/initial_setup/starter_projects/sequential_tasks_agent.py b/src/backend/base/langflow/initial_setup/starter_projects/sequential_tasks_agent.py index 6e340259d..7af7c4ec6 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/sequential_tasks_agent.py +++ b/src/backend/base/langflow/initial_setup/starter_projects/sequential_tasks_agent.py @@ -1,6 +1,5 @@ -from langflow.components.agents.CrewAIAgent import CrewAIAgentComponent from langflow.components.agents.SequentialCrew import SequentialCrewComponent -from langflow.components.helpers.SequentialTask import SequentialTaskComponent +from langflow.components.agents.SequentialTaskAgent import SequentialTaskAgentComponent from langflow.components.inputs.TextInput import TextInputComponent from langflow.components.models.OpenAIModel import OpenAIModelComponent from langflow.components.outputs.ChatOutput import ChatOutput @@ -12,31 +11,32 @@ from langflow.graph.graph.base import Graph def sequential_tasks_agent_graph(): llm = OpenAIModelComponent() search_api_tool = SearchAPIComponent() - researcher_agent = CrewAIAgentComponent() + text_input = TextInputComponent(_display_name="Topic") text_input.set(input_value="Agile") - researcher_agent.set( - tools=[search_api_tool.build_tool], - llm=llm.build_model, - role="Researcher", - goal="Search Google to find information to complete the task.", - backstory="Research has always been your thing. You can quickly find things on the web because of your skills.", - ) - research_task = SequentialTaskComponent() + + # Document Prompt for Researcher document_prompt_component = PromptComponent() document_prompt_component.set( template="""Topic: {topic} -Build a document about this document.""", +Build a document about this topic.""", topic=text_input.text_response, ) - research_task.set( - agent=researcher_agent.build_output, + + # Researcher Task Agent + researcher_task_agent = SequentialTaskAgentComponent() + researcher_task_agent.set( + role="Researcher", + goal="Search Google to find information to complete the task.", + backstory="Research has always been your thing. You can quickly find things on the web because of your skills.", + tools=[search_api_tool.build_tool], + llm=llm.build_model, task_description=document_prompt_component.build_prompt, expected_output="Bullet points and small phrases about the research topic.", ) - editor_agent = CrewAIAgentComponent() - editor_task = SequentialTaskComponent() + + # Revision Prompt for Editor revision_prompt_component = PromptComponent() revision_prompt_component.set( template="""Topic: {topic} @@ -44,18 +44,20 @@ Build a document about this document.""", Revise this document.""", topic=text_input.text_response, ) - editor_agent.set( - llm=llm.build_model, + + # Editor Task Agent + editor_task_agent = SequentialTaskAgentComponent() + editor_task_agent.set( role="Editor", - goal="You should edit the Information provided by the Researcher to make it more palatable and to not contain misleading information.", + goal="You should edit the information provided by the Researcher to make it more palatable and to not contain misleading information.", backstory="You are the editor of the most reputable journal in the world.", - ) - editor_task.set( - agent=editor_agent.build_output, + llm=llm.build_model, task_description=revision_prompt_component.build_prompt, expected_output="Small paragraphs and bullet points with the corrected content.", - task=research_task.build_task, + previous_task=researcher_task_agent.build_agent_and_task, ) + + # Blog Prompt for Comedian blog_prompt_component = PromptComponent() blog_prompt_component.set( template="""Topic: {topic} @@ -63,29 +65,34 @@ Revise this document.""", Build a fun blog post about this topic.""", topic=text_input.text_response, ) - comedian_agent = CrewAIAgentComponent() - comedian_agent.set( - llm=llm.build_model, + + # Comedian Task Agent + comedian_task_agent = SequentialTaskAgentComponent() + comedian_task_agent.set( role="Comedian", goal="You write comedic content based on the information provided by the editor.", - backstory="Your formal occupation is Comedian-in-Chief. You write jokes, do standup comedy and write funny articles.", - ) - blog_task = SequentialTaskComponent() - blog_task.set( - agent=comedian_agent.build_output, + backstory="Your formal occupation is Comedian-in-Chief. You write jokes, do standup comedy, and write funny articles.", + llm=llm.build_model, task_description=blog_prompt_component.build_prompt, expected_output="A small blog about the topic.", - task=editor_task.build_task, + previous_task=editor_task_agent.build_agent_and_task, ) - sequential_crew_component = SequentialCrewComponent() - sequential_crew_component.set(tasks=blog_task.build_task) - chat_output = ChatOutput() - chat_output.set(input_value=sequential_crew_component.build_output) + crew_component = SequentialCrewComponent() + crew_component.set( + tasks=comedian_task_agent.build_agent_and_task, + ) + + # Set up the output component + chat_output = ChatOutput() + chat_output.set(input_value=crew_component.build_output) + + # Create the graph graph = Graph( start=text_input, end=chat_output, flow_name="Sequential Tasks Agent", description="This Agent runs tasks in a predefined sequence.", ) + return graph