terraphim_multi_agent 1.0.0

Multi-agent system for Terraphim built on roles with rust-genai integration
Documentation
//! Basic Agent Usage Example
//!
//! This is the simplest possible test to verify GenAI HTTP client-Ollama integration works

use terraphim_multi_agent::{GenAiLlmClient, LlmMessage, LlmRequest};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    println!("๐Ÿงช Basic Agent Usage Example - GenAI HTTP Client");
    println!("=================================================");

    // Create GenAI LLM client for Ollama
    let client = GenAiLlmClient::new_ollama(Some("gemma3:270m".to_string()))?;

    println!("โœ… Created GenAI Ollama client");
    println!("   Model: {}", client.model());
    println!("   Provider: {}", client.provider());

    // Simple test prompt
    let prompt = "What is 2+2?";
    println!("๐Ÿค– Asking: '{}'", prompt);

    // Create request
    let messages = vec![
        LlmMessage::system(
            "You are a helpful assistant that gives concise, accurate answers.".to_string(),
        ),
        LlmMessage::user(prompt.to_string()),
    ];
    let request = LlmRequest::new(messages);

    // Make LLM call
    match client.generate(request).await {
        Ok(response) => {
            println!("โœ… Response: {}", response.content);
            println!("   Model: {}", response.model);
            println!("   Duration: {}ms", response.duration_ms);
            println!(
                "   Tokens: {} in / {} out",
                response.usage.input_tokens, response.usage.output_tokens
            );
            println!("๐ŸŽ‰ Basic agent usage successful!");
        }
        Err(e) => {
            println!("โŒ Error: {:?}", e);
            println!("๐Ÿ’ก Make sure Ollama is running: ollama serve");
            println!("๐Ÿ’ก Make sure gemma3:270m model is installed: ollama pull gemma3:270m");
            return Err(e.into());
        }
    }

    Ok(())
}