diff --git a/model/bing/jailbroken_sydney.py b/model/bing/jailbroken_sydney.py index c10b06e..198e46f 100644 --- a/model/bing/jailbroken_sydney.py +++ b/model/bing/jailbroken_sydney.py @@ -87,6 +87,8 @@ class SydneyBot(Chatbot): ): if final: try: + if self.chat_hub.wss and not self.chat_hub.wss.closed: + await self.chat_hub.wss.close() self.update_reply_cache(response["item"]["messages"][-1]) except Exception as e: self.conversations_cache[self.conversation_key]["messages"].pop() @@ -99,9 +101,6 @@ class SydneyBot(Chatbot): conversation_style: EdgeGPT.CONVERSATION_STYLE_TYPE = None, message_id: str = None ) -> dict: - if self.chat_hub.wss: - if not self.chat_hub.wss.closed: - await self.chat_hub.wss.close() async for final, response in self.ask_stream( prompt=prompt, conversation_style=conversation_style, diff --git a/requirements.txt b/requirements.txt index 92b0b1d..db2fa6b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ PyJWT flask flask_socketio itchat-uos==1.5.0.dev0 -openai \ No newline at end of file +openai +EdgeGPT \ No newline at end of file