You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
586 B
Python
20 lines
586 B
Python
# backend/app/routers/llm.py
|
|
from fastapi import APIRouter, Depends
|
|
|
|
from ..llm.provider import LLMProvider, get_provider
|
|
from ..schemas import LLMHealth
|
|
|
|
router = APIRouter() # prefix 없음. main.py 에서 prefix="/api" 등록.
|
|
|
|
|
|
@router.get("/llm/health", response_model=LLMHealth)
|
|
def llm_health(provider: LLMProvider = Depends(get_provider)):
|
|
h = provider.health()
|
|
return LLMHealth(
|
|
reachable=h.get("reachable", False),
|
|
provider=h.get("provider", ""),
|
|
model=h.get("model", ""),
|
|
host=h.get("host"),
|
|
detail=h.get("detail", ""),
|
|
)
|