Variables
Variable substitution and defaults
Basic Variables
Variables inject dynamic content into your prompts at render time:
support-agent.echo
You are a customer support agent for {{company}}.
The customer's name is {{customer.name}} and they have a {{customer.tier}} membership.
Their issue is: {{issue.description}}Nested Access
Access nested object properties with dot notation or array indices:
nested.echo
You are helping {{user.profile.name}} who works at {{user.company.name}}.
Their recent orders:
- Most recent: {{orders[0].product}}
- Previous: {{orders[1].product}}Default Values
Use ?? to provide fallbacks when variables might be undefined:
defaults.echo
You are a support agent for {{company ?? "our company"}}.
Hello {{customer.name ?? "valued customer"}}! How can I help you today?Typed Variables
Specify variable types for validation. File types resolve to base64 data URLs:
typed.echo
Analyze the attached document: {{document:file}}
The customer has been with us for {{tenure:number}} years.
Premium status: {{isPremium:boolean}}