From 8ac47707d86c5da2412d822efd2e4991d80e686b Mon Sep 17 00:00:00 2001 From: ParthSareen Date: Tue, 18 Feb 2025 15:48:39 -0800 Subject: [PATCH] add AbstractAsyncContextManager to BaseClient --- ollama/_client.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ollama/_client.py b/ollama/_client.py index f731205..ae755eb 100644 --- a/ollama/_client.py +++ b/ollama/_client.py @@ -76,7 +76,7 @@ from ollama._types import ( T = TypeVar('T') -class BaseClient(contextlib.AbstractContextManager): +class BaseClient(contextlib.AbstractContextManager, contextlib.AbstractAsyncContextManager): def __init__( self, client, @@ -120,9 +120,6 @@ class BaseClient(contextlib.AbstractContextManager): def __exit__(self, exc_type, exc_val, exc_tb): self.close() - async def __aenter__(self) -> Any: - return self - async def __aexit__(self, exc_type, exc_val, exc_tb): await self.close()