Skip to main content
Install the Rust SDK as a library or the CLI for command-line usage.

Quick Start

1

Prerequisites

# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
2

Add to Project

cargo add praisonai
3

Set API Key

export OPENAI_API_KEY="your-api-key"

Installation Methods

Add to your Cargo.toml:
[dependencies]
praisonai = "0.1"
tokio = { version = "1", features = ["full"] }
anyhow = "1"
Or use cargo:
cargo add praisonai tokio anyhow

Environment Variables

VariableRequiredDescription
OPENAI_API_KEYYesOpenAI API authentication
PRAISONAI_MODELNoDefault model (gpt-4o-mini)
RUST_LOGNoEnable debug logging

Verify Installation

use praisonai::Agent;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let agent = Agent::simple("Say hello")?;
    let response = agent.chat("Hi!").await?;
    println!("{}", response);
    Ok(())
}
Run with:
cargo run

Crates

CratePurpose
praisonaiCore library with Agent, Tools, Workflows
praisonai-deriveProcedural macros (#[tool])
praisonai-cliCommand-line interface