@ai-sdk/openai 2.0.0-beta.1 → 2.0.0-beta.11

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 CHANGED
@@ -1,5 +1,80 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 2.0.0-beta.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [57edfcb]
8
+ - Updated dependencies [383cbfa]
9
+ - @ai-sdk/provider-utils@3.0.0-beta.5
10
+
11
+ ## 2.0.0-beta.10
12
+
13
+ ### Patch Changes
14
+
15
+ - 0fa7414: chore (provider/openai): standardize on itemId in provider metadata
16
+ - 205077b: fix: improve Zod compatibility
17
+ - Updated dependencies [205077b]
18
+ - @ai-sdk/provider-utils@3.0.0-beta.4
19
+
20
+ ## 2.0.0-beta.9
21
+
22
+ ### Patch Changes
23
+
24
+ - faea29f: fix (provider/openai): multi-step reasoning with text
25
+
26
+ ## 2.0.0-beta.8
27
+
28
+ ### Patch Changes
29
+
30
+ - db64cbe: fix (provider/openai): multi-step reasoning with tool calls
31
+ - Updated dependencies [05d2819]
32
+ - @ai-sdk/provider-utils@3.0.0-beta.3
33
+
34
+ ## 2.0.0-beta.7
35
+
36
+ ### Patch Changes
37
+
38
+ - 209256d: Add missing file_search tool support to OpenAI Responses API
39
+
40
+ ## 2.0.0-beta.6
41
+
42
+ ### Patch Changes
43
+
44
+ - 0eee6a8: Fix streaming and reconstruction of reasoning summary parts
45
+ - b5a0e32: fix (provider/openai): correct default for chat model strict mode
46
+ - c7d3b2e: fix (provider/openai): push first reasoning chunk in output item added event
47
+
48
+ ## 2.0.0-beta.5
49
+
50
+ ### Patch Changes
51
+
52
+ - 48249c4: Do not warn if empty text is the first part of a reasoning sequence
53
+ - e497698: fix (provider/openai): handle responses api errors
54
+
55
+ ## 2.0.0-beta.4
56
+
57
+ ### Patch Changes
58
+
59
+ - b3c3450: feat (provider/openai): add support for encrypted_reasoning to responses api
60
+ - ad2a3d5: feat(provider/openai): add missing reasoning models to responses API
61
+
62
+ ## 2.0.0-beta.3
63
+
64
+ ### Major Changes
65
+
66
+ - efc3a62: fix (provider/openai): default strict mode to false
67
+
68
+ ## 2.0.0-beta.2
69
+
70
+ ### Patch Changes
71
+
72
+ - d1a034f: feature: using Zod 4 for internal stuff
73
+ - Updated dependencies [0571b98]
74
+ - Updated dependencies [39a4fab]
75
+ - Updated dependencies [d1a034f]
76
+ - @ai-sdk/provider-utils@3.0.0-beta.2
77
+
3
78
  ## 2.0.0-beta.1
4
79
 
5
80
  ### Major Changes
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LanguageModelV2, ProviderV2, EmbeddingModelV2, ImageModelV2, TranscriptionModelV2, SpeechModelV2 } from '@ai-sdk/provider';
2
2
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
3
  import { FetchFunction } from '@ai-sdk/provider-utils';
4
- import { z } from 'zod';
4
+ import { z } from 'zod/v4';
5
5
 
6
6
  type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo-preview' | 'gpt-4-0125-preview' | 'gpt-4-1106-preview' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | (string & {});
7
7
 
@@ -44,7 +44,8 @@ type OpenAIConfig = {
44
44
  generateId?: () => string;
45
45
  };
46
46
 
47
- type OpenAIResponsesModelId = 'o1' | 'o1-2024-12-17' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo-preview' | 'gpt-4-0125-preview' | 'gpt-4-1106-preview' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | (string & {});
47
+ declare const openaiResponsesModelIds: readonly ["gpt-4.1", "gpt-4.1-2025-04-14", "gpt-4.1-mini", "gpt-4.1-mini-2025-04-14", "gpt-4.1-nano", "gpt-4.1-nano-2025-04-14", "gpt-4o", "gpt-4o-2024-05-13", "gpt-4o-2024-08-06", "gpt-4o-2024-11-20", "gpt-4o-audio-preview", "gpt-4o-audio-preview-2024-10-01", "gpt-4o-audio-preview-2024-12-17", "gpt-4o-search-preview", "gpt-4o-search-preview-2025-03-11", "gpt-4o-mini-search-preview", "gpt-4o-mini-search-preview-2025-03-11", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-turbo-preview", "gpt-4-0125-preview", "gpt-4-1106-preview", "gpt-4", "gpt-4-0613", "gpt-4.5-preview", "gpt-4.5-preview-2025-02-27", "gpt-3.5-turbo-0125", "gpt-3.5-turbo", "gpt-3.5-turbo-1106", "chatgpt-4o-latest", "o1", "o1-2024-12-17", "o1-mini", "o1-mini-2024-09-12", "o1-preview", "o1-preview-2024-09-12", "o3-mini", "o3-mini-2025-01-31", "o3", "o3-2025-04-16", "o4-mini", "o4-mini-2025-04-16", "codex-mini-latest", "computer-use-preview"];
48
+ type OpenAIResponsesModelId = (typeof openaiResponsesModelIds)[number] | (string & {});
48
49
 
49
50
  declare class OpenAIResponsesLanguageModel implements LanguageModelV2 {
50
51
  readonly specificationVersion = "v2";
@@ -64,33 +65,17 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
64
65
  store: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
65
66
  user: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
67
  reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
67
- strictSchemas: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
68
+ strictJsonSchema: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
68
69
  instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
70
  reasoningSummary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
70
- serviceTier: z.ZodOptional<z.ZodNullable<z.ZodEnum<["auto", "flex"]>>>;
71
- }, "strip", z.ZodTypeAny, {
72
- user?: string | null | undefined;
73
- parallelToolCalls?: boolean | null | undefined;
74
- reasoningEffort?: string | null | undefined;
75
- store?: boolean | null | undefined;
76
- metadata?: any;
77
- serviceTier?: "auto" | "flex" | null | undefined;
78
- previousResponseId?: string | null | undefined;
79
- strictSchemas?: boolean | null | undefined;
80
- instructions?: string | null | undefined;
81
- reasoningSummary?: string | null | undefined;
82
- }, {
83
- user?: string | null | undefined;
84
- parallelToolCalls?: boolean | null | undefined;
85
- reasoningEffort?: string | null | undefined;
86
- store?: boolean | null | undefined;
87
- metadata?: any;
88
- serviceTier?: "auto" | "flex" | null | undefined;
89
- previousResponseId?: string | null | undefined;
90
- strictSchemas?: boolean | null | undefined;
91
- instructions?: string | null | undefined;
92
- reasoningSummary?: string | null | undefined;
93
- }>;
71
+ serviceTier: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
72
+ auto: "auto";
73
+ flex: "flex";
74
+ }>>>;
75
+ include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
76
+ "reasoning.encrypted_content": "reasoning.encrypted_content";
77
+ }>>>>;
78
+ }, z.core.$strip>;
94
79
  type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
95
80
 
96
81
  type OpenAISpeechModelId = 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts' | (string & {});
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LanguageModelV2, ProviderV2, EmbeddingModelV2, ImageModelV2, TranscriptionModelV2, SpeechModelV2 } from '@ai-sdk/provider';
2
2
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
3
  import { FetchFunction } from '@ai-sdk/provider-utils';
4
- import { z } from 'zod';
4
+ import { z } from 'zod/v4';
5
5
 
6
6
  type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo-preview' | 'gpt-4-0125-preview' | 'gpt-4-1106-preview' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | (string & {});
7
7
 
@@ -44,7 +44,8 @@ type OpenAIConfig = {
44
44
  generateId?: () => string;
45
45
  };
46
46
 
47
- type OpenAIResponsesModelId = 'o1' | 'o1-2024-12-17' | 'o1-mini' | 'o1-mini-2024-09-12' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo-preview' | 'gpt-4-0125-preview' | 'gpt-4-1106-preview' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | (string & {});
47
+ declare const openaiResponsesModelIds: readonly ["gpt-4.1", "gpt-4.1-2025-04-14", "gpt-4.1-mini", "gpt-4.1-mini-2025-04-14", "gpt-4.1-nano", "gpt-4.1-nano-2025-04-14", "gpt-4o", "gpt-4o-2024-05-13", "gpt-4o-2024-08-06", "gpt-4o-2024-11-20", "gpt-4o-audio-preview", "gpt-4o-audio-preview-2024-10-01", "gpt-4o-audio-preview-2024-12-17", "gpt-4o-search-preview", "gpt-4o-search-preview-2025-03-11", "gpt-4o-mini-search-preview", "gpt-4o-mini-search-preview-2025-03-11", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-turbo-preview", "gpt-4-0125-preview", "gpt-4-1106-preview", "gpt-4", "gpt-4-0613", "gpt-4.5-preview", "gpt-4.5-preview-2025-02-27", "gpt-3.5-turbo-0125", "gpt-3.5-turbo", "gpt-3.5-turbo-1106", "chatgpt-4o-latest", "o1", "o1-2024-12-17", "o1-mini", "o1-mini-2024-09-12", "o1-preview", "o1-preview-2024-09-12", "o3-mini", "o3-mini-2025-01-31", "o3", "o3-2025-04-16", "o4-mini", "o4-mini-2025-04-16", "codex-mini-latest", "computer-use-preview"];
48
+ type OpenAIResponsesModelId = (typeof openaiResponsesModelIds)[number] | (string & {});
48
49
 
49
50
  declare class OpenAIResponsesLanguageModel implements LanguageModelV2 {
50
51
  readonly specificationVersion = "v2";
@@ -64,33 +65,17 @@ declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
64
65
  store: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
65
66
  user: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
67
  reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
67
- strictSchemas: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
68
+ strictJsonSchema: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
68
69
  instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
70
  reasoningSummary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
70
- serviceTier: z.ZodOptional<z.ZodNullable<z.ZodEnum<["auto", "flex"]>>>;
71
- }, "strip", z.ZodTypeAny, {
72
- user?: string | null | undefined;
73
- parallelToolCalls?: boolean | null | undefined;
74
- reasoningEffort?: string | null | undefined;
75
- store?: boolean | null | undefined;
76
- metadata?: any;
77
- serviceTier?: "auto" | "flex" | null | undefined;
78
- previousResponseId?: string | null | undefined;
79
- strictSchemas?: boolean | null | undefined;
80
- instructions?: string | null | undefined;
81
- reasoningSummary?: string | null | undefined;
82
- }, {
83
- user?: string | null | undefined;
84
- parallelToolCalls?: boolean | null | undefined;
85
- reasoningEffort?: string | null | undefined;
86
- store?: boolean | null | undefined;
87
- metadata?: any;
88
- serviceTier?: "auto" | "flex" | null | undefined;
89
- previousResponseId?: string | null | undefined;
90
- strictSchemas?: boolean | null | undefined;
91
- instructions?: string | null | undefined;
92
- reasoningSummary?: string | null | undefined;
93
- }>;
71
+ serviceTier: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
72
+ auto: "auto";
73
+ flex: "flex";
74
+ }>>>;
75
+ include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
76
+ "reasoning.encrypted_content": "reasoning.encrypted_content";
77
+ }>>>>;
78
+ }, z.core.$strip>;
94
79
  type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
95
80
 
96
81
  type OpenAISpeechModelId = 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts' | (string & {});