@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/dist/internal/index.js
CHANGED
|
@@ -5128,7 +5128,7 @@ async function pollGoogleInteractionUntilTerminal({ baseURL, interactionId, head
|
|
|
5128
5128
|
* `toolChoice` shapes:
|
|
5129
5129
|
* - `'auto'` -> `'auto'`
|
|
5130
5130
|
* - `'required'` -> `'any'`
|
|
5131
|
-
* - `'none'` -> `
|
|
5131
|
+
* - `'none'` -> omit all tools and `tool_choice`
|
|
5132
5132
|
* - `{ type: 'tool', toolName }` -> `{ allowed_tools: { mode: 'validated', tools: [name] } }`
|
|
5133
5133
|
* (Interactions `AllowedTools.tools` is an `Array<string>` of function
|
|
5134
5134
|
* names, not tool descriptors -- see `src/interactions/resources/interactions.ts`
|
|
@@ -5136,6 +5136,11 @@ async function pollGoogleInteractionUntilTerminal({ baseURL, interactionId, head
|
|
|
5136
5136
|
*/
|
|
5137
5137
|
function prepareGoogleInteractionsTools({ tools, toolChoice }) {
|
|
5138
5138
|
const toolWarnings = [];
|
|
5139
|
+
if (toolChoice?.type === "none") return {
|
|
5140
|
+
tools: void 0,
|
|
5141
|
+
toolChoice: void 0,
|
|
5142
|
+
toolWarnings
|
|
5143
|
+
};
|
|
5139
5144
|
const normalized = tools?.length ? tools : void 0;
|
|
5140
5145
|
if (normalized == null) return {
|
|
5141
5146
|
tools: void 0,
|
|
@@ -5241,9 +5246,6 @@ function prepareGoogleInteractionsTools({ tools, toolChoice }) {
|
|
|
5241
5246
|
case "required":
|
|
5242
5247
|
mappedToolChoice = "any";
|
|
5243
5248
|
break;
|
|
5244
|
-
case "none":
|
|
5245
|
-
mappedToolChoice = "none";
|
|
5246
|
-
break;
|
|
5247
5249
|
case "tool": mappedToolChoice = { allowed_tools: {
|
|
5248
5250
|
mode: "validated",
|
|
5249
5251
|
tools: [toolChoice.toolName]
|