@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 +6 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +3 -0
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +3 -0
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/google-prepare-tools.ts +7 -0
package/package.json
CHANGED
|
@@ -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
|
|