expense_parser / main.py
Omkar008's picture
Create main.py
d5a1d7f verified
raw
history blame
610 Bytes
from fastapi import FastAPI, HTTPException,Query,Request,BackgroundTasks
import json
from authenticate import get_access_token,get_access_token_v1
import os
import requests
from extract_and_store_supabase import extract_structure_store_message
app = FastAPI()
@app.post("/process_document")
async def process_document_base64(request: Request,background_tasks: BackgroundTasks):
request_data = await request.json()
file_name = request_data.get('filename')
background_tasks.add_task(extract_structure_store_message,filename)
return {"status":'Processing and Updating the data to db!'}