diff --git a/libs/official_account_api/api.py b/libs/official_account_api/api.py index b777d626..58c9d067 100644 --- a/libs/official_account_api/api.py +++ b/libs/official_account_api/api.py @@ -176,7 +176,7 @@ class OAClient(): class OAClientForLongerResponse(): - def __init__(self,token:str,EncodingAESKey:str,AppID:str,Appsecret:str): + def __init__(self,token:str,EncodingAESKey:str,AppID:str,Appsecret:str,LoadingMessage:str): self.token = token self.aes = EncodingAESKey self.appid = AppID @@ -189,6 +189,7 @@ class OAClientForLongerResponse(): "example":[], } self.access_token_expiry_time = None + self.loading_message = LoadingMessage async def handle_callback_request(self): try: @@ -246,7 +247,7 @@ class OAClientForLongerResponse(): to_user=from_user, from_user=to_user, create_time=int(time.time()), - content="AI正在思考中,请发送任意内容获取回答。" + content=self.loading_message ) if user_msg_queue.get(from_user) and user_msg_queue[from_user][0]["content"]: diff --git a/pkg/platform/sources/officialaccount.py b/pkg/platform/sources/officialaccount.py index 13a53038..518794a6 100644 --- a/pkg/platform/sources/officialaccount.py +++ b/pkg/platform/sources/officialaccount.py @@ -107,6 +107,7 @@ class OfficialAccountAdapter(adapter.MessagePlatformAdapter): EncodingAESKey=config['EncodingAESKey'], Appsecret=config['AppSecret'], AppID=config['AppID'], + LoadingMessage=config['LoadingMessage'] ) else: raise KeyError("请设置微信公众号通信模式") diff --git a/templates/platform.json b/templates/platform.json index da233a53..fe39947c 100644 --- a/templates/platform.json +++ b/templates/platform.json @@ -78,6 +78,7 @@ "AppID":"", "AppSecret":"", "Mode":"drop", + "LoadingMessage":"AI正在思考中,请发送任意内容获取回复。", "host": "0.0.0.0", "port": 2287 },