@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/CHANGELOG.md +86 -0
- package/dist/index.d.mts +29 -15
- package/dist/index.d.ts +29 -15
- package/dist/index.js +8 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/convert-image-model-file-to-data-uri.ts +3 -3
- package/src/create-tool-name-mapping.ts +5 -21
- package/src/inject-json-instruction.ts +5 -5
- package/src/types/assistant-model-message.ts +2 -0
- package/src/types/content-part.ts +20 -0
- package/src/types/index.ts +1 -0
- package/src/types/provider-options.ts +2 -2
- package/src/types/tool.ts +2 -0
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 =
|
|
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
|
|
72
|
-
return (
|
|
66
|
+
var _a2;
|
|
67
|
+
return (_a2 = customToolNameToProviderToolName[customToolName]) != null ? _a2 : customToolName;
|
|
73
68
|
},
|
|
74
69
|
toCustomToolName: (providerToolName) => {
|
|
75
|
-
var
|
|
76
|
-
return (
|
|
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.
|
|
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;
|