WebSocketAudioAdapter
autogen.agentchat.realtime.experimental.WebSocketAudioAdapter #
Bases: RealtimeObserver
Observer for handling function calls from the OpenAI Realtime API.
PARAMETER | DESCRIPTION |
---|---|
websocket | The websocket connection. TYPE: |
logger | The logger for the observer. TYPE: |
Source code in autogen/agentchat/realtime/experimental/audio_adapters/websocket_audio_adapter.py
run async
#
Run the observer with the agent.
When implementing, be sure to call self._ready_event.set()
when the observer is ready to process events.
PARAMETER | DESCRIPTION |
---|---|
agent | The realtime agent attached to the observer. TYPE: |
Source code in autogen/agentchat/realtime/experimental/realtime_observer.py
wait_for_ready async
#
on_close async
#
on_event async
#
Receive events from the OpenAI Realtime API, send audio back to websocket.
Source code in autogen/agentchat/realtime/experimental/audio_adapters/websocket_audio_adapter.py
handle_speech_started_event async
#
Handle interruption when the caller's speech starts.
Source code in autogen/agentchat/realtime/experimental/audio_adapters/websocket_audio_adapter.py
send_mark async
#
Source code in autogen/agentchat/realtime/experimental/audio_adapters/websocket_audio_adapter.py
initialize_session async
#
Control initial session with OpenAI.
Source code in autogen/agentchat/realtime/experimental/audio_adapters/websocket_audio_adapter.py
run_loop async
#
Reads data from websocket and sends it to the RealtimeClient.