danieldeng commited on
Commit
0ec17ab
·
verified ·
1 Parent(s): 0bfc462

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -24,7 +24,12 @@ def generate_qr_code(text:str)-> AgentImage: #it's import to specify the return
24
  qr.make(fit=True)
25
  img = qr.make_image(fill_color="black", back_color="white").convert('RGB')
26
  print(img.size)
27
- return AgentImage(img)
 
 
 
 
 
28
  except Exception as e:
29
  return f"Error generating QR code:{str(e)}"
30
  # return "What magic will you build ?"
 
24
  qr.make(fit=True)
25
  img = qr.make_image(fill_color="black", back_color="white").convert('RGB')
26
  print(img.size)
27
+ filename = "my_qr_code.png"
28
+ save_path = os.path.abspath(filename)
29
+ img.save(save_path)
30
+ print(f"DEBUG: Saved absolute path to: {save_path}")
31
+ return AgentImage(save_path)
32
+ # return AgentImage(img)
33
  except Exception as e:
34
  return f"Error generating QR code:{str(e)}"
35
  # return "What magic will you build ?"