mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-07 09:11:42 +00:00
feat: add Mistral Medium 3.5 with reasoning support (#24996)
This commit is contained in:
parent
1124ae17b4
commit
639e27c3ce
2 changed files with 21 additions and 3 deletions
|
|
@ -760,9 +760,10 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
|
|||
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/mistral
|
||||
// https://docs.mistral.ai/capabilities/reasoning/adjustable
|
||||
if (!model.capabilities.reasoning) return {}
|
||||
// Only Mistral Small 4 supports reasoning (mistral-small-2603, mistral-small-latest)
|
||||
// Only Mistral Small 4 and Medium 3.5 support reasoning
|
||||
const MISTRAL_REASONING_IDS = ["mistral-small-2603", "mistral-small-latest", "mistral-medium-3.5"]
|
||||
const mistralId = model.api.id.toLowerCase()
|
||||
if (!mistralId.includes("mistral-small-2603") && !mistralId.includes("mistral-small-latest")) return {}
|
||||
if (!MISTRAL_REASONING_IDS.some((id) => mistralId.includes(id))) return {}
|
||||
return {
|
||||
high: { reasoningEffort: "high" },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2257,7 +2257,7 @@ describe("ProviderTransform.variants", () => {
|
|||
expect(result).toEqual({})
|
||||
})
|
||||
|
||||
test("mistral with reasoning returns variants", () => {
|
||||
test("mistral models with reasoning support return variants", () => {
|
||||
const model = createMockModel({
|
||||
id: "mistral/mistral-small-latest",
|
||||
providerID: "mistral",
|
||||
|
|
@ -2274,6 +2274,23 @@ describe("ProviderTransform.variants", () => {
|
|||
})
|
||||
})
|
||||
|
||||
test("mistral-medium-3.5 with reasoning returns variants", () => {
|
||||
const model = createMockModel({
|
||||
id: "mistral/mistral-medium-3.5",
|
||||
providerID: "mistral",
|
||||
api: {
|
||||
id: "mistral-medium-3.5",
|
||||
url: "https://api.mistral.com",
|
||||
npm: "@ai-sdk/mistral",
|
||||
},
|
||||
capabilities: { reasoning: true },
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(result).toEqual({
|
||||
high: { reasoningEffort: "high" },
|
||||
})
|
||||
})
|
||||
|
||||
test("mistral without reasoning returns empty object", () => {
|
||||
const model = createMockModel({
|
||||
id: "mistral/mistral-large",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue