Skip to content

Commit

Permalink
Fix streaming parameter encoding in prediction creation requests (#178
Browse files Browse the repository at this point in the history
)

Resolves #175

---------

Signed-off-by: Mattt Zmuda <mattt@replicate.com>
  • Loading branch information
mattt authored Oct 29, 2023
1 parent 99d6d1e commit 6d892b3
Show file tree
Hide file tree
Showing 4 changed files with 337 additions and 3 deletions.
2 changes: 1 addition & 1 deletion replicate/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def create( # type: ignore
if webhook_events_filter is not None:
body["webhook_events_filter"] = webhook_events_filter
if stream is True:
body["stream"] = "true"
body["stream"] = True

resp = self._client._request(
"POST",
Expand Down
4 changes: 2 additions & 2 deletions replicate/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def create( # type: ignore
"""

input = encode_json(input, upload_file=upload_file)
body = {
body: Dict[str, Any] = {
"version": version if isinstance(version, str) else version.id,
"input": input,
}
Expand All @@ -205,7 +205,7 @@ def create( # type: ignore
if webhook_events_filter is not None:
body["webhook_events_filter"] = webhook_events_filter
if stream is True:
body["stream"] = "true"
body["stream"] = True

resp = self._client._request(
"POST",
Expand Down
Loading

0 comments on commit 6d892b3

Please # to comment.