mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-25 00:42:24 +00:00
fix(moonshot): refresh kimi k2 catalog
This commit is contained in:
@@ -2,8 +2,8 @@ import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-models";
|
||||
|
||||
export const MOONSHOT_BASE_URL = "https://api.moonshot.ai/v1";
|
||||
export const MOONSHOT_DEFAULT_MODEL_ID = "kimi-k2.5";
|
||||
const MOONSHOT_DEFAULT_CONTEXT_WINDOW = 256000;
|
||||
const MOONSHOT_DEFAULT_MAX_TOKENS = 8192;
|
||||
const MOONSHOT_DEFAULT_CONTEXT_WINDOW = 262144;
|
||||
const MOONSHOT_DEFAULT_MAX_TOKENS = 262144;
|
||||
const MOONSHOT_DEFAULT_COST = {
|
||||
input: 0,
|
||||
output: 0,
|
||||
@@ -11,20 +11,49 @@ const MOONSHOT_DEFAULT_COST = {
|
||||
cacheWrite: 0,
|
||||
};
|
||||
|
||||
const MOONSHOT_MODEL_CATALOG = [
|
||||
{
|
||||
id: "kimi-k2.5",
|
||||
name: "Kimi K2.5",
|
||||
reasoning: false,
|
||||
input: ["text", "image"],
|
||||
cost: MOONSHOT_DEFAULT_COST,
|
||||
contextWindow: MOONSHOT_DEFAULT_CONTEXT_WINDOW,
|
||||
maxTokens: MOONSHOT_DEFAULT_MAX_TOKENS,
|
||||
},
|
||||
{
|
||||
id: "kimi-k2-thinking",
|
||||
name: "Kimi K2 Thinking",
|
||||
reasoning: true,
|
||||
input: ["text"],
|
||||
cost: MOONSHOT_DEFAULT_COST,
|
||||
contextWindow: 262144,
|
||||
maxTokens: 262144,
|
||||
},
|
||||
{
|
||||
id: "kimi-k2-thinking-turbo",
|
||||
name: "Kimi K2 Thinking Turbo",
|
||||
reasoning: true,
|
||||
input: ["text"],
|
||||
cost: MOONSHOT_DEFAULT_COST,
|
||||
contextWindow: 262144,
|
||||
maxTokens: 262144,
|
||||
},
|
||||
{
|
||||
id: "kimi-k2-turbo",
|
||||
name: "Kimi K2 Turbo",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: MOONSHOT_DEFAULT_COST,
|
||||
contextWindow: 256000,
|
||||
maxTokens: 16384,
|
||||
},
|
||||
] as const;
|
||||
|
||||
export function buildMoonshotProvider(): ModelProviderConfig {
|
||||
return {
|
||||
baseUrl: MOONSHOT_BASE_URL,
|
||||
api: "openai-completions",
|
||||
models: [
|
||||
{
|
||||
id: MOONSHOT_DEFAULT_MODEL_ID,
|
||||
name: "Kimi K2.5",
|
||||
reasoning: false,
|
||||
input: ["text", "image"],
|
||||
cost: MOONSHOT_DEFAULT_COST,
|
||||
contextWindow: MOONSHOT_DEFAULT_CONTEXT_WINDOW,
|
||||
maxTokens: MOONSHOT_DEFAULT_MAX_TOKENS,
|
||||
},
|
||||
],
|
||||
models: MOONSHOT_MODEL_CATALOG.map((model) => ({ ...model, input: [...model.input] })),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@ describe("moonshot implicit provider (#33637)", () => {
|
||||
reasoning: false,
|
||||
input: ["text", "image"],
|
||||
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
||||
contextWindow: 256000,
|
||||
maxTokens: 8192,
|
||||
contextWindow: 262144,
|
||||
maxTokens: 262144,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -80,6 +80,14 @@ describe("moonshot implicit provider (#33637)", () => {
|
||||
const providers = await resolveImplicitProvidersForTest({ agentDir });
|
||||
expect(providers?.moonshot).toBeDefined();
|
||||
expect(providers?.moonshot?.baseUrl).toBe(MOONSHOT_AI_BASE_URL);
|
||||
expect(providers?.moonshot?.models).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({ id: "kimi-k2.5", input: ["text", "image"] }),
|
||||
expect.objectContaining({ id: "kimi-k2-thinking", reasoning: true }),
|
||||
expect.objectContaining({ id: "kimi-k2-thinking-turbo", reasoning: true }),
|
||||
expect.objectContaining({ id: "kimi-k2-turbo", reasoning: false }),
|
||||
]),
|
||||
);
|
||||
expect(providers?.moonshot?.models?.[0]?.compat?.supportsUsageInStreaming).toBeUndefined();
|
||||
} finally {
|
||||
envSnapshot.restore();
|
||||
|
||||
@@ -106,8 +106,8 @@ const MOONSHOT_BASE_URL = "https://api.moonshot.ai/v1";
|
||||
const MOONSHOT_CN_BASE_URL = "https://api.moonshot.cn/v1";
|
||||
const MOONSHOT_DEFAULT_MODEL_ID = "kimi-k2.5";
|
||||
const MOONSHOT_DEFAULT_MODEL_REF = `moonshot/${MOONSHOT_DEFAULT_MODEL_ID}`;
|
||||
const MOONSHOT_DEFAULT_CONTEXT_WINDOW = 256000;
|
||||
const MOONSHOT_DEFAULT_MAX_TOKENS = 8192;
|
||||
const MOONSHOT_DEFAULT_CONTEXT_WINDOW = 262144;
|
||||
const MOONSHOT_DEFAULT_MAX_TOKENS = 262144;
|
||||
const MOONSHOT_DEFAULT_COST = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
|
||||
|
||||
const QIANFAN_BASE_URL = "https://qianfan.baidubce.com/v2";
|
||||
|
||||
Reference in New Issue
Block a user