Merge pull request #262 from chordfish-k/json_scenario

[Feat] 情景预设(人格)完善
This commit is contained in:
Rock Chin
2023-03-12 20:40:20 +08:00
committed by GitHub
9 changed files with 140 additions and 49 deletions

View File

@@ -182,6 +182,7 @@ def main(first_time_init=False):
import pkg.openai.dprompt
pkg.openai.dprompt.read_prompt_from_file()
pkg.openai.dprompt.read_scenario_from_file()
pkg.utils.context.context['logger_handler'] = sh
# 主启动流程
@@ -337,6 +338,10 @@ if __name__ == '__main__':
if not os.path.exists("sensitive.json"):
shutil.copy("sensitive-template.json", "sensitive.json")
# 检查是否有scenario/default.json
if not os.path.exists("scenario/default.json"):
shutil.copy("scenario/default-template.json", "scenario/default.json")
# 检查temp目录
if not os.path.exists("temp/"):
os.mkdir("temp/")