@ai-sdk/openai 3.0.0-beta.72 → 3.0.0-beta.74

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.
@@ -201,6 +201,133 @@ declare class OpenAIResponsesLanguageModel implements LanguageModelV3 {
201
201
  doStream(options: Parameters<LanguageModelV3['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV3['doStream']>>>;
202
202
  }
203
203
 
204
+ /**
205
+ * Schema for the apply_patch input - what the model sends.
206
+ *
207
+ * 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
208
+ *
209
+ */
210
+ declare const applyPatchInputSchema: _ai_sdk_provider_utils.LazySchema<{
211
+ callId: string;
212
+ operation: {
213
+ type: "create_file";
214
+ path: string;
215
+ diff: string;
216
+ } | {
217
+ type: "delete_file";
218
+ path: string;
219
+ } | {
220
+ type: "update_file";
221
+ path: string;
222
+ diff: string;
223
+ };
224
+ }>;
225
+ /**
226
+ * Schema for the apply_patch output - what we send back.
227
+ */
228
+ declare const applyPatchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
229
+ status: "completed" | "failed";
230
+ output?: string | undefined;
231
+ }>;
232
+ /**
233
+ * Schema for tool arguments (configuration options).
234
+ * The apply_patch tool doesn't require any configuration options.
235
+ */
236
+ declare const applyPatchArgsSchema: _ai_sdk_provider_utils.LazySchema<Record<string, never>>;
237
+ /**
238
+ * Type definitions for the apply_patch operations.
239
+ */
240
+ type ApplyPatchOperation = {
241
+ type: 'create_file';
242
+ /**
243
+ * Path of the file to create relative to the workspace root.
244
+ */
245
+ path: string;
246
+ /**
247
+ * Unified diff content to apply when creating the file.
248
+ */
249
+ diff: string;
250
+ } | {
251
+ type: 'delete_file';
252
+ /**
253
+ * Path of the file to delete relative to the workspace root.
254
+ */
255
+ path: string;
256
+ } | {
257
+ type: 'update_file';
258
+ /**
259
+ * Path of the file to update relative to the workspace root.
260
+ */
261
+ path: string;
262
+ /**
263
+ * Unified diff content to apply to the existing file.
264
+ */
265
+ diff: string;
266
+ };
267
+ /**
268
+ * The apply_patch tool lets GPT-5.1 create, update, and delete files in your
269
+ * codebase using structured diffs. Instead of just suggesting edits, the model
270
+ * emits patch operations that your application applies and then reports back on,
271
+ * enabling iterative, multi-step code editing workflows.
272
+ *
273
+ * The tool factory creates a provider-defined tool that:
274
+ * - Receives patch operations from the model (create_file, update_file, delete_file)
275
+ * - Returns the status of applying those patches (completed or failed)
276
+ *
277
+ */
278
+ declare const applyPatchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
279
+ /**
280
+ * The unique ID of the apply patch tool call generated by the model.
281
+ */
282
+ callId: string;
283
+ /**
284
+ * The specific create, delete, or update instruction for the apply_patch tool call.
285
+ */
286
+ operation: ApplyPatchOperation;
287
+ }, {
288
+ /**
289
+ * The status of the apply patch tool call output.
290
+ * - 'completed': The patch was applied successfully.
291
+ * - 'failed': The patch failed to apply.
292
+ */
293
+ status: "completed" | "failed";
294
+ /**
295
+ * Optional human-readable log text from the apply patch tool
296
+ * (e.g., patch results or errors).
297
+ */
298
+ output?: string;
299
+ }, {}>;
300
+ /**
301
+ * Creates an apply_patch tool instance.
302
+ *
303
+ * The apply_patch tool lets GPT-5.1 create, update, and delete files in your
304
+ * codebase using structured diffs.
305
+ *
306
+ * @returns A provider-defined tool for applying patches.
307
+ */
308
+ declare const applyPatch: () => _ai_sdk_provider_utils.Tool<{
309
+ /**
310
+ * The unique ID of the apply patch tool call generated by the model.
311
+ */
312
+ callId: string;
313
+ /**
314
+ * The specific create, delete, or update instruction for the apply_patch tool call.
315
+ */
316
+ operation: ApplyPatchOperation;
317
+ }, {
318
+ /**
319
+ * The status of the apply patch tool call output.
320
+ * - 'completed': The patch was applied successfully.
321
+ * - 'failed': The patch failed to apply.
322
+ */
323
+ status: "completed" | "failed";
324
+ /**
325
+ * Optional human-readable log text from the apply patch tool
326
+ * (e.g., patch results or errors).
327
+ */
328
+ output?: string;
329
+ }>;
330
+
204
331
  declare const codeInterpreterInputSchema: _ai_sdk_provider_utils.LazySchema<{
205
332
  containerId: string;
206
333
  code?: string | null | undefined;
@@ -229,7 +356,7 @@ type CodeInterpreterArgs = {
229
356
  fileIds?: string[];
230
357
  };
231
358
  };
232
- declare const codeInterpreterToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
359
+ declare const codeInterpreterToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
233
360
  /**
234
361
  * The code to run, or null if not available.
235
362
  */
@@ -336,7 +463,7 @@ declare const fileSearchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
336
463
  text: string;
337
464
  }[] | null;
338
465
  }>;
339
- declare const fileSearch: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
466
+ declare const fileSearch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
340
467
  /**
341
468
  * The search query to execute.
342
469
  */
@@ -492,7 +619,7 @@ declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
492
619
  } | undefined;
493
620
  }>;
494
621
  declare const webSearchPreviewInputSchema: _ai_sdk_provider_utils.LazySchema<Record<string, never>>;
495
- declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
622
+ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
496
623
  /**
497
624
  * An object describing the specific action taken in this web search call.
498
625
  * Includes details on how the model used the web (search, open_page, find).
@@ -564,4 +691,4 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactor
564
691
  };
565
692
  }>;
566
693
 
567
- export { 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, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, hasDefaultResponseFormat, imageGeneration, imageGenerationArgsSchema, imageGenerationOutputSchema, modelMaxImagesPerCall, openAITranscriptionProviderOptions, openaiChatLanguageModelOptions, openaiCompletionProviderOptions, openaiEmbeddingProviderOptions, openaiSpeechProviderOptionsSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema };
694
+ 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 };
@@ -201,6 +201,133 @@ declare class OpenAIResponsesLanguageModel implements LanguageModelV3 {
201
201
  doStream(options: Parameters<LanguageModelV3['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV3['doStream']>>>;
202
202
  }
203
203
 
204
+ /**
205
+ * Schema for the apply_patch input - what the model sends.
206
+ *
207
+ * 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
208
+ *
209
+ */
210
+ declare const applyPatchInputSchema: _ai_sdk_provider_utils.LazySchema<{
211
+ callId: string;
212
+ operation: {
213
+ type: "create_file";
214
+ path: string;
215
+ diff: string;
216
+ } | {
217
+ type: "delete_file";
218
+ path: string;
219
+ } | {
220
+ type: "update_file";
221
+ path: string;
222
+ diff: string;
223
+ };
224
+ }>;
225
+ /**
226
+ * Schema for the apply_patch output - what we send back.
227
+ */
228
+ declare const applyPatchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
229
+ status: "completed" | "failed";
230
+ output?: string | undefined;
231
+ }>;
232
+ /**
233
+ * Schema for tool arguments (configuration options).
234
+ * The apply_patch tool doesn't require any configuration options.
235
+ */
236
+ declare const applyPatchArgsSchema: _ai_sdk_provider_utils.LazySchema<Record<string, never>>;
237
+ /**
238
+ * Type definitions for the apply_patch operations.
239
+ */
240
+ type ApplyPatchOperation = {
241
+ type: 'create_file';
242
+ /**
243
+ * Path of the file to create relative to the workspace root.
244
+ */
245
+ path: string;
246
+ /**
247
+ * Unified diff content to apply when creating the file.
248
+ */
249
+ diff: string;
250
+ } | {
251
+ type: 'delete_file';
252
+ /**
253
+ * Path of the file to delete relative to the workspace root.
254
+ */
255
+ path: string;
256
+ } | {
257
+ type: 'update_file';
258
+ /**
259
+ * Path of the file to update relative to the workspace root.
260
+ */
261
+ path: string;
262
+ /**
263
+ * Unified diff content to apply to the existing file.
264
+ */
265
+ diff: string;
266
+ };
267
+ /**
268
+ * The apply_patch tool lets GPT-5.1 create, update, and delete files in your
269
+ * codebase using structured diffs. Instead of just suggesting edits, the model
270
+ * emits patch operations that your application applies and then reports back on,
271
+ * enabling iterative, multi-step code editing workflows.
272
+ *
273
+ * The tool factory creates a provider-defined tool that:
274
+ * - Receives patch operations from the model (create_file, update_file, delete_file)
275
+ * - Returns the status of applying those patches (completed or failed)
276
+ *
277
+ */
278
+ declare const applyPatchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
279
+ /**
280
+ * The unique ID of the apply patch tool call generated by the model.
281
+ */
282
+ callId: string;
283
+ /**
284
+ * The specific create, delete, or update instruction for the apply_patch tool call.
285
+ */
286
+ operation: ApplyPatchOperation;
287
+ }, {
288
+ /**
289
+ * The status of the apply patch tool call output.
290
+ * - 'completed': The patch was applied successfully.
291
+ * - 'failed': The patch failed to apply.
292
+ */
293
+ status: "completed" | "failed";
294
+ /**
295
+ * Optional human-readable log text from the apply patch tool
296
+ * (e.g., patch results or errors).
297
+ */
298
+ output?: string;
299
+ }, {}>;
300
+ /**
301
+ * Creates an apply_patch tool instance.
302
+ *
303
+ * The apply_patch tool lets GPT-5.1 create, update, and delete files in your
304
+ * codebase using structured diffs.
305
+ *
306
+ * @returns A provider-defined tool for applying patches.
307
+ */
308
+ declare const applyPatch: () => _ai_sdk_provider_utils.Tool<{
309
+ /**
310
+ * The unique ID of the apply patch tool call generated by the model.
311
+ */
312
+ callId: string;
313
+ /**
314
+ * The specific create, delete, or update instruction for the apply_patch tool call.
315
+ */
316
+ operation: ApplyPatchOperation;
317
+ }, {
318
+ /**
319
+ * The status of the apply patch tool call output.
320
+ * - 'completed': The patch was applied successfully.
321
+ * - 'failed': The patch failed to apply.
322
+ */
323
+ status: "completed" | "failed";
324
+ /**
325
+ * Optional human-readable log text from the apply patch tool
326
+ * (e.g., patch results or errors).
327
+ */
328
+ output?: string;
329
+ }>;
330
+
204
331
  declare const codeInterpreterInputSchema: _ai_sdk_provider_utils.LazySchema<{
205
332
  containerId: string;
206
333
  code?: string | null | undefined;
@@ -229,7 +356,7 @@ type CodeInterpreterArgs = {
229
356
  fileIds?: string[];
230
357
  };
231
358
  };
232
- declare const codeInterpreterToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
359
+ declare const codeInterpreterToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
233
360
  /**
234
361
  * The code to run, or null if not available.
235
362
  */
@@ -336,7 +463,7 @@ declare const fileSearchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
336
463
  text: string;
337
464
  }[] | null;
338
465
  }>;
339
- declare const fileSearch: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
466
+ declare const fileSearch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
340
467
  /**
341
468
  * The search query to execute.
342
469
  */
@@ -492,7 +619,7 @@ declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
492
619
  } | undefined;
493
620
  }>;
494
621
  declare const webSearchPreviewInputSchema: _ai_sdk_provider_utils.LazySchema<Record<string, never>>;
495
- declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
622
+ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
496
623
  /**
497
624
  * An object describing the specific action taken in this web search call.
498
625
  * Includes details on how the model used the web (search, open_page, find).
@@ -564,4 +691,4 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactor
564
691
  };
565
692
  }>;
566
693
 
567
- export { 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, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, hasDefaultResponseFormat, imageGeneration, imageGenerationArgsSchema, imageGenerationOutputSchema, modelMaxImagesPerCall, openAITranscriptionProviderOptions, openaiChatLanguageModelOptions, openaiCompletionProviderOptions, openaiEmbeddingProviderOptions, openaiSpeechProviderOptionsSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema };
694
+ 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 };