mirror of
https://github.com/xmanrui/OpenClaw-bot-review.git
synced 2026-07-27 22:25:52 +00:00
Merge pull request #30 from fangfei0110/fix/kimi-temperature
fix: use temperature=1 for Kimi providers in model probe
This commit is contained in:
+6
-1
@@ -192,6 +192,10 @@ async function probeModelDirect(params: ProbeModelParams): Promise<DirectProbeRe
|
||||
if (!providerCfg?.baseUrl || !providerCfg.api || !providerCfg.apiKey) return null;
|
||||
|
||||
const timeoutMs = params.timeoutMs ?? DEFAULT_MODEL_PROBE_TIMEOUT_MS;
|
||||
// Kimi providers require temperature=1
|
||||
const isKimiProvider = params.providerId === "kimi-coding" || params.providerId === "moonshot";
|
||||
const temperature = isKimiProvider ? 1 : 0;
|
||||
|
||||
const headers: Record<string, string> = {
|
||||
"content-type": "application/json",
|
||||
...(providerCfg.headers || {}),
|
||||
@@ -205,6 +209,7 @@ async function probeModelDirect(params: ProbeModelParams): Promise<DirectProbeRe
|
||||
model: params.modelId,
|
||||
max_tokens: 8,
|
||||
messages: [{ role: "user", content: "Reply with OK." }],
|
||||
temperature,
|
||||
};
|
||||
const start = Date.now();
|
||||
try {
|
||||
@@ -254,7 +259,7 @@ async function probeModelDirect(params: ProbeModelParams): Promise<DirectProbeRe
|
||||
model: params.modelId,
|
||||
messages: [{ role: "user", content: "Reply with OK." }],
|
||||
max_tokens: 8,
|
||||
temperature: 0,
|
||||
temperature,
|
||||
};
|
||||
const start = Date.now();
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user