mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
fix(gemini realtime): redact realtime payloads from debug logs
The transform_realtime_response debug logs were dumping the raw inbound Gemini frame and each outbound OpenAI event payload (up to 500 chars). Realtime frames carry transcripts, model output, and tool-call arguments, so those strings ended up in application logs whenever DEBUG was enabled. Replace the inbound dump with just the top-level frame keys and the outbound dump with just the event type.
This commit is contained in:
parent
0e13cfabef
commit
039e86f010
1 changed files with 7 additions and 3 deletions
|
|
@ -1198,7 +1198,12 @@ class GeminiRealtimeConfig(BaseRealtimeConfig):
|
|||
raise ValueError(f"Invalid JSON message: {message_str}")
|
||||
|
||||
verbose_logger.debug(
|
||||
f"Realtime Response Transform: Gemini message={json.dumps(json_message)[:500]}"
|
||||
"Realtime Response Transform: Gemini frame keys=%s",
|
||||
(
|
||||
sorted(json_message.keys())
|
||||
if isinstance(json_message, dict)
|
||||
else type(json_message).__name__
|
||||
),
|
||||
)
|
||||
|
||||
logging_session_id = logging_obj.litellm_trace_id
|
||||
|
|
@ -1586,11 +1591,10 @@ class GeminiRealtimeConfig(BaseRealtimeConfig):
|
|||
current_item_chunks=current_item_chunks,
|
||||
)
|
||||
|
||||
# Log the transformed events
|
||||
for msg in returned_message:
|
||||
event_type = msg.get("type") if isinstance(msg, dict) else "unknown"
|
||||
verbose_logger.debug(
|
||||
f"Realtime Response Transform: OpenAI event={event_type}, data={json.dumps(msg)[:500] if isinstance(msg, dict) else str(msg)[:500]}"
|
||||
"Realtime Response Transform: OpenAI event=%s", event_type
|
||||
)
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue