mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-26 01:34:51 +08:00
fix(provider): pin models URL for JieKou and Novita Claude presets
Both serve the Anthropic-compatible API under /anthropic but expose the OpenAI-compatible model list under /openai/v1. The candidates derived from the base URL (/anthropic/v1/models, and /v1/models and /models at the stripped root) all return 404, so "Fetch models" could never succeed for either provider. Also drop the JieKou assertion that pinned the absent modelsUrl, which locked the broken behaviour in.
This commit is contained in:
1 parent
ccc140a2c0
commit
648d89cd7b
2 files changed
+7
-1
No files matched your search
@@ -1566,6 +1566,9 @@ export const providerPresets: ProviderPreset[] = [
|
||||
},
|
||||
category: "aggregator",
|
||||
endpointCandidates: ["https://api.novita.ai/anthropic"],
|
||||
// Anthropic 兼容层在 /anthropic 子路径,OpenAI 侧却在 /openai/v1;剥后缀
|
||||
// 后的根路径没有 /models(实测 404),通用候选够不到,故覆写
|
||||
modelsUrl: "https://api.novita.ai/openai/v1/models",
|
||||
icon: "novita",
|
||||
iconColor: "#000000",
|
||||
},
|
||||
@@ -1794,6 +1797,9 @@ export const providerPresets: ProviderPreset[] = [
|
||||
},
|
||||
category: "aggregator",
|
||||
endpointCandidates: ["https://api.jiekou.ai/anthropic"],
|
||||
// 同 Novita:Anthropic 在 /anthropic、OpenAI 在 /openai/v1,根路径无
|
||||
// /models(实测 404),通用候选够不到,故覆写
|
||||
modelsUrl: "https://api.jiekou.ai/openai/v1/models",
|
||||
icon: "jiekou",
|
||||
iconColor: "#000000",
|
||||
},
|
||||
|
||||
@@ -58,8 +58,8 @@ describe("JieKou AI provider presets", () => {
|
||||
},
|
||||
},
|
||||
endpointCandidates: [anthropicBaseUrl],
|
||||
modelsUrl: `${openAiBaseUrl}/models`,
|
||||
});
|
||||
expect(preset).not.toHaveProperty("modelsUrl");
|
||||
});
|
||||
|
||||
it("configures Claude Desktop with the Anthropic endpoint", () => {
|
||||
|
||||
Reference in new issue
Block a user