mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 20:35:00 +00:00
fix: Update test_exceptions.py to provide required arguments for litellm exceptions
This commit is contained in:
parent
86d9275375
commit
c472e6e160
1 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ def test_get_ex_info():
|
|||
# Test with a known exception type
|
||||
from litellm import AuthenticationError
|
||||
|
||||
auth_error = AuthenticationError()
|
||||
auth_error = AuthenticationError(message="Invalid API key", llm_provider="openai", model="gpt-4")
|
||||
ex_info = ex.get_ex_info(auth_error)
|
||||
assert isinstance(ex_info, ExInfo)
|
||||
assert ex_info.name == "AuthenticationError"
|
||||
|
@ -45,7 +45,7 @@ def test_rate_limit_error():
|
|||
ex = LiteLLMExceptions()
|
||||
from litellm import RateLimitError
|
||||
|
||||
rate_error = RateLimitError()
|
||||
rate_error = RateLimitError(message="Rate limit exceeded", llm_provider="openai", model="gpt-4")
|
||||
ex_info = ex.get_ex_info(rate_error)
|
||||
assert ex_info.retry is True
|
||||
assert "rate limited" in ex_info.description.lower()
|
||||
|
@ -56,6 +56,6 @@ def test_context_window_error():
|
|||
ex = LiteLLMExceptions()
|
||||
from litellm import ContextWindowExceededError
|
||||
|
||||
ctx_error = ContextWindowExceededError()
|
||||
ctx_error = ContextWindowExceededError(message="Context length exceeded", model="gpt-4", llm_provider="openai")
|
||||
ex_info = ex.get_ex_info(ctx_error)
|
||||
assert ex_info.retry is False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue