Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -393,6 +393,17 @@ def inventory_report(question):
|
|
393 |
# chart = sdf.chat("Can you draw a bar chart with all avaialble item name and quantity.")
|
394 |
chart = sdf.chat(question)
|
395 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
|
397 |
|
398 |
return chart
|
@@ -560,17 +571,7 @@ def answer_question(user_question, chatbot, audio=None):
|
|
560 |
# image = gr.Image(value=img_str)
|
561 |
chatbot.append((user_question, img))
|
562 |
print(user_email)
|
563 |
-
|
564 |
-
if user_email:
|
565 |
-
# Send email with the chart image attached
|
566 |
-
send_email_with_attachment(
|
567 |
-
recipient_email=user_email,
|
568 |
-
subject="Warehouse Inventory Report",
|
569 |
-
body=response.get("output", "").split(":")[0],
|
570 |
-
image_data = img_str
|
571 |
-
# attachment_path=chart_path
|
572 |
-
#attachment_path=os.getenv("IMAGE_PATH")
|
573 |
-
)
|
574 |
|
575 |
if "send email to" in user_question:
|
576 |
try:
|
|
|
393 |
# chart = sdf.chat("Can you draw a bar chart with all avaialble item name and quantity.")
|
394 |
chart = sdf.chat(question)
|
395 |
|
396 |
+
# email send
|
397 |
+
if user_email:
|
398 |
+
# Send email with the chart image attached
|
399 |
+
send_email_with_attachment(
|
400 |
+
recipient_email=user_email,
|
401 |
+
subject="Warehouse Inventory Report",
|
402 |
+
body=response.get("output", "").split(":")[0],
|
403 |
+
image_data = img_str
|
404 |
+
# attachment_path=chart_path
|
405 |
+
#attachment_path=os.getenv("IMAGE_PATH")
|
406 |
+
)
|
407 |
|
408 |
|
409 |
return chart
|
|
|
571 |
# image = gr.Image(value=img_str)
|
572 |
chatbot.append((user_question, img))
|
573 |
print(user_email)
|
574 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
575 |
|
576 |
if "send email to" in user_question:
|
577 |
try:
|