crewAIInc / crewAI-examples

A collection of examples that show how to use CrewAI framework to automate workflows.
2.77k stars 1.05k forks source link

trip_planner is no longer working #120

Closed Toasterme closed 1 month ago

Toasterme commented 4 months ago

as the title said, the example is not working

pydantic_core._pydantic_core.ValidationError: 1 validation error for Task expected_output Field required [type=missing, input_value={'description': "\nAnalyz...ick ideal destinations)}, input_type=dict] For further information visit https://errors.pydantic.dev/2.7/v/missing

shaihi commented 4 months ago

Same error when running starter_template: Traceback (most recent call last): File ".../starter_template/main.py", line 68, in result = custom_crew.run() ^^^^^^^^^^^^^^^^^ File ".../starter_template/main.py", line 39, in run custom_task_1 = tasks.task_1_name( ^^^^^^^^^^^^^^^^^^ File ".../starter_template/tasks.py", line 13, in task_1_name return Task( ^^^^^ File ".../crewAIenv/lib/python3.12/site-packages/crewai/task.py", line 102, in init super().init(config, data) File ".../crewAIenv/lib/python3.12/site-packages/pydantic/main.py", line 176, in init self.__pydantic_validator__.validate_python(data, self_instance=self) pydantic_core._pydantic_core.ValidationError: 1 validation error for Task expected_output Field required [type=missing, input_value={'description': "\nDo som...agent 1 backstory here)}, input_type=dict] For further information visit https://errors.pydantic.dev/2.7/v/missing

kaibrach commented 3 months ago

You have to specify the expected_output for the task. The expected_output field is mandatory for the task. See the description of the Task class and the mandatory Field:

class Task(BaseModel):
    """ Class that represents a task to be executed.
   Each task must have a description, an expected output and an agent responsible for execution.
...

"""

For example:

task = Task(
    description='Edit the blog post draft, improving its clarity, coherence, and engagement.', 
    agent=content_editor,
    expected_output='A refined finalized version of the blog post in markdown format'
)
github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stale for 5 days with no activity.