Introduction
Quilbert: A Python AI Voice Assistant with State Machine Design
Quilbert is a GPT powered AI voice assistant built using Python. This project utilizes a state machine design pattern to efficiently handle user input, process it, and provide relevant responses. With Quilbert, you can easily access information, ask questions, and receive helpful responses using only your voice.
To get started with Quilbert, follow these steps:
$ pip install Quilbert
$ quilbert --debug
Once running, Quilbert will begin listening for the wakeword "porcupine". When you say "porcupine", Quilbert will become active and start listening for your questions or commands.
Please note some common issues you might encounter:
- OpenAI API not set: Configure your OpenAI API key by running
export OPENAI_API_KEY=<your key>. - Picovoice access key not set: Set up your Picovoice access key using
export PICOVOICE_ACCESS_KEY=<your key>. - Pyaudio import fails because portaudio is not installed: Install portaudio using
brew install portaudioon mac.
Architecture Overview
Quilbert's architecture is based on a state machine with three primary states: sleeping, listening, and processing. The state diagram for Quilbert's architecture can be visualized using Mermaid:
stateDiagram
sleeping --> listening
listening --> processing
processing --> listening
processing --> sleeping
By using this state machine design, Quilbert efficiently handles user interactions, providing a seamless and responsive voice assistant experience.
Sleeping state
In the sleeping state, Quilbert processes audio chunks, listens for the wakeword, and discards the audio data. The transitions are as follows:
- Sleeping to listening: Triggered when the wake word is detected.
Listening state
When in the listening state, Quilbert processes audio chunks, listens for voice activity, and stores the chunks in a buffer. The possible transitions are:
- Listening to sleeping: Triggered when no processing occurs after two minutes of listening.
- Listening to processing: Triggered when voice activity is detected for 0.25 seconds, followed by one second of inactivity.
Processing state
In the processing state, Quilbert takes the following actions:
- Converts the buffered audio to text.
- Fetches a response from the AI model.
- Plays the response using text-to-speech synthesis.
The transitions from processing state are:
- Processing to sleeping: Triggered when the user says "stop" or another stop phrase.
- Processing to listening: Triggered immediately after processing is complete.
Metadata
Release files for quilbert 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| quilbert-0.0.1.tar.gz | 6.2 kB | Without provenance | Details for quilbert-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quilbert-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for quilbert-0.0.1-py3-none-any.whl |
Total release size: 12.2 kB
Release files / quilbert-0.0.1.tar.gz
| Download URL | quilbert-0.0.1.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
641c5fb9a438b8ea5b10eebd9f955d041cb62b4f12b29d6ef3dee6a83721c6d8
|
|
BLAKE2b-256 checksum How to use checksums |
7b2d70cba364a960018fff935e2e9f61c1a97d5302f7a4102ece212633a0ad92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.5
|
Release files / quilbert-0.0.1-py3-none-any.whl
| Download URL | quilbert-0.0.1-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4150395c2f1b43055e2453d4f932b10932bd5de306baa851bfc62e63589f0095
|
|
BLAKE2b-256 checksum How to use checksums |
d4c7d2350e27d2896214f7d34ce6ff73d556ac1111c85e10bfa9fc86c2d106cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.5
|
Security for quilbert 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.