Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(test_function_call_parsing.py): handle anthropic internal server error

Krrish Dholakiae32d4a15b2ed
diff --git a/litellm/tests/test_function_call_parsing.py b/litellm/tests/test_function_call_parsing.py
index fab9cf110c9..98c3af4abe6 100644
--- a/litellm/tests/test_function_call_parsing.py
+++ b/litellm/tests/test_function_call_parsing.py
@@ -134,11 +134,11 @@ def trade(model_name: str) -> List[Trade]:
"function": {"name": tool_spec["function"]["name"]}, # type: ignore
},
)
+ calls = response.choices[0].message.tool_calls
+ trades = [trade for call in calls for trade in parse_call(call)]
+ return trades
except litellm.InternalServerError:
pass
- calls = response.choices[0].message.tool_calls
- trades = [trade for call in calls for trade in parse_call(call)]
- return trades
@pytest.mark.parametrize(