Skip to main content

Crate basal_client

Crate basal_client 

Source
Expand description

Async HTTP client for the native Basal endpoint (POST /v1/basal).

Reuse a Client to share its connection pool. The server validates requests and computes decisions; this crate preserves native probabilities and confidence. No GPU runtime or automatic retries are needed. See examples/decide.rs for usage. Dropping an in-flight future cancels the client-side request.

Structs§

ActAnswer
Checked act answer.
ActKind
Result marker for Act questions.
ActOptions
Act options. Omitted criteria use true/false outcomes.
Answer
Native answer. Fields used by other question types are absent. Unknown fields are retained in extra.
ChoiceAnswer
Checked choice answer.
ChoiceKind
Result marker for Choice questions.
ChoiceOptions
Choice display options.
Client
Cloneable, pooled HTTP/1 client with verified TLS. No redirects, automatic retries or environment proxies. DNS hostnames must be ASCII (use punycode for IDN). A Tokio runtime is required for requests.
ClientOptions
Connection configuration. The API key is intentionally not printable through Debug.
DecisionOptions
Decision routing/preprocessing options.
DecisionRequest
Native inference request. A missing model uses the server’s default; basal-rs accepts a model name.
DecisionResponse
Native inference result keyed by question ID.
EvidenceOptions
Supporting spans for noul and score.
EvidenceSpan
Supporting span in the original state.
ModelMetadata
Model metadata. The exact name is accepted by basal-rs as a request’s model.
ModelsResponse
Model discovery result.
MultiAnswer
Checked multi answer.
MultiKind
Result marker for Multi questions.
MultiOptions
Multi options intentionally have no evidence field.
NoulAnswer
Checked yes/no answer.
NoulKind
Result marker for Noul questions.
Question
Native question. Criteria and cost matrices are JSON objects or arrays; preserve their order. Additional native fields (including future extensions) go in extra.
QuestionSpec
Immutable typed question snapshot. Clone shares its identity and data.
Questions
Ordered heterogeneous request builder retaining typed question identities.
ScoreAnswer
Checked score answer.
ScoreKind
Result marker for Score questions.
TypedDecisionResponse
Validated native response retaining its request’s typed schema/identities.
Usage
Server-reported usage, with native extension fields retained.

Enums§

Error
Typed SDK failures. Display and Debug omit response bodies and transport details.
FactsMode
Native facts preprocessing mode.
OptionKeys
Display named criterion keys.
QuestionType
A native question type.

Traits§

AnswerKind
Closed association between a question and its required result fields.

Functions§

act
Act over true/false outcomes with default options.
act_with_options
Select an action from a full cost matrix. Omitted criteria use true/false outcomes.
choice
Choose from 2–10 options with default display settings.
choice_with_options
Choose one of 2–10 ordered named options.
multi
Multi selection with default threshold and no count limits.
multi_with_options
Select labels independently; options have no evidence.
noul
Yes/no probability with default options.
noul_with_options
Read a yes/no probability.
score
Score over ordered levels with default options.
score_with_options
Score over 2–10 ordered text levels.

Type Aliases§

ActQuestion
A typed act question.
ChoiceQuestion
A typed choice question.
CostMatrix
Explicit action/outcome cost matrix.
MultiQuestion
A typed multi question.
NoulQuestion
A typed yes/no question.
ScoreQuestion
A typed score question.