mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix: prevent MCP type objects from being captured in locals()
This commit is contained in:
parent
0db6229b63
commit
9d173ba4fe
1 changed files with 3 additions and 2 deletions
|
|
@ -1095,6 +1095,9 @@ def completion( # type: ignore # noqa: PLR0915
|
|||
# validate tool_choice
|
||||
tool_choice = validate_chat_completion_tool_choice(tool_choice=tool_choice)
|
||||
|
||||
######### unpacking kwargs #####################
|
||||
args = locals()
|
||||
|
||||
skip_mcp_handler = kwargs.pop("_skip_mcp_handler", False)
|
||||
if not skip_mcp_handler and tools:
|
||||
from litellm.responses.mcp.chat_completions_handler import (
|
||||
|
|
@ -1154,8 +1157,6 @@ def completion( # type: ignore # noqa: PLR0915
|
|||
shared_session=shared_session,
|
||||
**kwargs,
|
||||
)
|
||||
######### unpacking kwargs #####################
|
||||
args = locals()
|
||||
api_base = kwargs.get("api_base", None)
|
||||
mock_response: Optional[MOCK_RESPONSE_TYPE] = kwargs.get("mock_response", None)
|
||||
mock_tool_calls = kwargs.get("mock_tool_calls", None)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue