Commit
•
c1f1c6e
1
Parent(s):
d21554d
Fix: Update api url (#9)
Browse files- Fix: Update api url (5a43dafc2d61cf948f2f4e32fe27e5d5e728a029)
Co-authored-by: Anand <[email protected]>
app.py
CHANGED
@@ -4,6 +4,9 @@ import time
|
|
4 |
|
5 |
st.title("Rasa Chatbot Interface")
|
6 |
|
|
|
|
|
|
|
7 |
# Initialize chat history
|
8 |
if "messages" not in st.session_state:
|
9 |
st.session_state.messages = []
|
@@ -23,7 +26,7 @@ if user_input := st.chat_input("What is up?"):
|
|
23 |
|
24 |
# Send user input to Rasa webhook
|
25 |
payload = {"sender": "user", "message": user_input}
|
26 |
-
response = requests.post('
|
27 |
bot_reply = response.json()
|
28 |
|
29 |
# Extract assistant response
|
@@ -52,7 +55,6 @@ if user_input := st.chat_input("What is up?"):
|
|
52 |
# Add debug button to display RASA version, Model Name
|
53 |
with st.expander("Debug"):
|
54 |
if st.button("Show Debug Info"):
|
55 |
-
url = 'https://omdenalc-omdena-ng-lagos-chatbot-model.hf.space'
|
56 |
request_ids = ['/status', '/version']
|
57 |
results = [requests.get(url+request_id).json() for request_id in request_ids]
|
58 |
st.write(results)
|
|
|
4 |
|
5 |
st.title("Rasa Chatbot Interface")
|
6 |
|
7 |
+
# Change api url to yours here
|
8 |
+
url = https://omdena-lc-omdena-ng-lagos-chatbot-model.hf.space
|
9 |
+
|
10 |
# Initialize chat history
|
11 |
if "messages" not in st.session_state:
|
12 |
st.session_state.messages = []
|
|
|
26 |
|
27 |
# Send user input to Rasa webhook
|
28 |
payload = {"sender": "user", "message": user_input}
|
29 |
+
response = requests.post(url+'/webhooks/rest/webhook', json=payload)
|
30 |
bot_reply = response.json()
|
31 |
|
32 |
# Extract assistant response
|
|
|
55 |
# Add debug button to display RASA version, Model Name
|
56 |
with st.expander("Debug"):
|
57 |
if st.button("Show Debug Info"):
|
|
|
58 |
request_ids = ['/status', '/version']
|
59 |
results = [requests.get(url+request_id).json() for request_id in request_ids]
|
60 |
st.write(results)
|