@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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 4.0.111
4
+
5
+ ### Patch Changes
6
+
7
+ - a32df11: Omit all Google Interactions tools when `toolChoice` is `none`, including provider-defined tools.
8
+ - Updated dependencies [fa15312]
9
+ - @ai-sdk/provider-utils@5.0.74
10
+
3
11
  ## 4.0.110
4
12
 
5
13
  ### Patch Changes
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { Experimental_DecisionLanguageModel } from "@ai-sdk/provider-utils/exper
3
3
  import { AISDKError, InvalidArgumentError, InvalidResponseDataError, TooManyEmbeddingValuesForCallError, UnsupportedFunctionalityError } from "@ai-sdk/provider";
4
4
  import { z } from "zod/v4";
5
5
  //#region src/version.ts
6
- const VERSION = "4.0.110";
6
+ const VERSION = "4.0.111";
7
7
  //#endregion
8
8
  //#region src/google-error.ts
9
9
  const getGoogleErrorSchema = () => z.object({
@@ -6402,7 +6402,7 @@ async function pollGoogleInteractionUntilTerminal({ baseURL, interactionId, head
6402
6402
  * `toolChoice` shapes:
6403
6403
  * - `'auto'` -> `'auto'`
6404
6404
  * - `'required'` -> `'any'`
6405
- * - `'none'` -> `'none'`
6405
+ * - `'none'` -> omit all tools and `tool_choice`
6406
6406
  * - `{ type: 'tool', toolName }` -> `{ allowed_tools: { mode: 'validated', tools: [name] } }`
6407
6407
  * (Interactions `AllowedTools.tools` is an `Array<string>` of function
6408
6408
  * names, not tool descriptors -- see `src/interactions/resources/interactions.ts`
@@ -6410,6 +6410,11 @@ async function pollGoogleInteractionUntilTerminal({ baseURL, interactionId, head
6410
6410
  */
6411
6411
  function prepareGoogleInteractionsTools({ tools, toolChoice }) {
6412
6412
  const toolWarnings = [];
6413
+ if (toolChoice?.type === "none") return {
6414
+ tools: void 0,
6415
+ toolChoice: void 0,
6416
+ toolWarnings
6417
+ };
6413
6418
  const normalized = tools?.length ? tools : void 0;
6414
6419
  if (normalized == null) return {
6415
6420
  tools: void 0,
@@ -6515,9 +6520,6 @@ function prepareGoogleInteractionsTools({ tools, toolChoice }) {
6515
6520
  case "required":
6516
6521
  mappedToolChoice = "any";
6517
6522
  break;
6518
- case "none":
6519
- mappedToolChoice = "none";
6520
- break;
6521
6523
  case "tool": mappedToolChoice = { allowed_tools: {
6522
6524
  mode: "validated",
6523
6525
  tools: [toolChoice.toolName]