feat: add tool call support for moonshot models

This commit is contained in:
QiuYang Shen 2025-07-28 11:39:17 +08:00
parent cab9ce70e0
commit 125a7d795f
2 changed files with 17 additions and 0 deletions

View file

@ -188,6 +188,7 @@ function autodetectTemplateType(model: string): TemplateType | undefined {
lower.includes("gemini") ||
lower.includes("grok") ||
lower.includes("moonshot") ||
lower.includes("kimi") ||
lower.includes("mercury") ||
/^o\d/.test(lower)
) {

View file

@ -285,6 +285,22 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
}
}
return false;
},
moonshot: (model) => {
// support moonshot models
// https://platform.moonshot.ai/docs/pricing/chat#concepts
if (
model.toLowerCase().startsWith("kimi") &&
model.toLowerCase() !== "kimi-thinking-preview"
) {
return true;
}
if (model.toLowerCase().startsWith("moonshot")) {
return true;
}
return false;
},
};