generate-models: use reasoning options from models.dev (#6928)
* generate-models: use reasoning options from models.dev * fix tests
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { getEffortThinkingLevelMap } from "../scripts/models-dev-reasoning-options.ts";
|
||||
|
||||
describe("getEffortThinkingLevelMap", () => {
|
||||
it("exposes only verified effort values and none", () => {
|
||||
expect(
|
||||
getEffortThinkingLevelMap([{ type: "toggle" }, { type: "effort", values: ["none", "low", "high", "max"] }]),
|
||||
).toEqual({
|
||||
off: "none",
|
||||
minimal: null,
|
||||
low: "low",
|
||||
medium: null,
|
||||
high: "high",
|
||||
xhigh: null,
|
||||
max: "max",
|
||||
});
|
||||
});
|
||||
|
||||
it("does not infer thinking-off from an effort list", () => {
|
||||
expect(getEffortThinkingLevelMap([{ type: "effort", values: ["low", "high", "max"] }])).toEqual({
|
||||
off: null,
|
||||
minimal: null,
|
||||
low: "low",
|
||||
medium: null,
|
||||
high: "high",
|
||||
xhigh: null,
|
||||
max: "max",
|
||||
});
|
||||
});
|
||||
|
||||
it("leaves toggle and budget controls for their adapter-specific implementations", () => {
|
||||
expect(getEffortThinkingLevelMap([{ type: "toggle" }])).toBeUndefined();
|
||||
expect(getEffortThinkingLevelMap([{ type: "budget_tokens", min: 1024, max: 32000 }])).toBeUndefined();
|
||||
expect(getEffortThinkingLevelMap([{ type: "effort", values: [null, "default"] }])).toBeUndefined();
|
||||
});
|
||||
});
|
||||
@@ -59,15 +59,7 @@ describe("getSupportedThinkingLevels", () => {
|
||||
(modelId) => {
|
||||
const model = getModel("openai", modelId);
|
||||
expect(model).toBeDefined();
|
||||
expect(getSupportedThinkingLevels(model!)).toEqual([
|
||||
"off",
|
||||
"minimal",
|
||||
"low",
|
||||
"medium",
|
||||
"high",
|
||||
"xhigh",
|
||||
"max",
|
||||
]);
|
||||
expect(getSupportedThinkingLevels(model!)).toEqual(["off", "low", "medium", "high", "xhigh", "max"]);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -110,6 +102,12 @@ describe("getSupportedThinkingLevels", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it.each(["moonshotai", "moonshotai-cn"] as const)("uses the verified effort options for %s Kimi K3", (provider) => {
|
||||
const model = getModel(provider, "kimi-k3");
|
||||
expect(model).toBeDefined();
|
||||
expect(getSupportedThinkingLevels(model!)).toEqual(["low", "high", "max"]);
|
||||
});
|
||||
|
||||
it("includes only low, high, max for Kimi Coding K3", () => {
|
||||
const model = getModel("kimi-coding", "k3");
|
||||
expect(model).toBeDefined();
|
||||
|
||||
@@ -44,7 +44,15 @@ describe("Together models", () => {
|
||||
|
||||
it("models Together reasoning controls from the Together API surface", () => {
|
||||
const gptOss = getModel("together", "openai/gpt-oss-120b");
|
||||
expect(gptOss.thinkingLevelMap).toEqual({ off: null, minimal: null });
|
||||
expect(gptOss.thinkingLevelMap).toEqual({
|
||||
off: null,
|
||||
minimal: null,
|
||||
low: "low",
|
||||
medium: "medium",
|
||||
high: "high",
|
||||
max: null,
|
||||
xhigh: null,
|
||||
});
|
||||
expect(gptOss.compat).toMatchObject({
|
||||
supportsReasoningEffort: true,
|
||||
thinkingFormat: "openai",
|
||||
|
||||
Reference in New Issue
Block a user