AI prompts: reusable templates with variables
Describes AI 0.29.1.
A prompt is a saved text you send to an AI model again and again, with blanks filled in each time. Write {{Language}} in it, and the value for Language is put in when the prompt is used.
Where to find it
In the admin sidebar, open AI, then Prompts (/admin/ai/prompts). You need the AI permission, and the AI module must be switched on under Modules.
Prompts: reusable instructions with variables.
The prompt list
The table shows each prompt’s Name with its slug under it, Status (Active or Disabled), the number of Variables, Uses, Last Used and Created. Sort by clicking a column header; in card view a sort selector offers Order, Name, Usage, Last Used and Created. A disabled prompt is shown faded.
The menu at the end of each row holds:
- Edit: open the prompt.
- Disable / Enable: a disabled prompt can’t be used for AI calls and doesn’t appear in the Playground.
- Delete: asks Are you sure you want to delete this prompt? and removes it.
With no prompts yet, the page says No Prompts Yet and offers Create First Prompt.
Writing a prompt
New Prompt opens the form.
A new prompt.
- Name (required).
- Slug: made from the name and can’t be edited. It changes when the name does.
- Description (Optional).
- System Prompt (Optional): sent as the system message before the prompt itself. It can hold variables too.
- Content (required): the prompt text.
- Enabled.
As you type, Detected Variables lists the variables found in Content. Variables used only in the system prompt aren’t listed there while you type, but they are counted once the prompt is saved. Create Prompt or Update Prompt saves it.
Variable rules
The Variable Syntax box under the form sums them up:
- Wrap a name in double curly braces:
{{Language}}. - Use letters, numbers and underscores only.
{{UserLanguage}}and{{user_language}}both work;{{User Language}}is not a variable. - A variable that isn’t given a value when the prompt is used stays in the text as it is, braces included.
Using a prompt
In the Playground, pick the prompt under Prompt (Optional): a field appears for each variable in the content (not for one used only in the system prompt), and the template can be edited for that one try without changing the saved prompt. A successful try there counts as a use. Other modules and the site’s own code can use prompts too.
What it doesn’t do
- Prompts aren’t tied to an endpoint or model; the caller chooses the endpoint each time.
- There is no drag-and-drop ordering on this page, although a sort option is called Order.
- Nothing checks that every variable got a value: a missing one is sent as
{{Name}}.