agentchat.realtime_agent
agentchat.realtime_agent.websocket_audio_adapter
WebSocketAudioAdapter
__init__
Observer for handling function calls from the OpenAI Realtime API.
Arguments:
websocket
WebSocket - The websocket connection.logger
Logger - The logger for the observer.
on_event
Receive events from the OpenAI Realtime API, send audio back to websocket.
handle_speech_started_event
Handle interruption when the caller’s speech starts.
initialize_session
Control initial session with OpenAI.
run_loop
Reads data from websocket and sends it to the RealtimeClient.