@ai-sdk/openai 3.0.131 → 3.0.132

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,11 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 3.0.132
4
+
5
+ ### Patch Changes
6
+
7
+ - 766eebd: add azure.tools.toolSearch and support azure provider options on responses function tools
8
+
3
9
  ## 3.0.131
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -5482,9 +5482,10 @@ async function prepareResponsesTools({
5482
5482
  allowedTools,
5483
5483
  toolNameMapping,
5484
5484
  customProviderToolNames,
5485
- supportsAsyncToolCalling = true
5485
+ supportsAsyncToolCalling = true,
5486
+ providerOptionsName = "openai"
5486
5487
  }) {
5487
- var _a2, _b, _c, _d;
5488
+ var _a2, _b, _c, _d, _e, _f;
5488
5489
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
5489
5490
  const toolWarnings = [];
5490
5491
  if (tools == null) {
@@ -5510,7 +5511,7 @@ async function prepareResponsesTools({
5510
5511
  for (const tool of tools) {
5511
5512
  switch (tool.type) {
5512
5513
  case "function": {
5513
- const openaiOptions = (_a2 = tool.providerOptions) == null ? void 0 : _a2.openai;
5514
+ const openaiOptions = (_c = (_a2 = tool.providerOptions) == null ? void 0 : _a2[providerOptionsName]) != null ? _c : (_b = tool.providerOptions) == null ? void 0 : _b.openai;
5514
5515
  const openaiFunctionTool = prepareFunctionTool({
5515
5516
  tool,
5516
5517
  options: openaiOptions,
@@ -5774,7 +5775,7 @@ async function prepareResponsesTools({
5774
5775
  });
5775
5776
  allowedToolEntries.push({
5776
5777
  type: "function",
5777
- name: (_b = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(name)) != null ? _b : name
5778
+ name: (_d = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(name)) != null ? _d : name
5778
5779
  });
5779
5780
  continue;
5780
5781
  }
@@ -5800,7 +5801,7 @@ async function prepareResponsesTools({
5800
5801
  tools: openaiTools2,
5801
5802
  toolChoice: {
5802
5803
  type: "allowed_tools",
5803
- mode: (_c = allowedTools.mode) != null ? _c : "auto",
5804
+ mode: (_e = allowedTools.mode) != null ? _e : "auto",
5804
5805
  tools: allowedToolEntries
5805
5806
  },
5806
5807
  toolWarnings
@@ -5816,7 +5817,7 @@ async function prepareResponsesTools({
5816
5817
  case "required":
5817
5818
  return { tools: openaiTools2, toolChoice: type, toolWarnings };
5818
5819
  case "tool": {
5819
- const resolvedToolName = (_d = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _d : toolChoice.toolName;
5820
+ const resolvedToolName = (_f = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _f : toolChoice.toolName;
5820
5821
  return {
5821
5822
  tools: openaiTools2,
5822
5823
  toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
@@ -6088,7 +6089,8 @@ var OpenAIResponsesLanguageModel = class {
6088
6089
  allowedTools: (_b = openaiOptions == null ? void 0 : openaiOptions.allowedTools) != null ? _b : void 0,
6089
6090
  toolNameMapping,
6090
6091
  customProviderToolNames,
6091
- supportsAsyncToolCalling: modelCapabilities.supportsAsyncToolCalling
6092
+ supportsAsyncToolCalling: modelCapabilities.supportsAsyncToolCalling,
6093
+ providerOptionsName
6092
6094
  });
6093
6095
  const configurationUpdateUnsupportedReason = getConfigurationUpdateUnsupportedReason({
6094
6096
  modelCapabilities,
@@ -8325,7 +8327,7 @@ var OpenAITranscriptionModel = class {
8325
8327
  };
8326
8328
 
8327
8329
  // src/version.ts
8328
- var VERSION = true ? "3.0.131" : "0.0.0-test";
8330
+ var VERSION = true ? "3.0.132" : "0.0.0-test";
8329
8331
 
8330
8332
  // src/openai-provider.ts
8331
8333
  function createOpenAI(options = {}) {