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 \ V1Methods
__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 |
↳ 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 |
↳ safety_spec |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SafetySpec
Model specification. |
↳ related_questions_spec |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\RelatedQuestionsSpec
Related questions specification. |
↳ answer_generation_spec |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec
Answer generation specification. |
↳ search_spec |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec
Search specification. |
↳ query_understanding_spec |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec
Query understanding specification. |
↳ 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 |
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 |
Google\Cloud\DiscoveryEngine\V1\Query|null |
hasQuery
clearQuery
setQuery
Required. Current user query.
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\DiscoveryEngine\V1\Query
|
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.
Returns | |
---|---|
Type | Description |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SafetySpec|null |
hasSafetySpec
clearSafetySpec
setSafetySpec
Model specification.
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SafetySpec
|
Returns | |
---|---|
Type | Description |
$this |
getRelatedQuestionsSpec
Related questions specification.
Returns | |
---|---|
Type | Description |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\RelatedQuestionsSpec|null |
hasRelatedQuestionsSpec
clearRelatedQuestionsSpec
setRelatedQuestionsSpec
Related questions specification.
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\RelatedQuestionsSpec
|
Returns | |
---|---|
Type | Description |
$this |
getAnswerGenerationSpec
Answer generation specification.
Returns | |
---|---|
Type | Description |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec|null |
hasAnswerGenerationSpec
clearAnswerGenerationSpec
setAnswerGenerationSpec
Answer generation specification.
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec
|
Returns | |
---|---|
Type | Description |
$this |
getSearchSpec
Search specification.
Returns | |
---|---|
Type | Description |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec|null |
hasSearchSpec
clearSearchSpec
setSearchSpec
Search specification.
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec
|
Returns | |
---|---|
Type | Description |
$this |
getQueryUnderstandingSpec
Query understanding specification.
Returns | |
---|---|
Type | Description |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec|null |
hasQueryUnderstandingSpec
clearQueryUnderstandingSpec
setQueryUnderstandingSpec
Query understanding specification.
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec
|
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 |