# events

Python API: `luxonis_ml.telemetry.events`

## Classes

| Name | Description |
| --- | --- |
|
[`TelemetryEvent`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/telemetry/events.md)
| Represents a single telemetry event. |

### class `TelemetryEvent`

```python
class TelemetryEvent
```

Represents a single telemetry event.

Attributes

| Name | Type | Description |
| --- | --- | --- |
| `context` | `dict[str, Any]` |  |
| `distinct_id` | `str | None` |  |
| `name` | `str` |  |
| `properties` | `dict[str, Any]` |  |
| `schema_version` | `int` |  |
| `timestamp` | `datetime` |  |

Methods

| Name | Description |
| --- | --- |
|
[`create`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/telemetry/events.md)
| Create a telemetry event with a UTC timestamp. |
|
[`to_payload`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/telemetry/events.md)
| Serialize the event into a JSON-friendly dict. |

#### class method `create`

```python
def create(
    *,
    name: str,
    properties: dict[str, Any],
    context: dict[str, Any],
    distinct_id: str | None = None,
    schema_version: int = 1,
) -> TelemetryEvent
```

Create a telemetry event with a UTC timestamp.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `name` | `str` | Event name. | required |
| `properties` | `dict[str, Any]` | Event properties after sanitization. | required |
| `context` | `dict[str, Any]` | Merged context to attach to the event. | required |
| `distinct_id` | `str | None` | Optional backend identity override. | `None` |
| `schema_version` | `int` | Event schema version. | `1` |

Returns

| Type | Description |
| --- | --- |
| `TelemetryEvent` | A telemetry event with a UTC timestamp. |

#### method `to_payload`

```python
def to_payload() -> dict[str, Any]
```

Serialize the event into a JSON-friendly dict.
