diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bd7f384..ca2c4e6 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.2.0" + ".": "4.2.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 02392b6..0d877c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 4.2.1 (2025-12-16) + +Full Changelog: [v4.2.0...v4.2.1](https://github.com/runwayml/sdk-python/compare/v4.2.0...v4.2.1) + +### Bug Fixes + +* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([9d4f77c](https://github.com/runwayml/sdk-python/commit/9d4f77c847837f20ef333a10e5a0d1d9e6a25cf5)) + + +### Chores + +* add missing docstrings ([4c14222](https://github.com/runwayml/sdk-python/commit/4c142226410821c794e9e3bf43c7bf9a7d5bf6c1)) +* **internal:** add missing files argument to base client ([1c5f3af](https://github.com/runwayml/sdk-python/commit/1c5f3af332fdd873865234b11c0b1b24aa9df688)) + ## 4.2.0 (2025-12-04) Full Changelog: [v4.1.1...v4.2.0](https://github.com/runwayml/sdk-python/compare/v4.1.1...v4.2.0) diff --git a/pyproject.toml b/pyproject.toml index 668ea2e..f31bdfb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runwayml" -version = "4.2.0" +version = "4.2.1" description = "The official Python library for the runwayml API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/runwayml/_base_client.py b/src/runwayml/_base_client.py index 8e9efd7..cc0bf65 100644 --- a/src/runwayml/_base_client.py +++ b/src/runwayml/_base_client.py @@ -1247,9 +1247,12 @@ def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return self.request(cast_to, opts) def put( @@ -1767,9 +1770,12 @@ async def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return await self.request(cast_to, opts) async def put( diff --git a/src/runwayml/_types.py b/src/runwayml/_types.py index e845cd6..8facef4 100644 --- a/src/runwayml/_types.py +++ b/src/runwayml/_types.py @@ -243,6 +243,9 @@ class HttpxSendArgs(TypedDict, total=False): if TYPE_CHECKING: # This works because str.__contains__ does not accept object (either in typeshed or at runtime) # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + # + # Note: index() and count() methods are intentionally omitted to allow pyright to properly + # infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr. class SequenceNotStr(Protocol[_T_co]): @overload def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... @@ -251,8 +254,6 @@ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... def __contains__(self, value: object, /) -> bool: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T_co]: ... - def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... - def count(self, value: Any, /) -> int: ... def __reversed__(self) -> Iterator[_T_co]: ... else: # just point this to a normal `Sequence` at runtime to avoid having to special case diff --git a/src/runwayml/_version.py b/src/runwayml/_version.py index 9e0ccac..8b41e5d 100644 --- a/src/runwayml/_version.py +++ b/src/runwayml/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runwayml" -__version__ = "4.2.0" # x-release-please-version +__version__ = "4.2.1" # x-release-please-version diff --git a/src/runwayml/types/character_performance_create_params.py b/src/runwayml/types/character_performance_create_params.py index 8cc93cf..aa66adc 100644 --- a/src/runwayml/types/character_performance_create_params.py +++ b/src/runwayml/types/character_performance_create_params.py @@ -62,6 +62,11 @@ class CharacterPerformanceCreateParams(TypedDict, total=False): class CharacterImage(TypedDict, total=False): + """An image of your character. + + In the output, the character will use the reference video performance in its original static environment. + """ + type: Required[Literal["image"]] uri: Required[str] @@ -69,6 +74,11 @@ class CharacterImage(TypedDict, total=False): class CharacterVideo(TypedDict, total=False): + """A video of your character. + + In the output, the character will use the reference video performance in its original animated environment and some of the character's own movements. + """ + type: Required[Literal["video"]] uri: Required[str] @@ -79,6 +89,10 @@ class CharacterVideo(TypedDict, total=False): class Reference(TypedDict, total=False): + """ + A video of a person performing in the manner that you would like your character to perform. The video must be between 3 and 30 seconds in duration. + """ + type: Required[Literal["video"]] uri: Required[str] @@ -86,6 +100,8 @@ class Reference(TypedDict, total=False): class ContentModeration(TypedDict, total=False): + """Settings that affect the behavior of the content moderation system.""" + public_figure_threshold: Annotated[Literal["auto", "low"], PropertyInfo(alias="publicFigureThreshold")] """ When set to `low`, the content moderation system will be less strict about diff --git a/src/runwayml/types/image_to_video_create_params.py b/src/runwayml/types/image_to_video_create_params.py index ecae04a..16ef9a0 100644 --- a/src/runwayml/types/image_to_video_create_params.py +++ b/src/runwayml/types/image_to_video_create_params.py @@ -68,6 +68,8 @@ class Gen4TurboPromptImagePromptImage(TypedDict, total=False): class Gen4TurboContentModeration(TypedDict, total=False): + """Settings that affect the behavior of the content moderation system.""" + public_figure_threshold: Annotated[Literal["auto", "low"], PropertyInfo(alias="publicFigureThreshold")] """ When set to `low`, the content moderation system will be less strict about @@ -160,6 +162,8 @@ class Gen3aTurboPromptImagePromptImage(TypedDict, total=False): class Gen3aTurboContentModeration(TypedDict, total=False): + """Settings that affect the behavior of the content moderation system.""" + public_figure_threshold: Annotated[Literal["auto", "low"], PropertyInfo(alias="publicFigureThreshold")] """ When set to `low`, the content moderation system will be less strict about diff --git a/src/runwayml/types/organization_retrieve_response.py b/src/runwayml/types/organization_retrieve_response.py index f3a56ca..236bb0b 100644 --- a/src/runwayml/types/organization_retrieve_response.py +++ b/src/runwayml/types/organization_retrieve_response.py @@ -10,6 +10,8 @@ class TierModels(BaseModel): + """Limits associated with the model.""" + max_concurrent_generations: int = FieldInfo(alias="maxConcurrentGenerations") """The maximum number of generations that can be run concurrently for this model.""" @@ -18,6 +20,8 @@ class TierModels(BaseModel): class Tier(BaseModel): + """Limits associated with the organization's tier.""" + max_monthly_credit_spend: int = FieldInfo(alias="maxMonthlyCreditSpend") """The maximum number of credits that can be purchased in a month.""" @@ -26,11 +30,15 @@ class Tier(BaseModel): class UsageModels(BaseModel): + """Usage data for the model.""" + daily_generations: int = FieldInfo(alias="dailyGenerations") """The number of generations that have been run for this model in the past day.""" class Usage(BaseModel): + """Usage data for the organization.""" + models: Dict[str, UsageModels] diff --git a/src/runwayml/types/speech_to_speech_create_params.py b/src/runwayml/types/speech_to_speech_create_params.py index 50bda5f..18fc4db 100644 --- a/src/runwayml/types/speech_to_speech_create_params.py +++ b/src/runwayml/types/speech_to_speech_create_params.py @@ -24,6 +24,8 @@ class SpeechToSpeechCreateParams(TypedDict, total=False): class MediaAudio(TypedDict, total=False): + """An audio file containing dialogue to be processed.""" + type: Required[Literal["audio"]] uri: Required[str] @@ -31,6 +33,8 @@ class MediaAudio(TypedDict, total=False): class MediaVideo(TypedDict, total=False): + """A video file containing dialogue to be processed.""" + type: Required[Literal["video"]] uri: Required[str] @@ -41,6 +45,8 @@ class MediaVideo(TypedDict, total=False): class Voice(TypedDict, total=False): + """A voice preset from the RunwayML API.""" + preset_id: Required[ Annotated[ Literal[ diff --git a/src/runwayml/types/task_retrieve_response.py b/src/runwayml/types/task_retrieve_response.py index 9284246..c6a2d91 100644 --- a/src/runwayml/types/task_retrieve_response.py +++ b/src/runwayml/types/task_retrieve_response.py @@ -13,6 +13,8 @@ class Pending(BaseModel): + """A pending task""" + id: str """The ID of the task being returned.""" @@ -23,6 +25,8 @@ class Pending(BaseModel): class Throttled(BaseModel): + """A throttled task""" + id: str """The ID of the task being returned.""" @@ -33,6 +37,8 @@ class Throttled(BaseModel): class Cancelled(BaseModel): + """A cancelled or deleted task""" + id: str """The ID of the task being returned.""" @@ -43,6 +49,8 @@ class Cancelled(BaseModel): class Running(BaseModel): + """A running task""" + id: str """The ID of the task being returned.""" @@ -55,6 +63,8 @@ class Running(BaseModel): class Failed(BaseModel): + """A failed task""" + id: str """The ID of the task being returned.""" @@ -77,6 +87,8 @@ class Failed(BaseModel): class Succeeded(BaseModel): + """A succeeded task""" + id: str """The ID of the task being returned.""" diff --git a/src/runwayml/types/text_to_image_create_params.py b/src/runwayml/types/text_to_image_create_params.py index 8a1e6c6..daaf399 100644 --- a/src/runwayml/types/text_to_image_create_params.py +++ b/src/runwayml/types/text_to_image_create_params.py @@ -81,6 +81,8 @@ class Gen4ImageTurboReferenceImage(TypedDict, total=False): class Gen4ImageTurboContentModeration(TypedDict, total=False): + """Settings that affect the behavior of the content moderation system.""" + public_figure_threshold: Annotated[Literal["auto", "low"], PropertyInfo(alias="publicFigureThreshold")] """ When set to `low`, the content moderation system will be less strict about @@ -138,6 +140,8 @@ class Gen4Image(TypedDict, total=False): class Gen4ImageContentModeration(TypedDict, total=False): + """Settings that affect the behavior of the content moderation system.""" + public_figure_threshold: Annotated[Literal["auto", "low"], PropertyInfo(alias="publicFigureThreshold")] """ When set to `low`, the content moderation system will be less strict about diff --git a/src/runwayml/types/text_to_speech_create_params.py b/src/runwayml/types/text_to_speech_create_params.py index 7518af7..3940a85 100644 --- a/src/runwayml/types/text_to_speech_create_params.py +++ b/src/runwayml/types/text_to_speech_create_params.py @@ -23,6 +23,8 @@ class TextToSpeechCreateParams(TypedDict, total=False): class Voice(TypedDict, total=False): + """A voice preset from the RunwayML API.""" + preset_id: Required[ Annotated[ Literal[ diff --git a/src/runwayml/types/video_to_video_create_params.py b/src/runwayml/types/video_to_video_create_params.py index b2cb513..56c5350 100644 --- a/src/runwayml/types/video_to_video_create_params.py +++ b/src/runwayml/types/video_to_video_create_params.py @@ -47,6 +47,8 @@ class VideoToVideoCreateParams(TypedDict, total=False): class ContentModeration(TypedDict, total=False): + """Settings that affect the behavior of the content moderation system.""" + public_figure_threshold: Annotated[Literal["auto", "low"], PropertyInfo(alias="publicFigureThreshold")] """ When set to `low`, the content moderation system will be less strict about @@ -55,6 +57,10 @@ class ContentModeration(TypedDict, total=False): class Reference(TypedDict, total=False): + """ + Passing an image reference allows the model to emulate the style or content of the reference in the output. + """ + type: Required[Literal["image"]] uri: Required[str]