Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs-chat.die-coaching-akademie.de/llms.txt

Use this file to discover all available pages before exploring further.

Tests use Python unittest and FastAPI’s TestClient.

Run tests

cd faq_bot
source .venv/bin/activate
python -m unittest discover -s tests

Current coverage focus

Public routes

Demo page, /health, /chat, deterministic answers.

Safety behavior

Placeholder OpenAI key handling, prompt-injection rejection, admin auth.

Answer logic

Infoabende, prices, payment terms, workshops, lead-intent routing.

Analytics

Admin endpoints, question scrubbing, JSONL summaries, no IP/User-Agent storage.

Example test pattern

def test_admin_health_rejects_wrong_token(self) -> None:
    with patch.dict(os.environ, {"ADMIN_TOKEN": "test-admin-token"}):
        response = self.client.get(
            "/admin/health",
            headers={"X-Admin-Token": "wrong"},
        )

    self.assertEqual(response.status_code, 401)

Test hygiene

Tests patch environment values where needed, especially for ADMIN_TOKEN, ANALYTICS_ENABLED, and placeholder OpenAI keys. This keeps tests from relying on local secrets.