diligence/backend/app/services
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
ai_provider.py Stream C: Multi-provider AI coaching backend + 20-provider registry 2026-06-21 23:16:17 +00:00
crawl_scheduler.py v2: Program research, Groq extraction, and workout tracking (REVIEW — not deployed) 2026-04-03 16:22:53 +00:00
crypto.py Deliver Step 1: Backend cleanup — secrets scrubbed, is_admin column, Telegram optional, crypto service, v4-v7 migrations, .env.example, setup.sh 2026-06-15 14:29:53 +00:00
food_lookup.py Deliver Step 1: Backend cleanup — secrets scrubbed, is_admin column, Telegram optional, crypto service, v4-v7 migrations, .env.example, setup.sh 2026-06-15 14:29:53 +00:00
points_engine.py Feature: clickable program bar on Dashboard + program workout shortcut on Log page 2026-04-09 16:06:38 +00:00
polar_sync.py Fix: add future annotations to all files, fix date field name shadowing type in RewardRedeemRequest 2026-03-15 00:42:13 +00:00
program_research.py Add PHUL and Darebee Foundation Light to known program sources 2026-04-03 16:53:23 +00:00
provider_registry.py Stream C: Multi-provider AI coaching backend + 20-provider registry 2026-06-21 23:16:17 +00:00
resource_matcher.py Feature: expanded equipment, integration-aware sync, tooltips 2026-03-15 22:16:55 +00:00
strava_sync.py Fix: add future annotations to all files, fix date field name shadowing type in RewardRedeemRequest 2026-03-15 00:42:13 +00:00
usda_lookup.py Deliver Step 9: agent-card.json, SKILL.md, USDA lookup, integrations dynamic config, Welcome/Integrations/MealPlan pages, API methods, README, routes 2026-06-15 14:40:34 +00:00