@ai-sdk/google 2.0.108 → 2.0.110

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,21 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 2.0.110
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [c31e0a2]
8
+ - @ai-sdk/provider-utils@3.0.46
9
+
10
+ ## 2.0.109
11
+
12
+ ### Patch Changes
13
+
14
+ - 5eaea4b: 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.
15
+ - Updated dependencies [49c554d]
16
+ - Updated dependencies [b753c03]
17
+ - @ai-sdk/provider-utils@3.0.45
18
+
3
19
  ## 2.0.108
4
20
 
5
21
  ### Patch Changes
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(index_exports);
30
30
  var import_provider_utils15 = require("@ai-sdk/provider-utils");
31
31
 
32
32
  // src/version.ts
33
- var VERSION = true ? "2.0.108" : "0.0.0-test";
33
+ var VERSION = true ? "2.0.110" : "0.0.0-test";
34
34
 
35
35
  // src/google-generative-ai-embedding-model.ts
36
36
  var import_provider = require("@ai-sdk/provider");
@@ -1114,6 +1114,9 @@ function prepareTools({
1114
1114
  modelId,
1115
1115
  isVertexProvider = false
1116
1116
  }) {
1117
+ if ((toolChoice == null ? void 0 : toolChoice.type) === "none") {
1118
+ tools = tools == null ? void 0 : tools.filter((tool) => tool.type === "function");
1119
+ }
1117
1120
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
1118
1121
  const toolWarnings = [];
1119
1122
  const { supportsGemini2Tools, supportsFileSearch, usesGemini3Features } = getGoogleModelCapabilities(modelId);
@@ -1129,7 +1132,9 @@ function prepareTools({
1129
1132
  toolWarnings.push({
1130
1133
  type: "unsupported-tool",
1131
1134
  tool: tools.find((tool) => tool.type === "function"),
1132
- details: `Cannot mix function tools with provider-defined tools in the same request. Falling back to provider-defined tools only. The following function tools will be ignored: ${functionTools.map((t) => t.name).join(", ")}. Please use either function tools or provider-defined tools, but not both.`
1135
+ details: `Cannot mix function tools with provider-defined tools in the same request. Falling back to provider-defined tools only. The following function tools will be ignored: ${functionTools.map((t) => t.name).join(
1136
+ ", "
1137
+ )}. Please use either function tools or provider-defined tools, but not both.`
1133
1138
  });
1134
1139
  }
1135
1140
  if (hasProviderDefinedTools) {