@ai-sdk/openai 3.0.7 → 3.0.9

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.
@@ -202,6 +202,411 @@ declare class OpenAIResponsesLanguageModel implements LanguageModelV3 {
202
202
  doStream(options: LanguageModelV3CallOptions): Promise<LanguageModelV3StreamResult>;
203
203
  }
204
204
 
205
+ /**
206
+ * A filter used to compare a specified attribute key to a given value using a defined comparison operation.
207
+ */
208
+ type OpenAIResponsesFileSearchToolComparisonFilter = {
209
+ /**
210
+ * The key to compare against the value.
211
+ */
212
+ key: string;
213
+ /**
214
+ * Specifies the comparison operator: eq, ne, gt, gte, lt, lte, in, nin.
215
+ */
216
+ type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin';
217
+ /**
218
+ * The value to compare against the attribute key; supports string, number, boolean, or array of string types.
219
+ */
220
+ value: string | number | boolean | string[];
221
+ };
222
+ /**
223
+ * Combine multiple filters using and or or.
224
+ */
225
+ type OpenAIResponsesFileSearchToolCompoundFilter = {
226
+ /**
227
+ * Type of operation: and or or.
228
+ */
229
+ type: 'and' | 'or';
230
+ /**
231
+ * Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.
232
+ */
233
+ filters: Array<OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter>;
234
+ };
235
+ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
236
+ type: "unknown_chunk";
237
+ message: string;
238
+ } | {
239
+ type: "response.output_text.delta";
240
+ item_id: string;
241
+ delta: string;
242
+ logprobs?: {
243
+ token: string;
244
+ logprob: number;
245
+ top_logprobs: {
246
+ token: string;
247
+ logprob: number;
248
+ }[];
249
+ }[] | null | undefined;
250
+ } | {
251
+ type: "response.completed" | "response.incomplete";
252
+ response: {
253
+ usage: {
254
+ input_tokens: number;
255
+ output_tokens: number;
256
+ input_tokens_details?: {
257
+ cached_tokens?: number | null | undefined;
258
+ } | null | undefined;
259
+ output_tokens_details?: {
260
+ reasoning_tokens?: number | null | undefined;
261
+ } | null | undefined;
262
+ };
263
+ incomplete_details?: {
264
+ reason: string;
265
+ } | null | undefined;
266
+ service_tier?: string | null | undefined;
267
+ };
268
+ } | {
269
+ type: "response.created";
270
+ response: {
271
+ id: string;
272
+ created_at: number;
273
+ model: string;
274
+ service_tier?: string | null | undefined;
275
+ };
276
+ } | {
277
+ type: "response.output_item.added";
278
+ output_index: number;
279
+ item: {
280
+ type: "message";
281
+ id: string;
282
+ } | {
283
+ type: "reasoning";
284
+ id: string;
285
+ encrypted_content?: string | null | undefined;
286
+ } | {
287
+ type: "function_call";
288
+ id: string;
289
+ call_id: string;
290
+ name: string;
291
+ arguments: string;
292
+ } | {
293
+ type: "web_search_call";
294
+ id: string;
295
+ status: string;
296
+ } | {
297
+ type: "computer_call";
298
+ id: string;
299
+ status: string;
300
+ } | {
301
+ type: "file_search_call";
302
+ id: string;
303
+ } | {
304
+ type: "image_generation_call";
305
+ id: string;
306
+ } | {
307
+ type: "code_interpreter_call";
308
+ id: string;
309
+ container_id: string;
310
+ code: string | null;
311
+ outputs: ({
312
+ type: "logs";
313
+ logs: string;
314
+ } | {
315
+ type: "image";
316
+ url: string;
317
+ })[] | null;
318
+ status: string;
319
+ } | {
320
+ type: "mcp_call";
321
+ id: string;
322
+ status: string;
323
+ approval_request_id?: string | null | undefined;
324
+ } | {
325
+ type: "mcp_list_tools";
326
+ id: string;
327
+ } | {
328
+ type: "mcp_approval_request";
329
+ id: string;
330
+ } | {
331
+ type: "apply_patch_call";
332
+ id: string;
333
+ call_id: string;
334
+ status: "completed" | "in_progress";
335
+ operation: {
336
+ type: "create_file";
337
+ path: string;
338
+ diff: string;
339
+ } | {
340
+ type: "delete_file";
341
+ path: string;
342
+ } | {
343
+ type: "update_file";
344
+ path: string;
345
+ diff: string;
346
+ };
347
+ } | {
348
+ type: "shell_call";
349
+ id: string;
350
+ call_id: string;
351
+ status: "completed" | "in_progress" | "incomplete";
352
+ action: {
353
+ commands: string[];
354
+ };
355
+ };
356
+ } | {
357
+ type: "response.output_item.done";
358
+ output_index: number;
359
+ item: {
360
+ type: "message";
361
+ id: string;
362
+ } | {
363
+ type: "reasoning";
364
+ id: string;
365
+ encrypted_content?: string | null | undefined;
366
+ } | {
367
+ type: "function_call";
368
+ id: string;
369
+ call_id: string;
370
+ name: string;
371
+ arguments: string;
372
+ status: "completed";
373
+ } | {
374
+ type: "code_interpreter_call";
375
+ id: string;
376
+ code: string | null;
377
+ container_id: string;
378
+ outputs: ({
379
+ type: "logs";
380
+ logs: string;
381
+ } | {
382
+ type: "image";
383
+ url: string;
384
+ })[] | null;
385
+ } | {
386
+ type: "image_generation_call";
387
+ id: string;
388
+ result: string;
389
+ } | {
390
+ type: "web_search_call";
391
+ id: string;
392
+ status: string;
393
+ action: {
394
+ type: "search";
395
+ query?: string | null | undefined;
396
+ sources?: ({
397
+ type: "url";
398
+ url: string;
399
+ } | {
400
+ type: "api";
401
+ name: string;
402
+ })[] | null | undefined;
403
+ } | {
404
+ type: "open_page";
405
+ url?: string | null | undefined;
406
+ } | {
407
+ type: "find_in_page";
408
+ url?: string | null | undefined;
409
+ pattern?: string | null | undefined;
410
+ };
411
+ } | {
412
+ type: "file_search_call";
413
+ id: string;
414
+ queries: string[];
415
+ results?: {
416
+ attributes: Record<string, string | number | boolean>;
417
+ file_id: string;
418
+ filename: string;
419
+ score: number;
420
+ text: string;
421
+ }[] | null | undefined;
422
+ } | {
423
+ type: "local_shell_call";
424
+ id: string;
425
+ call_id: string;
426
+ action: {
427
+ type: "exec";
428
+ command: string[];
429
+ timeout_ms?: number | undefined;
430
+ user?: string | undefined;
431
+ working_directory?: string | undefined;
432
+ env?: Record<string, string> | undefined;
433
+ };
434
+ } | {
435
+ type: "computer_call";
436
+ id: string;
437
+ status: "completed";
438
+ } | {
439
+ type: "mcp_call";
440
+ id: string;
441
+ status: string;
442
+ arguments: string;
443
+ name: string;
444
+ server_label: string;
445
+ output?: string | null | undefined;
446
+ error?: string | {
447
+ [x: string]: unknown;
448
+ type?: string | undefined;
449
+ code?: string | number | undefined;
450
+ message?: string | undefined;
451
+ } | null | undefined;
452
+ approval_request_id?: string | null | undefined;
453
+ } | {
454
+ type: "mcp_list_tools";
455
+ id: string;
456
+ server_label: string;
457
+ tools: {
458
+ name: string;
459
+ input_schema: any;
460
+ description?: string | undefined;
461
+ annotations?: Record<string, unknown> | undefined;
462
+ }[];
463
+ error?: string | {
464
+ [x: string]: unknown;
465
+ type?: string | undefined;
466
+ code?: string | number | undefined;
467
+ message?: string | undefined;
468
+ } | undefined;
469
+ } | {
470
+ type: "mcp_approval_request";
471
+ id: string;
472
+ server_label: string;
473
+ name: string;
474
+ arguments: string;
475
+ approval_request_id?: string | undefined;
476
+ } | {
477
+ type: "apply_patch_call";
478
+ id: string;
479
+ call_id: string;
480
+ status: "completed" | "in_progress";
481
+ operation: {
482
+ type: "create_file";
483
+ path: string;
484
+ diff: string;
485
+ } | {
486
+ type: "delete_file";
487
+ path: string;
488
+ } | {
489
+ type: "update_file";
490
+ path: string;
491
+ diff: string;
492
+ };
493
+ } | {
494
+ type: "shell_call";
495
+ id: string;
496
+ call_id: string;
497
+ status: "completed" | "in_progress" | "incomplete";
498
+ action: {
499
+ commands: string[];
500
+ };
501
+ };
502
+ } | {
503
+ type: "response.function_call_arguments.delta";
504
+ item_id: string;
505
+ output_index: number;
506
+ delta: string;
507
+ } | {
508
+ type: "response.image_generation_call.partial_image";
509
+ item_id: string;
510
+ output_index: number;
511
+ partial_image_b64: string;
512
+ } | {
513
+ type: "response.code_interpreter_call_code.delta";
514
+ item_id: string;
515
+ output_index: number;
516
+ delta: string;
517
+ } | {
518
+ type: "response.code_interpreter_call_code.done";
519
+ item_id: string;
520
+ output_index: number;
521
+ code: string;
522
+ } | {
523
+ type: "response.output_text.annotation.added";
524
+ annotation: {
525
+ type: "url_citation";
526
+ start_index: number;
527
+ end_index: number;
528
+ url: string;
529
+ title: string;
530
+ } | {
531
+ type: "file_citation";
532
+ file_id: string;
533
+ filename: string;
534
+ index: number;
535
+ } | {
536
+ type: "container_file_citation";
537
+ container_id: string;
538
+ file_id: string;
539
+ filename: string;
540
+ start_index: number;
541
+ end_index: number;
542
+ } | {
543
+ type: "file_path";
544
+ file_id: string;
545
+ index: number;
546
+ };
547
+ } | {
548
+ type: "response.reasoning_summary_part.added";
549
+ item_id: string;
550
+ summary_index: number;
551
+ } | {
552
+ type: "response.reasoning_summary_text.delta";
553
+ item_id: string;
554
+ summary_index: number;
555
+ delta: string;
556
+ } | {
557
+ type: "response.reasoning_summary_part.done";
558
+ item_id: string;
559
+ summary_index: number;
560
+ } | {
561
+ type: "response.apply_patch_call_operation_diff.delta";
562
+ item_id: string;
563
+ output_index: number;
564
+ delta: string;
565
+ obfuscation?: string | null | undefined;
566
+ } | {
567
+ type: "response.apply_patch_call_operation_diff.done";
568
+ item_id: string;
569
+ output_index: number;
570
+ diff: string;
571
+ } | {
572
+ type: "error";
573
+ sequence_number: number;
574
+ error: {
575
+ type: string;
576
+ code: string;
577
+ message: string;
578
+ param?: string | null | undefined;
579
+ };
580
+ }>;
581
+
582
+ type OpenaiResponsesChunk = InferSchema<typeof openaiResponsesChunkSchema>;
583
+ type ResponsesOutputTextAnnotationProviderMetadata = Extract<OpenaiResponsesChunk, {
584
+ type: 'response.output_text.annotation.added';
585
+ }>['annotation'];
586
+ type ResponsesTextProviderMetadata = {
587
+ itemId: string;
588
+ annotations?: Array<ResponsesOutputTextAnnotationProviderMetadata>;
589
+ };
590
+ type OpenaiResponsesTextProviderMetadata = {
591
+ openai: ResponsesTextProviderMetadata;
592
+ };
593
+ type ResponsesSourceDocumentProviderMetadata = {
594
+ type: 'file_citation';
595
+ fileId: string;
596
+ index: number;
597
+ } | {
598
+ type: 'container_file_citation';
599
+ fileId: string;
600
+ containerId: string;
601
+ } | {
602
+ type: 'file_path';
603
+ fileId: string;
604
+ index: number;
605
+ };
606
+ type OpenaiResponsesSourceDocumentProviderMetadata = {
607
+ openai: ResponsesSourceDocumentProviderMetadata;
608
+ };
609
+
205
610
  /**
206
611
  * Schema for the apply_patch input - what the model sends.
207
612
  *
@@ -412,37 +817,6 @@ declare const codeInterpreter: (args?: CodeInterpreterArgs) => _ai_sdk_provider_
412
817
  }> | null;
413
818
  }>;
414
819
 
415
- /**
416
- * A filter used to compare a specified attribute key to a given value using a defined comparison operation.
417
- */
418
- type OpenAIResponsesFileSearchToolComparisonFilter = {
419
- /**
420
- * The key to compare against the value.
421
- */
422
- key: string;
423
- /**
424
- * Specifies the comparison operator: eq, ne, gt, gte, lt, lte, in, nin.
425
- */
426
- type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin';
427
- /**
428
- * The value to compare against the attribute key; supports string, number, boolean, or array of string types.
429
- */
430
- value: string | number | boolean | string[];
431
- };
432
- /**
433
- * Combine multiple filters using and or or.
434
- */
435
- type OpenAIResponsesFileSearchToolCompoundFilter = {
436
- /**
437
- * Type of operation: and or or.
438
- */
439
- type: 'and' | 'or';
440
- /**
441
- * Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.
442
- */
443
- filters: Array<OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter>;
444
- };
445
-
446
820
  declare const fileSearchArgsSchema: _ai_sdk_provider_utils.LazySchema<{
447
821
  vectorStoreIds: string[];
448
822
  maxNumResults?: number | undefined;
@@ -690,4 +1064,4 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOu
690
1064
  };
691
1065
  }>;
692
1066
 
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 };
1067
+ 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, type OpenaiResponsesSourceDocumentProviderMetadata, type OpenaiResponsesTextProviderMetadata, type ResponsesSourceDocumentProviderMetadata, type ResponsesTextProviderMetadata, 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 };