LiveServerContent

@PublicPreviewAPI
class LiveServerContent : LiveServerMessage


Incremental server update generated by the model in response to client messages.

Content is generated as quickly as possible, and not in realtime. You may choose to buffer and play it out in realtime.

Summary

Public constructors

LiveServerContent(
    content: Content?,
    interrupted: Boolean,
    turnComplete: Boolean,
    generationComplete: Boolean
)

Public properties

Content?

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

Boolean

The model has finished generating data for the current turn.

Boolean

The model was interrupted by the client while generating data.

Boolean

The model has finished sending data in the current turn.

Public constructors

LiveServerContent

LiveServerContent(
    content: Content?,
    interrupted: Boolean,
    turnComplete: Boolean,
    generationComplete: Boolean
)

Public properties

content

val contentContent?

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

This can be null if there is no content.

generationComplete

val generationCompleteBoolean

The model has finished generating data for the current turn.

For realtime playback, there will be a delay between when the model finishes generating content and the client has finished playing back the generated content. generationComplete indicates that the model is done generating data, while turnComplete indicates the model is waiting for additional client messages. Sending a message during this delay may cause an interrupted message to be sent.

Note that if the model was interrupted, this will not be set. The model will go from interrupted ->turnComplete.

interrupted

val interruptedBoolean

The model was interrupted by the client while generating data.

An interruption occurs when the client sends a message while the model is actively sending data.

turnComplete

val turnCompleteBoolean

The model has finished sending data in the current turn.

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.