Signed-off-by: 26751 <2675174581@qq.com>

This commit is contained in:
26751
2023-04-01 18:29:24 +08:00
parent da03911610
commit 48dcd257da
2 changed files with 10 additions and 3 deletions

View File

@@ -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)]