olrea / openai-cpp

OpenAI C++ is a community-maintained library for the Open AI API
https://openai.com/api/
MIT License
183 stars 65 forks source link

"SSL connect error" appearing only sometimes #2

Closed Sokkero closed 1 year ago

Sokkero commented 1 year ago

Hello, when using openai::completion().create() I sometimes get "SSL connect error". This seems to be happening infrequently and seemingly randomly. Is this a problem that is happening because of heavy load of openAI or is this something I can fix/work around? I am relatively new to using c++ so I apologise in advance if this question is irrelevant to this project or if there is an obvious fix.

coin-au-carre commented 1 year ago

Thank you for your report, I do not know could you provide some code and results in order to try to reproduce your problem ?

Sokkero commented 1 year ago

I used the example code of examples/00-showcase.cpp. I now have altered it a bit to retry with a delay of 500ms when this SSL error appears for a maximum of 10 times. Seems to be working this way

coin-au-carre commented 1 year ago

Could you copy paste the exact error if it happens again ? I will try to investigate this.

coin-au-carre commented 1 year ago

@Sokkernr1 this PR should solve this issue https://github.com/olrea/openai-cpp/pull/15. If you try from master branch we should not have this problem anymore. I will close this issue feel free to reopen it (or create another one) if needed.