fix(provider): guard reasoningSummary injection for @ai-sdk/openai-compatible providers (#22352)
Co-authored-by: Nazar Hnatyshen <nazar.hnatyshen@atolls.com>
This commit is contained in:
co-authored by
Nazar Hnatyshen
parent
34e2429c49
commit
c2403d0f15
@@ -832,7 +832,16 @@ export namespace ProviderTransform {
|
|||||||
if (input.model.api.id.includes("gpt-5") && !input.model.api.id.includes("gpt-5-chat")) {
|
if (input.model.api.id.includes("gpt-5") && !input.model.api.id.includes("gpt-5-chat")) {
|
||||||
if (!input.model.api.id.includes("gpt-5-pro")) {
|
if (!input.model.api.id.includes("gpt-5-pro")) {
|
||||||
result["reasoningEffort"] = "medium"
|
result["reasoningEffort"] = "medium"
|
||||||
result["reasoningSummary"] = "auto"
|
// Only inject reasoningSummary for providers that support it natively.
|
||||||
|
// @ai-sdk/openai-compatible proxies (e.g. LiteLLM) do not understand this
|
||||||
|
// parameter and return "Unknown parameter: 'reasoningSummary'".
|
||||||
|
if (
|
||||||
|
input.model.api.npm === "@ai-sdk/openai" ||
|
||||||
|
input.model.api.npm === "@ai-sdk/azure" ||
|
||||||
|
input.model.api.npm === "@ai-sdk/github-copilot"
|
||||||
|
) {
|
||||||
|
result["reasoningSummary"] = "auto"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only set textVerbosity for non-chat gpt-5.x models
|
// Only set textVerbosity for non-chat gpt-5.x models
|
||||||
|
|||||||
Reference in New Issue
Block a user