From b2ad14e6a9ae22bd5de60977b905795596c299fd Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 17 Jul 2024 11:48:15 -0300 Subject: [PATCH] fix(crewai): replace MessageTextInput with MultilineInput (#2757) * feat: Update input handling in HierarchicalTaskComponent The code changes modify the `HierarchicalTaskComponent` in the `HierarchicalTask.py` file. The `MessageTextInput` inputs are replaced with `MultilineInput` inputs to allow for multiline descriptions and expected outputs. This change improves the user experience and provides more flexibility in input handling. * refactor: Update input handling in SequentialTaskComponent The code changes modify the `SequentialTaskComponent` in the `SequentialTask.py` file. The `MessageTextInput` inputs are replaced with `MultilineInput` inputs to allow for multiline descriptions and expected outputs. This change improves the user experience and provides more flexibility in input handling. * refactor: Update input handling in CrewAIAgentComponent The code changes modify the `CrewAIAgentComponent` in the `CrewAIAgent.py` file. The `MessageTextInput` inputs are replaced with `MultilineInput` inputs to allow for multiline descriptions and expected outputs. This change improves the user experience and provides more flexibility in input handling. --- .../base/langflow/components/agents/CrewAIAgent.py | 8 ++++---- .../base/langflow/components/helpers/HierarchicalTask.py | 6 +++--- .../base/langflow/components/helpers/SequentialTask.py | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/backend/base/langflow/components/agents/CrewAIAgent.py b/src/backend/base/langflow/components/agents/CrewAIAgent.py index 5510a5823..c92ebc27e 100644 --- a/src/backend/base/langflow/components/agents/CrewAIAgent.py +++ b/src/backend/base/langflow/components/agents/CrewAIAgent.py @@ -1,7 +1,7 @@ from crewai import Agent # type: ignore from langflow.custom import Component -from langflow.io import BoolInput, DictInput, HandleInput, MessageTextInput, Output +from langflow.io import BoolInput, DictInput, HandleInput, MultilineInput, Output class CrewAIAgentComponent(Component): @@ -11,9 +11,9 @@ class CrewAIAgentComponent(Component): icon = "CrewAI" inputs = [ - MessageTextInput(name="role", display_name="Role", info="The role of the agent."), - MessageTextInput(name="goal", display_name="Goal", info="The objective of the agent."), - MessageTextInput(name="backstory", display_name="Backstory", info="The backstory of the agent."), + MultilineInput(name="role", display_name="Role", info="The role of the agent."), + MultilineInput(name="goal", display_name="Goal", info="The objective of the agent."), + MultilineInput(name="backstory", display_name="Backstory", info="The backstory of the agent."), HandleInput( name="tools", display_name="Tools", diff --git a/src/backend/base/langflow/components/helpers/HierarchicalTask.py b/src/backend/base/langflow/components/helpers/HierarchicalTask.py index 993126d36..e5a73e851 100644 --- a/src/backend/base/langflow/components/helpers/HierarchicalTask.py +++ b/src/backend/base/langflow/components/helpers/HierarchicalTask.py @@ -1,6 +1,6 @@ from langflow.base.agents.crewai.tasks import HierarchicalTask from langflow.custom import Component -from langflow.io import HandleInput, MessageTextInput, Output +from langflow.io import HandleInput, MultilineInput, Output class HierarchicalTaskComponent(Component): @@ -8,12 +8,12 @@ class HierarchicalTaskComponent(Component): description: str = "Each task must have a description, an expected output and an agent responsible for execution." icon = "CrewAI" inputs = [ - MessageTextInput( + MultilineInput( name="task_description", display_name="Description", info="Descriptive text detailing task's purpose and execution.", ), - MessageTextInput( + MultilineInput( name="expected_output", display_name="Expected Output", info="Clear definition of expected task outcome.", diff --git a/src/backend/base/langflow/components/helpers/SequentialTask.py b/src/backend/base/langflow/components/helpers/SequentialTask.py index 793d7db4c..7048a68c7 100644 --- a/src/backend/base/langflow/components/helpers/SequentialTask.py +++ b/src/backend/base/langflow/components/helpers/SequentialTask.py @@ -1,6 +1,6 @@ from langflow.base.agents.crewai.tasks import SequentialTask from langflow.custom import Component -from langflow.io import BoolInput, HandleInput, MessageTextInput, Output +from langflow.io import BoolInput, HandleInput, MultilineInput, Output class SequentialTaskComponent(Component): @@ -8,12 +8,12 @@ class SequentialTaskComponent(Component): description: str = "Each task must have a description, an expected output and an agent responsible for execution." icon = "CrewAI" inputs = [ - MessageTextInput( + MultilineInput( name="task_description", display_name="Description", info="Descriptive text detailing task's purpose and execution.", ), - MessageTextInput( + MultilineInput( name="expected_output", display_name="Expected Output", info="Clear definition of expected task outcome.",