I want the Python client objects to support streamed Ollama responses when I opt in with stream=True. On Client, generate, chat, pull, push, and create should accept their existing arguments plus stream=True; in that mode they should send "stream": true in the JSON request and return a normal Python iterator of typed response chunks instead of waiting for a single full response. The top-level aliases such as ollama.generate(..., stream=True) and ollama.chat(..., stream=True) should expose the same behavior because they call through the default Client.
For example, if /api/generate streams newline-delimited JSON objects {"model":"dummy","response":"Because "}, {"model":"dummy","response":"it "}, and {"model":"dummy","response":"is."}, then for part in Client(host).generate('dummy', 'Why is the sky blue?', stream=True) should yield three GenerateResponse objects with those response fragments in order. If /api/chat streams assistant message fragments like {"model":"dummy","message":{"role":"assistant","content":"I "}} and {"model":"dummy","message":{"role":"assistant","content":"know."}}, then Client(host).chat('dummy', messages=[...], stream=True) should yield ChatResponse chunks preserving the role and content fragments. For pull, push, and create, streamed newline-delimited status objects should yield ProgressResponse chunks in order, such as pulling manifest, verifying sha256 digest, and success.
I also need the async client to mirror this API. await AsyncClient(host).generate(..., stream=True), chat, pull, push, and create should return asynchronous iterators, and async for should yield the same typed chunk objects in the same order.
Stream error handling should behave like normal client errors. If the HTTP response status is an error before chunk iteration starts, the client should raise ResponseError with the response text and status code. If any streamed JSON object contains an error field, iteration should raise ResponseError for that error instead of yielding it as a normal response chunk.