Closed billy-le closed 2 weeks ago
Try describing your fields with Field
class. For example, in the weather.py you should do the following:
from pydantic import BaseModel
from typing import Union
class Weather(BaseModel):
date: str = Field(description="Date in YYYY-MM-DD format.")
temp: float = Field(description="A floating number representing temperature.")
scale: Union["fahrenheit", "celsius"] = Field(description="The scale of the weather.")
@ArtyomVancyan Unfortunately I am presented with the same errors after updating the generative models with the Field class.
Just to clarify, have you updated all the models or just this one? Because you should update all of them. Also, make sure all models are inherited from the BaseModel
.
I've updated all the models and dependant models assigned to a Task.output_json
.
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.
This issue was closed because it has been stalled for 5 days with no activity.
I raised an issue in the Discord channel but haven't gotten a solution yet so I thought I might open an issue here.
This is the repo where I'm having the problem. The branch I'm working on is
ft/pydantic
This is the error I keep having even after following instructions from the community.
The AI Agents sometimes are able to have a "Final Answer" but it still fails to parse it into a Pydantic Model.