Skip to content

Commit 6f35c4f

Browse files
authored
Add urls property to Prediction (#128)
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
1 parent ea0fe2c commit 6f35c4f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

replicate/prediction.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Prediction(BaseModel):
2020
started_at: Optional[str]
2121
created_at: Optional[str]
2222
completed_at: Optional[str]
23+
urls: Optional[Dict[str, str]]
2324

2425
def wait(self) -> None:
2526
"""Wait for prediction to finish."""

tests/test_prediction.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def test_async_timings():
156156
assert prediction.created_at == "2022-04-26T20:00:40.658234Z"
157157
assert prediction.completed_at is None
158158
assert prediction.output is None
159+
assert prediction.urls["get"] == "https://api.replicate.com/v1/predictions/p1"
159160
prediction.wait()
160161
assert prediction.created_at == "2022-04-26T20:00:40.658234Z"
161162
assert prediction.completed_at == "2022-04-26T20:02:27.648305Z"

0 commit comments

Comments
 (0)