MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / get_database_schema

Function get_database_schema

bmtools/tools/database/api.py:43–54  ·  view source on GitHub ↗
(db_name : str='tpch10x')

Source from the content-addressed store, hash-verified

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")

Callers

nothing calls this directly

Calls 1

compute_table_schemaMethod · 0.45

Tested by

no test coverage detected