Overview
Oration enables dynamic content in agent prompts and conversations. Create personalized, context-aware interactions by injecting variables, applying filters, and using conditional logic directly in your agent prompts. Use double curly braces{{ }} for variables and {% %} for logic tags to create data-driven prompts that adapt to each conversation.
Key Benefits
- Dynamic Personalization: Insert customer names, account details, and contextual information
- Conditional Logic: Show different content based on customer data or conversation state
- Data Formatting: Apply filters to format dates, numbers, and text automatically
- Reusable Templates: Create flexible prompts that work across different scenarios
Using Dynamic Variables in Conversations
Basic Variable Injection
Inject dynamic variables into your agent prompts:Conditional Content
Use conditional logic to personalize responses based on customer data:Working with Nested Variables
Oration supports complex nested data structures in variables. You can access nested properties using dot notation and work with arrays and objects seamlessly.Accessing Nested Properties
Working with Objects
Working with Arrays
Complex Nested Structures
Safe Navigation
Use conditional checks to avoid errors when nested properties might not exist:Default Variables
Oration provides several built-in system variables that are always available in your prompts:System Variables
| Variable | Description | Example |
|---|---|---|
language | Current conversation language | "en-US" |
currentTime | Full current date and time | "Monday, August 27, 2024 at 12:25:37 PM IST" |
currentDate | Current date only | "Monday, August 27, 2024" |
Usage Examples
Custom Dynamic Variables
Define custom variables that are evaluated at runtime:Data Formatting Filters
Filters transform variable output using the pipe| operator. Most useful filters for agent prompts:
Text Formatting
Date and Time Formatting
Number Formatting
Conditional and Logic Filters
Advanced Filter Combinations
Essential Liquid JS Keywords & Syntax
Understanding these key Liquid JS keywords will help you create more powerful and flexible agent prompts. These are the most commonly used control structures and operators.Control Flow Keywords
Conditionals
Loops and Iteration
Variable Assignment and Manipulation
Comparison and Logic Operators
Special Keywords and Properties
Flow Control Keywords
Comments and Documentation
Advanced Keywords
Best Practices with Keywords
Best Practices
Always Provide Fallbacks
Use Meaningful Variable Names
Format Data Consistently
Keep Logic Simple
Common Use Cases
Customer Service Agent
Sales Agent
Appointment Scheduling
Technical Reference
Oration’s dynamic templating is powered by LiquidJS, a robust templating engine that provides the syntax and filters described in this guide. For advanced use cases and additional filters not covered here, you can refer to the LiquidJS documentation for complete technical details and extended functionality.Need more help? Reach out to our team at [email protected]