vkumartr commited on
Commit
18caa25
·
verified ·
1 Parent(s): 60d6ee2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -119,7 +119,7 @@ def extract_invoice_data(file_data, content_type, json_schema):
119
  temperature=0.5,
120
  max_tokens=16384
121
  )
122
-
123
  # Clean and parse JSON output
124
  content = response.choices[0].message.content.strip()
125
  cleaned_content = content.strip().strip('```json').strip('```')
@@ -187,6 +187,7 @@ def extract_text_from_file(
187
  "file_key": file_key,
188
  "file_type": content_type,
189
  "document_type": document_type,
 
190
  "entityrefkey": entity_ref_key,
191
  "extracted_data": extracted_data
192
  }
 
119
  temperature=0.5,
120
  max_tokens=16384
121
  )
122
+ base64dataresp = f"data:{mime_type};base64,{base64_encoded}"
123
  # Clean and parse JSON output
124
  content = response.choices[0].message.content.strip()
125
  cleaned_content = content.strip().strip('```json').strip('```')
 
187
  "file_key": file_key,
188
  "file_type": content_type,
189
  "document_type": document_type,
190
+ "base64dataResp":base64dataresp,
191
  "entityrefkey": entity_ref_key,
192
  "extracted_data": extracted_data
193
  }