recommendations
Creates, updates, deletes, gets or lists a recommendations resource.
Overview
| Name | recommendations |
| Type | Resource |
| Id | aws.wisdom.recommendations |
Fields
The following fields are returned by SELECT queries:
- get_recommendations
| Name | Datatype | Description |
|---|---|---|
recommendations | array | The recommendations. |
triggers | array | The triggers corresponding to recommendations. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_recommendations | select | assistant_id, session_id, region | maxResults, waitTimeSeconds | Retrieves recommendations for the specified session. To avoid retrieving the same recommendations in subsequent calls, use NotifyRecommendationsReceived. This API supports long-polling behavior with the waitTimeSeconds parameter. Short poll is the default behavior and only returns recommendations already available. To perform a manual query against an assistant, use QueryAssistant. |
notify_recommendations_received | exec | assistant_id, session_id, region, recommendationIds | Removes the specified recommendations from the specified assistant's queue of newly available recommendations. You can use this API in conjunction with GetRecommendations and a waitTimeSeconds input for long-polling behavior and avoiding duplicate recommendations. |
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.
| Name | Datatype | Description |
|---|---|---|
assistant_id | string | The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN. |
region | string | AWS region (default: us-east-1) |
session_id | string | The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN. |
maxResults | integer | The maximum number of results to return per page. |
waitTimeSeconds | integer | The duration (in seconds) for which the call waits for a recommendation to be made available before returning. If a recommendation is available, the call returns sooner than WaitTimeSeconds. If no messages are available and the wait time expires, the call returns successfully with an empty list. |
SELECT examples
- get_recommendations
Retrieves recommendations for the specified session. To avoid retrieving the same recommendations in subsequent calls, use NotifyRecommendationsReceived. This API supports long-polling behavior with the waitTimeSeconds parameter. Short poll is the default behavior and only returns recommendations already available. To perform a manual query against an assistant, use QueryAssistant.
SELECT
recommendations,
triggers
FROM aws.wisdom.recommendations
WHERE assistant_id = '{{ assistant_id }}' -- required
AND session_id = '{{ session_id }}' -- required
AND region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND waitTimeSeconds = '{{ waitTimeSeconds }}'
;
Lifecycle Methods
- notify_recommendations_received
Removes the specified recommendations from the specified assistant's queue of newly available recommendations. You can use this API in conjunction with GetRecommendations and a waitTimeSeconds input for long-polling behavior and avoiding duplicate recommendations.
EXEC aws.wisdom.recommendations.notify_recommendations_received
@assistant_id='{{ assistant_id }}' --required,
@session_id='{{ session_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"recommendationIds": "{{ recommendationIds }}"
}'
;