evaluate • AI Agent SDK
evaluate: Return :attr:`LivenessDecision.REAP` iff the connection is stale.
evaluate
Method
</div>
This is a method of the LivenessPolicy class in the protocols module.
Return :attr:LivenessDecision.REAP iff the connection is stale.
Signature
def evaluate(last_activity: float, now: float) -> LivenessDecisionParameters
ParamField
floatThe connection’s last-activity timestamp (same clock as `now` — the wrapper uses a monotonic clock).
ParamField
floatThe current timestamp.
Returns
ResponseField
LivenessDecisionattr:LivenessDecision.KEEP while reaping is disabled or the connection is within its liveness window; otherwise :attr:LivenessDecision.REAP.
Uses
reap_deadline
Source
View on GitHubpraisonaiagents/gateway/protocols.py at line 7301