Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -115,23 +115,65 @@ async def process_with_gemini(filename: str, raw_text: str):
|
|
| 115 |
|
| 116 |
Output JSON:
|
| 117 |
{{
|
| 118 |
-
|
| 119 |
-
"
|
| 120 |
-
"
|
| 121 |
-
"
|
| 122 |
-
"
|
| 123 |
-
"
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
}}
|
| 136 |
"""
|
| 137 |
response = model.generate_content(prompt)
|
|
|
|
| 115 |
|
| 116 |
Output JSON:
|
| 117 |
{{
|
| 118 |
+
"invoice": {{
|
| 119 |
+
"invoice_number": "",
|
| 120 |
+
"invoice_date": "",
|
| 121 |
+
"due_date": "",
|
| 122 |
+
"purchase_order_number": "",
|
| 123 |
+
"vendor": {{
|
| 124 |
+
"vendor_id": "",
|
| 125 |
+
"name": "",
|
| 126 |
+
"address": {{
|
| 127 |
+
"line1": "",
|
| 128 |
+
"line2": "",
|
| 129 |
+
"city": "",
|
| 130 |
+
"state": "",
|
| 131 |
+
"postal_code": "",
|
| 132 |
+
"country": ""
|
| 133 |
+
}},
|
| 134 |
+
"contact": {{
|
| 135 |
+
"email": "",
|
| 136 |
+
"phone": ""
|
| 137 |
+
}},
|
| 138 |
+
"tax_id": ""
|
| 139 |
+
}},
|
| 140 |
+
"buyer": {{
|
| 141 |
+
"buyer_id": "",
|
| 142 |
+
"name": "",
|
| 143 |
+
"address": {{
|
| 144 |
+
"line1": "",
|
| 145 |
+
"line2": "",
|
| 146 |
+
"city": "",
|
| 147 |
+
"state": "",
|
| 148 |
+
"postal_code": "",
|
| 149 |
+
"country": ""
|
| 150 |
+
}},
|
| 151 |
+
"contact": {{
|
| 152 |
+
"email": "",
|
| 153 |
+
"phone": ""
|
| 154 |
+
}},
|
| 155 |
+
"tax_id": ""
|
| 156 |
+
}},
|
| 157 |
+
"items": [
|
| 158 |
+
{{
|
| 159 |
+
"item_id": "",
|
| 160 |
+
"description": "",
|
| 161 |
+
"quantity": 0,
|
| 162 |
+
"unit_of_measure": "",
|
| 163 |
+
"unit_price": 0,
|
| 164 |
+
"total_price": 0,
|
| 165 |
+
"tax_rate": 0,
|
| 166 |
+
"tax_amount": 0,
|
| 167 |
+
"discount": 0,
|
| 168 |
+
"net_amount": 0
|
| 169 |
+
}}
|
| 170 |
+
],
|
| 171 |
+
"sub_total": 0,
|
| 172 |
+
"tax_total": 0,
|
| 173 |
+
"discount_total": 0,
|
| 174 |
+
"total_amount": 0,
|
| 175 |
+
"currency": ""
|
| 176 |
+
|
| 177 |
}}
|
| 178 |
"""
|
| 179 |
response = model.generate_content(prompt)
|