Commit ·
aebb122
1
Parent(s): 32585a6
- simplyfing UI
Browse files- merging CTA with message instructions for simplification
- eliminating optional things not needed
- Messaging_system/MultiMessage.py +3 -0
- Messaging_system/PromptGenerator.py +5 -3
- app.py +3 -8
Messaging_system/MultiMessage.py
CHANGED
|
@@ -172,6 +172,9 @@ class MultiMessage:
|
|
| 172 |
# Craft the prompt
|
| 173 |
prompt = f"""
|
| 174 |
We have previously sent these push notifications to the user and The user has not re-engaged yet:
|
|
|
|
|
|
|
|
|
|
| 175 |
** Previous messages **
|
| 176 |
{previous_text_str}
|
| 177 |
|
|
|
|
| 172 |
# Craft the prompt
|
| 173 |
prompt = f"""
|
| 174 |
We have previously sent these push notifications to the user and The user has not re-engaged yet:
|
| 175 |
+
User info:
|
| 176 |
+
{self.Core.segment_info}
|
| 177 |
+
|
| 178 |
** Previous messages **
|
| 179 |
{previous_text_str}
|
| 180 |
|
Messaging_system/PromptGenerator.py
CHANGED
|
@@ -94,10 +94,11 @@ class PromptGenerator:
|
|
| 94 |
|
| 95 |
prompt = f"""
|
| 96 |
{input_context}
|
| 97 |
-
{cta}
|
| 98 |
|
| 99 |
{user_info}
|
| 100 |
|
|
|
|
|
|
|
| 101 |
{general_instructions}
|
| 102 |
|
| 103 |
{output_instructions}
|
|
@@ -128,8 +129,9 @@ class PromptGenerator:
|
|
| 128 |
|
| 129 |
instructions = f"""
|
| 130 |
|
| 131 |
-
**
|
| 132 |
-
|
|
|
|
| 133 |
"""
|
| 134 |
|
| 135 |
return instructions
|
|
|
|
| 94 |
|
| 95 |
prompt = f"""
|
| 96 |
{input_context}
|
|
|
|
| 97 |
|
| 98 |
{user_info}
|
| 99 |
|
| 100 |
+
{cta}
|
| 101 |
+
|
| 102 |
{general_instructions}
|
| 103 |
|
| 104 |
{output_instructions}
|
|
|
|
| 129 |
|
| 130 |
instructions = f"""
|
| 131 |
|
| 132 |
+
### **Main instructions**
|
| 133 |
+
|
| 134 |
+
{self.Core.CTA} \n
|
| 135 |
"""
|
| 136 |
|
| 137 |
return instructions
|
app.py
CHANGED
|
@@ -174,13 +174,8 @@ with st.sidebar:
|
|
| 174 |
|
| 175 |
# ─ Personalisation
|
| 176 |
st.text_area("Segment info *", key="segment_info")
|
| 177 |
-
st.text_area("
|
| 178 |
-
|
| 179 |
-
st.text_area("Message style", key="message_style",
|
| 180 |
-
placeholder="Be kind and friendly…")
|
| 181 |
-
st.text_area("Additional instructions", key="additional_instructions",
|
| 182 |
-
placeholder="e.g. Mention the number weeks since their last practice")
|
| 183 |
-
st.text_area("Sample example", key="sample_example",
|
| 184 |
placeholder="Hello! We have crafted…")
|
| 185 |
st.number_input("Number of samples (default = 10)", 1, 50,
|
| 186 |
key="number_of_samples")
|
|
@@ -252,7 +247,7 @@ with tab2:
|
|
| 252 |
|
| 253 |
# ─ simple validation
|
| 254 |
if not st.session_state.CTA.strip() or not st.session_state.segment_info.strip() or not st.session_state.brand.strip():
|
| 255 |
-
st.error("
|
| 256 |
st.stop()
|
| 257 |
|
| 258 |
if st.session_state.get("generate_clicked", False):
|
|
|
|
| 174 |
|
| 175 |
# ─ Personalisation
|
| 176 |
st.text_area("Segment info *", key="segment_info")
|
| 177 |
+
st.text_area("First Message Instructions*", key="CTA")
|
| 178 |
+
st.text_area("Examples", key="sample_example",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
placeholder="Hello! We have crafted…")
|
| 180 |
st.number_input("Number of samples (default = 10)", 1, 50,
|
| 181 |
key="number_of_samples")
|
|
|
|
| 247 |
|
| 248 |
# ─ simple validation
|
| 249 |
if not st.session_state.CTA.strip() or not st.session_state.segment_info.strip() or not st.session_state.brand.strip():
|
| 250 |
+
st.error("Message Instructions, Segment info, and brand are mandatory 🚫")
|
| 251 |
st.stop()
|
| 252 |
|
| 253 |
if st.session_state.get("generate_clicked", False):
|