danieldeng commited on
Commit
1e0d6fe
·
verified ·
1 Parent(s): 18eda08

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -21,8 +21,11 @@ def generate_qr_code(text:str)-> str: #it's import to specify the return type
21
  qr.make(fit=True)
22
 
23
  img = qr.make_image(fill_color="black", back_color="white").convert('RGB')
24
-
25
- return img
 
 
 
26
  except Exception as e:
27
  return f"QR code generation failed: {str(e)}"
28
  # return "What magic will you build ?"
 
21
  qr.make(fit=True)
22
 
23
  img = qr.make_image(fill_color="black", back_color="white").convert('RGB')
24
+
25
+ save_path = "generated_qr.png"
26
+ img.save(save_path)
27
+ from smolagents.agent_types import AgentImage
28
+ return AgentImage(save_path)
29
  except Exception as e:
30
  return f"QR code generation failed: {str(e)}"
31
  # return "What magic will you build ?"