nunjucks-llm
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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

NPM Version NPM Downloads Linux Build Windows Build Test Codecov

Nunjucks is a full featured templating engine for javascript. It is heavily inspired by jinja2. View the docs here.

Installation

npm install nunjucks

To use the file watcher built-in to Nunjucks, Chokidar must be installed separately.

npm install nunjucks chokidar

(View the CHANGELOG)

Documentation

See here.

Browser Support

Supported in all modern browsers. For IE8 support, use es5-shim.

Tests

Run the tests with npm test.

Watch master branch's tests running in the browser.

Mailing List

Join our mailing list and get help with and issues you have: https://groups.google.com/forum/?fromgroups#!forum/nunjucks

Want to help?

Contributions are always welcome! Before you submit an issue or pull request, please read our contribution guidelines.

Contributors

Dependencies (3)

Dev Dependencies (30)

Package Sidebar

Install

npm i nunjucks-llm

Weekly Downloads

1

Version

0.0.4

License

BSD-2-Clause

Unpacked Size

1.8 MB

Total Files

35

Last publish

Collaborators

  • romannurik