agentchat.realtime_agent
agentchat.realtime_agent.client
OpenAIRealtimeClient
(Experimental) Client for OpenAI Realtime API.
__init__
(Experimental) Client for OpenAI Realtime API.
Arguments:
agent
RealtimeAgent - The agent that the client is associated with.audio_adapter
RealtimeObserver - The audio adapter for the client.function_observer
FunctionObserver - The function observer for the client.
openai_ws
Get the OpenAI WebSocket connection.
register
Register an observer to the client.
notify_observers
Notify all observers of a message from the OpenAI Realtime API.
Arguments:
message
dict[str, Any] - The message from the OpenAI Realtime API.
function_result
Send the result of a function call to the OpenAI Realtime API.
Arguments:
call_id
str - The ID of the function call.result
str - The result of the function call.
send_text
Send a text message to the OpenAI Realtime API.
Arguments:
role
str - The role of the message.text
str - The text of the message.
initialize_session
Control initial session with OpenAI.
session_update
Send a session update to the OpenAI Realtime API.
Arguments:
session_options
dict[str, Any] - The session options to update.
run
Run the client.