RealtimeAgent

RealtimeAgent(
    *,
    name: str,
    audio_adapter: RealtimeObserver | None = None,
    system_message: str = 'You are a helpful AI Assistant.',
    llm_config: dict[str, Any],
    logger: Logger | None = None,
    observers: list[RealtimeObserver] | None = None,
    **client_kwargs: Any
)

(Experimental) Agent for interacting with the Realtime Clients.

Parameters:
NameDescription
nameType: str
audio_adapterType: RealtimeObserver | None

Default: None
system_messageType: str

Default: ‘You are a helpful AI Assistant.‘
llm_configType: dict[str, typing.Any]
loggerType: logging.Logger | None

Default: None
observersType: list[RealtimeObserver] | None

Default: None
**client_kwargsType: Any

Instance Attributes

logger


Get the logger for the agent.

realtime_client


Get the OpenAI Realtime Client.

registered_realtime_tools


Get the registered realtime tools.

system_message


Get the system message for the agent.

Instance Methods

register_observer

register_observer(self, observer: RealtimeObserver) -> None

Register an observer with the Realtime Agent.

Parameters:
NameDescription
observerThe observer to register.

Type: RealtimeObserver

register_realtime_function

register_realtime_function(
    self,
    *,
    name: str | None = None,
    description: str | None = None
) -> Callable[[~F | Tool], Tool]

Decorator for registering a function to be used by an agent.

Parameters:
NameDescription
nameThe name of the function.

Type: str | None

Default: None
descriptionThe description of the function.

Type: str | None

Default: None
Returns:
TypeDescription
Callable[[~F | Tool], Tool]Callable[[Union[F, Tool]], Tool]: The decorator for registering a function.

run

run(self) -> None

Run the agent.


start_observers

start_observers(self) -> None