mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-17 18:06:06 +00:00
adjust:整理代码,仅添加json方式的prompt读取
This commit is contained in:
@@ -27,15 +27,7 @@ def check_response_rule(text: str, event):
|
||||
config = pkg.utils.context.get_config()
|
||||
if not hasattr(config, 'response_rules'):
|
||||
return False, ''
|
||||
|
||||
|
||||
bot_name = pkg.openai.session.get_session('group_{}'.format(event.group.id)).bot_name
|
||||
logging.debug(bot_name)
|
||||
# 检查情景json自带的名字
|
||||
if bot_name:
|
||||
import re
|
||||
if re.search(bot_name, text):
|
||||
return True, text
|
||||
|
||||
rules = config.response_rules
|
||||
# 检查前缀匹配
|
||||
if 'prefix' in rules:
|
||||
|
||||
Reference in New Issue
Block a user