@ai-sdk/google 3.0.98 → 3.0.99

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.99
4
+
5
+ ### Patch Changes
6
+
7
+ - 2886d22: Avoid missing thought-signature warnings and skip-validator injection for valid unsigned Gemini 3 parallel function calls in the same model response.
8
+
3
9
  ## 3.0.98
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(index_exports);
30
30
  var import_provider_utils23 = require("@ai-sdk/provider-utils");
31
31
 
32
32
  // src/version.ts
33
- var VERSION = true ? "3.0.98" : "0.0.0-test";
33
+ var VERSION = true ? "3.0.99" : "0.0.0-test";
34
34
 
35
35
  // src/google-generative-ai-embedding-model.ts
36
36
  var import_provider = require("@ai-sdk/provider");
@@ -593,6 +593,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
593
593
  }
594
594
  case "assistant": {
595
595
  systemMessagesAllowed = false;
596
+ let modelResponseHasSignedFunctionCall = false;
596
597
  contents.push({
597
598
  role: "model",
598
599
  parts: content.map((part) => {
@@ -633,8 +634,19 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
633
634
  case "tool-call": {
634
635
  const serverToolCallId = (providerOpts == null ? void 0 : providerOpts.serverToolCallId) != null ? String(providerOpts.serverToolCallId) : void 0;
635
636
  const serverToolType = (providerOpts == null ? void 0 : providerOpts.serverToolType) != null ? String(providerOpts.serverToolType) : void 0;
636
- const effectiveThoughtSignature = thoughtSignature != null ? thoughtSignature : isGemini3Model ? injectSkipSignature(part.toolName) : void 0;
637
- if (serverToolCallId && serverToolType) {
637
+ const isServerToolCall = serverToolCallId != null && serverToolType != null;
638
+ const shouldSkipMissingSignatureMitigation = (
639
+ // Gemini 3 returns a single signature for a parallel
640
+ // function-call response on the first standard function
641
+ // call. Subsequent standard function calls in the same
642
+ // model response legitimately have no signature.
643
+ !isServerToolCall && thoughtSignature == null && modelResponseHasSignedFunctionCall
644
+ );
645
+ const effectiveThoughtSignature = thoughtSignature != null ? thoughtSignature : isGemini3Model && !shouldSkipMissingSignatureMitigation ? injectSkipSignature(part.toolName) : void 0;
646
+ if (!isServerToolCall && thoughtSignature != null) {
647
+ modelResponseHasSignedFunctionCall = true;
648
+ }
649
+ if (isServerToolCall) {
638
650
  return {
639
651
  toolCall: {
640
652
  toolType: serverToolType,