File size: 400 Bytes
542c765
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from fastapi import APIRouter
from app.schemas import ChatRequest, ChatResponse
from app.ml.openrouter import chat

router = APIRouter()


@router.post("/chat", response_model=ChatResponse)
async def doctor_chat(body: ChatRequest):
    reply = chat(
        message=body.message,
        history=[m.model_dump() for m in body.history],
        guc=body.guc
    )
    return ChatResponse(reply=reply)