fix(provider): honor reasoning option semantics (#37519)
This commit is contained in:
@@ -1477,7 +1477,7 @@ test("models.dev normalization fills required response fields", () => {
|
||||
expect(model.release_date).toBe("")
|
||||
})
|
||||
|
||||
test("models.dev reasoning options replace generated variants and unsupported options fall back", () => {
|
||||
test("models.dev reasoning options replace generated variants and unsupported toggles fall back", () => {
|
||||
const provider = {
|
||||
id: "reasoning",
|
||||
name: "Reasoning",
|
||||
@@ -1514,6 +1514,14 @@ test("models.dev reasoning options replace generated variants and unsupported op
|
||||
limit: { context: 128_000, output: 64_000 },
|
||||
experimental: { modes: { fast: {} } },
|
||||
},
|
||||
anthropicCompatible: {
|
||||
id: "k3",
|
||||
name: "Anthropic Compatible",
|
||||
reasoning: true,
|
||||
reasoning_options: [{ type: "effort", values: ["max"] }],
|
||||
provider: { npm: "@ai-sdk/anthropic" },
|
||||
limit: { context: 1_048_576, output: 131_072 },
|
||||
},
|
||||
},
|
||||
} as unknown as ModelsDev.Provider
|
||||
|
||||
@@ -1530,6 +1538,7 @@ test("models.dev reasoning options replace generated variants and unsupported op
|
||||
expect(models.override.variants).toEqual({
|
||||
high: { thinkingConfig: { includeThoughts: true, thinkingLevel: "high" } },
|
||||
})
|
||||
expect(models.anthropicCompatible.variants).toEqual({ max: { effort: "max" } })
|
||||
expect(models["gemini-3-pro-fast"].variants).toEqual(models.override.variants)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user