detect_episodes
Detect hypoglycemic and hyperglycemic episodes from Dexcom CGM data. Set time window and glucose thresholds to find low and high events.
Instructions
Detect hypoglycemic and hyperglycemic episodes.
Args:
minutes: Time period if using Dexcom API (1-1440, default 1440 = 24h)
start_minutes: Window start - minutes ago from now (e.g., 240 = 4 hours ago)
end_minutes: Window end - minutes ago from now (e.g., 180 = 3 hours ago)
low: Low threshold in mg/dL (default 70)
high: High threshold in mg/dL (default 180)
data: Optional external readings for persistence layer integration.
Schema: [{"glucose_mg_dl": int, "timestamp": "ISO-8601"}, ...]
Examples:
detect_episodes(minutes=180) # Episodes in last 3 hours
detect_episodes(start_minutes=240, end_minutes=180) # Episodes 4h to 3h ago
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| low | No | ||
| data | No | ||
| high | No | ||
| minutes | No | ||
| end_minutes | No | ||
| start_minutes | No |