diff --git a/.sdk.json b/.sdk.json index c32ac68..beded5f 100644 --- a/.sdk.json +++ b/.sdk.json @@ -1,5 +1,5 @@ { - "id": "53e3a1c7-5db6-4850-bfe3-e16e89b5f60b", + "id": "3d0a471b-07ca-4e2e-85d9-7cff5b51eaa2", "tracked_paths": [ { "editable": true, diff --git a/magic_hour/environment.py b/magic_hour/environment.py index 861e27b..e84d2ae 100644 --- a/magic_hour/environment.py +++ b/magic_hour/environment.py @@ -6,7 +6,7 @@ class Environment(enum.Enum): """Pre-defined base URLs for the API""" ENVIRONMENT = "https://api.magichour.ai" - MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.71.0" + MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.72.0" def _get_base_url( diff --git a/magic_hour/resources/v1/ai_video_editor/README.md b/magic_hour/resources/v1/ai_video_editor/README.md index bd13559..7b0ccb5 100644 --- a/magic_hour/resources/v1/ai_video_editor/README.md +++ b/magic_hour/resources/v1/ai_video_editor/README.md @@ -103,7 +103,9 @@ For detailed examples, see the [product page](https://magichour.ai/products/vide | `end_seconds` | ✓ | End time of your clip in seconds. Must be greater than `start_seconds`. Duration must be between 3 and 10 seconds. | `5.0` | | `style` | ✓ | | `{"prompt": "Change the car color to blue"}` | | `└─ prompt` | ✓ | The prompt used to edit the video. | `"Change the car color to blue"` | +| `model` | ✗ | Editing model. Defaults to `ltx-2.3` for free tier and `gemini-omni` for paid. Use `ltx-2.3` for LTX video edit. | `"gemini-omni"` | | `name` | ✗ | Give your video a custom name for easy identification. | `"My Video Editor video"` | +| `resolution` | ✗ | Output resolution. Defaults to `480p` for free tier and `720p` for paid. Google Omni supports 720p only; LTX-2.3 supports 480p, 720p, and 1080p. | `"720p"` | | `start_seconds` | ✗ | Start time of your clip (seconds). Must be ≥ 0. | `0.0` | #### Synchronous Client @@ -117,7 +119,9 @@ res = client.v1.ai_video_editor.create( assets={"video_file_path": "api-assets/id/1234.mp4"}, end_seconds=5.0, style={"prompt": "Change the car color to blue"}, + model="gemini-omni", name="My Video Editor video", + resolution="720p", start_seconds=0.0, ) ``` @@ -133,7 +137,9 @@ res = await client.v1.ai_video_editor.create( assets={"video_file_path": "api-assets/id/1234.mp4"}, end_seconds=5.0, style={"prompt": "Change the car color to blue"}, + model="gemini-omni", name="My Video Editor video", + resolution="720p", start_seconds=0.0, ) ``` diff --git a/magic_hour/resources/v1/ai_video_editor/client.py b/magic_hour/resources/v1/ai_video_editor/client.py index f0d4d04..3ceca24 100644 --- a/magic_hour/resources/v1/ai_video_editor/client.py +++ b/magic_hour/resources/v1/ai_video_editor/client.py @@ -1,4 +1,5 @@ import typing +import typing_extensions from magic_hour.helpers.logger import get_sdk_logger from magic_hour.resources.v1.files.client import AsyncFilesClient, FilesClient @@ -30,9 +31,17 @@ def generate( assets: params.V1AiVideoEditorGenerateBodyAssets, end_seconds: float, style: params.V1AiVideoEditorCreateBodyStyle, + model: typing.Union[ + typing.Optional[typing_extensions.Literal["gemini-omni", "ltx-2.3"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, name: typing.Union[ typing.Optional[str], type_utils.NotGiven ] = type_utils.NOT_GIVEN, + resolution: typing.Union[ + typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, start_seconds: typing.Union[ typing.Optional[float], type_utils.NotGiven ] = type_utils.NOT_GIVEN, @@ -106,9 +115,17 @@ def create( assets: params.V1AiVideoEditorCreateBodyAssets, end_seconds: float, style: params.V1AiVideoEditorCreateBodyStyle, + model: typing.Union[ + typing.Optional[typing_extensions.Literal["gemini-omni", "ltx-2.3"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, name: typing.Union[ typing.Optional[str], type_utils.NotGiven ] = type_utils.NOT_GIVEN, + resolution: typing.Union[ + typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, start_seconds: typing.Union[ typing.Optional[float], type_utils.NotGiven ] = type_utils.NOT_GIVEN, @@ -143,7 +160,9 @@ def create( POST /v1/ai-video-editor Args: + model: Editing model. Defaults to `ltx-2.3` for free tier and `gemini-omni` for paid. Use `ltx-2.3` for LTX video edit. name: Give your video a custom name for easy identification. + resolution: Output resolution. Defaults to `480p` for free tier and `720p` for paid. Google Omni supports 720p only; LTX-2.3 supports 480p, 720p, and 1080p. start_seconds: Start time of your clip (seconds). Must be ≥ 0. assets: Provide the assets for video editing. end_seconds: End time of your clip in seconds. Must be greater than `start_seconds`. Duration must be between 3 and 10 seconds. @@ -163,14 +182,18 @@ def create( assets={"video_file_path": "api-assets/id/1234.mp4"}, end_seconds=5.0, style={"prompt": "Change the car color to blue"}, + model="gemini-omni", name="My Video Editor video", + resolution="720p", start_seconds=0.0, ) ``` """ _json = to_encodable( item={ + "model": model, "name": name, + "resolution": resolution, "start_seconds": start_seconds, "assets": assets, "end_seconds": end_seconds, @@ -198,9 +221,17 @@ async def generate( assets: params.V1AiVideoEditorGenerateBodyAssets, end_seconds: float, style: params.V1AiVideoEditorCreateBodyStyle, + model: typing.Union[ + typing.Optional[typing_extensions.Literal["gemini-omni", "ltx-2.3"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, name: typing.Union[ typing.Optional[str], type_utils.NotGiven ] = type_utils.NOT_GIVEN, + resolution: typing.Union[ + typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, start_seconds: typing.Union[ typing.Optional[float], type_utils.NotGiven ] = type_utils.NOT_GIVEN, @@ -274,9 +305,17 @@ async def create( assets: params.V1AiVideoEditorCreateBodyAssets, end_seconds: float, style: params.V1AiVideoEditorCreateBodyStyle, + model: typing.Union[ + typing.Optional[typing_extensions.Literal["gemini-omni", "ltx-2.3"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, name: typing.Union[ typing.Optional[str], type_utils.NotGiven ] = type_utils.NOT_GIVEN, + resolution: typing.Union[ + typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]], + type_utils.NotGiven, + ] = type_utils.NOT_GIVEN, start_seconds: typing.Union[ typing.Optional[float], type_utils.NotGiven ] = type_utils.NOT_GIVEN, @@ -311,7 +350,9 @@ async def create( POST /v1/ai-video-editor Args: + model: Editing model. Defaults to `ltx-2.3` for free tier and `gemini-omni` for paid. Use `ltx-2.3` for LTX video edit. name: Give your video a custom name for easy identification. + resolution: Output resolution. Defaults to `480p` for free tier and `720p` for paid. Google Omni supports 720p only; LTX-2.3 supports 480p, 720p, and 1080p. start_seconds: Start time of your clip (seconds). Must be ≥ 0. assets: Provide the assets for video editing. end_seconds: End time of your clip in seconds. Must be greater than `start_seconds`. Duration must be between 3 and 10 seconds. @@ -331,14 +372,18 @@ async def create( assets={"video_file_path": "api-assets/id/1234.mp4"}, end_seconds=5.0, style={"prompt": "Change the car color to blue"}, + model="gemini-omni", name="My Video Editor video", + resolution="720p", start_seconds=0.0, ) ``` """ _json = to_encodable( item={ + "model": model, "name": name, + "resolution": resolution, "start_seconds": start_seconds, "assets": assets, "end_seconds": end_seconds, diff --git a/magic_hour/types/params/v1_ai_video_editor_create_body.py b/magic_hour/types/params/v1_ai_video_editor_create_body.py index 3f61560..78911ed 100644 --- a/magic_hour/types/params/v1_ai_video_editor_create_body.py +++ b/magic_hour/types/params/v1_ai_video_editor_create_body.py @@ -27,11 +27,25 @@ class V1AiVideoEditorCreateBody(typing_extensions.TypedDict): End time of your clip in seconds. Must be greater than `start_seconds`. Duration must be between 3 and 10 seconds. """ + model: typing_extensions.NotRequired[ + typing_extensions.Literal["gemini-omni", "ltx-2.3"] + ] + """ + Editing model. Defaults to `ltx-2.3` for free tier and `gemini-omni` for paid. Use `ltx-2.3` for LTX video edit. + """ + name: typing_extensions.NotRequired[str] """ Give your video a custom name for easy identification. """ + resolution: typing_extensions.NotRequired[ + typing_extensions.Literal["1080p", "480p", "720p"] + ] + """ + Output resolution. Defaults to `480p` for free tier and `720p` for paid. Google Omni supports 720p only; LTX-2.3 supports 480p, 720p, and 1080p. + """ + start_seconds: typing_extensions.NotRequired[float] """ Start time of your clip (seconds). Must be ≥ 0. @@ -56,7 +70,13 @@ class _SerializerV1AiVideoEditorCreateBody(pydantic.BaseModel): end_seconds: float = pydantic.Field( alias="end_seconds", ) + model: typing.Optional[typing_extensions.Literal["gemini-omni", "ltx-2.3"]] = ( + pydantic.Field(alias="model", default=None) + ) name: typing.Optional[str] = pydantic.Field(alias="name", default=None) + resolution: typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]] = ( + pydantic.Field(alias="resolution", default=None) + ) start_seconds: typing.Optional[float] = pydantic.Field( alias="start_seconds", default=None ) diff --git a/pyproject.toml b/pyproject.toml index dc3b4cb..1fdadce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "magic_hour" -version = "0.71.0" +version = "0.72.0" description = "Python SDK for Magic Hour API" readme = "README.md" authors = [] diff --git a/tests/test_v1_ai_video_editor_client.py b/tests/test_v1_ai_video_editor_client.py index 7b527fa..5e0bca3 100644 --- a/tests/test_v1_ai_video_editor_client.py +++ b/tests/test_v1_ai_video_editor_client.py @@ -30,7 +30,9 @@ def test_create_200_success_all_params() -> None: assets={"video_file_path": "api-assets/id/1234.mp4"}, end_seconds=5.0, style={"prompt": "Change the car color to blue"}, + model="gemini-omni", name="My Video Editor video", + resolution="720p", start_seconds=0.0, ) try: @@ -68,7 +70,9 @@ async def test_await_create_200_success_all_params() -> None: assets={"video_file_path": "api-assets/id/1234.mp4"}, end_seconds=5.0, style={"prompt": "Change the car color to blue"}, + model="gemini-omni", name="My Video Editor video", + resolution="720p", start_seconds=0.0, ) try: