diff --git a/src/cogs/ollama.py b/src/cogs/ollama.py index aad739c..36d4c99 100644 --- a/src/cogs/ollama.py +++ b/src/cogs/ollama.py @@ -194,7 +194,7 @@ class OllamaClient: def with_client( self, timeout: httpx.Timeout | float | int | None = None - ) -> contextlib.AbstractContextManager[httpx.AsyncClient]: + ) -> httpx.AsyncClient: """ Creates an instance for a request, with properly populated values. :param timeout: @@ -206,8 +206,7 @@ class OllamaClient: timeout = httpx.Timeout(timeout) else: timeout = timeout or httpx.Timeout(60) - async with httpx.AsyncClient(base_url=self.base_url, timeout=timeout, auth=self.authorisation) as client: - yield client + return httpx.AsyncClient(base_url=self.base_url, timeout=timeout, auth=self.authorisation) async def get_tags(self) -> dict[typing.Literal["models"], dict[str, str, int, dict[str, str, None]]]: """