langgoap.ResourceUsage#
- class ResourceUsage(key, total, constraint_min=None, constraint_max=None, satisfied=True, level='info')[source]#
Per-key resource breakdown for a plan.
- Parameters:
key (str)
total (float)
constraint_min (float | None)
constraint_max (float | None)
satisfied (bool)
level (Literal['hard', 'soft', 'info'])
- key#
Resource identifier (e.g.
"tokens","cost_usd").- Type:
str
- total#
Total consumption across all actions.
- Type:
float
- constraint_min#
Lower bound from the constraint, or
None.- Type:
float | None
- constraint_max#
Upper bound from the constraint, or
None.- Type:
float | None
- satisfied#
Whether the total falls within the constraint bounds.
- Type:
bool
- level#
Constraint level.
"hard"— the usage corresponds to aConstraintSpecwithlevel="hard". Violation marks the planCSPStatus.INFEASIBLE."soft"— the usage corresponds to a soft constraint. Violation contributes to the plan’s soft score."info"(default) — informational only; the resource key has no matchingConstraintSpec. Violation is impossible because there is no bound to violate.
- Type:
Literal[‘hard’, ‘soft’, ‘info’]
- __init__(key, total, constraint_min=None, constraint_max=None, satisfied=True, level='info')#
- Parameters:
key (str)
total (float)
constraint_min (float | None)
constraint_max (float | None)
satisfied (bool)
level (Literal['hard', 'soft', 'info'])
- Return type:
None
Methods
__init__(key, total[, constraint_min, ...])Attributes