Table of Contents

Class AudioTranscriptionConfig

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

The audio transcription configuration in Setup.

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

Properties

AdaptationPhrases

A list of phrases used for speech adaptation, which biases the ASR model to improve recognition of these specific terms.

[JsonPropertyName("adaptationPhrases")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string>? AdaptationPhrases { get; set; }

Property Value

List<string>

LanguageAuto

The model will detect the language automatically. Do not use together with LanguageHints.

[JsonPropertyName("languageAuto")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public LanguageAuto? LanguageAuto { get; set; }

Property Value

LanguageAuto

LanguageCodes

Deprecated: use LanguageAuto or LanguageHints instead.

[JsonPropertyName("languageCodes")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string>? LanguageCodes { get; set; }

Property Value

List<string>

LanguageHints

Specifies one or more languages in the audio. Do not use together with LanguageAuto.

[JsonPropertyName("languageHints")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public LanguageHints? LanguageHints { get; set; }

Property Value

LanguageHints

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a AudioTranscriptionConfig object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

AudioTranscriptionConfig

The deserialized AudioTranscriptionConfig object, or null if deserialization fails.