From 48dcd257da099c18f86a52073fa4e492b76cc88b Mon Sep 17 00:00:00 2001 From: 26751 <2675174581@qq.com> Date: Sat, 1 Apr 2023 18:29:24 +0800 Subject: [PATCH] Signed-off-by: 26751 <2675174581@qq.com> --- pkg/qqbot/cmds/session/reset.py | 5 +++-- tips_custom_template.py | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/qqbot/cmds/session/reset.py b/pkg/qqbot/cmds/session/reset.py index 269cdb30..483defea 100644 --- a/pkg/qqbot/cmds/session/reset.py +++ b/pkg/qqbot/cmds/session/reset.py @@ -1,3 +1,4 @@ +import tips_custom from ..mgr import AbstractCommandNode, Context import pkg.openai.session @@ -22,12 +23,12 @@ class ResetCommand(AbstractCommandNode): if len(params) == 0: pkg.openai.session.get_session(session_name).reset(explicit=True) - reply = ["[bot]会话已重置"] + reply = tips_custom.command_reset_message else: try: import pkg.openai.dprompt as dprompt pkg.openai.session.get_session(session_name).reset(explicit=True, use_prompt=params[0]) - reply = ["[bot]会话已重置,使用场景预设:{}".format(dprompt.mode_inst().get_full_name(params[0]))] + reply = [tips_custom.command_reset_name_message+"{}".format(dprompt.mode_inst().get_full_name(params[0]))] except Exception as e: reply = ["[bot]会话重置失败:{}".format(e)] diff --git a/tips_custom_template.py b/tips_custom_template.py index 4cae59a9..d9f72562 100644 --- a/tips_custom_template.py +++ b/tips_custom_template.py @@ -25,7 +25,8 @@ help_message = """【可自定义】 请不要用其生成整篇文章或大段代码,因为每次只会向模型提交少部分文字,生成大部分文字会产生偏题、前后矛盾等问题 每次会话最后一次交互后{}分钟后会自动结束,结束后将开启新会话,如需继续前一次会话请发送 !last 重新开启 欢迎到github.com/RockChinQ/QChatGPT 给个star -指令帮助信息请查看: https://github.com/RockChinQ/QChatGPT/wiki/%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8#%E6%9C%BA%E5%99%A8%E4%BA%BA%E6%8C%87%E4%BB%A4""".format(config.session_expire_time // 60) +指令帮助信息请查看: https://github.com/RockChinQ/QChatGPT/wiki/%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8#%E6%9C%BA%E5%99%A8%E4%BA%BA%E6%8C%87%E4%BB%A4""".format( + config.session_expire_time // 60) # ---原config.py结束-- @@ -42,3 +43,8 @@ replys_message = ["群聊请求超时"] # line:266,279 command_admin_message = "权限不足: " command_err_message = "指令执行出错:" + +# 会话重置提示 +# pkg/qqbot/cmds/session/reset.py,line:25,31 +command_reset_message = ["[bot]会话已重置"] +command_reset_name_message = ["[bot]会话已重置,使用场景预设:"]