|
|
|
@ -43,7 +43,7 @@ def generate_sql_from_prompt(ddl: str, prompt: str) -> str:
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
# 读取 Sql/CreateTable.sql 文件
|
|
|
|
|
with open("Sql/CreateTable.sql", "r", encoding="utf-8") as file:
|
|
|
|
|
with open("../Sql/CreateTable.sql", "r", encoding="utf-8") as file:
|
|
|
|
|
ddl = file.read()
|
|
|
|
|
|
|
|
|
|
# 自然语言描述
|
|
|
|
@ -53,8 +53,6 @@ if __name__ == '__main__':
|
|
|
|
|
要求:
|
|
|
|
|
1、只返回可以运行的SQL,不要描述信息和```sql 还有```
|
|
|
|
|
2、对于学校名称和行政区划名称等于NULL 或者为空的不要进行统计
|
|
|
|
|
3、有行政区划列返回时,先按行政区划排序
|
|
|
|
|
4、有课程数量时,再按课程数量由高到低排序
|
|
|
|
|
'''
|
|
|
|
|
prompt = prompt + common_prompt
|
|
|
|
|
# 生成 SQL
|