A real-time, voice agent that can be run on robots. This was specifically made for the Unitree Go 2 Edu, and can run natively on the Jetson Expansion module. The voice agent is built using OpenAI’s Realtime API, with a Textual TUI and modular tool integration. This project is easily customizable for any event, robot, or use case, and includes WSO2Con-specific mock data for demonstration.
- Real-time transcription and voice response on a Textual Interface (TUI)
- Modular, customizable tools and persona config (see
agent_config.py) - Uses OpenAI's streaming Realtime API
- Easily extensible for any robot, event, or conference
- Python 3.9+ (Python 3.11.9 recommended)
- MacOS:
brew install portaudio ffmpeg - Ubuntu:
sudo apt install portaudio19-dev python3-pyaudio - Environment variable:
OPENAI_API_KEY(see.env.example)
git clone <this-repo-url>
cd <repo-folder>
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Copy
.env.exampleto.envand fill in your OpenAI API key. - Edit
agent_config.pyto set your agent's persona, event, and tool configuration. - Run the Conference Service in
tools/(Runpython conference_service.pyfor WSO2Con mock example). - Setup the Unitree Go2 Control Service (Optional - Refer to instructions below)
- Run the app:
python main.pyControls:
- Press
Kto start/stop recording (push-to-talk) - Press
Qto quit
- Persona & Instructions: Edit
agent_config.pyto set the agent's name, event, and instructions. - Tools: Add or modify tools in
agent_config.pyand implement their logic intools/. - Event Data: Place markdown or data files in
data/for info lookup. - Mock Conference API: See
tools/conference_service.pyfor a WSO2Con mock agenda and speaker API.
main.py— App entry pointaudio_util.py— Audio streaming utilitiestools/— Info lookup and event API helpers (seeconference_service.pyfor mock WSO2Con)data/— Static markdown datastyles/cli.css— Custom styling for the TUI.env.example— Sample environment config
This is a concurrency-safe Flask server implementation for the Unitree Go2 Python SDK. It has been tested on the Unitree Go2 Edu version. The server can be run from an external computer (with the network interface configured appropriately), directly on the Jetson module (using network interface eth0), or in test mode (without a Unitree Go2 robot).
If you encounter issues, refer to the Unitree SDK website.
cd robot_controller
git clone https://github.com/unitreerobotics/unitree_sdk2_python.git
cd unitree_sdk2_python
python -m venv .venv
source .venv/bin/activate
pip3 install -e .
cd ..pip3 install -r requirements.txtpython3 control_service.py <network_interface>
# Example: python3 control_service.py eth0
# Or for test mode: python3 control_service.py testpython conference_service.pyQ1: Error when running pip3 install -e .:
Could not locate cyclonedds. Try to set CYCLONEDDS_HOME or CMAKE_PREFIX_PATH
This error means the cyclonedds path could not be found. First, compile and install cyclonedds:
cd ~
git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x
cd cyclonedds && mkdir build install && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
cmake --build . --target installThen, set CYCLONEDDS_HOME and install the SDK:
cd ~/unitree_sdk2_python
export CYCLONEDDS_HOME="~/cyclonedds/install"
pip3 install -e .Apache 2.0 — see LICENSE file.
- This project is built on an example from OpenAI: https://github.com/openai/openai-python/blob/main/examples/realtime/push_to_talk_app.py