Logan Markewich a8d6b7a430 more examples
2024-10-08 22:54:26 -06:00
2024-10-08 22:54:26 -06:00
2024-10-08 22:54:26 -06:00
2024-10-08 22:54:26 -06:00
2024-10-08 22:54:26 -06:00
2024-10-08 22:54:26 -06:00
2024-10-08 22:54:26 -06:00

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:

git clone https://github.com/run-llama/openai_realtime_client.git
pip install -e .

Set your openai key:

export OPENAI_API_KEY="sk-..."

Usage

Run the interactive CLI with manual VAD:

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.

S
Description
A simple client and utils for interacting with OpenAI's Realtime API in Python
Readme MIT 137 KiB
Languages
Python 100%