search_recommendations
¶
search_recommendations(
domain_name: name,
key_name: name,
key_values: KeyValuesList,
recommender: Recommender,
*,
config_overrides: Optional[CustomerProfilesClientConfig] = None,
candidate_ids: Optional[CandidateIdList] = None,
context: Optional[RecommenderContext] = None,
diversity: Optional[RecommendationDiversityConfig] = None,
metadata: Optional[RecommendationMetadata] = None,
max_recommendations: Optional[MaxSize500] = None,
) -> SearchRecommendationsResponse
Retrieves recommendations for a profile in a specific domain. The profile is identified using a search key, which consists of a KeyName and a KeyValues list. The KeyName can be a predefined key (for example, _profileId, _phone, _email) or a custom-defined key.
The search key must match exactly one profile. If no profile matches the search key, the operation returns a ResourceNotFoundException. If more than one profile matches the search key, the operation returns a BadRequestException. You can use the SearchProfiles API to review the matching profiles.
Parameters:
-
domain_name(name) –The unique name of the domain.
-
key_name(name) –A searchable identifier of a customer profile. You can use a predefined key, such as
_profileId,_phone, or_email, or a custom-defined key. -
key_values(KeyValuesList) –A list of key values. Provide one value for each field of the search key.
-
recommender(Recommender) –The recommender used to generate the recommendations.
-
candidate_ids(Optional[CandidateIdList], default:None) –A list of item IDs to rank for the user. Use this when you want to re-rank a specific set of items rather than getting recommendations from the full item catalog. Required for personalized-ranking use cases.
-
context(Optional[RecommenderContext], default:None) –The contextual metadata used to provide dynamic runtime information to tailor recommendations.
-
diversity(Optional[RecommendationDiversityConfig], default:None) –Runtime diversity configuration for this request. Enables diversity-aware recommendations and optionally supplies values for placeholder-based diversity caps configured on the recommender.
-
metadata(Optional[RecommendationMetadata], default:None) –Configuration for metadata to include in recommendation responses.
-
max_recommendations(Optional[MaxSize500], default:None) –The maximum number of recommendations to return. The default value is 5.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
BadRequestException–The input you provided is invalid.
-
InternalServerException–An internal service error occurred.
-
ResourceNotFoundException–The requested resource does not exist, or access was denied.
-
ThrottlingException–You exceeded the maximum number of requests.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_customer_profiles/_services/customer_profiles.py
7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 | |