"""Infra endpoints.""" from typing import Any from fastapi import APIRouter from ai_evals.api.schemas import infra as schemas from ai_evals.auth import get_expected_key, invalidate_key_cache router = APIRouter(tags=["infra"]) @router.get( "/hello/", operation_id="hello", response_model=schemas.HelloResponse, ) async def hello() -> dict[str, Any]: return {"status": "ok"} @router.post( "/admin/refresh-api-key", operation_id="refresh_api_key", response_model=schemas.HelloResponse, ) async def refresh_api_key() -> dict[str, Any]: invalidate_key_cache() get_expected_key() return {"status": "ok"}