search_recommendations
async
¶
search_recommendations(
domain_name: name,
key_name: name,
key_values: KeyValuesList,
recommender: Recommender,
*,
config_overrides: Optional[AsyncCustomerProfilesClientConfig] = 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/async_customer_profiles.py
7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 | |