Skip to content

Commit 7c68d93

Browse files
feat(api): Added speech to speech
1 parent 1a1e79d commit 7c68d93

22 files changed

+114
-161
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 14
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml%2Frunwayml-2c2e099a7b5785af1882c1f8c3f28f560e478d8345b6443155342f152f036117.yml
3-
openapi_spec_hash: b8e80b47d8ba09a28dedc562a3e79319
4-
config_hash: ef699c0a3936550275ab6d77894a2c72
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml%2Frunwayml-90724848e40fec0df1f6d172d097324ce50e9baed8a388426347886f98b754f3.yml
3+
openapi_spec_hash: 16e4f270e0c98418abfe265c1d248ef0
4+
config_hash: 590ccad5fefa843078c23b0cf95a081f

src/runwayml/resources/character_performance.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ def create(
5454
*,
5555
character: character_performance_create_params.Character,
5656
model: Literal["act_two"],
57-
ratio: Literal["1280:720", "720:1280", "960:960", "1104:832", "832:1104", "1584:672"],
5857
reference: character_performance_create_params.Reference,
5958
body_control: bool | Omit = omit,
6059
content_moderation: character_performance_create_params.ContentModeration | Omit = omit,
6160
expression_intensity: int | Omit = omit,
61+
ratio: Literal["1280:720", "720:1280", "960:960", "1104:832", "832:1104", "1584:672"] | Omit = omit,
6262
seed: int | Omit = omit,
6363
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6464
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -75,9 +75,7 @@ def create(
7575
character: The character to control. You can either provide a video or an image. A visually
7676
recognizable face must be visible and stay within the frame.
7777
78-
model: The model variant to use.
79-
80-
ratio: The resolution of the output video.
78+
reference: The reference video containing the performance to apply to the character.
8179
8280
body_control: A boolean indicating whether to enable body control. When enabled, non-facial
8381
movements and gestures will be applied to the character in addition to facial
@@ -88,9 +86,7 @@ def create(
8886
expression_intensity: An integer between 1 and 5 (inclusive). A larger value increases the intensity
8987
of the character's expression.
9088
91-
seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
92-
get different results for the same other request parameters. Using the same seed
93-
integer for an identical request will produce similar results.
89+
ratio: The resolution of the output video.
9490
9591
extra_headers: Send extra headers
9692
@@ -106,11 +102,11 @@ def create(
106102
{
107103
"character": character,
108104
"model": model,
109-
"ratio": ratio,
110105
"reference": reference,
111106
"body_control": body_control,
112107
"content_moderation": content_moderation,
113108
"expression_intensity": expression_intensity,
109+
"ratio": ratio,
114110
"seed": seed,
115111
},
116112
character_performance_create_params.CharacterPerformanceCreateParams,
@@ -147,11 +143,11 @@ async def create(
147143
*,
148144
character: character_performance_create_params.Character,
149145
model: Literal["act_two"],
150-
ratio: Literal["1280:720", "720:1280", "960:960", "1104:832", "832:1104", "1584:672"],
151146
reference: character_performance_create_params.Reference,
152147
body_control: bool | Omit = omit,
153148
content_moderation: character_performance_create_params.ContentModeration | Omit = omit,
154149
expression_intensity: int | Omit = omit,
150+
ratio: Literal["1280:720", "720:1280", "960:960", "1104:832", "832:1104", "1584:672"] | Omit = omit,
155151
seed: int | Omit = omit,
156152
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
157153
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -168,9 +164,7 @@ async def create(
168164
character: The character to control. You can either provide a video or an image. A visually
169165
recognizable face must be visible and stay within the frame.
170166
171-
model: The model variant to use.
172-
173-
ratio: The resolution of the output video.
167+
reference: The reference video containing the performance to apply to the character.
174168
175169
body_control: A boolean indicating whether to enable body control. When enabled, non-facial
176170
movements and gestures will be applied to the character in addition to facial
@@ -181,9 +175,7 @@ async def create(
181175
expression_intensity: An integer between 1 and 5 (inclusive). A larger value increases the intensity
182176
of the character's expression.
183177
184-
seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
185-
get different results for the same other request parameters. Using the same seed
186-
integer for an identical request will produce similar results.
178+
ratio: The resolution of the output video.
187179
188180
extra_headers: Send extra headers
189181
@@ -199,11 +191,11 @@ async def create(
199191
{
200192
"character": character,
201193
"model": model,
202-
"ratio": ratio,
203194
"reference": reference,
204195
"body_control": body_control,
205196
"content_moderation": content_moderation,
206197
"expression_intensity": expression_intensity,
198+
"ratio": ratio,
207199
"seed": seed,
208200
},
209201
character_performance_create_params.CharacterPerformanceCreateParams,

src/runwayml/resources/sound_effect.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,13 @@ def create(
6868
description.
6969
7070
Args:
71-
model: The model variant to use.
72-
7371
prompt_text: A text description of the sound effect to generate.
7472
7573
duration: The duration of the sound effect in seconds, between 0.5 and 30 seconds. If not
7674
provided, the duration will be determined automatically based on the text
7775
description.
7876
79-
loop: Whether the sound effect should be designed to loop seamlessly.
77+
loop: Whether the output sound effect should be designed to loop seamlessly.
8078
8179
extra_headers: Send extra headers
8280
@@ -143,15 +141,13 @@ async def create(
143141
description.
144142
145143
Args:
146-
model: The model variant to use.
147-
148144
prompt_text: A text description of the sound effect to generate.
149145
150146
duration: The duration of the sound effect in seconds, between 0.5 and 30 seconds. If not
151147
provided, the duration will be determined automatically based on the text
152148
description.
153149
154-
loop: Whether the sound effect should be designed to loop seamlessly.
150+
loop: Whether the output sound effect should be designed to loop seamlessly.
155151
156152
extra_headers: Send extra headers
157153

src/runwayml/resources/text_to_speech.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ def create(
6666
This endpoint will start a new task to generate speech from text.
6767
6868
Args:
69-
model: The model variant to use.
70-
7169
prompt_text: A non-empty string up to 1000 characters (measured in UTF-16 code units). This
7270
should describe in detail what should appear in the output.
7371
@@ -135,8 +133,6 @@ async def create(
135133
This endpoint will start a new task to generate speech from text.
136134
137135
Args:
138-
model: The model variant to use.
139-
140136
prompt_text: A non-empty string up to 1000 characters (measured in UTF-16 code units). This
141137
should describe in detail what should appear in the output.
142138

src/runwayml/resources/voice_dubbing.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ def create(
9999
This endpoint will start a new task to dub audio content to a target language.
100100
101101
Args:
102-
audio_uri: A HTTPS URL or data URI containing the audio file to dub. See
103-
[our docs](/assets/inputs#audio) on audio inputs for more information.
104-
105-
model: The model variant to use.
102+
audio_uri: A data URI containing encoded audio.
106103
107104
target_lang: The target language code to dub the audio to (e.g., "es" for Spanish, "fr" for
108105
French).
@@ -212,10 +209,7 @@ async def create(
212209
This endpoint will start a new task to dub audio content to a target language.
213210
214211
Args:
215-
audio_uri: A HTTPS URL or data URI containing the audio file to dub. See
216-
[our docs](/assets/inputs#audio) on audio inputs for more information.
217-
218-
model: The model variant to use.
212+
audio_uri: A data URI containing encoded audio.
219213
220214
target_lang: The target language code to dub the audio to (e.g., "es" for Spanish, "fr" for
221215
French).

src/runwayml/resources/voice_isolation.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def with_streaming_response(self) -> VoiceIsolationResourceWithStreamingResponse
5252
def create(
5353
self,
5454
*,
55-
audio_url: str,
55+
audio_uri: str,
5656
model: Literal["eleven_voice_isolation"],
5757
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5858
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -62,13 +62,11 @@ def create(
6262
timeout: float | httpx.Timeout | None | NotGiven = not_given,
6363
) -> NewTaskCreatedResponse:
6464
"""
65-
This endpoint will start a new task to isolate and enhance voices in audio.
65+
This endpoint will start a new task to isolate the voice from the background
66+
audio.
6667
6768
Args:
68-
audio_url: A HTTPS URL or data URI containing the audio file to process. See
69-
[our docs](/assets/inputs#audio) on audio inputs for more information.
70-
71-
model: The model variant to use.
69+
audio_uri: A data URI containing encoded audio.
7270
7371
extra_headers: Send extra headers
7472
@@ -82,7 +80,7 @@ def create(
8280
"/v1/voice_isolation",
8381
body=maybe_transform(
8482
{
85-
"audio_url": audio_url,
83+
"audio_uri": audio_uri,
8684
"model": model,
8785
},
8886
voice_isolation_create_params.VoiceIsolationCreateParams,
@@ -117,7 +115,7 @@ def with_streaming_response(self) -> AsyncVoiceIsolationResourceWithStreamingRes
117115
async def create(
118116
self,
119117
*,
120-
audio_url: str,
118+
audio_uri: str,
121119
model: Literal["eleven_voice_isolation"],
122120
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
123121
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -127,13 +125,11 @@ async def create(
127125
timeout: float | httpx.Timeout | None | NotGiven = not_given,
128126
) -> AsyncNewTaskCreatedResponse:
129127
"""
130-
This endpoint will start a new task to isolate and enhance voices in audio.
128+
This endpoint will start a new task to isolate the voice from the background
129+
audio.
131130
132131
Args:
133-
audio_url: A HTTPS URL or data URI containing the audio file to process. See
134-
[our docs](/assets/inputs#audio) on audio inputs for more information.
135-
136-
model: The model variant to use.
132+
audio_uri: A data URI containing encoded audio.
137133
138134
extra_headers: Send extra headers
139135
@@ -147,7 +143,7 @@ async def create(
147143
"/v1/voice_isolation",
148144
body=await async_maybe_transform(
149145
{
150-
"audio_url": audio_url,
146+
"audio_uri": audio_uri,
151147
"model": model,
152148
},
153149
voice_isolation_create_params.VoiceIsolationCreateParams,

src/runwayml/types/character_performance_create_params.py

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
__all__ = [
1111
"CharacterPerformanceCreateParams",
1212
"Character",
13-
"CharacterVideo",
1413
"CharacterImage",
14+
"CharacterVideo",
1515
"Reference",
1616
"ContentModeration",
1717
]
@@ -26,12 +26,9 @@ class CharacterPerformanceCreateParams(TypedDict, total=False):
2626
"""
2727

2828
model: Required[Literal["act_two"]]
29-
"""The model variant to use."""
30-
31-
ratio: Required[Literal["1280:720", "720:1280", "960:960", "1104:832", "832:1104", "1584:672"]]
32-
"""The resolution of the output video."""
3329

3430
reference: Required[Reference]
31+
"""The reference video containing the performance to apply to the character."""
3532

3633
body_control: Annotated[bool, PropertyInfo(alias="bodyControl")]
3734
"""A boolean indicating whether to enable body control.
@@ -49,55 +46,35 @@ class CharacterPerformanceCreateParams(TypedDict, total=False):
4946
A larger value increases the intensity of the character's expression.
5047
"""
5148

52-
seed: int
53-
"""If unspecified, a random number is chosen.
49+
ratio: Literal["1280:720", "720:1280", "960:960", "1104:832", "832:1104", "1584:672"]
50+
"""The resolution of the output video."""
5451

55-
Varying the seed integer is a way to get different results for the same other
56-
request parameters. Using the same seed integer for an identical request will
57-
produce similar results.
58-
"""
52+
seed: int
5953

6054

61-
class CharacterVideo(TypedDict, total=False):
62-
type: Required[Literal["video"]]
55+
class CharacterImage(TypedDict, total=False):
56+
type: Required[Literal["image"]]
6357

6458
uri: Required[str]
65-
"""
66-
A HTTPS URL pointing to a video or a data URI containing a video of your
67-
character. See [our docs](/assets/inputs#videos) on video inputs for more
68-
information.
69-
"""
59+
"""A data URI containing an encoded image."""
7060

7161

72-
class CharacterImage(TypedDict, total=False):
73-
type: Required[Literal["image"]]
62+
class CharacterVideo(TypedDict, total=False):
63+
type: Required[Literal["video"]]
7464

7565
uri: Required[str]
76-
"""
77-
A HTTPS URL pointing to an image or a data URI containing an image of your
78-
character. See [our docs](/assets/inputs#images) on image inputs for more
79-
information.
80-
"""
66+
"""A data URI containing an encoded video."""
8167

8268

83-
Character: TypeAlias = Union[CharacterVideo, CharacterImage]
69+
Character: TypeAlias = Union[CharacterImage, CharacterVideo]
8470

8571

8672
class Reference(TypedDict, total=False):
8773
type: Required[Literal["video"]]
8874

8975
uri: Required[str]
90-
"""
91-
A HTTPS URL pointing to a video or a data URI containing a video of a person
92-
performing in the manner that you would like your character to perform. The
93-
video must be between 3 and 30 seconds in duration. See
94-
[our docs](/assets/inputs#videos) on video inputs for more information.
95-
"""
76+
"""A data URI containing an encoded video."""
9677

9778

9879
class ContentModeration(TypedDict, total=False):
9980
public_figure_threshold: Annotated[Literal["auto", "low"], PropertyInfo(alias="publicFigureThreshold")]
100-
"""
101-
When set to `low`, the content moderation system will be less strict about
102-
preventing generations that include recognizable public figures.
103-
"""

src/runwayml/types/character_performance_create_response.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@
77

88
class CharacterPerformanceCreateResponse(BaseModel):
99
id: str
10-
"""The ID of the newly created task."""

0 commit comments

Comments
 (0)