mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-23 10:45:33 -04:00
fix(provider): support mistral reasoning options
This commit is contained in:
@@ -722,6 +722,7 @@ function effortVariant(model: Provider.Model, effort: ReasoningEffortValue) {
|
||||
case "venice-ai-sdk-provider":
|
||||
case "@ai-sdk/openai-compatible":
|
||||
case "@ai-sdk/groq":
|
||||
case "@ai-sdk/mistral":
|
||||
return { reasoningEffort: effort }
|
||||
}
|
||||
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", () => {
|
||||
const model = createMockModel({
|
||||
id: "mistral/mistral-large",
|
||||
|
||||
Reference in New Issue
Block a user