-
Notifications
You must be signed in to change notification settings - Fork 264
Closed
Labels
Description
Overview
In addition to #4296, we need to create a RecommendationsAdapter that inherits the base Adapter class in the appnexus library. The RecommendationsAdapter should be able to make requests to the Recommendations backend to generate embeddings and get recommendations using its make_request method.
Description and outcomes
- Create a new class
RecommendationsAdapterthat inheritsAdapter:
CLASS RecommendationsAdapter INHERITS Adapter:
METHOD generateEmbeddings(self, params) -> Boolean
# [ Implementation ]
METHOD getRecommendations(self, params) -> Array
# [ Implementation ]
- Implement the
generate embeddingsandget recommendationsmethods that use themake_request()method in the Backend class - The actual functionality depends on presence of an actual backend, so boilerplate will do for now.
- The class should be implemented within the
contentcurationapp incontentcuration/contentcuration/utils/recommendations.py
Accessibility requirements
Not applicable
Acceptance criteria
- The
RecommendationsAdapteris created and it inherits theAdapterclass. - The
make_requestmethod is called within thegenerate embeddingandget recommendationsmethods. - Tests are written to validate correctness of the
RecommendationsAdapterlogic. - Documentation has been added to the backend class, explaining its purpose, inputs and outputs.