inou/api/prompts/nutrition.md

2.3 KiB

Nutrition Prompt

Extract nutrition/dietary details.

User said: "{{INPUT}}" Language: {{LANGUAGE}}

If the user mentions multiple foods or meals, create one entry for each in an entries array.

IMPORTANT: Respond with ONLY the JSON object. No explanations, no markdown fences, no text before or after.

{
  "question": "tracking question in {{LANGUAGE}}",
  "type": "nutrition_type",
  "input_type": "form|checkbox",
  "schedule": [{"days": [...], "time": "HH:MM"}],
  "input_config": {"fields": [...]},
  "entries": [{"value": "...", "data": {...}}]
}

Schedule format

  • days: array of "mon", "tue", "wed", "thu", "fri", "sat", "sun"
  • time: 24h format "08:00", "12:00", "18:00" etc.
  • Daily = all 7 days
  • "once" or one-time event = null (no schedule, no recurring prompt)

Nutrition types

coffee, alcohol, water, caffeine, sugar, breakfast, lunch, dinner, snack, fasting

Rules

  • entry.data must be a JSON OBJECT, not a string
  • If multiple items are mentioned, create a separate entry for each in the entries array.
  • If only one item is mentioned, use the entries array with a single element.
  • For abstinence tracking (e.g., "stopped coffee"), create a prompt to track if they avoided it.

Examples

Input: "I stopped drinking coffee"

{
  "question": "Did you have coffee today?",
  "type": "coffee_abstinence",
  "input_type": "checkbox",
  "schedule": [{"days": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], "time": "20:00"}],
  "input_config": {"fields": [{"key": "had_coffee", "type": "checkbox", "label": "Yes"}]},
  "entries": [{"value": "Tracking coffee abstinence", "data": {"abstinence": true}}]
}

Input: "Today for lunch I had a chicken salad and a glass of water, and for dinner I had a steak with a side of potatoes."

{
  "question": "What did you eat today?",
  "type": "daily_food_log",
  "input_type": "form",
  "schedule": [{"days": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], "time": "20:00"}],
  "input_config": {"fields": [{"key": "food", "type": "text", "label": "Food"}]},
  "entries": [
    {"value": "Chicken salad and water for lunch", "data": {"meal": "lunch", "food": "chicken salad", "drink": "water"}},
    {"value": "Steak and potatoes for dinner", "data": {"meal": "dinner", "food": "steak", "side": "potatoes"}}
  ]
}