Skip to main content

Friendly ai voice assistant

Project description

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 portaudio on 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:

  1. Converts the buffered audio to text.
  2. Fetches a response from the AI model.
  3. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quilbert-0.0.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quilbert-0.0.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file quilbert-0.0.1.tar.gz.

File metadata

  • Download URL: quilbert-0.0.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for quilbert-0.0.1.tar.gz
Algorithm Hash digest
SHA256 641c5fb9a438b8ea5b10eebd9f955d041cb62b4f12b29d6ef3dee6a83721c6d8
MD5 cb2032aa5fcdbfee6377c803ab1fbaea
BLAKE2b-256 7b2d70cba364a960018fff935e2e9f61c1a97d5302f7a4102ece212633a0ad92

See more details on using hashes here.

File details

Details for the file quilbert-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: quilbert-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for quilbert-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4150395c2f1b43055e2453d4f932b10932bd5de306baa851bfc62e63589f0095
MD5 462e31b351ab316f39d0b32f8427aed8
BLAKE2b-256 d4c7d2350e27d2896214f7d34ce6ff73d556ac1111c85e10bfa9fc86c2d106cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page