mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
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:
parent
cf9b1031a0
commit
dd9884ef27
2 changed files with 6 additions and 1 deletions
|
|
@ -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,")
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue