nunjucks-llm
is a fork of Nunjucks that makes it easier to use for LLM prompt hydration and interleaving
Currently forked from Nunjucks version: 3.2.4
Changes:
- A bunch of
async/await
is now built into the compiler, so expressions that return promises are handled natively. - Functions passed as template params can call
this.getBuffer()
to get the current buffer, which is useful for passing as the prefix to LLMs for completion. For example:let template = ` Color: Blue Bird: {{ llm() }} `; async function llm() { let prefix = this.getBuffer(); return await actuallyCallAnLLM(prefix); }
Original README below.
Nunjucks is a full featured templating engine for javascript. It is heavily inspired by jinja2. View the docs here.
npm install nunjucks
To use the file watcher built-in to Nunjucks, Chokidar must be installed separately.
npm install nunjucks chokidar
(View the CHANGELOG)
See here.
Supported in all modern browsers. For IE8 support, use es5-shim.
Run the tests with npm test
.
Watch master
branch's tests running in the browser.
Join our mailing list and get help with and issues you have: https://groups.google.com/forum/?fromgroups#!forum/nunjucks
Contributions are always welcome! Before you submit an issue or pull request, please read our contribution guidelines.