fix: no summary config bug

This commit is contained in:
zhayujie
2023-09-25 18:30:19 +08:00
parent a5a234ed97
commit a1aa925019
3 changed files with 7 additions and 4 deletions

View File

@@ -93,7 +93,7 @@
#### 配置
该功能依赖 LinkAI的知识库及对话功能需要在项目根目录的config.json中设置 `linkai_api_key` 同时根据上述插件配置说明,添加 `summary` 部分的配置,设置 `enabled` 为 true。
该功能依赖 LinkAI的知识库及对话功能需要在项目根目录的config.json中设置 `linkai_api_key` 同时根据上述插件配置说明,在插件config.json添加 `summary` 部分的配置,设置 `enabled` 为 true。
如果不想创建 `plugins/linkai/config.json` 配置,可以直接通过 `$linkai sum open` 指令开启该功能。

View File

@@ -171,8 +171,11 @@ class LinkAI(Plugin):
if cmd[2] == "close":
tips_text = "关闭"
is_open = False
self.sum_config["enabled"] = is_open
_set_reply_text(f"文章总结功能{tips_text}", e_context, level=ReplyType.INFO)
if not self.sum_config:
_set_reply_text(f"插件未启用summary功能请参考以下链添加插件配置\n\nhttps://github.com/zhayujie/chatgpt-on-wechat/blob/master/plugins/linkai/README.md", e_context, level=ReplyType.INFO)
else:
self.sum_config["enabled"] = is_open
_set_reply_text(f"文章总结功能{tips_text}", e_context, level=ReplyType.INFO)
else:
_set_reply_text(f"指令错误,请输入{_get_trigger_prefix()}linkai help 获取帮助", e_context,
level=ReplyType.INFO)

View File

@@ -85,5 +85,5 @@ class LinkSummary:
for support_url in support_list:
if url.strip().startswith(support_url):
return True
logger.warn("[LinkSum] unsupported url")
logger.debug("[LinkSum] unsupported url, no need to process")
return False