Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
| 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 ?"
|