fix(provider): support mistral reasoning options
This commit is contained in:
parent
c7cbbda8f2
commit
eb6efbccfd
2 changed files with 20 additions and 0 deletions
|
|
@ -722,6 +722,7 @@ function effortVariant(model: Provider.Model, effort: ReasoningEffortValue) {
|
||||||
case "venice-ai-sdk-provider":
|
case "venice-ai-sdk-provider":
|
||||||
case "@ai-sdk/openai-compatible":
|
case "@ai-sdk/openai-compatible":
|
||||||
case "@ai-sdk/groq":
|
case "@ai-sdk/groq":
|
||||||
|
case "@ai-sdk/mistral":
|
||||||
return { reasoningEffort: effort }
|
return { reasoningEffort: effort }
|
||||||
}
|
}
|
||||||
return undefined
|
return undefined
|
||||||
|
|
|
||||||
|
|
@ -3067,6 +3067,25 @@ describe("ProviderTransform.variants", () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("mistral reasoning_options drive supported effort variants", () => {
|
||||||
|
const result = ProviderTransform.variants(
|
||||||
|
createMockModel({
|
||||||
|
id: "mistral/mistral-small-2603",
|
||||||
|
providerID: "mistral",
|
||||||
|
api: {
|
||||||
|
id: "mistral-small-2603",
|
||||||
|
url: "https://api.mistral.com",
|
||||||
|
npm: "@ai-sdk/mistral",
|
||||||
|
},
|
||||||
|
reasoning_options: [{ type: "effort", values: ["none", "high"] }],
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
expect(result).toEqual({
|
||||||
|
none: { reasoningEffort: "none" },
|
||||||
|
high: { reasoningEffort: "high" },
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
test("mistral without reasoning returns empty object", () => {
|
test("mistral without reasoning returns empty object", () => {
|
||||||
const model = createMockModel({
|
const model = createMockModel({
|
||||||
id: "mistral/mistral-large",
|
id: "mistral/mistral-large",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue