@ai-sdk/google 4.0.110 → 4.0.111

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-sdk/google",
3
- "version": "4.0.110",
3
+ "version": "4.0.111",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@ai-sdk/provider": "4.0.35",
39
- "@ai-sdk/provider-utils": "5.0.73"
39
+ "@ai-sdk/provider-utils": "5.0.74"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@ai-sdk/test-server": "2.0.4",
@@ -39,7 +39,7 @@ export type PrepareGoogleInteractionsToolsResult = {
39
39
  * `toolChoice` shapes:
40
40
  * - `'auto'` -> `'auto'`
41
41
  * - `'required'` -> `'any'`
42
- * - `'none'` -> `'none'`
42
+ * - `'none'` -> omit all tools and `tool_choice`
43
43
  * - `{ type: 'tool', toolName }` -> `{ allowed_tools: { mode: 'validated', tools: [name] } }`
44
44
  * (Interactions `AllowedTools.tools` is an `Array<string>` of function
45
45
  * names, not tool descriptors -- see `src/interactions/resources/interactions.ts`
@@ -54,6 +54,12 @@ export function prepareGoogleInteractionsTools({
54
54
  }): PrepareGoogleInteractionsToolsResult {
55
55
  const toolWarnings: Array<SharedV4Warning> = [];
56
56
 
57
+ // The API's tool_choice only controls function tools. Omit all tools to
58
+ // disable provider-executed tools as well.
59
+ if (toolChoice?.type === 'none') {
60
+ return { tools: undefined, toolChoice: undefined, toolWarnings };
61
+ }
62
+
57
63
  const normalized = tools?.length ? tools : undefined;
58
64
 
59
65
  if (normalized == null) {
@@ -223,9 +229,6 @@ export function prepareGoogleInteractionsTools({
223
229
  case 'required':
224
230
  mappedToolChoice = 'any';
225
231
  break;
226
- case 'none':
227
- mappedToolChoice = 'none';
228
- break;
229
232
  case 'tool':
230
233
  mappedToolChoice = {
231
234
  allowed_tools: {