Skip to content

Remove deprecated APIs and internalize response constructors in firebase-ai - #8563

Open
VinayGuthal wants to merge 8 commits into
mainfrom
clean_up
Open

VinayGuthal wants to merge 8 commits into
mainfrom
clean_up

Conversation

@VinayGuthal

@VinayGuthal VinayGuthal commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Cleans up the firebase-ai public API surface by removing deprecated classes, methods, and properties, and marking constructors of SDK-emitted response/status models as internal.

Removed Deprecated Classes & APIs
Restricted Constructors on Output/Status Types to internal
Tests & API Signatures updated
Removed VERTEX_AI and used AgentPlatform instead.

@github-actions

Copy link
Copy Markdown
Contributor

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

@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.

@VinayGuthal VinayGuthal changed the title remove deprecated code Remove deprecated APIs and internalize response constructors in firebase-ai Aug 31, 2026
@VinayGuthal

Copy link
Copy Markdown
Contributor 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 cleans up the API by removing deprecated classes and methods (such as the vertexAI backend, MediaData, Voices, and GroundingAttribution), making several constructors internal to prevent external instantiation, and renaming internal "Bidi" components to "Live". The review feedback suggests several Kotlin-specific improvements, such as declaring DownloadStatus as a sealed class and converting stateless classes like DownloadCompleted and LiveServerSetupComplete into objects. It also recommends updating outdated variable names and comments that still refer to 'Vertex AI' to reflect the transition to 'Agent Platform'.

Comment thread ai-logic/firebase-ai/src/main/kotlin/com/google/firebase/ai/OnDeviceConfig.kt Outdated
@google-oss-bot

Copy link
Copy Markdown
Collaborator

The public api surface has changed for the subproject ai-logic_firebase-ai:
error: Added field com.google.firebase.ai.type.LiveServerSetupComplete.INSTANCE [AddedField]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@VinayGuthal

Copy link
Copy Markdown
Contributor 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 cleans up the firebase-ai API by removing deprecated classes (such as MediaData and Voices), removing the deprecated vertexAI backend in favor of agentPlatform, making several public constructors internal, and renaming internal live session classes for clarity. Feedback on these changes suggests defining DownloadStatus as a sealed class instead of an abstract class with an internal constructor for a more idiomatic Kotlin implementation, and converting LiveServerSetupComplete to an object since it has no state or properties.

VinayGuthal and others added 2 commits September 15, 2026 15:44
…pe/LiveServerMessage.kt

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@google-oss-bot

Copy link
Copy Markdown
Collaborator

The public api surface has changed for the subproject ai-logic_firebase-ai:
error: Added field com.google.firebase.ai.type.LiveServerSetupComplete.INSTANCE [AddedField]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@rlazo

rlazo commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

The public api surface has changed for the subproject ai-logic_firebase-ai: error: Added field com.google.firebase.ai.type.LiveServerSetupComplete.INSTANCE [AddedField]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

please address

@@ -1,5 +1,9 @@
# Unreleased

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.

Needs work, see http://shortn/_42TlvbtlPu

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.

Suggested by gemini

- [removed] **Breaking change:** Removed the deprecated `GenerativeBackend.vertexAI` backend in favor of [`GenerativeBackend.agentPlatform`](https://firebase.google.com/docs/ai-logic/locations?api=vertex). Note that `GenerativeBackend.agentPlatform` defaults to the `global` location rather than `us-central1`. (#8563)
- [removed] **Breaking change:** Removed the deprecated `MediaData` class along with `LiveSession.sendMediaStream` and `LiveSessionFutures.sendMediaStream`. Use `sendAudioRealtime`, `sendVideoRealtime`, or `sendTextRealtime` with `InlineData` instead for streaming realtime input during live sessions. (#8563)
- [removed] **Breaking change:** Removed deprecated classes and properties, including `Voices` (use `Voice` instead), `GroundingAttribution` (use `GroundingChunk` instead), `GenerativeModel.warmUp` (use `onDeviceExtension?.warmUp()` instead), and `CountTokensResponse.totalBillableCharacters`. (#8563)
- [changed] **Breaking change:** Restricted public constructors on SDK-emitted response and status models to `internal`, and converted stateless status classes `DownloadStatus.DownloadCompleted` and `LiveServerSetupComplete` into singletons (`object`). These classes are provided by the SDK and are not intended for direct instantiation by client applications. (#8563)

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