Retrieve recommendations

Retrieves recommendations from selected AI models.

Usage

Required ACL: search
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import 'package:algolia_client_recommend/algolia_client_recommend.dart';

final client = RecommendClient(
    appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY');

final response = await client.getRecommendations(
  getRecommendationsParams: GetRecommendationsParams(
    requests: [
      RelatedQuery(
        indexName: "ALGOLIA_INDEX_NAME",
        objectID: "objectID",
        model: RelatedModel.fromJson("related-products"),
        threshold: 42.1,
      ),
    ],
  ),
);
Did you find this page helpful?