Google Cloud Discovery Engine V1 Client - Class AnswerQueryRequest (1.0.0)

Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class AnswerQueryRequest.

Request message for ConversationalSearchService.AnswerQuery method.

Generated from protobuf message google.cloud.discoveryengine.v1.AnswerQueryRequest

Namespace

Google \ Cloud \ DiscoveryEngine \ V1

Methods

__construct

Constructor.

Parameters
Name
Description
data
array

Optional. Data for populating the Message object.

↳ 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 . This field is used to identify the serving configuration name, set of models used to make the search.

↳ query
Google\Cloud\DiscoveryEngine\V1\Query

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.

↳ related_questions_spec
↳ answer_generation_spec
↳ query_understanding_spec
↳ asynchronous_mode
bool

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 or ConversationalSearchService.GetSession 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
array| Google\Protobuf\Internal\MapField

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 for more details.

getServingConfig

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 .

This field is used to identify the serving configuration name, set of models used to make the search.

Returns
Type
Description
string

setServingConfig

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 .

This field is used to identify the serving configuration name, set of models used to make the search.

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getQuery

Required. Current user query.

Returns
Type
Description

hasQuery

clearQuery

setQuery

Required. Current user query.

Parameter
Name
Description
Returns
Type
Description
$this

getSession

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.

Returns
Type
Description
string

setSession

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.

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getSafetySpec

Model specification.

hasSafetySpec

clearSafetySpec

setSafetySpec

Model specification.

Returns
Type
Description
$this

getRelatedQuestionsSpec

Related questions specification.

hasRelatedQuestionsSpec

clearRelatedQuestionsSpec

setRelatedQuestionsSpec

Related questions specification.

Returns
Type
Description
$this

getAnswerGenerationSpec

Answer generation specification.

hasAnswerGenerationSpec

clearAnswerGenerationSpec

setAnswerGenerationSpec

Answer generation specification.

Returns
Type
Description
$this

getSearchSpec

Search specification.

hasSearchSpec

clearSearchSpec

setSearchSpec

Search specification.

Returns
Type
Description
$this

getQueryUnderstandingSpec

Query understanding specification.

hasQueryUnderstandingSpec

clearQueryUnderstandingSpec

setQueryUnderstandingSpec

Query understanding specification.

Returns
Type
Description
$this

getAsynchronousMode

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 or ConversationalSearchService.GetSession method.

Returns
Type
Description
bool

setAsynchronousMode

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 or ConversationalSearchService.GetSession method.

Parameter
Name
Description
var
bool
Returns
Type
Description
$this

getUserPseudoId

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.

Returns
Type
Description
string

setUserPseudoId

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.

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getUserLabels

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 for more details.
Returns
Type
Description

setUserLabels

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 for more details.
Parameter
Name
Description
Returns
Type
Description
$this
Design a Mobile Site
View Site in Mobile | Classic
Share by: