mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
Make sure every mode is logged correctly
This commit is contained in:
parent
7ebcee7581
commit
c70bbbe583
1 changed files with 11 additions and 1 deletions
|
|
@ -70,6 +70,7 @@ _RATIONALE_TRUNCATE_CHARS = 200
|
|||
_DEFAULT_POLICIES = [
|
||||
"Default_Policy_SystemPromptEnforcement",
|
||||
"Default_Policy_HarmfulContentProtection",
|
||||
"Default_Policy_GeneralPromptAttackProtection",
|
||||
]
|
||||
|
||||
|
||||
|
|
@ -207,6 +208,15 @@ class XecGuardGuardrail(CustomGuardrail):
|
|||
StandardLoggingGuardrailInformation entry so the scan decision
|
||||
reaches downstream loggers (Langfuse, DataDog, etc.).
|
||||
"""
|
||||
if (
|
||||
isinstance(kwargs, dict)
|
||||
and "litellm_params" in kwargs
|
||||
and "metadata" in kwargs["litellm_params"]
|
||||
and "standard_logging_guardrail_information"in kwargs["litellm_params"]["metadata"]
|
||||
and kwargs["litellm_params"]["metadata"]["standard_logging_guardrail_information"]
|
||||
):
|
||||
return kwargs, result
|
||||
|
||||
start_time = datetime.now()
|
||||
try:
|
||||
assistant_text = self._extract_assistant_text_from_response(result)
|
||||
|
|
@ -575,4 +585,4 @@ class XecGuardGuardrail(CustomGuardrail):
|
|||
return (
|
||||
f"Blocked by XecGuard grounding: rules=[{rules_str}] "
|
||||
f"trace_id={trace_id} rationale={rationale}"
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Reference in a new issue