From 8dd7e165e395178028ec4098bb03811e6410e308 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Mon, 29 Jun 2026 11:25:45 +0530 Subject: [PATCH] address greptile review feedback (greploop iteration 3) - bias_hallucination_estimator: forward remaining session routing options (on_sensitive_data, sensitive_data_route_to_model, sticky_session_routing) - gemini: use continue pattern for null text guard in _extract_audio_response_from_parts Co-Authored-By: Claude Sonnet 4.6 --- .../vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py | 4 +++- .../guardrail_hooks/bias_hallucination_estimator/__init__.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py index ff50a526b0f..5510fbfff4d 100644 --- a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py +++ b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py @@ -1542,8 +1542,10 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig): for part in parts: if "text" in part: text_content = part["text"] + if text_content is None: + continue # Check if text content contains audio data URI - if text_content is not None and text_content.startswith("data:audio") and ";base64," in text_content: + if text_content.startswith("data:audio") and ";base64," in text_content: try: if is_base64_encoded(text_content): media_type, audio_data = text_content.split("data:")[1].split(";base64,") diff --git a/litellm/proxy/guardrails/guardrail_hooks/bias_hallucination_estimator/__init__.py b/litellm/proxy/guardrails/guardrail_hooks/bias_hallucination_estimator/__init__.py index 8473cb97591..74db43ccd1f 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/bias_hallucination_estimator/__init__.py +++ b/litellm/proxy/guardrails/guardrail_hooks/bias_hallucination_estimator/__init__.py @@ -51,6 +51,9 @@ def initialize_guardrail( end_session_after_n_fails=getattr(litellm_params, "end_session_after_n_fails", None), on_violation=getattr(litellm_params, "on_violation", None), realtime_violation_message=getattr(litellm_params, "realtime_violation_message", None), + on_sensitive_data=getattr(litellm_params, "on_sensitive_data", None), + sensitive_data_route_to_model=getattr(litellm_params, "sensitive_data_route_to_model", None), + sticky_session_routing=getattr(litellm_params, "sticky_session_routing", True), ), ), )