@ai-sdk/openai 2.0.70 → 2.0.71

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.
@@ -477,4 +477,87 @@ declare const imageGeneration: (args?: ImageGenerationArgs) => _ai_sdk_provider_
477
477
  result: string;
478
478
  }>;
479
479
 
480
- 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 };
480
+ declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
481
+ searchContextSize?: "low" | "medium" | "high" | undefined;
482
+ userLocation?: {
483
+ type: "approximate";
484
+ country?: string | undefined;
485
+ city?: string | undefined;
486
+ region?: string | undefined;
487
+ timezone?: string | undefined;
488
+ } | undefined;
489
+ }>;
490
+ declare const webSearchPreviewInputSchema: _ai_sdk_provider_utils.LazySchema<Record<string, never>>;
491
+ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
492
+ /**
493
+ * An object describing the specific action taken in this web search call.
494
+ * Includes details on how the model used the web (search, open_page, find).
495
+ */
496
+ action: {
497
+ /**
498
+ * Action type "search" - Performs a web search query.
499
+ */
500
+ type: "search";
501
+ /**
502
+ * The search query.
503
+ */
504
+ query?: string;
505
+ } | {
506
+ /**
507
+ * Action type "openPage" - Opens a specific URL from search results.
508
+ */
509
+ type: "openPage";
510
+ /**
511
+ * The URL opened by the model.
512
+ */
513
+ url: string;
514
+ } | {
515
+ /**
516
+ * Action type "find": Searches for a pattern within a loaded page.
517
+ */
518
+ type: "find";
519
+ /**
520
+ * The URL of the page searched for the pattern.
521
+ */
522
+ url: string;
523
+ /**
524
+ * The pattern or text to search for within the page.
525
+ */
526
+ pattern: string;
527
+ };
528
+ }, {
529
+ /**
530
+ * Search context size to use for the web search.
531
+ * - high: Most comprehensive context, highest cost, slower response
532
+ * - medium: Balanced context, cost, and latency (default)
533
+ * - low: Least context, lowest cost, fastest response
534
+ */
535
+ searchContextSize?: "low" | "medium" | "high";
536
+ /**
537
+ * User location information to provide geographically relevant search results.
538
+ */
539
+ userLocation?: {
540
+ /**
541
+ * Type of location (always 'approximate')
542
+ */
543
+ type: "approximate";
544
+ /**
545
+ * Two-letter ISO country code (e.g., 'US', 'GB')
546
+ */
547
+ country?: string;
548
+ /**
549
+ * City name (free text, e.g., 'Minneapolis')
550
+ */
551
+ city?: string;
552
+ /**
553
+ * Region name (free text, e.g., 'Minnesota')
554
+ */
555
+ region?: string;
556
+ /**
557
+ * IANA timezone (e.g., 'America/Chicago')
558
+ */
559
+ timezone?: string;
560
+ };
561
+ }>;
562
+
563
+ 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 };
@@ -477,4 +477,87 @@ declare const imageGeneration: (args?: ImageGenerationArgs) => _ai_sdk_provider_
477
477
  result: string;
478
478
  }>;
479
479
 
480
- 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 };
480
+ declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
481
+ searchContextSize?: "low" | "medium" | "high" | undefined;
482
+ userLocation?: {
483
+ type: "approximate";
484
+ country?: string | undefined;
485
+ city?: string | undefined;
486
+ region?: string | undefined;
487
+ timezone?: string | undefined;
488
+ } | undefined;
489
+ }>;
490
+ declare const webSearchPreviewInputSchema: _ai_sdk_provider_utils.LazySchema<Record<string, never>>;
491
+ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
492
+ /**
493
+ * An object describing the specific action taken in this web search call.
494
+ * Includes details on how the model used the web (search, open_page, find).
495
+ */
496
+ action: {
497
+ /**
498
+ * Action type "search" - Performs a web search query.
499
+ */
500
+ type: "search";
501
+ /**
502
+ * The search query.
503
+ */
504
+ query?: string;
505
+ } | {
506
+ /**
507
+ * Action type "openPage" - Opens a specific URL from search results.
508
+ */
509
+ type: "openPage";
510
+ /**
511
+ * The URL opened by the model.
512
+ */
513
+ url: string;
514
+ } | {
515
+ /**
516
+ * Action type "find": Searches for a pattern within a loaded page.
517
+ */
518
+ type: "find";
519
+ /**
520
+ * The URL of the page searched for the pattern.
521
+ */
522
+ url: string;
523
+ /**
524
+ * The pattern or text to search for within the page.
525
+ */
526
+ pattern: string;
527
+ };
528
+ }, {
529
+ /**
530
+ * Search context size to use for the web search.
531
+ * - high: Most comprehensive context, highest cost, slower response
532
+ * - medium: Balanced context, cost, and latency (default)
533
+ * - low: Least context, lowest cost, fastest response
534
+ */
535
+ searchContextSize?: "low" | "medium" | "high";
536
+ /**
537
+ * User location information to provide geographically relevant search results.
538
+ */
539
+ userLocation?: {
540
+ /**
541
+ * Type of location (always 'approximate')
542
+ */
543
+ type: "approximate";
544
+ /**
545
+ * Two-letter ISO country code (e.g., 'US', 'GB')
546
+ */
547
+ country?: string;
548
+ /**
549
+ * City name (free text, e.g., 'Minneapolis')
550
+ */
551
+ city?: string;
552
+ /**
553
+ * Region name (free text, e.g., 'Minnesota')
554
+ */
555
+ region?: string;
556
+ /**
557
+ * IANA timezone (e.g., 'America/Chicago')
558
+ */
559
+ timezone?: string;
560
+ };
561
+ }>;
562
+
563
+ 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 };
@@ -44,7 +44,10 @@ __export(internal_exports, {
44
44
  openaiChatLanguageModelOptions: () => openaiChatLanguageModelOptions,
45
45
  openaiCompletionProviderOptions: () => openaiCompletionProviderOptions,
46
46
  openaiEmbeddingProviderOptions: () => openaiEmbeddingProviderOptions,
47
- openaiSpeechProviderOptionsSchema: () => openaiSpeechProviderOptionsSchema
47
+ openaiSpeechProviderOptionsSchema: () => openaiSpeechProviderOptionsSchema,
48
+ webSearchPreview: () => webSearchPreview,
49
+ webSearchPreviewArgsSchema: () => webSearchPreviewArgsSchema,
50
+ webSearchPreviewInputSchema: () => webSearchPreviewInputSchema
48
51
  });
49
52
  module.exports = __toCommonJS(internal_exports);
50
53
 
@@ -2683,6 +2686,8 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazyValidator)(
2683
2686
  annotation: import_v414.z.discriminatedUnion("type", [
2684
2687
  import_v414.z.object({
2685
2688
  type: import_v414.z.literal("url_citation"),
2689
+ start_index: import_v414.z.number(),
2690
+ end_index: import_v414.z.number(),
2686
2691
  url: import_v414.z.string(),
2687
2692
  title: import_v414.z.string()
2688
2693
  }),
@@ -3998,7 +4003,7 @@ var OpenAIResponsesLanguageModel = class {
3998
4003
  controller.enqueue({
3999
4004
  type: "tool-call",
4000
4005
  toolCallId: value.item.id,
4001
- toolName: "web_search",
4006
+ toolName: webSearchToolName != null ? webSearchToolName : "web_search",
4002
4007
  input: JSON.stringify({}),
4003
4008
  providerExecuted: true
4004
4009
  });
@@ -4099,7 +4104,7 @@ var OpenAIResponsesLanguageModel = class {
4099
4104
  controller.enqueue({
4100
4105
  type: "tool-result",
4101
4106
  toolCallId: value.item.id,
4102
- toolName: "web_search",
4107
+ toolName: webSearchToolName != null ? webSearchToolName : "web_search",
4103
4108
  result: mapWebSearchOutput(value.item.action),
4104
4109
  providerExecuted: true
4105
4110
  });
@@ -4499,6 +4504,9 @@ function mapWebSearchOutput(action) {
4499
4504
  openaiChatLanguageModelOptions,
4500
4505
  openaiCompletionProviderOptions,
4501
4506
  openaiEmbeddingProviderOptions,
4502
- openaiSpeechProviderOptionsSchema
4507
+ openaiSpeechProviderOptionsSchema,
4508
+ webSearchPreview,
4509
+ webSearchPreviewArgsSchema,
4510
+ webSearchPreviewInputSchema
4503
4511
  });
4504
4512
  //# sourceMappingURL=index.js.map