crewAIInc / crewAI-examples

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

Pydantic error in Instagram Post example #36

Closed gururise closed 9 months ago

gururise commented 9 months ago

In the Instagram Post example, I get the following error:

Traceback (most recent call last):
  File "/home/gene/Projects/crewai/crewAI-examples/instagram_post/main.py", line 20, in <module>
    product_competitor_agent = agents.product_competitor_agent()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gene/Projects/crewai/crewAI-examples/instagram_post/agents.py", line 14, in product_competitor_agent
    return Agent(
           ^^^^^^
  File "/home/gene/Projects/crewai/venv/lib/python3.11/site-packages/pydantic/main.py", line 164, in __init__
    __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Agent
  Value error, 1 validation error for ConversationSummaryMemory
llm
  value is not a valid dict (type=type_error.dict) [type=value_error, input_value={'role': 'Lead Market Ana...es'),), 'verbose': True}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.5/v/value_error
gururise commented 9 months ago

Found out that the llm was not properly instantiated. Based on this error msg, it's very hard to know that the llm wasn't set up properly.