Spaces:
Running
Running
from fastapi import APIRouter, Depends, Form | |
from fastapi.responses import JSONResponse | |
from app.db_local_storage.in_memory_db import query_response_storage | |
from app.modules.querySearch.controllers.querySearch_controller import ( | |
QuerySearchController, | |
) | |
from app.modules.querySearch.dependecies import get_query_search_controller | |
router = APIRouter() | |
async def handle_query_search( | |
q: str = Form(...), | |
controller: QuerySearchController = Depends(get_query_search_controller), | |
): | |
return await controller.handle_query_search(q) | |
async def get_messages(): | |
return JSONResponse(status_code=200, content={"data": query_response_storage}) | |