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: use custom gptURL to verify key #815

Merged
merged 1 commit into from
Jun 30, 2024
Merged

Conversation

GrayXu
Copy link
Contributor

@GrayXu GrayXu commented Jun 1, 2024

No description provided.

@@ -13,29 +14,9 @@ export async function gptStatusCallback(status: boolean) {
const doc = dialog.window.document;

try {
const models = await updateGPTModel();
Copy link
Owner

Choose a reason for hiding this comment

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

Why is this removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

868acc5 has removed the model selection for custom model input. As a result, the logic of updateGPTModel() has become redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But authGPT() still requests /models to verify the availability of apiurl and key.

Perhaps by attempting a model chat request directly with limited tokens, it could provide more detailed error information. down to the model availability.
However, different providers currently have inconsistent HTTP status codes in their responses. For instance, when a model does not exist, OpenAI returns a 404, while One-API returns a 503.

@windingwind
Copy link
Owner

Thanks. Since I no longer work on Zotero 6, I won't be able to test the z6 branch. If you confirm it's OK to merge, I'll push a new stable release.

@GrayXu
Copy link
Contributor Author

GrayXu commented Jun 13, 2024

Certainly, I have been testing it on Zotero 6 for a while now.

@windingwind windingwind merged commit ecf9c74 into windingwind:z6 Jun 30, 2024
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