mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-04-14 16:39:54 +08:00
fix: correct opencode kimi-for-coding preset (#1738)
This commit is contained in:
@@ -453,10 +453,10 @@ export const opencodeProviderPresets: OpenCodeProviderPreset[] = [
|
|||||||
websiteUrl: "https://www.kimi.com/coding/docs/",
|
websiteUrl: "https://www.kimi.com/coding/docs/",
|
||||||
apiKeyUrl: "https://platform.moonshot.cn/console/api-keys",
|
apiKeyUrl: "https://platform.moonshot.cn/console/api-keys",
|
||||||
settingsConfig: {
|
settingsConfig: {
|
||||||
npm: "@ai-sdk/openai-compatible",
|
npm: "@ai-sdk/anthropic",
|
||||||
name: "Kimi For Coding",
|
name: "Kimi For Coding",
|
||||||
options: {
|
options: {
|
||||||
baseURL: "https://api.kimi.com/v1",
|
baseURL: "https://api.kimi.com/coding/v1",
|
||||||
apiKey: "",
|
apiKey: "",
|
||||||
setCacheKey: true,
|
setCacheKey: true,
|
||||||
},
|
},
|
||||||
@@ -470,8 +470,8 @@ export const opencodeProviderPresets: OpenCodeProviderPreset[] = [
|
|||||||
templateValues: {
|
templateValues: {
|
||||||
baseURL: {
|
baseURL: {
|
||||||
label: "Base URL",
|
label: "Base URL",
|
||||||
placeholder: "https://api.kimi.com/v1",
|
placeholder: "https://api.kimi.com/coding/v1",
|
||||||
defaultValue: "https://api.kimi.com/v1",
|
defaultValue: "https://api.kimi.com/coding/v1",
|
||||||
editorValue: "",
|
editorValue: "",
|
||||||
},
|
},
|
||||||
apiKey: {
|
apiKey: {
|
||||||
|
|||||||
@@ -65,4 +65,19 @@ describe("AWS Bedrock OpenCode Provider Presets", () => {
|
|||||||
modelIds.some((id) => id.includes("anthropic.claude")),
|
modelIds.some((id) => id.includes("anthropic.claude")),
|
||||||
).toBe(true);
|
).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("Kimi For Coding preset should use Anthropic with the coding endpoint", () => {
|
||||||
|
const kimiForCodingPreset = opencodeProviderPresets.find(
|
||||||
|
(p) => p.name === "Kimi For Coding",
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(kimiForCodingPreset).toBeDefined();
|
||||||
|
expect(kimiForCodingPreset!.settingsConfig.npm).toBe("@ai-sdk/anthropic");
|
||||||
|
expect(kimiForCodingPreset!.settingsConfig.options?.baseURL).toBe(
|
||||||
|
"https://api.kimi.com/coding/v1",
|
||||||
|
);
|
||||||
|
expect(kimiForCodingPreset!.templateValues?.baseURL.defaultValue).toBe(
|
||||||
|
"https://api.kimi.com/coding/v1",
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user