From ca5a1ddc0bcfc969b818448aa022f6de4b8bb987 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Sat, 22 Apr 2023 11:27:43 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96bing=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E8=BE=BE=E5=88=B0=E5=8D=95=E6=AC=A1=E4=BC=9A=E8=AF=9D?= =?UTF-8?q?=E4=B8=8A=E9=99=90=E5=90=8E=E8=87=AA=E5=8A=A8=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/provider/provider_rev_edgegpt.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/model/provider/provider_rev_edgegpt.py b/model/provider/provider_rev_edgegpt.py index e40a27630..34a0d74b8 100644 --- a/model/provider/provider_rev_edgegpt.py +++ b/model/provider/provider_rev_edgegpt.py @@ -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: