You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Statement
I want to investigate whether annotating the Pydantic model with additional metadata (like descriptions and examples) could improve GPT's performance and the accuracy of predictions in our pipeline.
For instance, here's how we can annotate the same model:
frompydanticimportBaseModel, FieldclassAddress(BaseModel):
street: str=Field(..., description="Street address of the user", example="123 Main St")
classUser(BaseModel):
id: int=Field(..., description="User's unique identifier", example=1)
email: str|None=Field(None, description="User's email address, optional", example="email@somewhere")
address: Address=Field(..., description="Address details of the user")
print(User.model_json_schema())
Description
Context
Currently, we pass our Pydantic model's JSON schema to GPT, like this:
An example output of
model_json_schema()
:Results:
Problem Statement
I want to investigate whether annotating the Pydantic model with additional metadata (like descriptions and examples) could improve GPT's performance and the accuracy of predictions in our pipeline.
For instance, here's how we can annotate the same model:
Results with annotations:
Acceptance Criteria
Additional Information
The text was updated successfully, but these errors were encountered: