@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 +6 -0
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +14 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +14 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/convert-to-google-generative-ai-messages.ts +18 -7
package/CHANGELOG.md
CHANGED
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.
|
|
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
|
|
637
|
-
|
|
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,
|