Skip to content

Commit 6d892b3

Browse files
authored
Fix streaming parameter encoding in prediction creation requests (#178)
Resolves #175 --------- Signed-off-by: Mattt Zmuda <[email protected]>
1 parent 99d6d1e commit 6d892b3

File tree

4 files changed

+337
-3
lines changed

4 files changed

+337
-3
lines changed

replicate/deployment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def create( # type: ignore
127127
if webhook_events_filter is not None:
128128
body["webhook_events_filter"] = webhook_events_filter
129129
if stream is True:
130-
body["stream"] = "true"
130+
body["stream"] = True
131131

132132
resp = self._client._request(
133133
"POST",

replicate/prediction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def create( # type: ignore
194194
"""
195195

196196
input = encode_json(input, upload_file=upload_file)
197-
body = {
197+
body: Dict[str, Any] = {
198198
"version": version if isinstance(version, str) else version.id,
199199
"input": input,
200200
}
@@ -205,7 +205,7 @@ def create( # type: ignore
205205
if webhook_events_filter is not None:
206206
body["webhook_events_filter"] = webhook_events_filter
207207
if stream is True:
208-
body["stream"] = "true"
208+
body["stream"] = True
209209

210210
resp = self._client._request(
211211
"POST",

0 commit comments

Comments
 (0)