The SimilarProductRecommender component

Once the engine template (Similar Products Engine Template) is deployed, built, and trained, we can ask for a recommendation by calling the query endpoint, which will be of the https://<appname>.herokuapp.com/queries.json format.

The query-input JSON data for the engine template we currently have will be of the following format:

    {     "items": ["i1"],     "num": 4    }

The results will be of the following format:

      {        "itemScores": [{           "item": "i4",           "score": 0.45        },         {           "item": "i5",           "score": 0.50         }        ]      }

The Apex code to invoke the query API is as follows:

      public class SimilarProductRecommenderController {       @AuraEnabled       public static list<Product2> queryPredictionAPI         (String productId){ list<Product2> lstProducts ...

Get Learning Salesforce Einstein now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.