fix: use LiteLLMExceptions class instead of undefined litellm_ex

This commit is contained in:
Paul Gauthier (aider) 2024-12-09 07:46:09 -08:00
parent 6aa80d2a4c
commit a997dd6c49

View file

@ -1563,8 +1563,8 @@ class Coder:
# Calculate costs for successful responses
self.calculate_and_show_tokens_and_cost(messages, completion)
except litellm_ex.exceptions_tuple() as err:
ex_info = litellm_ex.get_ex_info(err)
except LiteLLMExceptions().exceptions_tuple() as err:
ex_info = LiteLLMExceptions().get_ex_info(err)
if ex_info.name == "ContextWindowExceededError":
# Still calculate costs for context window errors
self.calculate_and_show_tokens_and_cost(messages, completion)