mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
fix(anthropic): shallow-copy input_schema to prevent caller mutation (Closes #34510)
This commit is contained in:
parent
e1717c5e9c
commit
66b2e66db0
1 changed files with 3 additions and 1 deletions
|
|
@ -762,7 +762,9 @@ class LiteLLMAnthropicMessagesAdapter:
|
|||
name=truncated_name,
|
||||
)
|
||||
if "input_schema" in tool:
|
||||
function_chunk["parameters"] = tool["input_schema"]
|
||||
# Shallow-copy to avoid mutating the caller's original dict when
|
||||
# extra kwargs are merged below (see #34510).
|
||||
function_chunk["parameters"] = dict(tool["input_schema"])
|
||||
if "description" in tool:
|
||||
function_chunk["description"] = tool["description"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue