thmsmlr / instructor_ex

Structured outputs for LLMs in Elixir
https://hexdocs.pm/instructor
430 stars 48 forks source link

Return raw errors #55

Open seanmor5 opened 2 months ago

seanmor5 commented 2 months ago

This is just a proposal, but basically I have a reasonably complex workflow that requires a lot of calls to the OAI API. Because of this, I'm running into rate limit issues that I would like to handle by adding some retries with backoff functionality. I can just match on {:error, _}, but having the raw errors would make things a bit easier because I can handle the specific case where the API returns a rate-limit exceeded error and do the retries in that case. Thoughts?

seanmor5 commented 2 months ago

I guess I should also point out that you can control what I'm trying to do with the http_options passed to Req

armanm commented 1 month ago

+1

I would structured data to not be turned into string.