mirror of
https://github.com/ollama/ollama-python.git
synced 2026-05-01 11:48:17 +08:00
_stream in async client raises RuntimeError processing HTTP errors (#266)
Fixes a bug processing errors in async client. When response in _stream has an HTTP error, the process raises a RuntimeError("Attempted to call a sync iterator on an async stream.") due to use of e.response.read() instead of await e.response.aread()
This commit is contained in:
parent
d98f646929
commit
81edab1b64
@ -495,7 +495,7 @@ class AsyncClient(BaseClient):
|
||||
try:
|
||||
r.raise_for_status()
|
||||
except httpx.HTTPStatusError as e:
|
||||
e.response.read()
|
||||
await e.response.aread()
|
||||
raise ResponseError(e.response.text, e.response.status_code) from None
|
||||
|
||||
async for line in r.aiter_lines():
|
||||
|
||||
Loading…
Reference in New Issue
Block a user