Closed bks5881 closed 1 month ago
Hi, thanks for raising this issue. You can do:
OpenAI openAI = OpenAI.newBuilder(apiKey).baseUrl("http://localhost:8080").build();
And it will initialize with a custom url and also all endpoints accept passing the model as a String
. Is there any other functionality that is missing?
Hi @bks5881 is the above example enough for your use case?
@StefanBratanov thanks. Is the error handler only for streaming or I can have personal error handlers for syncronous calls as well?
No worries, all methods throw OpenAIException
in case an error happens when calling the API, so you can catch it.
Will close this issue for now. Feel free to comment for any further discussion.
Just a thought, many companies are hosting their own versions of "Chat" where the url and model name changes. Would be helpful to have that feature to change them.Sometimes same url but different params.