fix(provider): only set thinkingConfig for models with reasoning capability (#18283)

This commit is contained in:
Protocol Zero
2026-03-22 00:57:52 +08:00
committed by GitHub
parent d5337b41f4
commit cc818f8032
2 changed files with 73 additions and 5 deletions

View File

@@ -755,11 +755,13 @@ export namespace ProviderTransform {
}
if (input.model.api.npm === "@ai-sdk/google" || input.model.api.npm === "@ai-sdk/google-vertex") {
result["thinkingConfig"] = {
includeThoughts: true,
}
if (input.model.api.id.includes("gemini-3")) {
result["thinkingConfig"]["thinkingLevel"] = "high"
if (input.model.capabilities.reasoning) {
result["thinkingConfig"] = {
includeThoughts: true,
}
if (input.model.api.id.includes("gemini-3")) {
result["thinkingConfig"]["thinkingLevel"] = "high"
}
}
}