- How you use it
- A setting in your project
- What it can do
- installs software · writes files · network · runs shell
- What's inside
The option
| Option | AConfig · v1.1.3Dotprompt local template rendering |
|---|---|
| How you use it | A setting in your project |
| What it can do | installs software · writes files · network · runs shell |
| What's inside |
What this thread does
Do first: render a small prompt locally with the two checks below.
What it is
Dotprompt is a prompt template format with a TypeScript/JavaScript reference library.
Use it when
Use it to keep model configuration and input/output schemas in YAML frontmatter, or to build messages with Handlebars helpers.
Not for
For model generation, pair the templates with a model client such as Genkit.
Install
In an empty project directory with Node.js and npm available, run:
1. npm init -y 2. npm install --save-exact dotprompt@1.1.3
Registry record for the pinned version: npm registry dotprompt 1.1.3.
Check
The first check asserts parsed model metadata; the second asserts substituted message text.
node -e "require('node:assert/strict').equal(new (require('dotprompt').Dotprompt)().parse('---\nmodel: example\n---\nHello').model, 'example')"
node -e "new (require('dotprompt').Dotprompt)().render('Hello, {{name}}!', {input:{name:'World'}}).then(r=>require('node:assert/strict').equal(r.messages[0].content[0].text,'Hello, World!'))"
Limits
The TypeScript README does not specify a minimum Node.js version or performance measurements.
The monorepo release tag dotpromptz-1.0.1 contains JavaScript package version 1.1.3.
Sources
Started from a post by @google, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.