mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-26 06:16:09 +00:00
feat: add support for loading message in wxoa
This commit is contained in:
@@ -176,7 +176,7 @@ class OAClient():
|
|||||||
|
|
||||||
class OAClientForLongerResponse():
|
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.token = token
|
||||||
self.aes = EncodingAESKey
|
self.aes = EncodingAESKey
|
||||||
self.appid = AppID
|
self.appid = AppID
|
||||||
@@ -189,6 +189,7 @@ class OAClientForLongerResponse():
|
|||||||
"example":[],
|
"example":[],
|
||||||
}
|
}
|
||||||
self.access_token_expiry_time = None
|
self.access_token_expiry_time = None
|
||||||
|
self.loading_message = LoadingMessage
|
||||||
|
|
||||||
async def handle_callback_request(self):
|
async def handle_callback_request(self):
|
||||||
try:
|
try:
|
||||||
@@ -246,7 +247,7 @@ class OAClientForLongerResponse():
|
|||||||
to_user=from_user,
|
to_user=from_user,
|
||||||
from_user=to_user,
|
from_user=to_user,
|
||||||
create_time=int(time.time()),
|
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"]:
|
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'],
|
EncodingAESKey=config['EncodingAESKey'],
|
||||||
Appsecret=config['AppSecret'],
|
Appsecret=config['AppSecret'],
|
||||||
AppID=config['AppID'],
|
AppID=config['AppID'],
|
||||||
|
LoadingMessage=config['LoadingMessage']
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
raise KeyError("请设置微信公众号通信模式")
|
raise KeyError("请设置微信公众号通信模式")
|
||||||
|
|||||||
@@ -78,6 +78,7 @@
|
|||||||
"AppID":"",
|
"AppID":"",
|
||||||
"AppSecret":"",
|
"AppSecret":"",
|
||||||
"Mode":"drop",
|
"Mode":"drop",
|
||||||
|
"LoadingMessage":"AI正在思考中,请发送任意内容获取回复。",
|
||||||
"host": "0.0.0.0",
|
"host": "0.0.0.0",
|
||||||
"port": 2287
|
"port": 2287
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user