@@ -50,7 +50,7 @@ def __init__(
5050 self ._output_transcription_text : str = ''
5151 self ._api_backend = api_backend
5252 self ._model_version = model_version
53- self ._is_gemini_3_1_flash_live = model_name_utils .is_gemini_3_1_flash_live (
53+ self ._is_gemini_3_x_live = model_name_utils ._is_gemini_3_x_live (
5454 model_version
5555 )
5656 self ._is_gemini_3_5_live_translate = (
@@ -115,11 +115,11 @@ async def send_content(self, content: types.Content):
115115 else :
116116 logger .debug ('Sending LLM new content %s' , content )
117117 if (
118- self ._is_gemini_3_1_flash_live
118+ self ._is_gemini_3_x_live
119119 and len (content .parts ) == 1
120120 and content .parts [0 ].text
121121 ):
122- logger .debug ('Using send_realtime_input for Gemini 3.1 text input' )
122+ logger .debug ('Using send_realtime_input for Gemini 3.x Live text input' )
123123 await self ._gemini_session .send_realtime_input (
124124 text = content .parts [0 ].text
125125 )
@@ -140,7 +140,7 @@ async def send_realtime(self, input: RealtimeInput):
140140 if isinstance (input , types .Blob ):
141141 # The blob is binary and is very large. So let's not log it.
142142 logger .debug ('Sending LLM Blob.' )
143- if self ._is_gemini_3_1_flash_live or self ._is_gemini_3_5_live_translate :
143+ if self ._is_gemini_3_x_live or self ._is_gemini_3_5_live_translate :
144144 if input .mime_type and input .mime_type .startswith ('audio/' ):
145145 await self ._gemini_session .send_realtime_input (audio = input )
146146 elif input .mime_type and input .mime_type .startswith ('image/' ):
@@ -362,9 +362,9 @@ async def receive(self) -> AsyncGenerator[LlmResponse, None]:
362362 # generation_complete, causing transcription to appear after
363363 # tool_call in the session log.
364364 if message .server_content .input_transcription :
365- # Gemini 3.1 Flash Live only sends a single final input
365+ # Gemini 3.x Live only sends a single final input
366366 # transcription
367- if self ._is_gemini_3_1_flash_live :
367+ if self ._is_gemini_3_x_live :
368368 if message .server_content .input_transcription .text :
369369 yield LlmResponse (
370370 input_transcription = types .Transcription (
@@ -464,7 +464,7 @@ async def receive(self) -> AsyncGenerator[LlmResponse, None]:
464464 or last_grounding_metadata
465465 or (
466466 types .GroundingMetadata ()
467- if self ._is_gemini_3_1_flash_live
467+ if self ._is_gemini_3_x_live
468468 else None
469469 )
470470 )
@@ -512,7 +512,7 @@ async def receive(self) -> AsyncGenerator[LlmResponse, None]:
512512 or last_grounding_metadata
513513 or (
514514 types .GroundingMetadata ()
515- if self ._is_gemini_3_1_flash_live
515+ if self ._is_gemini_3_x_live
516516 else None
517517 ),
518518 model_version = self ._model_version ,
@@ -559,17 +559,17 @@ async def receive(self) -> AsyncGenerator[LlmResponse, None]:
559559 types .Part (function_call = function_call )
560560 for function_call in message .tool_call .function_calls
561561 ])
562- if not self ._is_gemini_3_1_flash_live :
562+ if not self ._is_gemini_3_x_live :
563563 if tool_call_metadata is None :
564564 tool_call_metadata = last_grounding_metadata
565- # Gemini 3.1 does not emit turn_complete until it receives the
565+ # Gemini 3.x Live does not emit turn_complete until it receives the
566566 # tool response, so yield tool calls immediately to avoid
567567 # deadlocking the conversation. Other models (e.g. 2.5-pro,
568568 # native-audio) send turn_complete after tool calls, so buffer
569569 # and merge them into a single response at turn_complete.
570- if self ._is_gemini_3_1_flash_live and tool_call_parts :
570+ if self ._is_gemini_3_x_live and tool_call_parts :
571571 logger .debug (
572- 'Yielding tool_call_parts immediately for Gemini 3.1 live tool'
572+ 'Yielding tool_call_parts immediately for Gemini 3.x live tool'
573573 ' call'
574574 )
575575 yield LlmResponse (
0 commit comments