New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue with below code #549
Comments
I have this error also- just upgraded CrewAI (on Linux) and got this validation error (was working before) Starts with this warning also: And then the error: |
you didnt add the expected output in the code |
can you give a sample example expected_output to put here |
insights_task = Task( |
from crewai import Agent, Task, Crew
from langchain_openai import ChatOpenAI
import os
os.environ["OPENAI_API_KEY"] = "NA"
llm = ChatOpenAI(
general_agent = Agent(role = "Math Professor",
task = Task (description="""what is 3 + 5""",
crew = Crew(
result = crew.kickoff()
print(result)
###################################
error
ValidationError Traceback (most recent call last)
Cell In[26], line 31
11 llm = ChatOpenAI(
12
13 model = "llama2",
14
15 base_url = "http://localhost:11434/v1")
19 general_agent = Agent(role = "Math Professor",
20
21 goal = """Provide the solution to the students that are asking mathematical questions and give them the answer.""",
(...)
28
29 llm = llm)
---> 31 task = Task (description="""what is 3 + 5""",
32
33 agent = general_agent)
37 crew = Crew(
38
39 agents=[general_agent],
(...)
44
45 )
49 result = crew.kickoff()
File /opt/homebrew/lib/python3.12/site-packages/crewai/task.py:100, in Task.init(pydantic_self, **data)
98 def init(pydantic_self, **data):
99 config = data.pop("config", {})
--> 100 super().init(**config, **data)
File /opt/homebrew/lib/python3.12/site-packages/pydantic/main.py:176, in BaseModel.init(self, **data)
174 #
__tracebackhide__
tells pytest and some other tools to omit this function from tracebacks175 tracebackhide = True
--> 176 self.pydantic_validator.validate_python(data, self_instance=self)
ValidationError: 1 validation error for Task
expected_output
Field required [type=missing, input_value={'description': 'what is ...derstand your solution)}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.7/v/missing
The text was updated successfully, but these errors were encountered: