Table of Contents

Class LiveServerMessage

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

Response message for API call.

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

Properties

GoAway

Server will disconnect soon.

[JsonPropertyName("goAway")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public LiveServerGoAway? GoAway { get; set; }

Property Value

LiveServerGoAway

ServerContent

Content generated by the model in response to client messages.

[JsonPropertyName("serverContent")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public LiveServerContent? ServerContent { get; set; }

Property Value

LiveServerContent

SessionResumptionUpdate

Update of the session resumption state.

[JsonPropertyName("sessionResumptionUpdate")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public LiveServerSessionResumptionUpdate? SessionResumptionUpdate { get; set; }

Property Value

LiveServerSessionResumptionUpdate

SetupComplete

Sent in response to a LiveClientSetup message from the client.

[JsonPropertyName("setupComplete")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public LiveServerSetupComplete? SetupComplete { get; set; }

Property Value

LiveServerSetupComplete

ToolCall

Request for the client to execute the function_calls and return the responses with the matching ids.

[JsonPropertyName("toolCall")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public LiveServerToolCall? ToolCall { get; set; }

Property Value

LiveServerToolCall

ToolCallCancellation

Notification for the client that a previously issued ToolCallMessage with the specified ids should have been not executed and should be cancelled.

[JsonPropertyName("toolCallCancellation")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public LiveServerToolCallCancellation? ToolCallCancellation { get; set; }

Property Value

LiveServerToolCallCancellation

UsageMetadata

Usage metadata about model response(s).

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

Property Value

UsageMetadata

VoiceActivity

Voice activity signal.

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

Property Value

VoiceActivity

VoiceActivityDetectionSignal

Voice activity detection signal. Allowlisted only.

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

Property Value

VoiceActivityDetectionSignal

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a LiveServerMessage object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

LiveServerMessage

The deserialized LiveServerMessage object, or null if deserialization fails.