Skip to content

Conversation

@cognition9144
Copy link

@cognition9144 cognition9144 commented Nov 30, 2025

Description

The upstream has updated the field name to response_json_schema, where it supports additional fields, such as additionalProperties. Therefore, it will fix issues like pydantic/pydantic-ai#3517 in a similar way as https://github.com/pydantic/pydantic-ai/pull/3517/files

PR Type

🐛 Bug Fix

Relevant issues

Fixes #541.

Checklist

  • I have added unit tests that prove my fix/feature works
  • New and existing tests pass locally
  • Documentation was updated where necessary
  • I have read and followed the contribution guidelines```

The upstream has updated the field name to response_json_schema, where it supports additional fields, such as `additionalProperties`. Therefore, it will fix issues like pydantic/pydantic-ai#3517 in a similar way as https://github.com/pydantic/pydantic-ai/pull/3517/files
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/any_llm/providers/gemini/base.py 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/any_llm/providers/gemini/base.py 64.75% <0.00%> (-22.14%) ⬇️

... and 41 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@daavoo daavoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @cognition9144 , thanks for the contribution. The change doesn't as expected.

I am fine with using the new response_json_schema but you can't pass a pydantic BaseModel directly as in this PR.

I also don't think that this fixes #547 as the code only sets response_json_schema if the value passed is a pydantic class. In order to fix that issue we should update the code to also accept an input json and pass it as response_json_schema.

So, if you could please:

  • Update to convert the BaseModel to a valid input for response_json_schema.
  • Update to support raw JSON as input.
  • Add corresponding tests.

See https://github.com/mozilla-ai/any-llm/blob/main/CONTRIBUTING.md

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.

Support conversion of response_format from OpenAI format to Gemini format for structured outputs

2 participants