Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Fix reset conversation (#6)
Browse files Browse the repository at this point in the history
* Fix reset conversation
  • Loading branch information
vsakkas authored Nov 7, 2023
1 parent 301b3d2 commit 4be0528
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bard/bard.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ async def _get_session(self, force_close: bool = False) -> ClientSession:
"__Secure-1PSIDTS": self.secure_1psidts,
}

if self.session and force_close:
if self.session and not self.session.closed and force_close:
await self.session.close()
self.session = None

if not self.session:
self.session = ClientSession(
Expand Down Expand Up @@ -144,6 +145,7 @@ async def close_conversation(self) -> None:
"""
if self.session and not self.session.closed:
await self.session.close()
self.session = None

self.conversation_id = None
self.response_id = None
Expand Down

0 comments on commit 4be0528

Please sign in to comment.