gabrielchua commited on
Commit
2286dbf
1 Parent(s): 6f1bfa9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -7
app.py CHANGED
@@ -29,15 +29,23 @@ def extract_receipt_info(image):
29
  messages=[
30
  {
31
  "role": "user",
32
- "content": "Your task is to extract key information from the provided receipt image.\n\nReply in table.\n\nThis is the schema:\n- item (str), description of the item\n- price (float), price of the item\n- quantity (int), quantity of the item\n- total (float), total cost for the item"
 
 
 
 
 
 
 
 
 
 
 
33
  },
34
  {
35
- "role": "user",
36
- "content": {
37
- "type": "image_url",
38
- "url": f"data:image/jpeg;base64,{base64_image}",
39
- },
40
- },
41
  ],
42
  temperature=0.1,
43
  max_tokens=8192,
 
29
  messages=[
30
  {
31
  "role": "user",
32
+ "content": [
33
+ {
34
+ "type": "text",
35
+ "text": "Your task is to extract key information from the provided receipt image.\n\nReply in table.\n\nThis is the schema:\n- item (str), description of the item\n- price (float), price of the item\n- quantity (int), quantity of the item\n- total (float), total cost for the item"
36
+ },
37
+ {
38
+ "type": "image_url",
39
+ "image_url": {
40
+ "url": image
41
+ }
42
+ }
43
+ ]
44
  },
45
  {
46
+ "role": "assistant",
47
+ "content": "```markdown"
48
+ }
 
 
 
49
  ],
50
  temperature=0.1,
51
  max_tokens=8192,