Skip to main content

Module client

Module client 

Source
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Β§

ResponseEnvelope πŸ”’
SystemOneClient
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.