Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ import threading
|
|
9 |
|
10 |
import uuid
|
11 |
import shutil
|
12 |
-
from other_function import predict_pest,predict_disease,convert_img,generate_response,ConversationBufferMemory,get_weather,get_rates
|
13 |
app = Flask(__name__)
|
14 |
UPLOAD_FOLDER = '/code/uploads'
|
15 |
if not os.path.exists(UPLOAD_FOLDER):
|
@@ -70,6 +70,9 @@ def whatsapp_webhook():
|
|
70 |
elif ('rates' in incoming_msg.lower()) or ('price' in incoming_msg.lower()) or ('market' in incoming_msg.lower()) or ('rate' in incoming_msg.lower()) or ('prices' in incoming_msg.lower()):
|
71 |
rates=get_rates()
|
72 |
response_text = generate_response(incoming_msg+'data is '+rates, chat_history)
|
|
|
|
|
|
|
73 |
|
74 |
else:
|
75 |
# Generate response considering the chat history
|
|
|
9 |
|
10 |
import uuid
|
11 |
import shutil
|
12 |
+
from other_function import predict_pest,predict_disease,convert_img,generate_response,ConversationBufferMemory,get_weather,get_rates,get_news
|
13 |
app = Flask(__name__)
|
14 |
UPLOAD_FOLDER = '/code/uploads'
|
15 |
if not os.path.exists(UPLOAD_FOLDER):
|
|
|
70 |
elif ('rates' in incoming_msg.lower()) or ('price' in incoming_msg.lower()) or ('market' in incoming_msg.lower()) or ('rate' in incoming_msg.lower()) or ('prices' in incoming_msg.lower()):
|
71 |
rates=get_rates()
|
72 |
response_text = generate_response(incoming_msg+'data is '+rates, chat_history)
|
73 |
+
elif ('news' in incoming_msg.lower()) or ('information' in incoming_msg.lower()):
|
74 |
+
news=get_news()
|
75 |
+
response_text = generate_response(incoming_msg+'data is '+news, chat_history)
|
76 |
|
77 |
else:
|
78 |
# Generate response considering the chat history
|