Skip to content

Commit 7b035aa

Browse files
seanzhougooglecopybara-github
authored andcommitted
chore: Always log api backend when connecting to live model
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com> PiperOrigin-RevId: 856404282
1 parent 672b57f commit 7b035aa

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/google/adk/models/google_llm.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,13 @@ async def connect(self, llm_request: LlmRequest) -> BaseLlmConnection:
378378
types.Part.from_text(text=llm_request.config.system_instruction)
379379
],
380380
)
381+
382+
logger.info(
383+
'Trying to connect to live model: %s with api backend: %s',
384+
llm_request.model,
385+
self._api_backend,
386+
)
387+
381388
if (
382389
llm_request.live_connect_config.session_resumption
383390
and llm_request.live_connect_config.session_resumption.transparent
@@ -386,17 +393,13 @@ async def connect(self, llm_request: LlmRequest) -> BaseLlmConnection:
386393
'session resumption config: %s',
387394
llm_request.live_connect_config.session_resumption,
388395
)
389-
logger.debug(
390-
'self._api_backend: %s',
391-
self._api_backend,
392-
)
396+
393397
if self._api_backend == GoogleLLMVariant.GEMINI_API:
394398
raise ValueError(
395399
'Transparent session resumption is only supported for Vertex AI'
396400
' backend. Please use Vertex AI backend.'
397401
)
398402
llm_request.live_connect_config.tools = llm_request.config.tools
399-
logger.info('Connecting to live for model: %s', llm_request.model)
400403
logger.debug('Connecting to live with llm_request:%s', llm_request)
401404
logger.debug('Live connect config: %s', llm_request.live_connect_config)
402405
async with self._live_api_client.aio.live.connect(

0 commit comments

Comments
 (0)