← 开源

A simple client and utils for interacting with OpenAI's Realtime API in Python

AI EngineeringAccess modelsMake agent see hear talkPython
增长势头
+024 小时新增 Star0.0%
245
Star
48
Fork
+0
本周
6
贡献者
创建于 2024-10-08 · 更新于 2026-11-03 · 今日第 25784 名
主要开发者
logan-markewichliorboordDaniel-Chin
README

OpenAI Realtime API Client for Python

This is an experimental OpenAI Realtime API client for Python and LlamaIndex. It integrates with LlamaIndex's tools, allowing you to quickly build custom voice assistants.

Include two examples that run directly in the terminal -- using both manual and Server VAD mode (i.e. allowing you to interrupt the chatbot).

Installation

Install system deps:

brew install ffmpeg portaudio

Install python deps:

pip install openai-realtime-client

# Optional: clone the repo and run the examples locally
git clone https://github.com/run-llama/openai_realtime_client.git
cd openai_realtime_client

Set your openai key:

export OPENAI_API_KEY="sk-..."

Usage

Assuming you installed and cloned the repo (or copy-pasted the examples), you can immediately run the examples.

Run the interactive CLI with manual VAD (try asking for your phone number to see function calling in action):

python ./examples/manual_cli.py

Or to use streaming mode (which allows you to interrupt the chatbot):

python ./examples/streaming_cli.py

NOTE: Streaming mode can be a little janky, best to use headphones in a quiet environment.

Take a look at the examples, add your own tools, and build something amazing!

排名相邻
同类项目

AI Rank iPhone 版

随时追踪 AI 模型榜单

在 App Store 下载