> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# on • AI Agent SDK

> on: Register an event handler.

# on

Method

> This is a method of the [**ObservabilityHooks**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/ObservabilityHooks.md) class in the [**observability**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/observability.md) module.

Register an event handler.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def on(event_type: EventType, handler: Callable[[ObservabilityEvent], None]) -> Any
```

## Parameters

**event\_type** `EventType` *required*

Type of event to handle

**handler** `Callable` *required*

Handler function

### Returns

**Returns** `Any`

The result of the operation.

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/escalation/observability.py#L154)
>
> `praisonaiagents/escalation/observability.py` at line 154


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.