Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -142,6 +142,8 @@ print(personalized_data)
|
|
| 142 |
|
| 143 |
|
| 144 |
|
|
|
|
|
|
|
| 145 |
with gr.Blocks() as demo:
|
| 146 |
gr.Markdown("""## Gradio send queryparam to chatbot
|
| 147 |
type `read query`
|
|
@@ -156,8 +158,11 @@ type `read query`
|
|
| 156 |
def user(user_message, url_params, history):
|
| 157 |
return "", history + [[user_message, None]]
|
| 158 |
|
|
|
|
| 159 |
def bot(history, url_params):
|
| 160 |
if "read query" in history[-1][0]:
|
|
|
|
|
|
|
| 161 |
bot_message = f"""
|
| 162 |
here your URL params:
|
| 163 |
{json.dumps(url_params, indent=4)}
|
|
|
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
+
|
| 146 |
+
|
| 147 |
with gr.Blocks() as demo:
|
| 148 |
gr.Markdown("""## Gradio send queryparam to chatbot
|
| 149 |
type `read query`
|
|
|
|
| 158 |
def user(user_message, url_params, history):
|
| 159 |
return "", history + [[user_message, None]]
|
| 160 |
|
| 161 |
+
|
| 162 |
def bot(history, url_params):
|
| 163 |
if "read query" in history[-1][0]:
|
| 164 |
+
session_index = url_params.get('session_index')
|
| 165 |
+
personalized_data = fetch_personalized_data(session_index)
|
| 166 |
bot_message = f"""
|
| 167 |
here your URL params:
|
| 168 |
{json.dumps(url_params, indent=4)}
|