Commit a366120a

fzyzcjy <5236035+fzyzcjy@users.noreply.github.com>
2024-10-21 14:43:12
fix(client/async): correctly retry in all cases (#1803)
1 parent 38d87a3
Changed files (1)
src
src/openai/_base_client.py
@@ -1591,7 +1591,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
         except Exception as err:
             log.debug("Encountered Exception", exc_info=True)
 
-            if retries_taken > 0:
+            if remaining_retries > 0:
                 return await self._retry_request(
                     input_options,
                     cast_to,