diff --git a/docs/features/ai-services.md b/docs/features/ai-services.md index 953b208..cfac2ba 100644 --- a/docs/features/ai-services.md +++ b/docs/features/ai-services.md @@ -91,6 +91,29 @@ As a learner, I want AI-powered features like generated stories, speech recognit - Vosk Python library + German model - Coqui TTS Python library + German model +### Configuration Setup + +Add the following to your local `appsettings.Development.json` file: + +```json +{ + "Mistral": { + "ApiKey": "YOUR_MISTRAL_API_KEY", + "BaseUrl": "https://api.mistral.ai/v1/", + "DefaultModel": "mistral-medium", + "TimeoutSeconds": 30, + "MaxRetries": 3, + "RateLimitPerMinute": 10, + "EnableCaching": true, + "CacheTTLMinutes": 60, + "CircuitBreakerFailureThreshold": 5, + "CircuitBreakerResetMinutes": 1 + } +} +``` + +**Note**: Do NOT commit your API key to version control. Use environment variables in production or keep it in local development configuration files only. + ### Data Flow #### Story Generation Flow @@ -148,8 +171,8 @@ As a learner, I want AI-powered features like generated stories, speech recognit **Deliverables:** - Standalone Mistral API connector component -- Configurable via appsettings.json -- Resilient to API failures +- Configurable via appsettings.json (add to local appsettings.Development.json) +- Resilient to API failures (retry, rate limiting, circuit breaker, caching) - Testable with mocked HTTP client ### Phase 1: Configuration & Interfaces (2 hours)