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. - Choice
Answer - Checked choice answer.
- Choice
Kind - Result marker for Choice questions.
- Choice
Options - 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.
- Client
Options - Connection configuration. The API key is intentionally not printable through
Debug. - Decision
Options - Decision routing/preprocessing options.
- Decision
Request - Native inference request. A missing model uses the server’s default; basal-rs accepts a model name.
- Decision
Response - Native inference result keyed by question ID.
- Evidence
Options - Supporting spans for noul and score.
- Evidence
Span - Supporting span in the original state.
- Model
Metadata - Model metadata. The exact
nameis accepted by basal-rs as a request’s model. - Models
Response - Model discovery result.
- Multi
Answer - Checked multi answer.
- Multi
Kind - Result marker for Multi questions.
- Multi
Options - Multi options intentionally have no evidence field.
- Noul
Answer - Checked yes/no answer.
- Noul
Kind - 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. - Question
Spec - Immutable typed question snapshot. Clone shares its identity and data.
- Questions
- Ordered heterogeneous request builder retaining typed question identities.
- Score
Answer - Checked score answer.
- Score
Kind - Result marker for Score questions.
- Typed
Decision Response - 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.
- Facts
Mode - Native facts preprocessing mode.
- Option
Keys - Display named criterion keys.
- Question
Type - A native question type.
Traits§
- Answer
Kind - 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.
- Choice
Question - A typed choice question.
- Cost
Matrix - Explicit action/outcome cost matrix.
- Multi
Question - A typed multi question.
- Noul
Question - A typed yes/no question.
- Score
Question - A typed score question.