Installation
The Algolia Guides API Client package is available on the npm registry.Usage
Guide headlines
ThegetHeadlines method lets you retrieve different guides for your app.
JavaScript
getOrGenerateHeadlines method by passing a source parameter.
For this method you must use an API key with the search and addObject ACLs.
Only use this method on your backend or if you provide a layer of authentication.
JavaScript
Parameters
The category used for retrieving the headlines.
The number of headlines to display (between 1 and 1000).
The source of the headlines.
The tone used by the model.
The language code used for generating headlines.
The customized instructions that the model should take into account for generating content,
for example, to refine the focus of the article, add constraints, or adjust to a target audience.
A list of keywords that the model should highlight in the generated content.
Whether to only return headlines with generated content.
Guide content
ThegetContent method lets you retrieve the content of a guide.
JavaScript
getOrGenerateContent method by passing a source parameter.
For this method you must use an API key with the search and addObject ACLs.
Only use this method on your backend implementation or if you provide a layer of authentication.
JavaScript
Parameters
The ID of the guide to retrieve.
The source of the guide content.
If
source is generated: the type of guide to generate.The tone used by the model.
The language code used for generating headlines.
The customised instructions that the model should take into account for generating content,
for example, to refine the focus of the article, add constraints, or adjust to a target audience.
A list of keywords that the model should highlight in the generated content.
Whether to only return headlines with generated content.
Gather feedback
Thevote method lets you gather feedback for the guide’s headlines or content.
This feature uses the Insights API to gather events related to Guides feedback.
This requires a a user token.
JavaScript
Parameters
List of object IDs for which to gather feedback.
The user token for computing feedback.
The feedback type:
upvote or downvote.The feedback target.