mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
fix(utils.py): improve coverage for anthropic exception mapping
This commit is contained in:
parent
24addd8a4f
commit
000d678445
2 changed files with 37 additions and 8 deletions
|
@ -670,7 +670,7 @@ def test_litellm_predibase_exception():
|
|||
# print(f"accuracy_score: {accuracy_score}")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("provider", ["predibase", "vertex_ai_beta"])
|
||||
@pytest.mark.parametrize("provider", ["predibase", "vertex_ai_beta", "anthropic"])
|
||||
def test_exception_mapping(provider):
|
||||
"""
|
||||
For predibase, run through a set of mock exceptions
|
||||
|
@ -712,3 +712,23 @@ def test_exception_mapping(provider):
|
|||
)
|
||||
|
||||
pass
|
||||
|
||||
|
||||
def test_anthropic_tool_calling_exception():
|
||||
"""
|
||||
Related - https://github.com/BerriAI/litellm/issues/4348
|
||||
"""
|
||||
tools = [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "get_current_weather",
|
||||
"description": "Get the current weather in a given location",
|
||||
},
|
||||
}
|
||||
]
|
||||
litellm.completion(
|
||||
model="claude-3.5",
|
||||
messages=[{"role": "user", "content": "Hey, how's it going?"}],
|
||||
tools=tools,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue