代码拉取完成,页面将自动刷新
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"))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。