projects

POST /v1/projects/{projectsId}/locations/{locationsId}/apps/{appsId}/assistantSessions/{assistantSessionsId}:streamChatAiAssistant

Changed on

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

Request

  • Base URL
    https://ces.googleapis.com
  • Auth
    • OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/ces
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/ces
    • or OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/cloud-platform
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/cloud-platform

Path parameters

projectsId, string required
locationsId, string required
appsId, string required
assistantSessionsId, string required

Query parameters

$.xgafv, '1' | '2'

V1 error format.

access_token, string

OAuth access token.

alt, 'json' | 'media' | 'proto'

Data format for response.

callback, string

JSONP

fields, string

Selector specifying which fields to include in a partial response.

key, string

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_token, string

OAuth 2.0 token for the current user.

prettyPrint, boolean

Returns response with indentations and line breaks.

quotaUser, string

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

uploadType, string

Legacy upload protocol for media (e.g. "media", "multipart").

upload_protocol, string

Upload protocol for media (e.g. "raw", "multipart").

Request body

StreamChatAiAssistantRequest required

Request message for SessionService.StreamChatAiAssistant.

attachOnly, boolean

Optional. Optional flag to attach to an existing in-flight turn without submitting a new message.

attachedGcsUris, string[]

Optional. Cloud Storage URIs for files uploaded by the user during this turn. Example: "gs://cxas-transient-uploads/uuid/prd.pdf"

clientCapabilities, string[]

Optional. Response features this client can render. The server only emits events that need a capability (e.g. confirmation_request) when the capability is declared, so older clients never receive events they would silently drop.

confirmationResponse, AssistantConfirmationResponse

The user's answer to an AssistantConfirmationRequest, sent on the next SessionService.StreamChatAiAssistant call to resume the paused agent.

contextToken, string

Optional. Opaque onboarding context token returned by SessionService.GenerateOnboardingSuggestions. When set and still fresh, the server reuses the onboarding snapshot computed for the zero state instead of recomputing it for the first conversation turn.

message, string

Optional. The message to send to the assistant agent. May be empty when confirmation_response is set (answering a pending confirmation without adding a new message); at least one of the two must be provided.

operationCompletedEvent, OperationCompletedEvent

Event sent by the client or background worker to resume an assistant session after an asynchronous Long-Running Operation (LRO) completes.

resumeFromSequenceNumber, string int64

Optional. Optional cursor to resume and replay events from an in-flight or completed turn.

Response

Successful response

StreamChatAiAssistantResponse required

Response message for SessionService.StreamChatAiAssistant.

artifactChunk, ArtifactChunk

A streamed fragment of a document artifact (e.g. a markdown TDD) that the assistant is generating. Content deltas stream while the document is being written so clients can render a live preview; the FINALIZED chunk carries the Cloud Storage URI once the file has been persisted.

confirmationRequest, AssistantConfirmationRequest

A blocking question or confirmation the assistant needs answered before an agent action can proceed. The requesting agent is paused and resumes only when the answer arrives on a later StreamChatAiAssistantRequest.confirmation_response.

eventId, string

Unique identifier for the event.

eventTime, string google-datetime

Timestamp when the event occurred.

handoff, TurnHandoffEvent

Emitted before this task stops serving the stream mid-turn (e.g. a server restart). The turn's state is persisted; a reconnect carrying resume_from_sequence_number continues it on another task.

optionQuestionsChunk, OptionQuestionsChunk

Structured clarification options the assistant asks the user to choose among, transduced server-side out of the model's turn (the option block is stripped from the streamed and persisted text). The console renders a keyboard-navigable option list docked above the composer.

resumeSnapshot, TurnResumeSnapshot

A compacted replay of an in-flight turn: everything needed to render the turn's visible output so far, plus the position live events continue from.

sequenceNumber, string int64

Optional. Monotonically increasing sequence number for this session turn.

sessionCheckpoint, SessionCheckpoint

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

status, Status

The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide.

textChunk, string

Text Token (for streaming Gemini responses word-by-word).

thoughtChunk, string

Thought text chunk (agent's reasoning before generating response).

toolCall, ToolCall

Request for the client or the agent to execute the specified tool.

toolResponse, ToolResponse

The execution result of a specific tool from the client or the agent.

turnCompleted, TurnCompletedEvent

Terminal event of a turn (see StreamChatAiAssistantResponse.turn_completed).

turnInProgress, boolean

Optional. Indicates whether the turn is still actively running in the background.

turnMetadata, TurnMetadata

Turn-level metadata and intent categorization.

uiEvent, UiEvent

Represents a UI event payload.

Changes

    • info

      the security scope https://www.googleapis.com/auth/ces was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/ces was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was removed from the endpoint's security scheme Oauth2

    1 more change in this revision