fix(provider): honor reasoning option semantics (#37519)

This commit is contained in:
Aiden Cline
2026-07-17 14:23:33 -05:00
committed by GitHub
parent 0df2f6245a
commit 49d2dd8a38
3 changed files with 30 additions and 11 deletions
+2 -2
View File
@@ -1586,7 +1586,7 @@ export function reasoningVariants(model: ModelsDev.Model, target: Provider.Model
if (options.length === 0) return {}
const effort = options.find((option) => option.type === "effort")
if (effort) return nonEmptyVariants(effortVariants(target, effort.values))
if (effort) return effortVariants(target, effort.values)
const toggle = options.some((option) => option.type === "toggle")
const budget = options.find((option) => option.type === "budget_tokens")
@@ -1651,7 +1651,7 @@ function reasoningEffort(model: Provider.Model, effort: string) {
return { reasoning: { effort } }
case "@ai-sdk/anthropic":
case "@ai-sdk/google-vertex/anthropic":
return anthropicEffort(model, effort)
return anthropicEffort(model, effort) ?? { effort }
case "@ai-sdk/google":
case "@ai-sdk/google-vertex":
return { thinkingConfig: { includeThoughts: true, thinkingLevel: effort } }