botsi commited on
Commit
9aedfd5
·
verified ·
1 Parent(s): 249b759

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -74,7 +74,6 @@ with gr.Blocks() as demo:
74
  def bot(history, url_params):
75
  if "read query" in history[-1][0]:
76
  session_index = url_params.get('session_index')
77
- #print(session_index)
78
  bot_message = f"""
79
  here your URL params:
80
  {json.dumps(url_params, indent=4)}
@@ -93,6 +92,8 @@ with gr.Blocks() as demo:
93
  # Replace the placeholders with your actual database and table names
94
  core_table = "e5390g37096_core"
95
  decisions_table = "e5390g37096_decisions"
 
 
96
  playerNr = "1"
97
 
98
  # Query to fetch relevant data from both tables based on session_index
@@ -131,11 +132,10 @@ with gr.Blocks() as demo:
131
 
132
  # Convert the list of dictionaries to JSON
133
  personalized_result = json.dumps(result)
134
-
135
- # Close the database connection
136
- conn.close()
137
-
138
  print(personalized_result)
 
 
 
139
 
140
  elif "print data" in history[-1][0]:
141
  personalized_data = fetch_personalized_data()
 
74
  def bot(history, url_params):
75
  if "read query" in history[-1][0]:
76
  session_index = url_params.get('session_index')
 
77
  bot_message = f"""
78
  here your URL params:
79
  {json.dumps(url_params, indent=4)}
 
92
  # Replace the placeholders with your actual database and table names
93
  core_table = "e5390g37096_core"
94
  decisions_table = "e5390g37096_decisions"
95
+ session_index = session_index
96
+ print(session_index)
97
  playerNr = "1"
98
 
99
  # Query to fetch relevant data from both tables based on session_index
 
132
 
133
  # Convert the list of dictionaries to JSON
134
  personalized_result = json.dumps(result)
 
 
 
 
135
  print(personalized_result)
136
+
137
+ # Close the database connection
138
+ conn.close()
139
 
140
  elif "print data" in history[-1][0]:
141
  personalized_data = fetch_personalized_data()