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.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-07-17 11:48:15 -03:00 committed by GitHub
commit b2ad14e6a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 10 deletions

View file

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

View file

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

View file

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