From e0a6062bdd339c7407736bc9111bb6035050bffd Mon Sep 17 00:00:00 2001 From: Runs Date: Sun, 11 Oct 2026 02:19:59 +0000 Subject: [PATCH] fix: preserve Python request options during polling --- magic_hour/resources/v1/ai_clothes_changer/client.py | 2 ++ magic_hour/resources/v1/ai_face_editor/client.py | 2 ++ magic_hour/resources/v1/ai_gif_generator/client.py | 2 ++ .../resources/v1/ai_headshot_generator/client.py | 2 ++ magic_hour/resources/v1/ai_image_editor/client.py | 2 ++ magic_hour/resources/v1/ai_image_generator/client.py | 2 ++ magic_hour/resources/v1/ai_image_upscaler/client.py | 2 ++ magic_hour/resources/v1/ai_meme_generator/client.py | 2 ++ .../resources/v1/ai_qr_code_generator/client.py | 2 ++ magic_hour/resources/v1/ai_talking_photo/client.py | 2 ++ magic_hour/resources/v1/ai_video_editor/client.py | 2 ++ .../resources/v1/ai_video_translator/client.py | 2 ++ magic_hour/resources/v1/ai_voice_cloner/client.py | 2 ++ magic_hour/resources/v1/ai_voice_generator/client.py | 2 ++ magic_hour/resources/v1/animation/client.py | 2 ++ magic_hour/resources/v1/audio_projects/client.py | 12 ++++++++---- magic_hour/resources/v1/audio_to_video/client.py | 2 ++ .../resources/v1/auto_subtitle_generator/client.py | 2 ++ magic_hour/resources/v1/body_swap/client.py | 2 ++ magic_hour/resources/v1/character_replace/client.py | 2 ++ magic_hour/resources/v1/face_detection/client.py | 8 ++++---- magic_hour/resources/v1/face_swap/client.py | 2 ++ magic_hour/resources/v1/face_swap_photo/client.py | 2 ++ magic_hour/resources/v1/head_swap/client.py | 2 ++ .../resources/v1/image_background_remover/client.py | 2 ++ magic_hour/resources/v1/image_projects/client.py | 12 ++++++++---- magic_hour/resources/v1/image_to_video/client.py | 2 ++ magic_hour/resources/v1/lip_sync/client.py | 2 ++ magic_hour/resources/v1/photo_colorizer/client.py | 2 ++ magic_hour/resources/v1/text_to_video/client.py | 2 ++ magic_hour/resources/v1/video_projects/client.py | 12 ++++++++---- magic_hour/resources/v1/video_to_video/client.py | 2 ++ 32 files changed, 84 insertions(+), 16 deletions(-) diff --git a/magic_hour/resources/v1/ai_clothes_changer/client.py b/magic_hour/resources/v1/ai_clothes_changer/client.py index 84686be..085ffc4 100644 --- a/magic_hour/resources/v1/ai_clothes_changer/client.py +++ b/magic_hour/resources/v1/ai_clothes_changer/client.py @@ -86,6 +86,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -214,6 +215,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/ai_face_editor/client.py b/magic_hour/resources/v1/ai_face_editor/client.py index a5d5c1b..dbdb685 100644 --- a/magic_hour/resources/v1/ai_face_editor/client.py +++ b/magic_hour/resources/v1/ai_face_editor/client.py @@ -99,6 +99,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -251,6 +252,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/ai_gif_generator/client.py b/magic_hour/resources/v1/ai_gif_generator/client.py index 30a61fe..3de8397 100644 --- a/magic_hour/resources/v1/ai_gif_generator/client.py +++ b/magic_hour/resources/v1/ai_gif_generator/client.py @@ -82,6 +82,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -204,6 +205,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/ai_headshot_generator/client.py b/magic_hour/resources/v1/ai_headshot_generator/client.py index 01ee5ba..dc098cf 100644 --- a/magic_hour/resources/v1/ai_headshot_generator/client.py +++ b/magic_hour/resources/v1/ai_headshot_generator/client.py @@ -85,6 +85,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -209,6 +210,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/ai_image_editor/client.py b/magic_hour/resources/v1/ai_image_editor/client.py index 12202a5..1ae38ad 100644 --- a/magic_hour/resources/v1/ai_image_editor/client.py +++ b/magic_hour/resources/v1/ai_image_editor/client.py @@ -138,6 +138,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -456,6 +457,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/ai_image_generator/client.py b/magic_hour/resources/v1/ai_image_generator/client.py index 3efe4f4..7b82ae9 100644 --- a/magic_hour/resources/v1/ai_image_generator/client.py +++ b/magic_hour/resources/v1/ai_image_generator/client.py @@ -127,6 +127,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -434,6 +435,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/ai_image_upscaler/client.py b/magic_hour/resources/v1/ai_image_upscaler/client.py index a03aa5e..77e4b13 100644 --- a/magic_hour/resources/v1/ai_image_upscaler/client.py +++ b/magic_hour/resources/v1/ai_image_upscaler/client.py @@ -93,6 +93,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -235,6 +236,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/ai_meme_generator/client.py b/magic_hour/resources/v1/ai_meme_generator/client.py index 2adc79a..c7d6d38 100644 --- a/magic_hour/resources/v1/ai_meme_generator/client.py +++ b/magic_hour/resources/v1/ai_meme_generator/client.py @@ -78,6 +78,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -195,6 +196,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/ai_qr_code_generator/client.py b/magic_hour/resources/v1/ai_qr_code_generator/client.py index 5dece2e..9e66c2a 100644 --- a/magic_hour/resources/v1/ai_qr_code_generator/client.py +++ b/magic_hour/resources/v1/ai_qr_code_generator/client.py @@ -76,6 +76,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -190,6 +191,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/ai_talking_photo/client.py b/magic_hour/resources/v1/ai_talking_photo/client.py index 2ff9ea7..510bf6b 100644 --- a/magic_hour/resources/v1/ai_talking_photo/client.py +++ b/magic_hour/resources/v1/ai_talking_photo/client.py @@ -105,6 +105,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -269,6 +270,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/ai_video_editor/client.py b/magic_hour/resources/v1/ai_video_editor/client.py index 314703e..cef36a1 100644 --- a/magic_hour/resources/v1/ai_video_editor/client.py +++ b/magic_hour/resources/v1/ai_video_editor/client.py @@ -111,6 +111,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -311,6 +312,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/ai_video_translator/client.py b/magic_hour/resources/v1/ai_video_translator/client.py index b2f53f1..5952707 100644 --- a/magic_hour/resources/v1/ai_video_translator/client.py +++ b/magic_hour/resources/v1/ai_video_translator/client.py @@ -124,6 +124,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) def create( @@ -380,6 +381,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) async def create( diff --git a/magic_hour/resources/v1/ai_voice_cloner/client.py b/magic_hour/resources/v1/ai_voice_cloner/client.py index 91a9fe7..57a7391 100644 --- a/magic_hour/resources/v1/ai_voice_cloner/client.py +++ b/magic_hour/resources/v1/ai_voice_cloner/client.py @@ -87,6 +87,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -213,6 +214,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/ai_voice_generator/client.py b/magic_hour/resources/v1/ai_voice_generator/client.py index e3fac27..cc3669f 100644 --- a/magic_hour/resources/v1/ai_voice_generator/client.py +++ b/magic_hour/resources/v1/ai_voice_generator/client.py @@ -76,6 +76,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -187,6 +188,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/animation/client.py b/magic_hour/resources/v1/animation/client.py index a92c7ed..e87307f 100644 --- a/magic_hour/resources/v1/animation/client.py +++ b/magic_hour/resources/v1/animation/client.py @@ -122,6 +122,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -315,6 +316,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/audio_projects/client.py b/magic_hour/resources/v1/audio_projects/client.py index 33d7ce3..344f554 100644 --- a/magic_hour/resources/v1/audio_projects/client.py +++ b/magic_hour/resources/v1/audio_projects/client.py @@ -38,6 +38,7 @@ def check_result( wait_for_completion: bool, download_outputs: bool, download_directory: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> V1AudioProjectsGetResponseWithDownloads: """ Check the result of an audio project with optional waiting and downloading. @@ -51,12 +52,13 @@ def check_result( download_outputs: Whether to download the outputs download_directory: The directory to download the outputs to. If not provided, the outputs will be downloaded to the current working directory + request_options: Additional options to customize each project-status HTTP request. Returns: V1AudioProjectsGetResponseWithDownloads: The audio project response with optional downloaded file paths included """ - api_response = self.get(id=id) + api_response = self.get(id=id, request_options=request_options) if not wait_for_completion: response = V1AudioProjectsGetResponseWithDownloads( **api_response.model_dump() @@ -68,7 +70,7 @@ def check_result( status = api_response.status while status not in ["complete", "error", "canceled"]: - api_response = self.get(id=id) + api_response = self.get(id=id, request_options=request_options) status = api_response.status time.sleep(poll_interval) @@ -178,6 +180,7 @@ async def check_result( wait_for_completion: bool, download_outputs: bool, download_directory: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> V1AudioProjectsGetResponseWithDownloads: """ Check the result of an audio project with optional waiting and downloading. @@ -191,12 +194,13 @@ async def check_result( download_outputs: Whether to download the outputs download_directory: The directory to download the outputs to. If not provided, the outputs will be downloaded to the current working directory + request_options: Additional options to customize each project-status HTTP request. Returns: V1AudioProjectsGetResponseWithDownloads: The audio project response with optional downloaded file paths included """ - api_response = await self.get(id=id) + api_response = await self.get(id=id, request_options=request_options) if not wait_for_completion: response = V1AudioProjectsGetResponseWithDownloads( **api_response.model_dump() @@ -208,7 +212,7 @@ async def check_result( status = api_response.status while status not in ["complete", "error", "canceled"]: - api_response = await self.get(id=id) + api_response = await self.get(id=id, request_options=request_options) status = api_response.status time.sleep(poll_interval) diff --git a/magic_hour/resources/v1/audio_to_video/client.py b/magic_hour/resources/v1/audio_to_video/client.py index 770d4b6..c98991a 100644 --- a/magic_hour/resources/v1/audio_to_video/client.py +++ b/magic_hour/resources/v1/audio_to_video/client.py @@ -112,6 +112,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -308,6 +309,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/auto_subtitle_generator/client.py b/magic_hour/resources/v1/auto_subtitle_generator/client.py index ef3920c..b4cee42 100644 --- a/magic_hour/resources/v1/auto_subtitle_generator/client.py +++ b/magic_hour/resources/v1/auto_subtitle_generator/client.py @@ -104,6 +104,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -267,6 +268,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/body_swap/client.py b/magic_hour/resources/v1/body_swap/client.py index bb6c3b9..c47e6fa 100644 --- a/magic_hour/resources/v1/body_swap/client.py +++ b/magic_hour/resources/v1/body_swap/client.py @@ -92,6 +92,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -225,6 +226,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/character_replace/client.py b/magic_hour/resources/v1/character_replace/client.py index 381bad6..afe1345 100644 --- a/magic_hour/resources/v1/character_replace/client.py +++ b/magic_hour/resources/v1/character_replace/client.py @@ -122,6 +122,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -338,6 +339,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/face_detection/client.py b/magic_hour/resources/v1/face_detection/client.py index 53a81b4..c568c1c 100644 --- a/magic_hour/resources/v1/face_detection/client.py +++ b/magic_hour/resources/v1/face_detection/client.py @@ -80,14 +80,14 @@ def generate( task_id = create_response.id - api_response = self.get(id=task_id) + api_response = self.get(id=task_id, request_options=request_options) if not wait_for_completion: return V1FaceDetectionGetResponseWithDownloads(**api_response.model_dump()) poll_interval = float(os.getenv("MAGIC_HOUR_POLL_INTERVAL", "0.5")) while api_response.status not in ["complete", "error"]: - api_response = self.get(id=task_id) + api_response = self.get(id=task_id, request_options=request_options) time.sleep(poll_interval) if api_response.status != "complete": @@ -255,14 +255,14 @@ async def generate( task_id = create_response.id - api_response = await self.get(id=task_id) + api_response = await self.get(id=task_id, request_options=request_options) if not wait_for_completion: return V1FaceDetectionGetResponseWithDownloads(**api_response.model_dump()) poll_interval = float(os.getenv("MAGIC_HOUR_POLL_INTERVAL", "0.5")) while api_response.status not in ["complete", "error"]: - api_response = await self.get(id=task_id) + api_response = await self.get(id=task_id, request_options=request_options) await asyncio.sleep(poll_interval) if api_response.status != "complete": diff --git a/magic_hour/resources/v1/face_swap/client.py b/magic_hour/resources/v1/face_swap/client.py index b1f4188..cf31750 100644 --- a/magic_hour/resources/v1/face_swap/client.py +++ b/magic_hour/resources/v1/face_swap/client.py @@ -128,6 +128,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -357,6 +358,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/face_swap_photo/client.py b/magic_hour/resources/v1/face_swap_photo/client.py index 24bb377..432202e 100644 --- a/magic_hour/resources/v1/face_swap_photo/client.py +++ b/magic_hour/resources/v1/face_swap_photo/client.py @@ -99,6 +99,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -246,6 +247,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/head_swap/client.py b/magic_hour/resources/v1/head_swap/client.py index 5d3066b..1aaf64e 100644 --- a/magic_hour/resources/v1/head_swap/client.py +++ b/magic_hour/resources/v1/head_swap/client.py @@ -94,6 +94,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -230,6 +231,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/image_background_remover/client.py b/magic_hour/resources/v1/image_background_remover/client.py index 3ac2f6e..c5f1dc3 100644 --- a/magic_hour/resources/v1/image_background_remover/client.py +++ b/magic_hour/resources/v1/image_background_remover/client.py @@ -80,6 +80,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -197,6 +198,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/image_projects/client.py b/magic_hour/resources/v1/image_projects/client.py index c248dd4..1079c56 100644 --- a/magic_hour/resources/v1/image_projects/client.py +++ b/magic_hour/resources/v1/image_projects/client.py @@ -39,6 +39,7 @@ def check_result( wait_for_completion: bool, download_outputs: bool, download_directory: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> V1ImageProjectsGetResponseWithDownloads: """ Check the result of an image project with optional waiting and downloading. @@ -52,12 +53,13 @@ def check_result( download_outputs: Whether to download the outputs download_directory: The directory to download the outputs to. If not provided, the outputs will be downloaded to the current working directory + request_options: Additional options to customize each project-status HTTP request. Returns: V1ImageProjectsGetResponseWithDownloads: The image project response with optional downloaded file paths included """ - api_response = self.get(id=id) + api_response = self.get(id=id, request_options=request_options) if not wait_for_completion: response = V1ImageProjectsGetResponseWithDownloads( **api_response.model_dump() @@ -69,7 +71,7 @@ def check_result( status = api_response.status while status not in ["complete", "error", "canceled"]: - api_response = self.get(id=id) + api_response = self.get(id=id, request_options=request_options) status = api_response.status time.sleep(poll_interval) @@ -179,6 +181,7 @@ async def check_result( wait_for_completion: bool, download_outputs: bool, download_directory: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> V1ImageProjectsGetResponseWithDownloads: """ Check the result of an image project with optional waiting and downloading. @@ -192,12 +195,13 @@ async def check_result( download_outputs: Whether to download the outputs download_directory: The directory to download the outputs to. If not provided, the outputs will be downloaded to the current working directory + request_options: Additional options to customize each project-status HTTP request. Returns: V1ImageProjectsGetResponseWithDownloads: The image project response with optional downloaded file paths included """ - api_response = await self.get(id=id) + api_response = await self.get(id=id, request_options=request_options) if not wait_for_completion: response = V1ImageProjectsGetResponseWithDownloads( **api_response.model_dump() @@ -209,7 +213,7 @@ async def check_result( status = api_response.status while status not in ["complete", "error", "canceled"]: - api_response = await self.get(id=id) + api_response = await self.get(id=id, request_options=request_options) status = api_response.status await asyncio.sleep(poll_interval) diff --git a/magic_hour/resources/v1/image_to_video/client.py b/magic_hour/resources/v1/image_to_video/client.py index bedabef..5137b72 100644 --- a/magic_hour/resources/v1/image_to_video/client.py +++ b/magic_hour/resources/v1/image_to_video/client.py @@ -145,6 +145,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -483,6 +484,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/lip_sync/client.py b/magic_hour/resources/v1/lip_sync/client.py index 98faacf..4cded8b 100644 --- a/magic_hour/resources/v1/lip_sync/client.py +++ b/magic_hour/resources/v1/lip_sync/client.py @@ -124,6 +124,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -344,6 +345,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/photo_colorizer/client.py b/magic_hour/resources/v1/photo_colorizer/client.py index b059f0f..6047e37 100644 --- a/magic_hour/resources/v1/photo_colorizer/client.py +++ b/magic_hour/resources/v1/photo_colorizer/client.py @@ -80,6 +80,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -194,6 +195,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/text_to_video/client.py b/magic_hour/resources/v1/text_to_video/client.py index ad20cf3..ef2ad00 100644 --- a/magic_hour/resources/v1/text_to_video/client.py +++ b/magic_hour/resources/v1/text_to_video/client.py @@ -142,6 +142,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -492,6 +493,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response diff --git a/magic_hour/resources/v1/video_projects/client.py b/magic_hour/resources/v1/video_projects/client.py index 528f7ae..07f7f57 100644 --- a/magic_hour/resources/v1/video_projects/client.py +++ b/magic_hour/resources/v1/video_projects/client.py @@ -38,6 +38,7 @@ def check_result( wait_for_completion: bool, download_outputs: bool, download_directory: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> V1VideoProjectsGetResponseWithDownloads: """ Check the result of a video project with optional waiting and downloading. @@ -51,12 +52,13 @@ def check_result( download_outputs: Whether to download the outputs download_directory: The directory to download the outputs to. If not provided, the outputs will be downloaded to the current working directory + request_options: Additional options to customize each project-status HTTP request. Returns: V1VideoProjectsGetResponseWithDownloads: The video project response with optional downloaded file paths included """ - api_response = self.get(id=id) + api_response = self.get(id=id, request_options=request_options) if not wait_for_completion: response = V1VideoProjectsGetResponseWithDownloads( **api_response.model_dump() @@ -68,7 +70,7 @@ def check_result( status = api_response.status while status not in ["complete", "error", "canceled"]: - api_response = self.get(id=id) + api_response = self.get(id=id, request_options=request_options) status = api_response.status time.sleep(poll_interval) @@ -178,6 +180,7 @@ async def check_result( wait_for_completion: bool, download_outputs: bool, download_directory: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> V1VideoProjectsGetResponseWithDownloads: """ Check the result of a video project with optional waiting and downloading. @@ -191,12 +194,13 @@ async def check_result( download_outputs: Whether to download the outputs download_directory: The directory to download the outputs to. If not provided, the outputs will be downloaded to the current working directory + request_options: Additional options to customize each project-status HTTP request. Returns: V1VideoProjectsGetResponseWithDownloads: The video project response with optional downloaded file paths included """ - api_response = await self.get(id=id) + api_response = await self.get(id=id, request_options=request_options) if not wait_for_completion: response = V1VideoProjectsGetResponseWithDownloads( **api_response.model_dump() @@ -208,7 +212,7 @@ async def check_result( status = api_response.status while status not in ["complete", "error", "canceled"]: - api_response = await self.get(id=id) + api_response = await self.get(id=id, request_options=request_options) status = api_response.status time.sleep(poll_interval) diff --git a/magic_hour/resources/v1/video_to_video/client.py b/magic_hour/resources/v1/video_to_video/client.py index 014b72e..f6d785e 100644 --- a/magic_hour/resources/v1/video_to_video/client.py +++ b/magic_hour/resources/v1/video_to_video/client.py @@ -126,6 +126,7 @@ def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response @@ -354,6 +355,7 @@ async def generate( wait_for_completion=wait_for_completion, download_outputs=download_outputs, download_directory=download_directory, + request_options=request_options, ) return response