Spaces:
Sleeping
Sleeping
File size: 538 Bytes
4043817 cf81e2a e1b7faf 4043817 e1b7faf 1ed53af e1b7faf 293e20c cf53afd 1ed53af cf53afd e1b7faf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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)}
|