mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-27 16:04:21 +00:00
bug:修复上次更新后不响应的问题
This commit is contained in:
+10
-1
@@ -102,6 +102,15 @@ def get_prompt(name: str = None) -> str:
|
|||||||
|
|
||||||
for key in default_dict:
|
for key in default_dict:
|
||||||
if key.lower().startswith(name.lower()):
|
if key.lower().startswith(name.lower()):
|
||||||
return default_dict[key], None, None
|
return [
|
||||||
|
{
|
||||||
|
"role":"user",
|
||||||
|
"content":default_dict[key]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role":"assistant",
|
||||||
|
"content":"好的。"
|
||||||
|
}
|
||||||
|
], None, None
|
||||||
|
|
||||||
raise KeyError("未找到默认情景预设: " + name)
|
raise KeyError("未找到默认情景预设: " + name)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import pkg.plugin.models as plugin_models
|
|||||||
|
|
||||||
|
|
||||||
# 检查消息是否符合泛响应匹配机制
|
# 检查消息是否符合泛响应匹配机制
|
||||||
def check_response_rule(text: str, event):
|
def check_response_rule(text: str):
|
||||||
config = pkg.utils.context.get_config()
|
config = pkg.utils.context.get_config()
|
||||||
if not hasattr(config, 'response_rules'):
|
if not hasattr(config, 'response_rules'):
|
||||||
return False, ''
|
return False, ''
|
||||||
@@ -318,7 +318,7 @@ class QQBotManager:
|
|||||||
# 直接调用
|
# 直接调用
|
||||||
reply = process()
|
reply = process()
|
||||||
else:
|
else:
|
||||||
check, result = check_response_rule(str(event.message_chain).strip(), event)
|
check, result = check_response_rule(str(event.message_chain).strip())
|
||||||
|
|
||||||
if check:
|
if check:
|
||||||
reply = process(result.strip())
|
reply = process(result.strip())
|
||||||
|
|||||||
Reference in New Issue
Block a user