@ai-sdk/google 3.0.135 → 3.0.137
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 +10 -11
- package/dist/index.d.ts +10 -11
- package/dist/index.js +291 -256
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +201 -161
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +62 -40
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +62 -40
- package/dist/internal/index.mjs.map +1 -1
- package/docs/15-google-generative-ai.mdx +8 -0
- package/package.json +2 -2
- package/src/google-generative-ai-embedding-options.ts +15 -14
- package/src/google-generative-ai-image-model.ts +1 -1
- package/src/google-generative-ai-language-model.ts +73 -42
- package/src/google-generative-ai-prompt.ts +2 -0
- package/src/google-generative-ai-video-model.ts +30 -26
- package/src/tool/file-search.ts +33 -30
- package/src/tool/google-search.ts +19 -18
- package/src/transcription/google-transcription-model-options.ts +40 -31
- package/src/transcription/google-transcription-model.ts +37 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 3.0.137
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f536aa8: Defer validation schema construction until first use to reduce provider import time.
|
|
8
|
+
- Updated dependencies [1183cc4]
|
|
9
|
+
- Updated dependencies [d726591]
|
|
10
|
+
- @ai-sdk/provider-utils@4.0.62
|
|
11
|
+
|
|
12
|
+
## 3.0.136
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 8fccc63: Preserve grounding metadata from each automatically continued Google response in `groundingMetadataPerRequest`. Previously, a later response without grounding could leave earlier Search queries absent from the final provider metadata even though their sources were returned. The new array preserves request order and includes `null` for requests without grounding.
|
|
17
|
+
|
|
3
18
|
## 3.0.135
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -241,6 +241,8 @@ type GoogleGenerativeAIUsageMetadata = UsageMetadataSchema;
|
|
|
241
241
|
interface GoogleGenerativeAIProviderMetadata {
|
|
242
242
|
promptFeedback: GoogleGenerativeAIPromptFeedback | null;
|
|
243
243
|
groundingMetadata: GoogleGenerativeAIGroundingMetadata | null;
|
|
244
|
+
/** Grounding from each automatically continued request, in request order. */
|
|
245
|
+
groundingMetadataPerRequest?: Array<GoogleGenerativeAIGroundingMetadata | null>;
|
|
244
246
|
urlContextMetadata: GoogleGenerativeAIUrlContextMetadata | null;
|
|
245
247
|
safetyRatings: GoogleGenerativeAISafetyRating[] | null;
|
|
246
248
|
usageMetadata: GoogleGenerativeAIUsageMetadata | null;
|
|
@@ -463,17 +465,14 @@ type GoogleTranscriptionModelId = 'gemini-3.5-transcribe' | 'gemini-3.5-transcri
|
|
|
463
465
|
* The live variant (`gemini-3.5-transcribe-live`) requires streaming
|
|
464
466
|
* transcription, which is only available in AI SDK v7.
|
|
465
467
|
*/
|
|
466
|
-
declare const googleTranscriptionModelOptions:
|
|
467
|
-
languageCodes
|
|
468
|
-
customVocabulary
|
|
469
|
-
wordTimestamp
|
|
470
|
-
diarization
|
|
471
|
-
mode
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
}>>;
|
|
475
|
-
}, z.core.$strip>;
|
|
476
|
-
type GoogleTranscriptionModelOptions = z.infer<typeof googleTranscriptionModelOptions>;
|
|
468
|
+
declare const googleTranscriptionModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
469
|
+
languageCodes?: string[] | undefined;
|
|
470
|
+
customVocabulary?: string[] | undefined;
|
|
471
|
+
wordTimestamp?: boolean | undefined;
|
|
472
|
+
diarization?: boolean | undefined;
|
|
473
|
+
mode?: "SMART" | "VERBATIM" | undefined;
|
|
474
|
+
}>;
|
|
475
|
+
type GoogleTranscriptionModelOptions = InferSchema<typeof googleTranscriptionModelOptions>;
|
|
477
476
|
|
|
478
477
|
interface GoogleTranscriptionModelConfig {
|
|
479
478
|
provider: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -241,6 +241,8 @@ type GoogleGenerativeAIUsageMetadata = UsageMetadataSchema;
|
|
|
241
241
|
interface GoogleGenerativeAIProviderMetadata {
|
|
242
242
|
promptFeedback: GoogleGenerativeAIPromptFeedback | null;
|
|
243
243
|
groundingMetadata: GoogleGenerativeAIGroundingMetadata | null;
|
|
244
|
+
/** Grounding from each automatically continued request, in request order. */
|
|
245
|
+
groundingMetadataPerRequest?: Array<GoogleGenerativeAIGroundingMetadata | null>;
|
|
244
246
|
urlContextMetadata: GoogleGenerativeAIUrlContextMetadata | null;
|
|
245
247
|
safetyRatings: GoogleGenerativeAISafetyRating[] | null;
|
|
246
248
|
usageMetadata: GoogleGenerativeAIUsageMetadata | null;
|
|
@@ -463,17 +465,14 @@ type GoogleTranscriptionModelId = 'gemini-3.5-transcribe' | 'gemini-3.5-transcri
|
|
|
463
465
|
* The live variant (`gemini-3.5-transcribe-live`) requires streaming
|
|
464
466
|
* transcription, which is only available in AI SDK v7.
|
|
465
467
|
*/
|
|
466
|
-
declare const googleTranscriptionModelOptions:
|
|
467
|
-
languageCodes
|
|
468
|
-
customVocabulary
|
|
469
|
-
wordTimestamp
|
|
470
|
-
diarization
|
|
471
|
-
mode
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
}>>;
|
|
475
|
-
}, z.core.$strip>;
|
|
476
|
-
type GoogleTranscriptionModelOptions = z.infer<typeof googleTranscriptionModelOptions>;
|
|
468
|
+
declare const googleTranscriptionModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
469
|
+
languageCodes?: string[] | undefined;
|
|
470
|
+
customVocabulary?: string[] | undefined;
|
|
471
|
+
wordTimestamp?: boolean | undefined;
|
|
472
|
+
diarization?: boolean | undefined;
|
|
473
|
+
mode?: "SMART" | "VERBATIM" | undefined;
|
|
474
|
+
}>;
|
|
475
|
+
type GoogleTranscriptionModelOptions = InferSchema<typeof googleTranscriptionModelOptions>;
|
|
477
476
|
|
|
478
477
|
interface GoogleTranscriptionModelConfig {
|
|
479
478
|
provider: string;
|