Properly return a client in with_client
This commit is contained in:
parent
3f894c493d
commit
c219158c62
1 changed files with 2 additions and 3 deletions
|
@ -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]]]:
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue