@ai-sdk/google 4.0.0-canary.74 → 4.0.0-canary.76
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.ts +27 -4
- package/dist/index.js +638 -366
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +10 -10
- package/dist/internal/index.js.map +1 -1
- package/docs/15-google.mdx +78 -0
- package/package.json +1 -1
- package/src/google-embedding-model-options.ts +1 -0
- package/src/google-json-accumulator.ts +10 -10
- package/src/google-language-model-options.ts +2 -0
- package/src/google-provider.ts +23 -0
- package/src/google-speech-api.ts +36 -0
- package/src/google-speech-model-options.ts +48 -0
- package/src/google-speech-model.ts +286 -0
- package/src/index.ts +4 -0
- package/src/interactions/build-google-interactions-stream-transform.ts +7 -7
- package/src/interactions/extract-google-interactions-sources.ts +20 -13
- package/src/interactions/google-interactions-language-model.ts +50 -46
- package/src/interactions/stream-google-interactions.ts +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 4.0.0-canary.76
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b563707: feat(provider/google): add Gemini text-to-speech (speech) model support
|
|
8
|
+
|
|
9
|
+
## 4.0.0-canary.75
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 00a0f36: feat(google, google-vertex): added `gemini-embedding-2`, `deep-research-max-preview-04-2026` and `deep-research-preview-04-2026`
|
|
14
|
+
|
|
3
15
|
## 4.0.0-canary.74
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
2
2
|
import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
|
-
import { ProviderV4, LanguageModelV4, ImageModelV4, EmbeddingModelV4, Experimental_VideoModelV4, FilesV4 } from '@ai-sdk/provider';
|
|
3
|
+
import { ProviderV4, LanguageModelV4, ImageModelV4, EmbeddingModelV4, Experimental_VideoModelV4, SpeechModelV4, FilesV4 } from '@ai-sdk/provider';
|
|
4
4
|
|
|
5
5
|
declare const googleErrorDataSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
6
6
|
error: {
|
|
@@ -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 GoogleModelId = 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-flash-lite-001' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-2.5-flash-native-audio-latest' | 'gemini-2.5-flash-native-audio-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-pro-preview-customtools' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.5-flash' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'deep-research-pro-preview-12-2025' | 'nano-banana-pro-preview' | 'aqa' | 'gemini-robotics-er-1.5-preview' | 'gemma-3-1b-it' | 'gemma-3-4b-it' | 'gemma-3n-e4b-it' | 'gemma-3n-e2b-it' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
|
|
14
|
+
type GoogleModelId = 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-flash-lite-001' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-2.5-flash-native-audio-latest' | 'gemini-2.5-flash-native-audio-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-pro-preview-customtools' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.5-flash' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'deep-research-pro-preview-12-2025' | 'deep-research-max-preview-04-2026' | 'deep-research-preview-04-2026' | 'nano-banana-pro-preview' | 'aqa' | 'gemini-robotics-er-1.5-preview' | 'gemma-3-1b-it' | 'gemma-3-4b-it' | 'gemma-3n-e4b-it' | 'gemma-3n-e2b-it' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
|
|
15
15
|
declare const googleLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
16
16
|
responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
|
|
17
17
|
thinkingConfig?: {
|
|
@@ -231,7 +231,7 @@ declare const googleImageModelOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
231
231
|
}>;
|
|
232
232
|
type GoogleImageModelOptions = InferSchema<typeof googleImageModelOptionsSchema>;
|
|
233
233
|
|
|
234
|
-
type GoogleEmbeddingModelId = 'gemini-embedding-001' | 'gemini-embedding-2-preview' | (string & {});
|
|
234
|
+
type GoogleEmbeddingModelId = 'gemini-embedding-001' | 'gemini-embedding-2' | 'gemini-embedding-2-preview' | (string & {});
|
|
235
235
|
declare const googleEmbeddingModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
236
236
|
outputDimensionality?: number | undefined;
|
|
237
237
|
taskType?: "SEMANTIC_SIMILARITY" | "CLASSIFICATION" | "CLUSTERING" | "RETRIEVAL_DOCUMENT" | "RETRIEVAL_QUERY" | "QUESTION_ANSWERING" | "FACT_VERIFICATION" | "CODE_RETRIEVAL_QUERY" | undefined;
|
|
@@ -265,6 +265,21 @@ type GoogleVideoModelOptions = {
|
|
|
265
265
|
|
|
266
266
|
type GoogleVideoModelId = 'veo-3.1-fast-generate-preview' | 'veo-3.1-generate-preview' | 'veo-3.1-generate' | 'veo-3.1-lite-generate-preview' | 'veo-3.0-generate-001' | 'veo-3.0-fast-generate-001' | 'veo-2.0-generate-001' | (string & {});
|
|
267
267
|
|
|
268
|
+
type GoogleSpeechModelId = 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-3.1-flash-tts-preview' | (string & {});
|
|
269
|
+
declare const googleSpeechProviderOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
270
|
+
multiSpeakerVoiceConfig?: {
|
|
271
|
+
speakerVoiceConfigs: {
|
|
272
|
+
speaker: string;
|
|
273
|
+
voiceConfig: {
|
|
274
|
+
prebuiltVoiceConfig: {
|
|
275
|
+
voiceName: string;
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
}[];
|
|
279
|
+
} | undefined;
|
|
280
|
+
}>;
|
|
281
|
+
type GoogleSpeechModelOptions = InferSchema<typeof googleSpeechProviderOptionsSchema>;
|
|
282
|
+
|
|
268
283
|
type GoogleFilesUploadOptions = {
|
|
269
284
|
displayName?: string | null;
|
|
270
285
|
pollIntervalMs?: number | null;
|
|
@@ -517,6 +532,14 @@ interface GoogleProvider extends ProviderV4 {
|
|
|
517
532
|
* Creates a model for video generation.
|
|
518
533
|
*/
|
|
519
534
|
videoModel(modelId: GoogleVideoModelId): Experimental_VideoModelV4;
|
|
535
|
+
/**
|
|
536
|
+
* Creates a model for speech generation (text-to-speech).
|
|
537
|
+
*/
|
|
538
|
+
speech(modelId: GoogleSpeechModelId): SpeechModelV4;
|
|
539
|
+
/**
|
|
540
|
+
* Creates a model for speech generation (text-to-speech).
|
|
541
|
+
*/
|
|
542
|
+
speechModel(modelId: GoogleSpeechModelId): SpeechModelV4;
|
|
520
543
|
files(): FilesV4;
|
|
521
544
|
/**
|
|
522
545
|
* Creates a language model targeting the Gemini Interactions API
|
|
@@ -574,4 +597,4 @@ declare const google: GoogleProvider;
|
|
|
574
597
|
|
|
575
598
|
declare const VERSION: string;
|
|
576
599
|
|
|
577
|
-
export { type GoogleEmbeddingModelOptions, type GoogleErrorData, type GoogleFilesUploadOptions, type GoogleEmbeddingModelOptions as GoogleGenerativeAIEmbeddingProviderOptions, type GoogleImageModelOptions as GoogleGenerativeAIImageProviderOptions, type GoogleProvider as GoogleGenerativeAIProvider, type GoogleProviderMetadata as GoogleGenerativeAIProviderMetadata, type GoogleLanguageModelOptions as GoogleGenerativeAIProviderOptions, type GoogleProviderSettings as GoogleGenerativeAIProviderSettings, type GoogleVideoModelId as GoogleGenerativeAIVideoModelId, type GoogleVideoModelOptions as GoogleGenerativeAIVideoProviderOptions, type GoogleImageModelOptions, type GoogleInteractionsAgentName, type GoogleInteractionsModelId, type GoogleInteractionsProviderMetadata, type GoogleLanguageModelInteractionsOptions, type GoogleLanguageModelOptions, type GoogleProvider, type GoogleProviderMetadata, type GoogleProviderSettings, type GoogleVideoModelId, type GoogleVideoModelOptions, VERSION, createGoogle, createGoogle as createGoogleGenerativeAI, google };
|
|
600
|
+
export { type GoogleEmbeddingModelOptions, type GoogleErrorData, type GoogleFilesUploadOptions, type GoogleEmbeddingModelOptions as GoogleGenerativeAIEmbeddingProviderOptions, type GoogleImageModelOptions as GoogleGenerativeAIImageProviderOptions, type GoogleProvider as GoogleGenerativeAIProvider, type GoogleProviderMetadata as GoogleGenerativeAIProviderMetadata, type GoogleLanguageModelOptions as GoogleGenerativeAIProviderOptions, type GoogleProviderSettings as GoogleGenerativeAIProviderSettings, type GoogleVideoModelId as GoogleGenerativeAIVideoModelId, type GoogleVideoModelOptions as GoogleGenerativeAIVideoProviderOptions, type GoogleImageModelOptions, type GoogleInteractionsAgentName, type GoogleInteractionsModelId, type GoogleInteractionsProviderMetadata, type GoogleLanguageModelInteractionsOptions, type GoogleLanguageModelOptions, type GoogleProvider, type GoogleProviderMetadata, type GoogleProviderSettings, type GoogleSpeechModelId, type GoogleSpeechModelOptions, type GoogleVideoModelId, type GoogleVideoModelOptions, VERSION, createGoogle, createGoogle as createGoogleGenerativeAI, google };
|