Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.
/ VirgilAI Public archive

Virgil is an advanced virtual assistant that is based on the powerful GPT-3.5 artificial intelligence developed by OpenAI. This virtual assistant is designed to offer a wide range of features and capabilities similar to those of well-known virtual assistants such as Amazon's Alexa.

License

Notifications You must be signed in to change notification settings

ProjecVirgil/VirgilAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Virgil AI πŸ›οΈ (Assistant Interface) | Last docs update: 03/01/2024 (d/m/y)

Index πŸ“–


VirgilAI GitHub commit activity (branch) GitHub repo size Scrutinizer Code Quality

Introduction

Created in principle with python3.11 and various libraries such as SpeechRecognition and TTS library.

Virgilo or Virgil is a virtual assistant like Alexa or Google Home, but integrated with an AI (powered by openai).Designed to give the user the ability to use it and do what they want with it, from putting it on a rasperry and using it as alexa to integrating it with their device whether it's linux or windows. With the possibility to set your own settings according to your needs, from where and when you want.

Installation Tutorial + Small demo

Watch the video

πŸ”‘ Key features

You can ask many questions on Virgilio, like us:.

  • The time ⏲️
  • The weather 🌧️
  • The latest news πŸ—žοΈ
  • Change the volume πŸ”‰
  • The temperature 🌑️
  • Days of the week πŸ“†
  • Interact with the domotic (Merros device only) πŸ’‘
  • Timer πŸ”‚
  • Ask a Virgil to remember your commitments πŸ—“οΈ
  • Media player 🎡
  • and ask whatever you want how: Virgilio explain quantum math πŸ€–

Is fast to use:

  • In fact, all you have to do is insert the key into the app and you're done βœ…

Portable:

  • You can use it on any linux/windows 🌐

πŸ’» How VirgilAI works

white text

Example of communication with API and APP

Markdownify

Structure of Virgil

Markdownify

πŸ“‹ Installation

Obligatory requirements

  • Python 3.11
  • Key from GPT3.5>=

Installation

Windows

  1. The first part of the installation is to get the installer with this link and follow the instructions (it will be easy, don't worry and remember to save the key).

  2. Install the App to configure your Virgil.

  3. Now we need the api (for now I am not rich and do not pay for everything) so we need 3 api keys (the keys marked with * ** are mandatory for operation)

    • API for OpenAI and GPT, I recommend this video tutorial.
    • API for Merros (domotic socket), just create a Merros account and enter your credentials (key not obligatory as Merros function is disabled)
    • API for ElevenLabs This API is not required, but if you want a BEST EXPERIENCE I recommend you to get it.
  4. When you have all the keys/accounts, save them to any file.

Linux

Not yet available (sorry)

Guide to ElevenLabs

Elevenlabs is a service to reproduce tts by deeplearning and the key is free but is necessary an account but the tokens are very few... But is there a trick to have UNLIMITED accounts with the same email

Explanation:

  1. Take any gmail
  2. Add a dot anywhere in the email
  3. And the confirmation email will be sent

Example:

Original email: example@gmail.com. Email with dots added: example.@gmail.com or e.xample@gmail.com.

First start

The first time you start Virgil immediately after booting, it will be much slower than a normal start. This is because Python, and Virgil in general, is optimized so that the more starts it has in a session, the faster it will start.

How to use

πŸŽ™οΈ Guide to microphones

Problem

The recognizer tries to recognize speech even when I'm not speaking, or after I've finished speaking.

Solution

Try increasing the recognizer_instance.energy_threshold property. This is basically how sensitive the recognizer is to when recognition should start. Higher values mean it will be less sensitive, which is useful if you are in a loud room.

I made this tool for you (the tool is in the repository) πŸ’“

import math
import speech_recognition as sr
import time
listener = sr.Recognizer()
def main(languageChoose:str):
    print("SAY A WORD OR PHRASE IN YOUR LANGUAGE")
    resultDict = {}
    for i in range(5):
        try:
            with sr.Microphone() as source:
                print(f"{i}. SPEAK")
                start_time = time.time()
                voice = listener.listen(source,3,15)
                command = listener.recognize_google(voice,language=languageChoose)
                end_time = time.time()
                resultDict[i] = [listener.energy_threshold,command,end_time - start_time]
        except:
            pass
    return resultDict
if __name__ == "__main__":
    listener.operation_timeout = 2
    listener.dynamic_energy_threshold = True
    languageChoose = str(input("Insert your language nation and dialect if is not dialect simple repeat the nation example it-it: "))
    results  = main(languageChoose)
    sorted_keys = sorted(results.keys(), key=lambda key: results[key][2])
    sorted_dict = {key: results[key] for key in sorted_keys}
    print(f"Recommended value:  {math.ceil(list(sorted_dict.values())[0][0])}")

The tool is not 100% accurate, but it's a good way to get a starting idea if you see that Virgil is not accurate enough in recognizing when you speak and when you don't try to adjust.

Why the key of OpenAI, ElevenLabs and Merros❓

  • Virgil: The Virgilio configuration key is used to synchronize all online settings... DO NOT GIVE THE KEY TO ANYONE OR EXPORT IT TO ANYONE OR YOU WILL GET ALL YOUR KEYS (OpenAI,Elevenlabs etc)
  • OpenAI: This is actually the only mandatory key, as GPT covers 50% of the application, and this is the real difference to Alexa and Virgil.
  • ElevenLabs: This key is not mandatory, but it makes the experience more pleasant because ElevenLabs implements a more natural Speech To Text (TTS) and also allows you to choose your own voice. If you can't use the button, Virgil will still work, but with Google's TTS. and it's not the best choice πŸ˜….
  • Meross: This is ONLY required if you can use a domotic Meross, but if you don't have a domotic Meross, don't waste your time ⏲️

How to change the voice for TTS ElevenLabs

  1. Go to this file lib/packages_utility/sound.py

  2. Go to the ElevenLabs website and create an account (you should already have one)

  3. Explore the default voice and choose one

  4. Now go to this part of the sound.py file

    sound = generate(
                      api_key = self.API_KEY,
                      text=text,
                      voice="Antoni",
                      model='eleven_multilingual_v1'
                    )

    And replace the voice with the one you want (if after the TTS does not work try another voice on watch a video on YT on how to use default entries).

  5. Restart Virgil.

WARNING!!: To save ElevenLabs tokens and increase efficiency, many phrases are pre-recorded, so there will be a difference between the voice you type and the pre-recorded voice.

πŸ” Change the key

For change the key you can re-run the installer and modify the parameter of key in the menu

Security

This is not a topic we will be exploring in depth at the moment, but each key is managed in a hosting system that encrypts communications and uses various string sanitization and controls against ddos and other attacks, but I believe that security can never be too much, so... If you discover a vulnerability in Virgil, please email projectvirgilai@gmail.com. All vulnerabilities are reported immediately.

Notes and Updates

In this paragraph I will add secondary items or updates released

  • The CATONE UPDATE is here and brings many new features

Other

As mentioned above, VirgililAI is part of a larger project that includes an app, a website and others, the links of which are at Project:

Credits

The project is made by one person and is still in development, I'm looking for someone to give me advice and a hand to continue the project, which I believe is an excellent open source and free alternative to devices like Alexa or Google Home.

Contact me

For code related issues you can use github directly for other collaborations or alerts write to this email projectvirgilai@gmail.com

If you want to support a small developer take a special link (pls i need coffee)

License

About

Virgil is an advanced virtual assistant that is based on the powerful GPT-3.5 artificial intelligence developed by OpenAI. This virtual assistant is designed to offer a wide range of features and capabilities similar to those of well-known virtual assistants such as Amazon's Alexa.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages