chore: Always log api backend when connecting to live model

Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 856404282
This commit is contained in:
Xiang (Sean) Zhou
2026-01-14 16:00:15 -08:00
committed by Copybara-Service
parent 672b57f1b7
commit 7b035aa9fc
+8 -5
View File
@@ -378,6 +378,13 @@ class Gemini(BaseLlm):
types.Part.from_text(text=llm_request.config.system_instruction)
],
)
logger.info(
'Trying to connect to live model: %s with api backend: %s',
llm_request.model,
self._api_backend,
)
if (
llm_request.live_connect_config.session_resumption
and llm_request.live_connect_config.session_resumption.transparent
@@ -386,17 +393,13 @@ class Gemini(BaseLlm):
'session resumption config: %s',
llm_request.live_connect_config.session_resumption,
)
logger.debug(
'self._api_backend: %s',
self._api_backend,
)
if self._api_backend == GoogleLLMVariant.GEMINI_API:
raise ValueError(
'Transparent session resumption is only supported for Vertex AI'
' backend. Please use Vertex AI backend.'
)
llm_request.live_connect_config.tools = llm_request.config.tools
logger.info('Connecting to live for model: %s', llm_request.model)
logger.debug('Connecting to live with llm_request:%s', llm_request)
logger.debug('Live connect config: %s', llm_request.live_connect_config)
async with self._live_api_client.aio.live.connect(