Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,10 +2,10 @@ import requests
|
|
2 |
import streamlit as st
|
3 |
import time
|
4 |
|
5 |
-
st.title("
|
6 |
|
7 |
# Edit API url here
|
8 |
-
url =
|
9 |
|
10 |
# Initialize chat history
|
11 |
if "messages" not in st.session_state:
|
@@ -26,8 +26,7 @@ if user_input := st.chat_input("What is up?"):
|
|
26 |
|
27 |
# Send user input to Rasa webhook
|
28 |
payload = {"sender": "user", "message": user_input}
|
29 |
-
response = requests.post(url+
|
30 |
-
|
31 |
bot_reply = response.json()
|
32 |
|
33 |
# Extract assistant response
|
@@ -79,6 +78,4 @@ with st.expander("Debug"):
|
|
79 |
results = [requests.get(url+request_id).json() for request_id in request_ids]
|
80 |
st.write(results)
|
81 |
else:
|
82 |
-
st.write("")
|
83 |
-
|
84 |
-
|
|
|
2 |
import streamlit as st
|
3 |
import time
|
4 |
|
5 |
+
st.title("Omdena Chatbot Interface")
|
6 |
|
7 |
# Edit API url here
|
8 |
+
url = 'https://pvanand-rasa-omdena-demo-model-feature-followup.hf.space'
|
9 |
|
10 |
# Initialize chat history
|
11 |
if "messages" not in st.session_state:
|
|
|
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
|
|
|
78 |
results = [requests.get(url+request_id).json() for request_id in request_ids]
|
79 |
st.write(results)
|
80 |
else:
|
81 |
+
st.write("")
|
|
|
|