Omkar008's picture
Update main.py
288c09a verified
raw
history blame contribute delete
741 Bytes
from fastapi import FastAPI, HTTPException,Query,Request,BackgroundTasks
import json
import os
import requests
from extract_insights import process_synchronous_job
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')
# raw_text = request_data.get('receipt_text')
# data = await process_synchronous_job(user_id,email,message_id,raw_text)
background_tasks.add_task(process_synchronous_job,request_data)
return {"message":"Processing the data!!"}