@ai-sdk/google 4.0.78 → 4.0.79
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.ts +13 -1
- package/dist/index.js +573 -397
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +26 -2
- package/dist/internal/index.js +370 -219
- package/dist/internal/index.js.map +1 -1
- package/docs/15-google.mdx +85 -14
- package/package.json +2 -2
- package/src/convert-to-google-messages.ts +28 -0
- package/src/google-embedding-model.ts +39 -8
- package/src/google-json-accumulator.ts +0 -1
- package/src/google-prompt.ts +12 -0
- package/src/google-speech-api.ts +2 -1
- package/src/google-speech-input.ts +64 -0
- package/src/google-speech-model-options.ts +28 -1
- package/src/google-speech-model.ts +137 -25
- package/src/internal/index.ts +1 -0
- package/src/tool/code-execution.ts +14 -10
package/dist/internal/index.d.ts
CHANGED
|
@@ -59,6 +59,16 @@ type GoogleContentPart = {
|
|
|
59
59
|
id: string;
|
|
60
60
|
};
|
|
61
61
|
thoughtSignature?: string;
|
|
62
|
+
} | {
|
|
63
|
+
executableCode: {
|
|
64
|
+
language: string;
|
|
65
|
+
code: string;
|
|
66
|
+
};
|
|
67
|
+
} | {
|
|
68
|
+
codeExecutionResult: {
|
|
69
|
+
outcome: string;
|
|
70
|
+
output: string;
|
|
71
|
+
};
|
|
62
72
|
};
|
|
63
73
|
type GoogleFunctionResponsePart = {
|
|
64
74
|
inlineData: {
|
|
@@ -412,7 +422,7 @@ type SafetyRatingSchema = NonNullable<CandidateSchema['safetyRatings']>[number];
|
|
|
412
422
|
type PromptFeedbackSchema = NonNullable<InferSchema<typeof responseSchema>['promptFeedback']>;
|
|
413
423
|
type UsageMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['usageMetadata']>;
|
|
414
424
|
|
|
415
|
-
type GoogleSpeechModelId = 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-3.1-flash-tts-preview' | (string & {});
|
|
425
|
+
type GoogleSpeechModelId = 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.8-flash-tts' | 'gemini-3.8-flash-lite-tts' | (string & {});
|
|
416
426
|
|
|
417
427
|
interface GoogleSpeechModelConfig {
|
|
418
428
|
provider: string;
|
|
@@ -441,6 +451,20 @@ declare class GoogleSpeechModel implements SpeechModelV4 {
|
|
|
441
451
|
doGenerate(options: Parameters<SpeechModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV4['doGenerate']>>>;
|
|
442
452
|
}
|
|
443
453
|
|
|
454
|
+
/**
|
|
455
|
+
* Inspects speech input without replacing provider option validation. This is
|
|
456
|
+
* also used by intermediaries that need the transcript or voice kind before
|
|
457
|
+
* invoking a model. Model support for structured turns is validated separately.
|
|
458
|
+
*/
|
|
459
|
+
declare function getGoogleSpeechInput({ text, voice, providerOptions, }: {
|
|
460
|
+
text: string;
|
|
461
|
+
voice?: string;
|
|
462
|
+
providerOptions?: Record<string, unknown>;
|
|
463
|
+
}): {
|
|
464
|
+
text: string;
|
|
465
|
+
usesCustomVoice: boolean;
|
|
466
|
+
};
|
|
467
|
+
|
|
444
468
|
declare const googleTools: {
|
|
445
469
|
/**
|
|
446
470
|
* Creates a Google search tool that gives Google direct access to real-time web content.
|
|
@@ -587,4 +611,4 @@ declare class GoogleInteractionsLanguageModel implements LanguageModelV4 {
|
|
|
587
611
|
*/
|
|
588
612
|
type GoogleInteractionsAgentName = 'deep-research-pro-preview-12-2025' | 'deep-research-preview-04-2026' | 'deep-research-max-preview-04-2026' | 'antigravity-preview-05-2026';
|
|
589
613
|
|
|
590
|
-
export { type GoogleInteractionsAgentName, GoogleInteractionsLanguageModel, type GoogleInteractionsModelId, type GoogleInteractionsModelInput, GoogleLanguageModel, type GoogleLanguageModelConfig, type GoogleModelId, GoogleSpeechModel, type GroundingMetadataSchema, type PromptFeedbackSchema, type SafetyRatingSchema, type UrlContextMetadataSchema, type UsageMetadataSchema, getGroundingMetadataSchema, getUrlContextMetadataSchema, googleTools, responseSchema };
|
|
614
|
+
export { type GoogleInteractionsAgentName, GoogleInteractionsLanguageModel, type GoogleInteractionsModelId, type GoogleInteractionsModelInput, GoogleLanguageModel, type GoogleLanguageModelConfig, type GoogleModelId, GoogleSpeechModel, type GroundingMetadataSchema, type PromptFeedbackSchema, type SafetyRatingSchema, type UrlContextMetadataSchema, type UsageMetadataSchema, getGoogleSpeechInput, getGroundingMetadataSchema, getUrlContextMetadataSchema, googleTools, responseSchema };
|