Simple voice assistant in Python that executes predefined commands.
- Greetings and responses
- Current time
- Repeat phrases
- Open apps and websites (browser, YouTube, GitHub)
- Timers
- Random numbers
git clone https://github.com/AlmazCode/Project-Friday.git
cd Project-Friday
pip install -r requirements.txtpython src/main.py
- "Hello" → assistant greets you
- "What time is it?" → tells current time
- "Say I am the best" → repeats phrase
- "Open YouTube" → opens YouTube
- "Timer for 10 seconds" → starts timer
- "Random number from 1 to 100" → generates number
Maps user phrases → tokens.
"HELLO": ["hello", "hi", "hey"], "TIME": ["time", "what time", "current time"]
- User says: "What time is it?"
- Matched to token
"TIME"
Defines what to do when a token is detected.
TIME: actions: - { func: tts, args: ["Current time is {time}"] }
- Token
"TIME"→ calls functiontts()with{time}(All variables like{time}can be configured in CONTEXT insrc/core/data.py).
With arguments:
SAY: <ARG>: actions: - { func: tts, args: ["{0}"] }
- User: "Say hello world" →
tts("hello world")
Nested example:
OPEN: YOUTUBE: actions: - { func: open_url, args: ["{youtube}"] }
- User: "Open YouTube" → opens site.
Contains ready-made answers.
"GREETINGS": [ "Hello, {user}!", "Nice to see you, {user}!" ]
And in commands.yaml:
HELLO: actions: - { func: reply, args: ["GREETINGS"] }
- Assistant randomly picks a greeting.
Implements all available actions, e.g.:
tts(text)→ speak textopen_url(url)→ open websitelaunch_app(path)→ run applicationstart_timer(time)→ set timerrandom_number(a, b)→ generate number
- Add token and phrases to
lexicon.json - Add behavior to
commands.yaml - (Optional) Add replies to
assistant_lexicon.json - Implement new function in
src/modules/commands.py