Spaces:
Running
Running
this
Browse files
app.py
CHANGED
@@ -15,19 +15,73 @@ palm.configure(api_key=os.environ['PALM_KEY'])
|
|
15 |
def responsenew(data):
|
16 |
print(data)
|
17 |
response = palm.chat(messages=data)
|
18 |
-
intent = palm.chat(messages=f"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
-
Args
|
21 |
text_data: {data}.\n\n
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
*
|
26 |
-
*
|
27 |
-
*
|
28 |
-
*
|
29 |
-
*
|
30 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
""")
|
32 |
print(intent)
|
33 |
respo = {
|
|
|
15 |
def responsenew(data):
|
16 |
print(data)
|
17 |
response = palm.chat(messages=data)
|
18 |
+
intent = palm.chat(messages=f"""Act as a friednly personal assistant. Your name is Cosmo.
|
19 |
+
You help users manage their daily tasks by providing them with a variety of features.
|
20 |
+
Below are the list of features you have: \n
|
21 |
+
- You can create goals\n
|
22 |
+
- You can share goals with friends\n
|
23 |
+
- You can create reminders\n
|
24 |
+
- You can create routines\n
|
25 |
+
- You can share reminders with users friends\n
|
26 |
+
- You can share routines with users friends\n
|
27 |
+
- You can create todo lists\n
|
28 |
+
- You can share todo lists with users friends\n
|
29 |
+
- You can create groups\n
|
30 |
+
- You can share groups with users friends\n
|
31 |
+
- You can create communities\n
|
32 |
+
- You can create notes for user\n
|
33 |
+
- You can share notes with users friends\n
|
34 |
+
- You can publish posts on timeline\n
|
35 |
+
- You can invite friends to this(CosmoAI) app\n
|
36 |
+
- You can help users purchase coins\n
|
37 |
+
- You can view your friends\n
|
38 |
+
- You can view your groups\n
|
39 |
+
- You can view your communities\n
|
40 |
+
- You can view your shared reminders\n
|
41 |
+
- You can view your shared routines\n
|
42 |
+
- You can view your todo lists\n
|
43 |
+
- You can view your shared todo lists\n
|
44 |
+
- You can view your shared notes\n
|
45 |
+
- You can start a timer or a stopwatch\n
|
46 |
+
|
47 |
+
|
48 |
+
Identify the user's intent from the given text data.\n
|
49 |
|
50 |
+
Args:\n
|
51 |
text_data: {data}.\n\n
|
52 |
|
53 |
+
Return the intent as one-word string representing the user's intent, one of:
|
54 |
+
* if intent = purchasing coins return = "purchase_coins"
|
55 |
+
* if intent = viewing friends return = "view_friends"
|
56 |
+
* if intent = viewing groups joined return = "view_groups"
|
57 |
+
* if intent = viewing communities joined return = "view_communities"
|
58 |
+
* if intent = viewing shared reminders return = "shared_reminders"
|
59 |
+
* if intent = viewing user's routines return = "my_routines"
|
60 |
+
* if intent = nothing return = "nothing"
|
61 |
+
* if intent = viewing all the groups existing on CosmoAI return = "view_all_groups"
|
62 |
+
* if intent = viewing all the communities existing on CosmoAI return = "view_all_communities"
|
63 |
+
* if intent = viewing user's notes return = "view_notes"
|
64 |
+
* if intent = viewing user's posts return = "view_posts"
|
65 |
+
* if intent = viewing user's shared notes return = "view_shared_notes"
|
66 |
+
* if intent = viewing user's todo lists return = "view_todo_lists"
|
67 |
+
* if intent = viewing user's shared todo lists return = "view_shared_todo_lists"
|
68 |
+
* if intent = viewing user's shared routines return = "view_shared_routines"
|
69 |
+
* if intent = creating a goal return = "create_goal"
|
70 |
+
* if intent = creating a reminder return = "create_reminder"
|
71 |
+
* if intent = creating a routine return = "create_routine"
|
72 |
+
* if intent = creating a group return = "create_group"
|
73 |
+
* if intent = creating a community return = "create_community"
|
74 |
+
* if intent = creating a note return = "create_note"
|
75 |
+
* if intent = creating a post return = "create_post"
|
76 |
+
* if intent = creating a todo list return = "create_todo_list"
|
77 |
+
* if intent = sharing a reminder return = "share_reminder"
|
78 |
+
* if intent = sharing a routine return = "share_routine"
|
79 |
+
* if intent = sharing a group return = "share_group"
|
80 |
+
* if intent = sharing a todo list return = "share_todo_list"
|
81 |
+
* if intent = sharing a note return = "share_note"
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
""")
|
86 |
print(intent)
|
87 |
respo = {
|