pub trait DecideBackend: Send + Sync {
// Required methods
fn decide(&self, request_json: &str) -> Result<String>;
fn calibrated(&self) -> bool;
fn describe(&self) -> String;
}Expand description
The seam: one wire request in, one wire response out.
Required Methods§
Sourcefn decide(&self, request_json: &str) -> Result<String>
fn decide(&self, request_json: &str) -> Result<String>
Answer one request. request_json is {"state": …, "questions": {id: question}} in the proposal’s wire shape; the returned text is the wire
response plus provenance (provider, model, calibrated,
latency_ms) and is validated by the caller.
Sourcefn calibrated(&self) -> bool
fn calibrated(&self) -> bool
Whether this backend’s probabilities are calibrated. Uncalibrated backends may reorder, never omit.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".