Skip to main content

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

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!

Release files for openai-realtime-client 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openai-realtime-client 0.1.0
File Size Uploaded
openai_realtime_client-0.1.0.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openai-realtime-client 0.1.0
File Interpreter ABI Platform
openai_realtime_client-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.6 kB

Release files / openai_realtime_client-0.1.0.tar.gz

Download URL openai_realtime_client-0.1.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4a6344d625c92b9ff53f9c42bc71e4946e46a1216d48c691c1812371927ce42a
BLAKE2b-256 checksum
How to use checksums
820c9815245936af960389fce0314a5632f6d74a44416bd1bbc1fc55508363de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.12 Darwin/22.3.0

Release files / openai_realtime_client-0.1.0-py3-none-any.whl

Download URL openai_realtime_client-0.1.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8ad6b01ed154834b0ddfea6619ff9e849c462714580690111d25832dcbf4250
BLAKE2b-256 checksum
How to use checksums
a20630819100fea0e19d4011f8bb8049b5235d3856721ebf3af35bb7f196c69e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.12 Darwin/22.3.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page