from typing import Annotated from fastapi import APIRouter from fastapi.params import Depends from watchfiles import awatch from app.chat_qa_query.api.qa_dependencies import get_qa_query_service from app.chat_qa_query.api.schema.query_qa_schema import QueryQASchema from app.chat_qa_query.service.query_qa_service import QueryQAService query_qa_router = APIRouter() @query_qa_router.post("/api/qa/query") async def query_handler(query: QueryQASchema, query_service: Annotated[QueryQAService, Depends(get_qa_query_service)]): return await query_service.query(query.external_str, query.messages_top15)