Skip to content

Commit 85161db

Browse files
authored
Fix(prediction): add missing "aborted" status to Prediction model
The Replicate API sometimes returns a "status": "aborted" value for predictions that were interrupted before completion. The current pydantic model does not include this status, which causes a ValidationError: pydantic.v1.error_wrappers.ValidationError: unexpected value; permitted: 'starting', 'processing', 'succeeded', 'failed', 'canceled' This commit updates the `Prediction.status` Literal to include "aborted" to match the current API behavior.
1 parent d2956ff commit 85161db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

replicate/prediction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Prediction(Resource):
5555
version: str
5656
"""An identifier for the version of the model used to create the prediction."""
5757

58-
status: Literal["starting", "processing", "succeeded", "failed", "canceled"]
58+
status: Literal["starting", "processing", "succeeded", "failed", "canceled", "aborted"]
5959
"""The status of the prediction."""
6060

6161
input: Optional[Dict[str, Any]]

0 commit comments

Comments
 (0)