Table of Contents

Class TranslationConfig

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

Config for stream translation.

public record TranslationConfig : IEquatable<TranslationConfig>
Inheritance
TranslationConfig
Implements
Inherited Members

Properties

EchoTargetLanguage

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.

[JsonPropertyName("echoTargetLanguage")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? EchoTargetLanguage { get; set; }

Property Value

bool?

TargetLanguageCode

The target language for translation. Supported values are BCP-47 language codes (e.g. "en", "es", "fr").

[JsonPropertyName("targetLanguageCode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? TargetLanguageCode { get; set; }

Property Value

string

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a TranslationConfig object.

public static TranslationConfig? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

TranslationConfig

The deserialized TranslationConfig object, or null if deserialization fails.