# Discovery Engine V1BETA API - Class Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client (v0.28.0)

0.28.0 (latest) 0.27.0 0.26.0 0.25.0 0.24.0 0.23.1 0.22.0 0.21.0 0.20.1 0.19.1 0.18.0 0.17.0 0.16.0 0.15.0 0.14.2 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.2 0.6.0 0.5.0 0.4.0 0.3.0 0.2.1 0.1.0 Reference documentation and code samples for the Discovery Engine V1BETA API class Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.

REST client for the ConversationalSearchService service.


<br />

Service for conversational search.

## Inherits

- Object

## Includes

- [Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the ConversationalSearchService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Rest-Client-Configuration "Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all ConversationalSearchService clients
::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #answer_query

    def answer_query(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse
    def answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil, end_user_spec: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse

Answer query method.
**Overloads**

    def answer_query(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse

Pass arguments to `answer_query` via a request object, either of type [AnswerQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest "Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil, end_user_spec: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse

Pass arguments to `answer_query` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **serving_config** (::String) --- Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`.


  Or the resource name of the agent engine serving config, such as:
  `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_agent_answer`.
  (use when `enable_agent_invocation` set to true, and you have custom
  `AI_MODE` agent engine configured)

  This field is used to identify the serving configuration name, set
  of models used to make the search.
- **query** ([::Google::Cloud::DiscoveryEngine::V1beta::Query](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Query), ::Hash) --- Required. Current user query.
- **session** (::String) --- The session resource name. Not required.


  When session field is not set, the API is in sessionless mode.

  We support auto session mode: users can use the wildcard symbol `-` as
  session ID. A new ID will be automatically generated and assigned.
- **safety_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SafetySpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-SafetySpec), ::Hash) --- Model specification.
- **related_questions_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::RelatedQuestionsSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-RelatedQuestionsSpec), ::Hash) --- Related questions specification.
- **grounding_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::GroundingSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-GroundingSpec), ::Hash) --- Optional. Grounding specification.
- **answer_generation_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::AnswerGenerationSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-AnswerGenerationSpec), ::Hash) --- Answer generation specification.
- **search_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-SearchSpec), ::Hash) --- Search specification.
- **query_understanding_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::QueryUnderstandingSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-QueryUnderstandingSpec), ::Hash) --- Query understanding specification.
- **asynchronous_mode** (::Boolean) --- Deprecated: This field is deprecated. Streaming Answer API will be supported.


  Asynchronous mode control.

  If enabled, the response will be returned with answer/session resource
  name without final answer. The API users need to do the polling to get
  the latest status of answer/session by calling
  [ConversationalSearchService.GetAnswer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Rest-Client#Google__Cloud__DiscoveryEngine__V1beta__ConversationalSearchService__Rest__Client_get_answer_instance_ "Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client#get_answer (method)")
  or
  [ConversationalSearchService.GetSession](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Rest-Client#Google__Cloud__DiscoveryEngine__V1beta__ConversationalSearchService__Rest__Client_get_session_instance_ "Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client#get_session (method)")
  method.
- **user_pseudo_id** (::String) --- A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website.


  This field should NOT have a fixed value such as `unknown_visitor`.

  The field must be a UTF-8 encoded string with a length limit of 128
  characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
- **user_labels** (::Hash{::String =\> ::String}) --- The user labels applied to a resource must meet the following requirements:


  - Each resource can have multiple labels, up to a maximum of 64.
  - Each label must be a key-value pair.
  - Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
  - Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
  - The key portion of a label must be unique. However, you can use the same key with multiple resources.
  - Keys must start with a lowercase letter or international character.

  See [Google Cloud
  Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
  for more details.
- **end_user_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::EndUserSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-EndUserSpec), ::Hash) --- Optional. End user specification.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryResponse))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest.new

# Call the answer_query method.
result = client.answer_query request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse.
p result
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the ConversationalSearchService Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Rest-Client#Google__Cloud__DiscoveryEngine__V1beta__ConversationalSearchService__Rest__Client_configure_class_ "Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Rest-Client-Configuration "Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Rest-Client-Configuration))

### #converse_conversation

    def converse_conversation(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationResponse
    def converse_conversation(name: nil, query: nil, serving_config: nil, conversation: nil, safe_search: nil, user_labels: nil, summary_spec: nil, filter: nil, boost_spec: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationResponse

Converses a conversation.
**Overloads**

    def converse_conversation(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationResponse

Pass arguments to `converse_conversation` via a request object, either of type [Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConverseConversationRequest "Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConverseConversationRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def converse_conversation(name: nil, query: nil, serving_config: nil, conversation: nil, safe_search: nil, user_labels: nil, summary_spec: nil, filter: nil, boost_spec: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationResponse

Pass arguments to `converse_conversation` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The resource name of the Conversation to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. Use `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session.
- **query** ([::Google::Cloud::DiscoveryEngine::V1beta::TextInput](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TextInput), ::Hash) --- Required. Current user input.
- **serving_config** (::String) --- The resource name of the Serving Config to use. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` If this is not set, the default serving config will be used.
- **conversation** ([::Google::Cloud::DiscoveryEngine::V1beta::Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation), ::Hash) --- The conversation to be used by auto session only. The name field will be ignored as we automatically assign new name for the conversation in auto session.
- **safe_search** (::Boolean) --- Whether to turn on safe search.
- **user_labels** (::Hash{::String =\> ::String}) --- The user labels applied to a resource must meet the following requirements:


  - Each resource can have multiple labels, up to a maximum of 64.
  - Each label must be a key-value pair.
  - Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
  - Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
  - The key portion of a label must be unique. However, you can use the same key with multiple resources.
  - Keys must start with a lowercase letter or international character.

  See [Google Cloud
  Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
  for more details.
- **summary_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-SearchRequest-ContentSearchSpec-SummarySpec), ::Hash) --- A specification for configuring the summary returned in the response.
- **filter** (::String) --- 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. This will be used to filter search results which may affect the summary response.


  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)
- **boost_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-SearchRequest-BoostSpec), ::Hash) --- Boost specification to boost certain documents in search results which may affect the converse response. For more information on boosting, see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConverseConversationResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConverseConversationResponse))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationRequest.new

# Call the converse_conversation method.
result = client.converse_conversation request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationResponse.
p result
```

### #create_conversation

    def create_conversation(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Conversation
    def create_conversation(parent: nil, conversation: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Conversation

Creates a Conversation.


<br />

If the [Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation "Google::Cloud::DiscoveryEngine::V1beta::Conversation (class)") to
create already exists, an ALREADY_EXISTS error is returned.
**Overloads**

    def create_conversation(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Conversation

Pass arguments to `create_conversation` via a request object, either of type [Google::Cloud::DiscoveryEngine::V1beta::CreateConversationRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CreateConversationRequest "Google::Cloud::DiscoveryEngine::V1beta::CreateConversationRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::CreateConversationRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CreateConversationRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def create_conversation(parent: nil, conversation: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Conversation

Pass arguments to `create_conversation` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. Full resource name of parent data store. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
- **conversation** ([::Google::Cloud::DiscoveryEngine::V1beta::Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation), ::Hash) --- Required. The conversation to create.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1beta::Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::CreateConversationRequest.new

# Call the create_conversation method.
result = client.create_conversation request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Conversation.
p result
```

### #create_session

    def create_session(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
    def create_session(parent: nil, session: nil, session_id: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session

Creates a Session.


<br />

If the [Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session "Google::Cloud::DiscoveryEngine::V1beta::Session (class)") to create
already exists, an ALREADY_EXISTS error is returned.
**Overloads**

    def create_session(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session

Pass arguments to `create_session` via a request object, either of type [Google::Cloud::DiscoveryEngine::V1beta::CreateSessionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CreateSessionRequest "Google::Cloud::DiscoveryEngine::V1beta::CreateSessionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::CreateSessionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CreateSessionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def create_session(parent: nil, session: nil, session_id: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session

Pass arguments to `create_session` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. Full resource name of parent data store. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
- **session** ([::Google::Cloud::DiscoveryEngine::V1beta::Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session), ::Hash) --- Required. The session to create.
- **session_id** (::String) --- Optional. The ID to use for the session, which will become the final component of the session's resource name.


  This value should be 1-63 characters, and valid characters
  are /\[a-z0-9\]\[a-z0-9-\]{0,61}\[a-z0-9\]/. If not specified, a unique ID will
  be generated.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1beta::Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::CreateSessionRequest.new

# Call the create_session method.
result = client.create_session request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Session.
p result
```

### #delete_conversation

    def delete_conversation(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_conversation(name: nil) -> ::Google::Protobuf::Empty

Deletes a Conversation.


<br />

If the [Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation "Google::Cloud::DiscoveryEngine::V1beta::Conversation (class)") to
delete does not exist, a NOT_FOUND error is returned.
**Overloads**

    def delete_conversation(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_conversation` via a request object, either of type [DeleteConversationRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-DeleteConversationRequest "Google::Cloud::DiscoveryEngine::V1beta::DeleteConversationRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::DeleteConversationRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-DeleteConversationRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def delete_conversation(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_conversation` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the Conversation to delete. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Protobuf-Empty))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::DeleteConversationRequest.new

# Call the delete_conversation method.
result = client.delete_conversation request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #delete_session

    def delete_session(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_session(name: nil) -> ::Google::Protobuf::Empty

Deletes a Session.


<br />

If the [Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session "Google::Cloud::DiscoveryEngine::V1beta::Session (class)") to delete
does not exist, a NOT_FOUND error is returned.
**Overloads**

    def delete_session(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_session` via a request object, either of type [DeleteSessionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-DeleteSessionRequest "Google::Cloud::DiscoveryEngine::V1beta::DeleteSessionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::DeleteSessionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-DeleteSessionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def delete_session(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_session` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the Session to delete. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Protobuf-Empty))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::DeleteSessionRequest.new

# Call the delete_session method.
result = client.delete_session request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #get_answer

    def get_answer(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Answer
    def get_answer(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Answer

Gets a Answer.
**Overloads**

    def get_answer(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Answer

Pass arguments to `get_answer` via a request object, either of type [GetAnswerRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-GetAnswerRequest "Google::Cloud::DiscoveryEngine::V1beta::GetAnswerRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::GetAnswerRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-GetAnswerRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_answer(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Answer

Pass arguments to `get_answer` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the Answer to get. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1beta::Answer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Answer))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::Answer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Answer))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::GetAnswerRequest.new

# Call the get_answer method.
result = client.get_answer request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Answer.
p result
```

### #get_conversation

    def get_conversation(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Conversation
    def get_conversation(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Conversation

Gets a Conversation.
**Overloads**

    def get_conversation(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Conversation

Pass arguments to `get_conversation` via a request object, either of type [GetConversationRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-GetConversationRequest "Google::Cloud::DiscoveryEngine::V1beta::GetConversationRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::GetConversationRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-GetConversationRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_conversation(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Conversation

Pass arguments to `get_conversation` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the Conversation to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1beta::Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::GetConversationRequest.new

# Call the get_conversation method.
result = client.get_conversation request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Conversation.
p result
```

### #get_session

    def get_session(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
    def get_session(name: nil, include_answer_details: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session

Gets a Session.
**Overloads**

    def get_session(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session

Pass arguments to `get_session` via a request object, either of type [GetSessionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-GetSessionRequest "Google::Cloud::DiscoveryEngine::V1beta::GetSessionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::GetSessionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-GetSessionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_session(name: nil, include_answer_details: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session

Pass arguments to `get_session` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The resource name of the Session to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
- **include_answer_details** (::Boolean) --- Optional. If set to true, the full session including all answer details will be returned.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1beta::Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::GetSessionRequest.new

# Call the get_session method.
result = client.get_session request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Session.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new ConversationalSearchService REST client object.
**Yields**

- (config) --- Configure the ConversationalSearchService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_conversations

    def list_conversations(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Conversation>
    def list_conversations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Conversation>

Lists all Conversations by their parent
[DataStore](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-DataStore "Google::Cloud::DiscoveryEngine::V1beta::DataStore (class)").
**Overloads**

    def list_conversations(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Conversation>

Pass arguments to `list_conversations` via a request object, either of type [ListConversationsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListConversationsRequest "Google::Cloud::DiscoveryEngine::V1beta::ListConversationsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::ListConversationsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListConversationsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_conversations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Conversation>

Pass arguments to `list_conversations` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The data store resource name. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
- **page_size** (::Integer) --- Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.
- **page_token** (::String) --- A page token, received from a previous `ListConversations` call. Provide this to retrieve the subsequent page.
- **filter** (::String) --- A filter to apply on the list results. The supported features are: user_pseudo_id, state.


  Example:
  "user_pseudo_id = some_id"
- **order_by** (::String) --- A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending. Supported fields:


  - `update_time`
  - `create_time`
  - `conversation_name`

  Example:
  "update_time desc"
  "create_time"
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DiscoveryEngine::V1beta::Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DiscoveryEngine::V1beta::Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::ListConversationsRequest.new

# Call the list_conversations method.
result = client.list_conversations request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::Conversation.
  p item
end
```

### #list_sessions

    def list_sessions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Session>
    def list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Session>

Lists all Sessions by their parent
[DataStore](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-DataStore "Google::Cloud::DiscoveryEngine::V1beta::DataStore (class)").
**Overloads**

    def list_sessions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Session>

Pass arguments to `list_sessions` via a request object, either of type [ListSessionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListSessionsRequest "Google::Cloud::DiscoveryEngine::V1beta::ListSessionsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::ListSessionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListSessionsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Session>

Pass arguments to `list_sessions` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The data store resource name. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
- **page_size** (::Integer) --- Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.
- **page_token** (::String) --- A page token, received from a previous `ListSessions` call. Provide this to retrieve the subsequent page.
- **filter** (::String) ---

  A comma-separated list of fields to filter by, in EBNF grammar.

  The supported fields are:
  - `user_pseudo_id`
  - `state`
  - `display_name`
  - `starred`
  - `is_pinned`
  - `labels`
  - `create_time`
  - `update_time`
  - `collaborative_project`

  Examples:
  - `user_pseudo_id = some_id`
  - `display_name = "some_name"`
  - `starred = true`
  - `is_pinned=true AND (NOT labels:hidden)`
  - `create_time > "1970-01-01T12:00:00Z"`
  - `collaborative_project =
    "projects/123/locations/global/collections/default_collection/engines/"
    "default_engine/collaborative_projects/cp1"`
- **order_by** (::String) ---

  A comma-separated list of fields to order by, sorted in ascending order.
  Use "desc" after a field name for descending.

  Supported fields:
  - `update_time`
  - `create_time`
  - `session_name`
  - `is_pinned`
  - `display_name`

  Example:
  - `update_time desc`
  - `create_time`
  - `is_pinned desc,update_time desc`: list sessions by is_pinned first, then by update_time.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DiscoveryEngine::V1beta::Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DiscoveryEngine::V1beta::Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::ListSessionsRequest.new

# Call the list_sessions method.
result = client.list_sessions request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::Session.
  p item
end
```

### #location_client

    def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.
**Returns**

- (Google::Cloud::Location::Locations::Rest::Client)

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #stream_answer_query

    def stream_answer_query(request, options = nil) -> ::Enumerable<::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse>
    def stream_answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil, end_user_spec: nil) -> ::Enumerable<::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse>

Answer query method (streaming).


<br />

It takes one
[AnswerQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest "Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest (class)")
and returns multiple
[AnswerQueryResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryResponse "Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse (class)")
messages in a stream.
**Overloads**

    def stream_answer_query(request, options = nil) -> ::Enumerable<::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse>

Pass arguments to `stream_answer_query` via a request object, either of type [AnswerQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest "Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def stream_answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil, end_user_spec: nil) -> ::Enumerable<::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse>

Pass arguments to `stream_answer_query` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **serving_config** (::String) --- Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`.


  Or the resource name of the agent engine serving config, such as:
  `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_agent_answer`.
  (use when `enable_agent_invocation` set to true, and you have custom
  `AI_MODE` agent engine configured)

  This field is used to identify the serving configuration name, set
  of models used to make the search.
- **query** ([::Google::Cloud::DiscoveryEngine::V1beta::Query](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Query), ::Hash) --- Required. Current user query.
- **session** (::String) --- The session resource name. Not required.


  When session field is not set, the API is in sessionless mode.

  We support auto session mode: users can use the wildcard symbol `-` as
  session ID. A new ID will be automatically generated and assigned.
- **safety_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SafetySpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-SafetySpec), ::Hash) --- Model specification.
- **related_questions_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::RelatedQuestionsSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-RelatedQuestionsSpec), ::Hash) --- Related questions specification.
- **grounding_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::GroundingSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-GroundingSpec), ::Hash) --- Optional. Grounding specification.
- **answer_generation_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::AnswerGenerationSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-AnswerGenerationSpec), ::Hash) --- Answer generation specification.
- **search_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-SearchSpec), ::Hash) --- Search specification.
- **query_understanding_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::QueryUnderstandingSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-QueryUnderstandingSpec), ::Hash) --- Query understanding specification.
- **asynchronous_mode** (::Boolean) --- Deprecated: This field is deprecated. Streaming Answer API will be supported.


  Asynchronous mode control.

  If enabled, the response will be returned with answer/session resource
  name without final answer. The API users need to do the polling to get
  the latest status of answer/session by calling
  [ConversationalSearchService.GetAnswer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Rest-Client#Google__Cloud__DiscoveryEngine__V1beta__ConversationalSearchService__Rest__Client_get_answer_instance_ "Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client#get_answer (method)")
  or
  [ConversationalSearchService.GetSession](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ConversationalSearchService-Rest-Client#Google__Cloud__DiscoveryEngine__V1beta__ConversationalSearchService__Rest__Client_get_session_instance_ "Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client#get_session (method)")
  method.
- **user_pseudo_id** (::String) --- A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website.


  This field should NOT have a fixed value such as `unknown_visitor`.

  The field must be a UTF-8 encoded string with a length limit of 128
  characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
- **user_labels** (::Hash{::String =\> ::String}) --- The user labels applied to a resource must meet the following requirements:


  - Each resource can have multiple labels, up to a maximum of 64.
  - Each label must be a key-value pair.
  - Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
  - Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
  - The key portion of a label must be unique. However, you can use the same key with multiple resources.
  - Keys must start with a lowercase letter or international character.

  See [Google Cloud
  Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
  for more details.
- **end_user_spec** ([::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::EndUserSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryRequest-EndUserSpec), ::Hash) --- Optional. End user specification.
**Returns**

- (::Enumerable\<[::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-AnswerQueryResponse)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest.new

# Call the stream_answer_query method to start streaming.
output = client.stream_answer_query request

# The returned object is a streamed enumerable yielding elements of type
# ::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse
output.each do |current_response|
  p current_response
end
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_conversation

    def update_conversation(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Conversation
    def update_conversation(conversation: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Conversation

Updates a Conversation.


<br />

[Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation "Google::Cloud::DiscoveryEngine::V1beta::Conversation (class)") action
type cannot be changed. If the
[Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation "Google::Cloud::DiscoveryEngine::V1beta::Conversation (class)") to update
does not exist, a NOT_FOUND error is returned.
**Overloads**

    def update_conversation(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Conversation

Pass arguments to `update_conversation` via a request object, either of type [UpdateConversationRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UpdateConversationRequest "Google::Cloud::DiscoveryEngine::V1beta::UpdateConversationRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::UpdateConversationRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UpdateConversationRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def update_conversation(conversation: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Conversation

Pass arguments to `update_conversation` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **conversation** ([::Google::Cloud::DiscoveryEngine::V1beta::Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation), ::Hash) --- Required. The Conversation to update.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Protobuf-FieldMask), ::Hash) --- Indicates which fields in the provided [Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation "Google::Cloud::DiscoveryEngine::V1beta::Conversation (class)") to update. The following are NOT supported:


  - [Conversation.name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation#Google__Cloud__DiscoveryEngine__V1beta__Conversation_name_instance_ "Google::Cloud::DiscoveryEngine::V1beta::Conversation#name (method)")

  If not set or empty, all supported fields are updated.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1beta::Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::Conversation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Conversation))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::UpdateConversationRequest.new

# Call the update_conversation method.
result = client.update_conversation request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Conversation.
p result
```

### #update_session

    def update_session(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
    def update_session(session: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session

Updates a Session.


<br />

[Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session "Google::Cloud::DiscoveryEngine::V1beta::Session (class)") action type cannot
be changed. If the [Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session "Google::Cloud::DiscoveryEngine::V1beta::Session (class)")
to update does not exist, a NOT_FOUND error is returned.
**Overloads**

    def update_session(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session

Pass arguments to `update_session` via a request object, either of type [UpdateSessionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UpdateSessionRequest "Google::Cloud::DiscoveryEngine::V1beta::UpdateSessionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::UpdateSessionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UpdateSessionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def update_session(session: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session

Pass arguments to `update_session` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **session** ([::Google::Cloud::DiscoveryEngine::V1beta::Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session), ::Hash) --- Required. The Session to update.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Protobuf-FieldMask), ::Hash) --- Indicates which fields in the provided [Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session "Google::Cloud::DiscoveryEngine::V1beta::Session (class)") to update. The following are NOT supported:


  - [Session.name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session#Google__Cloud__DiscoveryEngine__V1beta__Session_name_instance_ "Google::Cloud::DiscoveryEngine::V1beta::Session#name (method)")

  If not set or empty, all supported fields are updated.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1beta::Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-Session))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::UpdateSessionRequest.new

# Call the update_session method.
result = client.update_session request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Session.
p result
```