From 3ff57ab0a653308f3838dc1853be8edcd0ab8fdb Mon Sep 17 00:00:00 2001 From: Lasse Rune Hansen Date: Tue, 9 Jun 2026 19:55:23 +0200 Subject: [PATCH] docs(features/ai-services): add Mistral configuration setup instructions - Add Configuration Setup section with appsettings.Development.json example - Clarify where to add API key (local dev config, not version control) - Add security note about not committing API keys - Update Phase 0 deliverables with clarity Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- docs/features/ai-services.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) 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)