openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

Additional ClientTimeout parameter support on async API calls - sock_read, sock_connect

Open suhjohn opened this issue 1 year ago • 0 comments

Describe the feature or improvement you're requesting

Want a logic to retry API if sock_read on stream is not working in <2 seconds. Sometimes this happens on a web-server due to various issues with the requesting library (requests.request / aiohttp). Currently only

            timeout = aiohttp.ClientTimeout(
                connect=request_timeout[0],
                total=request_timeout[1],
            )

is supported. Perhaps accepting additional lengths on request_timeout, or adding a new kwarg for timeout object, or accepting a dictionary instead a tuple on request_timeout would be helpful.

Additional context

No response

suhjohn avatar Mar 23 '23 17:03 suhjohn