reorganize codebase. Add in more of the framework for adding skills.

This commit is contained in:
samerbam 2023-06-14 11:57:12 -04:00
parent 483ba60fa9
commit eab4a90c80
29 changed files with 66 additions and 1 deletions

4
backend/NLP.py Normal file
View File

@ -0,0 +1,4 @@
# Natural Language Processing using something like https://spacy.io
# this will allow us to figure out what the query means
# i.e we might not have to add the word "wolfram" into a query to send it to wolfram...

17
backend/main.py Normal file
View File

@ -0,0 +1,17 @@
from skills.alarms import Alarms
from skills.cal import Cal
from skills.gmail import Gmail
from skills.gpt import GPT
from skills.reminders import Reminders
from skills.timers import Timers
from skills.todos import Todos
from skills.weather import Weather
from skills.wolfram import Wolfram
skills = [GPT(), Alarms(), Cal(), Gmail(), Reminders(), Timers(), Todos(), Weather(), Wolfram()]
if __name__ == "__main__":
print("Skill Trigger Phrases: ")
for skill in skills:
print(skill.trigger_phrase)

5
backend/skills/alarms.py Normal file
View File

@ -0,0 +1,5 @@
class Alarms:
def __init__(self):
self.trigger_phrase = "alarms"

5
backend/skills/cal.py Normal file
View File

@ -0,0 +1,5 @@
class Cal:
def __init__(self):
self.trigger_phrase = "calendar"

5
backend/skills/gmail.py Normal file
View File

@ -0,0 +1,5 @@
class Gmail:
def __init__(self):
self.trigger_phrase = "gmail"

5
backend/skills/gpt.py Normal file
View File

@ -0,0 +1,5 @@
class GPT:
def __init__(self):
self.trigger_phrase = "gpt"

View File

@ -0,0 +1,5 @@
class Reminders: # ntfy.sh notification?
def __init__(self):
self.trigger_phrase = "reminders"

View File

@ -1,4 +1,4 @@
from config import ntfy_url from skills.config import ntfy_url
import requests import requests
class Timers: class Timers:

5
backend/skills/todos.py Normal file
View File

@ -0,0 +1,5 @@
class Todos: # Notion api?
def __init__(self):
self.trigger_phrase = "todos"

View File

@ -0,0 +1,5 @@
class Weather: #open weather map api
def __init__(self):
self.trigger_phrase = "weather"

View File

@ -0,0 +1,5 @@
class Wolfram: #wolfram alpha api
def __init__(self):
self.trigger_phrase = "wolfram"

View File

@ -22,3 +22,6 @@ stop_listening = r.listen_in_background(m, callback)
print("Listening...") print("Listening...")
while True: while True:
time.sleep(0.1) time.sleep(0.1)
# TODO: Make api request to backend with resulting text in callback function.

1
frontend/tts.py Normal file
View File

@ -0,0 +1 @@
# make requests to https://github.com/synesthesiam/opentts and play resulting wav file

View File

View File

View File

View File

View File

View File

View File