@ai-sdk/google 2.1.0-beta.6 → 2.1.0-beta.8
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 +16 -0
- package/dist/index.d.mts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +6 -6
- package/dist/internal/index.d.ts +6 -6
- package/dist/internal/index.js +17 -3
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +17 -3
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# @ai-sdk/google
|
2
2
|
|
3
|
+
## 2.1.0-beta.8
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 7728ac5: The mediaResolution option has been added and is now passed to the Google API.
|
8
|
+
|
9
|
+
## 2.1.0-beta.7
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- 8dac895: feat: `LanguageModelV3`
|
14
|
+
- 10c1322: fix: moved dependency `@ai-sdk/test-server` to devDependencies
|
15
|
+
- Updated dependencies [8dac895]
|
16
|
+
- @ai-sdk/provider-utils@3.1.0-beta.5
|
17
|
+
- @ai-sdk/provider@2.1.0-beta.3
|
18
|
+
|
3
19
|
## 2.1.0-beta.6
|
4
20
|
|
5
21
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { z } from 'zod/v4';
|
2
|
-
import { ProviderV3,
|
2
|
+
import { ProviderV3, LanguageModelV3, ImageModelV3, EmbeddingModelV3 } from '@ai-sdk/provider';
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
4
4
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
5
5
|
|
@@ -52,6 +52,12 @@ declare const googleGenerativeAIProviderOptions: z.ZodObject<{
|
|
52
52
|
}>>;
|
53
53
|
audioTimestamp: z.ZodOptional<z.ZodBoolean>;
|
54
54
|
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
55
|
+
mediaResolution: z.ZodOptional<z.ZodEnum<{
|
56
|
+
MEDIA_RESOLUTION_UNSPECIFIED: "MEDIA_RESOLUTION_UNSPECIFIED";
|
57
|
+
MEDIA_RESOLUTION_LOW: "MEDIA_RESOLUTION_LOW";
|
58
|
+
MEDIA_RESOLUTION_MEDIUM: "MEDIA_RESOLUTION_MEDIUM";
|
59
|
+
MEDIA_RESOLUTION_HIGH: "MEDIA_RESOLUTION_HIGH";
|
60
|
+
}>>;
|
55
61
|
}, z.core.$strip>;
|
56
62
|
type GoogleGenerativeAIProviderOptions = z.infer<typeof googleGenerativeAIProviderOptions>;
|
57
63
|
|
@@ -187,9 +193,9 @@ declare const googleTools: {
|
|
187
193
|
};
|
188
194
|
|
189
195
|
interface GoogleGenerativeAIProvider extends ProviderV3 {
|
190
|
-
(modelId: GoogleGenerativeAIModelId):
|
191
|
-
languageModel(modelId: GoogleGenerativeAIModelId):
|
192
|
-
chat(modelId: GoogleGenerativeAIModelId):
|
196
|
+
(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
|
197
|
+
languageModel(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
|
198
|
+
chat(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
|
193
199
|
/**
|
194
200
|
Creates a model for image generation.
|
195
201
|
*/
|
@@ -197,7 +203,7 @@ interface GoogleGenerativeAIProvider extends ProviderV3 {
|
|
197
203
|
/**
|
198
204
|
* @deprecated Use `chat()` instead.
|
199
205
|
*/
|
200
|
-
generativeAI(modelId: GoogleGenerativeAIModelId):
|
206
|
+
generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
|
201
207
|
/**
|
202
208
|
@deprecated Use `textEmbedding()` instead.
|
203
209
|
*/
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { z } from 'zod/v4';
|
2
|
-
import { ProviderV3,
|
2
|
+
import { ProviderV3, LanguageModelV3, ImageModelV3, EmbeddingModelV3 } from '@ai-sdk/provider';
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
4
4
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
5
5
|
|
@@ -52,6 +52,12 @@ declare const googleGenerativeAIProviderOptions: z.ZodObject<{
|
|
52
52
|
}>>;
|
53
53
|
audioTimestamp: z.ZodOptional<z.ZodBoolean>;
|
54
54
|
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
55
|
+
mediaResolution: z.ZodOptional<z.ZodEnum<{
|
56
|
+
MEDIA_RESOLUTION_UNSPECIFIED: "MEDIA_RESOLUTION_UNSPECIFIED";
|
57
|
+
MEDIA_RESOLUTION_LOW: "MEDIA_RESOLUTION_LOW";
|
58
|
+
MEDIA_RESOLUTION_MEDIUM: "MEDIA_RESOLUTION_MEDIUM";
|
59
|
+
MEDIA_RESOLUTION_HIGH: "MEDIA_RESOLUTION_HIGH";
|
60
|
+
}>>;
|
55
61
|
}, z.core.$strip>;
|
56
62
|
type GoogleGenerativeAIProviderOptions = z.infer<typeof googleGenerativeAIProviderOptions>;
|
57
63
|
|
@@ -187,9 +193,9 @@ declare const googleTools: {
|
|
187
193
|
};
|
188
194
|
|
189
195
|
interface GoogleGenerativeAIProvider extends ProviderV3 {
|
190
|
-
(modelId: GoogleGenerativeAIModelId):
|
191
|
-
languageModel(modelId: GoogleGenerativeAIModelId):
|
192
|
-
chat(modelId: GoogleGenerativeAIModelId):
|
196
|
+
(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
|
197
|
+
languageModel(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
|
198
|
+
chat(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
|
193
199
|
/**
|
194
200
|
Creates a model for image generation.
|
195
201
|
*/
|
@@ -197,7 +203,7 @@ interface GoogleGenerativeAIProvider extends ProviderV3 {
|
|
197
203
|
/**
|
198
204
|
* @deprecated Use `chat()` instead.
|
199
205
|
*/
|
200
|
-
generativeAI(modelId: GoogleGenerativeAIModelId):
|
206
|
+
generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
|
201
207
|
/**
|
202
208
|
@deprecated Use `textEmbedding()` instead.
|
203
209
|
*/
|
package/dist/index.js
CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(src_exports);
|
|
30
30
|
var import_provider_utils9 = require("@ai-sdk/provider-utils");
|
31
31
|
|
32
32
|
// src/version.ts
|
33
|
-
var VERSION = true ? "2.1.0-beta.
|
33
|
+
var VERSION = true ? "2.1.0-beta.8" : "0.0.0-test";
|
34
34
|
|
35
35
|
// src/google-generative-ai-embedding-model.ts
|
36
36
|
var import_provider = require("@ai-sdk/provider");
|
@@ -522,7 +522,18 @@ var googleGenerativeAIProviderOptions = import_v44.z.object({
|
|
522
522
|
*
|
523
523
|
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls
|
524
524
|
*/
|
525
|
-
labels: import_v44.z.record(import_v44.z.string(), import_v44.z.string()).optional()
|
525
|
+
labels: import_v44.z.record(import_v44.z.string(), import_v44.z.string()).optional(),
|
526
|
+
/**
|
527
|
+
* Optional. If specified, the media resolution specified will be used.
|
528
|
+
*
|
529
|
+
* https://ai.google.dev/api/generate-content#MediaResolution
|
530
|
+
*/
|
531
|
+
mediaResolution: import_v44.z.enum([
|
532
|
+
"MEDIA_RESOLUTION_UNSPECIFIED",
|
533
|
+
"MEDIA_RESOLUTION_LOW",
|
534
|
+
"MEDIA_RESOLUTION_MEDIUM",
|
535
|
+
"MEDIA_RESOLUTION_HIGH"
|
536
|
+
]).optional()
|
526
537
|
});
|
527
538
|
|
528
539
|
// src/google-prepare-tools.ts
|
@@ -755,7 +766,7 @@ var urlContext = (0, import_provider_utils5.createProviderDefinedToolFactory)({
|
|
755
766
|
// src/google-generative-ai-language-model.ts
|
756
767
|
var GoogleGenerativeAILanguageModel = class {
|
757
768
|
constructor(modelId, config) {
|
758
|
-
this.specificationVersion = "
|
769
|
+
this.specificationVersion = "v3";
|
759
770
|
var _a;
|
760
771
|
this.modelId = modelId;
|
761
772
|
this.config = config;
|
@@ -833,7 +844,10 @@ var GoogleGenerativeAILanguageModel = class {
|
|
833
844
|
},
|
834
845
|
// provider options:
|
835
846
|
responseModalities: googleOptions == null ? void 0 : googleOptions.responseModalities,
|
836
|
-
thinkingConfig: googleOptions == null ? void 0 : googleOptions.thinkingConfig
|
847
|
+
thinkingConfig: googleOptions == null ? void 0 : googleOptions.thinkingConfig,
|
848
|
+
...(googleOptions == null ? void 0 : googleOptions.mediaResolution) && {
|
849
|
+
mediaResolution: googleOptions.mediaResolution
|
850
|
+
}
|
837
851
|
},
|
838
852
|
contents,
|
839
853
|
systemInstruction: isGemmaModel ? void 0 : systemInstruction,
|