diligence/backend/app/routers
Claude 9a8e6ce1eb Stream C: Multi-provider AI coaching backend + 20-provider registry
AI coaching service (backend/app/services/ai_provider.py):
- Two code paths: OpenAI-compatible (6 providers) + Anthropic (Claude)
- Streaming SSE responses via httpx async
- System prompt built from AGENT_GUIDE + live user context
- Graceful error handling for all provider failures
- Gemini adapter for Google's generateContent API

Chat endpoint (backend/app/routers/ai_chat.py):
- POST /api/ai/chat — SSE streaming response
- GET /api/ai/status — check configured provider
- History capped at 20 messages, content at 4K chars

Provider registry expanded to 20 providers:
- 9 device integrations (strava, polar, garmin, whoop, oura, coros, fitbit, withings, suunto)
- 8 AI providers (openai, openrouter, huggingface, groq, ollama, claude, gemini, custom_ai)
- 3 other (usda, nutritionix, telegram)
- Categorized: device, ai_provider, nutrition, notifications
- COROS: MCP bridge approach (no API integration needed)
- Strava: AI/ML warning per their ToS

Frontend ChatCoach.jsx to follow in next commit.
2026-06-21 23:16:17 +00:00
..
__init__.py Initial commit: full fitness-rewards app 2026-03-14 23:53:00 +00:00
activities.py Fix: add future annotations to all files, fix date field name shadowing type in RewardRedeemRequest 2026-03-15 00:42:13 +00:00
ai_chat.py Stream C: Multi-provider AI coaching backend + 20-provider registry 2026-06-21 23:16:17 +00:00
auth.py Fix all 7 launch blockers from security/QA review 2026-06-16 01:50:09 +00:00
catalog.py Fix: rotate template workouts across all program weeks (Bug 2) 2026-04-09 15:55:22 +00:00
food.py Fix: add future annotations to all files, fix date field name shadowing type in RewardRedeemRequest 2026-03-15 00:42:13 +00:00
integrations.py Fix all 7 launch blockers from security/QA review 2026-06-16 01:50:09 +00:00
meal_plans.py Deliver Steps 3-8: integration config, meal plans, provider registry, MCP connector (14 tools), B2A files, nginx proxy, AGENT_GUIDE, LICENSE 2026-06-15 14:34:09 +00:00
nutrition.py Feature: nutrition module (keto macros + intermittent fasting + electrolytes) 2026-04-12 05:13:52 +00:00
onboarding.py Feature: expanded equipment, integration-aware sync, tooltips 2026-03-15 22:16:55 +00:00
points.py Fix: add future annotations to all files, fix date field name shadowing type in RewardRedeemRequest 2026-03-15 00:42:13 +00:00
programs.py Fix: program workout shortcut now appears under Workout category 2026-04-09 16:13:47 +00:00
support.py Fix all 7 launch blockers from security/QA review 2026-06-16 01:50:09 +00:00