@ai-sdk/openai 3.0.92 → 3.0.94
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 +17 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -7
- 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 +8 -6
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +8 -6
- 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/convert-to-openai-responses-input.ts +12 -7
- package/src/responses/openai-responses-language-model.ts +2 -1
- package/src/responses/openai-responses-options.ts +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 3.0.94
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d3247d7: Keep client-executed function calls paired with their outputs when chaining OpenAI Responses with a previous response ID.
|
|
8
|
+
- Updated dependencies [b2a4d5a]
|
|
9
|
+
- @ai-sdk/provider-utils@4.0.45
|
|
10
|
+
|
|
11
|
+
## 3.0.93
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- f471a1c: Accept `serviceTier: 'fast'` on OpenAI chat and responses models. OpenAI renamed priority processing to Fast mode and accepts `service_tier: 'fast'` and `'priority'` interchangeably, so `'fast'` is now passed through verbatim and gated on the same model capability as `'priority'`.
|
|
16
|
+
- Updated dependencies [2171d15]
|
|
17
|
+
- @ai-sdk/provider@3.0.15
|
|
18
|
+
- @ai-sdk/provider-utils@4.0.44
|
|
19
|
+
|
|
3
20
|
## 3.0.92
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -14,7 +14,7 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
|
|
|
14
14
|
store?: boolean | undefined;
|
|
15
15
|
metadata?: Record<string, string> | undefined;
|
|
16
16
|
prediction?: Record<string, any> | undefined;
|
|
17
|
-
serviceTier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
17
|
+
serviceTier?: "default" | "auto" | "flex" | "priority" | "fast" | undefined;
|
|
18
18
|
strictJsonSchema?: boolean | undefined;
|
|
19
19
|
textVerbosity?: "low" | "medium" | "high" | undefined;
|
|
20
20
|
promptCacheKey?: string | undefined;
|
|
@@ -1096,7 +1096,7 @@ declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.
|
|
|
1096
1096
|
reasoningContext?: "auto" | "current_turn" | "all_turns" | undefined;
|
|
1097
1097
|
reasoningSummary?: string | null | undefined;
|
|
1098
1098
|
safetyIdentifier?: string | null | undefined;
|
|
1099
|
-
serviceTier?: "default" | "auto" | "flex" | "priority" | null | undefined;
|
|
1099
|
+
serviceTier?: "default" | "auto" | "flex" | "priority" | "fast" | null | undefined;
|
|
1100
1100
|
store?: boolean | null | undefined;
|
|
1101
1101
|
passThroughUnsupportedFiles?: boolean | undefined;
|
|
1102
1102
|
strictJsonSchema?: boolean | null | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
|
|
|
14
14
|
store?: boolean | undefined;
|
|
15
15
|
metadata?: Record<string, string> | undefined;
|
|
16
16
|
prediction?: Record<string, any> | undefined;
|
|
17
|
-
serviceTier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
17
|
+
serviceTier?: "default" | "auto" | "flex" | "priority" | "fast" | undefined;
|
|
18
18
|
strictJsonSchema?: boolean | undefined;
|
|
19
19
|
textVerbosity?: "low" | "medium" | "high" | undefined;
|
|
20
20
|
promptCacheKey?: string | undefined;
|
|
@@ -1096,7 +1096,7 @@ declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.
|
|
|
1096
1096
|
reasoningContext?: "auto" | "current_turn" | "all_turns" | undefined;
|
|
1097
1097
|
reasoningSummary?: string | null | undefined;
|
|
1098
1098
|
safetyIdentifier?: string | null | undefined;
|
|
1099
|
-
serviceTier?: "default" | "auto" | "flex" | "priority" | null | undefined;
|
|
1099
|
+
serviceTier?: "default" | "auto" | "flex" | "priority" | "fast" | null | undefined;
|
|
1100
1100
|
store?: boolean | null | undefined;
|
|
1101
1101
|
passThroughUnsupportedFiles?: boolean | undefined;
|
|
1102
1102
|
strictJsonSchema?: boolean | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -739,11 +739,12 @@ var openaiLanguageModelChatOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
739
739
|
* Project settings. Unless otherwise configured, the Project will use 'default'.
|
|
740
740
|
* - 'flex': 50% cheaper processing at the cost of increased latency. Only available for o3 and o4-mini models.
|
|
741
741
|
* - 'priority': Higher-speed processing with predictably low latency at premium cost. Available for Enterprise customers.
|
|
742
|
+
* - 'fast': OpenAI's newer name for the 'priority' tier. Interchangeable with it.
|
|
742
743
|
* - 'default': The request will be processed with the standard pricing and performance for the selected model.
|
|
743
744
|
*
|
|
744
745
|
* @default 'auto'
|
|
745
746
|
*/
|
|
746
|
-
serviceTier: import_v43.z.enum(["auto", "flex", "priority", "default"]).optional(),
|
|
747
|
+
serviceTier: import_v43.z.enum(["auto", "flex", "priority", "fast", "default"]).optional(),
|
|
747
748
|
/**
|
|
748
749
|
* Whether to use strict JSON schema validation.
|
|
749
750
|
*
|
|
@@ -1043,7 +1044,7 @@ var OpenAIChatLanguageModel = class {
|
|
|
1043
1044
|
});
|
|
1044
1045
|
baseArgs.service_tier = void 0;
|
|
1045
1046
|
}
|
|
1046
|
-
if (openaiOptions.serviceTier === "priority" && !modelCapabilities.supportsPriorityProcessing) {
|
|
1047
|
+
if ((openaiOptions.serviceTier === "priority" || openaiOptions.serviceTier === "fast") && !modelCapabilities.supportsPriorityProcessing) {
|
|
1047
1048
|
warnings.push({
|
|
1048
1049
|
type: "unsupported",
|
|
1049
1050
|
feature: "serviceTier",
|
|
@@ -3190,10 +3191,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
3190
3191
|
}
|
|
3191
3192
|
break;
|
|
3192
3193
|
}
|
|
3193
|
-
|
|
3194
|
+
const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || ((_m = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _m : false);
|
|
3195
|
+
if (hasPreviousResponseId && store && id != null && isProviderDefinedToolCall) {
|
|
3194
3196
|
break;
|
|
3195
3197
|
}
|
|
3196
|
-
const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || ((_m = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _m : false);
|
|
3197
3198
|
if (store && id != null && isProviderDefinedToolCall) {
|
|
3198
3199
|
input.push({ type: "item_reference", id });
|
|
3199
3200
|
break;
|
|
@@ -4798,10 +4799,11 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils28.lazy
|
|
|
4798
4799
|
* Service tier for the request.
|
|
4799
4800
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
4800
4801
|
* 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).
|
|
4802
|
+
* Set to 'fast' for the same tier as 'priority' (OpenAI's newer name for it).
|
|
4801
4803
|
*
|
|
4802
4804
|
* Defaults to 'auto'.
|
|
4803
4805
|
*/
|
|
4804
|
-
serviceTier: import_v423.z.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4806
|
+
serviceTier: import_v423.z.enum(["auto", "flex", "priority", "fast", "default"]).nullish(),
|
|
4805
4807
|
/**
|
|
4806
4808
|
* Whether to store the generation. Defaults to `true`.
|
|
4807
4809
|
*/
|
|
@@ -5468,7 +5470,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5468
5470
|
});
|
|
5469
5471
|
delete baseArgs.service_tier;
|
|
5470
5472
|
}
|
|
5471
|
-
if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "priority" && !modelCapabilities.supportsPriorityProcessing) {
|
|
5473
|
+
if (((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "priority" || (openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "fast") && !modelCapabilities.supportsPriorityProcessing) {
|
|
5472
5474
|
warnings.push({
|
|
5473
5475
|
type: "unsupported",
|
|
5474
5476
|
feature: "serviceTier",
|
|
@@ -7353,7 +7355,7 @@ var OpenAITranscriptionModel = class {
|
|
|
7353
7355
|
};
|
|
7354
7356
|
|
|
7355
7357
|
// src/version.ts
|
|
7356
|
-
var VERSION = true ? "3.0.
|
|
7358
|
+
var VERSION = true ? "3.0.94" : "0.0.0-test";
|
|
7357
7359
|
|
|
7358
7360
|
// src/openai-provider.ts
|
|
7359
7361
|
function createOpenAI(options = {}) {
|