1 Star 0 Fork 0

与衡/ChatDB

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
chatdb_prompts.py 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
from langchain.prompts import PromptTemplate
from sql_examples import egs
prompt_ask_steps_temp = """
Please tell me what standard SQL statements should I use in order to respond to the "USER INPUT". \
If it needs multiple SQL operations on the database, please list them step by step concisely. \
If there is no need to use the database, reply to the "USER INPUT" directly.
The output should be a markdown code snippet formatted in the following schema, \
including the leading and trailing "\`\`\`" and "\`\`\`":
```
Step1: <Description of first step>
SQL command for step1
Step2: <Description of second step>
SQL command for step2
......
```
Here are some examples:
{egs}
USER INPUT: {user_inp}
ANSWER:
"""
prompt_ask_steps = PromptTemplate(
template=prompt_ask_steps_temp,
input_variables=["user_inp"],
partial_variables={
"egs": '\n'.join(egs),
}
)
prompt_ask_steps_no_egs = PromptTemplate(
template=prompt_ask_steps_temp,
input_variables=["user_inp"],
partial_variables={
"egs": ""
}
)
if __name__ == '__main__':
print(prompt_ask_steps.format(user_inp="Hi"))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/JackieChan007/ChatDB.git
git@gitee.com:JackieChan007/ChatDB.git
JackieChan007
ChatDB
ChatDB
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385