Skip to content

Jev directory

TypeSafe Rs

A community Rust client for Jev's System One API whose environment variables, defaults, retries, identification headers, and error kinds match the official Python and TypeScript SDKs.
Stars
1
Language
Rust
License
MIT
Reading time
3 min
Published by
Community
Author
AbdelStark
Last verified
Sep 2026

About this project

Rust client for TypeSafe System One. Evaluate a state against named questions (noul, choice, score) and get one typed answer per question. This is a community SDK. It is not an official TypeSafe product. Env vars, defaults, retries, identification headers, and error kinds match the official Python SDK and @typesafe-ai/sdk. MSRV is 1.85 (edition 2024). TLS is rustls by default (native-tls is available). state can be a string, a JSON object, or an array. Keys you pick on the question map come back on answers.

Quoted from the project's README. Read the full README.

Highlights

  • MSRV is 1.85 (edition 2024), TLS is rustls by default with native-tls optional, and blocking and mock crates are available behind features.
  • Requests send X-TypeSafe-SDK, X-TypeSafe-Runtime, and a retry count header; API keys are redacted in Debug and errors omit the key and request body.
  • Default retries match the official SDKs: 2 retries, 500 ms initial backoff, a 5 s cap, 25% jitter, and retry-after-ms then Retry-After capped at 60 s.
  • RetryPolicy::conservative() retries only 408/429 and pre-send connection errors, because retrying 5xx on systemone can duplicate billable work.
  • Questions are built with the questions! macro using Question::noul, choice, and score builders, and state can be a string, JSON object, or array.

Quickstart

rust
use typesafe_rs::{questions, Client, Question};

#[tokio::main]
async fn main() -> Result<(), typesafe_rs::Error> {
    let client = Client::from_env()?;
    let response = client.system_one("My payouts have been failing.", questions! {
        "urgent" => Question::noul("Does this convey urgency?"),
        "team" => Question::choice("Which team?").option("billing", "Refunds"),
    }).await?;
    println!("{:?}", response.noul("urgent"));
    Ok(())
}

Watch out

Dual-licensed Apache-2.0 or MIT and not an official TypeSafe product. Needs Rust 1.85+, a TYPESAFE_API_KEY, and an async runtime; the default timeout is 10 seconds per attempt including the body.

Questions about this entry

Short answers drawn from the linked project or page.

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai