Spaces:
Sleeping
Sleeping
from fastapi import APIRouter , Request ,HTTPException | |
from controllers import ner_ai_controller as ai | |
import logging | |
router = APIRouter(prefix="/queryfilter") | |
async def get_data(request:Request): | |
body = await request.json() | |
# user_query = body.get('query') | |
user_query = body.get('query', '') if body else '' | |
return {"brand_name": None} if not user_query.strip() else {"brand_name": ai.get_brand_from_query(user_query)} | |
# return {"brand_name":ai.get_brand_from_query(user_query)} | |