Skip to content

feat(service): add OpenAI completions models output probe#97

Merged
sheepbox8646 merged 2 commits into
memohai:mainfrom
MoYoez:main
Feb 23, 2026
Merged

feat(service): add OpenAI completions models output probe#97
sheepbox8646 merged 2 commits into
memohai:mainfrom
MoYoez:main

Conversation

@MoYoez

@MoYoez MoYoez commented Feb 22, 2026

Copy link
Copy Markdown
Contributor
Screenshot 2026-02-22 at 15 51 02

一些国内的大模型可以使用,但是测试链接的时候会显示Unsupported

添加一个 Models 列表检查以用于判断

image

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds a new probe to test the OpenAI-compatible /models endpoint for LLM providers. The feature addresses an issue where some domestic Chinese LLM providers that support OpenAI-compatible APIs would show as "Unsupported" during connection testing. By adding a probe that checks the /models endpoint, the system can now better identify providers that support OpenAI-compatible APIs even if they don't support all other endpoints.

Changes:

  • Added backend probe function probeOpenAICompletionsModelsOutput to test the /models endpoint with OpenAI-style authentication
  • Updated the provider test response to include 6 checks instead of 5
  • Added UI display for the new "OpenAI Completions Models" check result in the provider form
  • Added translations for the new check in both English and Chinese locales

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
internal/providers/service.go Added new probe function and integrated it into the concurrent probe execution flow
packages/web/src/pages/models/components/provider-form.vue Added UI display for the new "openai-completions-models-output" check result
packages/web/src/i18n/locales/zh.json Added Chinese translation for "OpenAI Completions Models"
packages/web/src/i18n/locales/en.json Added English translation for "OpenAI Completions Models"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/providers/service.go Outdated
Comment thread internal/providers/service.go Outdated
return probeEndpoint(ctx, http.MethodGet, baseURL+"/models",
map[string]string{
"Authorization": "Bearer " + apiKey,
"Content-Type": "application/json",

Copilot AI Feb 22, 2026

Copy link

Choose a reason for hiding this comment

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

The Content-Type header is unnecessary for a GET request with no body. Other probe functions that make GET requests (like probeGoogleGenerativeAI on line 288) don't include this header. For consistency with the existing codebase pattern, consider removing the Content-Type header from the headers map.

Suggested change
"Content-Type": "application/json",

Copilot uses AI. Check for mistakes.
@sheepbox8646

Copy link
Copy Markdown
Member

也许有更优雅的方式来兼容检测这些api?

@MoYoez

MoYoez commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

也许有更优雅的方式来兼容检测这些api?

我目前看到的文档和测试结果表明,模型错误和没带apikey是一样的401报错,文档里面也没有相关probe的资料

这些服务商大多都是openai类型兼容的,可以用输出model变相测试是否正确,算是一种参考手段。

@sheepbox8646

Copy link
Copy Markdown
Member

也许有更优雅的方式来兼容检测这些api?

我目前看到的文档和测试结果表明,模型错误和没带apikey是一样的401报错,文档里面也没有相关probe的资料

这些服务商大多都是openai类型兼容的,可以用输出model变相测试是否正确,算是一种参考手段。

可以改一下现有的openai completion检测方法,使用获取model检测

@sheepbox8646 sheepbox8646 self-requested a review February 23, 2026 15:30
@MoYoez

MoYoez commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

也许有更优雅的方式来兼容检测这些api?

我目前看到的文档和测试结果表明,模型错误和没带apikey是一样的401报错,文档里面也没有相关probe的资料
这些服务商大多都是openai类型兼容的,可以用输出model变相测试是否正确,算是一种参考手段。

可以改一下现有的openai completion检测方法,使用获取model检测

已修改/

@sheepbox8646 sheepbox8646 merged commit 786959f into memohai:main Feb 23, 2026
Fodesu pushed a commit to Fodesu/Memoh that referenced this pull request Feb 24, 2026
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