Skip to content

Commit 04be83f

Browse files
committed
Rename FileOutput.client to ._client
Signed-off-by: Mattt Zmuda <[email protected]>
1 parent fe2323a commit 04be83f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

replicate/helpers.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,32 +124,29 @@ class FileOutput(httpx.SyncByteStream, httpx.AsyncByteStream):
124124
The file URL.
125125
"""
126126

127-
client: "Client"
128-
"""
129-
A Replicate client used to download the file.
130-
"""
127+
_client: "Client"
131128

132129
def __init__(self, url: str, client: "Client") -> None:
133130
self.url = url
134-
self.client = client
131+
self._client = client
135132

136133
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:
138135
response.raise_for_status()
139136
return response.read()
140137

141138
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:
143140
response.raise_for_status()
144141
yield from response.iter_bytes()
145142

146143
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:
148145
response.raise_for_status()
149146
return await response.aread()
150147

151148
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:
153150
response.raise_for_status()
154151
async for chunk in response.aiter_bytes():
155152
yield chunk

0 commit comments

Comments
 (0)