File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,6 +261,8 @@ function resolveEnvApiKey(): string | undefined {
261261 return trimToUndefined ( process . env . GEMINI_API_KEY ) ?? trimToUndefined ( process . env . GOOGLE_API_KEY ) ;
262262}
263263
264+ // Gemini 3.1 Live replaces client-content text and async tools with realtime text
265+ // and sequential function responses; explicit older models keep their prior contract.
264266function isGemini31LiveModel ( model : string ) : boolean {
265267 const modelId = model . startsWith ( "models/" ) ? model . slice ( "models/" . length ) : model ;
266268 return modelId . startsWith ( "gemini-3.1-" ) && modelId . includes ( "-live" ) ;
@@ -335,6 +337,8 @@ function buildFunctionDeclarations(
335337 omitted += 1 ;
336338 continue ;
337339 }
340+ // Live preview models honor the OpenAPI `parameters` field; the SDK normalizes
341+ // our lowercase JSON Schema types before sending the mutually exclusive field.
338342 const declaration : FunctionDeclaration = {
339343 name,
340344 description : tool . description ,
@@ -485,6 +489,8 @@ class GoogleRealtimeVoiceBridge implements RealtimeVoiceBridge {
485489 const canResumeSession =
486490 this . config . sessionResumption !== false && Boolean ( this . resumptionHandle ) ;
487491 if ( this . hasConnectedSession && ! canResumeSession ) {
492+ // An unfinished recognition hypothesis cannot cross into a fresh server session.
493+ // Dropping it avoids treating a transport break as a completed user utterance.
488494 this . resetPendingTranscripts ( ) ;
489495 }
490496 this . intentionallyClosed = false ;
You can’t perform that action at this time.
0 commit comments