# Google Cloud Discovery Engine V1 Client - Class StreamAssistResponse (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 StreamAssistResponse.

Response 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.StreamAssistResponse`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ answer` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistAnswer` 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 [AssistAnswer.replies](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistAnswer#_Google_Cloud_DiscoveryEngine_V1_AssistAnswer__getReplies__). Observe [AssistAnswer.state](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistAnswer#_Google_Cloud_DiscoveryEngine_V1_AssistAnswer__getState__) to see if more parts are to be expected. While the state is `IN_PROGRESS`, the [AssistAnswer.replies](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistAnswer#_Google_Cloud_DiscoveryEngine_V1_AssistAnswer__getReplies__) field in each response will contain replies (reply fragments) to be appended to the ones received in previous responses. AssistAnswer.name won't be filled. If the state is `SUCCEEDED`, `FAILED` or `SKIPPED`, the response is the last response and AssistAnswer.name will have a value. |
| `↳ session_info` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.StreamAssistResponse.SessionInfo` Session information. |
| `↳ assist_token` | `string` A global unique ID that identifies the current pair of request and stream of responses. Used for feedback and support. |

### getAnswer

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
[AssistAnswer.replies](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistAnswer#_Google_Cloud_DiscoveryEngine_V1_AssistAnswer__getReplies__).
Observe
[AssistAnswer.state](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistAnswer#_Google_Cloud_DiscoveryEngine_V1_AssistAnswer__getState__) to
see if more parts are to be expected. While the state is `IN_PROGRESS`, the
[AssistAnswer.replies](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistAnswer#_Google_Cloud_DiscoveryEngine_V1_AssistAnswer__getReplies__)
field in each response will contain replies (reply fragments) to be
appended to the ones received in previous responses. AssistAnswer.name
won't be filled.
If the state is `SUCCEEDED`, `FAILED` or `SKIPPED`, the response
is the last response and AssistAnswer.name will have a value.

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

### hasAnswer

### clearAnswer

### setAnswer

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
[AssistAnswer.replies](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistAnswer#_Google_Cloud_DiscoveryEngine_V1_AssistAnswer__getReplies__).
Observe
[AssistAnswer.state](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistAnswer#_Google_Cloud_DiscoveryEngine_V1_AssistAnswer__getState__) to
see if more parts are to be expected. While the state is `IN_PROGRESS`, the
[AssistAnswer.replies](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistAnswer#_Google_Cloud_DiscoveryEngine_V1_AssistAnswer__getReplies__)
field in each response will contain replies (reply fragments) to be
appended to the ones received in previous responses. AssistAnswer.name
won't be filled.
If the state is `SUCCEEDED`, `FAILED` or `SKIPPED`, the response
is the last response and AssistAnswer.name will have a value.

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

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

### getSessionInfo

Session information.

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

### hasSessionInfo

### clearSessionInfo

### setSessionInfo

Session information.

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

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

### getAssistToken

A global unique ID that identifies the current pair of request and stream
of responses. Used for feedback and support.

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

### setAssistToken

A global unique ID that identifies the current pair of request and stream
of responses. Used for feedback and support.

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

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