cayu.budgets.run_limits
Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.
copy_run_limits
Section titled “copy_run_limits”from cayu import copy_run_limitscopy_run_limits(limits: RunLimits | None) -> RunLimitsRelease source · Runtime guarantees · Capability guides
has_run_limits
Section titled “has_run_limits”from cayu import has_run_limitshas_run_limits(limits: RunLimits) -> boolRelease source · Runtime guarantees · Capability guides
RunLimits
Section titled “RunLimits”from cayu import RunLimitsOptional hard limits for one session run or resume call.
Every limit is evaluated against the clock selected by scope:
scope="run"(the default): token, tool-call, and elapsed-time limits all measure the current runtime invocation — usage deltas since the original run entered and active time since the run started. Durable approval and user-input continuations retain the baseline and exclude the human wait interval. A fresh run or clean-boundary resume resets it.scope="session": token, tool-call, and elapsed-time limits all measure the whole durable session — cumulative usage from the session event stream and wall time since the session was created. A resumed session that already meets a limit stops immediately.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
max_input_tokens |
StrictInt | None |
Field(default=None, ge=1, le=MAX_DURABLE_JSON_INTEGER) |
max_output_tokens |
StrictInt | None |
Field(default=None, ge=1, le=MAX_DURABLE_JSON_INTEGER) |
max_total_tokens |
StrictInt | None |
Field(default=None, ge=1, le=MAX_DURABLE_JSON_INTEGER) |
max_tool_calls |
StrictInt | None |
Field(default=None, ge=1, le=MAX_DURABLE_JSON_INTEGER) |
max_elapsed_seconds |
StrictInt | None |
Field(default=None, ge=1, le=MAX_DURABLE_JSON_INTEGER) |
scope |
Literal['session', 'run'] |
'run' |