get_action_recommendations
async
¶
get_action_recommendations(
*,
config_overrides: Optional[AsyncPersonalizeRuntimeClientConfig] = None,
campaign_arn: Optional[Arn] = None,
user_id: Optional[UserID] = None,
num_results: Optional[NumResults] = None,
filter_arn: Optional[Arn] = None,
filter_values: Optional[FilterValues] = None,
) -> GetActionRecommendationsResponse
Returns a list of recommended actions in sorted in descending order by prediction score. Use the GetActionRecommendations API if you have a custom campaign that deploys a solution version trained with a PERSONALIZED_ACTIONS recipe.
For more information about PERSONALIZED_ACTIONS recipes, see PERSONALIZED_ACTIONS recipes. For more information about getting action recommendations, see Getting action recommendations.
Parameters:
-
campaign_arn(Optional[Arn], default:None) –The Amazon Resource Name (ARN) of the campaign to use for getting action recommendations. This campaign must deploy a solution version trained with a PERSONALIZED_ACTIONS recipe.
-
user_id(Optional[UserID], default:None) –The user ID of the user to provide action recommendations for.
-
num_results(Optional[NumResults], default:None) –The number of results to return. The default is 5. The maximum is 100.
-
filter_arn(Optional[Arn], default:None) –The ARN of the filter to apply to the returned recommendations. For more information, see Filtering Recommendations.
When using this parameter, be sure the filter resource is
ACTIVE. -
filter_values(Optional[FilterValues], default:None) –The values to use when filtering recommendations. For each placeholder parameter in your filter expression, provide the parameter name (in matching case) as a key and the filter value(s) as the corresponding value. Separate multiple values for one parameter with a comma.
For filter expressions that use an
INCLUDEelement to include actions, you must provide values for all parameters that are defined in the expression. For filters with expressions that use anEXCLUDEelement to exclude actions, you can omit thefilter-values. In this case, Amazon Personalize doesn't use that portion of the expression to filter recommendations.For more information, see Filtering recommendations and user segments.
Raises:
-
InvalidInputException–Provide a valid value for the field or parameter.
-
ResourceNotFoundException–The specified resource does not exist.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_personalize_runtime/_services/async_personalize_runtime.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |