Expand description
The HTTP client: one POST per question, everything failed mapped to a typed error, no retries - the caller decides what a failure means.
Re-exportsΒ§
use std::collections::BTreeMap;πuse std::time::Duration;πuse crate::config::SystemOneConfig;πuse crate::config::systemone_url;πuse crate::error::SystemOneError;πuse crate::wire::Answer;πuse crate::wire::AskOutcome;πuse crate::wire::Question;πuse crate::wire::Usage;πuse crate::wire::validate_answer;π
StructsΒ§
- Response
Envelope π - System
OneClient - Calls one System One endpoint with one configured model.
ConstantsΒ§
- ERROR_
BODY_ πLIMIT - How much of a provider error body the error text carries.
- QUESTION_
KEY π - The question name on the wire. The name is echoed back, never sent to the model, so one fixed key is enough.
- TAG π
- The width of the key piece a mask matches on: long enough that it is key material rather than a scheme, short enough to survive a truncation.
FunctionsΒ§
- bare_
word π - A word with the punctuation a key cannot hold trimmed off its ends, the
way a JSON body carries one (
"hunter2",reads as the key). - redact_
key π - Text with the credentialβs copies masked, before the body is cut - a key straddling the cut would otherwise survive as a fragment of itself. A text carrying no key material comes back untouched, its own formatting intact.
- transport_
or_ πtimeout - A request failure reads as a timeout wherever it struck - the send or the body read - so a stalled connection never surfaces as a decode error.
- truncate π
- A bounded prefix of a provider error body, cut on a char boundary.