File size: 610 Bytes
d5a1d7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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!'}