- [HTTP request](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#body.StreamAssistResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#body.aspect_1)
- [AnswerGenerationMode](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AnswerGenerationMode)
- [AssistSkippingMode](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AssistSkippingMode)
- [BrowserContext](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#BrowserContext)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#BrowserContext.SCHEMA_REPRESENTATION)
- [Tab](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#Tab)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#Tab.SCHEMA_REPRESENTATION)
- [EncryptionMetadata](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#EncryptionMetadata)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#EncryptionMetadata.SCHEMA_REPRESENTATION)
- [AgentsConfig](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AgentsConfig)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AgentsConfig.SCHEMA_REPRESENTATION)
- [NoCodeAgentsConfig](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#NoCodeAgentsConfig)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#NoCodeAgentsConfig.SCHEMA_REPRESENTATION)
- [AgentsSpec](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AgentsSpec)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AgentsSpec.SCHEMA_REPRESENTATION)
- [AgentSpec](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AgentSpec)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AgentSpec.SCHEMA_REPRESENTATION)
- [MentionMode](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#MentionMode)
- [ToolsSpec](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ToolsSpec)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ToolsSpec.SCHEMA_REPRESENTATION)
- [VertexAiSearchSpec](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#VertexAiSearchSpec)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#VertexAiSearchSpec.SCHEMA_REPRESENTATION)
- [WebGroundingSpec](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#WebGroundingSpec)
- [ImageGenerationSpec](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ImageGenerationSpec)
- [VideoGenerationSpec](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#VideoGenerationSpec)
- [MapsGroundingSpec](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#MapsGroundingSpec)
- [GenerationSpec](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#GenerationSpec)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#GenerationSpec.SCHEMA_REPRESENTATION)
- [ActionSpec](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ActionSpec)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ActionSpec.SCHEMA_REPRESENTATION)
- [SessionInfo](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#SessionInfo)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#SessionInfo.SCHEMA_REPRESENTATION)
- [StatusUpdate](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#StatusUpdate)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#StatusUpdate.SCHEMA_REPRESENTATION)
- [ToolResult](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ToolResult)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ToolResult.SCHEMA_REPRESENTATION)
- [InvokedSkill](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#InvokedSkill)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#InvokedSkill.SCHEMA_REPRESENTATION)
- [ConnectorAuthError](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ConnectorAuthError)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ConnectorAuthError.SCHEMA_REPRESENTATION)

Assists the user with a query in a streaming fashion.

### HTTP request

Choose an endpoint:
global us   
`POST https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/assistants/*}:streamAssist`

<br />

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The resource name of the `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants#Assistant`. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "query": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/Query`) }, "answerGenerationMode": enum (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AnswerGenerationMode`), "session": string, "isSessionLess": boolean, "assistSkippingMode": enum (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AssistSkippingMode`), "fileIds": [ string ], "browserContext": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#BrowserContext`) }, "userMetadata": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AssistUserMetadata`) }, "languageCode": string, "googleSearchGroundingEnabled": boolean, "webGroundingEnabled": boolean, "dataStoreSpecs": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/DataStoreSpec`) } ], "agentsConfig": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AgentsConfig`) }, "agentsSpec": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AgentsSpec`) }, "assistGenerationConfig": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AssistGenerationConfig`) }, "cannedQuery": string, "toolsSpec": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ToolsSpec`) }, "generationSpec": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#GenerationSpec`) }, "actionSpec": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ActionSpec`) } } ``` |

| Fields ||
|---|---|
| `query` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/Query`)`` Optional. Current user query. Empty query is only supported if `fileIds` are provided. In this case, the answer will be generated based on those context files. |
| `answerGenerationMode` | ``enum (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AnswerGenerationMode`)`` Optional. The answer generation mode. If not specified, it defaults to `NORMAL`. |
| `session` | `string` Optional. The session to use for the request. If specified, the assistant has access to the session history, and the query and the answer are stored there. If `-` is specified as the session ID, or it is left empty, then a new session is created with an automatically generated ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` |
| `isSessionLess` | `boolean` Optional. Specifies whether the request is session-less. If true, the request runs without any session: no session will be created, and the request will not be associated with any existing session, even if `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#body.request_body.FIELDS.session` is empty or set to "-". The response's `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#SessionInfo.FIELDS.session` will be empty. If true and `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#body.request_body.FIELDS.session` is also set to a non-empty value other than "-", the request is rejected with `INVALID_ARGUMENT`. |
| `assistSkippingMode` | ``enum (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AssistSkippingMode`)`` Optional. Determines the cases in which the assistant will not answer the query. If the answer is skipped, the reasons will be listed in `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.sessions.assistAnswers#AssistAnswer.FIELDS.assist_skipped_reasons` within `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/assist#body.AssistResponse.FIELDS.answer`. |
| `fileIds[]` | `string` Optional. The IDs of the files to be used for answering the request. When uploading a file, its ID is returned in `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.sessions/addContextFile#body.AddContextFileResponse.FIELDS.file_id`. |
| `browserContext` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#BrowserContext`)`` Optional. Context about the page the user is viewing, e.g. from the Gemini Enterprise Chrome side panel. |
| `userMetadata` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AssistUserMetadata`)`` Optional. Information about the user initiating the query. |
| `languageCode (deprecated)` | `string` Optional. Deprecated. Use `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AssistUserMetadata#FIELDS.preferred_language_code` instead. Language to be used for answering if language detection fails. Also used as the language of error messages created by actions, regardless of language detection results. |
| `googleSearchGroundingEnabled (deprecated)` | `boolean` Optional. Deprecated. Please refrain from using this field. |
| `webGroundingEnabled (deprecated)` | `boolean` Optional. Deprecated. Please refrain from using this field. |
| `dataStoreSpecs[] (deprecated)` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/DataStoreSpec`)`` Optional. Deprecated: Use `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#VertexAiSearchSpec.FIELDS.data_store_specs` instead. Specs defining `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores#DataStore`s to filter on in a search call and configurations for those data stores. This is only considered for `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines#Engine`s with multiple data stores. Not setting this field will result in using all data stores in the engine, except when `ignoreDataStores` is set to true. |
| `agentsConfig` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AgentsConfig`)`` Optional. Configuration of agents that are used to serve the request. |
| `agentsSpec` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AgentsSpec`)`` Optional. Specification of agents that are used to serve the request. |
| `assistGenerationConfig (deprecated)` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AssistGenerationConfig`)`` Optional. Deprecated. Use `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#body.request_body.FIELDS.generation_spec` instead. Request level generation configuration. This is used to override the default generation configuration at the engine level. |
| `cannedQuery` | `string` Optional. The resource name of the `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQuery` for this request. This parameter can only be set if the session is new, otherwise an `INVALID_ARGUMENT` error is returned. A session is considered new if there is a `StreamAssistRequest.session` provided and the corresponding `Session` does not have any turns in it, or if there is no `StreamAssistRequest.session` provided (and a new `Session` gets created). If the `cannedQuery` parameter is given, the corresponding `CannedQuery` will be taken into account during processing. The exact behaviour is described and documented in the `CannedQuery`. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}/cannedQueries/{cannedQuery}` |
| `toolsSpec` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ToolsSpec`)`` Optional. Specification of tools that are used to serve the request. |
| `generationSpec` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#GenerationSpec`)`` Optional. Specification of the generation configuration for the request. |
| `actionSpec` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ActionSpec`)`` Optional. Specification of actions for the request. |

### Response body

Response for the `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#google.cloud.discoveryengine.v1alpha.AssistantService.StreamAssist` method.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "answer": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.sessions.assistAnswers#AssistAnswer`) }, "sessionInfo": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#SessionInfo`) }, "statusUpdates": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#StatusUpdate`) } ], "assistToken": string, "toolResult": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ToolResult`) } ], "finalResultToolInvocationId": string, "invocationTools": [ string ], "invokedSkills": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#InvokedSkill`) } ], "connectorAuthErrors": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ConnectorAuthError`) } ] } ``` |

| Fields ||
|---|---|
| `answer` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.sessions.assistAnswers#AssistAnswer`)`` assistants.assist answer resource object containing parts of the assistant's final answer for the user's query. Not present if the current response doesn't add anything to previously sent `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.sessions.assistAnswers#AssistAnswer.FIELDS.replies`. Observe `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.sessions.assistAnswers#AssistAnswer.FIELDS.state` to see if more parts are to be expected. While the state is `IN_PROGRESS`, the `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.sessions.assistAnswers#AssistAnswer.FIELDS.replies` field in each response will contain replies (reply fragments) to be appended to the ones received in previous responses. `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.sessions.assistAnswers#AssistAnswer.FIELDS.name` won't be filled. If the state is `SUCCEEDED`, `FAILED` or `SKIPPED`, the response is the last response and `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.sessions.assistAnswers#AssistAnswer.FIELDS.name` will have a value. |
| `sessionInfo` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#SessionInfo`)`` Session information. Only included in the final StreamAssistResponse of the response stream. |
| `statusUpdates[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#StatusUpdate`)`` Optional progress updates. |
| `assistToken` | `string` A global unique ID that identifies the current pair of request and stream of responses. Used for feedback and support. |
| `toolResult[] (deprecated)` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ToolResult`)`` > [!WARNING] > This item is deprecated! Results of tool invocations. |
| `finalResultToolInvocationId` | `string` If this field is present, it contains the ID of the tool invocation whose result is used as the final answer. |
| `invocationTools[]` | `string` The tool names of the tools that were invoked. |
| `invokedSkills[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#InvokedSkill`)`` The skills executed during the turn. |
| `connectorAuthErrors[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ConnectorAuthError`)`` Per-connector authentication errors encountered during the request. Present when one or more connectors failed authentication but the request proceeded with the remaining connectors. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `https://www.googleapis.com/auth/discoveryengine.assist.readwrite`
- `https://www.googleapis.com/auth/discoveryengine.readwrite`
- `https://www.googleapis.com/auth/discoveryengine.serving.readwrite`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `discoveryengine.assistants.assist`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## AnswerGenerationMode

Available answer generation modes.

| Enums ||
|---|---|
| `ANSWER_GENERATION_MODE_UNSPECIFIED` | Unspecified answer generation mode. |
| `NORMAL` | Normal answer generation mode. May trigger a few searches and call actions. |
| `RESEARCH` | Research answer generation mode. Deep dives into the query, triggering many searches for a wide range of topics related to the query. |
| `AGENT` | Direct Agent answer generation mode. uses an agent defined in `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#body.request_body.FIELDS.agents_config` to generate the answer. |

## AssistSkippingMode

Available skipping behaviors for assist requests.

| Enums ||
|---|---|
| `ASSIST_SKIPPING_MODE_UNSPECIFIED` | Default value. The answer can be skipped if the query isn't seeking assistance. |
| `REQUEST_ASSIST` | Request Assistant answer. The answer may still be skipped if the query fails policy checks. |

## BrowserContext

Context about the page the user is viewing, e.g. from the Gemini Enterprise Chrome side panel. The files it references are encrypted by the client and are not attached to the request as model inputs; a consumer reads them using `encryptionMetadata`.

| JSON representation |
|---|
| ``` { "activeTab": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#Tab`) }, "encryptionMetadata": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#EncryptionMetadata`) } } ``` |

| Fields ||
|---|---|
| `activeTab` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#Tab`)`` Optional. The tab the user is currently viewing. Each file ID refers to a file uploaded to the session beforehand (its ID is returned in `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.sessions/addContextFile#body.AddContextFileResponse.FIELDS.file_id`). Do not also list those IDs in `fileIds`: that attaches them as ordinary files and bypasses browser-context handling. |
| `encryptionMetadata` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#EncryptionMetadata`)`` Optional. How the files referenced by this browser context are encrypted. One keyset covers the whole request rather than an individual tab. |

## Tab

A browser tab whose context is attached to the request.

| JSON representation |
|---|
| ``` { "uri": string, "title": string, "selectedText": string, "screenshotFileId": string, "annotatedPageContentFileId": string } ``` |

| Fields ||
|---|---|
| `uri` | `string` Optional. URI of the page the tab is showing. Not necessarily an http(s) URL: a tab can be showing `chrome://settings`, `about:blank` or a `file://` path. |
| `title` | `string` Optional. Title of the page the tab is showing. |
| `selectedText` | `string` Optional. Text the user has selected on the page, if any. |
| `screenshotFileId` | `string` Optional. ID of the uploaded screenshot of the visible page. |
| `annotatedPageContentFileId` | `string` Optional. ID of the uploaded page content: a serialized Annotated Page Content (APC) capture, not pre-rendered text. |

## EncryptionMetadata

How the browser-context files were encrypted by the client.

| JSON representation |
|---|
| ``` { "encrypted": boolean, "keyset": string } ``` |

| Fields ||
|---|---|
| `encrypted` | `boolean` Optional. Whether the browser-context files are encrypted. If `true`, `keyset` must be set, or the files cannot be read. |
| `keyset` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. Serialized Tink keyset using the AEAD primitive, used to decrypt the browser-context files. Present only for the lifetime of the request and never logged. A base64-encoded string. |

## AgentsConfig

Configuration of agents that are used to serve the request.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "noCodeAgentsConfig": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#NoCodeAgentsConfig`) }, "assistantAgentConfigId": string, "agent": string, "inlineAgent": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents#Agent`) }, "vertexAiAgentId": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| Configuration of the different types of agents. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `noCodeAgentsConfig (deprecated)` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#NoCodeAgentsConfig`)`` > [!WARNING] > This item is deprecated! Optional. Deprecated: Configuration for No-code Agentspace agents. When set, the assistants.assist request will be served according to the configuration. Use `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AgentsConfig.FIELDS.agent` instead. |
| `assistantAgentConfigId` | `string` Optional. ID of the agent from `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants#Assistant.FIELDS.agent_configs` |
| `agent` | `string` The name of the agent to use. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}/agents/{agent}` |
| `inlineAgent` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents#Agent`)`` The inline definition of the `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents#Agent` to use. If provided, an agent based on this definition will be used. This is a temporary representation of an agent, the `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents#Agent.FIELDS.name` field will be ignored. |
| `vertexAiAgentId` | `string` Optional. ID of the agent from `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants#Assistant.FIELDS.vertex_ai_agent_configs` The ID can be either the full name registered in the config or the last part after the last slash. |
| End of mutually exclusive fields. ||

## NoCodeAgentsConfig

Deprecated: Configuration for No-code Agentspace agents. Use `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#NoCodeAgentsConfig.FIELDS.agent` instead.

| JSON representation |
|---|
| ``` { "agent": string } ``` |

| Fields ||
|---|---|
| `agent` | `string` Optional. The name of the agent to use. |

## AgentsSpec

Specification of agents that are used to serve the request.

| JSON representation |
|---|
| ``` { "agentSpecs": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AgentSpec`) } ], "mentionMode": enum (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#MentionMode`) } ``` |

| Fields ||
|---|---|
| `agentSpecs[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#AgentSpec`)`` Optional. Specification of agents that are used to serve the request. |
| `mentionMode` | ``enum (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#MentionMode`)`` Optional. How to invoke the mentioned agents in `agentSpecs`. See `MentionMode`. |

## AgentSpec

Specification of an agent.

| JSON representation |
|---|
| ``` { "agentId": string, "inputVariables": { object } } ``` |

| Fields ||
|---|---|
| `agentId` | `string` Required. ID to identify the agent resource serving the request. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) with a length limit of 63 characters. |
| `inputVariables` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Optional. Input variables supplied at invocation time for a WorkflowAgent. The keys are the declared input variable names; the values are the user- or caller-supplied values. Exposed to downstream nodes as global inputs. |

## MentionMode

How to invoke the mentioned agents in `agentSpecs`.

| Enums ||
|---|---|
| `MENTION_MODE_UNSPECIFIED` | Defaults to `DIRECT`. |
| `DIRECT` | Mentioned agent becomes the top-level agent that runs the turn. Only one entry in `agentSpecs` is allowed. |
| `TOOL` | Each `AgentSpec` is attached as a tool under a synthesized orchestrator. Multi-mention. MVP: workflow agents only, latest published revision; do not set `version` / `revisionId`. |
| `TOOL_WORKFLOW_DIRECT` | Single workflow agent as its own chat surface. Exactly one `AgentSpec`; set either `version = "draft"` (Agent table) or `revisionId` (specific `AgentRevision`). Workflow must have a `ManualTrigger`. |

## ToolsSpec

Specification of tools that are used to serve the request.

| JSON representation |
|---|
| ``` { "toolRegistry": string, "vertexAiSearchSpec": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#VertexAiSearchSpec`) }, "webGroundingSpec": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#WebGroundingSpec`) }, "imageGenerationSpec": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ImageGenerationSpec`) }, "videoGenerationSpec": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#VideoGenerationSpec`) }, "mapsGroundingSpec": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#MapsGroundingSpec`) } } ``` |

| Fields ||
|---|---|
| `toolRegistry` | `string` Optional. The name of the tool registry to use. Format: `projects/{project}/locations/{location}/toolRegistries/{toolRegistry}` |
| `vertexAiSearchSpec` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#VertexAiSearchSpec`)`` Optional. Specification of the Vertex AI Search tool. |
| `webGroundingSpec` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#WebGroundingSpec`)`` Optional. Specification of the web grounding tool. If field is present, enables grounding with web search. Works only if `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants#Assistant.FIELDS.web_grounding_type` is `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants#WebGroundingType.ENUM_VALUES.WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants#WebGroundingType.ENUM_VALUES.WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`. |
| `imageGenerationSpec` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#ImageGenerationSpec`)`` Optional. Specification of the image generation tool. |
| `videoGenerationSpec` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#VideoGenerationSpec`)`` Optional. Specification of the video generation tool. |
| `mapsGroundingSpec` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants/streamAssist#MapsGroundingSpec`)`` Optional. Specification of the Google Maps grounding tool. If field is present, enables grounding with Google Maps. |

## VertexAiSearchSpec

Specification of the Vertex AI Search tool.

| JSON representation |
|---|
| ``` { "disabled": boolean, "dataStoreSpecs": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/DataStoreSpec`) } ], "filter": string } ``` |

| Fields ||
|---|---|
| `disabled (deprecated)` | `boolean` > [!WARNING] > This item is deprecated! Optional. Deprecated. Please refrain from using this field. Whether the Vertex AI Search tool is disabled. Default value is false, the tool is enabled by default. |
| `dataStoreSpecs[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/DataStoreSpec`)`` Optional. Specs defining `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores#DataStore`s to filter on in a search call and configurations for those data stores. This is only considered for `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines#Engine`s with multiple data stores. |
| `filter` | `string` Optional. The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by mapping the LHS filter key to a key property defined in the Vertex AI Search backend -- this mapping is defined by the customer in their schema. For example a media customer might have a field 'name' in their schema. In this case the filter would look like this: filter --\> name:'ANY("king kong")' For more information about filtering including syntax and filter operators, see [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) |

## WebGroundingSpec

This type has no fields.
Specification of the web grounding tool.

## ImageGenerationSpec

This type has no fields.
Specification of the image generation tool.

## VideoGenerationSpec

This type has no fields.
Specification of the video generation tool.

## MapsGroundingSpec

This type has no fields.
Specification of the Google Maps grounding tool.

## GenerationSpec

Assistant generation specification for the request. This allows to override the default generation configuration at the engine level.

| JSON representation |
|---|
| ``` { "modelId": string } ``` |

| Fields ||
|---|---|
| `modelId` | `string` Optional. The Vertex AI modelId used for the generative model. If not set, the default Assistant model will be used. |

## ActionSpec

Specification of actions for the request.

| JSON representation |
|---|
| ``` { "actionDisabled": boolean } ``` |

| Fields ||
|---|---|
| `actionDisabled` | `boolean` Optional. If true, actions will not be served for the request. This only works for enterprise edition. |

## SessionInfo

Information about the session.

| JSON representation |
|---|
| ``` { "session": string, "queryId": string } ``` |

| Fields ||
|---|---|
| `session` | `string` Name of the newly generated or continued session. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}`. |
| `queryId` | `string` Query ID that corresponds to this assist API call. One session can have multiple turns, each with a unique query ID. By specifying the session name and this query ID in the assistants.assist API call, the assist request happens in the context of the search results from this search call. |

## StatusUpdate

Update about how the assist call is progressing.

| JSON representation |
|---|
| ``` { "updateText": string, "invocationId": string } ``` |

| Fields ||
|---|---|
| `updateText` | `string` Free text status status update, e.g., 'Starting internal search in HR docs for benefits', or 'Web search for "Moon landing" got 12 results'. |
| `invocationId` | `string` Unique identifier of the invocation that generates the update. |

## ToolResult

(Partial) result of a tool invocation.

| JSON representation |
|---|
| ``` { "toolInvocationId": string, "result": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.sessions.assistAnswers#AssistAnswer.Reply`) } } ``` |

| Fields ||
|---|---|
| `toolInvocationId` | `string` Unique identifier of the tool invocation that generates the result. |
| `result` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.sessions.assistAnswers#AssistAnswer.Reply`)`` Partial content of the result. |

## InvokedSkill

Represents a skill used during the assist call.

| JSON representation |
|---|
| ``` { "name": string, "displayName": string } ``` |

| Fields ||
|---|---|
| `name` | `string` The resource name of the skill. |
| `displayName` | `string` The display name of the skill. |

## ConnectorAuthError

Describes an authentication error for a specific data connector.

| JSON representation |
|---|
| ``` { "dataConnector": string, "errorMessage": string } ``` |

| Fields ||
|---|---|
| `dataConnector` | `string` Resource name of the data connector that failed authentication. |
| `errorMessage` | `string` Human-readable error message describing the auth failure. |