cyberchitta / openai_ex

Community maintained Elixir library for OpenAI API
https://hexdocs.pm/openai_ex
Apache License 2.0
132 stars 18 forks source link

Fix #100 #101

Closed goodniceweb closed 2 months ago

goodniceweb commented 2 months ago

Context Linked issue: https://github.com/restlessronin/openai_ex/issues/100

When API experience latency and increased error rates, from time to time there is an error related closed connection happens.

Solution

  1. To fix "no function clause matching OpenaiEx.Http.Finch.to_error/2" in this commit you find an addition clause for the error building mechanism
  2. Also, there is a default function clause so other developers can can catch errors in a regular way and do not mess with the "try catch" statements.
restlessronin commented 2 months ago

@goodniceweb merged. Thank you for the PR! 🎉🎉🎉🎉