Skip to content

Commit 927ac9c

Browse files
committed
review feedback
1 parent dec7227 commit 927ac9c

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

packages/firebase_ai/firebase_ai/example/lib/pages/bidi_page.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ class BidiMediaManager {
108108
if (!kIsWeb && defaultTargetPlatform == TargetPlatform.macOS) {
109109
int attempts = 0;
110110
while (_videoInput.cameraController == null) {
111-
if (attempts > 50) break; // 5 second timeout safety
111+
if (attempts > 50) {
112+
developer.log(
113+
'BidiMediaManager.startVideo(): macOS camera controller initialization timed out after 50 attempts.',
114+
);
115+
break; // 5 second timeout safety
116+
}
112117
await Future.delayed(const Duration(milliseconds: 100));
113118
attempts++;
114119
}

packages/firebase_ai/firebase_ai/lib/src/live_model.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ final class LiveGenerativeModel extends BaseModel {
9090
///
9191
/// This function handles the WebSocket connection setup and returns an [LiveSession]
9292
/// object that can be used to communicate with the service.
93-
///
93+
/// [sessionResumption] (optional): The configuration for session resumption,
94+
/// such as the handle to the previous session state to restore.
95+
///
9496
/// Returns a [Future] that resolves to an [LiveSession] object upon successful
9597
/// connection.
9698
Future<LiveSession> connect(
@@ -106,7 +108,7 @@ final class LiveGenerativeModel extends BaseModel {
106108
_useLimitedUseAppCheckTokens,
107109
)();
108110

109-
return LiveSession.connect(
111+
return LiveSession.create(
110112
uri: uri,
111113
headers: headers,
112114
modelString: modelString,

packages/firebase_ai/firebase_ai/lib/src/live_session.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ class LiveSession {
5454
///
5555
/// Returns a [Future] that resolves to an [LiveSession] object upon successful
5656
/// connection.
57-
static Future<LiveSession> connect({
57+
@internal
58+
static Future<LiveSession> create({
5859
required String uri,
5960
required Map<String, String> headers,
6061
required String modelString,

0 commit comments

Comments
 (0)