fix(core): expose azure openai xhigh efforts (#30620)
This commit is contained in:
@@ -782,10 +782,7 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
|
|||||||
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/azure
|
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/azure
|
||||||
if (id === "o1-mini") return {}
|
if (id === "o1-mini") return {}
|
||||||
return Object.fromEntries(
|
return Object.fromEntries(
|
||||||
(GPT5_FAMILY_RE.test(id) && gpt5Version(id) === undefined
|
openaiReasoningEfforts(id, model.release_date).map((effort) => [
|
||||||
? ["minimal", ...WIDELY_SUPPORTED_EFFORTS]
|
|
||||||
: WIDELY_SUPPORTED_EFFORTS
|
|
||||||
).map((effort) => [
|
|
||||||
effort,
|
effort,
|
||||||
{
|
{
|
||||||
reasoningEffort: effort,
|
reasoningEffort: effort,
|
||||||
|
|||||||
@@ -3013,20 +3013,25 @@ describe("ProviderTransform.variants", () => {
|
|||||||
expect(Object.keys(result)).toEqual(["minimal", "low", "medium", "high"])
|
expect(Object.keys(result)).toEqual(["minimal", "low", "medium", "high"])
|
||||||
})
|
})
|
||||||
|
|
||||||
for (const id of ["gpt-5-4", "gpt-5-5"]) {
|
for (const testCase of [
|
||||||
test(`${id} does not add minimal effort`, () => {
|
{ id: "gpt-5-1", efforts: ["none", "low", "medium", "high"] },
|
||||||
|
{ id: "gpt-5-4", efforts: ["none", "low", "medium", "high", "xhigh"] },
|
||||||
|
{ id: "gpt-5.4", efforts: ["none", "low", "medium", "high", "xhigh"] },
|
||||||
|
{ id: "gpt-5-5", efforts: ["none", "low", "medium", "high", "xhigh"] },
|
||||||
|
]) {
|
||||||
|
test(`${testCase.id} returns supported Azure reasoning efforts`, () => {
|
||||||
const result = ProviderTransform.variants(
|
const result = ProviderTransform.variants(
|
||||||
createMockModel({
|
createMockModel({
|
||||||
id,
|
id: testCase.id,
|
||||||
providerID: "azure",
|
providerID: "azure",
|
||||||
api: {
|
api: {
|
||||||
id,
|
id: testCase.id,
|
||||||
url: "https://azure.com",
|
url: "https://azure.com",
|
||||||
npm: "@ai-sdk/azure",
|
npm: "@ai-sdk/azure",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
expect(Object.keys(result)).toEqual(["low", "medium", "high"])
|
expect(Object.keys(result)).toEqual(testCase.efforts)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user