Skip to main content

Crate cerno_sdk

Crate cerno_sdk 

Source
Expand description

Rust client for the cerno service.

use cerno_sdk::Client;

let client = Client::new("http://localhost:3000")?;
let answers = client
    .systemone("Ticket: server room at 31C, rising.")
    .noul("urgent", "Is this urgent?")
    .choice("team", "Which team?", ["IT", "Facility", "HR"])
    .score("sev", "How severe?", 5)
    .send()
    .await?;

assert!(answers.noul("urgent")? > 0.8);
assert_eq!(answers.choice("team")?, "Facility");

The wire types come from cerno-types, the same crate the server serialises from, so the client cannot drift from the service it talks to.

The same client exists for Python and TypeScript, written by hand against the same OpenAPI document and tested against the same conformance cases, so all three build identical requests.

Structs§

Answers
The answers to one request, with accessors that fail loudly on the wrong id or type.
Calibration
Temperature scaling applied to label logits before the softmax.
Client
ErrorResponse
Levels
A score rubric: either a plain count or the text of each level.
ModelInfo
ModelsResponse
SystemOne
A request under construction.
SystemOneRequest
A shared state plus the questions to ask about it.
SystemOneResponse

Enums§

Answer
A typed answer.
Error
ErrorCode
Machine-readable failure reasons. Callers branch on these, not on message.