chipp 0.3.0

Rust client for the Chipp.ai API - OpenAI-compatible chat completions with streaming support
Documentation
//! Simple non-streaming chat example
//!
//! Run with:
//! ```bash
//! export CHIPP_API_KEY="your-api-key"
//! export CHIPP_APP_NAME_ID="your-app-name-id"
//! cargo run --example simple
//! ```

use chipp::{ChippClient, ChippConfig, ChippMessage, ChippSession, MessageRole};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Initialize tracing
    tracing_subscriber::fmt::init();

    // Get API credentials from environment
    let api_key =
        std::env::var("CHIPP_API_KEY").expect("CHIPP_API_KEY environment variable not set");
    let app_name_id =
        std::env::var("CHIPP_APP_NAME_ID").expect("CHIPP_APP_NAME_ID environment variable not set");

    // Create client configuration
    let config = ChippConfig {
        api_key,
        model: app_name_id,
        ..Default::default()
    };

    // Create client and session
    let client = ChippClient::new(config)?;
    let mut session = ChippSession::new();

    // Send a message
    let messages = vec![ChippMessage {
        role: MessageRole::User,
        content: "Hello! Can you tell me a short joke?".to_string(),
    }];

    println!("Sending message to Chipp API...");
    let response = client.chat(&mut session, &messages).await?;

    println!("\n✅ Response:");
    println!("{}", response);
    println!("\n📝 Session ID: {:?}", session.chat_session_id);

    Ok(())
}