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

This commit is contained in:
MoeMagicMango
2026-02-24 02:16:24 +08:00
committed by GitHub
parent 0239d395e2
commit 786959f038
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -254,12 +254,10 @@ func probeReachable(ctx context.Context, baseURL string) (bool, string) {
}
func probeOpenAICompletions(ctx context.Context, baseURL, apiKey string) CheckResult {
body := `{"model":"probe-test","messages":[{"role":"user","content":"hi"}],"max_tokens":1}`
return probeEndpoint(ctx, http.MethodPost, baseURL+"/chat/completions",
return probeEndpoint(ctx, http.MethodGet, baseURL+"/models",
map[string]string{
"Authorization": "Bearer " + apiKey,
"Content-Type": "application/json",
}, body)
}, "")
}
func probeOpenAIResponses(ctx context.Context, baseURL, apiKey string) CheckResult {