@ai-sdk/openai 2.0.70 → 2.0.72

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 2.0.72
4
+
5
+ ### Patch Changes
6
+
7
+ - 53d2fcc: added support for external_web_access parameter on web_search tool
8
+
9
+ ## 2.0.71
10
+
11
+ ### Patch Changes
12
+
13
+ - 29a5595: Azure OpenAI enabled web-search-preview
14
+
3
15
  ## 2.0.70
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -77,6 +77,12 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFa
77
77
  name: string;
78
78
  }>;
79
79
  }, {
80
+ /**
81
+ * Whether to use external web access for fetching live content.
82
+ * - true: Fetch live web content (default)
83
+ * - false: Use cached/indexed results
84
+ */
85
+ externalWebAccess?: boolean;
80
86
  /**
81
87
  * Filters for the search.
82
88
  */
package/dist/index.d.ts CHANGED
@@ -77,6 +77,12 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFa
77
77
  name: string;
78
78
  }>;
79
79
  }, {
80
+ /**
81
+ * Whether to use external web access for fetching live content.
82
+ * - true: Fetch live web content (default)
83
+ * - false: Use cached/indexed results
84
+ */
85
+ externalWebAccess?: boolean;
80
86
  /**
81
87
  * Filters for the search.
82
88
  */
package/dist/index.js CHANGED
@@ -1917,6 +1917,7 @@ var import_v413 = require("zod/v4");
1917
1917
  var webSearchArgsSchema = (0, import_provider_utils18.lazySchema)(
1918
1918
  () => (0, import_provider_utils18.zodSchema)(
1919
1919
  import_v413.z.object({
1920
+ externalWebAccess: import_v413.z.boolean().optional(),
1920
1921
  filters: import_v413.z.object({ allowedDomains: import_v413.z.array(import_v413.z.string()).optional() }).optional(),
1921
1922
  searchContextSize: import_v413.z.enum(["low", "medium", "high"]).optional(),
1922
1923
  userLocation: import_v413.z.object({
@@ -2616,6 +2617,8 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazyValidator)(
2616
2617
  annotation: import_v416.z.discriminatedUnion("type", [
2617
2618
  import_v416.z.object({
2618
2619
  type: import_v416.z.literal("url_citation"),
2620
+ start_index: import_v416.z.number(),
2621
+ end_index: import_v416.z.number(),
2619
2622
  url: import_v416.z.string(),
2620
2623
  title: import_v416.z.string()
2621
2624
  }),
@@ -3042,6 +3045,7 @@ async function prepareResponsesTools({
3042
3045
  openaiTools2.push({
3043
3046
  type: "web_search",
3044
3047
  filters: args.filters != null ? { allowed_domains: args.filters.allowedDomains } : void 0,
3048
+ external_web_access: args.externalWebAccess,
3045
3049
  search_context_size: args.searchContextSize,
3046
3050
  user_location: args.userLocation
3047
3051
  });
@@ -3697,7 +3701,7 @@ var OpenAIResponsesLanguageModel = class {
3697
3701
  controller.enqueue({
3698
3702
  type: "tool-call",
3699
3703
  toolCallId: value.item.id,
3700
- toolName: "web_search",
3704
+ toolName: webSearchToolName != null ? webSearchToolName : "web_search",
3701
3705
  input: JSON.stringify({}),
3702
3706
  providerExecuted: true
3703
3707
  });
@@ -3798,7 +3802,7 @@ var OpenAIResponsesLanguageModel = class {
3798
3802
  controller.enqueue({
3799
3803
  type: "tool-result",
3800
3804
  toolCallId: value.item.id,
3801
- toolName: "web_search",
3805
+ toolName: webSearchToolName != null ? webSearchToolName : "web_search",
3802
3806
  result: mapWebSearchOutput(value.item.action),
3803
3807
  providerExecuted: true
3804
3808
  });
@@ -4526,7 +4530,7 @@ var OpenAITranscriptionModel = class {
4526
4530
  };
4527
4531
 
4528
4532
  // src/version.ts
4529
- var VERSION = true ? "2.0.70" : "0.0.0-test";
4533
+ var VERSION = true ? "2.0.72" : "0.0.0-test";
4530
4534
 
4531
4535
  // src/openai-provider.ts
4532
4536
  function createOpenAI(options = {}) {