Table of Contents

Class LiveServerContent

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

Incremental server update generated by the model in response to client messages. Content is generated as quickly as possible, and not in real time. Clients may choose to buffer and play it out in real time.

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

Properties

GenerationComplete

If true, indicates that the model is done generating. When model is interrupted while generating there will be no generation_complete message in interrupted turn, it will go through interrupted greater than turn_complete. When model assumes realtime playback there will be delay between generation_complete and turn_complete that is caused by model waiting for playback to finish. If true, indicates that the model has finished generating all content. This is a signal to the client that it can stop sending messages.

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

Property Value

bool?

GroundingMetadata

Metadata returned to client when grounding is enabled.

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

Property Value

GroundingMetadata

InputTranscription

Input transcription. The transcription is independent to the model turn which means it doesn’t imply any ordering between transcription and model turn.

[JsonPropertyName("inputTranscription")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Transcription? InputTranscription { get; set; }

Property Value

Transcription

InterimInputTranscription

Low latency transcription updated while the user is speaking.

[JsonPropertyName("interimInputTranscription")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Transcription? InterimInputTranscription { get; set; }

Property Value

Transcription

Interrupted

If true, indicates that a client message has interrupted current model generation. If the client is playing out the content in realtime, this is a good signal to stop and empty the current queue.

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

Property Value

bool?

ModelTurn

The content that the model has generated as part of the current conversation with the user.

[JsonPropertyName("modelTurn")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Content? ModelTurn { get; set; }

Property Value

Content

OutputTranscription

Output transcription. The transcription is independent to the model turn which means it doesn’t imply any ordering between transcription and model turn.

[JsonPropertyName("outputTranscription")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Transcription? OutputTranscription { get; set; }

Property Value

Transcription

TurnComplete

If true, indicates that the model is done generating. Generation will only start in response to additional client messages. Can be set alongside content, indicating that the content is the last in the turn.

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

Property Value

bool?

TurnCompleteReason

Reason for the turn is complete.

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

Property Value

TurnCompleteReason?

UrlContextMetadata

Metadata related to url context retrieval tool.

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

Property Value

UrlContextMetadata

WaitingForInput

If true, indicates that the model is not generating content because it is waiting for more input from the user, e.g. because it expects the user to continue talking.

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

Property Value

bool?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a LiveServerContent object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

LiveServerContent

The deserialized LiveServerContent object, or null if deserialization fails.