agentchat.realtime_agent
agentchat.realtime_agent.function_observer
FunctionObserver
Observer for handling function calls from the OpenAI Realtime API.
__init__
Observer for handling function calls from the OpenAI Realtime API.
Arguments:
agent
RealtimeAgent - The realtime agent attached to the observer.
update
Handle function call events from the OpenAI Realtime API.
Arguments:
response
dict[str, Any] - The response from the OpenAI Realtime API.
call_function
Call a function registered with the agent.
Arguments:
call_id
str - The ID of the function call.name
str - The name of the function to call.kwargs
Any[str, Any] - The arguments to pass to the function.
run
Run the observer.
Initialize the session with the OpenAI Realtime API.
initialize_session
Add registered tools to OpenAI with a session update.