mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-18 18:50:49 +08:00
fix(providers): use /chat/completions for OpenAI test requests
This commit is contained in:
@@ -55,7 +55,10 @@ export const buildOpenAIChatCompletionsEndpoint = (baseUrl: string): string => {
|
|||||||
if (trimmed.endsWith('/chat/completions')) {
|
if (trimmed.endsWith('/chat/completions')) {
|
||||||
return trimmed;
|
return trimmed;
|
||||||
}
|
}
|
||||||
return trimmed.endsWith('/v1') ? `${trimmed}/chat/completions` : `${trimmed}/v1/chat/completions`;
|
if (trimmed.endsWith('/v1')) {
|
||||||
|
return `${trimmed.slice(0, -3)}/chat/completions`;
|
||||||
|
}
|
||||||
|
return `${trimmed}/chat/completions`;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 根据 source (apiKey) 获取统计数据 - 与旧版逻辑一致
|
// 根据 source (apiKey) 获取统计数据 - 与旧版逻辑一致
|
||||||
|
|||||||
@@ -316,7 +316,7 @@
|
|||||||
"openai_keys_count": "Keys Count",
|
"openai_keys_count": "Keys Count",
|
||||||
"openai_models_count": "Models Count",
|
"openai_models_count": "Models Count",
|
||||||
"openai_test_title": "Connection Test",
|
"openai_test_title": "Connection Test",
|
||||||
"openai_test_hint": "Send a /v1/chat/completions request with the current settings to verify availability.",
|
"openai_test_hint": "Send a /chat/completions request with the current settings to verify availability.",
|
||||||
"openai_test_model_placeholder": "Model to test",
|
"openai_test_model_placeholder": "Model to test",
|
||||||
"openai_test_action": "Run Test",
|
"openai_test_action": "Run Test",
|
||||||
"openai_test_running": "Sending test request...",
|
"openai_test_running": "Sending test request...",
|
||||||
|
|||||||
@@ -316,7 +316,7 @@
|
|||||||
"openai_keys_count": "密钥数量",
|
"openai_keys_count": "密钥数量",
|
||||||
"openai_models_count": "模型数量",
|
"openai_models_count": "模型数量",
|
||||||
"openai_test_title": "连通性测试",
|
"openai_test_title": "连通性测试",
|
||||||
"openai_test_hint": "使用当前配置向 /v1/chat/completions 请求,验证是否可用。",
|
"openai_test_hint": "使用当前配置向 /chat/completions 请求,验证是否可用。",
|
||||||
"openai_test_model_placeholder": "选择或输入要测试的模型",
|
"openai_test_model_placeholder": "选择或输入要测试的模型",
|
||||||
"openai_test_action": "发送测试",
|
"openai_test_action": "发送测试",
|
||||||
"openai_test_running": "正在发送测试请求...",
|
"openai_test_running": "正在发送测试请求...",
|
||||||
|
|||||||
Reference in New Issue
Block a user