Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -72,18 +72,6 @@ with gr.Blocks(js = js) as demo:
|
|
| 72 |
|
| 73 |
def user(user_message, url_params, history):
|
| 74 |
return "", history + [[user_message, None]]
|
| 75 |
-
|
| 76 |
-
'''def bot(history, url_params):
|
| 77 |
-
if "hi" in history[-1][0]:
|
| 78 |
-
session_index = url_params.get('session_index')
|
| 79 |
-
print(session_index)
|
| 80 |
-
bot_message = f"""
|
| 81 |
-
here your URL params:
|
| 82 |
-
{json.dumps(url_params, indent=4)}
|
| 83 |
-
"""
|
| 84 |
-
# Fetch personalized data
|
| 85 |
-
personalized_data = fetch_personalized_data(session_index)
|
| 86 |
-
print(personalized_data)'''
|
| 87 |
|
| 88 |
def bot(history, url_params):
|
| 89 |
if "hi" in history[-1][0]:
|
|
@@ -103,7 +91,7 @@ with gr.Blocks(js = js) as demo:
|
|
| 103 |
bot_message = "There was an error. Please try again."
|
| 104 |
history[-1][1] = bot_message
|
| 105 |
time.sleep(1)
|
| 106 |
-
return history
|
| 107 |
|
| 108 |
msg.submit(user, inputs=[msg, url_params, chatbot], outputs=[msg, chatbot], queue=False).then(
|
| 109 |
fn=bot, inputs=[chatbot, url_params], outputs=[chatbot]
|
|
|
|
| 72 |
|
| 73 |
def user(user_message, url_params, history):
|
| 74 |
return "", history + [[user_message, None]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
def bot(history, url_params):
|
| 77 |
if "hi" in history[-1][0]:
|
|
|
|
| 91 |
bot_message = "There was an error. Please try again."
|
| 92 |
history[-1][1] = bot_message
|
| 93 |
time.sleep(1)
|
| 94 |
+
return history
|
| 95 |
|
| 96 |
msg.submit(user, inputs=[msg, url_params, chatbot], outputs=[msg, chatbot], queue=False).then(
|
| 97 |
fn=bot, inputs=[chatbot, url_params], outputs=[chatbot]
|