Template
Template engine for LLM prompting
Powered by minijinja, with preserve_order, json and pycompat enabled.
Also, there are a few built-in filters and functions implemented that are specific to Hyprnote.
Notes
Template must be registered before rendering.
ts
await commands.registerTemplate("<TEMPLATE_NAME>", "<TEMPLATE_CONTENT>");
const rendered = await commands.render("<TEMPLATE_NAME>", { a: 1 });
For templates included in extensions, init
function is perfect place to register them.
ts
export default {
id: "@hypr/extension-template",
init: async () => {},
widgetGroups: [],
} satisfies Extension;
Templates included in plugins are automatically registered on app initialization though register_template
provided by TemplatePluginExt
.
Commands
ts
import { commands } from "@hypr/plugin-template";