REST Resource: spaces.streamMessages

Resource: StreamMessage

A streaming message in a Google Chat space. Stream messages let Chat apps display incremental progress updates, steps, citations, and text chunks before committing a finalized message.

JSON representation
{
  "name": string,
  "progressText": string,
  "streamContentChunks": [
    {
      object (StreamContentChunk)
    }
  ],
  "markupSyntax": enum (MarkupSyntax),
  "nextChunkToken": string,

  "referencedMessage": string
}
Fields
name

string

Identifier. Resource name of the stream message. Format: spaces/{space}/streamMessages/{streamMessage}

progressText

string

Required. Plain-text progress status displayed for the active stream message. Maximum length is 250 characters. Must be non-empty when creating a stream message or when included in updateMask during an update.

streamContentChunks[]

object (StreamContentChunk)

Optional. Input only. A list of chunks that define the content of the stream message.

markupSyntax

enum (MarkupSyntax)

Optional. Specifies how the server interprets the stream content chunks.

nextChunkToken

string

Optional. Token returned by the server for sequencing subsequent stream requests. Pass this token as chunkToken when appending or committing content, or populate nextChunkToken when updating the stream message.

Required. The reference that the stream message is anchored to. One of the following is required: The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
referencedMessage

string

Resource name of the message that the stream message is referencing, such as the user message that invoked the Chat app. Must belong to the same space and be accessible to the Chat app. The space must have threading enabled.

Format: spaces/{space}/messages/{message}

End of mutually exclusive fields.

StreamContentChunk

A chunk of content within a stream message.

JSON representation
{

  "text": string,
  "step": {
    object (Step)
  },
  "card": {
    object (CardWithId)
  },
  "accessoryWidget": {
    object (AccessoryWidget)
  },
  "citation": {
    object (Citation)
  },
  "citedSource": {
    object (CitedSource)
  }
}
Fields
The content of the chunk. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
text

string

Optional. Text content of the stream message. Concatenated across append requests and replaced when streamContentChunks is included in an update request. Supports Markdown formatting when markupSyntax is set to MARKUP_SYNTAX_MARKDOWN.

step

object (Step)

Optional. A step that the Chat app performed while generating the response, such as a reasoning step or tool call.

card

object (CardWithId)

Optional. A card. Only supported when committing a stream message.

To learn how to create a message that contains cards, see Send a message.

Design and preview cards with the Card Builder.

Open the Card Builder

accessoryWidget

object (AccessoryWidget)

Optional. An interactive widget that appears at the bottom of a message. Only supported when committing a stream message.

For details, see Add interactive widgets at the bottom of a message.

citation

object (Citation)

Optional. An inline citation referenced within the message text (via <chat-citation> tags) that renders as an interactive hover card. Only supported when the stream message's markupSyntax is set to MARKUP_SYNTAX_MARKDOWN. If a citation with a duplicate id is provided, it overwrites the existing citation with the same id.

citedSource

object (CitedSource)

Optional. A source to be displayed under the message as a footer link. Only supported when committing a stream message.

End of mutually exclusive fields.

Methods

appendStreamMessageContent

Appends content chunks to an existing stream message in a Google Chat space.

commit

Commits an active stream message into a finalized message in a Google Chat space.

create

Initiates a new stream message in a Google Chat space.

delete

Deletes an active stream message in a Google Chat space.

patch

Updates fields in an active stream message in a Google Chat space.