# language_detection message

Last updated: 2026-11-19

The language spoken, once the engine knows it: a `gaia` session then moves to the model
that serves it best (`receive_realtime_processing_events`).

## Fields

- `session_id` (string, required): Identifier of the session.
- `created_at` (string, required): When the message was sent (ISO 8601, UTC).
- `type` ("language_detection", required)
- `data` (object, required): The language spoken, as the engine detected it (`model: "gaia"`).
  - `language` (string, required): The language spoken (ISO 639-1).
  - `confidence` (number, required, 0 to 1): How sure the engine is.
  - `speech_s` (number, default: `null`): The seconds of speech it decided on.
  - `low_confidence` (boolean, default: `false`): `true`: too unsure to act on; a `gaia` session stays on its model.
  - `model` (string, default: `null`): The detector that decided.
  - `alternatives` (array of object): The runners-up, the likeliest first.
    - `language` (string, required): Another language it may be (ISO 639-1).
    - `confidence` (number, required, 0 to 1)

## Example

```json
{
  "session_id": "string",
  "created_at": "string",
  "type": "language_detection",
  "data": {
    "language": "fr",
    "confidence": 0.93,
    "speech_s": 2.1,
    "low_confidence": false,
    "model": "language-id-v2",
    "alternatives": [
      {
        "language": "en",
        "confidence": 0.04
      }
    ]
  }
}
```
