Prompts
Manage and optimize agent prompts
Prompts are the instructions that guide agent behavior.
Quick Start
- Basic Prompt
rust use praisonai::Agent; let agent = Agent::new() .name("Assistant") .instructions("You are a helpful assistant. Be concise and accurate.") .build()?; - Prompt Template
rust use praisonai::{Agent, Prompt}; let prompt = Prompt::template(r#" You are a {role} assistant. Your expertise is in {domain}. Always respond in {language}. "#) .var("role", "technical") .var("domain", "AI") .var("language", "English"); let agent = Agent::new() .instructions(prompt) .build()?;
Prompt Components
| Component | Description |
|---|---|
| System | Core behavior instructions |
| Context | Background information |
| Examples | Few-shot examples |
| Constraints | Rules and limitations |