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

#[tokio::main]
async fn main() -> Result<()> {
    println!("Testing get_all_contexts_for_user function\n");

    // Initialize RAG module
    let mut rag_module = RagModule::new("./example-enhanced-chat-data").await?;
    rag_module.initialize().await?;

    // Test user ID
    let user_id = "cudewvsbxakj1n";

    // Get all contexts for the user
    println!("Fetching all contexts for user: {}", user_id);
    let contexts = rag_module.get_all_contexts_for_user(user_id).await?;

    // Display results

    // Pretty print as JSON
    println!("\nJSON Output:");
    println!("{}", serde_json::to_string_pretty(&contexts)?);

    Ok(())
}
