Skip to content

Commit 0826755

Browse files
hangfeicopybara-github
authored andcommitted
chore: Stop logging the full content of LLM blobs
The blob content is often large and binary, which makes the logs unreadable and can cause excessive logging. Co-authored-by: Hangfei Lin <hangfei@google.com> PiperOrigin-RevId: 828523413
1 parent aa77834 commit 0826755

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/google/adk/models/gemini_llm_connection.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,14 @@ async def send_realtime(self, input: RealtimeInput):
105105
"""
106106
if isinstance(input, types.Blob):
107107
input_blob = input.model_dump()
108-
logger.debug('Sending LLM Blob: %s', input_blob)
108+
# The blob is binary and is very large. So let's not log it.
109+
logger.debug('Sending LLM Blob.')
109110
await self._gemini_session.send(input=input_blob)
110111
elif isinstance(input, types.ActivityStart):
111-
logger.debug('Sending LLM activity start signal')
112+
logger.debug('Sending LLM activity start signal.')
112113
await self._gemini_session.send_realtime_input(activity_start=input)
113114
elif isinstance(input, types.ActivityEnd):
114-
logger.debug('Sending LLM activity end signal')
115+
logger.debug('Sending LLM activity end signal.')
115116
await self._gemini_session.send_realtime_input(activity_end=input)
116117
else:
117118
raise ValueError('Unsupported input type: %s' % type(input))

0 commit comments

Comments
 (0)