@ai-sdk/google 3.0.0-beta.52 → 3.0.0-beta.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 +12 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -22
- 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 +14 -21
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +14 -21
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.54
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bb28cac: Change streamText loop to merge file part processing into main parts loop
|
|
8
|
+
|
|
9
|
+
## 3.0.0-beta.53
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 33d9327: add `gemini-3-pro-preview` and `gemini-3-pro-image-preview` model IDs
|
|
14
|
+
|
|
3
15
|
## 3.0.0-beta.52
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ declare const googleErrorDataSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
11
11
|
}>;
|
|
12
12
|
type GoogleErrorData = InferSchema<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-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-pro-preview' | 'gemini-3-pro-image-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 = InferSchema<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-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-pro-preview' | 'gemini-3-pro-image-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_utils13 = require("@ai-sdk/provider-utils");
|
|
31
31
|
|
|
32
32
|
// src/version.ts
|
|
33
|
-
var VERSION = true ? "3.0.0-beta.
|
|
33
|
+
var VERSION = true ? "3.0.0-beta.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");
|
|
@@ -236,14 +236,16 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema) {
|
|
|
236
236
|
}
|
|
237
237
|
if (type) {
|
|
238
238
|
if (Array.isArray(type)) {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
const hasNull = type.includes("null");
|
|
240
|
+
const nonNullTypes = type.filter((t) => t !== "null");
|
|
241
|
+
if (nonNullTypes.length === 0) {
|
|
242
|
+
result.type = "null";
|
|
242
243
|
} else {
|
|
243
|
-
result.
|
|
244
|
+
result.anyOf = nonNullTypes.map((t) => ({ type: t }));
|
|
245
|
+
if (hasNull) {
|
|
246
|
+
result.nullable = true;
|
|
247
|
+
}
|
|
244
248
|
}
|
|
245
|
-
} else if (type === "null") {
|
|
246
|
-
result.type = "null";
|
|
247
249
|
} else {
|
|
248
250
|
result.type = type;
|
|
249
251
|
}
|
|
@@ -718,7 +720,7 @@ function prepareTools({
|
|
|
718
720
|
}
|
|
719
721
|
if (toolChoice == null) {
|
|
720
722
|
return {
|
|
721
|
-
tools: { functionDeclarations },
|
|
723
|
+
tools: [{ functionDeclarations }],
|
|
722
724
|
toolConfig: void 0,
|
|
723
725
|
toolWarnings
|
|
724
726
|
};
|
|
@@ -727,25 +729,25 @@ function prepareTools({
|
|
|
727
729
|
switch (type) {
|
|
728
730
|
case "auto":
|
|
729
731
|
return {
|
|
730
|
-
tools: { functionDeclarations },
|
|
732
|
+
tools: [{ functionDeclarations }],
|
|
731
733
|
toolConfig: { functionCallingConfig: { mode: "AUTO" } },
|
|
732
734
|
toolWarnings
|
|
733
735
|
};
|
|
734
736
|
case "none":
|
|
735
737
|
return {
|
|
736
|
-
tools: { functionDeclarations },
|
|
738
|
+
tools: [{ functionDeclarations }],
|
|
737
739
|
toolConfig: { functionCallingConfig: { mode: "NONE" } },
|
|
738
740
|
toolWarnings
|
|
739
741
|
};
|
|
740
742
|
case "required":
|
|
741
743
|
return {
|
|
742
|
-
tools: { functionDeclarations },
|
|
744
|
+
tools: [{ functionDeclarations }],
|
|
743
745
|
toolConfig: { functionCallingConfig: { mode: "ANY" } },
|
|
744
746
|
toolWarnings
|
|
745
747
|
};
|
|
746
748
|
case "tool":
|
|
747
749
|
return {
|
|
748
|
-
tools: { functionDeclarations },
|
|
750
|
+
tools: [{ functionDeclarations }],
|
|
749
751
|
toolConfig: {
|
|
750
752
|
functionCallingConfig: {
|
|
751
753
|
mode: "ANY",
|
|
@@ -1162,11 +1164,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1162
1164
|
} : void 0
|
|
1163
1165
|
});
|
|
1164
1166
|
}
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
const inlineDataParts = getInlineDataParts(content.parts);
|
|
1168
|
-
if (inlineDataParts != null) {
|
|
1169
|
-
for (const part of inlineDataParts) {
|
|
1167
|
+
} else if ("inlineData" in part) {
|
|
1170
1168
|
controller.enqueue({
|
|
1171
1169
|
type: "file",
|
|
1172
1170
|
mediaType: part.inlineData.mimeType,
|
|
@@ -1268,11 +1266,6 @@ function getToolCallsFromParts({
|
|
|
1268
1266
|
providerMetadata: part.thoughtSignature ? { google: { thoughtSignature: part.thoughtSignature } } : void 0
|
|
1269
1267
|
}));
|
|
1270
1268
|
}
|
|
1271
|
-
function getInlineDataParts(parts) {
|
|
1272
|
-
return parts == null ? void 0 : parts.filter(
|
|
1273
|
-
(part) => "inlineData" in part
|
|
1274
|
-
);
|
|
1275
|
-
}
|
|
1276
1269
|
function extractSources({
|
|
1277
1270
|
groundingMetadata,
|
|
1278
1271
|
generateId: generateId3
|