@ai-sdk/openai 2.1.0-beta.8 → 3.0.0-beta.100

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.
@@ -1,40 +1,26 @@
1
- import { LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV2CallOptions, TranscriptionModelV2, SpeechModelV2 } from '@ai-sdk/provider';
1
+ import { LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3CallOptions, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
2
2
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
- import { FetchFunction } from '@ai-sdk/provider-utils';
4
- import { z } from 'zod/v4';
3
+ import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
5
4
 
6
- type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-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-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | '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' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | (string & {});
7
- declare const openaiChatLanguageModelOptions: z.ZodObject<{
8
- logitBias: z.ZodOptional<z.ZodRecord<z.ZodCoercedNumber<string>, z.ZodNumber>>;
9
- logprobs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber]>>;
10
- parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
11
- user: z.ZodOptional<z.ZodString>;
12
- reasoningEffort: z.ZodOptional<z.ZodEnum<{
13
- minimal: "minimal";
14
- low: "low";
15
- medium: "medium";
16
- high: "high";
17
- }>>;
18
- maxCompletionTokens: z.ZodOptional<z.ZodNumber>;
19
- store: z.ZodOptional<z.ZodBoolean>;
20
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
21
- prediction: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
22
- structuredOutputs: z.ZodOptional<z.ZodBoolean>;
23
- serviceTier: z.ZodOptional<z.ZodEnum<{
24
- auto: "auto";
25
- flex: "flex";
26
- priority: "priority";
27
- }>>;
28
- strictJsonSchema: z.ZodOptional<z.ZodBoolean>;
29
- textVerbosity: z.ZodOptional<z.ZodEnum<{
30
- low: "low";
31
- medium: "medium";
32
- high: "high";
33
- }>>;
34
- promptCacheKey: z.ZodOptional<z.ZodString>;
35
- safetyIdentifier: z.ZodOptional<z.ZodString>;
36
- }, z.core.$strip>;
37
- type OpenAIChatLanguageModelOptions = z.infer<typeof openaiChatLanguageModelOptions>;
5
+ type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-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-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | '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' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | (string & {});
6
+ declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
7
+ logitBias?: Record<number, number> | undefined;
8
+ logprobs?: number | boolean | undefined;
9
+ parallelToolCalls?: boolean | undefined;
10
+ user?: string | undefined;
11
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
12
+ maxCompletionTokens?: number | undefined;
13
+ store?: boolean | undefined;
14
+ metadata?: Record<string, string> | undefined;
15
+ prediction?: Record<string, any> | undefined;
16
+ serviceTier?: "default" | "auto" | "flex" | "priority" | undefined;
17
+ strictJsonSchema?: boolean | undefined;
18
+ textVerbosity?: "low" | "medium" | "high" | undefined;
19
+ promptCacheKey?: string | undefined;
20
+ promptCacheRetention?: "in_memory" | "24h" | undefined;
21
+ safetyIdentifier?: string | undefined;
22
+ }>;
23
+ type OpenAIChatLanguageModelOptions = InferSchema<typeof openaiChatLanguageModelOptions>;
38
24
 
39
25
  type OpenAIChatConfig = {
40
26
  provider: string;
@@ -60,14 +46,14 @@ declare class OpenAIChatLanguageModel implements LanguageModelV3 {
60
46
  }
61
47
 
62
48
  type OpenAICompletionModelId = 'gpt-3.5-turbo-instruct' | (string & {});
63
- declare const openaiCompletionProviderOptions: z.ZodObject<{
64
- echo: z.ZodOptional<z.ZodBoolean>;
65
- logitBias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
66
- suffix: z.ZodOptional<z.ZodString>;
67
- user: z.ZodOptional<z.ZodString>;
68
- logprobs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber]>>;
69
- }, z.core.$strip>;
70
- type OpenAICompletionProviderOptions = z.infer<typeof openaiCompletionProviderOptions>;
49
+ declare const openaiCompletionProviderOptions: _ai_sdk_provider_utils.LazySchema<{
50
+ echo?: boolean | undefined;
51
+ logitBias?: Record<string, number> | undefined;
52
+ suffix?: string | undefined;
53
+ user?: string | undefined;
54
+ logprobs?: number | boolean | undefined;
55
+ }>;
56
+ type OpenAICompletionProviderOptions = InferSchema<typeof openaiCompletionProviderOptions>;
71
57
 
72
58
  type OpenAICompletionConfig = {
73
59
  provider: string;
@@ -112,13 +98,13 @@ type OpenAIConfig = {
112
98
  };
113
99
 
114
100
  type OpenAIEmbeddingModelId = 'text-embedding-3-small' | 'text-embedding-3-large' | 'text-embedding-ada-002' | (string & {});
115
- declare const openaiEmbeddingProviderOptions: z.ZodObject<{
116
- dimensions: z.ZodOptional<z.ZodNumber>;
117
- user: z.ZodOptional<z.ZodString>;
118
- }, z.core.$strip>;
119
- type OpenAIEmbeddingProviderOptions = z.infer<typeof openaiEmbeddingProviderOptions>;
101
+ declare const openaiEmbeddingProviderOptions: _ai_sdk_provider_utils.LazySchema<{
102
+ dimensions?: number | undefined;
103
+ user?: string | undefined;
104
+ }>;
105
+ type OpenAIEmbeddingProviderOptions = InferSchema<typeof openaiEmbeddingProviderOptions>;
120
106
 
121
- declare class OpenAIEmbeddingModel implements EmbeddingModelV3<string> {
107
+ declare class OpenAIEmbeddingModel implements EmbeddingModelV3 {
122
108
  readonly specificationVersion = "v3";
123
109
  readonly modelId: OpenAIEmbeddingModelId;
124
110
  readonly maxEmbeddingsPerCall = 2048;
@@ -126,10 +112,10 @@ declare class OpenAIEmbeddingModel implements EmbeddingModelV3<string> {
126
112
  private readonly config;
127
113
  get provider(): string;
128
114
  constructor(modelId: OpenAIEmbeddingModelId, config: OpenAIConfig);
129
- doEmbed({ values, headers, abortSignal, providerOptions, }: Parameters<EmbeddingModelV3<string>['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV3<string>['doEmbed']>>>;
115
+ doEmbed({ values, headers, abortSignal, providerOptions, }: Parameters<EmbeddingModelV3['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV3['doEmbed']>>>;
130
116
  }
131
117
 
132
- type OpenAIImageModelId = 'gpt-image-1' | 'dall-e-3' | 'dall-e-2' | (string & {});
118
+ type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | (string & {});
133
119
  declare const modelMaxImagesPerCall: Record<OpenAIImageModelId, number>;
134
120
  declare const hasDefaultResponseFormat: Set<string>;
135
121
 
@@ -149,19 +135,16 @@ declare class OpenAIImageModel implements ImageModelV3 {
149
135
  }
150
136
 
151
137
  type OpenAITranscriptionModelId = 'whisper-1' | 'gpt-4o-mini-transcribe' | 'gpt-4o-transcribe' | (string & {});
152
- declare const openAITranscriptionProviderOptions: z.ZodObject<{
153
- include: z.ZodOptional<z.ZodArray<z.ZodString>>;
154
- language: z.ZodOptional<z.ZodString>;
155
- prompt: z.ZodOptional<z.ZodString>;
156
- temperature: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
157
- timestampGranularities: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<{
158
- word: "word";
159
- segment: "segment";
160
- }>>>>;
161
- }, z.core.$strip>;
162
- type OpenAITranscriptionProviderOptions = z.infer<typeof openAITranscriptionProviderOptions>;
138
+ declare const openAITranscriptionProviderOptions: _ai_sdk_provider_utils.LazySchema<{
139
+ include?: string[] | undefined;
140
+ language?: string | undefined;
141
+ prompt?: string | undefined;
142
+ temperature?: number | undefined;
143
+ timestampGranularities?: ("word" | "segment")[] | undefined;
144
+ }>;
145
+ type OpenAITranscriptionProviderOptions = InferSchema<typeof openAITranscriptionProviderOptions>;
163
146
 
164
- type OpenAITranscriptionCallOptions = Omit<TranscriptionModelV2CallOptions, 'providerOptions'> & {
147
+ type OpenAITranscriptionCallOptions = Omit<TranscriptionModelV3CallOptions, 'providerOptions'> & {
165
148
  providerOptions?: {
166
149
  openai?: OpenAITranscriptionProviderOptions;
167
150
  };
@@ -171,39 +154,39 @@ interface OpenAITranscriptionModelConfig extends OpenAIConfig {
171
154
  currentDate?: () => Date;
172
155
  };
173
156
  }
174
- declare class OpenAITranscriptionModel implements TranscriptionModelV2 {
157
+ declare class OpenAITranscriptionModel implements TranscriptionModelV3 {
175
158
  readonly modelId: OpenAITranscriptionModelId;
176
159
  private readonly config;
177
- readonly specificationVersion = "v2";
160
+ readonly specificationVersion = "v3";
178
161
  get provider(): string;
179
162
  constructor(modelId: OpenAITranscriptionModelId, config: OpenAITranscriptionModelConfig);
180
163
  private getArgs;
181
- doGenerate(options: OpenAITranscriptionCallOptions): Promise<Awaited<ReturnType<TranscriptionModelV2['doGenerate']>>>;
164
+ doGenerate(options: OpenAITranscriptionCallOptions): Promise<Awaited<ReturnType<TranscriptionModelV3['doGenerate']>>>;
182
165
  }
183
166
 
184
167
  type OpenAISpeechModelId = 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts' | (string & {});
168
+ declare const openaiSpeechProviderOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
169
+ instructions?: string | null | undefined;
170
+ speed?: number | null | undefined;
171
+ }>;
172
+ type OpenAISpeechCallOptions = InferSchema<typeof openaiSpeechProviderOptionsSchema>;
185
173
 
186
- declare const OpenAIProviderOptionsSchema: z.ZodObject<{
187
- instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
188
- speed: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodNumber>>>;
189
- }, z.core.$strip>;
190
- type OpenAISpeechCallOptions = z.infer<typeof OpenAIProviderOptionsSchema>;
191
174
  interface OpenAISpeechModelConfig extends OpenAIConfig {
192
175
  _internal?: {
193
176
  currentDate?: () => Date;
194
177
  };
195
178
  }
196
- declare class OpenAISpeechModel implements SpeechModelV2 {
179
+ declare class OpenAISpeechModel implements SpeechModelV3 {
197
180
  readonly modelId: OpenAISpeechModelId;
198
181
  private readonly config;
199
- readonly specificationVersion = "v2";
182
+ readonly specificationVersion = "v3";
200
183
  get provider(): string;
201
184
  constructor(modelId: OpenAISpeechModelId, config: OpenAISpeechModelConfig);
202
185
  private getArgs;
203
- doGenerate(options: Parameters<SpeechModelV2['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV2['doGenerate']>>>;
186
+ doGenerate(options: Parameters<SpeechModelV3['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV3['doGenerate']>>>;
204
187
  }
205
188
 
206
- type OpenAIResponsesModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | '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-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4' | 'gpt-4-0613' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | (string & {});
189
+ 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 & {});
207
190
 
208
191
  declare class OpenAIResponsesLanguageModel implements LanguageModelV3 {
209
192
  readonly specificationVersion = "v3";
@@ -216,56 +199,150 @@ declare class OpenAIResponsesLanguageModel implements LanguageModelV3 {
216
199
  doGenerate(options: Parameters<LanguageModelV3['doGenerate']>[0]): Promise<Awaited<ReturnType<LanguageModelV3['doGenerate']>>>;
217
200
  doStream(options: Parameters<LanguageModelV3['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV3['doStream']>>>;
218
201
  }
219
- declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
220
- include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
221
- "file_search_call.results": "file_search_call.results";
222
- "message.output_text.logprobs": "message.output_text.logprobs";
223
- "reasoning.encrypted_content": "reasoning.encrypted_content";
224
- }>>>>;
225
- instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
226
- logprobs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber]>>;
227
- maxToolCalls: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
228
- metadata: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
229
- parallelToolCalls: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
230
- previousResponseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
231
- promptCacheKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
232
- reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
233
- reasoningSummary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
234
- safetyIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
235
- serviceTier: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
236
- auto: "auto";
237
- flex: "flex";
238
- priority: "priority";
239
- }>>>;
240
- store: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
241
- strictJsonSchema: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
242
- textVerbosity: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
243
- low: "low";
244
- medium: "medium";
245
- high: "high";
246
- }>>>;
247
- user: z.ZodOptional<z.ZodNullable<z.ZodString>>;
248
- }, z.core.$strip>;
249
- type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
250
202
 
251
- declare const codeInterpreterInputSchema: z.ZodObject<{
252
- code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
253
- containerId: z.ZodString;
254
- }, z.core.$strip>;
255
- declare const codeInterpreterOutputSchema: z.ZodObject<{
256
- outputs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
257
- type: z.ZodLiteral<"logs">;
258
- logs: z.ZodString;
259
- }, z.core.$strip>, z.ZodObject<{
260
- type: z.ZodLiteral<"image">;
261
- url: z.ZodString;
262
- }, z.core.$strip>]>>>>;
263
- }, z.core.$strip>;
264
- declare const codeInterpreterArgsSchema: z.ZodObject<{
265
- container: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
266
- fileIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
267
- }, z.core.$strip>]>>;
268
- }, z.core.$strip>;
203
+ /**
204
+ * Schema for the apply_patch input - what the model sends.
205
+ *
206
+ * Refer the official spec here: https://platform.openai.com/docs/api-reference/responses/create#responses_create-input-input_item_list-item-apply_patch_tool_call
207
+ *
208
+ */
209
+ declare const applyPatchInputSchema: _ai_sdk_provider_utils.LazySchema<{
210
+ callId: string;
211
+ operation: {
212
+ type: "create_file";
213
+ path: string;
214
+ diff: string;
215
+ } | {
216
+ type: "delete_file";
217
+ path: string;
218
+ } | {
219
+ type: "update_file";
220
+ path: string;
221
+ diff: string;
222
+ };
223
+ }>;
224
+ /**
225
+ * Schema for the apply_patch output - what we send back.
226
+ */
227
+ declare const applyPatchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
228
+ status: "completed" | "failed";
229
+ output?: string | undefined;
230
+ }>;
231
+ /**
232
+ * Schema for tool arguments (configuration options).
233
+ * The apply_patch tool doesn't require any configuration options.
234
+ */
235
+ declare const applyPatchArgsSchema: _ai_sdk_provider_utils.LazySchema<Record<string, never>>;
236
+ /**
237
+ * Type definitions for the apply_patch operations.
238
+ */
239
+ type ApplyPatchOperation = {
240
+ type: 'create_file';
241
+ /**
242
+ * Path of the file to create relative to the workspace root.
243
+ */
244
+ path: string;
245
+ /**
246
+ * Unified diff content to apply when creating the file.
247
+ */
248
+ diff: string;
249
+ } | {
250
+ type: 'delete_file';
251
+ /**
252
+ * Path of the file to delete relative to the workspace root.
253
+ */
254
+ path: string;
255
+ } | {
256
+ type: 'update_file';
257
+ /**
258
+ * Path of the file to update relative to the workspace root.
259
+ */
260
+ path: string;
261
+ /**
262
+ * Unified diff content to apply to the existing file.
263
+ */
264
+ diff: string;
265
+ };
266
+ /**
267
+ * The apply_patch tool lets GPT-5.1 create, update, and delete files in your
268
+ * codebase using structured diffs. Instead of just suggesting edits, the model
269
+ * emits patch operations that your application applies and then reports back on,
270
+ * enabling iterative, multi-step code editing workflows.
271
+ *
272
+ * The tool factory creates a provider-defined tool that:
273
+ * - Receives patch operations from the model (create_file, update_file, delete_file)
274
+ * - Returns the status of applying those patches (completed or failed)
275
+ *
276
+ */
277
+ declare const applyPatchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
278
+ /**
279
+ * The unique ID of the apply patch tool call generated by the model.
280
+ */
281
+ callId: string;
282
+ /**
283
+ * The specific create, delete, or update instruction for the apply_patch tool call.
284
+ */
285
+ operation: ApplyPatchOperation;
286
+ }, {
287
+ /**
288
+ * The status of the apply patch tool call output.
289
+ * - 'completed': The patch was applied successfully.
290
+ * - 'failed': The patch failed to apply.
291
+ */
292
+ status: "completed" | "failed";
293
+ /**
294
+ * Optional human-readable log text from the apply patch tool
295
+ * (e.g., patch results or errors).
296
+ */
297
+ output?: string;
298
+ }, {}>;
299
+ /**
300
+ * The apply_patch tool lets GPT-5.1 create, update, and delete files in your
301
+ * codebase using structured diffs. Instead of just suggesting edits, the model
302
+ * emits patch operations that your application applies and then reports back on,
303
+ * enabling iterative, multi-step code editing workflows.
304
+ */
305
+ declare const applyPatch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
306
+ /**
307
+ * The unique ID of the apply patch tool call generated by the model.
308
+ */
309
+ callId: string;
310
+ /**
311
+ * The specific create, delete, or update instruction for the apply_patch tool call.
312
+ */
313
+ operation: ApplyPatchOperation;
314
+ }, {
315
+ /**
316
+ * The status of the apply patch tool call output.
317
+ * - 'completed': The patch was applied successfully.
318
+ * - 'failed': The patch failed to apply.
319
+ */
320
+ status: "completed" | "failed";
321
+ /**
322
+ * Optional human-readable log text from the apply patch tool
323
+ * (e.g., patch results or errors).
324
+ */
325
+ output?: string;
326
+ }, {}>;
327
+
328
+ declare const codeInterpreterInputSchema: _ai_sdk_provider_utils.LazySchema<{
329
+ containerId: string;
330
+ code?: string | null | undefined;
331
+ }>;
332
+ declare const codeInterpreterOutputSchema: _ai_sdk_provider_utils.LazySchema<{
333
+ outputs?: ({
334
+ type: "logs";
335
+ logs: string;
336
+ } | {
337
+ type: "image";
338
+ url: string;
339
+ })[] | null | undefined;
340
+ }>;
341
+ declare const codeInterpreterArgsSchema: _ai_sdk_provider_utils.LazySchema<{
342
+ container?: string | {
343
+ fileIds?: string[] | undefined;
344
+ } | undefined;
345
+ }>;
269
346
  type CodeInterpreterArgs = {
270
347
  /**
271
348
  * The code interpreter container.
@@ -276,7 +353,7 @@ type CodeInterpreterArgs = {
276
353
  fileIds?: string[];
277
354
  };
278
355
  };
279
- declare const codeInterpreterToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
356
+ declare const codeInterpreterToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
280
357
  /**
281
358
  * The code to run, or null if not available.
282
359
  */
@@ -342,13 +419,13 @@ type OpenAIResponsesFileSearchToolComparisonFilter = {
342
419
  */
343
420
  key: string;
344
421
  /**
345
- * Specifies the comparison operator: eq, ne, gt, gte, lt, lte.
422
+ * Specifies the comparison operator: eq, ne, gt, gte, lt, lte, in, nin.
346
423
  */
347
- type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
424
+ type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin';
348
425
  /**
349
- * The value to compare against the attribute key; supports string, number, or boolean types.
426
+ * The value to compare against the attribute key; supports string, number, boolean, or array of string types.
350
427
  */
351
- value: string | number | boolean;
428
+ value: string | number | boolean | string[];
352
429
  };
353
430
  /**
354
431
  * Combine multiple filters using and or or.
@@ -364,37 +441,26 @@ type OpenAIResponsesFileSearchToolCompoundFilter = {
364
441
  filters: Array<OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter>;
365
442
  };
366
443
 
367
- declare const fileSearchArgsSchema: z.ZodObject<{
368
- vectorStoreIds: z.ZodArray<z.ZodString>;
369
- maxNumResults: z.ZodOptional<z.ZodNumber>;
370
- ranking: z.ZodOptional<z.ZodObject<{
371
- ranker: z.ZodOptional<z.ZodString>;
372
- scoreThreshold: z.ZodOptional<z.ZodNumber>;
373
- }, z.core.$strip>>;
374
- filters: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
375
- key: z.ZodString;
376
- type: z.ZodEnum<{
377
- lt: "lt";
378
- ne: "ne";
379
- eq: "eq";
380
- gt: "gt";
381
- gte: "gte";
382
- lte: "lte";
383
- }>;
384
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
385
- }, z.core.$strip>, z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>]>>;
386
- }, z.core.$strip>;
387
- declare const fileSearchOutputSchema: z.ZodObject<{
388
- queries: z.ZodArray<z.ZodString>;
389
- results: z.ZodNullable<z.ZodArray<z.ZodObject<{
390
- attributes: z.ZodRecord<z.ZodString, z.ZodUnknown>;
391
- fileId: z.ZodString;
392
- filename: z.ZodString;
393
- score: z.ZodNumber;
394
- text: z.ZodString;
395
- }, z.core.$strip>>>;
396
- }, z.core.$strip>;
397
- declare const fileSearch: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
444
+ declare const fileSearchArgsSchema: _ai_sdk_provider_utils.LazySchema<{
445
+ vectorStoreIds: string[];
446
+ maxNumResults?: number | undefined;
447
+ ranking?: {
448
+ ranker?: string | undefined;
449
+ scoreThreshold?: number | undefined;
450
+ } | undefined;
451
+ filters?: any;
452
+ }>;
453
+ declare const fileSearchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
454
+ queries: string[];
455
+ results: {
456
+ attributes: Record<string, unknown>;
457
+ fileId: string;
458
+ filename: string;
459
+ score: number;
460
+ text: string;
461
+ }[] | null;
462
+ }>;
463
+ declare const fileSearch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
398
464
  /**
399
465
  * The search query to execute.
400
466
  */
@@ -458,4 +524,168 @@ declare const fileSearch: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithO
458
524
  filters?: OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter;
459
525
  }>;
460
526
 
461
- export { OpenAIChatLanguageModel, type OpenAIChatLanguageModelOptions, type OpenAIChatModelId, OpenAICompletionLanguageModel, type OpenAICompletionModelId, type OpenAICompletionProviderOptions, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingProviderOptions, OpenAIImageModel, type OpenAIImageModelId, OpenAIResponsesLanguageModel, type OpenAIResponsesProviderOptions, type OpenAISpeechCallOptions, OpenAISpeechModel, type OpenAISpeechModelId, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionProviderOptions, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, hasDefaultResponseFormat, modelMaxImagesPerCall, openAITranscriptionProviderOptions, openaiChatLanguageModelOptions, openaiCompletionProviderOptions, openaiEmbeddingProviderOptions };
527
+ declare const imageGenerationArgsSchema: _ai_sdk_provider_utils.LazySchema<{
528
+ background?: "auto" | "opaque" | "transparent" | undefined;
529
+ inputFidelity?: "low" | "high" | undefined;
530
+ inputImageMask?: {
531
+ fileId?: string | undefined;
532
+ imageUrl?: string | undefined;
533
+ } | undefined;
534
+ model?: string | undefined;
535
+ moderation?: "auto" | undefined;
536
+ outputCompression?: number | undefined;
537
+ outputFormat?: "png" | "jpeg" | "webp" | undefined;
538
+ partialImages?: number | undefined;
539
+ quality?: "auto" | "low" | "medium" | "high" | undefined;
540
+ size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024" | undefined;
541
+ }>;
542
+ declare const imageGenerationOutputSchema: _ai_sdk_provider_utils.LazySchema<{
543
+ result: string;
544
+ }>;
545
+ type ImageGenerationArgs = {
546
+ /**
547
+ * Background type for the generated image. Default is 'auto'.
548
+ */
549
+ background?: 'auto' | 'opaque' | 'transparent';
550
+ /**
551
+ * Input fidelity for the generated image. Default is 'low'.
552
+ */
553
+ inputFidelity?: 'low' | 'high';
554
+ /**
555
+ * Optional mask for inpainting.
556
+ * Contains image_url (string, optional) and file_id (string, optional).
557
+ */
558
+ inputImageMask?: {
559
+ /**
560
+ * File ID for the mask image.
561
+ */
562
+ fileId?: string;
563
+ /**
564
+ * Base64-encoded mask image.
565
+ */
566
+ imageUrl?: string;
567
+ };
568
+ /**
569
+ * The image generation model to use. Default: gpt-image-1.
570
+ */
571
+ model?: string;
572
+ /**
573
+ * Moderation level for the generated image. Default: auto.
574
+ */
575
+ moderation?: 'auto';
576
+ /**
577
+ * Compression level for the output image. Default: 100.
578
+ */
579
+ outputCompression?: number;
580
+ /**
581
+ * The output format of the generated image. One of png, webp, or jpeg.
582
+ * Default: png
583
+ */
584
+ outputFormat?: 'png' | 'jpeg' | 'webp';
585
+ /**
586
+ * Number of partial images to generate in streaming mode, from 0 (default value) to 3.
587
+ */
588
+ partialImages?: number;
589
+ /**
590
+ * The quality of the generated image.
591
+ * One of low, medium, high, or auto. Default: auto.
592
+ */
593
+ quality?: 'auto' | 'low' | 'medium' | 'high';
594
+ /**
595
+ * The size of the generated image.
596
+ * One of 1024x1024, 1024x1536, 1536x1024, or auto.
597
+ * Default: auto.
598
+ */
599
+ size?: 'auto' | '1024x1024' | '1024x1536' | '1536x1024';
600
+ };
601
+ declare const imageGeneration: (args?: ImageGenerationArgs) => _ai_sdk_provider_utils.Tool<{}, {
602
+ /**
603
+ * The generated image encoded in base64.
604
+ */
605
+ result: string;
606
+ }>;
607
+
608
+ declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
609
+ searchContextSize?: "low" | "medium" | "high" | undefined;
610
+ userLocation?: {
611
+ type: "approximate";
612
+ country?: string | undefined;
613
+ city?: string | undefined;
614
+ region?: string | undefined;
615
+ timezone?: string | undefined;
616
+ } | undefined;
617
+ }>;
618
+ declare const webSearchPreviewInputSchema: _ai_sdk_provider_utils.LazySchema<Record<string, never>>;
619
+ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
620
+ /**
621
+ * An object describing the specific action taken in this web search call.
622
+ * Includes details on how the model used the web (search, open_page, find_in_page).
623
+ */
624
+ action: {
625
+ /**
626
+ * Action type "search" - Performs a web search query.
627
+ */
628
+ type: "search";
629
+ /**
630
+ * The search query.
631
+ */
632
+ query?: string;
633
+ } | {
634
+ /**
635
+ * Action type "openPage" - Opens a specific URL from search results.
636
+ */
637
+ type: "openPage";
638
+ /**
639
+ * The URL opened by the model.
640
+ */
641
+ url?: string | null;
642
+ } | {
643
+ /**
644
+ * Action type "findInPage": Searches for a pattern within a loaded page.
645
+ */
646
+ type: "findInPage";
647
+ /**
648
+ * The URL of the page searched for the pattern.
649
+ */
650
+ url?: string | null;
651
+ /**
652
+ * The pattern or text to search for within the page.
653
+ */
654
+ pattern?: string | null;
655
+ };
656
+ }, {
657
+ /**
658
+ * Search context size to use for the web search.
659
+ * - high: Most comprehensive context, highest cost, slower response
660
+ * - medium: Balanced context, cost, and latency (default)
661
+ * - low: Least context, lowest cost, fastest response
662
+ */
663
+ searchContextSize?: "low" | "medium" | "high";
664
+ /**
665
+ * User location information to provide geographically relevant search results.
666
+ */
667
+ userLocation?: {
668
+ /**
669
+ * Type of location (always 'approximate')
670
+ */
671
+ type: "approximate";
672
+ /**
673
+ * Two-letter ISO country code (e.g., 'US', 'GB')
674
+ */
675
+ country?: string;
676
+ /**
677
+ * City name (free text, e.g., 'Minneapolis')
678
+ */
679
+ city?: string;
680
+ /**
681
+ * Region name (free text, e.g., 'Minnesota')
682
+ */
683
+ region?: string;
684
+ /**
685
+ * IANA timezone (e.g., 'America/Chicago')
686
+ */
687
+ timezone?: string;
688
+ };
689
+ }>;
690
+
691
+ export { type ApplyPatchOperation, OpenAIChatLanguageModel, type OpenAIChatLanguageModelOptions, type OpenAIChatModelId, OpenAICompletionLanguageModel, type OpenAICompletionModelId, type OpenAICompletionProviderOptions, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingProviderOptions, OpenAIImageModel, type OpenAIImageModelId, OpenAIResponsesLanguageModel, type OpenAISpeechCallOptions, OpenAISpeechModel, type OpenAISpeechModelId, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionProviderOptions, applyPatch, applyPatchArgsSchema, applyPatchInputSchema, applyPatchOutputSchema, applyPatchToolFactory, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, hasDefaultResponseFormat, imageGeneration, imageGenerationArgsSchema, imageGenerationOutputSchema, modelMaxImagesPerCall, openAITranscriptionProviderOptions, openaiChatLanguageModelOptions, openaiCompletionProviderOptions, openaiEmbeddingProviderOptions, openaiSpeechProviderOptionsSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema };