record • AI Agent SDK

record: Record a restart at “now“ and return whether the breaker tripped.

record

Method

</div>

This is a method of the RestartLoopGuard class in the protocols module.

Record a restart at `now` and return whether the breaker tripped.

Signature

python
def record(now: float) -> bool

Parameters

ParamField float

A monotonic timestamp for this restart event.

Returns

ResponseField bool

`True when at least max_restarts restarts have occurred within the trailing window_seconds (breaker tripped); False` otherwise.

Used By

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 6050