fix: gpt-5.5+ in combination with azure fails with reasoningEffort (#40265)
This commit is contained in:
@@ -1270,8 +1270,14 @@ export function options(input: {
|
|||||||
result["gateway"] = { caching: "auto" }
|
result["gateway"] = { caching: "auto" }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input.model.api.npm === "@ai-sdk/azure" && input.model.api.id.includes("gpt-5.5")) {
|
// Any gpt version above 5.4 in combination with azure does not support reasoningEffort
|
||||||
result["reasoningSummary"] = "auto"
|
// so we should return early here.
|
||||||
|
const [, gptMajorVersion, gptMinorVersion] = input.model.api.id.match(/gpt-(\d+)\.(\d+)/) ?? []
|
||||||
|
const isGpt55OrNewer = Number(gptMajorVersion) > 5 || (Number(gptMajorVersion) === 5 && Number(gptMinorVersion) >= 5)
|
||||||
|
if (input.model.api.npm === "@ai-sdk/azure" && input.providerOptions?.useCompletionUrls) {
|
||||||
|
if (!isGpt55OrNewer) {
|
||||||
|
result["reasoningEffort"] = "medium"
|
||||||
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -690,6 +690,16 @@ describe("ProviderTransform.options - gpt-5 reasoningEffort", () => {
|
|||||||
|
|
||||||
expect(result.reasoningEffort).toBeUndefined()
|
expect(result.reasoningEffort).toBeUndefined()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("gpt-5.6 should NOT set reasoningEffort", () => {
|
||||||
|
const result = ProviderTransform.options({
|
||||||
|
model: createModel("gpt-5.6"),
|
||||||
|
sessionID,
|
||||||
|
providerOptions: {},
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(result.reasoningEffort).toBeUndefined()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("ProviderTransform.options - gateway", () => {
|
describe("ProviderTransform.options - gateway", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user