Fix: Update api url

#9
by pvanand - opened
Files changed (1) hide show
  1. app.py +4 -2
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('https://omdenalc-omdena-ng-lagos-chatbot-model.hf.space/webhooks/rest/webhook', json=payload)
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)