(db_name : str='tpch10x')
| 41 | @tool.get("/get_database_schema") |
| 42 | #def get_database_schema(query : str='select * from customer limit 2;', db_name : str='tpch10x'): |
| 43 | def get_database_schema(db_name : str='tpch10x'): |
| 44 | global schema |
| 45 | |
| 46 | #todo simplify the schema based on the query |
| 47 | print("=========== database name:", db_name) |
| 48 | schema = db.compute_table_schema() |
| 49 | |
| 50 | print("========schema:", schema) |
| 51 | |
| 52 | text_output = f"The database schema is:\n" + "".join(str(schema)) |
| 53 | |
| 54 | return text_output |
| 55 | |
| 56 | |
| 57 | @tool.get("/translate_nlp_to_sql") |
nothing calls this directly
no test coverage detected