Skip to main content

RealtimeAgent

Defined in the Realtime Agent module.
AI Agent Agent for real-time voice conversations using OpenAI Realtime API. This agent enables bidirectional audio streaming for voice conversations, supporting both text and audio modalities with configurable voice settings.

Constructor

str
default:"'RealtimeAgent'"
No description available.
Optional[str]
No description available.
Optional
No description available.
Optional[str]
No description available.
bool
default:"True"
No description available.

Methods

console()

Lazy load Rich console.

connect()

Connect to the Realtime API (sync wrapper).

aconnect()

Connect to the Realtime API asynchronously.

disconnect()

Disconnect from the Realtime API (sync wrapper).

adisconnect()

Disconnect from the Realtime API asynchronously.

send_text()

Send text message (sync wrapper).

asend_text()

Send text message asynchronously.

send_audio()

Send audio data (sync wrapper).

asend_audio()

Send audio data asynchronously.

on_message()

Register callback for text messages.

on_audio()

Register callback for audio data.

on_error()

Register callback for errors.

receive_loop()

Main receive loop for processing incoming events.

Usage

Source

View on GitHub

praisonaiagents/agent/realtime_agent.py at line 36

Agents Concept

Single Agent Guide

Multi-Agent Guide

Agent Configuration

Auto Agents