Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "5.8.0"
".": "5.9.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 50
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml/runwayml-caa255c8f1c6fd2b54d331eeacc13de517b8dbaba491ef94745d107798b5eb7a.yml
openapi_spec_hash: d9f7b43604b06f389e2fc45376d0a519
config_hash: 955a0e451964a44778c5c0f54ca1c994
configured_endpoints: 51
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml/runwayml-d934e6804620f70a9a7d88bb3acf27146b57860ed56691e390e46027b3c04d4a.yml
openapi_spec_hash: 132fc1ce816bcfd680a239dc1ed58c8e
config_hash: 7caf94f26186e1ee432efcaa0b590bab
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 5.9.0 (2026-07-06)

Full Changelog: [v5.8.0...v5.9.0](https://github.com/runwayml/sdk-python/compare/v5.8.0...v5.9.0)

### Features

* **api:** add ad_localization recipe ([0e13593](https://github.com/runwayml/sdk-python/commit/0e13593e38bbf7d0120182d390727593ecefb189))

## 5.8.0 (2026-07-06)

Full Changelog: [v5.7.0...v5.8.0](https://github.com/runwayml/sdk-python/compare/v5.7.0...v5.8.0)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ Types:

```python
from runwayml.types import (
RecipeAdLocalizationResponse,
RecipeMarketingStockImageResponse,
RecipeMultiShotVideoResponse,
RecipeProductAdResponse,
Expand All @@ -264,6 +265,7 @@ from runwayml.types import (

Methods:

- <code title="post /v1/recipes/ad_localization">client.recipes.<a href="./src/runwayml/resources/recipes.py">ad_localization</a>(\*\*<a href="src/runwayml/types/recipe_ad_localization_params.py">params</a>) -> <a href="./src/runwayml/types/recipe_ad_localization_response.py">RecipeAdLocalizationResponse</a></code>
- <code title="post /v1/recipes/marketing_stock_image">client.recipes.<a href="./src/runwayml/resources/recipes.py">marketing_stock_image</a>(\*\*<a href="src/runwayml/types/recipe_marketing_stock_image_params.py">params</a>) -> <a href="./src/runwayml/types/recipe_marketing_stock_image_response.py">RecipeMarketingStockImageResponse</a></code>
- <code title="post /v1/recipes/multi_shot_video">client.recipes.<a href="./src/runwayml/resources/recipes.py">multi_shot_video</a>(\*\*<a href="src/runwayml/types/recipe_multi_shot_video_params.py">params</a>) -> <a href="./src/runwayml/types/recipe_multi_shot_video_response.py">RecipeMultiShotVideoResponse</a></code>
- <code title="post /v1/recipes/product_ad">client.recipes.<a href="./src/runwayml/resources/recipes.py">product_ad</a>(\*\*<a href="src/runwayml/types/recipe_product_ad_params.py">params</a>) -> <a href="./src/runwayml/types/recipe_product_ad_response.py">RecipeProductAdResponse</a></code>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "runwayml"
version = "5.8.0"
version = "5.9.0"
description = "The official Python library for the runwayml API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/runwayml/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "runwayml"
__version__ = "5.8.0" # x-release-please-version
__version__ = "5.9.0" # x-release-please-version
162 changes: 162 additions & 0 deletions src/runwayml/resources/recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
recipe_product_ad_params,
recipe_product_ugc_params,
recipe_product_swap_params,
recipe_ad_localization_params,
recipe_multi_shot_video_params,
recipe_marketing_stock_image_params,
recipe_product_campaign_image_params,
Expand All @@ -36,6 +37,7 @@
from ..types.recipe_product_ad_response import RecipeProductAdResponse
from ..types.recipe_product_ugc_response import RecipeProductUgcResponse
from ..types.recipe_product_swap_response import RecipeProductSwapResponse
from ..types.recipe_ad_localization_response import RecipeAdLocalizationResponse
from ..types.recipe_multi_shot_video_response import RecipeMultiShotVideoResponse
from ..types.recipe_marketing_stock_image_response import RecipeMarketingStockImageResponse
from ..types.recipe_product_campaign_image_response import RecipeProductCampaignImageResponse
Expand Down Expand Up @@ -63,6 +65,80 @@ def with_streaming_response(self) -> RecipesResourceWithStreamingResponse:
"""
return RecipesResourceWithStreamingResponse(self)

def ad_localization(
self,
*,
reference_image: recipe_ad_localization_params.ReferenceImage,
target_language: Literal[
"ar",
"zh",
"zh-Hant",
"nl",
"en",
"fr",
"de",
"hi",
"id",
"it",
"ja",
"ko",
"pl",
"pt",
"ru",
"es",
"sv",
"th",
"tr",
"uk",
"vi",
"el",
],
version: Literal["2026-06", "unsafe-latest"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> NewTaskCreatedResponse:
"""
Localize an existing ad image for a target language, preserving visual creative
while adapting on-screen messaging.

Args:
reference_image: Reference ad image to localize. See [our docs](/assets/inputs#images) on image
inputs.

target_language: Target language for the localized ad. Use ISO-style codes (e.g. "ja" for
Japanese, "es" for Spanish).

version: Workflow version. Use a dated version (e.g. "2026-06") to pin behavior, or
"unsafe-latest" to track the newest stable version (may break without notice).

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
"/v1/recipes/ad_localization",
body=maybe_transform(
{
"reference_image": reference_image,
"target_language": target_language,
"version": version,
},
recipe_ad_localization_params.RecipeAdLocalizationParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=create_waitable_resource(RecipeAdLocalizationResponse, self._client),
)

def marketing_stock_image(
self,
*,
Expand Down Expand Up @@ -564,6 +640,80 @@ def with_streaming_response(self) -> AsyncRecipesResourceWithStreamingResponse:
"""
return AsyncRecipesResourceWithStreamingResponse(self)

async def ad_localization(
self,
*,
reference_image: recipe_ad_localization_params.ReferenceImage,
target_language: Literal[
"ar",
"zh",
"zh-Hant",
"nl",
"en",
"fr",
"de",
"hi",
"id",
"it",
"ja",
"ko",
"pl",
"pt",
"ru",
"es",
"sv",
"th",
"tr",
"uk",
"vi",
"el",
],
version: Literal["2026-06", "unsafe-latest"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncNewTaskCreatedResponse:
"""
Localize an existing ad image for a target language, preserving visual creative
while adapting on-screen messaging.

Args:
reference_image: Reference ad image to localize. See [our docs](/assets/inputs#images) on image
inputs.

target_language: Target language for the localized ad. Use ISO-style codes (e.g. "ja" for
Japanese, "es" for Spanish).

version: Workflow version. Use a dated version (e.g. "2026-06") to pin behavior, or
"unsafe-latest" to track the newest stable version (may break without notice).

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
"/v1/recipes/ad_localization",
body=await async_maybe_transform(
{
"reference_image": reference_image,
"target_language": target_language,
"version": version,
},
recipe_ad_localization_params.RecipeAdLocalizationParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=create_async_waitable_resource(RecipeAdLocalizationResponse, self._client),
)

async def marketing_stock_image(
self,
*,
Expand Down Expand Up @@ -1049,6 +1199,9 @@ class RecipesResourceWithRawResponse:
def __init__(self, recipes: RecipesResource) -> None:
self._recipes = recipes

self.ad_localization = to_raw_response_wrapper(
recipes.ad_localization,
)
self.marketing_stock_image = to_raw_response_wrapper(
recipes.marketing_stock_image,
)
Expand All @@ -1073,6 +1226,9 @@ class AsyncRecipesResourceWithRawResponse:
def __init__(self, recipes: AsyncRecipesResource) -> None:
self._recipes = recipes

self.ad_localization = async_to_raw_response_wrapper(
recipes.ad_localization,
)
self.marketing_stock_image = async_to_raw_response_wrapper(
recipes.marketing_stock_image,
)
Expand All @@ -1097,6 +1253,9 @@ class RecipesResourceWithStreamingResponse:
def __init__(self, recipes: RecipesResource) -> None:
self._recipes = recipes

self.ad_localization = to_streamed_response_wrapper(
recipes.ad_localization,
)
self.marketing_stock_image = to_streamed_response_wrapper(
recipes.marketing_stock_image,
)
Expand All @@ -1121,6 +1280,9 @@ class AsyncRecipesResourceWithStreamingResponse:
def __init__(self, recipes: AsyncRecipesResource) -> None:
self._recipes = recipes

self.ad_localization = async_to_streamed_response_wrapper(
recipes.ad_localization,
)
self.marketing_stock_image = async_to_streamed_response_wrapper(
recipes.marketing_stock_image,
)
Expand Down
2 changes: 2 additions & 0 deletions src/runwayml/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
from .text_to_speech_create_params import TextToSpeechCreateParams as TextToSpeechCreateParams
from .video_to_video_create_params import VideoToVideoCreateParams as VideoToVideoCreateParams
from .image_upscale_create_response import ImageUpscaleCreateResponse as ImageUpscaleCreateResponse
from .recipe_ad_localization_params import RecipeAdLocalizationParams as RecipeAdLocalizationParams
from .text_to_image_create_response import TextToImageCreateResponse as TextToImageCreateResponse
from .text_to_video_create_response import TextToVideoCreateResponse as TextToVideoCreateResponse
from .video_upscale_create_response import VideoUpscaleCreateResponse as VideoUpscaleCreateResponse
Expand All @@ -63,6 +64,7 @@
from .text_to_speech_create_response import TextToSpeechCreateResponse as TextToSpeechCreateResponse
from .video_to_video_create_response import VideoToVideoCreateResponse as VideoToVideoCreateResponse
from .avatar_conversation_list_params import AvatarConversationListParams as AvatarConversationListParams
from .recipe_ad_localization_response import RecipeAdLocalizationResponse as RecipeAdLocalizationResponse
from .voice_isolation_create_response import VoiceIsolationCreateResponse as VoiceIsolationCreateResponse
from .realtime_session_create_response import RealtimeSessionCreateResponse as RealtimeSessionCreateResponse
from .recipe_multi_shot_video_response import RecipeMultiShotVideoResponse as RecipeMultiShotVideoResponse
Expand Down
68 changes: 68 additions & 0 deletions src/runwayml/types/recipe_ad_localization_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Literal, Required, Annotated, TypedDict

from .._utils import PropertyInfo

__all__ = ["RecipeAdLocalizationParams", "ReferenceImage"]


class RecipeAdLocalizationParams(TypedDict, total=False):
reference_image: Required[Annotated[ReferenceImage, PropertyInfo(alias="referenceImage")]]
"""Reference ad image to localize.

See [our docs](/assets/inputs#images) on image inputs.
"""

target_language: Required[
Annotated[
Literal[
"ar",
"zh",
"zh-Hant",
"nl",
"en",
"fr",
"de",
"hi",
"id",
"it",
"ja",
"ko",
"pl",
"pt",
"ru",
"es",
"sv",
"th",
"tr",
"uk",
"vi",
"el",
],
PropertyInfo(alias="targetLanguage"),
]
]
"""Target language for the localized ad.

Use ISO-style codes (e.g. "ja" for Japanese, "es" for Spanish).
"""

version: Required[Literal["2026-06", "unsafe-latest"]]
"""Workflow version.

Use a dated version (e.g. "2026-06") to pin behavior, or "unsafe-latest" to
track the newest stable version (may break without notice).
"""


class ReferenceImage(TypedDict, total=False):
"""Reference ad image to localize.

See [our docs](/assets/inputs#images) on image inputs.
"""

uri: Required[str]
"""A HTTPS URL."""
10 changes: 10 additions & 0 deletions src/runwayml/types/recipe_ad_localization_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .._models import BaseModel

__all__ = ["RecipeAdLocalizationResponse"]


class RecipeAdLocalizationResponse(BaseModel):
id: str
"""The ID of the task that was created. Use this to retrieve the task later."""
Loading