experimental
autogen.agentchat.realtime.experimental.TwilioAudioAdapter
TwilioAudioAdapter
Adapter for streaming audio from Twilio to OpenAI Realtime API and vice versa.
Adapter for streaming audio from Twilio to OpenAI Realtime API and vice versa.
Parameters:Name | Description |
---|---|
websocket | WebSocket the websocket connection to the Twilio service Type: WebSocket |
logger | 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 Twilio.
Parameters:Name | Description |
---|---|
event | Type: autogen.agentchat.realtime.experimental.realtime_events.RealtimeEvent |
run_loop
Run the adapter loop.
send_mark
Send a mark of audio interruption to the Twilio websocket.