From e32d4a15b2eda2d7cd1a3a38966056d03dc2c431 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 5 Sep 2024 09:27:42 -0700 Subject: [PATCH] test(test_function_call_parsing.py): handle anthropic internal server error --- litellm/tests/test_function_call_parsing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(