perf: 优化bing模型达到单次会话上限后自动重置

This commit is contained in:
Soulter
2023-04-22 11:27:43 +08:00
parent c9821132ad
commit ca5a1ddc0b
+7
View File
@@ -65,6 +65,13 @@ class ProviderRevEdgeGPT(Provider):
reply_msg += f"[{str(index)}]: {i['seeMoreUrl']} | {i['providerDisplayName']}\n"
index += 1
if throttling is not None:
if throttling['numUserMessagesInConversation'] == throttling['maxNumUserMessagesInConversation']:
# 达到上限,重置会话
await self.forget()
if throttling['numUserMessagesInConversation'] > throttling['maxNumUserMessagesInConversation']:
await self.forget()
err_count += 1
continue
reply_msg += f"\n{throttling['numUserMessagesInConversation']}/{throttling['maxNumUserMessagesInConversation']}"
break
except BaseException as e: