ReqLLM.OpenAI.Realtime
(ReqLLM v1.9.0)
View Source
Experimental low-level Realtime WebSocket client for OpenAI.
This module exposes a small session-oriented API for Realtime workflows that
do not map cleanly onto ReqLLM.stream_text/3. It is intentionally low-level:
you connect a session, send JSON events, receive JSON events, and close the
socket when you are done.
Summary
Functions
@spec close(ReqLLM.OpenAI.Realtime.Session.t()) :: :ok
@spec connect( ReqLLM.model_input() | String.t(), keyword() ) :: {:ok, ReqLLM.OpenAI.Realtime.Session.t()} | {:error, term()}
@spec next_event(ReqLLM.OpenAI.Realtime.Session.t(), non_neg_integer()) :: {:ok, map()} | :halt | {:error, term()}
@spec response_create(ReqLLM.OpenAI.Realtime.Session.t(), map()) :: :ok | {:error, term()}
@spec send_event(ReqLLM.OpenAI.Realtime.Session.t(), map()) :: :ok | {:error, term()}
@spec session_update(ReqLLM.OpenAI.Realtime.Session.t(), map()) :: :ok | {:error, term()}