Skip to main content

typesafeai_sdk/
lib.rs

1//! # TypeSafe AI Rust SDK
2//!
3//! Rust SDK for [TypeSafe AI](https://typesafe.ai) — typed judgments from
4//! System One models like Jev.
5//!
6//! See the [Quickstart](#quickstart) below or the full
7//! [primitives documentation](#primitives) in the README.
8//!
9//! ## Primitives
10//!
11//! - [`noul`] — yes/no question → probability in `[0, 1]`
12//! - [`choice`] — multiple-choice → label, probabilities, confidence
13//! - [`score`] — rubric-based → numeric score, legend, probabilities, confidence
14
15#![forbid(unsafe_code)]
16#![warn(missing_docs, missing_debug_implementations)]
17// Include README.md as a doctest so code samples in the README are verified
18// by `cargo test --doc`.
19#![doc = include_str!("../README.md")]
20
21mod client;
22mod error;
23mod questions;
24mod retry;
25mod types;
26
27#[cfg(feature = "blocking")]
28pub mod blocking;
29
30pub use client::{ClientConfig, SystemOneOpts, TypeSafeClient};
31pub use error::{ErrorKind, Result, TypeSafeError};
32pub use questions::{
33    choice, noul, score, Choice, Description, Noul, NoulCriteria, Question, Score,
34};
35pub use retry::RetryPolicy;
36pub use types::{
37    Answer, ChoiceAnswer, ListModelsResponse, ModelCard, NoulAnswer, ScoreAnswer,
38    SystemOneResponse, Usage,
39};
40
41#[cfg(feature = "blocking")]
42pub use blocking::BlockingClient;