chore: Add debug logging for live connection

This CL adds debug logs to show the history being sent to the live connection and the live connect config used.

Co-authored-by: Hangfei Lin <hangfei@google.com>
PiperOrigin-RevId: 831473597
This commit is contained in:
Hangfei Lin
2025-11-12 11:36:08 -08:00
committed by Copybara-Service
parent 52b1dfea14
commit 5d5708b2ab
2 changed files with 2 additions and 0 deletions
@@ -61,6 +61,7 @@ class GeminiLlmConnection(BaseLlmConnection):
for content in history
if content.parts and content.parts[0].text
]
logger.debug('Sending history to live connection: %s', contents)
if contents:
await self._gemini_session.send(
+1
View File
@@ -288,6 +288,7 @@ class Gemini(BaseLlm):
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(
model=llm_request.model, config=llm_request.live_connect_config
) as live_session: