experimental
autogen.agentchat.realtime.experimental.WebSocketAudioAdapter
WebSocketAudioAdapter
Observer for the OpenAI Realtime API.
Observer for handling function calls from the OpenAI Realtime API.
Parameters:Name | Description |
---|---|
websocket | The websocket connection. Type: WebSocket |
logger | The logger for the observer. Type: logging.Logger | None Default: None |
Instance Methods
handle_speech_started_event
Handle interruption when the caller’s speech starts.
initialize_session
Control initial session with OpenAI.
on_event
Receive events from the OpenAI Realtime API, send audio back to websocket.
Parameters:Name | Description |
---|---|
event | Type: autogen.agentchat.realtime.experimental.realtime_events.RealtimeEvent |
run_loop
Reads data from websocket and sends it to the RealtimeClient.