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

Represents a turn, including a query from the user and a
answer from service.

Generated from protobuf message `google.cloud.discoveryengine.v1.Session.Turn`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1 \\ Session

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ query` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Query` Optional. The user query. May not be set if this turn is merely regenerating an answer to a different turn |
| `↳ answer` | `string` Optional. The resource name of the answer to the user query. Only set if the answer generation (/answer API call) happened in this turn. |
| `↳ detailed_answer` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Answer` Output only. In [ConversationalSearchService.GetSession](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Client.ConversationalSearchServiceClient#_Google_Cloud_DiscoveryEngine_V1_Client_ConversationalSearchServiceClient__getSession__) API, if [GetSessionRequest.include_answer_details](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GetSessionRequest#_Google_Cloud_DiscoveryEngine_V1_GetSessionRequest__getIncludeAnswerDetails__) is set to true, this field will be populated when getting answer query session. |
| `↳ detailed_assist_answer` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.AssistAnswer` Output only. In [ConversationalSearchService.GetSession](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Client.ConversationalSearchServiceClient#_Google_Cloud_DiscoveryEngine_V1_Client_ConversationalSearchServiceClient__getSession__) API, if [GetSessionRequest.include_answer_details](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GetSessionRequest#_Google_Cloud_DiscoveryEngine_V1_GetSessionRequest__getIncludeAnswerDetails__) is set to true, this field will be populated when getting assistant session. |
| `↳ query_config` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. Represents metadata related to the query config, for example LLM model and version used, model parameters (temperature, grounding parameters, etc.). The prefix "google." is reserved for Google-developed functionality. |

### getQuery

Optional. The user query. May not be set if this turn is merely
regenerating an answer to a different turn

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

### hasQuery

### clearQuery

### setQuery

Optional. The user query. May not be set if this turn is merely
regenerating an answer to a different turn

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

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

### getAnswer

Optional. The resource name of the answer to the user query.

Only set if the answer generation (/answer API call) happened in this
turn.

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

### setAnswer

Optional. The resource name of the answer to the user query.

Only set if the answer generation (/answer API call) happened in this
turn.

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

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

### getDetailedAnswer

Output only. In
[ConversationalSearchService.GetSession](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Client.ConversationalSearchServiceClient#_Google_Cloud_DiscoveryEngine_V1_Client_ConversationalSearchServiceClient__getSession__)
API, if
[GetSessionRequest.include_answer_details](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GetSessionRequest#_Google_Cloud_DiscoveryEngine_V1_GetSessionRequest__getIncludeAnswerDetails__)
is set to true, this field will be populated when getting answer query
session.

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

### hasDetailedAnswer

### clearDetailedAnswer

### setDetailedAnswer

Output only. In
[ConversationalSearchService.GetSession](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Client.ConversationalSearchServiceClient#_Google_Cloud_DiscoveryEngine_V1_Client_ConversationalSearchServiceClient__getSession__)
API, if
[GetSessionRequest.include_answer_details](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GetSessionRequest#_Google_Cloud_DiscoveryEngine_V1_GetSessionRequest__getIncludeAnswerDetails__)
is set to true, this field will be populated when getting answer query
session.

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

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

### getDetailedAssistAnswer

Output only. In
[ConversationalSearchService.GetSession](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Client.ConversationalSearchServiceClient#_Google_Cloud_DiscoveryEngine_V1_Client_ConversationalSearchServiceClient__getSession__)
API, if
[GetSessionRequest.include_answer_details](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GetSessionRequest#_Google_Cloud_DiscoveryEngine_V1_GetSessionRequest__getIncludeAnswerDetails__)
is set to true, this field will be populated when getting assistant
session.

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

### hasDetailedAssistAnswer

### clearDetailedAssistAnswer

### setDetailedAssistAnswer

Output only. In
[ConversationalSearchService.GetSession](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Client.ConversationalSearchServiceClient#_Google_Cloud_DiscoveryEngine_V1_Client_ConversationalSearchServiceClient__getSession__)
API, if
[GetSessionRequest.include_answer_details](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.GetSessionRequest#_Google_Cloud_DiscoveryEngine_V1_GetSessionRequest__getIncludeAnswerDetails__)
is set to true, this field will be populated when getting assistant
session.

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

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

### getQueryConfig

Optional. Represents metadata related to the query config, for example
LLM model and version used, model parameters (temperature, grounding
parameters, etc.). The prefix "google." is reserved for Google-developed
functionality.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setQueryConfig

Optional. Represents metadata related to the query config, for example
LLM model and version used, model parameters (temperature, grounding
parameters, etc.). The prefix "google." is reserved for Google-developed
functionality.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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