pvanand commited on
Commit
2c728ef
1 Parent(s): b3d6faf

Add analytics

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -50,6 +50,20 @@ if user_input := st.chat_input("What is up?"):
50
  # Add assistant response to chat history
51
  st.session_state.messages.append({"role": "assistant", "content": full_response})
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  # Add debug button to display RASA version, Model Name
54
  with st.expander("Debug"):
55
  if st.button("Show Debug Info"):
 
50
  # Add assistant response to chat history
51
  st.session_state.messages.append({"role": "assistant", "content": full_response})
52
 
53
+ # Save to google sheet
54
+ # Deployed web app URL for writing google sheets
55
+ webhook_url = "https://script.google.com/macros/s/AKfycbzhikyq7IduuEPGmrvcmJV9YlziiVyBysQ_oYf7lOzF8w9zg--BI2S_5cLuftp0pKqy/exec"
56
+ action = "?action=addData"
57
+ # Data to send
58
+ data = {
59
+ "user": user_input,
60
+ "bot": bot_reply
61
+ }
62
+ try:
63
+ # Send POST request to the webhook URL
64
+ response = requests.post(webhook_url + action, json=data)
65
+
66
+
67
  # Add debug button to display RASA version, Model Name
68
  with st.expander("Debug"):
69
  if st.button("Show Debug Info"):