@ai-sdk/google 2.0.52 → 2.0.54
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 +15 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +37 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -25
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +1 -1
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +36 -24
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +36 -24
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 2.0.54
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5e921ed: feat(provider/google): add support for `gemini-3.1-pro-preview`
|
|
8
|
+
|
|
9
|
+
## 2.0.53
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [20565b8]
|
|
14
|
+
- @ai-sdk/provider-utils@3.0.21
|
|
15
|
+
|
|
3
16
|
## 2.0.52
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
6
19
|
|
|
7
|
-
-
|
|
8
|
-
- Updated dependencies [
|
|
20
|
+
- 526fe8d: fix: trigger new release for `@ai-v5` dist-tag
|
|
21
|
+
- Updated dependencies [526fe8d]
|
|
9
22
|
- @ai-sdk/provider@2.0.1
|
|
10
23
|
- @ai-sdk/provider-utils@3.0.20
|
|
11
24
|
|
package/dist/index.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ declare const googleErrorDataSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
11
11
|
}>;
|
|
12
12
|
type GoogleErrorData = InferValidator<typeof googleErrorDataSchema>;
|
|
13
13
|
|
|
14
|
-
type GoogleGenerativeAIModelId = 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'gemini-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
|
|
14
|
+
type GoogleGenerativeAIModelId = 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-3.1-pro-preview' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'gemini-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
|
|
15
15
|
declare const googleGenerativeAIProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
16
16
|
responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
|
|
17
17
|
thinkingConfig?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare const googleErrorDataSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
11
11
|
}>;
|
|
12
12
|
type GoogleErrorData = InferValidator<typeof googleErrorDataSchema>;
|
|
13
13
|
|
|
14
|
-
type GoogleGenerativeAIModelId = 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'gemini-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
|
|
14
|
+
type GoogleGenerativeAIModelId = 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-3.1-pro-preview' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'gemini-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
|
|
15
15
|
declare const googleGenerativeAIProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
16
16
|
responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
|
|
17
17
|
thinkingConfig?: {
|
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 ? "2.0.
|
|
33
|
+
var VERSION = true ? "2.0.54" : "0.0.0-test";
|
|
34
34
|
|
|
35
35
|
// src/google-generative-ai-embedding-model.ts
|
|
36
36
|
var import_provider = require("@ai-sdk/provider");
|
|
@@ -1003,12 +1003,22 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1003
1003
|
providerExecuted: true
|
|
1004
1004
|
});
|
|
1005
1005
|
lastCodeExecutionToolCallId = void 0;
|
|
1006
|
-
} else if ("text" in part && part.text != null
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1006
|
+
} else if ("text" in part && part.text != null) {
|
|
1007
|
+
const thoughtSignatureMetadata = part.thoughtSignature ? { google: { thoughtSignature: part.thoughtSignature } } : void 0;
|
|
1008
|
+
if (part.text.length === 0) {
|
|
1009
|
+
if (thoughtSignatureMetadata != null && content.length > 0) {
|
|
1010
|
+
const lastContent = content[content.length - 1];
|
|
1011
|
+
if (lastContent.type !== "file") {
|
|
1012
|
+
lastContent.providerMetadata = thoughtSignatureMetadata;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
} else {
|
|
1016
|
+
content.push({
|
|
1017
|
+
type: part.thought === true ? "reasoning" : "text",
|
|
1018
|
+
text: part.text,
|
|
1019
|
+
providerMetadata: thoughtSignatureMetadata
|
|
1020
|
+
});
|
|
1021
|
+
}
|
|
1012
1022
|
} else if ("functionCall" in part) {
|
|
1013
1023
|
content.push({
|
|
1014
1024
|
type: "tool-call",
|
|
@@ -1165,8 +1175,22 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1165
1175
|
});
|
|
1166
1176
|
lastCodeExecutionToolCallId = void 0;
|
|
1167
1177
|
}
|
|
1168
|
-
} else if ("text" in part && part.text != null
|
|
1169
|
-
|
|
1178
|
+
} else if ("text" in part && part.text != null) {
|
|
1179
|
+
const thoughtSignatureMetadata = part.thoughtSignature ? {
|
|
1180
|
+
google: {
|
|
1181
|
+
thoughtSignature: part.thoughtSignature
|
|
1182
|
+
}
|
|
1183
|
+
} : void 0;
|
|
1184
|
+
if (part.text.length === 0) {
|
|
1185
|
+
if (thoughtSignatureMetadata != null && currentTextBlockId !== null) {
|
|
1186
|
+
controller.enqueue({
|
|
1187
|
+
type: "text-delta",
|
|
1188
|
+
id: currentTextBlockId,
|
|
1189
|
+
delta: "",
|
|
1190
|
+
providerMetadata: thoughtSignatureMetadata
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
} else if (part.thought === true) {
|
|
1170
1194
|
if (currentTextBlockId !== null) {
|
|
1171
1195
|
controller.enqueue({
|
|
1172
1196
|
type: "text-end",
|
|
@@ -1179,20 +1203,14 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1179
1203
|
controller.enqueue({
|
|
1180
1204
|
type: "reasoning-start",
|
|
1181
1205
|
id: currentReasoningBlockId,
|
|
1182
|
-
providerMetadata:
|
|
1183
|
-
google: {
|
|
1184
|
-
thoughtSignature: part.thoughtSignature
|
|
1185
|
-
}
|
|
1186
|
-
} : void 0
|
|
1206
|
+
providerMetadata: thoughtSignatureMetadata
|
|
1187
1207
|
});
|
|
1188
1208
|
}
|
|
1189
1209
|
controller.enqueue({
|
|
1190
1210
|
type: "reasoning-delta",
|
|
1191
1211
|
id: currentReasoningBlockId,
|
|
1192
1212
|
delta: part.text,
|
|
1193
|
-
providerMetadata:
|
|
1194
|
-
google: { thoughtSignature: part.thoughtSignature }
|
|
1195
|
-
} : void 0
|
|
1213
|
+
providerMetadata: thoughtSignatureMetadata
|
|
1196
1214
|
});
|
|
1197
1215
|
} else {
|
|
1198
1216
|
if (currentReasoningBlockId !== null) {
|
|
@@ -1207,20 +1225,14 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1207
1225
|
controller.enqueue({
|
|
1208
1226
|
type: "text-start",
|
|
1209
1227
|
id: currentTextBlockId,
|
|
1210
|
-
providerMetadata:
|
|
1211
|
-
google: {
|
|
1212
|
-
thoughtSignature: part.thoughtSignature
|
|
1213
|
-
}
|
|
1214
|
-
} : void 0
|
|
1228
|
+
providerMetadata: thoughtSignatureMetadata
|
|
1215
1229
|
});
|
|
1216
1230
|
}
|
|
1217
1231
|
controller.enqueue({
|
|
1218
1232
|
type: "text-delta",
|
|
1219
1233
|
id: currentTextBlockId,
|
|
1220
1234
|
delta: part.text,
|
|
1221
|
-
providerMetadata:
|
|
1222
|
-
google: { thoughtSignature: part.thoughtSignature }
|
|
1223
|
-
} : void 0
|
|
1235
|
+
providerMetadata: thoughtSignatureMetadata
|
|
1224
1236
|
});
|
|
1225
1237
|
}
|
|
1226
1238
|
} else if ("inlineData" in part) {
|