Skip to main content
All Python modules · Import and compatibility guidance

Provider contract

Provider capabilities

Request and result validation

Policy rules

Exports

Choice

Choose one key from an unordered map of labels and descriptions.
Fields (— means no declared default):

ChoicePolicy

Map every allowed choice to an outcome, optionally requiring confidence.
Fields (— means no declared default):

ChoicePolicy.validate

Reject incomplete routes and unsupported confidence requirements at binding.

ChoicePolicy.apply

Apply authored branches without interpreting confidence as accuracy.

ChoiceResult

A selected option with optional native distribution and confidence.
Fields (— means no declared default):

DecisionAction

Authored control-flow signals; none grants permission to execute a tool.

DecisionAnswer

DecisionBinding

Bind a reusable definition to a provider name and optional pure policy.
Fields (— means no declared default):

DecisionCapabilities

Provider guarantees checked before evaluation, without guessing calibration.
Fields (— means no declared default):

DecisionContext

A revocable decision facade bound to the invocation that obtained it.

DecisionContext.evaluate

Evaluate within the owning scope and record only explicitly public results.

DecisionDefinition

A versioned set of independent questions, separate from provider selection.
Fields (— means no declared default):

DecisionError

A decision could not be evaluated without violating its contract.

DecisionEvaluation

Validated results or an explicit failure outcome, with provider provenance.
Fields (— means no declared default):

DecisionOutcome

A policy action and, for routing, an authored destination identity.
Fields (— means no declared default):

DecisionProvider

Implement in application code or an extension; lifecycle owns the client.
Fields (— means no declared default):

DecisionProvider.evaluate

Evaluate independent questions without executing the selected action.

DecisionProviderError

A provider failed; its private exception is intentionally not exposed.

DecisionQuestion

DecisionRequest

A definition and isolated state snapshot sent to one provider evaluation.
Fields (— means no declared default):

DecisionResponse

Typed answers keyed by the exact question identities in the request.
Fields (— means no declared default):

DecisionTimeoutError

A decision exceeded its configured evaluation deadline.

DecisionValidationError

A provider response did not match the declared decision contract.

Decisions

Register providers and named decisions; lifecycle resources own client cleanup.

Decisions.evaluate

Evaluate an isolated snapshot once; failures never trigger implicit retries.

Decisions.evaluate_definition

Evaluate a runtime-built definition without mutating registered decisions.

FixtureDecisionProvider

Return fixtures keyed by (decision name, version), without retaining private state.

FixtureDecisionProvider.evaluate

Select a deterministic fixture; missing revisions are errors, never live calls.

Predicate

Judge a proposition by returning the probability that it is true.
Fields (— means no declared default):

PredicateResult

The probability of true; this is not a generic confidence score.
Fields (— means no declared default):

QuestionKind

Portable question shapes a decision provider can explicitly support.

Score

Judge a rubric on the numeric scale 0 through len(levels) minus one.
Fields (— means no declared default):

ScoreResult

A rubric position with optional probabilities in the declared level order.
Fields (— means no declared default):

ThresholdPolicy

Use inclusive lower/upper boundaries and an explicit middle uncertainty band.
Fields (— means no declared default):

ThresholdPolicy.validate

Check thresholds against the actual probability or rubric scale.

ThresholdPolicy.apply

Return a signal on the question’s native scale without running effects.