fix: QQ频道停止信息来源显示
This commit is contained in:
+2
-2
@@ -529,11 +529,11 @@ def oper_msg(message, group=False, msg_ref = None, platform = None):
|
||||
while rev_edgegpt.is_busy():
|
||||
time.sleep(1)
|
||||
|
||||
res, res_code = asyncio.run_coroutine_threadsafe(rev_edgegpt.text_chat(qq_msg), bing_cache_loop).result()
|
||||
res, res_code = asyncio.run_coroutine_threadsafe(rev_edgegpt.text_chat(qq_msg, platform), bing_cache_loop).result()
|
||||
if res_code == 0: # bing不想继续话题,重置会话后重试。
|
||||
send_message(platform, message, "Bing不想继续话题了, 正在自动重置会话并重试。", msg_ref=msg_ref, gocq_loop=gocq_loop, qqchannel_bot=qqchannel_bot, gocq_bot=gocq_bot)
|
||||
asyncio.run_coroutine_threadsafe(rev_edgegpt.forget(), bing_cache_loop).result()
|
||||
res, res_code = asyncio.run_coroutine_threadsafe(rev_edgegpt.text_chat(qq_msg), bing_cache_loop).result()
|
||||
res, res_code = asyncio.run_coroutine_threadsafe(rev_edgegpt.text_chat(qq_msg, platform), bing_cache_loop).result()
|
||||
if res_code == 0: # bing还是不想继续话题,大概率说明提问有问题。
|
||||
asyncio.run_coroutine_threadsafe(rev_edgegpt.forget(), bing_cache_loop).result()
|
||||
send_message(platform, message, "Bing仍然不想继续话题, 会话已重置, 请检查您的提问后重试。", msg_ref=msg_ref, gocq_loop=gocq_loop, qqchannel_bot=qqchannel_bot, gocq_bot=gocq_bot)
|
||||
|
||||
@@ -20,7 +20,7 @@ class ProviderRevEdgeGPT(Provider):
|
||||
except BaseException:
|
||||
return False
|
||||
|
||||
async def text_chat(self, prompt):
|
||||
async def text_chat(self, prompt, platform = 'none'):
|
||||
if self.busy:
|
||||
return
|
||||
self.busy = True
|
||||
@@ -57,12 +57,13 @@ class ProviderRevEdgeGPT(Provider):
|
||||
# 不想答复
|
||||
return '', 0
|
||||
else:
|
||||
index = 1
|
||||
if len(reply_source) > 0:
|
||||
reply_msg += "\n\n信息来源:\n"
|
||||
for i in reply_source:
|
||||
reply_msg += f"[{str(index)}]: {i['seeMoreUrl']} | {i['providerDisplayName']}\n"
|
||||
index += 1
|
||||
if platform != 'qqchan':
|
||||
index = 1
|
||||
if len(reply_source) > 0:
|
||||
reply_msg += "\n\n信息来源:\n"
|
||||
for i in reply_source:
|
||||
reply_msg += f"[{str(index)}]: {i['seeMoreUrl']} | {i['providerDisplayName']}\n"
|
||||
index += 1
|
||||
if throttling is not None:
|
||||
reply_msg += f"\n⌈{throttling['numUserMessagesInConversation']}/{throttling['maxNumUserMessagesInConversation']}⌋"
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user