irudnyts/openai

connection timeout

Opened this issue · 9 comments

What should I do for this?
Error in curl::curl_fetch_memory(url, handle = handle) :
Timeout was reached: [api.openai.com] Connection timeout after 10007 ms

@Links996 It seems to be a problem on the server side. Can you please provide a minimal reproducible example? Thanks!

@irudnyts , similar issue here.
image
Is it possible to set the waiting time to a larger value?
I am using the following settings:

    model = "gpt-4-turbo-preview",
    temperature = 0,
    max_tokens = NULL,

and a prompt of ~4k tokens / 15k characters. It doesn't happen every time, so maybe set a larger waiting time could be enough; anyway there are other prompts that possibly takes minutes without any issues. No error occurred with gpt-3.5-turbo! Very strange behavior.

Thank you,
Corrado.

exactly the same issue here. intermittent. even with very low / trivial usage; nothing to do with rate limits.

@CorradoLanera, you use an outdated version. Please use the following code:

remotes::install_github("irudnyts/openai", ref = "r6")

library(openai)
client <- OpenAI()
completion <- client$chat$completions$create(
    model = "gpt-3.5-turbo",
    messages = list(list("role" = "user", "content" = "What's up?"))
)

@stevepowell99 Two questions: 1/ Does official Python package throws the same error? 2/ Can you please prepare a reproducible example? Thanks!

I used the updated version; tryed both the API. And forked trying to fix the issue. The issue happened in R only, with all the packages, with tirwct call using httr, or whatever other tool. It works, using the python official package through reticulate. I will prepare a reprex (the often eill reprex because the issue happend almost always, but not "always").

ps: itndoes not happen with 3.5-turbo, but only with 4/-turbo

I got the same issue with create_transcription, error as
"curl::curl_fetch_memory(url, handle = handle):
Timeout was reached: [api.openai.com] SSL/TLS connection timeout"

Is there any way to adjust the timeout in the package as the python code (However, I can't use python)

this seems to solve the issue to me. IF it works and can solve the issue, could it be added as an optional argument or hardcode a higher value (as I did 😂 😁 )?