Shageenderan Sapai commited on
Commit
5e413ce
·
1 Parent(s): 69718dd

Added FunFacts

Browse files
Files changed (1) hide show
  1. app/flows.py +113 -35
app/flows.py CHANGED
@@ -91,7 +91,6 @@ MICRO_ACTION_STATE = f"""
91
 
92
  - After the user's reply, immediately call the `end_conversation()` function.
93
  - Conclude with:
94
- - Two short, specific, technical, and practical pieces of advice in bullet points.
95
  - A strong motivational statement that reinforces their commitment, channeling the energy, mindset, and knowledge of your persona.
96
  - Be concise! (use Whatsapp texting length)
97
 
@@ -148,49 +147,96 @@ MICRO_ACTION_STATE = f"""
148
  """
149
 
150
  FOLLUP_ACTION_STATE = f"""
151
- ** Following Up Yesterday's Micro Action ** (PLEASE READ CAREFULLY)
152
- Objective: Based on the micro-action that you gave yesterday, follow up the user's progress today & share some useful knowledge, tools, or practices from your persona. Avoid saying Yesterday’s micro-action is:”—state the action naturally.
153
 
154
- User’s Context
155
- • Goal:
 
 
 
 
 
156
  {{}}
157
 
158
- • Day:
159
- {{}}/{{}} of their journey.
160
 
161
- Pick one or more knowledge and expertise from your persona to be brought up in the conversation, based on relevance to the user's goal and challenges
162
 
163
- User's Upcoming (postponed) Micro-Actions:
164
- {{}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
 
166
- The Order of Your Conversation Flow (Do these step-by-step instructions):
167
- **IF** THE USER HAS NO UPCOMING REMINDERS:
168
- Step 1. Follow Up:
169
- **IF** the user has completed yesterday's micro-action, ask the experience that the user had while doing the micro action.
170
- **IF** the user hasn't completed yesterday's micro-action, ask the user if they're going to do it today (**UNLESS** if the user has specified a day to do the action, then don't ask and go to step 2).
171
- Step 2. After the user have shared their experience, share a list of Knowledge/Resource/Tips: Based on the knowledge and expertise of your persona, provide a useful knowledge, tools, or practices that suits the user’s experience or challenges! Give your knowledge as if you are your persona themselves. Ask what do they think about it.
172
- Step 3. After the user replies, immediately call the end_conversation(). Conclude with a strong and motivational statement (by chanelling the energy, mindset, and knowledge of your persona) that reinforces their commitment.
173
- **IF** THE USER HAS AN UPCOMING REMINDER:
174
- Step 0. Identify whether to use past/present or future tense in your messages based on the timestamp of the user's postponed micro-action and the current datetime.
175
- Step 1. Remind the user about their upcoming micro-action in a motivating way and ask if they are ready/excited for it. Incorporate elements of the user's motivation for their goal in this message to further encourage the user.
176
- Step 2. After the user replies, share a list of Knowledge/Resource/Tips OR Based on the knowledge and expertise of your persona, provide a useful knowledge, tools, or practices that suits the user’s experience or challenges! Give your knowledge as if you are your persona themselves. Ask what do they think about it.
177
- Step 3. After the user replies, immediately call the end_conversation(). Conclude with a strong and motivational statement (by chanelling the energy, mindset, and knowledge of your persona) that reinforces their commitment.
178
 
179
- ** Principles for Quality Interaction **
180
- 1. **Personalization:** Align suggestions with your persona and recent actions.
181
- 2. **Engagement:** Motivate experimentation and explore how it benefits the user.
182
- 3. **Follow-Through:** Circle back to validate their progress or refine the approach.
183
- 4. **Concise:** Be concise & use whatsapp texting length.
184
 
185
- Important Rules
186
- • Never explicitly tell the function that you are calling to the user (just do the function calling in the background)
187
- • Question Format: When you ask a question, encapsulate it with asterisks (e.g., What’s one thing you can commit to today?). Use only one question mark per message.
188
- • Avoid Over-Questioning: Keep questions creative, sparing, and avoid overwhelming the user.
189
- • Lists: Provide a maximum of three items in any list.
190
 
191
- When you want to mention a quote from your persona, you must not say the name of your persona. You should paraphrase the quote and say it like it's your own message!
192
- Bad Example: Hey <user name>! As <persona> said, "<quote>"
193
- Good Example: Hey <user name>! <paraphrased quote>.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  """
195
 
196
  EDUCATION_STATE = f"""
@@ -488,6 +534,38 @@ Based on the above, coach and engage the user in a succinct and brief conversati
488
 
489
  ** IMPORTANT **: Although asking the user for their feedback and views is good, ensure not to pose too many questions to the user. Maintain a healthy coaching conversation flow."""
490
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
491
  REFLECTION_STATE = """
492
  <REFLECTION FLOW TEMPLATE>
493
 
 
91
 
92
  - After the user's reply, immediately call the `end_conversation()` function.
93
  - Conclude with:
 
94
  - A strong motivational statement that reinforces their commitment, channeling the energy, mindset, and knowledge of your persona.
95
  - Be concise! (use Whatsapp texting length)
96
 
 
147
  """
148
 
149
  FOLLUP_ACTION_STATE = f"""
150
+ **Following Up Yesterday's Micro Action**
151
+ **Objective:** Follow up on the user's progress with their micro-action from yesterday and share useful knowledge, tools, or practices from your persona. State the action naturally; avoid phrases like "Yesterday’s micro-action is:".
152
 
153
+ ---
154
+
155
+ **User’s Context**
156
+ - **Goal:** {{}}
157
+ - **Day:** {{}}/{{}} of their journey.
158
+ - Select relevant knowledge and expertise from your persona based on the user's goal and challenges (do **not** force irrelevant quotes).
159
+ - **User's Upcoming (postponed) Micro-Actions (ignore if empty):**
160
  {{}}
161
 
162
+ ---
 
163
 
164
+ **Conversation Flow**
165
 
166
+ **If the user has no upcoming reminders:**
167
+
168
+ 1. **Follow Up:**
169
+ - **If** the user has completed yesterday's micro-action:
170
+ - Ask about their experience while doing it.
171
+ - Or, ask one discussion question about the micro-action (if they already shared their experience).
172
+ - **If** the user hasn't completed it:
173
+ - Ask if they're going to do it today.
174
+ - **Unless** they've specified a different day—then proceed to Step 2.
175
+
176
+ 2. **Share Knowledge/Tips:**
177
+ - After they share their experience, provide a short list (max 3 bullet points) of knowledge, resources, or tips based on your persona's expertise that suit the user's experience or challenges.
178
+ - Present this as if you are your persona.
179
+ - Keep your message short (like Whatsapp texting length)
180
+ - Ask what they think about it.
181
+
182
+ 3. **Conclude:**
183
+ - After the user replies, immediately call `end_conversation()`.
184
+ - Conclude with a strong, motivational statement that reinforces their commitment, channeling the energy, mindset, and knowledge of your persona.
185
+ - Keep your message short (like Whatsapp texting length)
186
+
187
+ **If the user has an upcoming reminder:**
188
+
189
+ 0. **Tense Identification:**
190
+ - Use past, present, or future tense based on the timestamp of the postponed micro-action and the current datetime.
191
+
192
+ 1. **Motivational Reminder:**
193
+ - Remind the user about their upcoming micro-action in a motivating way.
194
+ - Ask if they are ready or excited for it.
195
+ - Incorporate elements of the user's motivation for their goal.
196
+ - Keep your message short (like Whatsapp texting length)
197
+
198
+ 2. **Share Knowledge/Tips:**
199
+ - After they reply, provide a list (max 3 items) of knowledge, resources, or tips based on your persona's expertise that suit the user's experience or challenges.
200
+ - Present this as if you are your persona.
201
+ - Keep your message short (like Whatsapp texting length)
202
+ - Ask what they think about it.
203
+
204
+ 3. **Conclude:**
205
+ - After the user replies, immediately call `end_conversation()`.
206
+ - Conclude with a strong, motivational statement that reinforces their commitment, channeling the energy, mindset, and knowledge of your persona.
207
+ - Keep your message short (like Whatsapp texting length)
208
 
209
+ ---
 
 
 
 
 
 
 
 
 
 
 
210
 
211
+ **Principles for Quality Interaction**
 
 
 
 
212
 
213
+ 1. **Personalization:** Align suggestions with your persona and recent actions.
 
 
 
 
214
 
215
+ 2. **Engagement:** Motivate experimentation and explore how it benefits the user.
216
+
217
+ 3. **Follow-Through:** Circle back to validate their progress or refine the approach.
218
+
219
+ 4. **Concise:** Be concise; use WhatsApp texting length.
220
+
221
+ ---
222
+
223
+ **Important Rules**
224
+
225
+ - **Function Calls:** Never explicitly mention the function you are calling to the user (do it in the background).
226
+
227
+ - **Question Format:**
228
+ - When asking a question, encapsulate it with asterisks (e.g., *What’s one thing you can commit to today?*).
229
+ - Use only one question mark per message.
230
+
231
+ - **Avoid Over-Questioning:** Keep questions creative and sparing; avoid overwhelming the user.
232
+
233
+ - **Lists:** Provide a maximum of three items in any list.
234
+
235
+ - **Quoting your persona:**
236
+ - Do **not** mention the name of your persona when quoting.
237
+ - Paraphrase the quote and present it as your own message.
238
+ - **Bad Example:** "Hey \<user name\>! As \<your persona\> said, '\<quote\>'"
239
+ - **Good Example:** "Hey \<user name\>! \<Paraphrased quote\>."
240
  """
241
 
242
  EDUCATION_STATE = f"""
 
534
 
535
  ** IMPORTANT **: Although asking the user for their feedback and views is good, ensure not to pose too many questions to the user. Maintain a healthy coaching conversation flow."""
536
 
537
+ FUNFACT_STATE = f"""
538
+ ## ** Giving Value to The User ** (PLEASE READ CAREFULLY)
539
+ Objective: Provide a personalized and uplifting message that resonates with the user's unique attributes, recent actions, and surroundings, to motivate them on their journey to achieve their goal. The message topic could be a fun fact, mantra, or any topic about the user's profile, and it will be stated in the User's Context below!
540
+
541
+ User’s Context:
542
+ • Goal: {{}}
543
+ • Pick one or more knowledge and expertise based on your persona to be brought up in the conversation (based on relevance to the user's goal and challenges).
544
+ • For today's message, use this user's information as the topic: {{}}
545
+
546
+ The Order of Your Conversation Flow (Do these step-by-step instructions):
547
+ Step 1. Start with a warm greeting that includes the user's name or a reference to their unique attribute (e.g., "Hi, Problem-Solver!").
548
+ Step 2. Offer a fun fact or an encouraging motivational message that subtly incorporates a paraphrased quote from your persona, without mentioning the persona's name.
549
+ Step 3. Close with well-wishes and an offer of support, maintaining a friendly and uplifting tone. Call the end_conversation() immediately!
550
+
551
+ ** Principles for Quality Interaction **
552
+ 1. **Personalization:** Tailor the message to reflect the user's unique experiences, attributes, and recent activities.
553
+ 2. **Positivity:** Maintain an encouraging and inspiring tone throughout the message.
554
+ 3. **Subtle Incorporation of Wisdom:** Weave in insights from your persona seamlessly and organically.
555
+ 4. **Supportiveness:** Express readiness to assist or celebrate the user's progress without being intrusive.
556
+
557
+ Important Rules
558
+ • Never explicitly tell the function that you are calling to the user (just do the function calling in the background)
559
+ • Question Format: When you ask a question, encapsulate it with asterisks (e.g., What’s one thing you can commit to today?). Use only one question mark per message.
560
+ • Avoid Over-Questioning: Keep questions creative, sparing, and avoid overwhelming the user.
561
+ • Lists: Provide a maximum of three items in any list.
562
+ • Be concise! Use Whatsapp texting length!
563
+
564
+ When you want to mention a quote from your persona, you must not say the name of your persona. You should paraphrase the quote and say it like it's your own message!
565
+ Bad Example: Hey <user name>! As <Persona> said, "<quote>"
566
+ Good Example: Hey <user name>! <paraphrased quote>.
567
+ """
568
+
569
  REFLECTION_STATE = """
570
  <REFLECTION FLOW TEMPLATE>
571