You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@ai-sdk/google

Package Overview
Dependencies
Maintainers
3
Versions
395
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/google - npm Package Compare versions

Comparing version
4.0.0-beta.0
to
4.0.0-beta.1
+6
-0
CHANGELOG.md
# @ai-sdk/google
## 4.0.0-beta.1
### Patch Changes
- 19b95f9: fix(google): use VALIDATED function calling mode when any tool has strict:true
## 4.0.0-beta.0

@@ -4,0 +10,0 @@

+16
-4

@@ -641,2 +641,3 @@ "use strict";

const functionDeclarations = [];
let hasStrictTools = false;
for (const tool of tools) {

@@ -650,2 +651,5 @@ switch (tool.type) {

});
if (tool.strict === true) {
hasStrictTools = true;
}
break;

@@ -663,3 +667,3 @@ default:

tools: [{ functionDeclarations }],
toolConfig: void 0,
toolConfig: hasStrictTools ? { functionCallingConfig: { mode: "VALIDATED" } } : void 0,
toolWarnings

@@ -673,3 +677,7 @@ };

tools: [{ functionDeclarations }],
toolConfig: { functionCallingConfig: { mode: "AUTO" } },
toolConfig: {
functionCallingConfig: {
mode: hasStrictTools ? "VALIDATED" : "AUTO"
}
},
toolWarnings

@@ -686,3 +694,7 @@ };

tools: [{ functionDeclarations }],
toolConfig: { functionCallingConfig: { mode: "ANY" } },
toolConfig: {
functionCallingConfig: {
mode: hasStrictTools ? "VALIDATED" : "ANY"
}
},
toolWarnings

@@ -695,3 +707,3 @@ };

functionCallingConfig: {
mode: "ANY",
mode: hasStrictTools ? "VALIDATED" : "ANY",
allowedFunctionNames: [toolChoice.toolName]

@@ -698,0 +710,0 @@ }

@@ -630,2 +630,3 @@ // src/google-generative-ai-language-model.ts

const functionDeclarations = [];
let hasStrictTools = false;
for (const tool of tools) {

@@ -639,2 +640,5 @@ switch (tool.type) {

});
if (tool.strict === true) {
hasStrictTools = true;
}
break;

@@ -652,3 +656,3 @@ default:

tools: [{ functionDeclarations }],
toolConfig: void 0,
toolConfig: hasStrictTools ? { functionCallingConfig: { mode: "VALIDATED" } } : void 0,
toolWarnings

@@ -662,3 +666,7 @@ };

tools: [{ functionDeclarations }],
toolConfig: { functionCallingConfig: { mode: "AUTO" } },
toolConfig: {
functionCallingConfig: {
mode: hasStrictTools ? "VALIDATED" : "AUTO"
}
},
toolWarnings

@@ -675,3 +683,7 @@ };

tools: [{ functionDeclarations }],
toolConfig: { functionCallingConfig: { mode: "ANY" } },
toolConfig: {
functionCallingConfig: {
mode: hasStrictTools ? "VALIDATED" : "ANY"
}
},
toolWarnings

@@ -684,3 +696,3 @@ };

functionCallingConfig: {
mode: "ANY",
mode: hasStrictTools ? "VALIDATED" : "ANY",
allowedFunctionNames: [toolChoice.toolName]

@@ -687,0 +699,0 @@ }

+3
-3
{
"name": "@ai-sdk/google",
"version": "4.0.0-beta.0",
"version": "4.0.0-beta.1",
"license": "Apache-2.0",

@@ -39,4 +39,4 @@ "sideEffects": false,

"dependencies": {
"@ai-sdk/provider": "4.0.0-beta.0",
"@ai-sdk/provider-utils": "5.0.0-beta.0"
"@ai-sdk/provider-utils": "5.0.0-beta.0",
"@ai-sdk/provider": "4.0.0-beta.0"
},

@@ -43,0 +43,0 @@ "devDependencies": {

@@ -34,3 +34,3 @@ import {

functionCallingConfig: {
mode: 'AUTO' | 'NONE' | 'ANY';
mode: 'AUTO' | 'NONE' | 'ANY' | 'VALIDATED';
allowedFunctionNames?: string[];

@@ -190,2 +190,3 @@ };

const functionDeclarations = [];
let hasStrictTools = false;
for (const tool of tools) {

@@ -199,2 +200,5 @@ switch (tool.type) {

});
if (tool.strict === true) {
hasStrictTools = true;
}
break;

@@ -213,3 +217,5 @@ default:

tools: [{ functionDeclarations }],
toolConfig: undefined,
toolConfig: hasStrictTools
? { functionCallingConfig: { mode: 'VALIDATED' } }
: undefined,
toolWarnings,

@@ -225,3 +231,7 @@ };

tools: [{ functionDeclarations }],
toolConfig: { functionCallingConfig: { mode: 'AUTO' } },
toolConfig: {
functionCallingConfig: {
mode: hasStrictTools ? 'VALIDATED' : 'AUTO',
},
},
toolWarnings,

@@ -238,3 +248,7 @@ };

tools: [{ functionDeclarations }],
toolConfig: { functionCallingConfig: { mode: 'ANY' } },
toolConfig: {
functionCallingConfig: {
mode: hasStrictTools ? 'VALIDATED' : 'ANY',
},
},
toolWarnings,

@@ -247,3 +261,3 @@ };

functionCallingConfig: {
mode: 'ANY',
mode: hasStrictTools ? 'VALIDATED' : 'ANY',
allowedFunctionNames: [toolChoice.toolName],

@@ -250,0 +264,0 @@ },

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display