Skip to content

Commit b867f23

Browse files
committed
Update with api review comments
1 parent 76b68c8 commit b867f23

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class _BidiPageState extends State<BidiPage> {
280280
// Map the Uint8List stream to InlineDataPart stream
281281
if (inputStream != null) {
282282
await for (final data in inputStream) {
283-
await _session.sendAudio(InlineDataPart('audio/pcm', data));
283+
await _session.sendAudioRealtime(InlineDataPart('audio/pcm', data));
284284
}
285285
}
286286
} catch (e) {
@@ -308,7 +308,7 @@ class _BidiPageState extends State<BidiPage> {
308308
try {
309309
final prompt = Content.text(textPrompt);
310310
// await _session.send(input: prompt, turnComplete: true);
311-
await _session.sendText(textPrompt);
311+
await _session.sendTextRealtime(textPrompt);
312312
} catch (e) {
313313
_showError(e.toString());
314314
}

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,30 +76,30 @@ class LiveSession {
7676
_ws.sink.add(clientJson);
7777
}
7878

79-
/// Sends audio data to the server.
79+
/// Sends audio data to the server in realtime.
8080
///
8181
/// [audio]: The audio data to send.
82-
Future<void> sendAudio(InlineDataPart audio) async {
82+
Future<void> sendAudioRealtime(InlineDataPart audio) async {
8383
_checkWsStatus();
8484
var clientMessage = LiveClientRealtimeInput.audio(audio);
8585
var clientJson = jsonEncode(clientMessage.toJson());
8686
_ws.sink.add(clientJson);
8787
}
8888

89-
/// Sends video data to the server.
89+
/// Sends video data to the server in realtime.
9090
///
9191
/// [video]: The video data to send.
92-
Future<void> sendVideo(InlineDataPart video) async {
92+
Future<void> sendVideoRealtime(InlineDataPart video) async {
9393
_checkWsStatus();
9494
var clientMessage = LiveClientRealtimeInput.video(video);
9595
var clientJson = jsonEncode(clientMessage.toJson());
9696
_ws.sink.add(clientJson);
9797
}
9898

99-
/// Sends text data to the server.
99+
/// Sends text data to the server in realtime.
100100
///
101101
/// [text]: The text data to send.
102-
Future<void> sendText(String text) async {
102+
Future<void> sendTextRealtime(String text) async {
103103
_checkWsStatus();
104104
var clientMessage = LiveClientRealtimeInput.text(text);
105105
var clientJson = jsonEncode(clientMessage.toJson());
@@ -109,7 +109,8 @@ class LiveSession {
109109
/// Sends realtime input (media chunks) to the server.
110110
///
111111
/// [mediaChunks]: The list of media chunks to send.
112-
@Deprecated('Use sendAudio, sendVideo, or sendText instead')
112+
@Deprecated(
113+
'Use sendAudioRealtime, sendVideoRealtime, or sendTextRealtime instead')
113114
Future<void> sendMediaChunks({
114115
required List<InlineDataPart> mediaChunks,
115116
}) async {

0 commit comments

Comments
 (0)