Openai Realtime Python banner
AgoraIO AgoraIO

Openai Realtime Python

Productivity community

Description

Real-time voice agent powered by Agora and OpenAI

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Realtime Agent

This project demonstrates how to deliver ultra-low latency access to OpenAI with exceptional audio quality using Agora's SD-RTN and OpenAI's Realtime API. By integrating Agora's SDK with OpenAI's Realtime API, it ensures seamless performance and minimal delay across the globe.

Prerequisites

Before running the demo, ensure you have the following installed and configured:

  • Python 3.11 or above

  • Agora account:

  • OpenAI account:

  • Additional Packages:

    • On macOS:
      brew install ffmpeg portaudio
    • On Ubuntu (verified on versions 22.04 & 24.04):
      sudo apt install portaudio19-dev python3-dev build-essential
      sudo apt install ffmpeg

Network Architecture

Architecture diagram of Conversational Ai by Agora and OpenAi

Organization of this Repo

  • realtimeAgent/realtime contains the Python implementation for interacting with the Realtime API.
  • realtimeAgent/agent.py includes a demo agent that leverages the realtime module and the agora-realtime-ai-api package to build a simple application.
  • realtimeAgent/main.py provides a web server that allows clients to start and stop AI-driven agents.

Run the Demo

Setup and run the backend

  1. Create a .env file for the backend. Copy .env.example to .env in the root of the repo and fill in the required values: