Skip to Content
Judgment Labs
Prompts

Prompt

A versioned prompt template with variable substitution.

Prompts are stored and versioned on the Judgment platform. Use {{variable}} placeholders in the template, then call .compile() to substitute values at runtime. Each version gets a unique commit_id and can be tagged (e.g. "production", "staging").

prompt = client.prompts.get(name="system-prompt", tag="production")
text = prompt.compile(product="Acme Search", tone="friendly")
print(text)

Attributes

Prop

Type


compile()

Fill in template variables and return the final prompt string.

Raises

ValueError: If a required variable is not provided.

prompt = client.prompts.get(name="system-prompt", tag="production")
# Template: "You are a {{tone}} assistant for {{product}}."
text = prompt.compile(tone="helpful", product="Acme Search")
# "You are a helpful assistant for Acme Search."
def compile(**kwargs) -> str:

Parameters

Prop

Type

Returns

str - The prompt with all variables substituted.

On this page