@ai-sdk/google 3.0.141 → 3.0.142

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 3.0.142
4
+
5
+ ### Patch Changes
6
+
7
+ - 5ba2f75: Omit Google provider-defined tools, including File Search and Vertex RAG Store, when `toolChoice` is `none` so disabled tools cannot retrieve data or execute server-side. Preserve function declarations needed by conversation history while disabling function calling.
8
+
3
9
  ## 3.0.141
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -278,7 +278,7 @@ var googleInteractionsTranscriptionResponseSchema = (0, import_provider_utils3.l
278
278
  var import_provider_utils26 = require("@ai-sdk/provider-utils");
279
279
 
280
280
  // src/version.ts
281
- var VERSION = true ? "3.0.141" : "0.0.0-test";
281
+ var VERSION = true ? "3.0.142" : "0.0.0-test";
282
282
 
283
283
  // src/google-generative-ai-embedding-model.ts
284
284
  var import_provider2 = require("@ai-sdk/provider");
@@ -1658,6 +1658,9 @@ function prepareTools({
1658
1658
  modelId,
1659
1659
  isVertexProvider = false
1660
1660
  }) {
1661
+ if ((toolChoice == null ? void 0 : toolChoice.type) === "none") {
1662
+ tools = tools == null ? void 0 : tools.filter((tool) => tool.type === "function");
1663
+ }
1661
1664
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
1662
1665
  const toolWarnings = [];
1663
1666
  const { supportsGemini2Tools, supportsFileSearch, usesGemini3Features } = getGoogleModelCapabilities(modelId);