Skip to content

Conversation

@dsfaccini
Copy link
Contributor

@dsfaccini dsfaccini commented Dec 2, 2025

Fixes #3617 temporarily while support is added.

Copy link
Collaborator

@DouweM DouweM left a comment

Choose a reason for hiding this comment

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

@dsfaccini We should also have a recorded test that verifies that a nested schema now works properly with OpenRouter + Gemini again

"""
is_image_model = 'image' in model_name
is_3_or_newer = 'gemini-3' in model_name
return GoogleModelProfile(
Copy link
Collaborator

Choose a reason for hiding this comment

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

We shouldn't copy paste all of this! We should call the original google_model_profile, and then do the replace thing to swap out just the transformer

) from _import_error


class OpenRouterGoogleJsonSchemaTransformer(JsonSchemaTransformer):
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is public now, I don't think it should be :)

@DouweM DouweM changed the title Interim fix for latest json schema support for gemini models via openrouter Fix structured output with nested definitions with Gemini via OpenRouter Dec 2, 2025
@DouweM DouweM self-assigned this Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenRouter + Google models produce degraded output due to schema format changes

2 participants