Skip to content
New issue

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

Support custom base url #80

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

le0zh0u
Copy link
Contributor

@le0zh0u le0zh0u commented Apr 20, 2023

This PR adds support for custom base url. You can pass custom base url when OpenAISwift creating.

Change point

  • add baseURL in OpenAISwift
  • update baseURL setting in prepareRequest

@astrokin
Copy link
Contributor

astrokin commented May 4, 2023

have the same here too #81

return URL(string: baseURL)!
}

return URL(string: endpoint.baseURL())!
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do better with the force unwrapping like throw an assertion to the client?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to look like https://api.openai.com. If not, throws an assertion error to let user know?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants