Gateway Event • AI Agent SDK

GatewayEvent: A gateway event with metadata.

GatewayEvent

Defined in the protocols module.

AI Agent

A gateway event with metadata.

Attributes: type: The event type data: Event payload event_id: Unique event identifier timestamp: Event creation time source: Source identifier (agent_id, client_id, etc.) target: Target identifier (optional, for directed events) sequence: Monotonic sequence number for gap detection (optional)

Wire Protocol Extensions: When events are sent over the gateway, additional fields are added: – seq: Top-level monotonic sequence number for gap detection – cursor: Event cursor position (also stored in data[‘cursor’])

Resume Protocol: The ‘joined’ acknowledgment includes: – cursor: Current head cursor position – oldest_cursor: Oldest event still in buffer – resync_required: True if requested ‘since’ is below oldest_cursor

When resync_required=true, a ‘snapshot’ message follows with full state.

Properties

ResponseField Union[EventType, str]

No description available.

ResponseField Dict[str, Any]

No description available.

ResponseField str

No description available.

ResponseField float

No description available.

ResponseField Optional[str]

No description available.

ResponseField Optional[str]

No description available.

ResponseField Optional[int]

No description available.

Internal & Generic Methods
  • from_dict: Create from dictionary.
  • to_dict: Convert to dictionary for serialization.

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 1113


Related Documentation