@ai-sdk/google 2.0.15 → 2.0.17
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 -0
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +16 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -9
- 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.map +1 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# @ai-sdk/google
|
2
2
|
|
3
|
+
## 2.0.17
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- bc5ed71: chore: update zod peer depenedency version
|
8
|
+
- 356c1f2: chore (provider/google): Add preview modelIds for gemini 2.5 flash and lite
|
9
|
+
- Updated dependencies [bc5ed71]
|
10
|
+
- @ai-sdk/provider-utils@3.0.10
|
11
|
+
|
12
|
+
## 2.0.16
|
13
|
+
|
14
|
+
### Patch Changes
|
15
|
+
|
16
|
+
- 322901b: feat: add provider version to user-agent header
|
17
|
+
|
3
18
|
## 2.0.15
|
4
19
|
|
5
20
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
@@ -12,7 +12,7 @@ declare const googleErrorDataSchema: z.ZodObject<{
|
|
12
12
|
}, z.core.$strip>;
|
13
13
|
type GoogleErrorData = z.infer<typeof googleErrorDataSchema>;
|
14
14
|
|
15
|
-
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-lite' | 'gemini-2.5-flash-
|
15
|
+
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-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
|
16
16
|
declare const googleGenerativeAIProviderOptions: z.ZodObject<{
|
17
17
|
responseModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
18
18
|
TEXT: "TEXT";
|
@@ -240,4 +240,6 @@ Default Google Generative AI provider instance.
|
|
240
240
|
*/
|
241
241
|
declare const google: GoogleGenerativeAIProvider;
|
242
242
|
|
243
|
-
|
243
|
+
declare const VERSION: string;
|
244
|
+
|
245
|
+
export { type GoogleErrorData, type GoogleGenerativeAIEmbeddingProviderOptions, type GoogleGenerativeAIImageProviderOptions, type GoogleGenerativeAIProvider, type GoogleGenerativeAIProviderMetadata, type GoogleGenerativeAIProviderOptions, type GoogleGenerativeAIProviderSettings, VERSION, createGoogleGenerativeAI, google };
|
package/dist/index.d.ts
CHANGED
@@ -12,7 +12,7 @@ declare const googleErrorDataSchema: z.ZodObject<{
|
|
12
12
|
}, z.core.$strip>;
|
13
13
|
type GoogleErrorData = z.infer<typeof googleErrorDataSchema>;
|
14
14
|
|
15
|
-
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-lite' | 'gemini-2.5-flash-
|
15
|
+
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-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
|
16
16
|
declare const googleGenerativeAIProviderOptions: z.ZodObject<{
|
17
17
|
responseModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
18
18
|
TEXT: "TEXT";
|
@@ -240,4 +240,6 @@ Default Google Generative AI provider instance.
|
|
240
240
|
*/
|
241
241
|
declare const google: GoogleGenerativeAIProvider;
|
242
242
|
|
243
|
-
|
243
|
+
declare const VERSION: string;
|
244
|
+
|
245
|
+
export { type GoogleErrorData, type GoogleGenerativeAIEmbeddingProviderOptions, type GoogleGenerativeAIImageProviderOptions, type GoogleGenerativeAIProvider, type GoogleGenerativeAIProviderMetadata, type GoogleGenerativeAIProviderOptions, type GoogleGenerativeAIProviderSettings, VERSION, createGoogleGenerativeAI, google };
|
package/dist/index.js
CHANGED
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
20
20
|
// src/index.ts
|
21
21
|
var src_exports = {};
|
22
22
|
__export(src_exports, {
|
23
|
+
VERSION: () => VERSION,
|
23
24
|
createGoogleGenerativeAI: () => createGoogleGenerativeAI,
|
24
25
|
google: () => google
|
25
26
|
});
|
@@ -28,6 +29,9 @@ module.exports = __toCommonJS(src_exports);
|
|
28
29
|
// src/google-provider.ts
|
29
30
|
var import_provider_utils9 = require("@ai-sdk/provider-utils");
|
30
31
|
|
32
|
+
// src/version.ts
|
33
|
+
var VERSION = true ? "2.0.17" : "0.0.0-test";
|
34
|
+
|
31
35
|
// src/google-generative-ai-embedding-model.ts
|
32
36
|
var import_provider = require("@ai-sdk/provider");
|
33
37
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
@@ -1471,14 +1475,17 @@ var googleImageProviderOptionsSchema = import_v49.z.object({
|
|
1471
1475
|
function createGoogleGenerativeAI(options = {}) {
|
1472
1476
|
var _a;
|
1473
1477
|
const baseURL = (_a = (0, import_provider_utils9.withoutTrailingSlash)(options.baseURL)) != null ? _a : "https://generativelanguage.googleapis.com/v1beta";
|
1474
|
-
const getHeaders = () => (
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1478
|
+
const getHeaders = () => (0, import_provider_utils9.withUserAgentSuffix)(
|
1479
|
+
{
|
1480
|
+
"x-goog-api-key": (0, import_provider_utils9.loadApiKey)({
|
1481
|
+
apiKey: options.apiKey,
|
1482
|
+
environmentVariableName: "GOOGLE_GENERATIVE_AI_API_KEY",
|
1483
|
+
description: "Google Generative AI"
|
1484
|
+
}),
|
1485
|
+
...options.headers
|
1486
|
+
},
|
1487
|
+
`ai-sdk/google/${VERSION}`
|
1488
|
+
);
|
1482
1489
|
const createChatModel = (modelId) => {
|
1483
1490
|
var _a2;
|
1484
1491
|
return new GoogleGenerativeAILanguageModel(modelId, {
|
@@ -1535,6 +1542,7 @@ function createGoogleGenerativeAI(options = {}) {
|
|
1535
1542
|
var google = createGoogleGenerativeAI();
|
1536
1543
|
// Annotate the CommonJS export names for ESM import in node:
|
1537
1544
|
0 && (module.exports = {
|
1545
|
+
VERSION,
|
1538
1546
|
createGoogleGenerativeAI,
|
1539
1547
|
google
|
1540
1548
|
});
|