Skip to content

Deprecate Gemini 3.x tuning parameters - #16630

Merged
paulb777 merged 7 commits into
mainfrom
deprecate-gemini-tuning-params
Sep 11, 2026
Merged

Deprecate Gemini 3.x tuning parameters#16630
paulb777 merged 7 commits into
mainfrom
deprecate-gemini-tuning-params

Conversation

@paulb777

@paulb777 paulb777 commented Sep 8, 2026

Copy link
Copy Markdown
Member

Deprecates temperature, topP, topK, candidateCount, presencePenalty, and frequencyPenalty in FirebaseAI as they are no longer recommended for Gemini 3.x models. Addressing internal b/514770518.

Summary of Changes

This pull request updates the FirebaseAI library to align with Gemini 3.x model recommendations by deprecating several tuning parameters that are no longer supported. It introduces new, cleaner initializers for configuration types to facilitate a smoother transition for developers while maintaining backward compatibility through deprecation warnings.

Highlights

  • Deprecation of Tuning Parameters: Deprecated temperature, topP, topK, candidateCount, presencePenalty, and frequencyPenalty in GenerationConfig and LiveGenerationConfig as they are no longer recommended for Gemini 3.x models.
  • New Initializers: Added new public initializers to GenerationConfig and LiveGenerationConfig that exclude the deprecated tuning parameters.
  • API Updates: Updated GenerationOptions to deprecate manual sampling and temperature settings, providing alternative initializers.

@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@paulb777
paulb777 marked this pull request as draft September 8, 2026 20:46
@paulb777

paulb777 commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request deprecates several model tuning parameters (such as temperature, topP, topK, candidateCount, presencePenalty, and frequencyPenalty) across GenerationConfig, GenerationOptions, and LiveGenerationConfig, as they are no longer recommended for Gemini 3.x models. It introduces new public initializers that omit these deprecated parameters. The review feedback suggests adding comprehensive documentation comments to these new initializers and consistently using the self. prefix for property assignments within them.

Comment thread FirebaseAI/Sources/GenerationConfig.swift
Comment thread FirebaseAI/Sources/GenerationConfig.swift
Comment thread FirebaseAI/Sources/Types/Public/GenerationOptions.swift Outdated
Comment thread FirebaseAI/Sources/Types/Public/Live/LiveGenerationConfig.swift
@paulb777

paulb777 commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request deprecates several model tuning parameters (such as temperature, topP, topK, candidateCount, presencePenalty, and frequencyPenalty) across GenerationConfig, LiveGenerationConfig, and GenerationOptions as they are no longer recommended for Gemini 3.x models. It introduces new initializers that exclude these parameters and updates unit tests with deprecation annotations. Feedback is provided to update an outdated doc comment on the new GenerationOptions initializer, which still references token sampling behavior.

Comment thread FirebaseAI/Sources/Types/Public/GenerationOptions.swift Outdated
@paulb777

paulb777 commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

/gemini summary

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

This pull request updates the FirebaseAI library to align with Gemini 3.x model recommendations by deprecating several tuning parameters that are no longer supported. It introduces new, cleaner initializers for configuration types to facilitate a smoother transition for developers while maintaining backward compatibility through deprecation warnings.

Highlights

  • Deprecation of Tuning Parameters: Deprecated temperature, topP, topK, candidateCount, presencePenalty, and frequencyPenalty in GenerationConfig and LiveGenerationConfig as they are no longer recommended for Gemini 3.x models.
  • New Initializers: Added new public initializers to GenerationConfig and LiveGenerationConfig that exclude the deprecated tuning parameters.
  • API Updates: Updated GenerationOptions to deprecate manual sampling and temperature settings, providing alternative initializers.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Activity
  • The pull request was created by paulb777.
  • Gemini Code Assist performed automated code reviews.
  • The author addressed review comments regarding documentation and code style.
  • The author clarified that certain style suggestions were not compatible with existing SwiftFormat rules.

@paulb777
paulb777 marked this pull request as ready for review September 9, 2026 03:29
@paulb777
paulb777 requested a review from andrewheard September 9, 2026 03:29
Comment thread FirebaseAI/Sources/Types/Public/Live/LiveGenerationConfig.swift Outdated
Comment thread FirebaseAI/Tests/Unit/Types/GenerationOptionsTests.swift Outdated
Comment thread FirebaseAI/Tests/Unit/GenerativeModelSessionTests.swift Outdated
@paulb777
paulb777 force-pushed the deprecate-gemini-tuning-params branch from 83f8702 to ad87588 Compare September 10, 2026 16:23
@paulb777

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request deprecates several model tuning parameters (temperature, topP, topK, candidateCount, presencePenalty, and frequencyPenalty) in GenerationConfig and LiveGenerationConfig as they are unsupported in Gemini 3.x and later models. It introduces new initializers without these parameters and updates unit tests and snippets accordingly. Feedback highlights a test failure in GenerativeModelSessionTests.swift due to the removal of temperature from a config where the mock handler still asserts its presence. Additionally, it is recommended to retain or add dedicated test coverage for the serialization and merging of these deprecated parameters to ensure backward compatibility remains verified.

Comment thread FirebaseAI/Tests/Unit/GenerativeModelSessionTests.swift
Comment thread FirebaseAI/Tests/Unit/GenerationConfigTests.swift
@paulb777

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request deprecates several model tuning parameters (temperature, topP, topK, candidateCount, presencePenalty, and frequencyPenalty) in GenerationConfig and LiveGenerationConfig as they are unsupported in Gemini 3.x and later models. New initializers without these parameters have been introduced, and existing tests and snippets have been updated to remove them. The review feedback suggests maintaining test coverage for the encoding and merging behaviors of these deprecated parameters since they are still supported for backward compatibility.

Comment thread FirebaseAI/Tests/Unit/GenerationConfigTests.swift
Comment thread FirebaseAI/Tests/Unit/GenerationConfigTests.swift
@paulb777 paulb777 added this to the Firebase 13 milestone Sep 10, 2026
Comment thread FirebaseAI/Sources/Types/Public/Live/LiveGenerationConfig.swift
@paulb777
paulb777 merged commit 8f5e12c into main Sep 11, 2026
88 of 89 checks passed
@paulb777
paulb777 deleted the deprecate-gemini-tuning-params branch September 11, 2026 19:36
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.

2 participants