Hard limits and soft preferences attached to one inference request.
Constraint merging is monotonic: a handler may strengthen a flow constraint, but cannot widen privacy, cost, latency, or minimum-capability limits.
Summary
Functions
Builds constraints from flow contributions followed by call-site options.
Merges a stronger layer into an existing constraint set.
Types
@type t() :: %Spectre.Inference.Constraints{ context_tokens: non_neg_integer() | nil, max_attempts: pos_integer() | nil, maximum_cost_tier: :low | :medium | :high | nil, maximum_latency_ms: pos_integer() | nil, maximum_output_tokens: pos_integer() | nil, minimum_level: term(), preferred_level: term(), privacy: :cloud_allowed | :private_cloud_only | :local_only | atom(), risk: :low | :medium | :high | atom(), strict?: boolean(), structured_output?: boolean() }
Functions
@spec from_options( keyword(), [Spectre.Flow.Constraint.t()] ) :: t()
Builds constraints from flow contributions followed by call-site options.
Merges a stronger layer into an existing constraint set.