@runwayml/sdk 3.4.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/character-performance.d.mts +38 -27
  12. package/resources/character-performance.d.mts.map +1 -1
  13. package/resources/character-performance.d.ts +38 -27
  14. package/resources/character-performance.d.ts.map +1 -1
  15. package/resources/character-performance.js +16 -0
  16. package/resources/character-performance.js.map +1 -1
  17. package/resources/character-performance.mjs +16 -0
  18. package/resources/character-performance.mjs.map +1 -1
  19. package/resources/image-to-video.d.mts +215 -88
  20. package/resources/image-to-video.d.mts.map +1 -1
  21. package/resources/image-to-video.d.ts +215 -88
  22. package/resources/image-to-video.d.ts.map +1 -1
  23. package/resources/image-to-video.js +10 -1
  24. package/resources/image-to-video.js.map +1 -1
  25. package/resources/image-to-video.mjs +10 -1
  26. package/resources/image-to-video.mjs.map +1 -1
  27. package/resources/index.d.mts +1 -0
  28. package/resources/index.d.mts.map +1 -1
  29. package/resources/index.d.ts +1 -0
  30. package/resources/index.d.ts.map +1 -1
  31. package/resources/index.js +3 -1
  32. package/resources/index.js.map +1 -1
  33. package/resources/index.mjs +1 -0
  34. package/resources/index.mjs.map +1 -1
  35. package/resources/organization.d.mts +32 -2
  36. package/resources/organization.d.mts.map +1 -1
  37. package/resources/organization.d.ts +32 -2
  38. package/resources/organization.d.ts.map +1 -1
  39. package/resources/sound-effect.d.mts +1 -7
  40. package/resources/sound-effect.d.mts.map +1 -1
  41. package/resources/sound-effect.d.ts +1 -7
  42. package/resources/sound-effect.d.ts.map +1 -1
  43. package/resources/speech-to-speech.d.mts +64 -0
  44. package/resources/speech-to-speech.d.mts.map +1 -0
  45. package/resources/speech-to-speech.d.ts +64 -0
  46. package/resources/speech-to-speech.d.ts.map +1 -0
  47. package/resources/speech-to-speech.js +17 -0
  48. package/resources/speech-to-speech.js.map +1 -0
  49. package/resources/speech-to-speech.mjs +12 -0
  50. package/resources/speech-to-speech.mjs.map +1 -0
  51. package/resources/text-to-speech.d.mts +3 -9
  52. package/resources/text-to-speech.d.mts.map +1 -1
  53. package/resources/text-to-speech.d.ts +3 -9
  54. package/resources/text-to-speech.d.ts.map +1 -1
  55. package/resources/text-to-video.d.mts +50 -28
  56. package/resources/text-to-video.d.mts.map +1 -1
  57. package/resources/text-to-video.d.ts +50 -28
  58. package/resources/text-to-video.d.ts.map +1 -1
  59. package/resources/video-to-video.d.mts +12 -10
  60. package/resources/video-to-video.d.mts.map +1 -1
  61. package/resources/video-to-video.d.ts +12 -10
  62. package/resources/video-to-video.d.ts.map +1 -1
  63. package/resources/video-to-video.js +10 -0
  64. package/resources/video-to-video.js.map +1 -1
  65. package/resources/video-to-video.mjs +10 -0
  66. package/resources/video-to-video.mjs.map +1 -1
  67. package/resources/video-upscale.d.mts +9 -9
  68. package/resources/video-upscale.d.mts.map +1 -1
  69. package/resources/video-upscale.d.ts +9 -9
  70. package/resources/video-upscale.d.ts.map +1 -1
  71. package/resources/video-upscale.js +8 -0
  72. package/resources/video-upscale.js.map +1 -1
  73. package/resources/video-upscale.mjs +8 -0
  74. package/resources/video-upscale.mjs.map +1 -1
  75. package/resources/voice-dubbing.d.mts +10 -8
  76. package/resources/voice-dubbing.d.mts.map +1 -1
  77. package/resources/voice-dubbing.d.ts +10 -8
  78. package/resources/voice-dubbing.d.ts.map +1 -1
  79. package/resources/voice-dubbing.js +9 -0
  80. package/resources/voice-dubbing.js.map +1 -1
  81. package/resources/voice-dubbing.mjs +9 -0
  82. package/resources/voice-dubbing.mjs.map +1 -1
  83. package/resources/voice-isolation.d.mts +13 -10
  84. package/resources/voice-isolation.d.mts.map +1 -1
  85. package/resources/voice-isolation.d.ts +13 -10
  86. package/resources/voice-isolation.d.ts.map +1 -1
  87. package/resources/voice-isolation.js +11 -1
  88. package/resources/voice-isolation.js.map +1 -1
  89. package/resources/voice-isolation.mjs +11 -1
  90. package/resources/voice-isolation.mjs.map +1 -1
  91. package/src/client.ts +13 -0
  92. package/src/resources/character-performance.ts +40 -29
  93. package/src/resources/image-to-video.ts +253 -99
  94. package/src/resources/index.ts +5 -0
  95. package/src/resources/organization.ts +37 -0
  96. package/src/resources/sound-effect.ts +1 -7
  97. package/src/resources/speech-to-speech.ts +136 -0
  98. package/src/resources/text-to-speech.ts +3 -9
  99. package/src/resources/text-to-video.ts +61 -28
  100. package/src/resources/video-to-video.ts +12 -10
  101. package/src/resources/video-upscale.ts +9 -9
  102. package/src/resources/voice-dubbing.ts +10 -8
  103. package/src/resources/voice-isolation.ts +13 -10
  104. package/src/version.ts +1 -1
  105. package/version.d.mts +1 -1
  106. package/version.d.ts +1 -1
  107. package/version.js +1 -1
  108. package/version.mjs +1 -1
@@ -0,0 +1,136 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIPromiseWithAwaitableTask, wrapAsWaitableResource } from '../lib/polling';
3
+ import { APIResource } from '../core/resource';
4
+ import { RequestOptions } from '../internal/request-options';
5
+
6
+ export class SpeechToSpeech extends APIResource {
7
+ /**
8
+ * This endpoint will start a new task to convert speech from one voice to another
9
+ * in audio or video.
10
+ */
11
+ create(
12
+ body: SpeechToSpeechCreateParams,
13
+ options?: RequestOptions,
14
+ ): APIPromiseWithAwaitableTask<SpeechToSpeechCreateResponse> {
15
+ return wrapAsWaitableResource<SpeechToSpeechCreateResponse>(this._client)(
16
+ this._client.post('/v1/speech_to_speech', { body, ...options }),
17
+ );
18
+ }
19
+ }
20
+
21
+ export interface SpeechToSpeechCreateResponse {
22
+ id: string;
23
+ }
24
+
25
+ export interface SpeechToSpeechCreateParams {
26
+ /**
27
+ * The media to use as a source for the dialogue for the generated speech.
28
+ */
29
+ media: SpeechToSpeechCreateParams.Audio | SpeechToSpeechCreateParams.Video;
30
+
31
+ model: 'eleven_multilingual_sts_v2';
32
+
33
+ /**
34
+ * A voice preset from the RunwayML API.
35
+ */
36
+ voice: SpeechToSpeechCreateParams.Voice;
37
+
38
+ /**
39
+ * Whether to remove background noise from the generated speech.
40
+ */
41
+ removeBackgroundNoise?: boolean;
42
+ }
43
+
44
+ export namespace SpeechToSpeechCreateParams {
45
+ /**
46
+ * An audio file containing dialogue to be processed.
47
+ */
48
+ export interface Audio {
49
+ type: 'audio';
50
+
51
+ /**
52
+ * A HTTPS URL.
53
+ */
54
+ uri: string;
55
+ }
56
+
57
+ /**
58
+ * A video file containing dialogue to be processed.
59
+ */
60
+ export interface Video {
61
+ type: 'video';
62
+
63
+ /**
64
+ * A HTTPS URL.
65
+ */
66
+ uri: string;
67
+ }
68
+
69
+ /**
70
+ * A voice preset from the RunwayML API.
71
+ */
72
+ export interface Voice {
73
+ /**
74
+ * The preset voice ID to use for the generated speech.
75
+ */
76
+ presetId:
77
+ | 'Maya'
78
+ | 'Arjun'
79
+ | 'Serene'
80
+ | 'Bernard'
81
+ | 'Billy'
82
+ | 'Mark'
83
+ | 'Clint'
84
+ | 'Mabel'
85
+ | 'Chad'
86
+ | 'Leslie'
87
+ | 'Eleanor'
88
+ | 'Elias'
89
+ | 'Elliot'
90
+ | 'Grungle'
91
+ | 'Brodie'
92
+ | 'Sandra'
93
+ | 'Kirk'
94
+ | 'Kylie'
95
+ | 'Lara'
96
+ | 'Lisa'
97
+ | 'Malachi'
98
+ | 'Marlene'
99
+ | 'Martin'
100
+ | 'Miriam'
101
+ | 'Monster'
102
+ | 'Paula'
103
+ | 'Pip'
104
+ | 'Rusty'
105
+ | 'Ragnar'
106
+ | 'Xylar'
107
+ | 'Maggie'
108
+ | 'Jack'
109
+ | 'Katie'
110
+ | 'Noah'
111
+ | 'James'
112
+ | 'Rina'
113
+ | 'Ella'
114
+ | 'Mariah'
115
+ | 'Frank'
116
+ | 'Claudia'
117
+ | 'Niki'
118
+ | 'Vincent'
119
+ | 'Kendrick'
120
+ | 'Myrna'
121
+ | 'Tom'
122
+ | 'Wanda'
123
+ | 'Benjamin'
124
+ | 'Kiana'
125
+ | 'Rachel';
126
+
127
+ type: 'runway-preset';
128
+ }
129
+ }
130
+
131
+ export declare namespace SpeechToSpeech {
132
+ export {
133
+ type SpeechToSpeechCreateResponse as SpeechToSpeechCreateResponse,
134
+ type SpeechToSpeechCreateParams as SpeechToSpeechCreateParams,
135
+ };
136
+ }
@@ -19,16 +19,10 @@ export class TextToSpeech extends APIResource {
19
19
  }
20
20
 
21
21
  export interface TextToSpeechCreateResponse {
22
- /**
23
- * The ID of the newly created task.
24
- */
25
22
  id: string;
26
23
  }
27
24
 
28
25
  export interface TextToSpeechCreateParams {
29
- /**
30
- * The model variant to use.
31
- */
32
26
  model: 'eleven_multilingual_v2';
33
27
 
34
28
  /**
@@ -38,18 +32,18 @@ export interface TextToSpeechCreateParams {
38
32
  promptText: string;
39
33
 
40
34
  /**
41
- * The voice to use for the generated speech.
35
+ * A voice preset from the RunwayML API.
42
36
  */
43
37
  voice: TextToSpeechCreateParams.Voice;
44
38
  }
45
39
 
46
40
  export namespace TextToSpeechCreateParams {
47
41
  /**
48
- * The voice to use for the generated speech.
42
+ * A voice preset from the RunwayML API.
49
43
  */
50
44
  export interface Voice {
51
45
  /**
52
- * The name of the voice to use for the generated speech.
46
+ * The preset voice ID to use for the generated speech.
53
47
  */
54
48
  presetId:
55
49
  | 'Maya'
@@ -19,41 +19,74 @@ export class TextToVideo extends APIResource {
19
19
  }
20
20
 
21
21
  export interface TextToVideoCreateResponse {
22
- /**
23
- * The ID of the newly created task.
24
- */
25
22
  id: string;
26
23
  }
27
24
 
28
- export interface TextToVideoCreateParams {
29
- /**
30
- * `veo3` videos must be 8 seconds long. `veo3.1` and `veo3.1_fast` videos must be
31
- * 4, 6, or 8 seconds long.
32
- */
33
- duration: 4 | 6 | 8;
25
+ export type TextToVideoCreateParams =
26
+ | TextToVideoCreateParams.Veo3_1
27
+ | TextToVideoCreateParams.Veo3_1Fast
28
+ | TextToVideoCreateParams.Veo3;
34
29
 
35
- /**
36
- * The model variant to use.
37
- */
38
- model: 'veo3.1' | 'veo3.1_fast' | 'veo3';
30
+ export declare namespace TextToVideoCreateParams {
31
+ export interface Veo3_1 {
32
+ model: 'veo3.1';
39
33
 
40
- /**
41
- * A non-empty string up to 1000 characters (measured in UTF-16 code units). This
42
- * should describe in detail what should appear in the output.
43
- */
44
- promptText: string;
34
+ /**
35
+ * A non-empty string up to 1000 characters (measured in UTF-16 code units). This
36
+ * should describe in detail what should appear in the output.
37
+ */
38
+ promptText: string;
45
39
 
46
- /**
47
- * A string representing the aspect ratio of the output video.
48
- */
49
- ratio: '1280:720' | '720:1280' | '1080:1920' | '1920:1080';
40
+ /**
41
+ * The resolution of the output video.
42
+ */
43
+ ratio: '1280:720' | '720:1280' | '1080:1920' | '1920:1080';
50
44
 
51
- /**
52
- * If unspecified, a random number is chosen. Varying the seed integer is a way to
53
- * get different results for the same other request parameters. Using the same seed
54
- * integer for an identical request will produce similar results.
55
- */
56
- seed?: number;
45
+ /**
46
+ * The number of seconds of duration for the output video.
47
+ */
48
+ duration?: 4 | 6 | 8;
49
+ }
50
+
51
+ export interface Veo3_1Fast {
52
+ model: 'veo3.1_fast';
53
+
54
+ /**
55
+ * A non-empty string up to 1000 characters (measured in UTF-16 code units). This
56
+ * should describe in detail what should appear in the output.
57
+ */
58
+ promptText: string;
59
+
60
+ /**
61
+ * The resolution of the output video.
62
+ */
63
+ ratio: '1280:720' | '720:1280' | '1080:1920' | '1920:1080';
64
+
65
+ /**
66
+ * The number of seconds of duration for the output video.
67
+ */
68
+ duration?: 4 | 6 | 8;
69
+ }
70
+
71
+ export interface Veo3 {
72
+ /**
73
+ * The number of seconds of duration for the output video.
74
+ */
75
+ duration: 8;
76
+
77
+ model: 'veo3';
78
+
79
+ /**
80
+ * A non-empty string up to 1000 characters (measured in UTF-16 code units). This
81
+ * should describe in detail what should appear in the output.
82
+ */
83
+ promptText: string;
84
+
85
+ /**
86
+ * The resolution of the output video.
87
+ */
88
+ ratio: '1280:720' | '720:1280' | '1080:1920' | '1920:1080';
89
+ }
57
90
  }
58
91
 
59
92
  export declare namespace TextToVideo {
@@ -7,6 +7,16 @@ import { APIPromiseWithAwaitableTask, wrapAsWaitableResource } from '../lib/poll
7
7
  export class VideoToVideo extends APIResource {
8
8
  /**
9
9
  * This endpoint will start a new task to generate a video from a video.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const videoToVideo = await client.videoToVideo.create({
14
+ * model: 'gen4_aleph',
15
+ * promptText: 'x',
16
+ * ratio: '1280:720',
17
+ * videoUri: 'https://example.com/video.mp4',
18
+ * });
19
+ * ```
10
20
  */
11
21
  create(
12
22
  body: VideoToVideoCreateParams,
@@ -19,16 +29,10 @@ export class VideoToVideo extends APIResource {
19
29
  }
20
30
 
21
31
  export interface VideoToVideoCreateResponse {
22
- /**
23
- * The ID of the newly created task.
24
- */
25
32
  id: string;
26
33
  }
27
34
 
28
35
  export interface VideoToVideoCreateParams {
29
- /**
30
- * The model variant to use.
31
- */
32
36
  model: 'gen4_aleph';
33
37
 
34
38
  /**
@@ -43,8 +47,7 @@ export interface VideoToVideoCreateParams {
43
47
  ratio: '1280:720' | '720:1280' | '1104:832' | '960:960' | '832:1104' | '1584:672' | '848:480' | '640:480';
44
48
 
45
49
  /**
46
- * A HTTPS URL pointing to a video or a data URI containing a video. See
47
- * [our docs](/assets/inputs#videos) on video inputs for more information.
50
+ * A HTTPS URL.
48
51
  */
49
52
  videoUri: string;
50
53
 
@@ -87,8 +90,7 @@ export namespace VideoToVideoCreateParams {
87
90
  type: 'image';
88
91
 
89
92
  /**
90
- * A HTTPS URL pointing to an image or a data URI containing an image. See
91
- * [our docs](/assets/inputs#images) on image inputs for more information.
93
+ * A HTTPS URL.
92
94
  */
93
95
  uri: string;
94
96
  }
@@ -8,6 +8,14 @@ export class VideoUpscale extends APIResource {
8
8
  /**
9
9
  * This endpoint will start a new task to upscale a video. Videos will be upscaled
10
10
  * by a factor of 4X, capped at a maximum of 4096px along each side.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const videoUpscale = await client.videoUpscale.create({
15
+ * model: 'upscale_v1',
16
+ * videoUri: 'https://example.com/video.mp4',
17
+ * });
18
+ * ```
11
19
  */
12
20
  create(
13
21
  body: VideoUpscaleCreateParams,
@@ -20,22 +28,14 @@ export class VideoUpscale extends APIResource {
20
28
  }
21
29
 
22
30
  export interface VideoUpscaleCreateResponse {
23
- /**
24
- * The ID of the newly created task.
25
- */
26
31
  id: string;
27
32
  }
28
33
 
29
34
  export interface VideoUpscaleCreateParams {
30
- /**
31
- * The model variant to use.
32
- */
33
35
  model: 'upscale_v1';
34
36
 
35
37
  /**
36
- * A HTTPS URL pointing to a video or a data URI containing a video. The video must
37
- * be less than 4096px on each side. The video duration may not exceed 40 seconds.
38
- * See [our docs](/assets/inputs#videos) on video inputs for more information.
38
+ * A HTTPS URL.
39
39
  */
40
40
  videoUri: string;
41
41
  }
@@ -7,6 +7,15 @@ import { APIPromiseWithAwaitableTask, wrapAsWaitableResource } from '../lib/poll
7
7
  export class VoiceDubbing extends APIResource {
8
8
  /**
9
9
  * This endpoint will start a new task to dub audio content to a target language.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const voiceDubbing = await client.voiceDubbing.create({
14
+ * audioUri: 'https://example.com/audio.mp3',
15
+ * model: 'eleven_voice_dubbing',
16
+ * targetLang: 'en',
17
+ * });
18
+ * ```
10
19
  */
11
20
  create(
12
21
  body: VoiceDubbingCreateParams,
@@ -19,22 +28,15 @@ export class VoiceDubbing extends APIResource {
19
28
  }
20
29
 
21
30
  export interface VoiceDubbingCreateResponse {
22
- /**
23
- * The ID of the newly created task.
24
- */
25
31
  id: string;
26
32
  }
27
33
 
28
34
  export interface VoiceDubbingCreateParams {
29
35
  /**
30
- * A HTTPS URL or data URI containing the audio file to dub. See
31
- * [our docs](/assets/inputs#audio) on audio inputs for more information.
36
+ * A HTTPS URL.
32
37
  */
33
38
  audioUri: string;
34
39
 
35
- /**
36
- * The model variant to use.
37
- */
38
40
  model: 'eleven_voice_dubbing';
39
41
 
40
42
  /**
@@ -6,7 +6,17 @@ import { APIPromiseWithAwaitableTask, wrapAsWaitableResource } from '../lib/poll
6
6
 
7
7
  export class VoiceIsolation extends APIResource {
8
8
  /**
9
- * This endpoint will start a new task to isolate and enhance voices in audio.
9
+ * This endpoint will start a new task to isolate the voice from the background
10
+ * audio. Audio duration must be greater than 4.6 seconds and less than 3600
11
+ * seconds.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const voiceIsolation = await client.voiceIsolation.create({
16
+ * audioUri: 'https://example.com/audio.mp3',
17
+ * model: 'eleven_voice_isolation',
18
+ * });
19
+ * ```
10
20
  */
11
21
  create(
12
22
  body: VoiceIsolationCreateParams,
@@ -19,22 +29,15 @@ export class VoiceIsolation extends APIResource {
19
29
  }
20
30
 
21
31
  export interface VoiceIsolationCreateResponse {
22
- /**
23
- * The ID of the newly created task.
24
- */
25
32
  id: string;
26
33
  }
27
34
 
28
35
  export interface VoiceIsolationCreateParams {
29
36
  /**
30
- * A HTTPS URL or data URI containing the audio file to process. See
31
- * [our docs](/assets/inputs#audio) on audio inputs for more information.
37
+ * A HTTPS URL.
32
38
  */
33
- audioUrl: string;
39
+ audioUri: string;
34
40
 
35
- /**
36
- * The model variant to use.
37
- */
38
41
  model: 'eleven_voice_isolation';
39
42
  }
40
43
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '3.4.0'; // x-release-please-version
1
+ export const VERSION = '3.6.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.4.0";
1
+ export declare const VERSION = "3.6.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.4.0";
1
+ export declare const VERSION = "3.6.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '3.4.0'; // x-release-please-version
4
+ exports.VERSION = '3.6.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.4.0'; // x-release-please-version
1
+ export const VERSION = '3.6.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map