Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Merge #541
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio committed Jun 15, 2023
1 parent 476c81b commit b086330
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/EdgeGPT/EdgeGPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ async def close(self) -> None:
"""
await self.chat_hub.close()

async def remove_and_close(self) -> None:
async def delete_conversation(self, conversation_id: str=None, conversation_signature: str=None, client_id: str=None) -> None:
"""
Delete the chat in the server and close the connection
"""
await self.chat_hub.remove_and_close()
await self.chat_hub.delete_conversation(conversation_id=conversation_id, conversation_signature=conversation_signature, client_id=client_id)

async def reset(self, delete=False) -> None:
"""
Expand Down
10 changes: 4 additions & 6 deletions src/EdgeGPT/chathub.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ async def _initial_handshake(self, wss: aiohttp.ClientWebSocketResponse) -> None
await wss.receive(timeout=900)
await wss.send_str(append_identifier({"type": 6}))

async def remove_and_close(self) -> None:
conversation_id = self.request.conversation_id
conversation_signature = self.request.conversation_signature
client_id = self.request.client_id
async def delete_conversation(self, conversation_id: str=None, conversation_signature: str=None, client_id: str=None) -> None:
conversation_id = conversation_id or self.request.conversation_id
conversation_signature = conversation_signature or self.request.conversation_signature
client_id = client_id or self.request.client_id
url = "https://sydney.bing.com/sydney/DeleteSingleConversation"
await self.session.post(
url,
Expand All @@ -244,7 +244,5 @@ async def remove_and_close(self) -> None:
"optionsSets": ["autosave"]
}
)
await self.session.aclose()

async def close(self) -> None:
await self.session.aclose()

0 comments on commit b086330

Please # to comment.