jevrs 0.1.1

Async Rust client for TypeSafe AI's Jev (System One) API
Documentation

jevrs

crates.io docs.rs CI MSRV License

jevrs is an async Rust client for TypeSafe AI's Jev (System One) API. It gives you typed question sets and answers, a runtime builder, configurable retries, and native or WASI transports over a portable sans-I/O core.

Set TYPESAFE_API_KEY, then:

use jevrs::{Choice, Client, Levels, Noul, Options, Questions, Score};

#[derive(Clone, Copy, Debug, Eq, Options, PartialEq)]
enum Department {
    /// Payments, invoicing, refunds
    Billing,
    /// Bugs, outages, integrations
    Technical,
    Sales,
}

#[derive(Clone, Copy, Debug, Eq, Levels, Ord, PartialEq, PartialOrd)]
enum Frustration {
    /// Calm
    Calm,
    /// Frustrated
    Frustrated,
    /// Very angry
    VeryAngry,
}

#[derive(Questions)]
struct Triage {
    #[jev(
        noul = "Does this convey urgency?",
        yes = "Explicitly time-sensitive",
        no = "No urgency expressed"
    )]
    is_urgent: Noul,
    #[jev(choice = "Which team should handle this?")]
    department: Choice<Department>,
    #[jev(score = "How frustrated is the customer?")]
    frustration: Score<Frustration>,
}

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::from_env()?;
    let triage = client
        .ask::<Triage>(&"Help! My payouts have been failing for 3 days.")
        .await?;

    println!("urgent: {:.0}%", triage.is_urgent.p.get() * 100.0);
    println!("department: {:?}", triage.department.pick);
    println!("frustration: {:.2}", triage.frustration.expected());
    Ok(())
}

Client::from_env reads TYPESAFE_API_KEY. To pass the key yourself or bring your own HTTP stack, see Getting a client.

Install with cargo add jevrs tokio --features tokio/macros,tokio/rt-multi-thread.

Read the API documentation, then choose the guide for getting a client, the typed path, dynamic path, transports, or retries and errors.

Examples: typed native, dynamic native, WASI HTTP 0.2, and WASI HTTP 0.3.

Comparison with other Jev crates

Several community crates wrap the same API; none is official. This table reflects each crate's documentation as of 2026-09-20.

Crate Typed answers Custom transport WASI Sync client
jevrs Options, Levels, and Questions derives, plus a runtime builder Transport trait over a sans-I/O core wasip2, wasip3 no
typesafe-sdk-client derive(Questions) no, reqwest no no
typesafe-client choice questions only, via choice_options! no, reqwest no no
typesafe-rs no, string builder no, reqwest no reqwest blocking
typesafe-ai no, JSON maps reqwest or ureq backends no yes, ureq
kunobi-jev no, string arrays no, reqwest no no

Licensed under either Apache-2.0 or MIT, at your option.