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
8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 | |