mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-14 03:02:14 +03:00
fix(kimi): apply K3 effort policy to aliases (#10005)
This commit is contained in:
@@ -25,7 +25,9 @@ const KIMI_CODE_STATIC_THINKING_POLICIES: Record<string, KimiCodeThinkingPolicy>
|
||||
|
||||
export function getKimiCodeStaticThinkingPolicy(modelId: unknown): KimiCodeThinkingPolicy | null {
|
||||
if (typeof modelId !== "string") return null;
|
||||
return KIMI_CODE_STATIC_THINKING_POLICIES[modelId] || null;
|
||||
const normalizedModel = modelId.trim().toLowerCase().split("/").pop() || "";
|
||||
if (/^k3(?:$|-)/.test(normalizedModel)) return KIMI_CODE_STATIC_THINKING_POLICIES.k3;
|
||||
return KIMI_CODE_STATIC_THINKING_POLICIES[normalizedModel] || null;
|
||||
}
|
||||
|
||||
export type KimiCodeDeviceIdentity = {
|
||||
|
||||
@@ -263,6 +263,22 @@ test("handleResponsesCore preserves Kimi K3 reasoning through provider translati
|
||||
assert.equal(native.call.body.messages?.[1]?.reasoning_content, "I should search first.");
|
||||
});
|
||||
|
||||
test("handleResponsesCore maps unsupported Kimi K3 xhigh effort to max", async () => {
|
||||
const { call, result } = await invokeResponsesCore({
|
||||
body: {
|
||||
model: "k3-256k",
|
||||
reasoning: { effort: "xhigh", summary: "auto" },
|
||||
input: "Reply with OK.",
|
||||
},
|
||||
provider: "kimi-coding-apikey",
|
||||
model: "k3-256k",
|
||||
});
|
||||
|
||||
assert.equal(result.success, true);
|
||||
assert.deepEqual(call.body.thinking, { type: "enabled" });
|
||||
assert.deepEqual(call.body.output_config, { effort: "max" });
|
||||
});
|
||||
|
||||
test("handleResponsesCore strips previous_response_id by default and handles empty input arrays", async () => {
|
||||
const { call, result } = await invokeResponsesCore({
|
||||
body: {
|
||||
|
||||
Reference in New Issue
Block a user