Add GLM-4.7 and Kimi K2-Instruct; fix error logging with String(e)

This commit is contained in:
Riccardo Giorato 2026-01-26 16:17:49 +01:00
parent 7d4d53366e
commit 9601b6466e
2 changed files with 26 additions and 10 deletions

View File

@ -74,7 +74,7 @@ export async function discoverTogetherModels(apiKey?: string): Promise<ModelDefi
const errorText = await response.text();
console.warn(`[together-models] Error response body: ${errorText}`);
} catch (e) {
console.warn(`[together-models] Could not read error response body: ${e}`);
console.warn(`[together-models] Could not read error response body: ${String(e)}`);
}
return [];
@ -101,7 +101,7 @@ export async function discoverTogetherModels(apiKey?: string): Promise<ModelDefi
return [];
}
} catch (e) {
console.error(`[together-models] Failed to parse JSON: ${e}`);
console.error(`[together-models] Failed to parse JSON: ${String(e)}`);
console.error(`[together-models] Raw response: ${rawResponse}`);
return [];
}

View File

@ -80,17 +80,31 @@ const TOGETHER_MODEL_CATALOG = [
},
},
{
id: "Qwen/Qwen2.5-72B-Instruct-Turbo",
name: "Qwen 2.5 72B Instruct Turbo",
id: "zai-org/GLM-4.7",
name: "GLM 4.7 Fp8",
reasoning: false,
input: ["text"],
contextWindow: 131072,
contextWindow: 202752,
maxTokens: 8192,
cost: {
input: 0.35,
output: 0.8,
cacheRead: 0.35,
cacheWrite: 0.35,
input: 0.45,
output: 2.0,
cacheRead: 0.45,
cacheWrite: 2.0,
},
},
{
id: "moonshotai/Kimi-K2-Instruct-0905",
name: "Kimi K2-Instruct 0905",
reasoning: false,
input: ["text"],
contextWindow: 262144,
maxTokens: 8192,
cost: {
input: 1.0,
output: 3.0,
cacheRead: 1.0,
cacheWrite: 3.0,
},
},
];
@ -545,7 +559,9 @@ export async function applyTogetherProviderConfig(cfg: ClawdbotConfig): Promise<
togetherModels = await discoverTogetherModels(normalizedApiKey);
console.log(`[together-models] Dynamic discovery found ${togetherModels.length} models`);
} catch (error) {
console.warn(`[together-models] Dynamic discovery failed, using static catalog: ${error}`);
console.warn(
`[together-models] Dynamic discovery failed, using static catalog: ${String(error)}`,
);
togetherModels = TOGETHER_MODEL_CATALOG.map(buildTogetherModelDefinition);
}
} else {