Skip to content

Commit

Permalink
fix(client): fix a bug which causes client's running status not to be…
Browse files Browse the repository at this point in the history
… updated
  • Loading branch information
HanaokaYuzu committed May 26, 2024
1 parent 67a1236 commit 2fab029
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gemini_webapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,15 @@ async def close(self, delay: float = 0) -> None:
if delay:
await asyncio.sleep(delay)

self.running = False

if self.close_task:
self.close_task.cancel()
self.close_task = None

if self.client:
await self.client.aclose()

self.running = False

async def reset_close_task(self) -> None:
"""
Reset the timer for closing the client when a new request is made.
Expand Down Expand Up @@ -486,7 +486,9 @@ def __setattr__(self, name: str, value: Any) -> None:
self.rcid = value.rcid

async def send_message(
self, prompt: str, images: list[bytes | str | Path] | None = None,
self,
prompt: str,
images: list[bytes | str | Path] | None = None,
) -> ModelOutput:
"""
Generates contents with prompt.
Expand Down

0 comments on commit 2fab029

Please sign in to comment.