This project enables natural language interaction with a Pepper robot using language models such as GPT, GEmini, LLaMA, etc. The chatbot pipeline supports speech recognition, question answering, and text-to-speech, and can run using the PC microphone or Pepper’s built-in microphone.
This project requires both Python 3.10 and Python 2.7:
- Python 3.10 is used for the main logic and language model interaction.
- Python 2.7 is required for communication with Pepper using pynaoqi, which only supports Python 2.7.
Install the following system libraries (linux system):
sudo apt-get update
sudo apt-get install portaudio19-dev
sudo apt-get install libpython2.7To avoid exporting the dynamic library path every time:
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATHInstall Python 3.10 dependencies:
pip install -r requirements.txtMake sure you have downloaded the pynaoqi module. In this repository, it is already included in the main directory tree.
Before running the chatbot, ensure the pynaoqi module is included in your environment:
export PYTHONPATH=${PYTHONPATH}:/path/to/pynaoqi-python2.7-2.5.7.1-linux64/lib/python2.7/site-packagesReplace
/path/to/with the actual directory where you extracted thepynaoqimodule.
Set your API key as an environment variable (e.g., for OpenAI GPT models):
export OPENAI_API_KEY="your_key_here"Once everything is set up, you can launch the main program using:
python main_gpt.py --IP <robot-ip-to-connect>By default, the PC microphone is used. To use Pepper’s built-in microphone, run:
python main_gpt.py --use_pepper_mic=TrueYou will then be asked to specify the interaction language:
Please enter the desired language code (example 'es' for Spanish, 'en' for English):- Touch Pepper's head to indicate you want to ask a question.
- Pepper will prompt you when it's ready to listen.
- Ask your question using voice.
- The system processes your voice input, generates a response using the selected model, and makes Pepper speak the answer.
- This system supports real-time interaction and requires both network access (for API calls) and local audio input/output.
- Ensure that Pepper is connected and reachable at the specified IP address (e.g.,
192.168.x.x). - Log messages from
qimessagingmay appear at startup — this is expected behavior from the Pepper communication stack.
The repository is organized into different modules depending on where the code is executed:
This script allows Pepper to recite poems by Mario Benedetti using expressive speech and synchronized gestures. It's a great example of how to use Pepper's animation library combined with voice interaction. (See README_benedetti.md)
Contains the lightweight Python 2.7 scripts that must be uploaded and executed directly on the Pepper Robot. This includes the bridge server that listens for commands from the web interface or external triggers. (See pepper-files/README.md)
This folder contains the Flask-based API designed to run on a powerful external machine (GPU-enabled). It handles the heavy lifting: Speech-to-Text, LLM processing (GPT, Gemini, etc.), and response generation. (See servergpu/README.md)
