From d68499d91618aab0735ea36f35b21bc3eaa982da Mon Sep 17 00:00:00 2001 From: Siraj637909 Date: Fri, 14 Aug 2026 20:16:14 +0530 Subject: [PATCH] get_retry_from_policy.py --- litellm/router_utils/get_retry_from_policy.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/litellm/router_utils/get_retry_from_policy.py b/litellm/router_utils/get_retry_from_policy.py index 7cf55e80e0c..3496e7fce81 100644 --- a/litellm/router_utils/get_retry_from_policy.py +++ b/litellm/router_utils/get_retry_from_policy.py @@ -8,6 +8,7 @@ from litellm.exceptions import ( AuthenticationError, BadRequestError, ContentPolicyViolationError, + NotFoundError, RateLimitError, Timeout, ) @@ -26,6 +27,7 @@ def get_num_retries_from_retry_policy( TimeoutErrorRetries: Optional[int] = None RateLimitErrorRetries: Optional[int] = None ContentPolicyViolationErrorRetries: Optional[int] = None + NotFoundErrorRetries: Optional[int] = None """ # if we can find the exception then in the retry policy -> return the number of retries @@ -50,6 +52,8 @@ def get_num_retries_from_retry_policy( return retry_policy.ContentPolicyViolationErrorRetries if isinstance(exception, BadRequestError) and retry_policy.BadRequestErrorRetries is not None: return retry_policy.BadRequestErrorRetries + if isinstance(exception, NotFoundError) and retry_policy.NotFoundErrorRetries is not None: + return retry_policy.NotFoundErrorRetries def reset_retry_policy() -> RetryPolicy: