mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
Add fallback message when blocking service returns empty explanation
Prevents whitespace-only violation message when the tool blocking service blocks tools but returns an empty content field. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fe47a37c9c
commit
d2d6e6f22a
1 changed files with 2 additions and 1 deletions
|
|
@ -453,7 +453,8 @@ class RubrikLogger(CustomGuardrail, CustomBatchLogger):
|
|||
if len(allowed_tools) == len(all_tool_calls):
|
||||
return None
|
||||
|
||||
explanation = blocking_explanation or "Tool call blocked by policy."
|
||||
return BlockedToolsResult(
|
||||
allowed_tools=allowed_tools,
|
||||
explanation=f"\n\n{blocking_explanation}",
|
||||
explanation=f"\n\n{explanation}",
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue