Skip to content

Conversation

@minhduc0711
Copy link
Contributor

Remove spaces from the name of the JSON schema to comply with OpenAI API docs on structured output.

Otherwise, the snippet would return this error:

pydantic_ai.exceptions.ModelHTTPError: status_code: 400, model_name: gpt-4o, body: {'message': "Invalid 'response_format.json_schema.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.", 'type': 'invalid_request_error', 'param': 'response_format.json_schema.name', 'code': 'invalid_value'}

@hyperlint-ai
Copy link
Contributor

hyperlint-ai bot commented Jul 22, 2025

PR Change Summary

Updated JSON schema name in the code snippet to comply with OpenAI API documentation requirements.

  • Removed spaces from the JSON schema name to avoid validation errors.
  • Corrected the name from 'Fruit or vehicle' to 'Fruit_or_vehicle'.
  • Ensured compliance with the expected naming pattern for JSON schema.

Modified Files

  • docs/output.md

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

@DouweM DouweM merged commit 932c888 into pydantic:main Jul 22, 2025
19 checks passed
@DouweM
Copy link
Collaborator

DouweM commented Jul 22, 2025

@minhduc0711 Thanks Minh!

KRRT7 pushed a commit to aseembits93/pydantic-ai that referenced this pull request Jul 24, 2025
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.

2 participants