@@ -124,32 +124,29 @@ class FileOutput(httpx.SyncByteStream, httpx.AsyncByteStream):
124
124
The file URL.
125
125
"""
126
126
127
- client : "Client"
128
- """
129
- A Replicate client used to download the file.
130
- """
127
+ _client : "Client"
131
128
132
129
def __init__ (self , url : str , client : "Client" ) -> None :
133
130
self .url = url
134
- self .client = client
131
+ self ._client = client
135
132
136
133
def read (self ) -> bytes :
137
- with self .client ._client .stream ("GET" , self .url ) as response :
134
+ with self ._client ._client .stream ("GET" , self .url ) as response :
138
135
response .raise_for_status ()
139
136
return response .read ()
140
137
141
138
def __iter__ (self ) -> Iterator [bytes ]:
142
- with self .client ._client .stream ("GET" , self .url ) as response :
139
+ with self ._client ._client .stream ("GET" , self .url ) as response :
143
140
response .raise_for_status ()
144
141
yield from response .iter_bytes ()
145
142
146
143
async def aread (self ) -> bytes :
147
- async with self .client ._async_client .stream ("GET" , self .url ) as response :
144
+ async with self ._client ._async_client .stream ("GET" , self .url ) as response :
148
145
response .raise_for_status ()
149
146
return await response .aread ()
150
147
151
148
async def __aiter__ (self ) -> AsyncIterator [bytes ]:
152
- async with self .client ._async_client .stream ("GET" , self .url ) as response :
149
+ async with self ._client ._async_client .stream ("GET" , self .url ) as response :
153
150
response .raise_for_status ()
154
151
async for chunk in response .aiter_bytes ():
155
152
yield chunk
0 commit comments