botsi commited on
Commit
7f55eca
·
verified ·
1 Parent(s): d76ff68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -1
app.py CHANGED
@@ -89,8 +89,27 @@ type `read query`
89
  bot_message = random.choice(["Yes", "No"])
90
  history[-1][1] = bot_message
91
  time.sleep(1)
92
- return history
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
 
95
  msg.submit(user, inputs=[msg, url_params, chatbot], outputs=[msg, chatbot], queue=False).then(
96
  fn=bot, inputs=[chatbot, url_params], outputs=[chatbot]
 
89
  bot_message = random.choice(["Yes", "No"])
90
  history[-1][1] = bot_message
91
  time.sleep(1)
92
+ return history
93
 
94
+ ''' def bot(history, url_params):
95
+ global session_index
96
+ if "read query" in history[-1][0]:
97
+ session_index = url_params.get('session_index')
98
+ bot_message = f"""
99
+ here your URL params:
100
+ {json.dumps(url_params, indent=4)}
101
+ """
102
+ print(url_params)
103
+ elif "print data" in history[-1][0]:
104
+ personalized_data = fetch_personalized_data()
105
+ print(personalized_data)
106
+ bot_message = "Data printed."
107
+ else:
108
+ bot_message = random.choice(["Yes", "No"])
109
+ history[-1][1] = bot_message
110
+ time.sleep(1)
111
+ return history
112
+ '''
113
 
114
  msg.submit(user, inputs=[msg, url_params, chatbot], outputs=[msg, chatbot], queue=False).then(
115
  fn=bot, inputs=[chatbot, url_params], outputs=[chatbot]