Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,14 @@
|
|
1 |
-
from fastapi import FastAPI, HTTPException,Query
|
2 |
import json
|
3 |
from authenticate import get_access_token
|
4 |
app = FastAPI()
|
5 |
|
6 |
@app.post("/process-document")
|
7 |
-
async def process_document_base64(
|
|
|
8 |
project_id = os.getenv('PROJECT_ID')
|
9 |
processor_id = os.getenv('PROCESSOR_ID')
|
|
|
10 |
if request_data.get('base64_content') is None:
|
11 |
return {"error":"base64 data not present"}
|
12 |
payload = {
|
|
|
1 |
+
from fastapi import FastAPI, HTTPException,Query,Request
|
2 |
import json
|
3 |
from authenticate import get_access_token
|
4 |
app = FastAPI()
|
5 |
|
6 |
@app.post("/process-document")
|
7 |
+
async def process_document_base64(request: Request):
|
8 |
+
|
9 |
project_id = os.getenv('PROJECT_ID')
|
10 |
processor_id = os.getenv('PROCESSOR_ID')
|
11 |
+
request_data = request.json()
|
12 |
if request_data.get('base64_content') is None:
|
13 |
return {"error":"base64 data not present"}
|
14 |
payload = {
|