Liveness Config • AI Agent SDK

LivenessConfig: Configuration for application-level connection liveness (Issue #2798).

LivenessConfig

Defined in the config module.

AI Agent

Configuration for application-level connection liveness (Issue #2798).

Drives the transport-agnostic ping/pong heartbeat contract: the gateway emits a `PING every interval_ms and reaps any connection whose last activity is older than interval_ms × missed_beats_before_reap (closing it with GatewayCloseCode.LIVENESS_TIMEOUT`), while the reference client sends heartbeats on the same cadence and force-reconnects after a silence watchdog fires.

This maps directly onto the pure core :class:~praisonaiagents.gateway. protocols.LivenessPolicy; :meth:to_policy builds one.

Attributes: enabled: Toggle liveness heartbeat/reaping. When False (default), behaviour is unchanged — `last_activity is stamped but never acted upon, so upgrading is fully backward-compatible. interval_ms: Heartbeat interval in milliseconds (advertised to clients as heartbeat_ms`). missed_beats_before_reap: How many consecutive missed heartbeat intervals of silence before a connection is reaped (>= 1).

Properties

ResponseField bool

No description available.

ResponseField int

No description available.

ResponseField int

No description available.

Methods

Internal & Generic Methods
  • from_dict: Create from a parsed `gateway.liveness` mapping (tolerant of None).
  • to_dict: Convert to dictionary.

Source

View on GitHub

praisonaiagents/gateway/config.py at line 718


Related Documentation