Commit 041bf5a8

Vik Goel <vikash.a.goel@gmail.com>
2023-06-17 00:53:37
catch asyncio.TimeoutError in _interpret_async_response (#180) (#489)
1 parent 7610c5a
Changed files (1)
openai/api_requestor.py
@@ -720,6 +720,8 @@ class APIRequestor:
         else:
             try:
                 await result.read()
+            except (aiohttp.ServerTimeoutError, asyncio.TimeoutError) as e:
+                raise error.Timeout("Request timed out") from e
             except aiohttp.ClientError as e:
                 util.log_warn(e, body=result.content)
             return (