REST Resource: projects.locations.apps.assistantSessions

Resource: AssistantSession

An assistant session represents a conversation between a user and the assistant agent.

JSON representation
{
  "name": string,
  "requestor": string,
  "messages": [
    {
      object (AssistantMessage)
    }
  ],
  "state": enum (AssistantSessionState),
  "createTime": string,
  "updateTime": string,
  "userResponseSuggestions": {
    object (UserResponseSuggestions)
  },
  "displayName": string,
  "artifacts": [
    {
      object (AssistantSessionArtifact)
    }
  ],
  "sessionCheckpoint": {
    object (SessionCheckpoint)
  },
  "activeTurn": {
    object (ActiveTurnInfo)
  },
  "touchedApps": [
    string
  ]
}
Fields
name

string

Required. Identifier. The unique identifier of the session. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{session}

requestor

string

Output only. The user who initiated the session.

messages[]

object (AssistantMessage)

Optional. History of messages in the session.

state

enum (AssistantSessionState)

Output only. The status of the assistant session.

createTime

string (Timestamp format)

Output only. The time the assistant session was created.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

updateTime

string (Timestamp format)

Output only. The time the assistant session was last updated.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

userResponseSuggestions

object (UserResponseSuggestions)

Output only. Suggested user responses from the assistant agent.

displayName

string

Optional. The display name of the assistant session.

artifacts[]

object (AssistantSessionArtifact)

Output only. Document artifacts (e.g. generated TDDs in markdown) produced by the assistant in this session. Pointers only; the file content lives in the customer's Cloud Storage bucket.

sessionCheckpoint

object (SessionCheckpoint)

Output only. Session checkpoint containing user intent and rolling history summary.

activeTurn

object (ActiveTurnInfo)

Output only. Attachment info for this session's currently running turn. Unset when no turn is running.

touchedApps[]

string

Output only. Apps this session has targeted or changed (project-scoped sessions only), for history tags. Format: projects/{project}/locations/{location}/apps/{app}

AssistantMessage

A message in an assistant session.

JSON representation
{
  "role": string,
  "chunks": [
    {
      object (AssistantChunk)
    }
  ],
  "eventTime": string,
  "attachedGcsUris": [
    string
  ]
}
Fields
role

string

Required. Role within the conversation "user" or "model".

chunks[]

object (AssistantChunk)

Optional. Content of the message as chunks.

eventTime

string (Timestamp format)

Required. Timestamp when the message was sent or received.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

attachedGcsUris[]

string

Optional. Cloud Storage URIs for files uploaded by the user during this turn. This allows attachments to be persisted and rendered in the session history UI. Example: "gs://cxas-transient-uploads/uuid/prd.pdf"

AssistantChunk

A chunk of data in an assistant message.

JSON representation
{
  "createTime": string,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "text": string,
  "thought": string,
  "payload": {
    object
  },
  "typedPayload": {
    object (TypedPayload)
  }
  // End of mutually exclusive fields.
}
Fields
createTime

string (Timestamp format)

Optional. Timestamp when the chunk was created or emitted.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

Data in 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 data.

thought

string

Optional. Thought generated by the model.

payload

object (Struct format)

Optional. Payload which contains structured responses like the quality report, agent version name, suggested responses etc.

typedPayload

object (TypedPayload)

Optional. Typed payload which contains structured responses.

End of mutually exclusive fields.

TypedPayload

Payload with a type. Used by the assistant history (AssistantChunk) and by the streaming typedPayload event; lives here because both assistant_service.proto and session_service.proto need it.

JSON representation
{
  "displayName": string,
  "type": string,
  "value": {
    object
  },
  "metadata": {
    object
  }
}
Fields
displayName

string

Required. The display name of the payload.

type

string

Required. The type of the payload.

value

object (Struct format)

Required. The value of the payload.

metadata

object (Struct format)

Optional. The metadata of the payload.

AssistantSessionState

The status of the assistant session.

Enums
ASSISTANT_SESSION_STATE_UNSPECIFIED The default value. This value is used if the status is not specified.
PROCESSING The assistant agent is processing the request as a long running task.
IDLE The assistant agent is idle and does not have any pending requests or response.
PENDING_REVIEW The assistant agent is done processing a long running task and has a response ready for the user.

UserResponseSuggestions

Suggested user responses from the assistant agent.

JSON representation
{
  "suggestions": [
    string
  ]
}
Fields
suggestions[]

string

Required. The assistant suggested user responses. These are suggestions for the user on how to interact with the assistant.

AssistantSessionArtifact

A document artifact generated by the assistant within a session, stored as a file in the customer's Cloud Storage bucket.

JSON representation
{
  "id": string,
  "displayName": string,
  "gcsUri": string,
  "mimeType": string,
  "createTime": string,
  "turnIndex": integer
}
Fields
id

string

Output only. The unique identifier of the artifact within the session.

displayName

string

Output only. The file name shown to the user, e.g. "hotel_booking_tdd.md".

gcsUri

string

Output only. The Cloud Storage object holding the artifact content. Example: "gs://{project}-agent-assist-artifacts/agent-assist-generated/1_tdd.md"

mimeType

string

Output only. The IANA media type of the artifact content, e.g. "text/markdown".

createTime

string (Timestamp format)

Output only. When the artifact was persisted.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

turnIndex

integer

Output only. Index of the message in [AssistantSession.messages] whose turn produced the artifact, for placing the artifact chip when history is restored.

SessionCheckpoint

Session checkpoint containing inferred user intent for session title and UI.

JSON representation
{
  "userIntent": string
}
Fields
userIntent

string

Inferred user goal or topic for the session (e.g. "Building E-Commerce Support Agent").

ActiveTurnInfo

Live-attachment info for a session turn that is currently running, disconnected from its client, or parked for pickup by another server task.

JSON representation
{
  "turnId": string,
  "status": enum (ActiveTurnInfo.Status),
  "startTime": string,
  "lastProgressTime": string,
  "orphanDeadlineTime": string
}
Fields
turnId

string

Identifies the turn; echoed by resume snapshots on the streaming API.

status

enum (ActiveTurnInfo.Status)

Current attachment status.

startTime

string (Timestamp format)

Output only. When the turn started.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

lastProgressTime

string (Timestamp format)

Output only. When the turn last persisted progress.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

orphanDeadlineTime

string (Timestamp format)

Output only. When the turn will be wound down if no client attaches.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

ActiveTurnInfo.Status

How the running turn currently relates to clients and server tasks.

Enums
STATUS_UNSPECIFIED Unspecified.
RUNNING The turn is executing with at least one client attached.
DISCONNECTED The turn is executing with no client attached.
RESUMING The turn is parked for pickup: the next attach continues it.
ABANDONED The turn's server lease has lapsed and no task is driving it; the next read seals it to a committed partial. Not attachable.

Methods

cancelAssistantTurn

Cancels the assistant session's in-flight turn, if any: the explicit user stop for a turn running detached from any stream.

create

Creates a new assistant session in the given app.

delete

Deletes the specified assistant session.

get

Gets details of the specified assistant session.

list

Lists all assistant sessions in the given app.

streamChatAiAssistant

Runs Arc, the AI assistant, for the specified assistant session in a streaming fashion.