themissingCRAM
commited on
Commit
·
b1f7d5c
1
Parent(s):
5756803
blocks experiment
Browse files
app.py
CHANGED
|
@@ -21,6 +21,7 @@ from sqlalchemy import (
|
|
| 21 |
inspect,
|
| 22 |
text,
|
| 23 |
select,
|
|
|
|
| 24 |
)
|
| 25 |
import spaces
|
| 26 |
|
|
@@ -38,7 +39,7 @@ def dummy():
|
|
| 38 |
|
| 39 |
|
| 40 |
@tool
|
| 41 |
-
def sql_engine_tool(query: str, engine:
|
| 42 |
"""
|
| 43 |
Allows you to perform SQL queries on the table. Returns a string representation of the result.
|
| 44 |
The table is named 'receipts'. Its description is as follows:
|
|
@@ -55,7 +56,7 @@ def sql_engine_tool(query: str, engine: any) -> str:
|
|
| 55 |
output = ""
|
| 56 |
print("debug sql_engine_tool")
|
| 57 |
print(engine)
|
| 58 |
-
with engine.
|
| 59 |
print(con.connection)
|
| 60 |
print(metadata_objects.tables.keys())
|
| 61 |
result = con.execute(
|
|
|
|
| 21 |
inspect,
|
| 22 |
text,
|
| 23 |
select,
|
| 24 |
+
Engine,
|
| 25 |
)
|
| 26 |
import spaces
|
| 27 |
|
|
|
|
| 39 |
|
| 40 |
|
| 41 |
@tool
|
| 42 |
+
def sql_engine_tool(query: str, engine: Engine) -> str:
|
| 43 |
"""
|
| 44 |
Allows you to perform SQL queries on the table. Returns a string representation of the result.
|
| 45 |
The table is named 'receipts'. Its description is as follows:
|
|
|
|
| 56 |
output = ""
|
| 57 |
print("debug sql_engine_tool")
|
| 58 |
print(engine)
|
| 59 |
+
with engine.begin() as con:
|
| 60 |
print(con.connection)
|
| 61 |
print(metadata_objects.tables.keys())
|
| 62 |
result = con.execute(
|