Google Cloud Discovery Engine V1 Client - Class Answer (1.12.0)
Stay organized with collections
Save and categorize content based on your preferences.
Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class Answer.
Defines an answer.
Generated from protobuf message google.cloud.discoveryengine.v1.Answer
Namespace
Google \ Cloud \ DiscoveryEngine \ V1
Methods
__construct
| Parameter |
| Name |
Description |
data |
mixed
|
getName
Immutable. Fully qualified name
projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*
| Returns |
| Type |
Description |
string |
|
setName
Immutable. Fully qualified name
projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*
| Parameter |
| Name |
Description |
var |
string
|
| Returns |
| Type |
Description |
$this |
|
getState
The state of the answer generation.
| Returns |
| Type |
Description |
int |
Enum of type State. |
setState
The state of the answer generation.
| Parameter |
| Name |
Description |
var |
int
Enum of type State.
|
| Returns |
| Type |
Description |
$this |
|
getAnswerText
| Returns |
| Type |
Description |
string |
|
setAnswerText
| Parameter |
| Name |
Description |
var |
string
|
| Returns |
| Type |
Description |
$this |
|
getGroundingScore
A score in the range of [0, 1] describing how grounded the answer is by the
reference chunks.
| Returns |
| Type |
Description |
float |
|
hasGroundingScore
clearGroundingScore
setGroundingScore
A score in the range of [0, 1] describing how grounded the answer is by the
reference chunks.
| Parameter |
| Name |
Description |
var |
float
|
| Returns |
| Type |
Description |
$this |
|
getCitations
setCitations
| Returns |
| Type |
Description |
$this |
|
getGroundingSupports
Optional. Grounding supports.
setGroundingSupports
Optional. Grounding supports.
| Returns |
| Type |
Description |
$this |
|
getReferences
setReferences
| Returns |
| Type |
Description |
$this |
|
Suggested related questions.
| Returns |
| Type |
Description |
Google\Protobuf\RepeatedField<string> |
|
Suggested related questions.
| Parameter |
| Name |
Description |
var |
string[]
|
| Returns |
| Type |
Description |
$this |
|
getSteps
| Returns |
| Type |
Description |
Google\Protobuf\RepeatedField<Answer\Step> |
|
setSteps
| Returns |
| Type |
Description |
$this |
|
getQueryUnderstandingInfo
Query understanding information.
hasQueryUnderstandingInfo
clearQueryUnderstandingInfo
setQueryUnderstandingInfo
Query understanding information.
| Returns |
| Type |
Description |
$this |
|
getAnswerSkippedReasons
Additional answer-skipped reasons. This provides the reason for ignored
cases. If nothing is skipped, this field is not set.
| Returns |
| Type |
Description |
Google\Protobuf\RepeatedField<int> |
|
setAnswerSkippedReasons
Additional answer-skipped reasons. This provides the reason for ignored
cases. If nothing is skipped, this field is not set.
| Parameter |
| Name |
Description |
var |
int[]
|
| Returns |
| Type |
Description |
$this |
|
getCreateTime
Output only. Answer creation timestamp.
| Returns |
| Type |
Description |
Google\Protobuf\Timestamp|null |
|
hasCreateTime
clearCreateTime
setCreateTime
Output only. Answer creation timestamp.
| Parameter |
| Name |
Description |
var |
Google\Protobuf\Timestamp
|
| Returns |
| Type |
Description |
$this |
|
getCompleteTime
Output only. Answer completed timestamp.
| Returns |
| Type |
Description |
Google\Protobuf\Timestamp|null |
|
hasCompleteTime
clearCompleteTime
setCompleteTime
Output only. Answer completed timestamp.
| Parameter |
| Name |
Description |
var |
Google\Protobuf\Timestamp
|
| Returns |
| Type |
Description |
$this |
|
getSafetyRatings
Optional. Safety ratings.
| Returns |
| Type |
Description |
Google\Protobuf\RepeatedField<SafetyRating> |
|
setSafetyRatings
Optional. Safety ratings.
| Returns |
| Type |
Description |
$this |
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-07-31 UTC.
[null,null,["Last updated 2026-07-31 UTC."],[],[]]