Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -80,21 +80,21 @@ with gr.Blocks() as demo:
|
|
| 80 |
return "", history + [[user_message, None]]
|
| 81 |
|
| 82 |
def bot(history, url_params):
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
|
| 99 |
elif "print data" in history[-1][0]:
|
| 100 |
personalized_data = fetch_personalized_data()
|
|
|
|
| 80 |
return "", history + [[user_message, None]]
|
| 81 |
|
| 82 |
def bot(history, url_params):
|
| 83 |
+
if "read query" in history[-1][0]:
|
| 84 |
+
session_index = url_params.get('session_index')
|
| 85 |
+
print(session_index)
|
| 86 |
+
bot_message = f"""
|
| 87 |
+
here your URL params:
|
| 88 |
+
{json.dumps(url_params, indent=4)}
|
| 89 |
+
"""
|
| 90 |
+
# Fetch personalized data
|
| 91 |
+
personalized_data = fetch_personalized_data(session_index)
|
| 92 |
+
if personalized_data:
|
| 93 |
+
bot_message = "Personalized data fetched successfully."
|
| 94 |
+
return [[bot_message, None]]
|
| 95 |
+
else:
|
| 96 |
+
bot_message = "Error fetching personalized data."
|
| 97 |
+
return [[bot_message, None]]
|
| 98 |
|
| 99 |
elif "print data" in history[-1][0]:
|
| 100 |
personalized_data = fetch_personalized_data()
|