Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.praison.ai/llms.txt

Use this file to discover all available pages before exploring further.

on_event

Method
This is a method of the GatewayProtocol class in the protocols module.
Decorator to register an event handler.

Signature

def on_event(event_type: Union[EventType, str]) -> Callable

Parameters

event_type
Union
required
No description available.

Returns

Returns
Callable
The result of the operation.

Usage

@gateway.on_event(EventType.MESSAGE)
    async def handle_message(event: GatewayEvent):
        print(f"Message: {event.data}")

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 365