# Google Cloud Retail V2 Client - Class ConversationalSearchResponse (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.1 2.2.1 2.1.3 2.0.0 1.7.0 1.6.4 1.5.0 1.4.2 1.3.1 1.2.1 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Retail V2 Client class ConversationalSearchResponse.

Response message for
[ConversationalSearchService.ConversationalSearch](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Client.ConversationalSearchServiceClient#_Google_Cloud_Retail_V2_Client_ConversationalSearchServiceClient__conversationalSearch__)
method.

Generated from protobuf message `google.cloud.retail.v2.ConversationalSearchResponse`

## Namespace

Google \\ Cloud \\ Retail \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ user_query_types` | `string[]` The types Retail classifies the search query as. Supported values are: - "ORDER_SUPPORT" - "SIMPLE_PRODUCT_SEARCH" - "INTENT_REFINEMENT" - "PRODUCT_DETAILS" - "PRODUCT_COMPARISON" - "DEALS_AND_COUPONS" - "STORE_RELEVANT" - "BLOCKLISTED" - "BEST_PRODUCT" - "RETAIL_SUPPORT" - "DISABLED" |
| `↳ conversational_text_response` | `string` The conversational answer-based text response generated by the Server. |
| `↳ followup_question` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchResponse.FollowupQuestion` The conversational followup question generated for Intent refinement. |
| `↳ conversation_id` | `string` Conversation UUID. This field will be stored in client side storage to maintain the conversation session with server and will be used for next search request's [ConversationalSearchRequest.conversation_id](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchRequest#_Google_Cloud_Retail_V2_ConversationalSearchRequest__getConversationId__) to restore conversation state in server. |
| `↳ refined_search` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchResponse.RefinedSearch>` The proposed refined search queries. They can be used to fetch the relevant search results. When using CONVERSATIONAL_FILTER_ONLY mode, the refined_query from search response will be populated here. |
| `↳ conversational_filtering_result` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchResponse.ConversationalFilteringResult` This field specifies all related information that is needed on client side for UI rendering of conversational filtering search. |
| `↳ state` | `int` Output only. The state of the response generation. |

### getUserQueryTypes

The types Retail classifies the search query as.

Supported values are:

- "ORDER_SUPPORT"
- "SIMPLE_PRODUCT_SEARCH"
- "INTENT_REFINEMENT"
- "PRODUCT_DETAILS"
- "PRODUCT_COMPARISON"
- "DEALS_AND_COUPONS"
- "STORE_RELEVANT"
- "BLOCKLISTED"
- "BEST_PRODUCT"
- "RETAIL_SUPPORT"
- "DISABLED"

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setUserQueryTypes

The types Retail classifies the search query as.

Supported values are:

- "ORDER_SUPPORT"
- "SIMPLE_PRODUCT_SEARCH"
- "INTENT_REFINEMENT"
- "PRODUCT_DETAILS"
- "PRODUCT_COMPARISON"
- "DEALS_AND_COUPONS"
- "STORE_RELEVANT"
- "BLOCKLISTED"
- "BEST_PRODUCT"
- "RETAIL_SUPPORT"
- "DISABLED"

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

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

### getConversationalTextResponse

The conversational answer-based text response generated by the Server.

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

### setConversationalTextResponse

The conversational answer-based text response generated by the Server.

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

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

### getFollowupQuestion

The conversational followup question generated for Intent refinement.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchResponse.FollowupQuestion|null` |   |

### hasFollowupQuestion

### clearFollowupQuestion

### setFollowupQuestion

The conversational followup question generated for Intent refinement.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchResponse.FollowupQuestion` |

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

### getConversationId

Conversation UUID. This field will be stored in client side storage to
maintain the conversation session with server and will be used for next
search request's
[ConversationalSearchRequest.conversation_id](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchRequest#_Google_Cloud_Retail_V2_ConversationalSearchRequest__getConversationId__)
to restore conversation state in server.

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

### setConversationId

Conversation UUID. This field will be stored in client side storage to
maintain the conversation session with server and will be used for next
search request's
[ConversationalSearchRequest.conversation_id](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchRequest#_Google_Cloud_Retail_V2_ConversationalSearchRequest__getConversationId__)
to restore conversation state in server.

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

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

### getRefinedSearch

The proposed refined search queries. They can be used to fetch the relevant
search results. When using CONVERSATIONAL_FILTER_ONLY mode, the
refined_query from search response will be populated here.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchResponse.RefinedSearch>` |   |

### setRefinedSearch

The proposed refined search queries. They can be used to fetch the relevant
search results. When using CONVERSATIONAL_FILTER_ONLY mode, the
refined_query from search response will be populated here.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchResponse.RefinedSearch>` |

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

### getConversationalFilteringResult

This field specifies all related information that is needed on client
side for UI rendering of conversational filtering search.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchResponse.ConversationalFilteringResult|null` |   |

### hasConversationalFilteringResult

### clearConversationalFilteringResult

### setConversationalFilteringResult

This field specifies all related information that is needed on client
side for UI rendering of conversational filtering search.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchResponse.ConversationalFilteringResult` |

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

### getState

Output only. The state of the response generation.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchResponse.State). |

### setState

Output only. The state of the response generation.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchResponse.State). |

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