Create a prompt
Create and commit a named prompt template in the Judgment platform.
Create a prompt when application text should be managed independently from an application release. At the end of this guide, the prompt has one committed version that you can retrieve from code.
Prerequisites
- A Judgment project where you can edit prompts
- A unique prompt name within that project
- The template text and any runtime values it needs
Create the first commit
Name the prompt
Open your project, select Prompts, then select New Prompt. Enter a
stable name such as support-system-prompt and select Next.
The name identifies the prompt in the UI and SDK. The prompt does not exist as saved content until you create its first commit.
Write the template
In the Prompt editor, enter:
You are a {{tone}} support assistant for {{product}}.
Answer the customer's question using only the supplied context.Judgment recognizes text between double braces as a variable. Confirm that
tone and product appear in the Variables section.
Add an optional tag
Select Add Tags, enter staging, then select Done in the tag
dialog. Tags make a version easy to select from code. You can also add or
move tags after committing.
Commit the prompt
Select Commit. Judgment stores the full template as the first immutable commit and opens the prompt detail page.
Troubleshooting
- If Commit is disabled, enter non-empty prompt text and make sure the editor contains a change.
- If the name is already in use, return to the Prompts list and choose another name. A new version of an existing prompt is created from its detail page.
- If a variable is missing from the Variables section, use the exact
{{variable_name}}form and do not leave the name empty.
Next step
Version the prompt, or retrieve and compile it in code.
Verify the prompt
The prompt is saved when its detail page shows the prompt name, a Commits
sidebar with one commit, the exact template text in read-only mode, and the
tone and product variables. If you added staging, confirm that its badge
appears on that commit.