@ai-sdk/provider-utils 5.0.0-beta.3 → 5.0.0-beta.5

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
@@ -50,30 +50,25 @@ function convertAsyncIteratorToReadableStream(iterator) {
50
50
  // src/create-tool-name-mapping.ts
51
51
  function createToolNameMapping({
52
52
  tools = [],
53
- providerToolNames,
54
- resolveProviderToolName
53
+ providerToolNames
55
54
  }) {
56
- var _a2;
57
55
  const customToolNameToProviderToolName = {};
58
56
  const providerToolNameToCustomToolName = {};
59
57
  for (const tool2 of tools) {
60
- if (tool2.type === "provider") {
61
- const providerToolName = (_a2 = resolveProviderToolName == null ? void 0 : resolveProviderToolName(tool2)) != null ? _a2 : tool2.id in providerToolNames ? providerToolNames[tool2.id] : void 0;
62
- if (providerToolName == null) {
63
- continue;
64
- }
58
+ if (tool2.type === "provider" && tool2.id in providerToolNames) {
59
+ const providerToolName = providerToolNames[tool2.id];
65
60
  customToolNameToProviderToolName[tool2.name] = providerToolName;
66
61
  providerToolNameToCustomToolName[providerToolName] = tool2.name;
67
62
  }
68
63
  }
69
64
  return {
70
65
  toProviderToolName: (customToolName) => {
71
- var _a3;
72
- return (_a3 = customToolNameToProviderToolName[customToolName]) != null ? _a3 : customToolName;
66
+ var _a2;
67
+ return (_a2 = customToolNameToProviderToolName[customToolName]) != null ? _a2 : customToolName;
73
68
  },
74
69
  toCustomToolName: (providerToolName) => {
75
- var _a3;
76
- return (_a3 = providerToolNameToCustomToolName[providerToolName]) != null ? _a3 : providerToolName;
70
+ var _a2;
71
+ return (_a2 = providerToolNameToCustomToolName[providerToolName]) != null ? _a2 : providerToolName;
77
72
  }
78
73
  };
79
74
  }
@@ -579,7 +574,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
579
574
  }
580
575
 
581
576
  // src/version.ts
582
- var VERSION = true ? "5.0.0-beta.3" : "0.0.0-test";
577
+ var VERSION = true ? "5.0.0-beta.5" : "0.0.0-test";
583
578
 
584
579
  // src/get-from-api.ts
585
580
  var getOriginalFetch = () => globalThis.fetch;