Remove deprecated APIs and internalize response constructors in firebase-ai - #8563
VinayGuthal wants to merge 8 commits into
Conversation
📝 PRs merging into main branchOur 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. |
Using Gemini Code AssistThe 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
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 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. |
|
/gemini review |
There was a problem hiding this comment.
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'.
|
The public api surface has changed for the subproject ai-logic_firebase-ai: 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. |
c40e453 to
b93ae65
Compare
|
/gemini review |
There was a problem hiding this comment.
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.
…pe/LiveServerMessage.kt Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
The public api surface has changed for the subproject ai-logic_firebase-ai: 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 | |||
There was a problem hiding this comment.
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)
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.