@ai-sdk/google 3.0.5 → 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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 3.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 2043612: fix(google): parse structured output when using google provider tools
8
+
3
9
  ## 3.0.5
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(src_exports);
30
30
  var import_provider_utils15 = require("@ai-sdk/provider-utils");
31
31
 
32
32
  // src/version.ts
33
- var VERSION = true ? "3.0.5" : "0.0.0-test";
33
+ var VERSION = true ? "3.0.6" : "0.0.0-test";
34
34
 
35
35
  // src/google-generative-ai-embedding-model.ts
36
36
  var import_provider = require("@ai-sdk/provider");
@@ -1098,7 +1098,10 @@ var GoogleGenerativeAILanguageModel = class {
1098
1098
  finishReason: {
1099
1099
  unified: mapGoogleGenerativeAIFinishReason({
1100
1100
  finishReason: candidate.finishReason,
1101
- hasToolCalls: content.some((part) => part.type === "tool-call")
1101
+ // Only count client-executed tool calls for finish reason determination.
1102
+ hasToolCalls: content.some(
1103
+ (part) => part.type === "tool-call" && !part.providerExecuted
1104
+ )
1102
1105
  }),
1103
1106
  raw: (_e = candidate.finishReason) != null ? _e : void 0
1104
1107
  },
@@ -1201,7 +1204,6 @@ var GoogleGenerativeAILanguageModel = class {
1201
1204
  input: JSON.stringify(part.executableCode),
1202
1205
  providerExecuted: true
1203
1206
  });
1204
- hasToolCalls = true;
1205
1207
  } else if ("codeExecutionResult" in part && part.codeExecutionResult) {
1206
1208
  const toolCallId = lastCodeExecutionToolCallId;
1207
1209
  if (toolCallId) {