@ai-sdk/openai 3.0.0-beta.73 → 3.0.0-beta.75

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.
@@ -13,7 +13,6 @@ declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<
13
13
  store?: boolean | undefined;
14
14
  metadata?: Record<string, string> | undefined;
15
15
  prediction?: Record<string, any> | undefined;
16
- structuredOutputs?: boolean | undefined;
17
16
  serviceTier?: "default" | "auto" | "flex" | "priority" | undefined;
18
17
  strictJsonSchema?: boolean | undefined;
19
18
  textVerbosity?: "low" | "medium" | "high" | undefined;
@@ -201,6 +200,133 @@ declare class OpenAIResponsesLanguageModel implements LanguageModelV3 {
201
200
  doStream(options: Parameters<LanguageModelV3['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV3['doStream']>>>;
202
201
  }
203
202
 
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
+ * Creates an apply_patch tool instance.
301
+ *
302
+ * The apply_patch tool lets GPT-5.1 create, update, and delete files in your
303
+ * codebase using structured diffs.
304
+ *
305
+ * @returns A provider-defined tool for applying patches.
306
+ */
307
+ declare const applyPatch: () => _ai_sdk_provider_utils.Tool<{
308
+ /**
309
+ * The unique ID of the apply patch tool call generated by the model.
310
+ */
311
+ callId: string;
312
+ /**
313
+ * The specific create, delete, or update instruction for the apply_patch tool call.
314
+ */
315
+ operation: ApplyPatchOperation;
316
+ }, {
317
+ /**
318
+ * The status of the apply patch tool call output.
319
+ * - 'completed': The patch was applied successfully.
320
+ * - 'failed': The patch failed to apply.
321
+ */
322
+ status: "completed" | "failed";
323
+ /**
324
+ * Optional human-readable log text from the apply patch tool
325
+ * (e.g., patch results or errors).
326
+ */
327
+ output?: string;
328
+ }>;
329
+
204
330
  declare const codeInterpreterInputSchema: _ai_sdk_provider_utils.LazySchema<{
205
331
  containerId: string;
206
332
  code?: string | null | undefined;
@@ -564,4 +690,4 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOu
564
690
  };
565
691
  }>;
566
692
 
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 };
693
+ 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 };
@@ -13,7 +13,6 @@ declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<
13
13
  store?: boolean | undefined;
14
14
  metadata?: Record<string, string> | undefined;
15
15
  prediction?: Record<string, any> | undefined;
16
- structuredOutputs?: boolean | undefined;
17
16
  serviceTier?: "default" | "auto" | "flex" | "priority" | undefined;
18
17
  strictJsonSchema?: boolean | undefined;
19
18
  textVerbosity?: "low" | "medium" | "high" | undefined;
@@ -201,6 +200,133 @@ declare class OpenAIResponsesLanguageModel implements LanguageModelV3 {
201
200
  doStream(options: Parameters<LanguageModelV3['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV3['doStream']>>>;
202
201
  }
203
202
 
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
+ * Creates an apply_patch tool instance.
301
+ *
302
+ * The apply_patch tool lets GPT-5.1 create, update, and delete files in your
303
+ * codebase using structured diffs.
304
+ *
305
+ * @returns A provider-defined tool for applying patches.
306
+ */
307
+ declare const applyPatch: () => _ai_sdk_provider_utils.Tool<{
308
+ /**
309
+ * The unique ID of the apply patch tool call generated by the model.
310
+ */
311
+ callId: string;
312
+ /**
313
+ * The specific create, delete, or update instruction for the apply_patch tool call.
314
+ */
315
+ operation: ApplyPatchOperation;
316
+ }, {
317
+ /**
318
+ * The status of the apply patch tool call output.
319
+ * - 'completed': The patch was applied successfully.
320
+ * - 'failed': The patch failed to apply.
321
+ */
322
+ status: "completed" | "failed";
323
+ /**
324
+ * Optional human-readable log text from the apply patch tool
325
+ * (e.g., patch results or errors).
326
+ */
327
+ output?: string;
328
+ }>;
329
+
204
330
  declare const codeInterpreterInputSchema: _ai_sdk_provider_utils.LazySchema<{
205
331
  containerId: string;
206
332
  code?: string | null | undefined;
@@ -564,4 +690,4 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOu
564
690
  };
565
691
  }>;
566
692
 
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 };
693
+ 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 };