mirror of
https://github.com/ollama/ollama-python.git
synced 2026-06-16 21:24:52 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a60f07e28 | |||
| 27e2ef1161 | |||
| 53b10f7c00 | |||
| 582839f24f |
+6
-6
@@ -299,12 +299,12 @@ class Client(BaseClient):
|
||||
def list(self) -> Mapping[str, Any]:
|
||||
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})
|
||||
def copy(self, source: str, destination: str) -> Mapping[str, Any]:
|
||||
response = self._request('POST', '/api/copy', json={'source': source, 'destination': destination})
|
||||
return {'status': 'success' if response.status_code == 200 else 'error'}
|
||||
|
||||
def show(self, model: str) -> Mapping[str, Any]:
|
||||
return self._request('GET', '/api/show', json={'name': model}).json()
|
||||
return self._request('POST', '/api/show', json={'name': model}).json()
|
||||
|
||||
|
||||
class AsyncClient(BaseClient):
|
||||
@@ -575,12 +575,12 @@ class AsyncClient(BaseClient):
|
||||
response = await self._request('GET', '/api/tags')
|
||||
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})
|
||||
async def copy(self, source: str, destination: str) -> Mapping[str, Any]:
|
||||
response = await self._request('POST', '/api/copy', json={'source': source, 'destination': destination})
|
||||
return {'status': 'success' if response.status_code == 200 else 'error'}
|
||||
|
||||
async def show(self, model: str) -> Mapping[str, Any]:
|
||||
response = await self._request('GET', '/api/show', json={'name': model})
|
||||
response = await self._request('POST', '/api/show', json={'name': model})
|
||||
return response.json()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user