Skip to main content

answers

Creates, updates, deletes, gets or lists an answers resource.

Overview

Nameanswers
TypeResource
Idgoogle.discoveryengine.answers

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringImmutable. Fully qualified name projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*
answerSkippedReasonsarrayAdditional answer-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set.
answerTextstringThe textual answer.
citationsarrayCitations.
completeTimestring (google-datetime)Output only. Answer completed timestamp.
createTimestring (google-datetime)Output only. Answer creation timestamp.
groundingScorenumber (double)A score in the range of [0, 1] describing how grounded the answer is by the reference chunks.
groundingSupportsarrayOptional. Grounding supports.
queryUnderstandingInfoobjectQuery understanding information. (id: GoogleCloudDiscoveryengineV1AnswerQueryUnderstandingInfo)
referencesarrayReferences.
relatedQuestionsarraySuggested related questions.
safetyRatingsarrayOptional. Safety ratings.
statestringThe state of the answer generation.
stepsarrayAnswer generation steps.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_collections_data_stores_sessions_answers_getselectprojectsId, locationsId, collectionsId, dataStoresId, sessionsId, answersIdGets a Answer.
projects_locations_collections_engines_sessions_answers_getselectprojectsId, locationsId, collectionsId, enginesId, sessionsId, answersIdGets a Answer.
projects_locations_data_stores_sessions_answers_getselectprojectsId, locationsId, dataStoresId, sessionsId, answersIdGets a Answer.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
answersIdstring
collectionsIdstring
dataStoresIdstring
enginesIdstring
locationsIdstring
projectsIdstring
sessionsIdstring

SELECT examples

Gets a Answer.

SELECT
name,
answerSkippedReasons,
answerText,
citations,
completeTime,
createTime,
groundingScore,
groundingSupports,
queryUnderstandingInfo,
references,
relatedQuestions,
safetyRatings,
state,
steps
FROM google.discoveryengine.answers
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND collectionsId = '{{ collectionsId }}' -- required
AND dataStoresId = '{{ dataStoresId }}' -- required
AND sessionsId = '{{ sessionsId }}' -- required
AND answersId = '{{ answersId }}' -- required;