cliai 0.2.0

A small Rust library for invoking AI tools through CLI backends like Ollama and GitHub Copilot CLI.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use cliai::{AiBackend, GenerateRequest, Ollama};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let ai = Ollama::default();

    let response = ai.generate(
        &GenerateRequest::new("Summarize Rust ownership in one paragraph.")
            .with_instructions("Be concise."),
    )?;

    println!("{}", response.text);
    Ok(())
}