Spaces:
Sleeping
Sleeping
Neurolingua
commited on
Commit
•
5a879b4
1
Parent(s):
bebbf0f
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from PIL import Image
|
|
7 |
import io
|
8 |
import uuid
|
9 |
import shutil
|
10 |
-
from other_function import predict_pest,predict_disease,convert_img,generate_response,ConversationBufferMemory
|
11 |
app = Flask(__name__)
|
12 |
UPLOAD_FOLDER = '/code/uploads'
|
13 |
if not os.path.exists(UPLOAD_FOLDER):
|
@@ -62,6 +62,8 @@ def whatsapp_webhook():
|
|
62 |
|
63 |
else:
|
64 |
response_text = "The attached file is not an image. Please send an image for classification."
|
|
|
|
|
65 |
elif 'bookkeeping' in incoming_msg:
|
66 |
response_text = "Please provide the details you'd like to record."
|
67 |
else:
|
|
|
7 |
import io
|
8 |
import uuid
|
9 |
import shutil
|
10 |
+
from other_function import predict_pest,predict_disease,convert_img,generate_response,ConversationBufferMemory,get_weather
|
11 |
app = Flask(__name__)
|
12 |
UPLOAD_FOLDER = '/code/uploads'
|
13 |
if not os.path.exists(UPLOAD_FOLDER):
|
|
|
62 |
|
63 |
else:
|
64 |
response_text = "The attached file is not an image. Please send an image for classification."
|
65 |
+
elif ('weather' in incoming_msg.lower()) or ('climate' in incoming_msg.lower()) or ('temperature' in incoming_msg.lower()):
|
66 |
+
response_text=get_weather(incoming_msg.lower())
|
67 |
elif 'bookkeeping' in incoming_msg:
|
68 |
response_text = "Please provide the details you'd like to record."
|
69 |
else:
|