Skip to content

feat(google-common): Gemini 2.5 flash #8051

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 5 commits into from
Apr 23, 2025

Conversation

afirstenberg
Copy link
Contributor

Initial support for Gemini 2.5 Flash

  • Adds support for the "thinking budget" through a "maxReasoningTokens" parameter
  • Also supports a "thinkingBudget" and "reasoningEffort" for compatibility
  • Tests for everything

Fixes #8038

I'd like to get this out ASAP, even if there are some pending issues.

Some notes:

  • Gemini 2.5 Flash defaults to using "thinking tokens" unless you set this off by setting the budget to 0. We don't do anything specific about this.
  • Specifying the "maxReasoningTokens" for models that don't support reasoning causes an error. We can discuss if / how we want to address this.

Still pending, but I'd like to get this release out asap while I add these:

  • Documentation (where should we document this, exactly?)
  • Information in OutputTokenDetails
    • Google has a bug causing inconsistent values for "output tokens" vs "thinking tokens" between the two platforms so we should wait on this till they standardize their format

Copy link

vercel bot commented Apr 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Apr 23, 2025 0:35am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Apr 23, 2025 0:35am

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 22, 2025
@afirstenberg afirstenberg changed the title feature(google-common): Gemini 2.5 flash feat(google-common): Gemini 2.5 flash Apr 22, 2025
@dosubot dosubot bot added the auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features label Apr 22, 2025
Copy link

@iltenahmet iltenahmet left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@benjamincburns benjamincburns left a comment

Choose a reason for hiding this comment

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

Looks great. Appreciate the extra effort to support the OpenAI reasoningEffort param!

@dosubot dosubot bot added the lgtm PRs that are ready to be merged as-is label Apr 23, 2025
@benjamincburns benjamincburns merged commit e91eacb into langchain-ai:main Apr 23, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features lgtm PRs that are ready to be merged as-is size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Gemini 2.5 Flash and Thinking Budget support for google-common
3 participants