@runwayml/sdk 3.17.0 → 3.19.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 (53) hide show
  1. package/CHANGELOG.md +36 -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/internal/utils/env.js +2 -2
  11. package/internal/utils/env.js.map +1 -1
  12. package/internal/utils/env.mjs +2 -2
  13. package/internal/utils/env.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/avatar-videos.d.mts +101 -0
  16. package/resources/avatar-videos.d.mts.map +1 -0
  17. package/resources/avatar-videos.d.ts +101 -0
  18. package/resources/avatar-videos.d.ts.map +1 -0
  19. package/resources/avatar-videos.js +19 -0
  20. package/resources/avatar-videos.js.map +1 -0
  21. package/resources/avatar-videos.mjs +15 -0
  22. package/resources/avatar-videos.mjs.map +1 -0
  23. package/resources/index.d.mts +1 -0
  24. package/resources/index.d.mts.map +1 -1
  25. package/resources/index.d.ts +1 -0
  26. package/resources/index.d.ts.map +1 -1
  27. package/resources/index.js +3 -1
  28. package/resources/index.js.map +1 -1
  29. package/resources/index.mjs +1 -0
  30. package/resources/index.mjs.map +1 -1
  31. package/resources/realtime-sessions.d.mts +274 -0
  32. package/resources/realtime-sessions.d.mts.map +1 -1
  33. package/resources/realtime-sessions.d.ts +274 -0
  34. package/resources/realtime-sessions.d.ts.map +1 -1
  35. package/resources/voices.d.mts +17 -7
  36. package/resources/voices.d.mts.map +1 -1
  37. package/resources/voices.d.ts +17 -7
  38. package/resources/voices.d.ts.map +1 -1
  39. package/resources/voices.js +2 -1
  40. package/resources/voices.js.map +1 -1
  41. package/resources/voices.mjs +2 -1
  42. package/resources/voices.mjs.map +1 -1
  43. package/src/client.ts +9 -0
  44. package/src/internal/utils/env.ts +2 -2
  45. package/src/resources/avatar-videos.ts +170 -0
  46. package/src/resources/index.ts +1 -0
  47. package/src/resources/realtime-sessions.ts +354 -0
  48. package/src/resources/voices.ts +19 -7
  49. package/src/version.ts +1 -1
  50. package/version.d.mts +1 -1
  51. package/version.d.ts +1 -1
  52. package/version.js +1 -1
  53. package/version.mjs +1 -1
@@ -0,0 +1,170 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { RequestOptions } from '../internal/request-options';
5
+ import { APIPromiseWithAwaitableTask, wrapAsWaitableResource } from '../lib/polling';
6
+
7
+ export class AvatarVideos extends APIResource {
8
+ /**
9
+ * Start an asynchronous task to generate a video of an avatar speaking. Provide
10
+ * `speech` with `type: "audio"` (audio file) or `type: "text"` (text script for
11
+ * TTS). Poll `GET /v1/tasks/:id` to check progress and retrieve the output video
12
+ * URL once complete.
13
+ */
14
+ create(
15
+ body: AvatarVideoCreateParams,
16
+ options?: RequestOptions,
17
+ ): APIPromiseWithAwaitableTask<AvatarVideoCreateResponse> {
18
+ return wrapAsWaitableResource<AvatarVideoCreateResponse>(this._client)(
19
+ this._client.post('/v1/avatar_videos', { body, ...options }),
20
+ );
21
+ }
22
+ }
23
+
24
+ export interface AvatarVideoCreateResponse {
25
+ /**
26
+ * The ID of the avatar video task. Use `GET /v1/tasks/:id` to poll for status and
27
+ * output.
28
+ */
29
+ id: string;
30
+ }
31
+
32
+ export interface AvatarVideoCreateParams {
33
+ /**
34
+ * The avatar configuration for the session.
35
+ */
36
+ avatar: AvatarVideoCreateParams.RunwayPreset | AvatarVideoCreateParams.Custom;
37
+
38
+ /**
39
+ * The model to use for avatar video generation.
40
+ */
41
+ model: 'gwm1_avatars';
42
+
43
+ /**
44
+ * The speech source for avatar video generation. Either an audio file or text
45
+ * script.
46
+ */
47
+ speech: AvatarVideoCreateParams.Audio | AvatarVideoCreateParams.Text;
48
+ }
49
+
50
+ export namespace AvatarVideoCreateParams {
51
+ /**
52
+ * A preset avatar from Runway.
53
+ */
54
+ export interface RunwayPreset {
55
+ /**
56
+ * ID of a preset avatar.
57
+ */
58
+ presetId:
59
+ | 'game-character'
60
+ | 'music-superstar'
61
+ | 'game-character-man'
62
+ | 'cat-character'
63
+ | 'influencer'
64
+ | 'tennis-coach'
65
+ | 'human-resource'
66
+ | 'fashion-designer'
67
+ | 'cooking-teacher';
68
+
69
+ type: 'runway-preset';
70
+ }
71
+
72
+ /**
73
+ * A user-created avatar.
74
+ */
75
+ export interface Custom {
76
+ /**
77
+ * ID of a user-created avatar.
78
+ */
79
+ avatarId: string;
80
+
81
+ type: 'custom';
82
+ }
83
+
84
+ /**
85
+ * Provide an audio file for the avatar to speak.
86
+ */
87
+ export interface Audio {
88
+ /**
89
+ * A HTTPS URL.
90
+ */
91
+ audio: string;
92
+
93
+ type: 'audio';
94
+ }
95
+
96
+ /**
97
+ * Provide text for the avatar to speak via TTS.
98
+ */
99
+ export interface Text {
100
+ /**
101
+ * Text script for speech-driven video generation.
102
+ */
103
+ text: string;
104
+
105
+ type: 'text';
106
+
107
+ /**
108
+ * Optional voice override for TTS. If not provided, the avatar's configured voice
109
+ * is used.
110
+ */
111
+ voice?: Text.Preset | Text.Custom;
112
+ }
113
+
114
+ export namespace Text {
115
+ /**
116
+ * A preset voice from the Runway API.
117
+ */
118
+ export interface Preset {
119
+ presetId:
120
+ | 'victoria'
121
+ | 'vincent'
122
+ | 'clara'
123
+ | 'drew'
124
+ | 'skye'
125
+ | 'max'
126
+ | 'morgan'
127
+ | 'felix'
128
+ | 'mia'
129
+ | 'marcus'
130
+ | 'summer'
131
+ | 'ruby'
132
+ | 'aurora'
133
+ | 'jasper'
134
+ | 'leo'
135
+ | 'adrian'
136
+ | 'nina'
137
+ | 'emma'
138
+ | 'blake'
139
+ | 'david'
140
+ | 'maya'
141
+ | 'nathan'
142
+ | 'sam'
143
+ | 'georgia'
144
+ | 'petra'
145
+ | 'adam'
146
+ | 'zach'
147
+ | 'violet'
148
+ | 'roman'
149
+ | 'luna';
150
+
151
+ type: 'preset';
152
+ }
153
+
154
+ /**
155
+ * A custom voice created via the Voices API.
156
+ */
157
+ export interface Custom {
158
+ id: string;
159
+
160
+ type: 'custom';
161
+ }
162
+ }
163
+ }
164
+
165
+ export declare namespace AvatarVideos {
166
+ export {
167
+ type AvatarVideoCreateResponse as AvatarVideoCreateResponse,
168
+ type AvatarVideoCreateParams as AvatarVideoCreateParams,
169
+ };
170
+ }
@@ -1,5 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ export { AvatarVideos, type AvatarVideoCreateResponse, type AvatarVideoCreateParams } from './avatar-videos';
3
4
  export {
4
5
  Avatars,
5
6
  type AvatarCreateResponse,
@@ -217,6 +217,11 @@ export interface RealtimeSessionCreateParams {
217
217
  * avatar default.
218
218
  */
219
219
  startScript?: string;
220
+
221
+ /**
222
+ * Tools available to the avatar during the session.
223
+ */
224
+ tools?: Array<RealtimeSessionCreateParams.ClientEvent | RealtimeSessionCreateParams.BackendRpc>;
220
225
  }
221
226
 
222
227
  export namespace RealtimeSessionCreateParams {
@@ -252,6 +257,355 @@ export namespace RealtimeSessionCreateParams {
252
257
 
253
258
  type: 'custom';
254
259
  }
260
+
261
+ /**
262
+ * A fire-and-forget tool that sends arguments to the frontend client of the
263
+ * realtime session.
264
+ */
265
+ export interface ClientEvent {
266
+ /**
267
+ * A description of when and how the tool should be used. Be specific so the avatar
268
+ * understands the right context to invoke it.
269
+ */
270
+ description: string;
271
+
272
+ /**
273
+ * The tool name. Must start with a letter or underscore, followed by alphanumeric
274
+ * characters or underscores.
275
+ */
276
+ name: string;
277
+
278
+ type: 'client_event';
279
+
280
+ parameters?: Array<
281
+ | ClientEvent.String
282
+ | ClientEvent.Integer
283
+ | ClientEvent.Number
284
+ | ClientEvent.Boolean
285
+ | ClientEvent.Array_
286
+ | ClientEvent.Object
287
+ >;
288
+ }
289
+
290
+ export namespace ClientEvent {
291
+ export interface String {
292
+ /**
293
+ * A description of the parameter.
294
+ */
295
+ description: string;
296
+
297
+ /**
298
+ * The parameter name.
299
+ */
300
+ name: string;
301
+
302
+ type: 'string';
303
+
304
+ /**
305
+ * Allowed values for the parameter.
306
+ */
307
+ enum?: Array<string>;
308
+
309
+ /**
310
+ * Whether the parameter is required.
311
+ */
312
+ required?: boolean;
313
+ }
314
+
315
+ export interface Integer {
316
+ /**
317
+ * A description of the parameter.
318
+ */
319
+ description: string;
320
+
321
+ /**
322
+ * The parameter name.
323
+ */
324
+ name: string;
325
+
326
+ type: 'integer';
327
+
328
+ /**
329
+ * Whether the parameter is required.
330
+ */
331
+ required?: boolean;
332
+ }
333
+
334
+ export interface Number {
335
+ /**
336
+ * A description of the parameter.
337
+ */
338
+ description: string;
339
+
340
+ /**
341
+ * The parameter name.
342
+ */
343
+ name: string;
344
+
345
+ type: 'number';
346
+
347
+ /**
348
+ * Whether the parameter is required.
349
+ */
350
+ required?: boolean;
351
+ }
352
+
353
+ export interface Boolean {
354
+ /**
355
+ * A description of the parameter.
356
+ */
357
+ description: string;
358
+
359
+ /**
360
+ * The parameter name.
361
+ */
362
+ name: string;
363
+
364
+ type: 'boolean';
365
+
366
+ /**
367
+ * Whether the parameter is required.
368
+ */
369
+ required?: boolean;
370
+ }
371
+
372
+ export interface Array_ {
373
+ /**
374
+ * A description of the parameter.
375
+ */
376
+ description: string;
377
+
378
+ /**
379
+ * Item schema for array elements.
380
+ */
381
+ items: Array_.Items;
382
+
383
+ /**
384
+ * The parameter name.
385
+ */
386
+ name: string;
387
+
388
+ type: 'array';
389
+
390
+ /**
391
+ * Whether the parameter is required.
392
+ */
393
+ required?: boolean;
394
+ }
395
+
396
+ export namespace Array_ {
397
+ /**
398
+ * Item schema for array elements.
399
+ */
400
+ export interface Items {
401
+ /**
402
+ * The type of each element in the array.
403
+ */
404
+ type: 'string' | 'integer' | 'number' | 'boolean';
405
+ }
406
+ }
407
+
408
+ export interface Object {
409
+ /**
410
+ * A description of the parameter.
411
+ */
412
+ description: string;
413
+
414
+ /**
415
+ * The parameter name.
416
+ */
417
+ name: string;
418
+
419
+ /**
420
+ * The properties of the object.
421
+ */
422
+ properties: Array<unknown>;
423
+
424
+ type: 'object';
425
+
426
+ /**
427
+ * Whether the parameter is required.
428
+ */
429
+ required?: boolean;
430
+ }
431
+ }
432
+
433
+ /**
434
+ * A tool that makes a round-trip RPC call to your backend server during the
435
+ * session.
436
+ */
437
+ export interface BackendRpc {
438
+ /**
439
+ * A description of when and how the tool should be used. Be specific so the avatar
440
+ * understands the right context to invoke it.
441
+ */
442
+ description: string;
443
+
444
+ /**
445
+ * The tool name. Must start with a letter or underscore, followed by alphanumeric
446
+ * characters or underscores.
447
+ */
448
+ name: string;
449
+
450
+ type: 'backend_rpc';
451
+
452
+ parameters?: Array<
453
+ | BackendRpc.String
454
+ | BackendRpc.Integer
455
+ | BackendRpc.Number
456
+ | BackendRpc.Boolean
457
+ | BackendRpc.Array_
458
+ | BackendRpc.Object
459
+ >;
460
+
461
+ /**
462
+ * Maximum time to wait for the backend to respond.
463
+ */
464
+ timeoutSeconds?: number;
465
+ }
466
+
467
+ export namespace BackendRpc {
468
+ export interface String {
469
+ /**
470
+ * A description of the parameter.
471
+ */
472
+ description: string;
473
+
474
+ /**
475
+ * The parameter name.
476
+ */
477
+ name: string;
478
+
479
+ type: 'string';
480
+
481
+ /**
482
+ * Allowed values for the parameter.
483
+ */
484
+ enum?: Array<string>;
485
+
486
+ /**
487
+ * Whether the parameter is required.
488
+ */
489
+ required?: boolean;
490
+ }
491
+
492
+ export interface Integer {
493
+ /**
494
+ * A description of the parameter.
495
+ */
496
+ description: string;
497
+
498
+ /**
499
+ * The parameter name.
500
+ */
501
+ name: string;
502
+
503
+ type: 'integer';
504
+
505
+ /**
506
+ * Whether the parameter is required.
507
+ */
508
+ required?: boolean;
509
+ }
510
+
511
+ export interface Number {
512
+ /**
513
+ * A description of the parameter.
514
+ */
515
+ description: string;
516
+
517
+ /**
518
+ * The parameter name.
519
+ */
520
+ name: string;
521
+
522
+ type: 'number';
523
+
524
+ /**
525
+ * Whether the parameter is required.
526
+ */
527
+ required?: boolean;
528
+ }
529
+
530
+ export interface Boolean {
531
+ /**
532
+ * A description of the parameter.
533
+ */
534
+ description: string;
535
+
536
+ /**
537
+ * The parameter name.
538
+ */
539
+ name: string;
540
+
541
+ type: 'boolean';
542
+
543
+ /**
544
+ * Whether the parameter is required.
545
+ */
546
+ required?: boolean;
547
+ }
548
+
549
+ export interface Array_ {
550
+ /**
551
+ * A description of the parameter.
552
+ */
553
+ description: string;
554
+
555
+ /**
556
+ * Item schema for array elements.
557
+ */
558
+ items: Array_.Items;
559
+
560
+ /**
561
+ * The parameter name.
562
+ */
563
+ name: string;
564
+
565
+ type: 'array';
566
+
567
+ /**
568
+ * Whether the parameter is required.
569
+ */
570
+ required?: boolean;
571
+ }
572
+
573
+ export namespace Array_ {
574
+ /**
575
+ * Item schema for array elements.
576
+ */
577
+ export interface Items {
578
+ /**
579
+ * The type of each element in the array.
580
+ */
581
+ type: 'string' | 'integer' | 'number' | 'boolean';
582
+ }
583
+ }
584
+
585
+ export interface Object {
586
+ /**
587
+ * A description of the parameter.
588
+ */
589
+ description: string;
590
+
591
+ /**
592
+ * The parameter name.
593
+ */
594
+ name: string;
595
+
596
+ /**
597
+ * The properties of the object.
598
+ */
599
+ properties: Array<unknown>;
600
+
601
+ type: 'object';
602
+
603
+ /**
604
+ * Whether the parameter is required.
605
+ */
606
+ required?: boolean;
607
+ }
608
+ }
255
609
  }
256
610
 
257
611
  export declare namespace RealtimeSessions {
@@ -9,7 +9,8 @@ import { path } from '../internal/utils/path';
9
9
 
10
10
  export class Voices extends APIResource {
11
11
  /**
12
- * Create a custom voice from a text description.
12
+ * Create a custom voice from a text description, or clone a voice from an audio
13
+ * sample.
13
14
  */
14
15
  create(body: VoiceCreateParams, options?: RequestOptions): APIPromise<VoiceCreateResponse> {
15
16
  return this._client.post('/v1/voices', { body, ...options });
@@ -283,7 +284,7 @@ export interface VoiceCreateParams {
283
284
  /**
284
285
  * The source configuration for creating the voice.
285
286
  */
286
- from: VoiceCreateParams.From;
287
+ from: VoiceCreateParams.Text | VoiceCreateParams.Audio;
287
288
 
288
289
  /**
289
290
  * A name for the voice.
@@ -300,11 +301,12 @@ export namespace VoiceCreateParams {
300
301
  /**
301
302
  * The source configuration for creating the voice.
302
303
  */
303
- export interface From {
304
+ export interface Text {
304
305
  /**
305
- * The voice design model to use.
306
+ * The voice design model to use. Prefer eleven_ttv_v3 (latest);
307
+ * eleven_multilingual_ttv_v2 is the previous generation.
306
308
  */
307
- model: 'eleven_multilingual_ttv_v2' | 'eleven_ttv_v3';
309
+ model: 'eleven_ttv_v3' | 'eleven_multilingual_ttv_v2';
308
310
 
309
311
  /**
310
312
  * A text description of the desired voice characteristics. Must be at least 20
@@ -314,15 +316,25 @@ export namespace VoiceCreateParams {
314
316
 
315
317
  type: 'text';
316
318
  }
319
+
320
+ export interface Audio {
321
+ /**
322
+ * A HTTPS URL.
323
+ */
324
+ audio: string;
325
+
326
+ type: 'audio';
327
+ }
317
328
  }
318
329
 
319
330
  export interface VoiceListParams extends CursorPageParams {}
320
331
 
321
332
  export interface VoicePreviewParams {
322
333
  /**
323
- * The voice design model to use.
334
+ * The voice design model to use. Prefer eleven_ttv_v3 (latest);
335
+ * eleven_multilingual_ttv_v2 is the previous generation.
324
336
  */
325
- model: 'eleven_multilingual_ttv_v2' | 'eleven_ttv_v3';
337
+ model: 'eleven_ttv_v3' | 'eleven_multilingual_ttv_v2';
326
338
 
327
339
  /**
328
340
  * A text description of the desired voice characteristics. Must be at least 20
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '3.17.0'; // x-release-please-version
1
+ export const VERSION = '3.19.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.17.0";
1
+ export declare const VERSION = "3.19.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.17.0";
1
+ export declare const VERSION = "3.19.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.17.0'; // x-release-please-version
4
+ exports.VERSION = '3.19.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.17.0'; // x-release-please-version
1
+ export const VERSION = '3.19.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map