Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -98,9 +98,15 @@ type `read query`
|
|
| 98 |
bot_message = random.choice(["Yes", "No"])
|
| 99 |
history[-1][1] = bot_message
|
| 100 |
time.sleep(1)
|
| 101 |
-
return history
|
| 102 |
|
| 103 |
def fetch_personalized_data():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
# Connect to the database
|
| 105 |
conn = mysql.connector.connect(
|
| 106 |
host="18.153.94.89",
|
|
@@ -112,13 +118,6 @@ type `read query`
|
|
| 112 |
# Create a cursor object
|
| 113 |
cursor = conn.cursor()
|
| 114 |
|
| 115 |
-
# Replace the placeholders with your actual database and table names
|
| 116 |
-
core_table = "e5390g37096_core"
|
| 117 |
-
decisions_table = "e5390g37096_decisions"
|
| 118 |
-
# session_index = url_params.get('session_index')
|
| 119 |
-
session_index = session_index
|
| 120 |
-
playerNr = "1"
|
| 121 |
-
|
| 122 |
# Query to fetch relevant data from both tables based on session_index
|
| 123 |
query = f"""
|
| 124 |
SELECT
|
|
|
|
| 98 |
bot_message = random.choice(["Yes", "No"])
|
| 99 |
history[-1][1] = bot_message
|
| 100 |
time.sleep(1)
|
| 101 |
+
return history
|
| 102 |
|
| 103 |
def fetch_personalized_data():
|
| 104 |
+
# Replace the placeholders with your actual database and table names
|
| 105 |
+
core_table = "e5390g37096_core"
|
| 106 |
+
decisions_table = "e5390g37096_decisions"
|
| 107 |
+
session_index = url_params.get('session_index')
|
| 108 |
+
playerNr = "1"
|
| 109 |
+
|
| 110 |
# Connect to the database
|
| 111 |
conn = mysql.connector.connect(
|
| 112 |
host="18.153.94.89",
|
|
|
|
| 118 |
# Create a cursor object
|
| 119 |
cursor = conn.cursor()
|
| 120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
# Query to fetch relevant data from both tables based on session_index
|
| 122 |
query = f"""
|
| 123 |
SELECT
|