Skip to main content
Prompts are the instructions that guide agent behavior.

Quick Start

1

Basic Prompt

use praisonai::Agent;

let agent = Agent::new()
    .name("Assistant")
    .instructions("You are a helpful assistant. Be concise and accurate.")
    .build()?;
2

Prompt Template

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

ComponentDescription
SystemCore behavior instructions
ContextBackground information
ExamplesFew-shot examples
ConstraintsRules and limitations