diff --git a/README.md b/README.md index 6eed02f..d7c4d2b 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # A Siri like AI Assistant -* Uses ChatGPT for general queries -* Uses Wolfram Alpha for anything math related -* Has built in NLP (using a NLI model) for determining if we can process query locally +* Uses ChatGPT (or alternative LLM) for general queries +* Uses Wolfram Alpha API for anything math related +* Has built in NLP (using a NLI model) for determining if we can process query locally (skills system) * Frontend/Backend architecture for ability to deploy lightweight clients ## Skills - [ ] Translations -- [ ] Alarms +- [ ] Alarms (potentally complete, if we use Timers logic) - [ ] Calendar - [ ] Gmail - [ ] ChatGPT @@ -40,4 +40,8 @@ More examples (includes jwt authentication, though this is in node.js, still use ## Ideas -* Dashboard with api call counts \ No newline at end of file +* Dashboard with api call counts (would require linking into all active skills, callbacks with class inheritance maybe?) + +## Wants, but limitations prevent + +* *tumble weed bounces by* Oh, dear. \ No newline at end of file diff --git a/backend/skills/cal.py b/backend/skills/cal.py index 970ebde..8318789 100644 --- a/backend/skills/cal.py +++ b/backend/skills/cal.py @@ -6,6 +6,8 @@ https://developers.google.com/calendar/api/quickstart/python https://git.imsam.ca/sam/ThermalTodos/src/branch/main/application/sync_calendar.py (readonly application of previous link) """ -class Cal: +from skills.skill import Skill + +class Cal(Skill): def __init__(self): self.trigger_phrase = "calendar" \ No newline at end of file diff --git a/backend/skills/gmail.py b/backend/skills/gmail.py index f63d2d0..ae6addb 100644 --- a/backend/skills/gmail.py +++ b/backend/skills/gmail.py @@ -6,6 +6,8 @@ https://developers.google.com/gmail/api/quickstart/python https://git.imsam.ca/sam/ThermalTodos/src/branch/main/application/sync_calendar.py (for autherizing user) """ -class Gmail: +from skills.skill import Skill + +class Gmail(Skill): def __init__(self): self.trigger_phrase = "gmail" \ No newline at end of file diff --git a/backend/skills/gpt.py b/backend/skills/gpt.py index 2bef38e..c46f23b 100644 --- a/backend/skills/gpt.py +++ b/backend/skills/gpt.py @@ -1,5 +1,6 @@ +from skills.skill import Skill -class GPT: +class GPT(Skill): def __init__(self): self.trigger_phrase = "gpt" \ No newline at end of file diff --git a/backend/skills/reminders.py b/backend/skills/reminders.py index b040d2a..650b4ba 100644 --- a/backend/skills/reminders.py +++ b/backend/skills/reminders.py @@ -5,8 +5,15 @@ Using notification logic from timers.py to notify at specified time have web app to access list of reminders? (notion api?) look into location based reminders and see if thats possible (maybe ntfy.sh supports this?) + +Look into using ios reminders url scheme to add reminder to ios reminders app - send url to ios device using ntfy.sh + +Even better, use this library: https://github.com/picklepete/pyicloud/blob/master/pyicloud/services/reminders.py +(icloud reminders api, reads/writes reminders from/to ios reminders app) """ -class Reminders: # ntfy.sh notification? +from skills.skill import Skill + +class Reminders(Skill): # ntfy.sh notification? def __init__(self): self.trigger_phrase = "reminders" \ No newline at end of file diff --git a/backend/skills/skill.py b/backend/skills/skill.py new file mode 100644 index 0000000..f799a63 --- /dev/null +++ b/backend/skills/skill.py @@ -0,0 +1,8 @@ + +class Skill: + def __init__(self): + self.trigger_phrase = "" + + def update_dashboard(self): + """Call this function to update data for dashboard""" + pass #TODO: When implementing dashboard, have all skills inherit from this class and call update_dashboard when needed. \ No newline at end of file diff --git a/backend/skills/timers.py b/backend/skills/timers.py index f2d6f36..8ad2dfe 100644 --- a/backend/skills/timers.py +++ b/backend/skills/timers.py @@ -3,9 +3,11 @@ import requests if __name__ == "__main__": # Handle running this script directly vs as a project from config import ntfy_url from utility import parsetime2 + from skill import Skill else: from skills.config import ntfy_url from skills.utility import parsetime2 + from skills.skill import Skill import threading @@ -48,10 +50,10 @@ def run_continuously(schedule, interval=1): # time.sleep(1) -class Timers: +class Timers(Skill): def __init__(self): self.trigger_phrase = "timer" - self.timers = {} + self.timers = {} #This is a good canidate for dashboard data self.schedule = schedule.Scheduler() diff --git a/backend/skills/todos.py b/backend/skills/todos.py index c3fee86..cca15b6 100644 --- a/backend/skills/todos.py +++ b/backend/skills/todos.py @@ -1,5 +1,9 @@ +""" +""" -class Todos: # Notion api? +from skills.skill import Skill + +class Todos(Skill): # Notion api? reminders app? def __init__(self): self.trigger_phrase = "todos" \ No newline at end of file diff --git a/backend/skills/translations.py b/backend/skills/translations.py index 10ed1f0..bc56980 100644 --- a/backend/skills/translations.py +++ b/backend/skills/translations.py @@ -1,7 +1,7 @@ import requests from skills.config import deepl_api_key from skills.config import google_api_key - +from skills.skill import Skill """ Reading material for this: @@ -10,7 +10,7 @@ https://www.deepl.com/en/docs-api https://cloud.google.com/translate/docs/overview """ -class Translations: +class Translations(Skill): def __init__(self): self.trigger_phrase = "translate" diff --git a/backend/skills/weather.py b/backend/skills/weather.py index d0fd520..2de1724 100644 --- a/backend/skills/weather.py +++ b/backend/skills/weather.py @@ -1,5 +1,6 @@ +from skills.skill import Skill -class Weather: #open weather map api +class Weather(Skill): #open weather map api def __init__(self): self.trigger_phrase = "weather" \ No newline at end of file diff --git a/backend/skills/wolfram.py b/backend/skills/wolfram.py index 712499b..e76cff9 100644 --- a/backend/skills/wolfram.py +++ b/backend/skills/wolfram.py @@ -1,5 +1,6 @@ +from skills.skill import Skill -class Wolfram: #wolfram alpha api +class Wolfram(Skill): #wolfram alpha api def __init__(self): self.trigger_phrase = "wolfram" \ No newline at end of file