@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/dist/index.mjs CHANGED
@@ -5597,9 +5597,10 @@ async function prepareResponsesTools({
5597
5597
  allowedTools,
5598
5598
  toolNameMapping,
5599
5599
  customProviderToolNames,
5600
- supportsAsyncToolCalling = true
5600
+ supportsAsyncToolCalling = true,
5601
+ providerOptionsName = "openai"
5601
5602
  }) {
5602
- var _a2, _b, _c, _d;
5603
+ var _a2, _b, _c, _d, _e, _f;
5603
5604
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
5604
5605
  const toolWarnings = [];
5605
5606
  if (tools == null) {
@@ -5625,7 +5626,7 @@ async function prepareResponsesTools({
5625
5626
  for (const tool of tools) {
5626
5627
  switch (tool.type) {
5627
5628
  case "function": {
5628
- const openaiOptions = (_a2 = tool.providerOptions) == null ? void 0 : _a2.openai;
5629
+ const openaiOptions = (_c = (_a2 = tool.providerOptions) == null ? void 0 : _a2[providerOptionsName]) != null ? _c : (_b = tool.providerOptions) == null ? void 0 : _b.openai;
5629
5630
  const openaiFunctionTool = prepareFunctionTool({
5630
5631
  tool,
5631
5632
  options: openaiOptions,
@@ -5889,7 +5890,7 @@ async function prepareResponsesTools({
5889
5890
  });
5890
5891
  allowedToolEntries.push({
5891
5892
  type: "function",
5892
- name: (_b = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(name)) != null ? _b : name
5893
+ name: (_d = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(name)) != null ? _d : name
5893
5894
  });
5894
5895
  continue;
5895
5896
  }
@@ -5915,7 +5916,7 @@ async function prepareResponsesTools({
5915
5916
  tools: openaiTools2,
5916
5917
  toolChoice: {
5917
5918
  type: "allowed_tools",
5918
- mode: (_c = allowedTools.mode) != null ? _c : "auto",
5919
+ mode: (_e = allowedTools.mode) != null ? _e : "auto",
5919
5920
  tools: allowedToolEntries
5920
5921
  },
5921
5922
  toolWarnings
@@ -5931,7 +5932,7 @@ async function prepareResponsesTools({
5931
5932
  case "required":
5932
5933
  return { tools: openaiTools2, toolChoice: type, toolWarnings };
5933
5934
  case "tool": {
5934
- const resolvedToolName = (_d = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _d : toolChoice.toolName;
5935
+ const resolvedToolName = (_f = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _f : toolChoice.toolName;
5935
5936
  return {
5936
5937
  tools: openaiTools2,
5937
5938
  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 },
@@ -6203,7 +6204,8 @@ var OpenAIResponsesLanguageModel = class {
6203
6204
  allowedTools: (_b = openaiOptions == null ? void 0 : openaiOptions.allowedTools) != null ? _b : void 0,
6204
6205
  toolNameMapping,
6205
6206
  customProviderToolNames,
6206
- supportsAsyncToolCalling: modelCapabilities.supportsAsyncToolCalling
6207
+ supportsAsyncToolCalling: modelCapabilities.supportsAsyncToolCalling,
6208
+ providerOptionsName
6207
6209
  });
6208
6210
  const configurationUpdateUnsupportedReason = getConfigurationUpdateUnsupportedReason({
6209
6211
  modelCapabilities,
@@ -8458,7 +8460,7 @@ var OpenAITranscriptionModel = class {
8458
8460
  };
8459
8461
 
8460
8462
  // src/version.ts
8461
- var VERSION = true ? "3.0.131" : "0.0.0-test";
8463
+ var VERSION = true ? "3.0.132" : "0.0.0-test";
8462
8464
 
8463
8465
  // src/openai-provider.ts
8464
8466
  function createOpenAI(options = {}) {