Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,7 +57,7 @@ for row in marks_data:
|
|
| 57 |
|
| 58 |
# --- Define SQL tool ---
|
| 59 |
@tool
|
| 60 |
-
def sql_engine(query: str) ->
|
| 61 |
try:
|
| 62 |
with engine.connect() as con:
|
| 63 |
rows = con.execute(text(query))
|
|
@@ -67,6 +67,7 @@ def sql_engine(query: str) -> list:
|
|
| 67 |
except Exception as e:
|
| 68 |
return {"columns": ["Error"], "data": [[str(e)]]}
|
| 69 |
|
|
|
|
| 70 |
# --- Table descriptions ---
|
| 71 |
inspector = inspect(engine)
|
| 72 |
updated_description = "Ask natural language questions about the student marks database.\n"
|
|
|
|
| 57 |
|
| 58 |
# --- Define SQL tool ---
|
| 59 |
@tool
|
| 60 |
+
def sql_engine(query: str) -> dict:
|
| 61 |
try:
|
| 62 |
with engine.connect() as con:
|
| 63 |
rows = con.execute(text(query))
|
|
|
|
| 67 |
except Exception as e:
|
| 68 |
return {"columns": ["Error"], "data": [[str(e)]]}
|
| 69 |
|
| 70 |
+
|
| 71 |
# --- Table descriptions ---
|
| 72 |
inspector = inspect(engine)
|
| 73 |
updated_description = "Ask natural language questions about the student marks database.\n"
|