Skip to content

Correct error message for invalid output types with strict JSON schema #1101

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

DanielHashmi
Copy link
Contributor

Problem

  1. Incorrect parameter reference: Suggests passing output_schema_strict=False to Agent(), but this parameter doesn't exist
  2. Vague guidance: The phrase "make the output type strict" doesn't explain HOW to make types strict

Solution

Updated the error message to provide accurate, actionable guidance:

Before:

"Either make the output type strict, or pass output_schema_strict=False to your Agent()"

After:

"Either use a dataclass, Pydantic model, or TypedDict, or wrap your type with AgentOutputSchema(your_type, strict_json_schema=False)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant