Output

Control how agent responses are displayed

Configure output format – silent, verbose, or JSON.

Diagram

Output Modes

🤖 Agent

Output

🔇 Silent

📢 Verbose

📋 JSON

Quick Start

  1. Verbose Output
    rust
    use praisonai::Agent;
    
    // Enable verbose output for debugging
    let agent = Agent::new()
        .name("Assistant")
        .instructions("You are a helpful assistant")
        .verbose(true)  // Show detailed output
        .build()?;
    
    let response = agent.chat("What's 2+2?").await?;
    println!("Response: {}", response);
  2. Silent Mode
    rust
    use praisonai::Agent;
    
    // Disable verbose output for production
    let agent = Agent::new()
        .name("Assistant")
        .verbose(false)  // Minimal output
        .build()?;
    
    // Only final result is shown
    let response = agent.chat("Analyze this data").await?;
  3. Streaming Output
    rust
    use praisonai::Agent;
    
    // Enable streaming for real-time output
    let agent = Agent::new()
        .name("Assistant")
        .stream(true)  // Stream responses as they arrive
        .build()?;
    
    let response = agent.chat("Write a story").await?;

Choosing Output Mode

Diagram

Choose Mode

Debugging

Production

API/Logs

Need?

verbose

silent

json

ModeBest For
verboseDevelopment, debugging
silentProduction, minimal noise
jsonAPIs, logging, parsing

Configuration

OptionTypeDefaultDescription
modeStringverboseOutput mode
fileStringNoneSave output to file

Related