🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@ai-sdk/google

Package Overview
Dependencies
Maintainers
3
Versions
527
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/google - npm Package Compare versions

Comparing version
4.0.0-beta.83
to
4.0.0-beta.84
+23
-1
dist/index.d.ts

@@ -625,4 +625,26 @@ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';

type GoogleRealtimeModelId = string;
type GoogleRealtimeModelOptions = {
/**
* Gemini Live Translation configuration.
*
* Required for `gemini-3.5-live-translate-preview` when translating speech
* to a target language.
*/
translationConfig?: {
/**
* BCP-47 language code of the language to translate into.
* Defaults to `en` in the Gemini API.
*/
targetLanguageCode?: string;
/**
* Whether input audio already in the target language should be echoed
* instead of producing silence.
*/
echoTargetLanguage?: boolean;
};
};
declare const VERSION: string;
export { GoogleRealtimeModel as Experimental_GoogleRealtimeModel, type GoogleRealtimeModelConfig as Experimental_GoogleRealtimeModelConfig, 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 };
export { GoogleRealtimeModel as Experimental_GoogleRealtimeModel, type GoogleRealtimeModelConfig as Experimental_GoogleRealtimeModelConfig, type GoogleRealtimeModelId as Experimental_GoogleRealtimeModelId, type GoogleRealtimeModelOptions as Experimental_GoogleRealtimeModelOptions, 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 };
+1
-1
{
"name": "@ai-sdk/google",
"version": "4.0.0-beta.83",
"version": "4.0.0-beta.84",
"type": "module",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

@@ -59,3 +59,7 @@ export type { GoogleErrorData } from './google-error';

export type { GoogleRealtimeModelConfig as Experimental_GoogleRealtimeModelConfig } from './realtime/google-realtime-model';
export type {
GoogleRealtimeModelId as Experimental_GoogleRealtimeModelId,
GoogleRealtimeModelOptions as Experimental_GoogleRealtimeModelOptions,
} from './realtime/google-realtime-model-options';
export { VERSION } from './version';

@@ -11,2 +11,3 @@ import type {

import { getModelPath } from '../get-model-path';
import type { GoogleRealtimeModelOptions } from './google-realtime-model-options';

@@ -42,2 +43,6 @@ type GoogleRealtimeFunctionCall = {

function isRecord(value: unknown): value is Record<string, unknown> {
return value != null && typeof value === 'object' && !Array.isArray(value);
}
/**

@@ -273,2 +278,8 @@ * Stateful event mapper for Google's Gemini Live API.

case 'input-audio-commit':
return {
realtimeInput: {
audioStreamEnd: true,
},
};
case 'input-audio-clear':

@@ -381,7 +392,24 @@ case 'response-create':

if (config?.providerOptions != null) {
Object.assign(setup, config.providerOptions);
if (config?.providerOptions == null) {
return setup;
}
const { google, ...providerOptions } = config.providerOptions;
Object.assign(setup, providerOptions);
const googleOptions = isRecord(google)
? (google as GoogleRealtimeModelOptions)
: undefined;
if (googleOptions?.translationConfig != null) {
const target = isRecord(setup.generationConfig)
? setup.generationConfig
: generationConfig;
setup.generationConfig = {
...target,
translationConfig: googleOptions.translationConfig,
};
}
return setup;
}
export type GoogleRealtimeModelId = string;
export type GoogleRealtimeModelOptions = Record<string, never>;
export type GoogleRealtimeModelOptions = {
/**
* Gemini Live Translation configuration.
*
* Required for `gemini-3.5-live-translate-preview` when translating speech
* to a target language.
*/
translationConfig?: {
/**
* BCP-47 language code of the language to translate into.
* Defaults to `en` in the Gemini API.
*/
targetLanguageCode?: string;
/**
* Whether input audio already in the target language should be echoed
* instead of producing silence.
*/
echoTargetLanguage?: boolean;
};
};
export { GoogleRealtimeModel as Experimental_GoogleRealtimeModel } from './google-realtime-model';
export type { GoogleRealtimeModelConfig as Experimental_GoogleRealtimeModelConfig } from './google-realtime-model';
export type {
GoogleRealtimeModelId as Experimental_GoogleRealtimeModelId,
GoogleRealtimeModelOptions as Experimental_GoogleRealtimeModelOptions,
} from './google-realtime-model-options';

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet