Makes a recommendation, which requires a contextual user event.
HTTP request
POST https://discoveryengine.googleapis.com/v1beta/{servingConfig=projects/*/locations/*/dataStores/*/servingConfigs/*}:recommend
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
serving |
Required. Full resource name of a One default serving config is created along with your recommendation engine creation. The engine ID is used as the ID of the default serving config. For example, for Engine |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"userEvent": {
object ( |
Fields | |
---|---|
user |
Required. Context about the user, what they are looking at and what action they took to trigger the servingConfigs.recommend request. Note that this user event detail won't be ingested to userEvent logs. Thus, a separate userEvent write request is required for event logging. Don't set |
page |
Maximum number of results to return. Set this property to the number of recommendation results needed. If zero, the service chooses a reasonable default. The maximum allowed value is 100. Values above 100 are set to 100. |
filter |
Filter for restricting recommendation results with a length limit of 5,000 characters. Currently, only filter expressions on the Examples:
If
If your filter blocks all results, the API returns generic (unfiltered) popular Documents. If you only want results strictly matching the filters, set Note that the API never returns |
validate |
Use validate only mode for this recommendation query. If set to |
params |
Additional domain specific parameters for the recommendations. Allowed values:
|
user |
The user labels applied to a resource must meet the following requirements:
See Requirements for labels for more details. |
Response body
If successful, the response body contains an instance of RecommendResponse
.
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.recommend
For more information, see the IAM documentation.