@ai-sdk/openai 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +23 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -17
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +5 -0
- package/dist/internal/index.d.ts +5 -0
- package/dist/internal/index.js +23 -17
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +23 -17
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 2.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4738f18: feat(openai): add flex processing support for gpt-5 models
|
|
8
|
+
- 013d747: feat(openai): add verbosity parameter support for responses api
|
|
9
|
+
- 35feee8: feat(openai): add priority processing support for gpt-5 models
|
|
10
|
+
|
|
3
11
|
## 2.0.6
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -87,6 +87,11 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
87
87
|
"reasoning.encrypted_content": "reasoning.encrypted_content";
|
|
88
88
|
"file_search_call.results": "file_search_call.results";
|
|
89
89
|
}>>>>;
|
|
90
|
+
textVerbosity: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
91
|
+
low: "low";
|
|
92
|
+
medium: "medium";
|
|
93
|
+
high: "high";
|
|
94
|
+
}>>>;
|
|
90
95
|
}, z.core.$strip>;
|
|
91
96
|
type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
|
|
92
97
|
|
package/dist/index.d.ts
CHANGED
|
@@ -87,6 +87,11 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
|
|
|
87
87
|
"reasoning.encrypted_content": "reasoning.encrypted_content";
|
|
88
88
|
"file_search_call.results": "file_search_call.results";
|
|
89
89
|
}>>>>;
|
|
90
|
+
textVerbosity: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
91
|
+
low: "low";
|
|
92
|
+
medium: "medium";
|
|
93
|
+
high: "high";
|
|
94
|
+
}>>>;
|
|
90
95
|
}, z.core.$strip>;
|
|
91
96
|
type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
|
|
92
97
|
|
package/dist/index.js
CHANGED
|
@@ -676,7 +676,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
676
676
|
warnings.push({
|
|
677
677
|
type: "unsupported-setting",
|
|
678
678
|
setting: "serviceTier",
|
|
679
|
-
details: "flex processing is only available for o3
|
|
679
|
+
details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
680
680
|
});
|
|
681
681
|
baseArgs.service_tier = void 0;
|
|
682
682
|
}
|
|
@@ -684,7 +684,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
684
684
|
warnings.push({
|
|
685
685
|
type: "unsupported-setting",
|
|
686
686
|
setting: "serviceTier",
|
|
687
|
-
details: "priority processing is only available for supported models (
|
|
687
|
+
details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
688
688
|
});
|
|
689
689
|
baseArgs.service_tier = void 0;
|
|
690
690
|
}
|
|
@@ -1117,10 +1117,10 @@ function isReasoningModel(modelId) {
|
|
|
1117
1117
|
return modelId.startsWith("o") || modelId.startsWith("gpt-5");
|
|
1118
1118
|
}
|
|
1119
1119
|
function supportsFlexProcessing(modelId) {
|
|
1120
|
-
return modelId.startsWith("o3") || modelId.startsWith("o4-mini");
|
|
1120
|
+
return modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5");
|
|
1121
1121
|
}
|
|
1122
1122
|
function supportsPriorityProcessing(modelId) {
|
|
1123
|
-
return modelId.startsWith("gpt-4") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
|
|
1123
|
+
return modelId.startsWith("gpt-4") || modelId.startsWith("gpt-5-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-nano") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
|
|
1124
1124
|
}
|
|
1125
1125
|
function getSystemMessageMode(modelId) {
|
|
1126
1126
|
var _a, _b;
|
|
@@ -2298,15 +2298,20 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2298
2298
|
temperature,
|
|
2299
2299
|
top_p: topP,
|
|
2300
2300
|
max_output_tokens: maxOutputTokens,
|
|
2301
|
-
...(responseFormat == null ? void 0 : responseFormat.type) === "json" && {
|
|
2301
|
+
...((responseFormat == null ? void 0 : responseFormat.type) === "json" || (openaiOptions == null ? void 0 : openaiOptions.textVerbosity)) && {
|
|
2302
2302
|
text: {
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2303
|
+
...(responseFormat == null ? void 0 : responseFormat.type) === "json" && {
|
|
2304
|
+
format: responseFormat.schema != null ? {
|
|
2305
|
+
type: "json_schema",
|
|
2306
|
+
strict: strictJsonSchema,
|
|
2307
|
+
name: (_b = responseFormat.name) != null ? _b : "response",
|
|
2308
|
+
description: responseFormat.description,
|
|
2309
|
+
schema: responseFormat.schema
|
|
2310
|
+
} : { type: "json_object" }
|
|
2311
|
+
},
|
|
2312
|
+
...(openaiOptions == null ? void 0 : openaiOptions.textVerbosity) && {
|
|
2313
|
+
verbosity: openaiOptions.textVerbosity
|
|
2314
|
+
}
|
|
2310
2315
|
}
|
|
2311
2316
|
},
|
|
2312
2317
|
// provider options:
|
|
@@ -2370,7 +2375,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2370
2375
|
warnings.push({
|
|
2371
2376
|
type: "unsupported-setting",
|
|
2372
2377
|
setting: "serviceTier",
|
|
2373
|
-
details: "flex processing is only available for o3
|
|
2378
|
+
details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
2374
2379
|
});
|
|
2375
2380
|
delete baseArgs.service_tier;
|
|
2376
2381
|
}
|
|
@@ -2378,7 +2383,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2378
2383
|
warnings.push({
|
|
2379
2384
|
type: "unsupported-setting",
|
|
2380
2385
|
setting: "serviceTier",
|
|
2381
|
-
details: "priority processing is only available for supported models (
|
|
2386
|
+
details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
2382
2387
|
});
|
|
2383
2388
|
delete baseArgs.service_tier;
|
|
2384
2389
|
}
|
|
@@ -3134,10 +3139,10 @@ function getResponsesModelConfig(modelId) {
|
|
|
3134
3139
|
};
|
|
3135
3140
|
}
|
|
3136
3141
|
function supportsFlexProcessing2(modelId) {
|
|
3137
|
-
return modelId.startsWith("o3") || modelId.startsWith("o4-mini");
|
|
3142
|
+
return modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5");
|
|
3138
3143
|
}
|
|
3139
3144
|
function supportsPriorityProcessing2(modelId) {
|
|
3140
|
-
return modelId.startsWith("gpt-4") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
|
|
3145
|
+
return modelId.startsWith("gpt-4") || modelId.startsWith("gpt-5-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-nano") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
|
|
3141
3146
|
}
|
|
3142
3147
|
var openaiResponsesProviderOptionsSchema = import_v414.z.object({
|
|
3143
3148
|
metadata: import_v414.z.any().nullish(),
|
|
@@ -3150,7 +3155,8 @@ var openaiResponsesProviderOptionsSchema = import_v414.z.object({
|
|
|
3150
3155
|
instructions: import_v414.z.string().nullish(),
|
|
3151
3156
|
reasoningSummary: import_v414.z.string().nullish(),
|
|
3152
3157
|
serviceTier: import_v414.z.enum(["auto", "flex", "priority"]).nullish(),
|
|
3153
|
-
include: import_v414.z.array(import_v414.z.enum(["reasoning.encrypted_content", "file_search_call.results"])).nullish()
|
|
3158
|
+
include: import_v414.z.array(import_v414.z.enum(["reasoning.encrypted_content", "file_search_call.results"])).nullish(),
|
|
3159
|
+
textVerbosity: import_v414.z.enum(["low", "medium", "high"]).nullish()
|
|
3154
3160
|
});
|
|
3155
3161
|
|
|
3156
3162
|
// src/openai-speech-model.ts
|