A python-based client for OpenAI's Realtime API
Project description
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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openai_realtime_client-0.1.0.tar.gz.
File metadata
- Download URL: openai_realtime_client-0.1.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Darwin/22.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a6344d625c92b9ff53f9c42bc71e4946e46a1216d48c691c1812371927ce42a
|
|
| MD5 |
7b9a05c3e7ea507932816d321ab93016
|
|
| BLAKE2b-256 |
820c9815245936af960389fce0314a5632f6d74a44416bd1bbc1fc55508363de
|
File details
Details for the file openai_realtime_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openai_realtime_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Darwin/22.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8ad6b01ed154834b0ddfea6619ff9e849c462714580690111d25832dcbf4250
|
|
| MD5 |
d6390dd8ed2a66d0724ef14e7d64ee62
|
|
| BLAKE2b-256 |
a20630819100fea0e19d4011f8bb8049b5235d3856721ebf3af35bb7f196c69e
|