Skip to content

fix: Expose ThinkingConfig class in firebase_ai.dart for use in GenerationConfig #17599

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 1 commit into from
Aug 6, 2025

Conversation

14T
Copy link
Contributor

@14T 14T commented Aug 5, 2025

Expose ThinkingConfig class in firebase_ai.dart for use in GenerationConfig

Description

This PR adds the ThinkingConfig class to the export list in lib/firebase_ai.dart for the firebase_ai package. Currently, ThinkingConfig is defined in src/api.dart but not exported, causing a compilation error (The method 'ThinkingConfig' isn't defined) when users attempt to use it with GenerationConfig to configure the thinking budget for Vertex AI models (e.g., gemini-2.5-flash). This change ensures ThinkingConfig is accessible, enabling users to set the thinkingBudget parameter as documented in the Firebase AI Logic SDK (https://firebase.google.com/docs/ai-logic/thinking?api=vertex#set-thinking-budget).

Existing Behavior: The ThinkingConfig class is defined but not exported, making it inaccessible to users of the firebase_ai package despite being required for GenerationConfig.

Change: Added ThinkingConfig to the export 'src/api.dart' show ... statement in lib/firebase_ai.dart.

Motivation: Users encounter errors when trying to use ThinkingConfig to disable or configure the thinking budget, as intended by the SDK. This fix aligns the package with the documented functionality and improves developer experience.

Related Issues

  • Resolves the issue where ThinkingConfig is not accessible, as reported by users attempting to use the thinking budget feature.

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]). (Note: No behavior changes; export addition only. Tests will be added if required by reviewers.)
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///). (Note: Added doc comment for ThinkingConfig export if needed.)
  • The analyzer (melos run analyze) does not report any problems on my PR.
  • I read and followed the [Flutter Style Guide].
  • I signed the [CLA].
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

Expose ThinkingConfig class so that it can be used in GenerationConfig
Copy link

google-cla bot commented Aug 5, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@14T 14T changed the title Expose ThinkingConfig class in firebase_ai.dart for use in GenerationConfig fix: Expose ThinkingConfig class in firebase_ai.dart for use in GenerationConfig Aug 5, 2025
@ryanwilson
Copy link
Member

Thanks so much for catching this @14T, and apologies for the issue!

@Lyokone Lyokone merged commit b03381a into firebase:main Aug 6, 2025
24 of 30 checks passed
@Lyokone
Copy link
Contributor

Lyokone commented Aug 6, 2025

Thanks @14T, it's now merged :)

gspencergoog pushed a commit to gspencergoog/flutterfire that referenced this pull request Aug 14, 2025
… use in GenerationConfig (firebase#17599)

Expose ThinkingConfig class so that it can be used in GenerationConfig
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.

4 participants