ai 3.4.14 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "3.4.14",
3
+ "version": "3.4.16",
4
4
  "description": "AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -66,7 +66,7 @@
66
66
  "dependencies": {
67
67
  "@ai-sdk/provider": "0.0.24",
68
68
  "@ai-sdk/provider-utils": "1.0.20",
69
- "@ai-sdk/react": "0.0.63",
69
+ "@ai-sdk/react": "0.0.64",
70
70
  "@ai-sdk/solid": "0.0.50",
71
71
  "@ai-sdk/svelte": "0.0.52",
72
72
  "@ai-sdk/ui-utils": "0.0.46",
@@ -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: Object.entries(tools).map(([name8, tool]) => ({
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({ tools, toolChoice })
1494
+ ...prepareToolsAndToolChoice({
1495
+ tools,
1496
+ toolChoice,
1497
+ activeTools: void 0
1498
+ })
1491
1499
  },
1492
1500
  ...prepareCallSettings(settings),
1493
1501
  inputFormat: validatedPrompt.type,