Download app/api/v1/admin.py from GodRad/rag_saas: direct link, hf CLI and curl.
- Browser
- Download file 435 Bytes
-
https://huggingface.co/spaces/GodRad/rag_saas/resolve/main/app/api/v1/admin.py
- Command line
-
hf download hf://spaces/GodRad/rag_saas/app/api/v1/admin.py
-
curl -L -o admin.py https://huggingface.co/spaces/GodRad/rag_saas/resolve/main/app/api/v1/admin.py
435 Bytes
| from fastapi import APIRouter | |
| from typing import Dict, Any | |
| router = APIRouter() | |
| # Mock storage for metrics | |
| metrics_store = { | |
| "ingestion_total": 0, | |
| "retrieval_total": 0, | |
| "generation_total": 0, | |
| "average_latency": 0.0 | |
| } | |
| def get_metrics(): | |
| return metrics_store | |
| def increment_metric(metric_name: str): | |
| if metric_name in metrics_store: | |
| metrics_store[metric_name] += 1 | |