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

fix: support http protocol for custom OpenAI api url #51

Merged
merged 2 commits into from Mar 7, 2024

Conversation

rookiezn
Copy link
Contributor

@rookiezn rookiezn commented Mar 6, 2024

Users might want to deploy OpenAI API service locally, in which case the HTTP protocol is usually used. But currently setting the http url will cause an error when calling the api. TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"

This PR aims to fix this issue.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello rookiezn, Thank you for your first PR contribution 🎉 rookiezn

@tisfeng
Copy link
Owner

tisfeng commented Mar 6, 2024

Thank you for your PR, I have just added the custom model option, we can use ollama for translation now.

image

@tisfeng
Copy link
Owner

tisfeng commented Mar 6, 2024

If there are no issues, I'll submit a version update to the store later.

@rookiezn
Copy link
Contributor Author

rookiezn commented Mar 6, 2024

That would be great

@tisfeng tisfeng merged commit 520a116 into tisfeng:main Mar 7, 2024
5 checks passed
"title": "OpenAI API URL",
"name": "openAIAPIURL",
"title": "OpenAI Endpoint",
"name": "openAIEndpoint",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tisfeng I just noticed you have updated name property of OpenAI API URL option. I am afraid this will cause the endpoint already set by the user to be overwritten by the default value after the update, because it is actually a new option and the old one was removed.

Copy link
Owner

Choose a reason for hiding this comment

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

Thank you reminding, I just fixed it 4907c2e

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.

None yet

2 participants