Documentation
¶
Overview ¶
Package contextbudget states and checks a budget for one model call's context. Limits holds a byte cap and an event-count cap; it does no I/O and keeps no state beyond the two caps.
Map: contextbudget.go = Limits, Validate, Fits. Rationale: ../docs/plans/contextbudget.md. Contribution rules: ../AGENTS.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limits ¶
Limits caps one model call's context by byte count and event count. A zero MaxBytes means no byte cap; a zero MaxEvents means no event-count cap. Both zero means the budget is uncapped.
func (Limits) Fits ¶
Fits reports whether bytes and events both stay at or under their respective caps. A zero cap always reports fit for its own dimension. Fits takes the candidate totals the caller already has; it keeps no running total of its own. Fits does not call Validate; a caller that skips Validate and passes a negative cap gets whatever comparison bytes <= cap produces for that cap.