@ai-sdk/google 3.0.4 → 3.0.6

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/index.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  } from "@ai-sdk/provider-utils";
8
8
 
9
9
  // src/version.ts
10
- var VERSION = true ? "3.0.4" : "0.0.0-test";
10
+ var VERSION = true ? "3.0.6" : "0.0.0-test";
11
11
 
12
12
  // src/google-generative-ai-embedding-model.ts
13
13
  import {
@@ -682,7 +682,7 @@ function prepareTools({
682
682
  ].some((id) => id === modelId);
683
683
  const isGemini2orNewer = modelId.includes("gemini-2") || modelId.includes("gemini-3") || isLatest;
684
684
  const supportsDynamicRetrieval = modelId.includes("gemini-1.5-flash") && !modelId.includes("-8b");
685
- const supportsFileSearch = modelId.includes("gemini-2.5");
685
+ const supportsFileSearch = modelId.includes("gemini-2.5") || modelId.includes("gemini-3");
686
686
  if (tools == null) {
687
687
  return { tools: void 0, toolConfig: void 0, toolWarnings };
688
688
  }
@@ -755,7 +755,7 @@ function prepareTools({
755
755
  toolWarnings.push({
756
756
  type: "unsupported",
757
757
  feature: `provider-defined tool ${tool.id}`,
758
- details: "The file search tool is only supported with Gemini 2.5 models."
758
+ details: "The file search tool is only supported with Gemini 2.5 models and Gemini 3 models."
759
759
  });
760
760
  }
761
761
  break;
@@ -1106,7 +1106,10 @@ var GoogleGenerativeAILanguageModel = class {
1106
1106
  finishReason: {
1107
1107
  unified: mapGoogleGenerativeAIFinishReason({
1108
1108
  finishReason: candidate.finishReason,
1109
- hasToolCalls: content.some((part) => part.type === "tool-call")
1109
+ // Only count client-executed tool calls for finish reason determination.
1110
+ hasToolCalls: content.some(
1111
+ (part) => part.type === "tool-call" && !part.providerExecuted
1112
+ )
1110
1113
  }),
1111
1114
  raw: (_e = candidate.finishReason) != null ? _e : void 0
1112
1115
  },
@@ -1209,7 +1212,6 @@ var GoogleGenerativeAILanguageModel = class {
1209
1212
  input: JSON.stringify(part.executableCode),
1210
1213
  providerExecuted: true
1211
1214
  });
1212
- hasToolCalls = true;
1213
1215
  } else if ("codeExecutionResult" in part && part.codeExecutionResult) {
1214
1216
  const toolCallId = lastCodeExecutionToolCallId;
1215
1217
  if (toolCallId) {