OpenAI icon indicating copy to clipboard operation
OpenAI copied to clipboard

Support for different URL scheme, port.

Open fdstevex opened this issue 1 year ago • 1 comments

The host that you supply to OpenAI.Configuration is converted into a URL by buildURL, which has the scheme hard-coded to https.

With projects like GPT4All allowing users to run a local server that provides an OpenAI-style API to a local engine, it would be useful to be able to either override the scheme and port, or supply the first part of the URL entirely ("http://localhost:4891").

fdstevex avatar Jun 09 '23 17:06 fdstevex

The OpenAI SDK lets you specify this as 'basePath':

configuration.basePath = "https://api.openai.com/v1";

fdstevex avatar Jun 11 '23 13:06 fdstevex