@ai-sdk/openai 3.0.0-beta.73 → 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.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +55 -1
- package/dist/index.d.ts +55 -1
- package/dist/index.js +960 -766
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +926 -728
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +128 -1
- package/dist/internal/index.d.ts +128 -1
- package/dist/internal/index.js +903 -707
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +883 -688
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -564,4 +691,4 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOu
|
|
|
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 };
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -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;
|
|
@@ -564,4 +691,4 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOu
|
|
|
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 };
|