Spaces:
Runtime error
Runtime error
this
Browse files
app.py
CHANGED
|
@@ -9,6 +9,37 @@ palm.configure(api_key=os.environ["PALM_KEY"])
|
|
| 9 |
# Select the PaLM 2 model
|
| 10 |
# model = 'models/text-bison-001'
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
# * if intent = viewing user's notes return = "view_notes"
|
| 13 |
# * if intent = viewing user's posts return = "view_posts"
|
| 14 |
# * if intent = viewing user's shared notes return = "view_shared_notes"
|
|
@@ -38,47 +69,19 @@ def responsenew(data):
|
|
| 38 |
|
| 39 |
# response = palm.chat( messages=data)
|
| 40 |
intent = palm.chat(
|
| 41 |
-
messages="""
|
| 42 |
-
You help users manage their daily tasks by providing them with a variety of features.
|
| 43 |
-
Below are the list of features you have: \n
|
| 44 |
-
- You can create goals\n
|
| 45 |
-
- You can share goals with friends\n
|
| 46 |
-
- You can create reminders\n
|
| 47 |
-
- You can create routines\n
|
| 48 |
-
- You can share reminders with users friends\n
|
| 49 |
-
- You can share routines with users friends\n
|
| 50 |
-
- You can create todo lists\n
|
| 51 |
-
- You can share todo lists with users friends\n
|
| 52 |
-
- You can create groups\n
|
| 53 |
-
- You can share groups with users friends\n
|
| 54 |
-
- You can create communities\n
|
| 55 |
-
- You can create notes for user\n
|
| 56 |
-
- You can share notes with users friends\n
|
| 57 |
-
- You can publish posts on timeline\n
|
| 58 |
-
- You can invite friends to this(CosmoAI) app\n
|
| 59 |
-
- You can help users purchase coins\n
|
| 60 |
-
- You can view your friends\n
|
| 61 |
-
- You can view your groups\n
|
| 62 |
-
- You can view your communities\n
|
| 63 |
-
- You can view your shared reminders\n
|
| 64 |
-
- You can view your shared routines\n
|
| 65 |
-
- You can view your todo lists\n
|
| 66 |
-
- You can view your shared todo lists\n
|
| 67 |
-
- You can view your shared notes\n
|
| 68 |
-
- You can start a timer or a stopwatch\n\n
|
| 69 |
-
|
| 70 |
|
| 71 |
Identify the user's intent from text_data below:\n
|
| 72 |
Arguments: text_data = {data}\n\n
|
| 73 |
-
Return the intent as one-word string representing the user's intent,
|
| 74 |
-
* if intent
|
| 75 |
-
* if intent
|
| 76 |
-
* if intent
|
| 77 |
-
* if intent
|
| 78 |
-
* if intent
|
| 79 |
-
* if intent
|
| 80 |
-
* if intent
|
| 81 |
-
* if intent
|
| 82 |
|
| 83 |
""",
|
| 84 |
)
|
|
|
|
| 9 |
# Select the PaLM 2 model
|
| 10 |
# model = 'models/text-bison-001'
|
| 11 |
|
| 12 |
+
|
| 13 |
+
# Act as a friendly personal assistant. ".
|
| 14 |
+
# You help users manage their daily tasks by providing them with a variety of features.
|
| 15 |
+
# Below are the list of features you have: \n
|
| 16 |
+
# - You can create goals\n
|
| 17 |
+
# - You can share goals with friends\n
|
| 18 |
+
# - You can create reminders\n
|
| 19 |
+
# - You can create routines\n
|
| 20 |
+
# - You can share reminders with users friends\n
|
| 21 |
+
# - You can share routines with users friends\n
|
| 22 |
+
# - You can create todo lists\n
|
| 23 |
+
# - You can share todo lists with users friends\n
|
| 24 |
+
# - You can create groups\n
|
| 25 |
+
# - You can share groups with users friends\n
|
| 26 |
+
# - You can create communities\n
|
| 27 |
+
# - You can create notes for user\n
|
| 28 |
+
# - You can share notes with users friends\n
|
| 29 |
+
# - You can publish posts on timeline\n
|
| 30 |
+
# - You can invite friends to this(CosmoAI) app\n
|
| 31 |
+
# - You can help users purchase coins\n
|
| 32 |
+
# - You can view your friends\n
|
| 33 |
+
# - You can view your groups\n
|
| 34 |
+
# - You can view your communities\n
|
| 35 |
+
# - You can view your shared reminders\n
|
| 36 |
+
# - You can view your shared routines\n
|
| 37 |
+
# - You can view your todo lists\n
|
| 38 |
+
# - You can view your shared todo lists\n
|
| 39 |
+
# - You can view your shared notes\n
|
| 40 |
+
# - You can start a timer or a stopwatch\n\n
|
| 41 |
+
|
| 42 |
+
|
| 43 |
# * if intent = viewing user's notes return = "view_notes"
|
| 44 |
# * if intent = viewing user's posts return = "view_posts"
|
| 45 |
# * if intent = viewing user's shared notes return = "view_shared_notes"
|
|
|
|
| 69 |
|
| 70 |
# response = palm.chat( messages=data)
|
| 71 |
intent = palm.chat(
|
| 72 |
+
messages="""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
Identify the user's intent from text_data below:\n
|
| 75 |
Arguments: text_data = {data}\n\n
|
| 76 |
+
Return the intent as one-word string representing the user's intent, as mentioned below:
|
| 77 |
+
* if intent is purchasing coins return "purchase_coins"
|
| 78 |
+
* if intent is viewing friends return "view_friends"
|
| 79 |
+
* if intent is viewing groups joined return "view_groups"
|
| 80 |
+
* if intent is viewing communities joined return "view_communities"
|
| 81 |
+
* if intent is viewing shared reminders return "shared_reminders"
|
| 82 |
+
* if intent is viewing user's routines return "my_routines"
|
| 83 |
+
* if intent is viewing all the groups existing return "view_all_groups"
|
| 84 |
+
* if intent is viewing all the communities existing return "view_all_communities"
|
| 85 |
|
| 86 |
""",
|
| 87 |
)
|