Spaces:
Sleeping
Sleeping
Prathamesh1420
commited on
Commit
•
2f4671c
1
Parent(s):
f600df2
Upload 2 files
Browse files- modules/commands_answers.py +24 -0
- modules/load_agenda.py +58 -0
modules/commands_answers.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Commands
|
2 |
+
functions = ['what you can do', 'what you do', 'functionalities', 'what you know how to do', 'what else do you know how to do']
|
3 |
+
reminders = ['note', 'take a note', 'remind', 'new note', 'new reminder', 'reminder', 'one more note']
|
4 |
+
help = ['search', 'i need help', 'help', 'can you help me', 'i have a question']
|
5 |
+
time = ['what time is it', 'time', 'time now']
|
6 |
+
date = ['what day is it', 'tell me the day']
|
7 |
+
analysis_mode = ['emotion mode', 'activate emotion']
|
8 |
+
agenda = ['events for today', 'agenda today', 'appointments for today']
|
9 |
+
|
10 |
+
commands = [functions, reminders, help, time, date, analysis_mode, agenda]
|
11 |
+
#print(comands)
|
12 |
+
#print(comands[2])
|
13 |
+
|
14 |
+
# Answers
|
15 |
+
functionalities = 'Record reminders, do Google searches, speak the time, speak the date, speak events scheduled for today. I also have the analysis mode that when activated, analyzes your emotion based on your voice'
|
16 |
+
answers_conclusion = ['Ok!', 'Done!', 'All good!', 'Finished!']
|
17 |
+
questions = ['How can I help you?', "Ok, let's go!", 'Right, tell me what you need']
|
18 |
+
answers_ok = ['Tell me if you need something else!', 'I am here for you!']
|
19 |
+
goodbye = ['I will see you soon!', 'See you later!', 'Bye', 'See you next time']
|
20 |
+
|
21 |
+
answers = [functionalities, answers_conclusion, questions, answers_ok, goodbye]
|
22 |
+
|
23 |
+
#print(answers)
|
24 |
+
#print(answers[2])
|
modules/load_agenda.py
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import datetime
|
2 |
+
import pandas as pd
|
3 |
+
|
4 |
+
current_time = datetime.datetime.now()
|
5 |
+
#print(current_time)
|
6 |
+
current_time, current_minute = datetime.datetime.time(current_time).hour, datetime.datetime.time(current_time).minute
|
7 |
+
#print('Current time:', current_time)
|
8 |
+
#print('Current minute: ', current_minute)
|
9 |
+
current_date = datetime.datetime.date(datetime.datetime.today())
|
10 |
+
#print('Current date:', current_date)
|
11 |
+
|
12 |
+
agenda_worksheet = '/Users/jonesgranatyr/Documents/Ensino/IA Expert/Cursos/Virtual assistent/virtual_assistant/agenda.xlsx'
|
13 |
+
agenda = pd.read_excel(agenda_worksheet)
|
14 |
+
#print(agenda)
|
15 |
+
|
16 |
+
description, responsible, hour_agenda = [], [], []
|
17 |
+
for index, row in agenda.iterrows():
|
18 |
+
#print(index)
|
19 |
+
#print(row)
|
20 |
+
date = datetime.datetime.date(row['date'])
|
21 |
+
#print(date)
|
22 |
+
complete_hour = datetime.datetime.strptime(str(row['hour']), '%H:%M:%S')
|
23 |
+
#print(complete_hour)
|
24 |
+
hour = datetime.datetime.time(complete_hour).hour
|
25 |
+
#print(hour)
|
26 |
+
|
27 |
+
if current_date == date:
|
28 |
+
if hour >= current_time:
|
29 |
+
description.append(row['description'])
|
30 |
+
responsible.append(row['responsible'])
|
31 |
+
hour_agenda.append(row['hour'])
|
32 |
+
|
33 |
+
#print(description)
|
34 |
+
#print(responsible)
|
35 |
+
#print(hour_agenda)
|
36 |
+
|
37 |
+
def load_agenda():
|
38 |
+
if description:
|
39 |
+
return description, responsible, hour_agenda
|
40 |
+
else:
|
41 |
+
return False
|
42 |
+
|
43 |
+
#print(load_agenda())
|
44 |
+
|
45 |
+
|
46 |
+
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
|