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

python
def evaluate(last_activity: float, now: float) -> LivenessDecision

Parameters

ParamField float

The connection’s last-activity timestamp (same clock as `now` — the wrapper uses a monotonic clock).

ParamField float

The current timestamp.

Returns

ResponseField LivenessDecision

attr:LivenessDecision.KEEP while reaping is disabled or the connection is within its liveness window; otherwise :attr:LivenessDecision.REAP.

Uses

  • reap_deadline

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 7301


Related Documentation