use anyhow::Result;
use rag_module::RagModule;

#[tokio::main]
async fn main() -> Result<()> {
    // Initialize RAG module
    let mut rag_module = RagModule::new("./example-enhanced-chat-data").await?;
    rag_module.initialize().await?;

    // Test context ID - replace with your actual context_id
    let context_id = "test2"; // You can change this to any valid context_id

    // Get chat history as JSON
    match rag_module.get_chat_history_json(context_id).await {
        Ok(chat_history) => {
            // Print clean JSON output
            println!("{}", serde_json::to_string_pretty(&chat_history)?);
        }
        Err(e) => {
            eprintln!("Error: {}", e);
        }
    }

    Ok(())
}
