Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api-report/genai-node.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2533,7 +2533,7 @@ export interface LiveConnectConfig {
seed?: number;
sessionResumption?: SessionResumptionConfig;
speechConfig?: SpeechConfig;
streamTranslationConfig?: StreamTranslationConfig;
streamingTranslationConfig?: StreamingTranslationConfig;
systemInstruction?: ContentUnion;
temperature?: number;
thinkingConfig?: ThinkingConfig;
Expand Down Expand Up @@ -3604,7 +3604,7 @@ export interface StreamableHttpTransport {
}

// @public
export interface StreamTranslationConfig {
export interface StreamingTranslationConfig {
echoTargetLanguage?: boolean;
targetLanguageCode?: string;
}
Expand Down
4 changes: 2 additions & 2 deletions api-report/genai-web.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2533,7 +2533,7 @@ export interface LiveConnectConfig {
seed?: number;
sessionResumption?: SessionResumptionConfig;
speechConfig?: SpeechConfig;
streamTranslationConfig?: StreamTranslationConfig;
streamingTranslationConfig?: StreamingTranslationConfig;
systemInstruction?: ContentUnion;
temperature?: number;
thinkingConfig?: ThinkingConfig;
Expand Down Expand Up @@ -3604,7 +3604,7 @@ export interface StreamableHttpTransport {
}

// @public
export interface StreamTranslationConfig {
export interface StreamingTranslationConfig {
echoTargetLanguage?: boolean;
targetLanguageCode?: string;
}
Expand Down
4 changes: 2 additions & 2 deletions api-report/genai.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2533,7 +2533,7 @@ export interface LiveConnectConfig {
seed?: number;
sessionResumption?: SessionResumptionConfig;
speechConfig?: SpeechConfig;
streamTranslationConfig?: StreamTranslationConfig;
streamingTranslationConfig?: StreamingTranslationConfig;
systemInstruction?: ContentUnion;
temperature?: number;
thinkingConfig?: ThinkingConfig;
Expand Down Expand Up @@ -3604,7 +3604,7 @@ export interface StreamableHttpTransport {
}

// @public
export interface StreamTranslationConfig {
export interface StreamingTranslationConfig {
echoTargetLanguage?: boolean;
targetLanguageCode?: string;
}
Expand Down
15 changes: 8 additions & 7 deletions src/converters/_live_converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1218,14 +1218,14 @@ export function liveConnectConfigToMldev(
);
}

const fromStreamTranslationConfig = common.getValueByPath(fromObject, [
'streamTranslationConfig',
const fromStreamingTranslationConfig = common.getValueByPath(fromObject, [
'streamingTranslationConfig',
]);
if (parentObject !== undefined && fromStreamTranslationConfig != null) {
if (parentObject !== undefined && fromStreamingTranslationConfig != null) {
common.setValueByPath(
parentObject,
['setup', 'generationConfig', 'streamTranslationConfig'],
fromStreamTranslationConfig,
['setup', 'generationConfig', 'streamingTranslationConfig'],
fromStreamingTranslationConfig,
);
}

Expand Down Expand Up @@ -1473,10 +1473,11 @@ export function liveConnectConfigToVertex(
}

if (
common.getValueByPath(fromObject, ['streamTranslationConfig']) !== undefined
common.getValueByPath(fromObject, ['streamingTranslationConfig']) !==
undefined
) {
throw new Error(
'streamTranslationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.',
'streamingTranslationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.',
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/converters/_tokens_converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,14 +558,14 @@ export function liveConnectConfigToMldev(
);
}

const fromStreamTranslationConfig = common.getValueByPath(fromObject, [
'streamTranslationConfig',
const fromStreamingTranslationConfig = common.getValueByPath(fromObject, [
'streamingTranslationConfig',
]);
if (parentObject !== undefined && fromStreamTranslationConfig != null) {
if (parentObject !== undefined && fromStreamingTranslationConfig != null) {
common.setValueByPath(
parentObject,
['setup', 'generationConfig', 'streamTranslationConfig'],
fromStreamTranslationConfig,
['setup', 'generationConfig', 'streamingTranslationConfig'],
fromStreamingTranslationConfig,
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7529,7 +7529,7 @@ export declare interface LiveClientMessage {
}

/** Config for stream translation. */
export declare interface StreamTranslationConfig {
export declare interface StreamingTranslationConfig {
/** If true, the model will generate audio when the target language is
spoken, essentially it will parrot the input. If false, we will not produce
audio for the target language. */
Expand Down Expand Up @@ -7635,8 +7635,8 @@ If included the server will send SessionResumptionUpdate messages. */
response.
*/
safetySettings?: SafetySetting[];
/** Config for stream translation. */
streamTranslationConfig?: StreamTranslationConfig;
/** Config for streaming translation. */
streamingTranslationConfig?: StreamingTranslationConfig;
}

/** Parameters for connecting to the live API. */
Expand Down
Loading