Answer query method.
HTTP request
POST https://discoveryengine.googleapis.com/v1alpha/{servingConfig=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:answer
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
serving |
Required. The resource name of the servingConfigs.search serving config, such as |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "query": { object ( |
Fields | |
---|---|
query |
Required. Current user query. |
session |
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 |
Model specification. |
related |
Related questions specification. |
grounding |
Optional. Grounding specification. |
answer |
Answer generation specification. |
search |
servingConfigs.search specification. |
query |
Query understanding specification. |
asynchronousMode |
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 |
user |
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 The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an |
user |
The user labels applied to a resource must meet the following requirements:
See Google Cloud Document for more details. |
Response body
If successful, the response body contains an instance of AnswerQueryResponse
.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the servingConfig
resource:
discoveryengine.servingConfigs.answer
For more information, see the IAM documentation.