mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
删除一部分注释和调试信息
This commit is contained in:
@@ -89,7 +89,7 @@ preset_mode = "default"
|
||||
|
||||
# 过滤AI脱离人设的消息
|
||||
# 这类消息在对应情景json中设置,将其替换为自定义消息,以保持人格
|
||||
# filter_ai_warning = False
|
||||
filter_ai_warning = False
|
||||
|
||||
# 群内响应规则
|
||||
# 符合此消息的群内消息即使不包含at机器人也会响应
|
||||
|
||||
@@ -256,17 +256,19 @@ class Session:
|
||||
del (res_ans_spt[0])
|
||||
res_ans = '\n\n'.join(res_ans_spt)
|
||||
|
||||
|
||||
# 检测是否包含ai人格否定
|
||||
# logging.debug('bot_filter: {}'.format(self.bot_filter))
|
||||
# if config.filter_ai_warning and self.bot_filter:
|
||||
# import re
|
||||
# match = re.search(self.bot_filter['reg'], res_ans)
|
||||
# logging.debug(self.bot_filter)
|
||||
# logging.debug(res_ans)
|
||||
# if match:
|
||||
# logging.debug('回复:{}, 检测到人格否定,替换中。。'.format(res_ans))
|
||||
# res_ans = self.bot_filter['replace']
|
||||
# logging.debug('替换为: {}'.format(res_ans))
|
||||
logging.debug('bot_filter: {}'.format(self.bot_filter))
|
||||
if config.filter_ai_warning and self.bot_filter:
|
||||
import re
|
||||
match = re.search(self.bot_filter['reg'], res_ans)
|
||||
logging.debug(self.bot_filter)
|
||||
logging.debug(res_ans)
|
||||
if match:
|
||||
logging.debug('回复:{}, 检测到人格否定,替换中。。'.format(res_ans))
|
||||
res_ans = self.bot_filter['replace']
|
||||
logging.debug('替换为: {}'.format(res_ans))
|
||||
|
||||
|
||||
# 将此次对话的双方内容加入到prompt中
|
||||
self.prompt.append({'role': 'user', 'content': text})
|
||||
|
||||
Reference in New Issue
Block a user