Prompt SQL
prompt = f"""-- language: SQL
### Question: {query}
### Input: {create_sql}
### Response:
Here is the SQL query I have generated to
answer the question `{query}`:
```sql
"""
Prompt写法很重要
- 说明语言类型,– language: SQL
- 将SQL建表语句放到SQL prompt中,因为大语言是通过SQL建表语句进行识别的
- SQL编写用 ```sql,放到prompt最后安全sql补全代码 (Prompt中的首尾很重要)