mirror of
https://github.com/ollama/ollama-python.git
synced 2026-05-01 11:48:17 +08:00
fix: use _request_raw error handling for version endpoint
This commit is contained in:
parent
dbf9e4405d
commit
40ca3c9300
@ -634,9 +634,6 @@ class Client(BaseClient):
|
||||
'GET',
|
||||
'/api/version'
|
||||
)
|
||||
if r.status_code != 200:
|
||||
raise Exception(f"Request failed: {r.status_code}")
|
||||
|
||||
return r.json().get('version', '')
|
||||
|
||||
def delete(self, model: str) -> StatusResponse:
|
||||
@ -1285,10 +1282,6 @@ class AsyncClient(BaseClient):
|
||||
'GET',
|
||||
'/api/version',
|
||||
)
|
||||
|
||||
if r.status_code != 200:
|
||||
raise Exception(f"Request failed: {r.status_code}")
|
||||
|
||||
return r.json().get('version', '')
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user