- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- Try it!
Makes a recommendation, which requires a contextual user event.
HTTP request
POST https://discoveryengine.googleapis.com/v1alpha/{servingConfig=projects/*/locations/*/dataStores/*/servingConfigs/*}:recommend
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
servingConfig |
Required. Full resource name of the format: Before you can request recommendations from your model, you must create at least one serving config for it. |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"userEvent": {
object ( |
Fields | |
---|---|
userEvent |
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 |
pageSize |
Maximum number of results to return. Set this property to the number of recommendation results needed. If zero, the service will choose a reasonable default. The maximum allowed value is 100. Values above 100 will be coerced to 100. |
filter |
Filter for restricting recommendation results with a length limit of 5,000 characters. Currently, only filter expressions on the Examples:
If your filter blocks all results, the API will return generic (unfiltered) popular Documents. If you only want results strictly matching the filters, set Note that the API will never return |
validateOnly |
Use validate only mode for this recommendation query. If set to true, a fake model will be used that returns arbitrary Document IDs. Note that the validate only mode should only be used for testing the API, or if the model is not ready. |
params |
Additional domain specific parameters for the recommendations. Allowed values:
|
userLabels |
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.