mirror of
https://fastgit.cc/github.com/openclaw/openclaw
synced 2026-04-30 14:02:56 +08:00
refactor: rename kimi coding surface to kimi
This commit is contained in:
@@ -8,40 +8,40 @@ const PROVIDER_ID = "kimi-coding";
|
||||
|
||||
const kimiCodingPlugin = {
|
||||
id: PROVIDER_ID,
|
||||
name: "Kimi Coding Provider",
|
||||
description: "Bundled Kimi Coding provider plugin",
|
||||
name: "Kimi Provider",
|
||||
description: "Bundled Kimi provider plugin",
|
||||
configSchema: emptyPluginConfigSchema(),
|
||||
register(api: OpenClawPluginApi) {
|
||||
api.registerProvider({
|
||||
id: PROVIDER_ID,
|
||||
label: "Kimi Coding",
|
||||
aliases: ["kimi-code"],
|
||||
label: "Kimi",
|
||||
aliases: ["kimi", "kimi-code"],
|
||||
docsPath: "/providers/moonshot",
|
||||
envVars: ["KIMI_API_KEY", "KIMICODE_API_KEY"],
|
||||
auth: [
|
||||
createProviderApiKeyAuthMethod({
|
||||
providerId: PROVIDER_ID,
|
||||
methodId: "api-key",
|
||||
label: "Kimi Code API key (subscription)",
|
||||
hint: "Kimi K2.5 + Kimi Coding",
|
||||
label: "Kimi API key (subscription)",
|
||||
hint: "Kimi K2.5 + Kimi",
|
||||
optionKey: "kimiCodeApiKey",
|
||||
flagName: "--kimi-code-api-key",
|
||||
envVar: "KIMI_API_KEY",
|
||||
promptMessage: "Enter Kimi Coding API key",
|
||||
promptMessage: "Enter Kimi API key",
|
||||
defaultModel: KIMI_CODING_MODEL_REF,
|
||||
expectedProviders: ["kimi-code", "kimi-coding"],
|
||||
expectedProviders: ["kimi", "kimi-code", "kimi-coding"],
|
||||
applyConfig: (cfg) => applyKimiCodeConfig(cfg),
|
||||
noteMessage: [
|
||||
"Kimi Coding uses a dedicated endpoint and API key.",
|
||||
"Kimi uses a dedicated coding endpoint and API key.",
|
||||
"Get your API key at: https://www.kimi.com/code/en",
|
||||
].join("\n"),
|
||||
noteTitle: "Kimi Coding",
|
||||
noteTitle: "Kimi",
|
||||
wizard: {
|
||||
choiceId: "kimi-code-api-key",
|
||||
choiceLabel: "Kimi Code API key (subscription)",
|
||||
choiceLabel: "Kimi API key (subscription)",
|
||||
groupId: "moonshot",
|
||||
groupLabel: "Moonshot AI (Kimi K2.5)",
|
||||
groupHint: "Kimi K2.5 + Kimi Coding",
|
||||
groupHint: "Kimi K2.5 + Kimi",
|
||||
},
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -15,7 +15,7 @@ export function applyKimiCodeProviderConfig(cfg: OpenClawConfig): OpenClawConfig
|
||||
const models = { ...cfg.agents?.defaults?.models };
|
||||
models[KIMI_CODING_MODEL_REF] = {
|
||||
...models[KIMI_CODING_MODEL_REF],
|
||||
alias: models[KIMI_CODING_MODEL_REF]?.alias ?? "Kimi for Coding",
|
||||
alias: models[KIMI_CODING_MODEL_REF]?.alias ?? "Kimi",
|
||||
};
|
||||
|
||||
const defaultModel = buildKimiCodingProvider().models[0];
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
"provider": "kimi-coding",
|
||||
"method": "api-key",
|
||||
"choiceId": "kimi-code-api-key",
|
||||
"choiceLabel": "Kimi Code API key (subscription)",
|
||||
"choiceLabel": "Kimi API key (subscription)",
|
||||
"groupId": "moonshot",
|
||||
"groupLabel": "Moonshot AI (Kimi K2.5)",
|
||||
"groupHint": "Kimi K2.5 + Kimi Coding",
|
||||
"groupHint": "Kimi K2.5 + Kimi",
|
||||
"optionKey": "kimiCodeApiKey",
|
||||
"cliFlag": "--kimi-code-api-key",
|
||||
"cliOption": "--kimi-code-api-key <key>",
|
||||
"cliDescription": "Kimi Coding API key"
|
||||
"cliDescription": "Kimi API key"
|
||||
}
|
||||
],
|
||||
"configSchema": {
|
||||
|
||||
@@ -22,7 +22,7 @@ export function buildKimiCodingProvider(): ModelProviderConfig {
|
||||
models: [
|
||||
{
|
||||
id: KIMI_CODING_DEFAULT_MODEL_ID,
|
||||
name: "Kimi for Coding",
|
||||
name: "Kimi",
|
||||
reasoning: true,
|
||||
input: ["text", "image"],
|
||||
cost: KIMI_CODING_DEFAULT_COST,
|
||||
|
||||
@@ -35,7 +35,7 @@ const moonshotPlugin = {
|
||||
providerId: PROVIDER_ID,
|
||||
methodId: "api-key",
|
||||
label: "Kimi API key (.ai)",
|
||||
hint: "Kimi K2.5 + Kimi Coding",
|
||||
hint: "Kimi K2.5 + Kimi",
|
||||
optionKey: "moonshotApiKey",
|
||||
flagName: "--moonshot-api-key",
|
||||
envVar: "MOONSHOT_API_KEY",
|
||||
@@ -48,14 +48,14 @@ const moonshotPlugin = {
|
||||
choiceLabel: "Kimi API key (.ai)",
|
||||
groupId: "moonshot",
|
||||
groupLabel: "Moonshot AI (Kimi K2.5)",
|
||||
groupHint: "Kimi K2.5 + Kimi Coding",
|
||||
groupHint: "Kimi K2.5 + Kimi",
|
||||
},
|
||||
}),
|
||||
createProviderApiKeyAuthMethod({
|
||||
providerId: PROVIDER_ID,
|
||||
methodId: "api-key-cn",
|
||||
label: "Kimi API key (.cn)",
|
||||
hint: "Kimi K2.5 + Kimi Coding",
|
||||
hint: "Kimi K2.5 + Kimi",
|
||||
optionKey: "moonshotApiKey",
|
||||
flagName: "--moonshot-api-key",
|
||||
envVar: "MOONSHOT_API_KEY",
|
||||
@@ -68,7 +68,7 @@ const moonshotPlugin = {
|
||||
choiceLabel: "Kimi API key (.cn)",
|
||||
groupId: "moonshot",
|
||||
groupLabel: "Moonshot AI (Kimi K2.5)",
|
||||
groupHint: "Kimi K2.5 + Kimi Coding",
|
||||
groupHint: "Kimi K2.5 + Kimi",
|
||||
},
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"choiceLabel": "Kimi API key (.ai)",
|
||||
"groupId": "moonshot",
|
||||
"groupLabel": "Moonshot AI (Kimi K2.5)",
|
||||
"groupHint": "Kimi K2.5 + Kimi Coding",
|
||||
"groupHint": "Kimi K2.5 + Kimi",
|
||||
"optionKey": "moonshotApiKey",
|
||||
"cliFlag": "--moonshot-api-key",
|
||||
"cliOption": "--moonshot-api-key <key>",
|
||||
@@ -25,7 +25,7 @@
|
||||
"choiceLabel": "Kimi API key (.cn)",
|
||||
"groupId": "moonshot",
|
||||
"groupLabel": "Moonshot AI (Kimi K2.5)",
|
||||
"groupHint": "Kimi K2.5 + Kimi Coding",
|
||||
"groupHint": "Kimi K2.5 + Kimi",
|
||||
"optionKey": "moonshotApiKey",
|
||||
"cliFlag": "--moonshot-api-key",
|
||||
"cliOption": "--moonshot-api-key <key>",
|
||||
|
||||
@@ -15,6 +15,9 @@ export function normalizeProviderId(provider: string): string {
|
||||
if (normalized === "kimi-code") {
|
||||
return "kimi-coding";
|
||||
}
|
||||
if (normalized === "kimi") {
|
||||
return "kimi-coding";
|
||||
}
|
||||
if (normalized === "bedrock" || normalized === "aws-bedrock") {
|
||||
return "amazon-bedrock";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user