chore: typo

This commit is contained in:
Rock Chin
2023-03-10 23:14:32 +08:00
parent d53f4e3917
commit 4269c7927e
3 changed files with 9 additions and 12 deletions

View File

@@ -84,7 +84,6 @@ default_prompt = {
# 参考值旧版本方式default | 完整情景full_scenario
preset_mode = "default"
# 群内响应规则
# 符合此消息的群内消息即使不包含at机器人也会响应
# 支持消息前缀匹配及正则表达式匹配

View File

@@ -1,4 +1,6 @@
# 多情景预设值管理
import json
import logging
__current__ = "default"
"""当前默认使用的情景预设的名称
@@ -10,11 +12,7 @@ __prompts_from_files__ = {}
"""从文件中读取的情景预设值"""
import json
import logging
def read_prompt_from_file() -> str:
def read_prompt_from_file():
"""从文件读取预设值"""
# 读取prompts/目录下的所有文件,以文件名为键,文件内容为值
# 保存在__prompts_from_files__中
@@ -104,13 +102,13 @@ def get_prompt(name: str = None) -> list:
if key.lower().startswith(name.lower()):
return [
{
"role":"user",
"content":default_dict[key]
"role": "user",
"content": default_dict[key]
},
{
"role":"assistant",
"content":"好的。"
"role": "assistant",
"content": "好的。"
}
]
]
raise KeyError("未找到默认情景预设: " + name)

View File

@@ -88,4 +88,4 @@ class KeysManager:
for key_name in self.api_key:
if self.api_key[key_name] == api_key:
return key_name
return ""
return ""