-
-
Notifications
You must be signed in to change notification settings - Fork 455
fix(ai-openrouter): Add support for google-gemini-v1 reasoning format #5799
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
base: main
Are you sure you want to change the base?
fix(ai-openrouter): Add support for google-gemini-v1 reasoning format #5799
Conversation
Google Gemini models return reasoning_details with format 'google-gemini-v1' which was not recognized by the schema, causing validation errors. Changes: - Add 'google-gemini-v1' to ReasoningDetailSummaryFormat - Add 'google-gemini-v1' to ReasoningDetailEncryptedFormat - Add 'google-gemini-v1' to ReasoningDetailTextFormat Fixes schema validation errors when using Google Gemini models (gemini-2.0-flash-exp, gemini-pro-preview, etc.) through OpenRouter. The error was: Expected 'unknown' | 'openai-responses-v1' | 'anthropic-claude-v1', actual 'google-gemini-v1' This is a backward-compatible change (union type extension).
🦋 Changeset detectedLatest commit: 071989e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes schema validation errors that occurred when using Google Gemini models (e.g., gemini-2.0-flash-exp) through OpenRouter. The issue was caused by Gemini models returning reasoning_details with format: "google-gemini-v1", which wasn't recognized by the existing schema.
Key Changes:
- Extended three reasoning format schemas to include
"google-gemini-v1"as a valid literal value - Added appropriate changeset documentation for the patch-level change
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/ai/openrouter/src/Generated.ts |
Added "google-gemini-v1" to all three reasoning format schemas (ReasoningDetailSummaryFormat, ReasoningDetailEncryptedFormat, ReasoningDetailTextFormat) |
.changeset/google-gemini-reasoning-format.md |
Added patch-level changeset documenting the support for Google Gemini v1 reasoning format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@subtleGradient - getting a CI error due to linting. I think running a simple |
|
I should definitely not ping @IMax153 too frequently. But... here goes :P |
Problem
Google Gemini models (gemini-2.0-flash-exp, gemini-pro-preview, etc.) fail with schema validation errors when used through @effect/ai-openrouter:
The error occurs because Gemini models return
reasoning_detailswithformat: "google-gemini-v1", which is not recognized by the schema.Solution
Add
"google-gemini-v1"to the three reasoning format schemas:ReasoningDetailSummaryFormatReasoningDetailEncryptedFormatReasoningDetailTextFormatThis is a backward-compatible change (union type extension). Existing models continue to work unchanged.
Minimal Reproduction
Error before fix:
Testing
google-gemini-v1formatChanges
Modified:
packages/ai/openrouter/src/Generated.ts- Added"google-gemini-v1"to format schemasAdded:
.changeset/google-gemini-reasoning-format.md- Patch-level changeset