Coverage for narrative_harm_classifier/api/routes/health.py: 100%
8 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-07-20 13:25 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-07-20 13:25 +0000
1"""
2api/routes/health.py
3"""
5from fastapi import APIRouter, Depends
6from narrative_harm_classifier.core.config import get_settings, Settings
7from narrative_harm_classifier.classifier.taxonomy.loader import load_taxonomy
9router = APIRouter()
12@router.get("/health")
13def health(settings: Settings = Depends(get_settings)):
14 taxonomy = load_taxonomy(settings.taxonomy_config_path)
15 return {
16 "status": "ok",
17 "app": settings.app_name,
18 "version": settings.app_version,
19 "taxonomy_version": taxonomy.version,
20 "taxonomy_baseline": taxonomy.baseline_tag,
21 "priority_category": taxonomy.priority_category,
22 "azure_configured": bool(settings.azure_text_analytics_endpoint),
23 }