From 1da596639f9316f971627b99c46704e3d6950526 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Sat, 6 Apr 2024 00:19:22 +0800 Subject: [PATCH 1/2] feat: update sdk version --- requirements-optional.txt | 3 --- requirements.txt | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/requirements-optional.txt b/requirements-optional.txt index e076558..eed22c0 100644 --- a/requirements-optional.txt +++ b/requirements-optional.txt @@ -35,9 +35,6 @@ broadscope_bailian # google google-generativeai -# linkai -linkai>=0.0.3.5 - # dingtalk dingtalk_stream diff --git a/requirements.txt b/requirements.txt index 495917b..aed76c3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,5 @@ requests>=2.28.2 chardet>=5.1.0 Pillow pre-commit -web.py \ No newline at end of file +web.py +linkai>=0.0.3.7 From 66a014150b9f98d99689145da445298bee6b1777 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Sat, 6 Apr 2024 01:03:26 +0800 Subject: [PATCH 2/2] fix: config update bug --- channel/chat_channel.py | 1 + channel/wechat/wechat_channel.py | 2 +- common/linkai_client.py | 7 +++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/channel/chat_channel.py b/channel/chat_channel.py index 907cea2..689fa0a 100644 --- a/channel/chat_channel.py +++ b/channel/chat_channel.py @@ -75,6 +75,7 @@ class ChatChannel(Channel): ): session_id = group_id else: + logger.debug(f"No need reply, groupName not in whitelist, group_name={group_name}") return None context["session_id"] = session_id context["receiver"] = group_id diff --git a/channel/wechat/wechat_channel.py b/channel/wechat/wechat_channel.py index a65269c..5cab1fb 100644 --- a/channel/wechat/wechat_channel.py +++ b/channel/wechat/wechat_channel.py @@ -96,7 +96,7 @@ def qrCallback(uuid, status, qrcode): print(qr_api4) print(qr_api2) print(qr_api1) - _send_qr_code([qr_api1, qr_api2, qr_api3, qr_api4]) + _send_qr_code([qr_api3, qr_api4, qr_api2, qr_api1]) qr = qrcode.QRCode(border=1) qr.add_data(url) qr.make(fit=True) diff --git a/common/linkai_client.py b/common/linkai_client.py index 8112f19..071be0a 100644 --- a/common/linkai_client.py +++ b/common/linkai_client.py @@ -2,7 +2,7 @@ from bridge.context import Context, ContextType from bridge.reply import Reply, ReplyType from common.log import logger from linkai import LinkAIClient, PushMsg -from config import conf, pconf, plugin_config, load_config +from config import conf, pconf, plugin_config, available_setting from plugins import PluginManager @@ -33,10 +33,9 @@ class ChatClient(LinkAIClient): return local_config = conf() - for key in local_config.keys(): - if config.get(key) is not None: + for key in config.keys(): + if key in available_setting and config.get(key) is not None: local_config[key] = config.get(key) - # 语音配置 reply_voice_mode = config.get("reply_voice_mode") if reply_voice_mode: