Class LiveConnectConfig
Session config for the API connection.
public record LiveConnectConfig : IEquatable<LiveConnectConfig>
- Inheritance
-
LiveConnectConfig
- Implements
- Inherited Members
Properties
AvatarConfig
Configures the avatar model behavior.
[JsonPropertyName("avatarConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public AvatarConfig? AvatarConfig { get; set; }
Property Value
ContextWindowCompression
Configures context window compression mechanism. If included, server will compress context window to fit into given length.
[JsonPropertyName("contextWindowCompression")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ContextWindowCompressionConfig? ContextWindowCompression { get; set; }
Property Value
EnableAffectiveDialog
If enabled, the model will detect emotions and adapt its responses accordingly.
[JsonPropertyName("enableAffectiveDialog")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? EnableAffectiveDialog { get; set; }
Property Value
- bool?
ExplicitVadSignal
Configures the explicit VAD signal. If enabled, the client will send vad_signal to indicate the start and end of speech. This allows the server to process the audio more efficiently.
[JsonPropertyName("explicitVadSignal")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? ExplicitVadSignal { get; set; }
Property Value
- bool?
GenerationConfig
The generation configuration for the session.
[JsonPropertyName("generationConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public GenerationConfig? GenerationConfig { get; set; }
Property Value
HttpOptions
Used to override HTTP request options.
[JsonPropertyName("httpOptions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public HttpOptions? HttpOptions { get; set; }
Property Value
InputAudioTranscription
The transcription of the input aligns with the input audio language.
[JsonPropertyName("inputAudioTranscription")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public AudioTranscriptionConfig? InputAudioTranscription { get; set; }
Property Value
MaxOutputTokens
Maximum number of tokens that can be generated in the response.
[JsonPropertyName("maxOutputTokens")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? MaxOutputTokens { get; set; }
Property Value
- int?
MediaResolution
If specified, the media resolution specified will be used.
[JsonPropertyName("mediaResolution")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public MediaResolution? MediaResolution { get; set; }
Property Value
OutputAudioTranscription
The transcription of the output aligns with the language code specified for the output audio.
[JsonPropertyName("outputAudioTranscription")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public AudioTranscriptionConfig? OutputAudioTranscription { get; set; }
Property Value
Proactivity
Configures the proactivity of the model. This allows the model to respond proactively to the input and to ignore irrelevant input.
[JsonPropertyName("proactivity")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ProactivityConfig? Proactivity { get; set; }
Property Value
RealtimeInputConfig
Configures the realtime input behavior in BidiGenerateContent.
[JsonPropertyName("realtimeInputConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public RealtimeInputConfig? RealtimeInputConfig { get; set; }
Property Value
ResponseModalities
The requested modalities of the response. Represents the set of modalities that the model can return. Defaults to AUDIO if not specified.
[JsonPropertyName("responseModalities")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<Modality>? ResponseModalities { get; set; }
Property Value
SafetySettings
Safety settings in the request to block unsafe content in the response.
[JsonPropertyName("safetySettings")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<SafetySetting>? SafetySettings { get; set; }
Property Value
Seed
When seed is fixed to a specific number, the model makes a best effort to provide the
same response for repeated requests. By default, a random number is used.
[JsonPropertyName("seed")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Seed { get; set; }
Property Value
- int?
SessionResumption
Configures session resumption mechanism. If included the server will send SessionResumptionUpdate messages.
[JsonPropertyName("sessionResumption")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public SessionResumptionConfig? SessionResumption { get; set; }
Property Value
SpeechConfig
The speech generation configuration.
[JsonPropertyName("speechConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public SpeechConfig? SpeechConfig { get; set; }
Property Value
SystemInstruction
The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.
[JsonPropertyName("systemInstruction")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Content? SystemInstruction { get; set; }
Property Value
Temperature
Value that controls the degree of randomness in token selection. Lower temperatures are good for prompts that require a less open-ended or creative response, while higher temperatures can lead to more diverse or creative results.
[JsonPropertyName("temperature")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? Temperature { get; set; }
Property Value
ThinkingConfig
Config for thinking features. An error will be returned if this field is set for models that don't support thinking.
[JsonPropertyName("thinkingConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ThinkingConfig? ThinkingConfig { get; set; }
Property Value
Tools
A list of Tools the model may use to generate the next response. A Tool is a piece of
code that enables the system to interact with external systems to perform an action, or set
of actions, outside of knowledge and scope of the model.
[JsonPropertyName("tools")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<Tool>? Tools { get; set; }
Property Value
TopK
For each token selection step, the top_k tokens with the highest probabilities are
sampled. Then tokens are further filtered based on top_p with the final token selected
using temperature sampling. Use a lower number for less random responses and a higher number
for more random responses.
[JsonPropertyName("topK")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? TopK { get; set; }
Property Value
TopP
Tokens are selected from the most to least probable until the sum of their probabilities equals this value. Use a lower value for less random responses and a higher value for more random responses.
[JsonPropertyName("topP")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? TopP { get; set; }
Property Value
TranslationConfig
Config for translation.
[JsonPropertyName("translationConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public TranslationConfig? TranslationConfig { get; set; }
Property Value
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a LiveConnectConfig object.
public static LiveConnectConfig? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- LiveConnectConfig
The deserialized LiveConnectConfig object, or null if deserialization fails.