Closed iamved777 closed 1 year ago
Hi, @iamved777 did you managed to fix the issue? Im having the same, mine its dying after 30s. Thanks in advance.
@StarterES-sgaleano I am still facing same issue, I think No one interested in solve the issue or share the solution. Still waiting for someone to help us. Thanks!
@iamved777 , im sure that you maybe already knew about this, but in the config file there its a Key for the time out, maybe if you can manage to increase it from there it helps?
Hey guys, This is not a library issues, but correct behaviour due to the OpenAI's API not returning data within the specified timeout limit set, e.g. 90 seconds as per the code
->withHttpClient(new \GuzzleHttp\Client(['timeout' => 90, 'connect_timeout' => 90]))
You need to manage this when any other API endpoint, and retry, or fail etc, based on your specific use case.
Personally I have a 240 second timeout - but many times its better to keep it short (e.g. default 30 secs) and simply retry.
Agree to @chrisrickard
Hi! There no any solution provided in any reply and just closed without proper resolution. Since curl is getting used by OPENAI, we have to use some method to catch error.
@chrisrickard is saying to retry, but how we can know that error occured and so we need to retry? any example? Thanks!
Hi! I am using API like this
Its working fine but sometime I am getting curl error like this and I am not able to handle it.
PHP Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 28: Operation timed out after 90000 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.openai.com/v1/chat/completions in /home/user/public_html/mydomains/crons/5/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:210
Let me know if anyone here can help me for solve the issue.
Thanks!