Replace Azure Functions architecture with a modern FastAPI-based REST API providing image, video, speech, and vision capabilities for General Bots. Key changes: - Add FastAPI app with versioned API endpoints and OpenAPI docs - Implement services for Stable Diffusion, Zeroscope, TTS/Whisper, BLIP2 - Add pydantic schemas for request/response validation - Configure structured logging with structlog - Support lazy model loading and GPU acceleration - Update dependencies from Azure/TensorFlow stack to PyTorch/diffusers
7 lines
264 B
Python
7 lines
264 B
Python
from fastapi import Header, HTTPException
|
|
from ..core.config import settings
|
|
|
|
async def verify_api_key(x_api_key: str = Header(...)):
|
|
if x_api_key != settings.api_key:
|
|
raise HTTPException(status_code=401, detail="Invalid API key")
|
|
return x_api_key
|