Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -106,6 +106,20 @@ with gr.Blocks() as demo:
|
|
| 106 |
time.sleep(1)
|
| 107 |
return history
|
| 108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
#bot_message = bot(history, url_params)
|
| 110 |
#user_message = user(user_message, url_params, history)
|
| 111 |
#print(bot_message)
|
|
|
|
| 106 |
time.sleep(1)
|
| 107 |
return history
|
| 108 |
|
| 109 |
+
def get_session_index(url_params):
|
| 110 |
+
if url_params:
|
| 111 |
+
print(f"""
|
| 112 |
+
{json.dumps(url_params)}
|
| 113 |
+
""")
|
| 114 |
+
session_index = url_params.get('session_index')
|
| 115 |
+
if session_index: # Check if session_index is not None or empty
|
| 116 |
+
print(session_index)
|
| 117 |
+
else:
|
| 118 |
+
print("Session index is missing.")
|
| 119 |
+
else:
|
| 120 |
+
print("There are no URL parameters available.")
|
| 121 |
+
return session_index
|
| 122 |
+
|
| 123 |
#bot_message = bot(history, url_params)
|
| 124 |
#user_message = user(user_message, url_params, history)
|
| 125 |
#print(bot_message)
|