address greptile review feedback (greploop iteration 2)

- bias_hallucination_estimator: forward all session options to GuardrailSessionConfig
- gemini: guard null text in _extract_audio_response_from_parts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Sameer Kankute 2026-06-29 11:12:02 +05:30
parent cf9b1031a0
commit dd9884ef27
No known key found for this signature in database
2 changed files with 6 additions and 1 deletions

View file

@ -1543,7 +1543,7 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig):
if "text" in part:
text_content = part["text"]
# Check if text content contains audio data URI
if text_content.startswith("data:audio") and ";base64," in text_content:
if text_content is not None and 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,")

View file

@ -46,6 +46,11 @@ def initialize_guardrail(
),
session=GuardrailSessionConfig(
violation_message_template=getattr(litellm_params, "violation_message_template", None),
mask_request_content=getattr(litellm_params, "mask_request_content", False),
mask_response_content=getattr(litellm_params, "mask_response_content", False),
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),
),
),
)