themissingCRAM
commited on
Commit
·
c25281e
1
Parent(s):
7fdbbb2
debug
Browse files
app.py
CHANGED
|
@@ -29,10 +29,11 @@ def dummy():
|
|
| 29 |
pass
|
| 30 |
|
| 31 |
|
|
|
|
|
|
|
|
|
|
| 32 |
@tool
|
| 33 |
-
def sql_engine_tool(
|
| 34 |
-
query: str,
|
| 35 |
-
) -> str:
|
| 36 |
"""
|
| 37 |
Allows you to perform SQL queries on the table. Returns a string representation of the result.
|
| 38 |
The table is named 'receipts'. Its description is as follows:
|
|
@@ -44,7 +45,7 @@ def sql_engine_tool(
|
|
| 44 |
|
| 45 |
Args:
|
| 46 |
query: The query to perform. This should be correct SQL.
|
| 47 |
-
|
| 48 |
"""
|
| 49 |
output = ""
|
| 50 |
print("debug sql_engine_tool")
|
|
@@ -118,7 +119,7 @@ if __name__ == "__main__":
|
|
| 118 |
# You are a text to sql converter
|
| 119 |
# """,
|
| 120 |
model=model,
|
| 121 |
-
max_steps=
|
| 122 |
verbosity_level=1,
|
| 123 |
)
|
| 124 |
# agent.run("What is the average each customer paid?")
|
|
|
|
| 29 |
pass
|
| 30 |
|
| 31 |
|
| 32 |
+
engine = None
|
| 33 |
+
|
| 34 |
+
|
| 35 |
@tool
|
| 36 |
+
def sql_engine_tool(query: str, engine: any = engine) -> str:
|
|
|
|
|
|
|
| 37 |
"""
|
| 38 |
Allows you to perform SQL queries on the table. Returns a string representation of the result.
|
| 39 |
The table is named 'receipts'. Its description is as follows:
|
|
|
|
| 45 |
|
| 46 |
Args:
|
| 47 |
query: The query to perform. This should be correct SQL.
|
| 48 |
+
engine: ignore this parameter, let is used the default please.
|
| 49 |
"""
|
| 50 |
output = ""
|
| 51 |
print("debug sql_engine_tool")
|
|
|
|
| 119 |
# You are a text to sql converter
|
| 120 |
# """,
|
| 121 |
model=model,
|
| 122 |
+
max_steps=1,
|
| 123 |
verbosity_level=1,
|
| 124 |
)
|
| 125 |
# agent.run("What is the average each customer paid?")
|