@ai-sdk/openai 2.0.92 → 2.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 +12 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +15 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -7
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +2 -2
- package/dist/internal/index.d.ts +2 -2
- package/dist/internal/index.js +14 -6
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +14 -6
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 2.0.94
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 42815ac: feat(provider/openai): add `gpt-5.3-codex`
|
|
8
|
+
|
|
9
|
+
## 2.0.93
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fa64d70: fix(openai): change web search tool action to be optional
|
|
14
|
+
|
|
3
15
|
## 2.0.92
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -34,7 +34,7 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFa
|
|
|
34
34
|
* An object describing the specific action taken in this web search call.
|
|
35
35
|
* Includes details on how the model used the web (search, open_page, findInPage).
|
|
36
36
|
*/
|
|
37
|
-
action
|
|
37
|
+
action?: {
|
|
38
38
|
/**
|
|
39
39
|
* Action type "search" - Performs a web search query.
|
|
40
40
|
*/
|
|
@@ -276,7 +276,7 @@ declare const openaiTools: {
|
|
|
276
276
|
* @deprecated Use `webSearch` instead.
|
|
277
277
|
*/
|
|
278
278
|
webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
|
|
279
|
-
action
|
|
279
|
+
action?: {
|
|
280
280
|
type: "search";
|
|
281
281
|
query?: string;
|
|
282
282
|
} | {
|
|
@@ -308,7 +308,7 @@ declare const openaiTools: {
|
|
|
308
308
|
* @param userLocation - The user location to use for the web search.
|
|
309
309
|
*/
|
|
310
310
|
webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
311
|
-
action
|
|
311
|
+
action?: {
|
|
312
312
|
type: "search";
|
|
313
313
|
query?: string;
|
|
314
314
|
} | {
|
|
@@ -329,7 +329,7 @@ declare const openaiTools: {
|
|
|
329
329
|
}>;
|
|
330
330
|
};
|
|
331
331
|
|
|
332
|
-
type OpenAIResponsesModelId = 'chatgpt-4o-latest' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4-0613' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | (string & {});
|
|
332
|
+
type OpenAIResponsesModelId = 'chatgpt-4o-latest' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4-0613' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-codex' | 'gpt-5.3-codex' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | (string & {});
|
|
333
333
|
declare const openaiResponsesProviderOptionsSchema: _ai_sdk_provider_utils.LazyValidator<{
|
|
334
334
|
conversation?: string | null | undefined;
|
|
335
335
|
include?: ("file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFa
|
|
|
34
34
|
* An object describing the specific action taken in this web search call.
|
|
35
35
|
* Includes details on how the model used the web (search, open_page, findInPage).
|
|
36
36
|
*/
|
|
37
|
-
action
|
|
37
|
+
action?: {
|
|
38
38
|
/**
|
|
39
39
|
* Action type "search" - Performs a web search query.
|
|
40
40
|
*/
|
|
@@ -276,7 +276,7 @@ declare const openaiTools: {
|
|
|
276
276
|
* @deprecated Use `webSearch` instead.
|
|
277
277
|
*/
|
|
278
278
|
webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
|
|
279
|
-
action
|
|
279
|
+
action?: {
|
|
280
280
|
type: "search";
|
|
281
281
|
query?: string;
|
|
282
282
|
} | {
|
|
@@ -308,7 +308,7 @@ declare const openaiTools: {
|
|
|
308
308
|
* @param userLocation - The user location to use for the web search.
|
|
309
309
|
*/
|
|
310
310
|
webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
311
|
-
action
|
|
311
|
+
action?: {
|
|
312
312
|
type: "search";
|
|
313
313
|
query?: string;
|
|
314
314
|
} | {
|
|
@@ -329,7 +329,7 @@ declare const openaiTools: {
|
|
|
329
329
|
}>;
|
|
330
330
|
};
|
|
331
331
|
|
|
332
|
-
type OpenAIResponsesModelId = 'chatgpt-4o-latest' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4-0613' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | (string & {});
|
|
332
|
+
type OpenAIResponsesModelId = 'chatgpt-4o-latest' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4-0613' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-codex' | 'gpt-5.3-codex' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | (string & {});
|
|
333
333
|
declare const openaiResponsesProviderOptionsSchema: _ai_sdk_provider_utils.LazyValidator<{
|
|
334
334
|
conversation?: string | null | undefined;
|
|
335
335
|
include?: ("file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1987,7 +1987,7 @@ var webSearchOutputSchema = (0, import_provider_utils18.lazySchema)(
|
|
|
1987
1987
|
url: import_v413.z.string().nullish(),
|
|
1988
1988
|
pattern: import_v413.z.string().nullish()
|
|
1989
1989
|
})
|
|
1990
|
-
]),
|
|
1990
|
+
]).optional(),
|
|
1991
1991
|
sources: import_v413.z.array(
|
|
1992
1992
|
import_v413.z.discriminatedUnion("type", [
|
|
1993
1993
|
import_v413.z.object({ type: import_v413.z.literal("url"), url: import_v413.z.string() }),
|
|
@@ -2042,7 +2042,7 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils19.lazySchema)(
|
|
|
2042
2042
|
url: import_v414.z.string().nullish(),
|
|
2043
2043
|
pattern: import_v414.z.string().nullish()
|
|
2044
2044
|
})
|
|
2045
|
-
])
|
|
2045
|
+
]).optional()
|
|
2046
2046
|
})
|
|
2047
2047
|
)
|
|
2048
2048
|
);
|
|
@@ -2591,7 +2591,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazyValidator)(
|
|
|
2591
2591
|
url: import_v416.z.string().nullish(),
|
|
2592
2592
|
pattern: import_v416.z.string().nullish()
|
|
2593
2593
|
})
|
|
2594
|
-
])
|
|
2594
|
+
]).nullish()
|
|
2595
2595
|
}),
|
|
2596
2596
|
import_v416.z.object({
|
|
2597
2597
|
type: import_v416.z.literal("file_search_call"),
|
|
@@ -2788,7 +2788,10 @@ var openaiResponsesResponseSchema = (0, import_provider_utils21.lazyValidator)(
|
|
|
2788
2788
|
sources: import_v416.z.array(
|
|
2789
2789
|
import_v416.z.discriminatedUnion("type", [
|
|
2790
2790
|
import_v416.z.object({ type: import_v416.z.literal("url"), url: import_v416.z.string() }),
|
|
2791
|
-
import_v416.z.object({
|
|
2791
|
+
import_v416.z.object({
|
|
2792
|
+
type: import_v416.z.literal("api"),
|
|
2793
|
+
name: import_v416.z.string()
|
|
2794
|
+
})
|
|
2792
2795
|
])
|
|
2793
2796
|
).nullish()
|
|
2794
2797
|
}),
|
|
@@ -2801,7 +2804,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils21.lazyValidator)(
|
|
|
2801
2804
|
url: import_v416.z.string().nullish(),
|
|
2802
2805
|
pattern: import_v416.z.string().nullish()
|
|
2803
2806
|
})
|
|
2804
|
-
])
|
|
2807
|
+
]).nullish()
|
|
2805
2808
|
}),
|
|
2806
2809
|
import_v416.z.object({
|
|
2807
2810
|
type: import_v416.z.literal("file_search_call"),
|
|
@@ -2922,7 +2925,9 @@ var openaiResponsesReasoningModelIds = [
|
|
|
2922
2925
|
"gpt-5.1-codex-max",
|
|
2923
2926
|
"gpt-5.2",
|
|
2924
2927
|
"gpt-5.2-chat-latest",
|
|
2925
|
-
"gpt-5.2-pro"
|
|
2928
|
+
"gpt-5.2-pro",
|
|
2929
|
+
"gpt-5.2-codex",
|
|
2930
|
+
"gpt-5.3-codex"
|
|
2926
2931
|
];
|
|
2927
2932
|
var openaiResponsesModelIds = [
|
|
2928
2933
|
"gpt-4.1",
|
|
@@ -4225,6 +4230,9 @@ function isErrorChunk(chunk) {
|
|
|
4225
4230
|
}
|
|
4226
4231
|
function mapWebSearchOutput(action) {
|
|
4227
4232
|
var _a;
|
|
4233
|
+
if (action == null) {
|
|
4234
|
+
return {};
|
|
4235
|
+
}
|
|
4228
4236
|
switch (action.type) {
|
|
4229
4237
|
case "search":
|
|
4230
4238
|
return {
|
|
@@ -4598,7 +4606,7 @@ var OpenAITranscriptionModel = class {
|
|
|
4598
4606
|
};
|
|
4599
4607
|
|
|
4600
4608
|
// src/version.ts
|
|
4601
|
-
var VERSION = true ? "2.0.
|
|
4609
|
+
var VERSION = true ? "2.0.94" : "0.0.0-test";
|
|
4602
4610
|
|
|
4603
4611
|
// src/openai-provider.ts
|
|
4604
4612
|
function createOpenAI(options = {}) {
|