Closed goodniceweb closed 4 months ago
@goodniceweb That sounds about right. Please submit a PR and I will merge it.
Hi @goodniceweb, could you please let me know if you are going to submit a PR? Otherwise I will add the fixes myself in a day or so.
Hi @restlessronin I'm working on the PR. Thanks for letting me know you're ok with the proposed solution
@goodniceweb Thank you for the PR!!
🎉🎉🎉🎉
@goodniceweb published at hex as v0.8.2
Describe the bug
Thank you for the great effort working on the library. It works great for my use-case. Though, I found a little bug when API experience problems and when I use Finch as a http client.
What happens
From time to time I see the error happens, that the connection is closed, especially when API experience latency and increased error rates
Source of the issue
I think the error is related to the fact that when there is an error while doing a request with Finch
https://github.com/restlessronin/openai_ex/blob/52e1dd9a8bfff4c34fe24e7bbe25255f19e97f6c/lib/openai_ex/http_finch.ex#L36
The only error we expect is the timeout error:
https://github.com/restlessronin/openai_ex/blob/52e1dd9a8bfff4c34fe24e7bbe25255f19e97f6c/lib/openai_ex/http_finch.ex#L81
There are no other function clauses.
Suggested solution
If you agree, I can work on a PR for this.
To Reproduce
Code snippets
No response
OS
macOS
Elixir version
1.15.2-otp-26
Library version
v0.8.0