-
Notifications
You must be signed in to change notification settings - Fork 492
feat(copilot): gemini 2.5 thinking mode support #1949
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
Conversation
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 adds support for Gemini 2.5 thinking variants by registering new model identifiers, updating the agent logic to detect and configure “thinking” modes for Google models, adjusting tests, and bumping the Google SDK dependency.
- Register new Gemini 2.5 models (including thinking and flash variants) in
AImodelsOptions
- Extend
AIAgent.processModel
to detect and handle Google thinking models - Update unit tests to include the new Gemini 2.5 options and bump
@ai-sdk/google
version
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/unit/utils/ai/copilot.spec.ts | Added assertions for gemini-2.5-pro and gemini-2.5-pro-thinking , updated provider test model |
src/utils/ai/copilot.ts | Registered new Gemini 2.5 model variants in the AI models options |
src/utils/ai/AIAgent.ts | Implemented isGoogleThinking detection and adjusted request payload for thinking models |
package.json | Bumped @ai-sdk/google dependency to ^1.2.12 |
Comments suppressed due to low confidence (1)
src/utils/ai/AIAgent.ts:173
- Add unit tests for the
isGoogleThinking
branch inprocessModel
to verify that it correctly trims the-thinking
suffix and setsisGoogleThinking
to true for models likegemini-2.5-pro-thinking
.
const isGoogleThinking = model.includes('gemini') && model.endsWith('-thinking')
expect(google?.children.map((c) => c.value)).to.include('gemini-2.5-pro') | ||
expect(google?.children.map((c) => c.value)).to.include('gemini-2.5-pro-thinking') | ||
expect(google?.children.map((c) => c.value)).to.include('gemini-1.5-pro') |
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.
[nitpick] Consider extracting google?.children.map(c => c.value)
into a single variable to avoid repeated mapping and improve readability.
expect(google?.children.map((c) => c.value)).to.include('gemini-2.5-pro') | |
expect(google?.children.map((c) => c.value)).to.include('gemini-2.5-pro-thinking') | |
expect(google?.children.map((c) => c.value)).to.include('gemini-1.5-pro') | |
const googleChildrenValues = google?.children.map((c) => c.value) | |
expect(googleChildrenValues).to.include('gemini-2.5-pro') | |
expect(googleChildrenValues).to.include('gemini-2.5-pro-thinking') | |
expect(googleChildrenValues).to.include('gemini-1.5-pro') |
Copilot uses AI. Check for mistakes.
PR Checklist
If you have any questions, you can refer to the Contributing Guide
What is the current behavior?
Please describe the current behavior and link to a relevant issue.
Issue Number
Example: #123
What is the new behavior?
Please describe the new behavior or provide screenshots.
Does this PR introduce a breaking change?
Specific Instructions
Are there any specific instructions or things that should be known prior to review?
Other information