@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google",
3
- "version": "3.0.141",
3
+ "version": "3.0.142",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -53,6 +53,13 @@ export function prepareTools({
53
53
  };
54
54
  toolWarnings: SharedV3Warning[];
55
55
  } {
56
+ // NONE only disables function calling in the Google API. Provider tools
57
+ // must be omitted so they cannot execute server-side. Keep function
58
+ // declarations for conversation history containing function calls.
59
+ if (toolChoice?.type === 'none') {
60
+ tools = tools?.filter(tool => tool.type === 'function');
61
+ }
62
+
56
63
  // when the tools array is empty, change it to undefined to prevent errors:
57
64
  tools = tools?.length ? tools : undefined;
58
65