F.R.I.D.A.Y. ("Female Replacement Intelligent Digital Assistant Youth") is a virtual assistant programmed in Python, designed to facilitate daily tasks through voice commands. This project places special emphasis on its ability to adapt to a variety of commands thanks to its flexibility in recognizing instructions. Inspired by the Iron Man movies, just like Tony Stark uses advanced artificial intelligence systems, this project aims to emulate that experience, providing a flexible assistant that adapts to the user's needs. Versión Español
- Activated by phrases such as "Friday, are you there?" or "Friday, are you awake?".
- Performs useful actions like opening applications, taking screenshots, managing the system, and much more.
- Interacts with personalized phrases and a friendly tone.
- Detects keywords anywhere in a sentence, allowing for a more conversational use without the need for strict commands.
Unlike other virtual assistants, F.R.I.D.A.Y. does not require dividing instructions into exact words to interpret commands. This is achieved by avoiding methods like .split()
and prioritizing keyword searching.
When using split()
, the command is divided into individual words, and each word is evaluated separately. This means the keyword must be present as a separate word within the command.
def execute(self, command, voice):
for key in self.command_dict.keys():
if any(key in word for word in command.split()): # Splits the command into words and searches for the keyword in each
voice.speak(self.command_dict[key]())
return
else:
voice.speak("I don't understand the command, sir.")
- Requires keywords to be separate: If the keyword is joined with other words, like in a phrase such as "open browser please", the system won't detect it correctly.
- Less tolerant of language variations: The keyword must exactly match a separate word in the command.
- Less flexibility: The keyword cannot be at the beginning, middle, or end of the sentence unless separated by spaces.
By not using split()
, the system looks for the keyword throughout the entire command string. This means the system can find the keyword even if it's joined with other words or in different parts of the sentence, offering much more flexibility in how users can express the command.
def execute(self, command, voice):
for key in self.command_dict.keys():
if key in command: # Searches for the keyword throughout the command
voice.speak(self.command_dict[key]())
return
else:
voice.speak("I don't understand the command, sir.")
- Greater flexibility: The keyword can be anywhere in the command, without needing to be separated by spaces.
- Tolerant of language variations: Even if the command has additional words or a different structure, the system will still detect the keyword correctly.
- Better handling of more complex or natural commands: The system can handle longer or more complex phrases without requiring them to fit into a rigid structure.
- The command is exactly "browser", which matches 100% with the keyword.
- The system identifies the match and executes the corresponding action without issues.
- Although the phrase contains more words and is more complex, the system doesn't need the words to be separated or in a specific order.
- The system searches for the keyword "browser" throughout the sentence.
- Since the word "browser" is present, the system executes the associated action correctly.
- Python 3.8+
- A functional microphone for voice recognition.
- Libraries:
speech_recognition
,pyttsx3
,pyautogui
,subprocess
,datetime
,time
,random
git clone https://github.com/mcortezv/F.R.I.D.A.Y. F.R.I.D.A.Y
pip install -r requirements.txt
python main.py
- "Viernes estás ahí"
- "Viernes estás despierta"
- "¿Qué hora es?"
- "Abre el navegador."
- "Haz una captura de pantalla."
Keyword | Action |
---|---|
viernes |
Responds to your request. |
hora |
Indicates the current time. |
apagar |
Shuts down the system. |
captura |
Takes a screenshot. |
escritorio |
Minimizes or restores windows. |
teclado |
Changes the keyboard layout. |
configuracion |
Opens system settings. |
terminal |
Opens the command terminal. |
archivos |
Opens the file explorer. |
tareas |
Opens the task manager. |
navegador |
Opens the browser. |
notas |
Opens the notepad. |
calculadora |
Opens the calculator. |
word |
Opens Microsoft Word. |
copiar |
Copies the current selection. |
v |
Pastes the copied content. |
z |
Undoes the last change. |
x |
Cuts the current selection. |
todo |
Selects all content. |
f4 |
Closes the active window. |
recarga |
Refreshes the active page. |
"new_command": self.my_custom_function
def my_custom_function(self):
# Custom logic
return "Executing my new command."
This project is licensed under the MIT License. See the LICENSE file for more details.