Skip to content

Commit

Permalink
feat: hot reload plugin config by reloadp command (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanfangyuan4396 authored Oct 5, 2024
1 parent d7b67a6 commit b1567e8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/config.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@
"max_words": 8000,
"white_url_list": [],
"black_url_list": ["https://support.weixin.qq.com", "https://channels-aladin.wxqcloud.qq.com"],
"prompt": "我需要对下面的文本进行总结,总结输出包括以下三个部分:\n📖 一句话总结\n🔑 关键要点,用数字序号列出3-5个文章的核心内容\n🏷 标签: #xx #xx\n请使用emoji让你的表达更生动。"
"prompt": "我需要对下面的文本进行总结,总结输出包括以下三个部分:\n📖 一句话总结\n🔑 关键要点,用数字序号列出3-5个文章的核心内容\n🏷 标签: #xx #xx\n。不要使用'**'加粗标题优化输出格式。"
}
}
2 changes: 1 addition & 1 deletion plugins/jina_sum/config.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"max_words": 8000,
"white_url_list": [],
"black_url_list": ["https://support.weixin.qq.com", "https://channels-aladin.wxqcloud.qq.com"],
"prompt": "我需要对下面的文本进行总结,总结输出包括以下三个部分:\n📖 一句话总结\n🔑 关键要点,用数字序号列出3-5个文章的核心内容\n🏷 标签: #xx #xx\n请使用emoji让你的表达更生动。"
"prompt": "我需要对下面的文本进行总结,总结输出包括以下三个部分:\n📖 一句话总结\n🔑 关键要点,用数字序号列出3-5个文章的核心内容\n🏷 标签: #xx #xx\n。不要使用'**'加粗标题优化输出格式。"
}
1 change: 1 addition & 0 deletions plugins/plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def refresh_order(self):

def activate_plugins(self): # 生成新开启的插件实例
failed_plugins = []
self._load_all_config() # 重新读取全局插件配置,支持使用#reloadp命令对插件配置热更新
for name, plugincls in self.plugins.items():
if plugincls.enabled:
if 'GODCMD' in self.instances and name == 'GODCMD':
Expand Down

0 comments on commit b1567e8

Please sign in to comment.