mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix current_attempt, num_retries not defined
This commit is contained in:
parent
a485b19215
commit
728fead32c
1 changed files with 5 additions and 0 deletions
|
@ -1972,6 +1972,8 @@ class Router:
|
||||||
response = await original_function(*args, **kwargs)
|
response = await original_function(*args, **kwargs)
|
||||||
return response
|
return response
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
num_retries = None
|
||||||
|
current_attempt = None
|
||||||
original_exception = e
|
original_exception = e
|
||||||
"""
|
"""
|
||||||
Retry Logic
|
Retry Logic
|
||||||
|
@ -2245,6 +2247,8 @@ class Router:
|
||||||
response = original_function(*args, **kwargs)
|
response = original_function(*args, **kwargs)
|
||||||
return response
|
return response
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
num_retries = None
|
||||||
|
current_attempt = None
|
||||||
original_exception = e
|
original_exception = e
|
||||||
### CHECK IF RATE LIMIT / CONTEXT WINDOW ERROR
|
### CHECK IF RATE LIMIT / CONTEXT WINDOW ERROR
|
||||||
_healthy_deployments = self._get_healthy_deployments(
|
_healthy_deployments = self._get_healthy_deployments(
|
||||||
|
@ -2299,6 +2303,7 @@ class Router:
|
||||||
if type(original_exception) in litellm.LITELLM_EXCEPTION_TYPES:
|
if type(original_exception) in litellm.LITELLM_EXCEPTION_TYPES:
|
||||||
original_exception.max_retries = num_retries
|
original_exception.max_retries = num_retries
|
||||||
original_exception.num_retries = current_attempt
|
original_exception.num_retries = current_attempt
|
||||||
|
|
||||||
raise original_exception
|
raise original_exception
|
||||||
|
|
||||||
### HELPER FUNCTIONS
|
### HELPER FUNCTIONS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue