menta 0.0.1

Minimal Rust library for non-UI LLM and AI primitives
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use menta::{stream_text, GenerateTextRequest, StreamEvent};

fn main() {
    for event in stream_text(
        GenerateTextRequest::new()
            .model("openai/gpt-4.1-mini")
            .prompt("hello"),
    )
    .expect("stream_text failed")
    {
        match event {
            StreamEvent::TextDelta(text) => println!("text: {text}"),
            StreamEvent::Finish { reason, .. } => println!("finish: {:?}", reason),
            _ => {}
        }
    }
}