forked from zhayujie/chatgpt-on-wechat
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 41762a1 Merge: e0d2e34 a786fa4 Author: zhayujie <yjzha1996@163.com> Date: Fri Jul 21 17:18:56 2023 +0800 Merge pull request zhayujie#1332 from zhayujie/feat-1.3.3 fix: reduce memory usage commit a786fa4 Author: zhayujie <yjzha1996@163.com> Date: Fri Jul 21 17:16:34 2023 +0800 fix: reduce the expiration time and avoid storing the original message text to decrease memory usage commit e4c7602 Author: zhayujie <yjzha1996@163.com> Date: Fri Jul 21 17:14:11 2023 +0800 docs: update README.md commit e0d2e34 Merge: 2361e3c 9ef8e1b Author: zhayujie <yjzha1996@163.com> Date: Fri Jul 21 10:50:16 2023 +0800 Merge pull request zhayujie#1328 from zhayujie/feat-1.3.3 feat: support global plugin config for docker env commit 9ef8e1b Author: zhayujie <yjzha1996@163.com> Date: Thu Jul 20 16:08:19 2023 +0800 feat: move loading config method to base class commit aae9b64 Author: zhayujie <yjzha1996@163.com> Date: Thu Jul 20 14:46:41 2023 +0800 fix: reduce unnecessary error traceback logs commit 4bab429 Author: zhayujie <yjzha1996@163.com> Date: Thu Jul 20 14:24:40 2023 +0800 fix: global plugin config read commit 954e55f Author: zhayujie <yjzha1996@163.com> Date: Thu Jul 20 11:36:02 2023 +0800 feat: add plugin global config to support docker volumes commit 2361e3c Author: zhayujie <yjzha1996@163.com> Date: Wed Jul 19 18:23:59 2023 +0800 docs: update README for railway cancelled free service commit 8aac86f Merge: 94b47a5 6384e93 Author: zhayujie <yjzha1996@163.com> Date: Wed Jul 5 01:44:06 2023 +0800 Merge pull request zhayujie#1291 from 6vision/master (tool)fix azure model commit 6384e93 Author: vision <vision_wangpc@sina.com> Date: Wed Jul 5 01:06:53 2023 +0800 plugin(tool): 更新0.4.6 1、temp fix summary tool not ending bug 2、兼容0613 gpt-3.5 3、add azure's model name: gpt-35-turbo commit 7a9205d Author: vision <vision_wangpc@sina.com> Date: Wed Jul 5 01:01:46 2023 +0800 fix azure model 更新chatgpt_tool_hub至0.4.6,拉取最新代码。tool即可使用azure接口! commit 94b47a5 Merge: 709b5be f970b2c Author: Jianglang <lanvent@qq.com> Date: Sat Jul 1 18:37:07 2023 +0800 Merge pull request zhayujie#1282 from haikerapples/master_haiker_timetask 内置 timetask 插件 commit 709b5be Author: zhayujie <yjzha1996@163.com> Date: Sat Jul 1 13:17:08 2023 +0800 fix: group voice config and azure model calc support commit f970b2c Author: haikerwang <haikerwang@tencent.com> Date: Thu Jun 29 00:58:57 2023 +0800 内置 timetask 插件
- Loading branch information
Showing
14 changed files
with
150 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"godcmd": { | ||
"password": "", | ||
"admin_users": [] | ||
}, | ||
"banwords": { | ||
"action": "replace", | ||
"reply_filter": true, | ||
"reply_action": "ignore" | ||
}, | ||
"tool": { | ||
"tools": [ | ||
"python", | ||
"url-get", | ||
"terminal", | ||
"meteo-weather" | ||
], | ||
"kwargs": { | ||
"top_k_results": 2, | ||
"no_default": false, | ||
"model_name": "gpt-3.5-turbo" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,28 @@ | ||
import os | ||
import json | ||
from config import pconf | ||
from common.log import logger | ||
|
||
|
||
class Plugin: | ||
def __init__(self): | ||
self.handlers = {} | ||
|
||
def load_config(self) -> dict: | ||
""" | ||
加载当前插件配置 | ||
:return: 插件配置字典 | ||
""" | ||
# 优先获取 plugins/config.json 中的全局配置 | ||
plugin_conf = pconf(self.name) | ||
if not plugin_conf: | ||
# 全局配置不存在,则获取插件目录下的配置 | ||
plugin_config_path = os.path.join(self.path, "config.json") | ||
if os.path.exists(plugin_config_path): | ||
with open(plugin_config_path, "r") as f: | ||
plugin_conf = json.load(f) | ||
logger.debug(f"loading plugin config, plugin_name={self.name}, conf={plugin_conf}") | ||
return plugin_conf | ||
|
||
def get_help_text(self, **kwargs): | ||
return "暂无帮助信息" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters