fix: bug encountered when using azure gpt-5.5 w/ completions api (#26222)

This commit is contained in:
Frederik
2026-05-14 06:24:16 +02:00
committed by GitHub
parent 4d8368970a
commit 9675579796
2 changed files with 74 additions and 0 deletions

View File

@@ -1126,6 +1126,11 @@ export function options(input: {
result["enable_thinking"] = true
}
if (input.model.api.npm === "@ai-sdk/azure" && input.model.api.id.includes("gpt-5.5")) {
result["reasoningSummary"] = "auto"
return result;
}
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")) {
result["reasoningEffort"] = "medium"

View File

@@ -310,6 +310,75 @@ describe("ProviderTransform.options - gpt-5 textVerbosity", () => {
})
})
describe("ProviderTransform.options - gpt-5 reasoningEffort", () => {
const sessionID = "test-session-123"
const createModel = (apiId: string) =>
({
id: `azure/${apiId}`,
providerID: "azure",
api: {
id: apiId,
url: "https://azure.com",
npm: "@ai-sdk/azure",
},
name: apiId,
capabilities: {
temperature: true,
reasoning: true,
attachment: true,
toolcall: true,
input: {
text: true,
audio: false,
image: true,
video: false,
pdf: false,
},
output: {
text: true,
audio: false,
image: false,
video: false,
pdf: false,
},
interleaved: false,
},
cost: {
input: 0.03,
output: 0.06,
cache: { read: 0.001, write: 0.002 },
},
limit: {
context: 128000,
output: 4096,
},
status: "active",
options: {},
headers: {},
}) as any
test('gpt-5-chat should NOT set reasoningEffort', () => {
const result = ProviderTransform.options({
model: createModel("gpt-5-chat"),
sessionID,
providerOptions: {},
})
expect(result.reasoningEffort).toBeUndefined()
})
test("gpt-5.5 should NOT set reasoningEffort", () => {
const result = ProviderTransform.options({
model: createModel("gpt-5.5"),
sessionID,
providerOptions: {},
})
expect(result.reasoningEffort).toBeUndefined()
})
})
describe("ProviderTransform.options - gateway", () => {
const sessionID = "test-session-123"