Commit ·
4d858d6
1
Parent(s): b53741d
Changing system prompts and modifying the instructions.
Browse files
Messaging_system/Message_generator.py
CHANGED
|
@@ -196,10 +196,8 @@ class MessageGenerator:
|
|
| 196 |
|
| 197 |
instructions = f"""
|
| 198 |
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
In case of any personalization, you should modify the original header and message very minimal, without changing the style, content and characteristic of the original header and message.
|
| 202 |
-
|
| 203 |
"""
|
| 204 |
|
| 205 |
return instructions
|
|
|
|
| 196 |
|
| 197 |
instructions = f"""
|
| 198 |
|
| 199 |
+
Your task is to select the best 'header' and a 'message' for a {self.Core.get_instrument()} student as a push notification.
|
| 200 |
+
Based on the user instructions, you might need to **modify the selected option** OR **use the original selection as is**.
|
|
|
|
|
|
|
| 201 |
"""
|
| 202 |
|
| 203 |
return instructions
|
Messaging_system/MultiMessage.py
CHANGED
|
@@ -130,7 +130,7 @@ class MultiMessage:
|
|
| 130 |
|
| 131 |
|
| 132 |
instructions = f"""
|
| 133 |
-
Below are the available options to
|
| 134 |
### **Available options:**
|
| 135 |
|
| 136 |
{self.Core.subsequent_examples[step]}
|
|
@@ -174,7 +174,7 @@ We have previously sent these push notifications to the user and The user has no
|
|
| 174 |
{previous_text_str}
|
| 175 |
|
| 176 |
{input_context}
|
| 177 |
-
- The new selection should be different from previous messages and we should not have similar words and phrases
|
| 178 |
|
| 179 |
{user_info}
|
| 180 |
|
|
@@ -281,11 +281,10 @@ We have previously sent these push notifications to the user and The user has no
|
|
| 281 |
jargon_list = "\n".join(f"- {word}" for word in self.Core.config_file["AI_Jargon"])
|
| 282 |
|
| 283 |
instructions = f"""
|
|
|
|
|
|
|
| 284 |
|
| 285 |
-
|
| 286 |
-
You should strictly follow the available options to select the proper header and message.
|
| 287 |
-
In case of any personalization, you should modify the original header and message very minimal, without changing the style, content and characteristic of the original header and message.
|
| 288 |
-
"""
|
| 289 |
|
| 290 |
|
| 291 |
return instructions
|
|
|
|
| 130 |
|
| 131 |
|
| 132 |
instructions = f"""
|
| 133 |
+
Below are the available options to select the best header and message:
|
| 134 |
### **Available options:**
|
| 135 |
|
| 136 |
{self.Core.subsequent_examples[step]}
|
|
|
|
| 174 |
{previous_text_str}
|
| 175 |
|
| 176 |
{input_context}
|
| 177 |
+
- The new selection should be different from previous messages and we should not have similar words and phrases from previous messages.
|
| 178 |
|
| 179 |
{user_info}
|
| 180 |
|
|
|
|
| 281 |
jargon_list = "\n".join(f"- {word}" for word in self.Core.config_file["AI_Jargon"])
|
| 282 |
|
| 283 |
instructions = f"""
|
| 284 |
+
Your task is to select the best 'header' and a 'message' for a {self.Core.get_instrument()} student as a push notification.
|
| 285 |
+
Based on the user instructions, you might need to **modify the selected option** OR **use the original selection as is**.
|
| 286 |
|
| 287 |
+
"""
|
|
|
|
|
|
|
|
|
|
| 288 |
|
| 289 |
|
| 290 |
return instructions
|
Messaging_system/PromptGenerator.py
CHANGED
|
@@ -43,7 +43,7 @@ class PromptGenerator:
|
|
| 43 |
if self.Core.personalization:
|
| 44 |
user_info = f"""
|
| 45 |
|
| 46 |
-
### **Use below information from the user to **modify** the selected header and message (without any change in style, tune and content) and make the final output more personalized.
|
| 47 |
- The user is a {str(self.Core.get_instrument())} student.
|
| 48 |
- {self.safe_get(self.Core.segment_info)}
|
| 49 |
- first name: {self.safe_get(user.get("first_name"))}
|
|
@@ -54,7 +54,8 @@ class PromptGenerator:
|
|
| 54 |
else:
|
| 55 |
|
| 56 |
user_info = f"""
|
| 57 |
-
### **Use below Information to
|
|
|
|
| 58 |
|
| 59 |
Here is the information about the user:
|
| 60 |
- The user is a {str(self.Core.get_instrument())} student.
|
|
@@ -109,7 +110,7 @@ Here is the information about the user:
|
|
| 109 |
|
| 110 |
context = f"""
|
| 111 |
### Task
|
| 112 |
-
Your task is to
|
| 113 |
|
| 114 |
"""
|
| 115 |
|
|
@@ -246,7 +247,6 @@ Your task is to pick a 'header' and a 'message' as a push notification from prov
|
|
| 246 |
"""
|
| 247 |
|
| 248 |
general_instructions = f"""
|
| 249 |
-
- The "header" < 30 and "message" < 100 characters.
|
| 250 |
- Ensure that the output is a valid JSON following above structure.
|
| 251 |
"""
|
| 252 |
|
|
@@ -280,7 +280,7 @@ Your task is to pick a 'header' and a 'message' as a push notification from prov
|
|
| 280 |
else:
|
| 281 |
# one shot prompting
|
| 282 |
example = f"""
|
| 283 |
-
Below are the available options to
|
| 284 |
|
| 285 |
### **Available options:**
|
| 286 |
{self.Core.sample_example}
|
|
|
|
| 43 |
if self.Core.personalization:
|
| 44 |
user_info = f"""
|
| 45 |
|
| 46 |
+
### **Use below information from the user to **modify** the selected header and message (without any change in style, tune and content) and make the final output more personalized if applicable.
|
| 47 |
- The user is a {str(self.Core.get_instrument())} student.
|
| 48 |
- {self.safe_get(self.Core.segment_info)}
|
| 49 |
- first name: {self.safe_get(user.get("first_name"))}
|
|
|
|
| 54 |
else:
|
| 55 |
|
| 56 |
user_info = f"""
|
| 57 |
+
### **Use below Information to select the best header and message from available options:**
|
| 58 |
+
Do not change or modify the selected option and **use the original header and message as is**
|
| 59 |
|
| 60 |
Here is the information about the user:
|
| 61 |
- The user is a {str(self.Core.get_instrument())} student.
|
|
|
|
| 110 |
|
| 111 |
context = f"""
|
| 112 |
### Task
|
| 113 |
+
Your task is to select a 'header' and a 'message' as a push notification from provided options for a {self.Core.get_instrument()} student.
|
| 114 |
|
| 115 |
"""
|
| 116 |
|
|
|
|
| 247 |
"""
|
| 248 |
|
| 249 |
general_instructions = f"""
|
|
|
|
| 250 |
- Ensure that the output is a valid JSON following above structure.
|
| 251 |
"""
|
| 252 |
|
|
|
|
| 280 |
else:
|
| 281 |
# one shot prompting
|
| 282 |
example = f"""
|
| 283 |
+
Below are the available options to select the header and message for the push notification:
|
| 284 |
|
| 285 |
### **Available options:**
|
| 286 |
{self.Core.sample_example}
|