Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -70,7 +70,15 @@ subjects_df = fetch_table("subjects")
|
|
| 70 |
# --- Define SQL tool for the agent ---
|
| 71 |
@tool
|
| 72 |
def sql_engine(query: str) -> list:
|
| 73 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
try:
|
| 75 |
print(f"🧩 Executing query: {query}")
|
| 76 |
with engine.connect() as con:
|
|
|
|
| 70 |
# --- Define SQL tool for the agent ---
|
| 71 |
@tool
|
| 72 |
def sql_engine(query: str) -> list:
|
| 73 |
+
"""
|
| 74 |
+
Executes SQL queries on the available tables: students and subjects.
|
| 75 |
+
|
| 76 |
+
Args:
|
| 77 |
+
query (str): The SQL query string to execute.
|
| 78 |
+
|
| 79 |
+
Returns:
|
| 80 |
+
list: List of tuples containing the query results.
|
| 81 |
+
"""
|
| 82 |
try:
|
| 83 |
print(f"🧩 Executing query: {query}")
|
| 84 |
with engine.connect() as con:
|