lancecarlson/openai.cr

[feature request] Allow changing BASE_URI for OpenAI::Client

Opened this issue · 3 comments

First of all, thank you for this very useful library (for those who prefer Crystal to Python).

The goal of this feature request is to enable the use of OpenAI alternatives that use a similar API, such as https://github.com/go-skynet/LocalAI.

Current status : BASE_URI is a constant in OpenAI::Client and cannot be configured (inheritance in Crystal does not seem to allow rewriting the constants).

a PR with this feature is opened #4

@glenux Can you check to see if this PR works for you? If it does, I'll merge it

First of all, thanks for the fix. From the code it looks like what I needed. 🙏

I don't have a chance to test with LocalAI and in good conditions for the next few days, but I'll let you know mid-December.