Compare commits

..

4 Commits

Author SHA1 Message Date
Michael Yang 1a60f07e28 Merge pull request #10 from easp/main
Changed 'show' to use POST instead of GET
2024-01-16 12:22:48 -08:00
Erik Sp 27e2ef1161 Changed 'show' to use POST instead of GET 2024-01-14 12:00:20 -08:00
Michael Yang 53b10f7c00 Merge pull request #9 from jmorganca/destination
s/target/destination/
2024-01-12 15:03:31 -08:00
Michael Yang 582839f24f s/target/destination/ 2024-01-12 14:59:32 -08:00
+6 -6
View File
@@ -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()