FunctionObserver
autogen.agentchat.realtime.experimental.FunctionObserver #
Bases: RealtimeObserver
Observer for handling function calls from the OpenAI Realtime API.
Observer for handling function calls from the OpenAI Realtime API.
Source code in autogen/agentchat/realtime/experimental/function_observer.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 #
Handle function call events from the OpenAI Realtime API.
| PARAMETER | DESCRIPTION |
|---|---|
event | The event from the OpenAI Realtime API. |
Source code in autogen/agentchat/realtime/experimental/function_observer.py
call_function async #
Call a function registered with the agent.
| PARAMETER | DESCRIPTION |
|---|---|
call_id | The ID of the function call. TYPE: |
name | The name of the function to call. TYPE: |
kwargs | The arguments to pass to the function. |
Source code in autogen/agentchat/realtime/experimental/function_observer.py
initialize_session async #
Add registered tools to OpenAI with a session update.