# `Xai.RealtimeBehaviour`
[🔗](https://github.com/beamlab-xai/xai/blob/main/lib/xai/realtime_behaviour.ex#L1)

Behaviour for the Realtime WebSocket client.

This allows mocking the WebSocket layer in tests using Mox.

# `audio`

```elixir
@type audio() :: binary()
```

# `event`

```elixir
@type event() :: map()
```

# `opts`

```elixir
@type opts() :: keyword()
```

# `t`

```elixir
@type t() :: pid() | term()
```

# `close`

```elixir
@callback close(t()) :: :ok
```

# `connect_realtime`

```elixir
@callback connect_realtime(opts()) :: {:ok, t()} | {:error, term()}
```

# `connect_tts`

```elixir
@callback connect_tts(opts()) :: {:ok, t()} | {:error, term()}
```

# `send_event`

```elixir
@callback send_event(t(), event()) :: :ok | {:error, term()}
```

# `send_text`

```elixir
@callback send_text(t(), String.t()) :: :ok | {:error, term()}
```

# `send_text_done`

```elixir
@callback send_text_done(t()) :: :ok | {:error, term()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
