ottobjorkland / SmartVoiceAssistant

A smart AI voice assistant with multi-language support and long-term memory. Currently best for Swedish and English. Compatible with Windows and Raspberry Pi. The assistant can use various functions and tools to answer questions (Google, Wolfram Alpha, etc.). Based on OpenAI's GPT-models, Google STT and TTS, and ElevenLabs TTS.
20 stars 2 forks source link
ai artificial-intelligence elevenlabs-api english function-calling google-api gpt gpt-3 gpt-4 long-term-memory openai-api raspberry-pi svenska swedish voice-assistant windows wolfram-alpha-api

SmartVoiceAssistant

A smart AI voice assistant with multi-language support and long-term memory. Currently best for Swedish and English. Compatible with Windows and Raspberry Pi. The assistant can use various functions and tools to answer question (Google, Wolfram Alpha, etc.). Based on OpenAI's GPT-models, Google STT and TTS, and ElevenLabs TTS.

Download

Get API-keys, credentials and ID's

If you do not want to gather all of this information or do not have time, simply do not save them to the "apiKeys.py" file. Only the OpenAI API Key is required for the assistant to function. However, I recommend to use its full potential by filling in the information. It is really fascinating!

Save these keys and ID's to the "apiKeys.py" file (only the OpenAI API Key is required):

Raspberry Pi

Set-Up

Run these commands to install packages on a Raspberry Pi (terminal):

Run the program

  1. Open the terminal
  2. Run python script: python {PROJECT DIRECTORY}\VoiceAssistant.py OR run python3 script: python3 "{PROJECT DIRECTORY}\VoiceAssistant.py" (Example: python "C:\Users\username\Documents\VoiceAssistant\test.py")

Windows

Set-Up

Run these commands, and follow the steps to install the packages (PowerShell terminal):

  1. Open a PowerShell terminal as ADMIN
  2. Install Python through Windows Store
  3. Install pip: Invoke-WebRequest -Uri https://bootstrap.pypa.io/get-pip.py -OutFile get-pip.py; python get-pip.py
  4. Create an environment: python -m venv "{PROJECT DIRECTORY}\venv" (Example: python -m venv "C:\Users\username\Documents\VoiceAssistant\venv")
  5. Activate the environment: & "{PROJECT DIRECTORY}\venv\Scripts\Activate.ps1"
  6. Install packages: pip install pyaudio pvporcupine pyttsx3 SpeechRecognition requests openai google-api-python-client pygame wolframalpha langchain google-cloud-speech google-cloud-texttospeech mutagen tiktoken colorama

Run the program

Run these commands to start the program in Windows PowerShell:

  1. Open a PowerShell terminal as ADMIN
  2. Let PowerShell execute scripts in Windows: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
  3. Activate the environment (If it isn't already activated after installation): & "{PROJECT DIRECTORY}\venv\Scripts\Activate.ps1"
  4. Run python script: & python "{PROJECT DIRECTORY}\VoiceAssistant.py" OR run python3 script: & python3 "{PROJECT DIRECTORY}\VoiceAssistant.py" (Example: & python "C:\Users\username\Documents\VoiceAssistant\test.py")