mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
fix(guardrails): read the logged call type without an untyped attribute access
This commit is contained in:
parent
c2a12ef5a7
commit
a1361e07c1
1 changed files with 2 additions and 1 deletions
|
|
@ -98,7 +98,8 @@ def _mcp_tool_name(request_data: Mapping[str, object], logging_obj: "LiteLLMLogg
|
|||
|
||||
The logger's call type wins when there is one, because a chat client can put MCP keys in its request body.
|
||||
"""
|
||||
if logging_obj is not None and logging_obj.call_type not in MCP_GUARDRAIL_CALL_TYPES:
|
||||
logged_call_type: Final[object] = getattr(logging_obj, "call_type", None)
|
||||
if logging_obj is not None and logged_call_type not in MCP_GUARDRAIL_CALL_TYPES:
|
||||
return None
|
||||
pre_call_name: Final = request_data.get("mcp_tool_name")
|
||||
if isinstance(pre_call_name, str) and pre_call_name:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue