hushh-valet-chat / routers /queryfilter_router.py
Omkar008's picture
Update routers/queryfilter_router.py
293e20c verified
raw
history blame
No virus
538 Bytes
from fastapi import APIRouter , Request ,HTTPException
from controllers import ner_ai_controller as ai
import logging
router = APIRouter(prefix="/queryfilter")
@router.post("/gemini")
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)}