Omkar008's picture
Create main.py
7150be8 verified
raw
history blame
694 Bytes
from fastapi import FastAPI, HTTPException,Query,Request,BackgroundTasks
import json
import os
import requests
from extract_insights import extract_fashion_categories
app = FastAPI()
@app.post("/process_ocr_text_openai_trigger")
async def process_document_base64(request: Request,background_tasks: BackgroundTasks):
# request_data = await request.json()
# user_id = request_data.get('user_id')
# message_id = request_data.get('message_id')
# email = request_data.get('email')
# await extract_fashion_categories(user_id,email,message_id)
# # background_tasks.add_task(extract_fashion_categories,user_id,email,message_id)
return {"message":'Endpoint working !'}