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
8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 | |