openai_ex icon indicating copy to clipboard operation
openai_ex copied to clipboard

Improve non-interactive usage with more explicit error reporting / handling.

Open restlessronin opened this issue 7 months ago • 0 comments

Describe the feature or improvement you're requesting

Since the library has been designed for Livebook usage, it's primary use-case is interactive. If something doesn't work when a cell is evaluated, one can look at the returned json in the output and manually fix whatever is wrong with the request. The returned JSON is usually pretty clear about what went wrong.

This has worked well for my usage, but I'd like to support non-interactive usage for those who convert their livebook samples to libraries / apps that run non-interactively.

This might involve throwing / raising errors whenever the API returns an error message. Or returning an :error tuple (requiring a change at the point of call). My preference would be to mimic what the official python library does

Please upvote this if you this is something you need for your use case. Leave a comment if you have an opinion on how it should be handled.

restlessronin avatar Nov 23 '23 14:11 restlessronin