Suggestions Prompt
Highlight uses a Handlebars template to generate actionable suggestions in a floating window UI, guiding users to explore app features directly.
Your Highlight app should expose a suggestions prompt, a Handlebars template that will offer the user suggestions about what your app can accomplish in Highlight. This Handlebars template should include a system and user message which will be used to generate a JSON array of suggestions.
Implementation
Expose an HTTP GET endpoint through your web app that will return raw text. This text should be a Handlebars template that uses our custom {{#system}}
and {{#user}}
Handlebars helpers. These helpers define which messages are system messages and which are user messages.
Generally, you should use the system message for instructions and the user message for context. When executed through an LLM, your template should always return a JSON array of suggestions. Highlight developers have found using this language towards the end of your prompt will yield the best results:
Tell Highlight where your endpoint can be located by adding the endpoint to the Developers Portal.
Testing
You’ll want to extensively test your suggestions prompt to ensure it’s working as expected. Follow our Developing Locally guide for more information, instead of using the URL specified through the Developers Portal, Highlight will listen for your suggestions prompt at http://localhost:3000/suggestions.hbs
.
Example
For example, your app may offer a list of suggestions like:
- For a code debugger app: Help me debug this problem
- For a dating app: Generate dating advice based on your open conversation
- For a travel advisor: Show me places I may want to visit
These suggestions will be shown through the Highlight floating window UI. When the user “activates” a suggestion by pressing it, they will be taken to your app. The suggestion line item will be sent through an event. See the App Runtime Guide for further information.
Here’s what your suggestion template could look like:
The Handlebars prompt file will be injected with the HighlightContext
type defined in the App Runtime package.
Production Example
Our demo app hosts a suggestions prompt at https://highlight-demo-app.vercel.app/suggestions.hbs.