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

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,72 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 2.0.0-beta.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 0fa7414: chore (provider/openai): standardize on itemId in provider metadata
8
+ - 205077b: fix: improve Zod compatibility
9
+ - Updated dependencies [205077b]
10
+ - @ai-sdk/provider-utils@3.0.0-beta.4
11
+
12
+ ## 2.0.0-beta.9
13
+
14
+ ### Patch Changes
15
+
16
+ - faea29f: fix (provider/openai): multi-step reasoning with text
17
+
18
+ ## 2.0.0-beta.8
19
+
20
+ ### Patch Changes
21
+
22
+ - db64cbe: fix (provider/openai): multi-step reasoning with tool calls
23
+ - Updated dependencies [05d2819]
24
+ - @ai-sdk/provider-utils@3.0.0-beta.3
25
+
26
+ ## 2.0.0-beta.7
27
+
28
+ ### Patch Changes
29
+
30
+ - 209256d: Add missing file_search tool support to OpenAI Responses API
31
+
32
+ ## 2.0.0-beta.6
33
+
34
+ ### Patch Changes
35
+
36
+ - 0eee6a8: Fix streaming and reconstruction of reasoning summary parts
37
+ - b5a0e32: fix (provider/openai): correct default for chat model strict mode
38
+ - c7d3b2e: fix (provider/openai): push first reasoning chunk in output item added event
39
+
40
+ ## 2.0.0-beta.5
41
+
42
+ ### Patch Changes
43
+
44
+ - 48249c4: Do not warn if empty text is the first part of a reasoning sequence
45
+ - e497698: fix (provider/openai): handle responses api errors
46
+
47
+ ## 2.0.0-beta.4
48
+
49
+ ### Patch Changes
50
+
51
+ - b3c3450: feat (provider/openai): add support for encrypted_reasoning to responses api
52
+ - ad2a3d5: feat(provider/openai): add missing reasoning models to responses API
53
+
54
+ ## 2.0.0-beta.3
55
+
56
+ ### Major Changes
57
+
58
+ - efc3a62: fix (provider/openai): default strict mode to false
59
+
60
+ ## 2.0.0-beta.2
61
+
62
+ ### Patch Changes
63
+
64
+ - d1a034f: feature: using Zod 4 for internal stuff
65
+ - Updated dependencies [0571b98]
66
+ - Updated dependencies [39a4fab]
67
+ - Updated dependencies [d1a034f]
68
+ - @ai-sdk/provider-utils@3.0.0-beta.2
69
+
3
70
  ## 2.0.0-beta.1
4
71
 
5
72
  ### 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 & {});