上传丢失的文件

master
落雨楓 2 years ago
parent 68d1647d5d
commit 7a2948fbca

2
.gitignore vendored

@ -141,4 +141,4 @@ dmypy.json
# Cython debug symbols
cython_debug/
config.py
/config.py

@ -0,0 +1,17 @@
import config
def get_prompt(name: str, type: str, params: dict = {}):
sys_params = {
"bot_name": config.CHATCOMPLETE_BOT_NAME
}
if name in config.PROMPTS and type in config.PROMPTS[name]:
prompt = config.PROMPTS[name][type]
for key in sys_params:
prompt = prompt.replace("{" + key + "}", sys_params[key])
for key in params:
prompt = prompt.replace("{" + key + "}", params[key])
return prompt
else:
return None
Loading…
Cancel
Save