@ai-sdk/google 3.0.23 → 3.0.24
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 +39 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -33
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +38 -32
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +38 -32
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/google-generative-ai-language-model.ts +47 -49
package/dist/internal/index.js
CHANGED
|
@@ -894,16 +894,24 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
894
894
|
}
|
|
895
895
|
});
|
|
896
896
|
lastCodeExecutionToolCallId = void 0;
|
|
897
|
-
} else if ("text" in part && part.text != null
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
897
|
+
} else if ("text" in part && part.text != null) {
|
|
898
|
+
const thoughtSignatureMetadata = part.thoughtSignature ? {
|
|
899
|
+
[providerOptionsName]: {
|
|
900
|
+
thoughtSignature: part.thoughtSignature
|
|
901
|
+
}
|
|
902
|
+
} : void 0;
|
|
903
|
+
if (part.text.length === 0) {
|
|
904
|
+
if (thoughtSignatureMetadata != null && content.length > 0) {
|
|
905
|
+
const lastContent = content[content.length - 1];
|
|
906
|
+
lastContent.providerMetadata = thoughtSignatureMetadata;
|
|
907
|
+
}
|
|
908
|
+
} else {
|
|
909
|
+
content.push({
|
|
910
|
+
type: part.thought === true ? "reasoning" : "text",
|
|
911
|
+
text: part.text,
|
|
912
|
+
providerMetadata: thoughtSignatureMetadata
|
|
913
|
+
});
|
|
914
|
+
}
|
|
907
915
|
} else if ("functionCall" in part) {
|
|
908
916
|
content.push({
|
|
909
917
|
type: "tool-call",
|
|
@@ -1061,8 +1069,22 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1061
1069
|
});
|
|
1062
1070
|
lastCodeExecutionToolCallId = void 0;
|
|
1063
1071
|
}
|
|
1064
|
-
} else if ("text" in part && part.text != null
|
|
1065
|
-
|
|
1072
|
+
} else if ("text" in part && part.text != null) {
|
|
1073
|
+
const thoughtSignatureMetadata = part.thoughtSignature ? {
|
|
1074
|
+
[providerOptionsName]: {
|
|
1075
|
+
thoughtSignature: part.thoughtSignature
|
|
1076
|
+
}
|
|
1077
|
+
} : void 0;
|
|
1078
|
+
if (part.text.length === 0) {
|
|
1079
|
+
if (thoughtSignatureMetadata != null && currentTextBlockId !== null) {
|
|
1080
|
+
controller.enqueue({
|
|
1081
|
+
type: "text-delta",
|
|
1082
|
+
id: currentTextBlockId,
|
|
1083
|
+
delta: "",
|
|
1084
|
+
providerMetadata: thoughtSignatureMetadata
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
} else if (part.thought === true) {
|
|
1066
1088
|
if (currentTextBlockId !== null) {
|
|
1067
1089
|
controller.enqueue({
|
|
1068
1090
|
type: "text-end",
|
|
@@ -1075,22 +1097,14 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1075
1097
|
controller.enqueue({
|
|
1076
1098
|
type: "reasoning-start",
|
|
1077
1099
|
id: currentReasoningBlockId,
|
|
1078
|
-
providerMetadata:
|
|
1079
|
-
[providerOptionsName]: {
|
|
1080
|
-
thoughtSignature: part.thoughtSignature
|
|
1081
|
-
}
|
|
1082
|
-
} : void 0
|
|
1100
|
+
providerMetadata: thoughtSignatureMetadata
|
|
1083
1101
|
});
|
|
1084
1102
|
}
|
|
1085
1103
|
controller.enqueue({
|
|
1086
1104
|
type: "reasoning-delta",
|
|
1087
1105
|
id: currentReasoningBlockId,
|
|
1088
1106
|
delta: part.text,
|
|
1089
|
-
providerMetadata:
|
|
1090
|
-
[providerOptionsName]: {
|
|
1091
|
-
thoughtSignature: part.thoughtSignature
|
|
1092
|
-
}
|
|
1093
|
-
} : void 0
|
|
1107
|
+
providerMetadata: thoughtSignatureMetadata
|
|
1094
1108
|
});
|
|
1095
1109
|
} else {
|
|
1096
1110
|
if (currentReasoningBlockId !== null) {
|
|
@@ -1105,22 +1119,14 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1105
1119
|
controller.enqueue({
|
|
1106
1120
|
type: "text-start",
|
|
1107
1121
|
id: currentTextBlockId,
|
|
1108
|
-
providerMetadata:
|
|
1109
|
-
[providerOptionsName]: {
|
|
1110
|
-
thoughtSignature: part.thoughtSignature
|
|
1111
|
-
}
|
|
1112
|
-
} : void 0
|
|
1122
|
+
providerMetadata: thoughtSignatureMetadata
|
|
1113
1123
|
});
|
|
1114
1124
|
}
|
|
1115
1125
|
controller.enqueue({
|
|
1116
1126
|
type: "text-delta",
|
|
1117
1127
|
id: currentTextBlockId,
|
|
1118
1128
|
delta: part.text,
|
|
1119
|
-
providerMetadata:
|
|
1120
|
-
[providerOptionsName]: {
|
|
1121
|
-
thoughtSignature: part.thoughtSignature
|
|
1122
|
-
}
|
|
1123
|
-
} : void 0
|
|
1129
|
+
providerMetadata: thoughtSignatureMetadata
|
|
1124
1130
|
});
|
|
1125
1131
|
}
|
|
1126
1132
|
} else if ("inlineData" in part) {
|