From d2ea72ae0753735116bd498967c7681581c62cbb Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Wed, 10 Jan 2024 17:20:35 -0800 Subject: [PATCH] return full list objects --- ollama/_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ollama/_client.py b/ollama/_client.py index e4aceac..35f6f2c 100644 --- a/ollama/_client.py +++ b/ollama/_client.py @@ -297,7 +297,7 @@ class Client(BaseClient): return {'status': 'success' if response.status_code == 200 else 'error'} def list(self) -> Mapping[str, Any]: - return self._request('GET', '/api/tags').json().get('models', []) + return self._request('GET', '/api/tags').json() def copy(self, source: str, target: str) -> Mapping[str, Any]: response = self._request('POST', '/api/copy', json={'source': source, 'destination': target}) @@ -573,7 +573,7 @@ class AsyncClient(BaseClient): async def list(self) -> Mapping[str, Any]: response = await self._request('GET', '/api/tags') - return response.json().get('models', []) + return response.json() async def copy(self, source: str, target: str) -> Mapping[str, Any]: response = await self._request('POST', '/api/copy', json={'source': source, 'destination': target})