ai 3.4.15 → 3.4.16
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 +6 -0
- package/dist/index.d.mts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/rsc/dist/rsc-server.mjs +11 -3
- package/rsc/dist/rsc-server.mjs.map +1 -1
package/package.json
CHANGED
package/rsc/dist/rsc-server.mjs
CHANGED
@@ -910,7 +910,8 @@ function isNonEmptyObject(object) {
|
|
910
910
|
// core/prompt/prepare-tools-and-tool-choice.ts
|
911
911
|
function prepareToolsAndToolChoice({
|
912
912
|
tools,
|
913
|
-
toolChoice
|
913
|
+
toolChoice,
|
914
|
+
activeTools
|
914
915
|
}) {
|
915
916
|
if (!isNonEmptyObject(tools)) {
|
916
917
|
return {
|
@@ -918,8 +919,11 @@ function prepareToolsAndToolChoice({
|
|
918
919
|
toolChoice: void 0
|
919
920
|
};
|
920
921
|
}
|
922
|
+
const filteredTools = activeTools != null ? Object.entries(tools).filter(
|
923
|
+
([name8]) => activeTools.includes(name8)
|
924
|
+
) : Object.entries(tools);
|
921
925
|
return {
|
922
|
-
tools:
|
926
|
+
tools: filteredTools.map(([name8, tool]) => ({
|
923
927
|
type: "function",
|
924
928
|
name: name8,
|
925
929
|
description: tool.description,
|
@@ -1487,7 +1491,11 @@ async function streamUI({
|
|
1487
1491
|
async () => model.doStream({
|
1488
1492
|
mode: {
|
1489
1493
|
type: "regular",
|
1490
|
-
...prepareToolsAndToolChoice({
|
1494
|
+
...prepareToolsAndToolChoice({
|
1495
|
+
tools,
|
1496
|
+
toolChoice,
|
1497
|
+
activeTools: void 0
|
1498
|
+
})
|
1491
1499
|
},
|
1492
1500
|
...prepareCallSettings(settings),
|
1493
1501
|
inputFormat: validatedPrompt.type,
|