Skip to content

Support enforcing json schema in supported AI model APIs #1133

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

Merged
merged 6 commits into from
Mar 19, 2025

Conversation

debanjum
Copy link
Member

Trigger

Gemini 2.0 Flash doesn't always follow JSON schema in research prompt

Details

  • Use json schema to enforce generate online queries format
  • Use json schema to enforce research mode tool pick format
  • Support constraining Gemini model output to specified response schema
  • Support constraining OpenAI model output to specified response schema
  • Only enforce json output in supported AI model APIs
  • Simplify OpenAI reasoning model specific arguments to OpenAI API

Previously OpenAI reasoning models didn't support stream_options and
response_format

Add reasoning_effort arg for calls to OpenAI reasoning models via API.
Right now it defaults to medium but can be changed to low or high
@debanjum debanjum force-pushed the improve-json-schema-adherence-by-gemini-2-flash branch 2 times, most recently from d50fe0b to a44fe81 Compare March 19, 2025 16:27
Deepseek reasoner does not support json object or schema via deepseek API
Azure Ai API does not support json schema

Resolves #1126
If the response_schema argument is passed to
send_message_to_model_wrapper it is used to constrain output by Gemini
models
@debanjum debanjum force-pushed the improve-json-schema-adherence-by-gemini-2-flash branch from a44fe81 to a5627ef Compare March 19, 2025 17:03
@debanjum debanjum merged commit e68428d into master Mar 19, 2025
10 checks passed
@debanjum debanjum deleted the improve-json-schema-adherence-by-gemini-2-flash branch March 19, 2025 17:38
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