@ai-sdk/openai 3.0.92 → 3.0.93
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 +9 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +1 -1
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +6 -4
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +6 -4
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +6 -2
- package/package.json +3 -3
- package/src/chat/openai-chat-language-model.ts +2 -1
- package/src/chat/openai-chat-options.ts +4 -1
- package/src/responses/openai-responses-language-model.ts +2 -1
- package/src/responses/openai-responses-options.ts +4 -1
package/docs/03-openai.mdx
CHANGED
|
@@ -231,10 +231,12 @@ The following provider options are available:
|
|
|
231
231
|
`.nullable()`.
|
|
232
232
|
</Note>
|
|
233
233
|
|
|
234
|
-
- **serviceTier** _'auto' | 'flex' | 'priority' | 'default'_
|
|
234
|
+
- **serviceTier** _'auto' | 'flex' | 'priority' | 'fast' | 'default'_
|
|
235
235
|
Service tier for the request. Set to 'flex' for 50% cheaper processing
|
|
236
236
|
at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
237
237
|
Set to 'priority' for faster processing with Enterprise access (available for gpt-4, gpt-5, gpt-5-mini, o3, o4-mini; gpt-5-nano is not supported).
|
|
238
|
+
'fast' is OpenAI's newer name for the 'priority' tier; the two are interchangeable, and responses from
|
|
239
|
+
gpt-5.6 and earlier report `serviceTier: 'priority'` for either.
|
|
238
240
|
|
|
239
241
|
Defaults to 'auto'.
|
|
240
242
|
|
|
@@ -1709,11 +1711,13 @@ The following optional provider options are available for OpenAI chat models:
|
|
|
1709
1711
|
|
|
1710
1712
|
Parameters for prediction mode.
|
|
1711
1713
|
|
|
1712
|
-
- **serviceTier** _'auto' | 'flex' | 'priority' | 'default'_
|
|
1714
|
+
- **serviceTier** _'auto' | 'flex' | 'priority' | 'fast' | 'default'_
|
|
1713
1715
|
|
|
1714
1716
|
Service tier for the request. Set to 'flex' for 50% cheaper processing
|
|
1715
1717
|
at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
1716
1718
|
Set to 'priority' for faster processing with Enterprise access (available for gpt-4, gpt-5, gpt-5-mini, o3, o4-mini; gpt-5-nano is not supported).
|
|
1719
|
+
'fast' is OpenAI's newer name for the 'priority' tier; the two are interchangeable, and responses from
|
|
1720
|
+
gpt-5.6 and earlier report `serviceTier: 'priority'` for either.
|
|
1717
1721
|
|
|
1718
1722
|
Defaults to 'auto'.
|
|
1719
1723
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/openai",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.93",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@ai-sdk/provider": "3.0.
|
|
40
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
39
|
+
"@ai-sdk/provider": "3.0.15",
|
|
40
|
+
"@ai-sdk/provider-utils": "4.0.44"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -283,7 +283,8 @@ export class OpenAIChatLanguageModel implements LanguageModelV3 {
|
|
|
283
283
|
|
|
284
284
|
// Validate priority processing support
|
|
285
285
|
if (
|
|
286
|
-
openaiOptions.serviceTier === 'priority'
|
|
286
|
+
(openaiOptions.serviceTier === 'priority' ||
|
|
287
|
+
openaiOptions.serviceTier === 'fast') &&
|
|
287
288
|
!modelCapabilities.supportsPriorityProcessing
|
|
288
289
|
) {
|
|
289
290
|
warnings.push({
|
|
@@ -138,11 +138,14 @@ export const openaiLanguageModelChatOptions = lazySchema(() =>
|
|
|
138
138
|
* Project settings. Unless otherwise configured, the Project will use 'default'.
|
|
139
139
|
* - 'flex': 50% cheaper processing at the cost of increased latency. Only available for o3 and o4-mini models.
|
|
140
140
|
* - 'priority': Higher-speed processing with predictably low latency at premium cost. Available for Enterprise customers.
|
|
141
|
+
* - 'fast': OpenAI's newer name for the 'priority' tier. Interchangeable with it.
|
|
141
142
|
* - 'default': The request will be processed with the standard pricing and performance for the selected model.
|
|
142
143
|
*
|
|
143
144
|
* @default 'auto'
|
|
144
145
|
*/
|
|
145
|
-
serviceTier: z
|
|
146
|
+
serviceTier: z
|
|
147
|
+
.enum(['auto', 'flex', 'priority', 'fast', 'default'])
|
|
148
|
+
.optional(),
|
|
146
149
|
|
|
147
150
|
/**
|
|
148
151
|
* Whether to use strict JSON schema validation.
|
|
@@ -450,7 +450,8 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV3 {
|
|
|
450
450
|
|
|
451
451
|
// Validate priority processing support
|
|
452
452
|
if (
|
|
453
|
-
openaiOptions?.serviceTier === 'priority'
|
|
453
|
+
(openaiOptions?.serviceTier === 'priority' ||
|
|
454
|
+
openaiOptions?.serviceTier === 'fast') &&
|
|
454
455
|
!modelCapabilities.supportsPriorityProcessing
|
|
455
456
|
) {
|
|
456
457
|
warnings.push({
|
|
@@ -293,10 +293,13 @@ export const openaiLanguageModelResponsesOptionsSchema = lazySchema(() =>
|
|
|
293
293
|
* Service tier for the request.
|
|
294
294
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
295
295
|
* Set to 'priority' for faster processing with Enterprise access (available for gpt-4, gpt-5, gpt-5-mini, o3, o4-mini; gpt-5-nano is not supported).
|
|
296
|
+
* Set to 'fast' for the same tier as 'priority' (OpenAI's newer name for it).
|
|
296
297
|
*
|
|
297
298
|
* Defaults to 'auto'.
|
|
298
299
|
*/
|
|
299
|
-
serviceTier: z
|
|
300
|
+
serviceTier: z
|
|
301
|
+
.enum(['auto', 'flex', 'priority', 'fast', 'default'])
|
|
302
|
+
.nullish(),
|
|
300
303
|
|
|
301
304
|
/**
|
|
302
305
|
* Whether to store the generation. Defaults to `true`.
|