From bee51024b399a8930b1bc333aa25cd74fdd14d53 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Wed, 26 Feb 2025 00:57:54 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E5=A4=8D=20wecom=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9=E7=9A=84=E7=A9=BA=E6=A0=BC=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E7=A1=AE=E4=BF=9D=E6=AD=A3=E7=A1=AE=E4=BC=A0=E9=80=92?= =?UTF-8?q?=20#599?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/platform/sources/wecom/wecom_adapter.py | 10 +++++----- astrbot/core/provider/sources/dify_source.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/astrbot/core/platform/sources/wecom/wecom_adapter.py b/astrbot/core/platform/sources/wecom/wecom_adapter.py index 7cf62c812..0127342fe 100644 --- a/astrbot/core/platform/sources/wecom/wecom_adapter.py +++ b/astrbot/core/platform/sources/wecom/wecom_adapter.py @@ -36,9 +36,9 @@ class WecomServer(): self.event_queue = event_queue self.crypto = WeChatCrypto( - config['token'], - config['encoding_aes_key'], - config['corpid'] + config['token'].strip(), + config['encoding_aes_key'].strip(), + config['corpid'].strip() ) self.callback = None @@ -136,8 +136,8 @@ class WecomPlatformAdapter(Platform): ) self.client = WeChatClient( - self.config['corpid'], - self.config['secret'], + self.config['corpid'].strip(), + self.config['secret'].strip(), ) self.client.API_BASE_URL = self.api_base_url diff --git a/astrbot/core/provider/sources/dify_source.py b/astrbot/core/provider/sources/dify_source.py index d0ffa9d0f..9e8e344f7 100644 --- a/astrbot/core/provider/sources/dify_source.py +++ b/astrbot/core/provider/sources/dify_source.py @@ -100,11 +100,11 @@ class ProviderDify(Provider): self.conversation_ids[session_id] = chunk['conversation_id'] conversation_id = chunk['conversation_id'] elif chunk['event'] == 'message_end': - logger.debug(f"Dify message end") + logger.debug("Dify message end") break elif chunk['event'] == 'error': - logger.error(f"Dify 出现错误:{chunk['error']}") - raise Exception(f"Dify 出现错误 status: {chunk['status']} message: {chunk['message']} error_code: {chunk['error']}") + logger.error(f"Dify 出现错误:{chunk}") + raise Exception(f"Dify 出现错误 status: {chunk['status']} message: {chunk['message']}") case "workflow": async for chunk in self.api_client.workflow_run(