We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is your feature request related to a problem? Please describe. Right, it's pretty nice we can init a OpenAI with custom host, like
let openAI = OpenAI(configuration: OpenAI.Configuration( token: "sk-xxx", organizationIdentifier: "org-xxx", host: "api.myhost", timeoutInterval: 60.0) )
It would even move better enabling a basePath like this,
let openAI = OpenAI(configuration: OpenAI.Configuration( token: "sk-xxx", organizationIdentifier: "org-xxx", host: "api.myhost", basePath: "/openai/api", timeoutInterval: 60.0) )
Since most of the time we have multiple endpoints for a host.
Describe the solution you'd like
It will be a simple changes on the current implementation actually.
public init( token: String, organizationIdentifier: String? = nil, host: String = "api.openai.com", basePath: String? = "", timeoutInterval: TimeInterval = 60.0 ) { self.token = token self.organizationIdentifier = organizationIdentifier self.host = host self.basePath = basePath ?? "" self.timeoutInterval = timeoutInterval } .... extension OpenAI { func buildURL(path: String) -> URL { var components = URLComponents() components.scheme = "https" components.host = configuration.host components.path = self.configuration.basePath + path return components.url! } }
If it's an acceptable changes, I can draft a PR.
Describe alternatives you've considered None.
Additional context None.
The text was updated successfully, but these errors were encountered:
It makes sense to me; would the basePath solution also solve #61?
Sorry, something went wrong.
Cool, a PR drafted, please help review it.
Hey @SunburstEnzo , could you help review it? thanks a lot.
No branches or pull requests
Is your feature request related to a problem? Please describe.
Right, it's pretty nice we can init a OpenAI with custom host, like
It would even move better enabling a basePath like this,
Since most of the time we have multiple endpoints for a host.
Describe the solution you'd like
It will be a simple changes on the current implementation actually.
If it's an acceptable changes, I can draft a PR.
Describe alternatives you've considered
None.
Additional context
None.
The text was updated successfully, but these errors were encountered: