# `Mojentic.Realtime.Schemas`
[🔗](https://github.com/svetzal/mojentic-ex/blob/v1.5.0/lib/mojentic/realtime/schemas.ex#L1)

Schema catalogue for OpenAI Realtime API server events.

Documents the required fields for each known event type. The
`parse_server_event/1` function normalises missing-type payloads and
passes all recognised and unknown events through verbatim — the live
path in `Session` pattern-matches event types directly, so no hard
validation is needed here.

Callers that need to validate a payload in tests can use
`valid?/1` to check that required fields are present.

Schema snapshot: OpenAI Realtime API beta circa 2026-05.

# `known_types`

List the event types this module recognises.

# `parse_server_event`

Normalise a raw server-event map: ensures a `"type"` key is present.

- Maps without a `"type"` key are tagged `%{"type" => "unknown"}`.
- All other maps are returned verbatim — unknown event types from
  provider drift pass through so callers can still consume them.

# `valid?`

Returns `true` when a recognised event's required fields are all present.

Unknown event types (not in the schema catalogue) always return `true`
so callers don't need to guard against future provider additions.

---

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