Prompts#
A prompt is a project item with typed variables and a version history, not a string buried in a script.
Writing one#
A prompt has a system message, a template, and variables written as {{name}}:
System: You are a careful summariser.
Template: Summarise the following in {{sentences}} sentences, in {{style}} style.
{{text}}
Press + add … from the template and every placeholder becomes a declared variable. Each one has a type:
| Type | Accepts |
|---|---|
string |
anything |
int / float |
numbers; a non-number is an error, not a silent zero |
bool |
true, 'true', 1, '1' |
enum |
one of the listed options |
list |
an array, a JSON array, or a comma-separated string |
json |
parsed JSON |
Give a variable a default and it becomes optional; mark it not required and it may stay empty.
Versions#
A new version is created only when the content changes — the system message, the template, the variables or the model settings. Renaming the prompt, editing its description or adding a tag does not create one.
History lists every version. Click one to see a line diff against your current draft, and Restore to bring it back into the draft.
This is what makes an experiment reproducible: it pins a version number, and that version cannot drift.
The playground#
Fill in the variables — enums get a dropdown, booleans a toggle, everything else a text box — and press Render to see exactly what would be sent, or Run to send it.
Two behaviours worth knowing:
- An empty value is treated exactly like a missing one: the default applies, and if there is no default the prompt reports it as missing and refuses to run.
- An unknown placeholder is left visible in the rendered text rather than blanked, so a
typo like
{{txt}}is obvious immediately.
From a script#
local text = prompts.run("summarize", { text = pageText, sentences = 3, style = "plain" })
local rendered = prompts.render("summarize", { text = pageText })
print(rendered.user)
print(table.concat(rendered.missing, ", "))
Next#
Run a prompt across a dataset and several models with an experiment.