Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,21 +57,13 @@ js = """
|
|
| 57 |
|
| 58 |
def get_session_index(url_params, chatbot):
|
| 59 |
if url_params:
|
| 60 |
-
print(f"""
|
| 61 |
-
{json.dumps(url_params)}
|
| 62 |
-
""")
|
| 63 |
session_index = url_params.get('session_index')
|
| 64 |
if session_index: # Check if session_index is not None or empty
|
| 65 |
-
|
| 66 |
-
# Fetch personalized data
|
| 67 |
-
personalized_data = fetch_personalized_data(session_index)
|
| 68 |
-
print(personalized_data)
|
| 69 |
else:
|
| 70 |
-
|
| 71 |
else:
|
| 72 |
-
|
| 73 |
-
time.sleep(1)
|
| 74 |
-
return session_index
|
| 75 |
|
| 76 |
with gr.Blocks(js=js) as demo:
|
| 77 |
gr.Markdown("""## Gradio send queryparam to chatbot
|
|
|
|
| 57 |
|
| 58 |
def get_session_index(url_params, chatbot):
|
| 59 |
if url_params:
|
|
|
|
|
|
|
|
|
|
| 60 |
session_index = url_params.get('session_index')
|
| 61 |
if session_index: # Check if session_index is not None or empty
|
| 62 |
+
return session_index
|
|
|
|
|
|
|
|
|
|
| 63 |
else:
|
| 64 |
+
return "Session index is missing."
|
| 65 |
else:
|
| 66 |
+
return "There are no URL parameters available."
|
|
|
|
|
|
|
| 67 |
|
| 68 |
with gr.Blocks(js=js) as demo:
|
| 69 |
gr.Markdown("""## Gradio send queryparam to chatbot
|