From 1d522a92d6fff6c0964d29deb1efbb68beb5f178 Mon Sep 17 00:00:00 2001 From: Renan Ferreira Date: Mon, 25 May 2026 11:49:35 -0300 Subject: [PATCH] feat(predictions): add packshot overload to subscribe() Sync subscribe() overloads with run() by adding the missing packshot model to both PredictionsResource and AsyncPredictionsResource. --- src/fashn/resources/predictions.py | 48 +++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/src/fashn/resources/predictions.py b/src/fashn/resources/predictions.py index 2ce4fda..f61c851 100644 --- a/src/fashn/resources/predictions.py +++ b/src/fashn/resources/predictions.py @@ -240,6 +240,24 @@ def subscribe( request_timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PredictionSubscribeResponse: ... + @overload + def subscribe( + self, + *, + inputs: prediction_run_params.PackshotRequestInputs, + model_name: Literal["packshot"], + webhook_url: str | Omit = omit, + poll_interval: int | None = None, + timeout: int | None = None, + max_retries: int | None = None, + on_enqueued: EnqueuedCallback | None = None, + on_queue_update: QueueUpdateCallback | None = None, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + request_timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PredictionSubscribeResponse: ... + def subscribe( self, *, @@ -253,7 +271,8 @@ def subscribe( | prediction_run_params.BackgroundChangeRequestInputs | prediction_run_params.BackgroundRemoveRequestInputs | prediction_run_params.ImageToVideoRequestInputs - | prediction_run_params.EditRequestInputs, + | prediction_run_params.EditRequestInputs + | prediction_run_params.PackshotRequestInputs, model_name: Literal["tryon-max"] | Literal["tryon-v1.6"] | Literal["product-to-model"] @@ -264,7 +283,8 @@ def subscribe( | Literal["background-change"] | Literal["background-remove"] | Literal["image-to-video"] - | Literal["edit"], + | Literal["edit"] + | Literal["packshot"], webhook_url: str | Omit = omit, poll_interval: int | None = None, timeout: int | None = None, @@ -1321,6 +1341,24 @@ async def subscribe( request_timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PredictionSubscribeResponse: ... + @overload + async def subscribe( + self, + *, + inputs: prediction_run_params.PackshotRequestInputs, + model_name: Literal["packshot"], + webhook_url: str | Omit = omit, + poll_interval: int | None = None, + timeout: int | None = None, + max_retries: int | None = None, + on_enqueued: EnqueuedCallback | None = None, + on_queue_update: QueueUpdateCallback | None = None, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + request_timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PredictionSubscribeResponse: ... + async def subscribe( self, *, @@ -1334,7 +1372,8 @@ async def subscribe( | prediction_run_params.BackgroundChangeRequestInputs | prediction_run_params.BackgroundRemoveRequestInputs | prediction_run_params.ImageToVideoRequestInputs - | prediction_run_params.EditRequestInputs, + | prediction_run_params.EditRequestInputs + | prediction_run_params.PackshotRequestInputs, model_name: Literal["tryon-max"] | Literal["tryon-v1.6"] | Literal["product-to-model"] @@ -1345,7 +1384,8 @@ async def subscribe( | Literal["background-change"] | Literal["background-remove"] | Literal["image-to-video"] - | Literal["edit"], + | Literal["edit"] + | Literal["packshot"], webhook_url: str | Omit = omit, poll_interval: int | None = None, timeout: int | None = None,