fix(ai): use adaptive thinking for Kimi Coding

This commit is contained in:
Armin Ronacher
2026-07-16 20:59:54 +02:00
parent aba324504c
commit b8575f60fa
6 changed files with 51 additions and 5 deletions
+5
View File
@@ -1641,6 +1641,7 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
const normalizedId = kimiAliases.has(modelId) ? "kimi-for-coding" : modelId;
const normalizedName = kimiAliases.has(modelId) ? "Kimi For Coding" : m.name || normalizedId;
const isKimiK3 = normalizedId === "k3";
const allowEmptySignature = isKimiK3 || normalizedId === "kimi-for-coding";
models.push({
id: normalizedId,
@@ -1650,6 +1651,10 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
// Kimi For Coding's Anthropic-compatible API - SDK appends /v1/messages
baseUrl: "https://api.kimi.com/coding",
headers: { ...KIMI_STATIC_HEADERS },
compat: {
...(allowEmptySignature ? { allowEmptySignature: true } : {}),
forceAdaptiveThinking: true,
},
reasoning: isKimiK3 || m.reasoning === true,
...(isKimiK3 ? { thinkingLevelMap: KIMI_K3_THINKING_LEVEL_MAP } : {}),
input: m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"],