Skip to content

Conversation

@daymxn
Copy link
Member

@daymxn daymxn commented Sep 9, 2025

Adds support for the Live API through a new LiveSession struct, which is facilitated through a new liveModel method on FirebaseAI. This includes support for the realtime api, as well as the incremental api.

This PR also adds support for the id field in FunctionCallPart.

Fixes #15147

@daymxn daymxn self-assigned this Sep 9, 2025
@google-oss-bot
Copy link

google-oss-bot commented Sep 9, 2025

1 Warning
⚠️ New public headers were added, did you remember to add them to the umbrella header?

Generated by 🚫 Danger

@ncooke3
Copy link
Member

ncooke3 commented Oct 1, 2025

Please audit public API and change mutable stored properties to immutable lets if possible.

@ncooke3
Copy link
Member

ncooke3 commented Oct 1, 2025

/gemini review

Copy link
Contributor

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

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 introduces support for the Live API, a significant feature enabling real-time, bidirectional communication with the model. The changes are extensive, adding new public-facing classes like LiveGenerativeModel and LiveSession, along with a robust internal infrastructure to handle WebSocket communication, including a LiveSessionService actor and numerous data models for client/server messages.

Overall, the implementation is of very high quality. The separation of concerns is excellent, with clear distinctions between public API, internal services, and low-level networking. The use of modern Swift concurrency features like actors and async streams is well-executed. Error handling is also very thorough, with specific, descriptive error types for the new Live API.

I've identified one high-severity issue related to a hardcoded URL that would prevent testing against non-production environments, and a medium-severity issue regarding the WebSocket delegate setup. My feedback is focused on improving the robustness and correctness of the new networking layer.

Copy link
Member

@ncooke3 ncooke3 left a comment

Choose a reason for hiding this comment

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

Great work! Please do a round of testing before merging.

@daymxn daymxn requested a review from andrewheard October 1, 2025 21:52
@daymxn daymxn enabled auto-merge (squash) October 1, 2025 22:32
@daymxn daymxn merged commit 22e527b into main Oct 1, 2025
49 checks passed
@daymxn daymxn deleted the dlr/firebaseai-live-api branch October 1, 2025 22:36
@firebase firebase locked and limited conversation to collaborators Nov 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.