Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection timeout #42

Open
Links996 opened this issue Apr 3, 2023 · 9 comments
Open

connection timeout #42

Links996 opened this issue Apr 3, 2023 · 9 comments

Comments

@Links996
Copy link

Links996 commented Apr 3, 2023

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

@irudnyts
Copy link
Owner

irudnyts commented May 3, 2023

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

@CorradoLanera
Copy link

@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.

@stevepowell99
Copy link

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

@irudnyts
Copy link
Owner

@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?"))
)

@irudnyts
Copy link
Owner

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

@CorradoLanera
Copy link

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").

@CorradoLanera
Copy link

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

@taiwankyh
Copy link

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)

@CorradoLanera
Copy link

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 😂 😁 )?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants