13 lines
437 B
Python
13 lines
437 B
Python
from fastapi import APIRouter, Request, UploadFile
|
|
from backend.services.llm_service import question_and_answer
|
|
from backend.schemas.basic_schema import QuestionRequest
|
|
from fastapi.responses import StreamingResponse
|
|
|
|
router = APIRouter(prefix="/npc")
|
|
|
|
# http://127.0.0.1:8000/npc/question
|
|
@router.post("/question")
|
|
async def question(req: QuestionRequest):
|
|
answer = question_and_answer(req.question)
|
|
|
|
return {"message" : answer} |