Spaces:
Sleeping
Sleeping
Neurolingua
commited on
Commit
•
528f451
1
Parent(s):
def2d74
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,get_weather
|
11 |
app = Flask(__name__)
|
12 |
UPLOAD_FOLDER = '/code/uploads'
|
13 |
if not os.path.exists(UPLOAD_FOLDER):
|
@@ -66,6 +66,10 @@ def whatsapp_webhook():
|
|
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:
|
70 |
# Generate response considering the chat history
|
71 |
response_text = generate_response(incoming_msg, chat_history)
|
|
|
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,get_rates
|
11 |
app = Flask(__name__)
|
12 |
UPLOAD_FOLDER = '/code/uploads'
|
13 |
if not os.path.exists(UPLOAD_FOLDER):
|
|
|
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 |
+
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()):
|
70 |
+
rate_data=get_rates()
|
71 |
+
response_text=generate_response(incoming_msg+'data'+rate_data, chat_history)
|
72 |
+
|
73 |
else:
|
74 |
# Generate response considering the chat history
|
75 |
response_text = generate_response(incoming_msg, chat_history)
|