irudnyts / openai

An R package-wrapper around OpenAI API
https://irudnyts.github.io/openai/
Other
164 stars 28 forks source link

Timeout was reached: [api.openai.com] Failed to connect to api.openai.com port 443 #61

Open Eos-halo opened 4 months ago

Eos-halo commented 4 months ago

res <- gptcelltype(markers, model = 'gpt-4') [1] "Note: OpenAI API key found: returning the cell type annotations." Error in curl::curl_fetch_memory(url, handle = handle) : Timeout was reached: [api.openai.com] Failed to connect to api.openai.com port 443 after 10002 ms: Timeout was reached

Can anyone help me to solve the problem? Thanks a lot!

yuanG2000 commented 4 months ago

hello,i got the same problem, would you find find the solution? thanks a lot

CorradoLanera commented 4 months ago

same as in #42 , It happens to me using gpt-4/-turbo models only... and quite always. For the moment, I have solved using Python library through {reticulate}... (I was not able to solve the issue trying any package or any direct call to curl endpoint, even tuning various timeouts settings... I decide it is an issue with R, or a preference on official python libraries from openai's server side...)

Chen0907-colson commented 1 month ago

same as in #42 , It happens to me using gpt-4/-turbo models only... and quite always. For the moment, I have solved using Python library through {reticulate}... (I was not able to solve the issue trying any package or any direct call to curl endpoint, even tuning various timeouts settings... I decide it is an issue with R, or a preference on official python libraries from openai's server side...)

Hi, bro. May I know how you connect it to Python? I also cannot solve this issue...

CorradoLanera commented 1 month ago

@Chen0907-colson, you can find my solution switching to Python here (which require a configured system, I assured by https://github.com/CorradoLanera/gpteasyr/blob/main/R/setup_py.R).

Anywhay, I have found a possible solution (@irudnyts) using connecttimeout_ms (as implemented here, which solved the same issue I had for file upload).