From 85161db91279dcd489acd71880510932402c9926 Mon Sep 17 00:00:00 2001 From: Stepan <103878593+P1nk-L0rD@users.noreply.github.com> Date: Fri, 10 Oct 2025 11:59:02 +0300 Subject: [PATCH] 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. --- replicate/prediction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/replicate/prediction.py b/replicate/prediction.py index b4ff047..6e373ef 100644 --- a/replicate/prediction.py +++ b/replicate/prediction.py @@ -55,7 +55,7 @@ class Prediction(Resource): version: str """An identifier for the version of the model used to create the prediction.""" - status: Literal["starting", "processing", "succeeded", "failed", "canceled"] + status: Literal["starting", "processing", "succeeded", "failed", "canceled", "aborted"] """The status of the prediction.""" input: Optional[Dict[str, Any]]