mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(utils.py): Fix anthropic tool calling exception mapping
Fixes https://github.com/BerriAI/litellm/issues/4348
This commit is contained in:
parent
44bd9548d9
commit
5e893ed13e
2 changed files with 19 additions and 8 deletions
|
@ -724,11 +724,15 @@ def test_anthropic_tool_calling_exception():
|
|||
"function": {
|
||||
"name": "get_current_weather",
|
||||
"description": "Get the current weather in a given location",
|
||||
"parameters": {},
|
||||
},
|
||||
}
|
||||
]
|
||||
litellm.completion(
|
||||
model="claude-3.5",
|
||||
messages=[{"role": "user", "content": "Hey, how's it going?"}],
|
||||
tools=tools,
|
||||
)
|
||||
try:
|
||||
litellm.completion(
|
||||
model="claude-3-5-sonnet-20240620",
|
||||
messages=[{"role": "user", "content": "Hey, how's it going?"}],
|
||||
tools=tools,
|
||||
)
|
||||
except litellm.BadRequestError:
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue