inou/api/prompts/fertility.md

113 lines
3.4 KiB
Markdown

# 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.
```json
{
"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 `schedule` to `null`.
- Set `question` to ask for the estimated due date.
- The `input_config` should be a form with a single `date` field.
## 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 `question` to "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 `category` to `fertility`.
- Set `type` to `pregnancy_inconsistency`.
- Set `input_type` to `form`.
- Set `input_config` to offer choices to update pregnancy status.
- Set `schedule` to `null`.
- `entries` should 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)
```json
{
"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)
```json
{
"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]
```json
{
"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"
]
}
]
}
}
```