vkumartr commited on
Commit
cb92879
·
verified ·
1 Parent(s): 7ae63db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -84,7 +84,7 @@ def fetch_file_from_s3(file_key):
84
  def extract_invoice_data(file_data, content_type, json_schema):
85
  system_prompt = "You are an expert in document data extraction."
86
 
87
- # Convert file to Base64
88
  base64_encoded = base64.b64encode(file_data).decode('utf-8')
89
  base64dataresp = f"data:{content_type};base64,{base64_encoded}"
90
 
@@ -205,6 +205,7 @@ def extract_text_from_file(
205
  "message": "Document successfully stored in MongoDB",
206
  "document_id": document_id,
207
  "entityrefkey": entity_ref_key,
 
208
  "extracted_data": extracted_data
209
  }
210
 
 
84
  def extract_invoice_data(file_data, content_type, json_schema):
85
  system_prompt = "You are an expert in document data extraction."
86
 
87
+ # Convert file to Base64
88
  base64_encoded = base64.b64encode(file_data).decode('utf-8')
89
  base64dataresp = f"data:{content_type};base64,{base64_encoded}"
90
 
 
205
  "message": "Document successfully stored in MongoDB",
206
  "document_id": document_id,
207
  "entityrefkey": entity_ref_key,
208
+ "base64dataResp":base64dataresp,
209
  "extracted_data": extracted_data
210
  }
211