# Google Cloud Discovery Engine V1 Client - Class StreamAssistRequest (1.11.1)

1.11.1 (latest) 1.11.0 1.10.1 1.9.1 1.8.0 1.7.0 1.6.1 1.5.1 1.4.0 1.3.3 1.2.0 1.1.0 1.0.0 0.11.3 0.8.0 0.7.1 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.1 Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class StreamAssistRequest.

Request for the
[AssistantService.StreamAssist](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Client.AssistantServiceClient#_Google_Cloud_DiscoveryEngine_V1_Client_AssistantServiceClient__streamAssist__)
method.

Generated from protobuf message `google.cloud.discoveryengine.v1.StreamAssistRequest`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Required. The resource name of the [Assistant](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Assistant). Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` |
| `↳ query` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Query` Optional. Current user query. Empty query is only supported if `file_ids` are provided. In this case, the answer will be generated based on those context files. |
| `↳ 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}` |
| `↳ user_metadata` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistUserMetadata` Optional. Information about the user initiating the query. |
| `↳ tools_spec` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.StreamAssistRequest.ToolsSpec` Optional. Specification of tools that are used to serve the request. |
| `↳ generation_spec` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.StreamAssistRequest.GenerationSpec` Optional. Specification of the generation configuration for the request. |

### getName

Required. The resource name of the
[Assistant](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Assistant). Format:
`projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Required. The resource name of the
[Assistant](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Assistant). Format:
`projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getQuery

Optional. Current user query.

Empty query is only supported if `file_ids` are provided. In this case, the
answer will be generated based on those context files.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Query|null` |   |

### hasQuery

### clearQuery

### setQuery

Optional. Current user query.

Empty query is only supported if `file_ids` are provided. In this case, the
answer will be generated based on those context files.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Query` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSession

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}`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setSession

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}`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUserMetadata

Optional. Information about the user initiating the query.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistUserMetadata|null` |   |

### hasUserMetadata

### clearUserMetadata

### setUserMetadata

Optional. Information about the user initiating the query.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistUserMetadata` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getToolsSpec

Optional. Specification of tools that are used to serve the request.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.StreamAssistRequest.ToolsSpec|null` |   |

### hasToolsSpec

### clearToolsSpec

### setToolsSpec

Optional. Specification of tools that are used to serve the request.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.StreamAssistRequest.ToolsSpec` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getGenerationSpec

Optional. Specification of the generation configuration for the request.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.StreamAssistRequest.GenerationSpec|null` |   |

### hasGenerationSpec

### clearGenerationSpec

### setGenerationSpec

Optional. Specification of the generation configuration for the request.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.StreamAssistRequest.GenerationSpec` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |