3.4 KiB
Fertility Prompt
Extract menstrual/fertility cycle details. Also handles new pregnancy announcements.
User said: "{{INPUT}}" Language: {{LANGUAGE}} Existing Types: {{EXISTING_TYPES}}
IMPORTANT: Respond with ONLY the JSON object. No explanations, no markdown fences, no text before or after.
{
"question": "tracking question in {{LANGUAGE}}",
"type": "fertility_type",
"input_type": "form|checkbox",
"schedule": [{"days": [...], "time": "HH:MM"}],
"input_config": {"fields": [...]},
"entries": [{"value": "...", "data": {...}}]
}
Special Handling for Pregnancy
If the user announces a pregnancy (e.g., "I'm pregnant"), do NOT create an entries array immediately. The goal is to ask a follow-up question to get more details.
- Set
scheduletonull. - Set
questionto ask for the estimated due date. - The
input_configshould be a form with a singledatefield.
Handling Contradictions (e.g., Period during Pregnancy)
If the user reports a period and "pregnancy" is listed in the Existing Types, respond with care and offer gentle options.
- Set
questionto "I'm so sorry, I know this can be a difficult time. I've noted you're tracking a pregnancy and have logged a new period. How would you like me to update your status?". - Set
categorytofertility. - Set
typetopregnancy_inconsistency. - Set
input_typetoform. - Set
input_configto offer choices to update pregnancy status. - Set
scheduletonull. entriesshould be null.
Schedule format
- Period/cycle tracking is typically daily.
- A new pregnancy announcement is a one-time event (
schedule: null).
Fertility types
period, menstruation, ovulation, cycle, fertility, pms, cramps, pregnancy
Standard fields
- flow: select [Spotting, Light, Medium, Heavy]
- pain: scale 0-5
- mood: select [Good, Okay, Low, Anxious, Irritable]
Examples
Input: "My period started today" Existing Types: (none yet)
{
"question": "How is your period today?",
"type": "period",
"input_type": "form",
"schedule": [{"days": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], "time": "20:00"}],
"input_config": {"fields": [
{"key": "flow", "type": "select", "label": "Flow", "options": ["Spotting", "Light", "Medium", "Heavy"]},
{"key": "pain", "type": "scale", "label": "Pain (0-5)"}
]},
"entries": [{"value": "Period started", "data": {"started": true}}]
}
Input: "I'm pregnant!" Existing Types: (none yet)
{
"question": "Congratulations! What is your estimated due date?",
"category": "fertility",
"type": "pregnancy",
"input_type": "form",
"schedule": null,
"input_config": {
"fields": [
{
"key": "estimated_due_date",
"type": "date",
"label": "Estimated Due Date"
}
]
}
}
Input: "I just had my period" Existing Types: - fertility: [pregnancy]
{
"question": "I'm so sorry, I know this can be a difficult time. I've noted you're tracking a pregnancy and have logged a new period. How would you like me to update your status?",
"category": "fertility",
"type": "pregnancy_inconsistency",
"input_type": "form",
"schedule": null,
"input_config": {
"fields": [
{
"key": "pregnancy_status",
"type": "select",
"label": "Update my status",
"options": [
"End pregnancy tracking",
"This was spotting or something else",
"Keep tracking pregnancy"
]
}
]
}
}