mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
feat: add support for loading message in wxoa
This commit is contained in:
@@ -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"]:
|
||||
|
||||
@@ -107,6 +107,7 @@ class OfficialAccountAdapter(adapter.MessagePlatformAdapter):
|
||||
EncodingAESKey=config['EncodingAESKey'],
|
||||
Appsecret=config['AppSecret'],
|
||||
AppID=config['AppID'],
|
||||
LoadingMessage=config['LoadingMessage']
|
||||
)
|
||||
else:
|
||||
raise KeyError("请设置微信公众号通信模式")
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
"AppID":"",
|
||||
"AppSecret":"",
|
||||
"Mode":"drop",
|
||||
"LoadingMessage":"AI正在思考中,请发送任意内容获取回复。",
|
||||
"host": "0.0.0.0",
|
||||
"port": 2287
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user