@runapi.ai/gemini-omni 0.2.6 → 0.2.7

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.
package/README.md CHANGED
@@ -32,6 +32,8 @@ const video = await client.textToVideo.run({
32
32
  });
33
33
  ```
34
34
 
35
+ RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
36
+
35
37
  ## Links
36
38
 
37
39
  - Model page: https://runapi.ai/models/gemini-omni
package/dist/index.d.mts CHANGED
@@ -1,108 +1,240 @@
1
- import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, ClientOptions } from '@runapi.ai/core';
1
+ import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
2
2
  export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
3
 
4
+ /**
5
+ * One of 30 preset voice identities for audio creation.
6
+ * Each voice has a distinct pitch, cadence, and personality.
7
+ * Pass the chosen value to {@link CreateAudioParams.audio_id}.
8
+ */
4
9
  type GeminiOmniAudioVoice = 'achernar' | 'achird' | 'algenib' | 'algieba' | 'alnilam' | 'aoede' | 'autonoe' | 'callirrhoe' | 'charon' | 'despina' | 'enceladus' | 'erinome' | 'fenrir' | 'gacrux' | 'iapetus' | 'kore' | 'laomedeia' | 'leda' | 'orus' | 'puck' | 'pulcherrima' | 'rasalgethi' | 'sadachbia' | 'sadaltager' | 'schedar' | 'sulafat' | 'umbriel' | 'vindemiatrix' | 'zephyr' | 'zubenelgenubi';
10
+ /**
11
+ * Parameters for registering a reusable voice preset.
12
+ * The returned audio ID can be attached to characters or text-to-video params
13
+ * to control narration voice.
14
+ */
5
15
  interface CreateAudioParams {
16
+ /** Preset voice identity. See {@link GeminiOmniAudioVoice} for the full list. */
6
17
  audio_id: GeminiOmniAudioVoice | string;
18
+ /** Display name for the voice preset, max 210 characters. */
7
19
  name: string;
20
+ /** Describes vocal characteristics (pitch, tone, accent), max 20 000 characters. */
8
21
  voice_description?: string;
22
+ /** Example dialogue line demonstrating the voice style, max 120 characters. */
9
23
  example_dialogue?: string;
10
24
  }
25
+ /** A created voice preset with its server-assigned ID. */
11
26
  interface GeminiOmniAudio {
12
27
  id: string;
13
28
  name?: string;
14
29
  [key: string]: unknown;
15
30
  }
31
+ /** Result of a synchronous create-audio call. */
16
32
  interface CreateAudioResponse {
17
33
  id: string;
34
+ /** The created voice preset; present on success. */
18
35
  audio?: GeminiOmniAudio;
19
36
  error?: string;
20
37
  [key: string]: unknown;
21
38
  }
39
+ /**
40
+ * Parameters for building a reusable character from a reference image and description.
41
+ * The returned character ID can be passed to {@link TextToVideoParams.character_ids}
42
+ * for consistent identity across videos.
43
+ */
22
44
  interface CreateCharacterParams {
45
+ /** Appearance, identity, style, clothing, or personality description. */
23
46
  descriptions: string;
47
+ /** Character reference image URL, max 20 MB. */
24
48
  reference_image_url: string;
49
+ /** Audio IDs from create-audio to give the character a specific voice. */
25
50
  audio_ids?: string[];
51
+ /** Character display name, max 210 characters. */
26
52
  character_name?: string;
27
53
  }
54
+ /** URL to a generated or reference image. */
28
55
  interface ImageMetadata {
29
56
  url: string;
30
57
  [key: string]: unknown;
31
58
  }
59
+ /** A created character with its reference images. */
32
60
  interface GeminiOmniCharacter {
33
61
  id: string;
34
62
  name?: string;
63
+ /** Reference images associated with this character. */
35
64
  images?: ImageMetadata[];
36
65
  [key: string]: unknown;
37
66
  }
67
+ /** Result of a synchronous create-character call. */
38
68
  interface CreateCharacterResponse {
39
69
  id: string;
70
+ /** The created character; present on success. */
40
71
  character?: GeminiOmniCharacter;
41
72
  error?: string;
42
73
  [key: string]: unknown;
43
74
  }
75
+ /** Video duration in seconds. Longer durations consume more credits. */
44
76
  type GeminiOmniTextToVideoDuration = 4 | 6 | 8 | 10;
77
+ /** Output aspect ratio -- landscape (16:9) or portrait (9:16). */
45
78
  type GeminiOmniTextToVideoAspectRatio = '16:9' | '9:16';
79
+ /** Output resolution -- higher resolutions produce sharper video at higher cost. */
46
80
  type GeminiOmniTextToVideoResolution = '720p' | '1080p' | '4k';
81
+ /**
82
+ * A trimmed segment of a source video for use in text-to-video generation.
83
+ * The trimmed segment (start to ends) must be within 10 seconds.
84
+ * Each clip consumes 2 reference units toward the 7-unit limit.
85
+ */
47
86
  interface GeminiOmniTextToVideoClip {
87
+ /** Public source video URL. */
48
88
  url: string;
89
+ /** Trim start time in seconds (>= 0). */
49
90
  start: number;
91
+ /** Trim end time in seconds (must be > start, within 10 s of start). */
50
92
  ends: number;
51
93
  }
94
+ /**
95
+ * Parameters for multimodal video generation.
96
+ * Pre-create characters via `createCharacter` and audio voices via `createAudio`,
97
+ * then reference their IDs here.
98
+ *
99
+ * Reference units are shared: images (1 each) + video clips (2 each) + characters (1 each)
100
+ * must total 7 or fewer.
101
+ */
52
102
  interface TextToVideoParams {
103
+ /** Video generation prompt, max 20 000 characters. */
53
104
  prompt: string;
105
+ /** Output video duration in seconds. */
54
106
  duration_seconds: GeminiOmniTextToVideoDuration;
107
+ /** HTTPS callback URL for task completion notification. */
55
108
  callback_url?: string;
109
+ /** Reference image URLs, max 7. Each consumes 1 reference unit. */
56
110
  reference_image_urls?: string[];
111
+ /** Audio IDs from create-audio for narration voices, max 3. */
57
112
  audio_ids?: string[];
113
+ /** Source video clips for motion reference, max 1. Each consumes 2 reference units. */
58
114
  video_list?: GeminiOmniTextToVideoClip[];
115
+ /** Character IDs from create-character for consistent identity, max 3. Each consumes 1 reference unit. */
59
116
  character_ids?: string[];
60
117
  aspect_ratio?: GeminiOmniTextToVideoAspectRatio;
118
+ /** Defaults to 720p. */
61
119
  output_resolution?: GeminiOmniTextToVideoResolution;
120
+ /** Reproducibility seed in [0, 2 147 483 647]. */
62
121
  seed?: number;
63
122
  }
123
+ /** Acknowledgement returned by `create()` before the task starts processing. */
64
124
  interface TaskCreateResponse {
65
125
  id: string;
66
126
  status?: AsyncTaskStatus;
67
127
  }
128
+ /** URL to a generated video file. */
68
129
  interface VideoMetadata {
69
130
  url: string;
70
131
  }
132
+ /** Async text-to-video task result with lifecycle status. */
71
133
  interface TextToVideoResponse {
72
134
  id: string;
73
135
  status: AsyncTaskStatus;
136
+ /** Generated video files; populated once the task completes. */
74
137
  videos?: VideoMetadata[];
75
138
  error?: string;
76
139
  [key: string]: unknown;
77
140
  }
141
+ /** Narrowed response returned by `run()` once polling confirms completion. Videos are guaranteed present. */
78
142
  type CompletedTextToVideoResponse = TextToVideoResponse & {
79
143
  status: 'completed';
80
144
  videos: VideoMetadata[];
81
145
  };
82
146
 
147
+ /**
148
+ * Registers a reusable voice preset from a built-in voice identity.
149
+ * This is a synchronous operation -- only `run()` is available (no create/get polling).
150
+ */
83
151
  declare class CreateAudio {
84
152
  private readonly http;
85
153
  constructor(http: HttpClient);
154
+ /**
155
+ * Register a reusable voice preset (synchronous).
156
+ * @param params Voice preset parameters.
157
+ * @param options Per-request overrides.
158
+ * @returns The created audio voice preset.
159
+ */
86
160
  run(params: CreateAudioParams, options?: RequestOptions): Promise<CreateAudioResponse>;
87
161
  }
88
162
 
163
+ /**
164
+ * Builds a reusable character from a reference image and description.
165
+ * Attach audio IDs to give the character a specific voice.
166
+ * This is a synchronous operation -- only `run()` is available (no create/get polling).
167
+ */
89
168
  declare class CreateCharacter {
90
169
  private readonly http;
91
170
  constructor(http: HttpClient);
171
+ /**
172
+ * Build a reusable character (synchronous).
173
+ * @param params Character creation parameters.
174
+ * @param options Per-request overrides.
175
+ * @returns The created character.
176
+ */
92
177
  run(params: CreateCharacterParams, options?: RequestOptions): Promise<CreateCharacterResponse>;
93
178
  }
94
179
 
180
+ /**
181
+ * Generates video from a prompt with optional characters, audio voices, reference images, and video clips.
182
+ * This is an async operation -- use `run()` for automatic polling or `create()`/`get()` for manual control.
183
+ */
95
184
  declare class TextToVideo {
96
185
  private readonly http;
97
186
  constructor(http: HttpClient);
187
+ /**
188
+ * Generate a video and wait until complete.
189
+ * @param params Text-to-video parameters.
190
+ * @param options Per-request and polling overrides.
191
+ * @returns The completed text-to-video result.
192
+ */
98
193
  run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse>;
194
+ /**
195
+ * Create a text-to-video task; returns immediately with a task id.
196
+ * @param params Text-to-video parameters.
197
+ * @param options Per-request overrides.
198
+ * @returns The task creation result with id.
199
+ */
99
200
  create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
201
+ /**
202
+ * Fetch the current status of a text-to-video task.
203
+ * @param id The task id.
204
+ * @param options Per-request overrides.
205
+ * @returns The current text-to-video status.
206
+ */
100
207
  get(id: string, options?: RequestOptions): Promise<TextToVideoResponse>;
101
208
  }
102
209
 
103
- declare class GeminiOmniClient {
210
+ /**
211
+ * Gemini Omni multimodal generation client for voice presets, character creation,
212
+ * and text-to-video with optional characters, audio voices, and reference media.
213
+ *
214
+ * @example
215
+ * ```typescript
216
+ * import { GeminiOmniClient } from '@runapi.ai/gemini-omni';
217
+ * const client = new GeminiOmniClient({ apiKey: 'sk-...' });
218
+ *
219
+ * // Create a voice preset, then generate a video using it
220
+ * const audio = await client.createAudio.run({
221
+ * audio_id: 'zephyr',
222
+ * name: 'Narrator',
223
+ * });
224
+ * const video = await client.textToVideo.run({
225
+ * prompt: 'A narrator walks through a futuristic city',
226
+ * duration_seconds: 6,
227
+ * audio_ids: [audio.audio!.id],
228
+ * });
229
+ * console.log(video.videos[0].url);
230
+ * ```
231
+ */
232
+ declare class GeminiOmniClient extends BaseClient {
233
+ /** Registers a reusable voice preset from a built-in voice identity (synchronous). */
104
234
  readonly createAudio: CreateAudio;
235
+ /** Builds a reusable character from a reference image and description (synchronous). */
105
236
  readonly createCharacter: CreateCharacter;
237
+ /** Generates video from a prompt with optional characters, voices, images, and clips (async with polling). */
106
238
  readonly textToVideo: TextToVideo;
107
239
  constructor(options?: ClientOptions);
108
240
  }
package/dist/index.d.ts CHANGED
@@ -1,108 +1,240 @@
1
- import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, ClientOptions } from '@runapi.ai/core';
1
+ import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
2
2
  export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
3
 
4
+ /**
5
+ * One of 30 preset voice identities for audio creation.
6
+ * Each voice has a distinct pitch, cadence, and personality.
7
+ * Pass the chosen value to {@link CreateAudioParams.audio_id}.
8
+ */
4
9
  type GeminiOmniAudioVoice = 'achernar' | 'achird' | 'algenib' | 'algieba' | 'alnilam' | 'aoede' | 'autonoe' | 'callirrhoe' | 'charon' | 'despina' | 'enceladus' | 'erinome' | 'fenrir' | 'gacrux' | 'iapetus' | 'kore' | 'laomedeia' | 'leda' | 'orus' | 'puck' | 'pulcherrima' | 'rasalgethi' | 'sadachbia' | 'sadaltager' | 'schedar' | 'sulafat' | 'umbriel' | 'vindemiatrix' | 'zephyr' | 'zubenelgenubi';
10
+ /**
11
+ * Parameters for registering a reusable voice preset.
12
+ * The returned audio ID can be attached to characters or text-to-video params
13
+ * to control narration voice.
14
+ */
5
15
  interface CreateAudioParams {
16
+ /** Preset voice identity. See {@link GeminiOmniAudioVoice} for the full list. */
6
17
  audio_id: GeminiOmniAudioVoice | string;
18
+ /** Display name for the voice preset, max 210 characters. */
7
19
  name: string;
20
+ /** Describes vocal characteristics (pitch, tone, accent), max 20 000 characters. */
8
21
  voice_description?: string;
22
+ /** Example dialogue line demonstrating the voice style, max 120 characters. */
9
23
  example_dialogue?: string;
10
24
  }
25
+ /** A created voice preset with its server-assigned ID. */
11
26
  interface GeminiOmniAudio {
12
27
  id: string;
13
28
  name?: string;
14
29
  [key: string]: unknown;
15
30
  }
31
+ /** Result of a synchronous create-audio call. */
16
32
  interface CreateAudioResponse {
17
33
  id: string;
34
+ /** The created voice preset; present on success. */
18
35
  audio?: GeminiOmniAudio;
19
36
  error?: string;
20
37
  [key: string]: unknown;
21
38
  }
39
+ /**
40
+ * Parameters for building a reusable character from a reference image and description.
41
+ * The returned character ID can be passed to {@link TextToVideoParams.character_ids}
42
+ * for consistent identity across videos.
43
+ */
22
44
  interface CreateCharacterParams {
45
+ /** Appearance, identity, style, clothing, or personality description. */
23
46
  descriptions: string;
47
+ /** Character reference image URL, max 20 MB. */
24
48
  reference_image_url: string;
49
+ /** Audio IDs from create-audio to give the character a specific voice. */
25
50
  audio_ids?: string[];
51
+ /** Character display name, max 210 characters. */
26
52
  character_name?: string;
27
53
  }
54
+ /** URL to a generated or reference image. */
28
55
  interface ImageMetadata {
29
56
  url: string;
30
57
  [key: string]: unknown;
31
58
  }
59
+ /** A created character with its reference images. */
32
60
  interface GeminiOmniCharacter {
33
61
  id: string;
34
62
  name?: string;
63
+ /** Reference images associated with this character. */
35
64
  images?: ImageMetadata[];
36
65
  [key: string]: unknown;
37
66
  }
67
+ /** Result of a synchronous create-character call. */
38
68
  interface CreateCharacterResponse {
39
69
  id: string;
70
+ /** The created character; present on success. */
40
71
  character?: GeminiOmniCharacter;
41
72
  error?: string;
42
73
  [key: string]: unknown;
43
74
  }
75
+ /** Video duration in seconds. Longer durations consume more credits. */
44
76
  type GeminiOmniTextToVideoDuration = 4 | 6 | 8 | 10;
77
+ /** Output aspect ratio -- landscape (16:9) or portrait (9:16). */
45
78
  type GeminiOmniTextToVideoAspectRatio = '16:9' | '9:16';
79
+ /** Output resolution -- higher resolutions produce sharper video at higher cost. */
46
80
  type GeminiOmniTextToVideoResolution = '720p' | '1080p' | '4k';
81
+ /**
82
+ * A trimmed segment of a source video for use in text-to-video generation.
83
+ * The trimmed segment (start to ends) must be within 10 seconds.
84
+ * Each clip consumes 2 reference units toward the 7-unit limit.
85
+ */
47
86
  interface GeminiOmniTextToVideoClip {
87
+ /** Public source video URL. */
48
88
  url: string;
89
+ /** Trim start time in seconds (>= 0). */
49
90
  start: number;
91
+ /** Trim end time in seconds (must be > start, within 10 s of start). */
50
92
  ends: number;
51
93
  }
94
+ /**
95
+ * Parameters for multimodal video generation.
96
+ * Pre-create characters via `createCharacter` and audio voices via `createAudio`,
97
+ * then reference their IDs here.
98
+ *
99
+ * Reference units are shared: images (1 each) + video clips (2 each) + characters (1 each)
100
+ * must total 7 or fewer.
101
+ */
52
102
  interface TextToVideoParams {
103
+ /** Video generation prompt, max 20 000 characters. */
53
104
  prompt: string;
105
+ /** Output video duration in seconds. */
54
106
  duration_seconds: GeminiOmniTextToVideoDuration;
107
+ /** HTTPS callback URL for task completion notification. */
55
108
  callback_url?: string;
109
+ /** Reference image URLs, max 7. Each consumes 1 reference unit. */
56
110
  reference_image_urls?: string[];
111
+ /** Audio IDs from create-audio for narration voices, max 3. */
57
112
  audio_ids?: string[];
113
+ /** Source video clips for motion reference, max 1. Each consumes 2 reference units. */
58
114
  video_list?: GeminiOmniTextToVideoClip[];
115
+ /** Character IDs from create-character for consistent identity, max 3. Each consumes 1 reference unit. */
59
116
  character_ids?: string[];
60
117
  aspect_ratio?: GeminiOmniTextToVideoAspectRatio;
118
+ /** Defaults to 720p. */
61
119
  output_resolution?: GeminiOmniTextToVideoResolution;
120
+ /** Reproducibility seed in [0, 2 147 483 647]. */
62
121
  seed?: number;
63
122
  }
123
+ /** Acknowledgement returned by `create()` before the task starts processing. */
64
124
  interface TaskCreateResponse {
65
125
  id: string;
66
126
  status?: AsyncTaskStatus;
67
127
  }
128
+ /** URL to a generated video file. */
68
129
  interface VideoMetadata {
69
130
  url: string;
70
131
  }
132
+ /** Async text-to-video task result with lifecycle status. */
71
133
  interface TextToVideoResponse {
72
134
  id: string;
73
135
  status: AsyncTaskStatus;
136
+ /** Generated video files; populated once the task completes. */
74
137
  videos?: VideoMetadata[];
75
138
  error?: string;
76
139
  [key: string]: unknown;
77
140
  }
141
+ /** Narrowed response returned by `run()` once polling confirms completion. Videos are guaranteed present. */
78
142
  type CompletedTextToVideoResponse = TextToVideoResponse & {
79
143
  status: 'completed';
80
144
  videos: VideoMetadata[];
81
145
  };
82
146
 
147
+ /**
148
+ * Registers a reusable voice preset from a built-in voice identity.
149
+ * This is a synchronous operation -- only `run()` is available (no create/get polling).
150
+ */
83
151
  declare class CreateAudio {
84
152
  private readonly http;
85
153
  constructor(http: HttpClient);
154
+ /**
155
+ * Register a reusable voice preset (synchronous).
156
+ * @param params Voice preset parameters.
157
+ * @param options Per-request overrides.
158
+ * @returns The created audio voice preset.
159
+ */
86
160
  run(params: CreateAudioParams, options?: RequestOptions): Promise<CreateAudioResponse>;
87
161
  }
88
162
 
163
+ /**
164
+ * Builds a reusable character from a reference image and description.
165
+ * Attach audio IDs to give the character a specific voice.
166
+ * This is a synchronous operation -- only `run()` is available (no create/get polling).
167
+ */
89
168
  declare class CreateCharacter {
90
169
  private readonly http;
91
170
  constructor(http: HttpClient);
171
+ /**
172
+ * Build a reusable character (synchronous).
173
+ * @param params Character creation parameters.
174
+ * @param options Per-request overrides.
175
+ * @returns The created character.
176
+ */
92
177
  run(params: CreateCharacterParams, options?: RequestOptions): Promise<CreateCharacterResponse>;
93
178
  }
94
179
 
180
+ /**
181
+ * Generates video from a prompt with optional characters, audio voices, reference images, and video clips.
182
+ * This is an async operation -- use `run()` for automatic polling or `create()`/`get()` for manual control.
183
+ */
95
184
  declare class TextToVideo {
96
185
  private readonly http;
97
186
  constructor(http: HttpClient);
187
+ /**
188
+ * Generate a video and wait until complete.
189
+ * @param params Text-to-video parameters.
190
+ * @param options Per-request and polling overrides.
191
+ * @returns The completed text-to-video result.
192
+ */
98
193
  run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse>;
194
+ /**
195
+ * Create a text-to-video task; returns immediately with a task id.
196
+ * @param params Text-to-video parameters.
197
+ * @param options Per-request overrides.
198
+ * @returns The task creation result with id.
199
+ */
99
200
  create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
201
+ /**
202
+ * Fetch the current status of a text-to-video task.
203
+ * @param id The task id.
204
+ * @param options Per-request overrides.
205
+ * @returns The current text-to-video status.
206
+ */
100
207
  get(id: string, options?: RequestOptions): Promise<TextToVideoResponse>;
101
208
  }
102
209
 
103
- declare class GeminiOmniClient {
210
+ /**
211
+ * Gemini Omni multimodal generation client for voice presets, character creation,
212
+ * and text-to-video with optional characters, audio voices, and reference media.
213
+ *
214
+ * @example
215
+ * ```typescript
216
+ * import { GeminiOmniClient } from '@runapi.ai/gemini-omni';
217
+ * const client = new GeminiOmniClient({ apiKey: 'sk-...' });
218
+ *
219
+ * // Create a voice preset, then generate a video using it
220
+ * const audio = await client.createAudio.run({
221
+ * audio_id: 'zephyr',
222
+ * name: 'Narrator',
223
+ * });
224
+ * const video = await client.textToVideo.run({
225
+ * prompt: 'A narrator walks through a futuristic city',
226
+ * duration_seconds: 6,
227
+ * audio_ids: [audio.audio!.id],
228
+ * });
229
+ * console.log(video.videos[0].url);
230
+ * ```
231
+ */
232
+ declare class GeminiOmniClient extends BaseClient {
233
+ /** Registers a reusable voice preset from a built-in voice identity (synchronous). */
104
234
  readonly createAudio: CreateAudio;
235
+ /** Builds a reusable character from a reference image and description (synchronous). */
105
236
  readonly createCharacter: CreateCharacter;
237
+ /** Generates video from a prompt with optional characters, voices, images, and clips (async with polling). */
106
238
  readonly textToVideo: TextToVideo;
107
239
  constructor(options?: ClientOptions);
108
240
  }
package/dist/index.js CHANGED
@@ -44,6 +44,12 @@ var CreateAudio = class {
44
44
  this.http = http;
45
45
  }
46
46
  http;
47
+ /**
48
+ * Register a reusable voice preset (synchronous).
49
+ * @param params Voice preset parameters.
50
+ * @param options Per-request overrides.
51
+ * @returns The created audio voice preset.
52
+ */
47
53
  async run(params, options) {
48
54
  return this.http.request("POST", ENDPOINT, {
49
55
  body: (0, import_core.compactParams)(params),
@@ -60,6 +66,12 @@ var CreateCharacter = class {
60
66
  this.http = http;
61
67
  }
62
68
  http;
69
+ /**
70
+ * Build a reusable character (synchronous).
71
+ * @param params Character creation parameters.
72
+ * @param options Per-request overrides.
73
+ * @returns The created character.
74
+ */
63
75
  async run(params, options) {
64
76
  return this.http.request("POST", ENDPOINT2, {
65
77
  body: (0, import_core2.compactParams)(params),
@@ -77,6 +89,12 @@ var TextToVideo = class {
77
89
  this.http = http;
78
90
  }
79
91
  http;
92
+ /**
93
+ * Generate a video and wait until complete.
94
+ * @param params Text-to-video parameters.
95
+ * @param options Per-request and polling overrides.
96
+ * @returns The completed text-to-video result.
97
+ */
80
98
  async run(params, options) {
81
99
  const { id } = await this.create(params, options);
82
100
  const response = await (0, import_internal.pollUntilComplete)(() => this.get(id, options), {
@@ -85,12 +103,24 @@ var TextToVideo = class {
85
103
  });
86
104
  return response;
87
105
  }
106
+ /**
107
+ * Create a text-to-video task; returns immediately with a task id.
108
+ * @param params Text-to-video parameters.
109
+ * @param options Per-request overrides.
110
+ * @returns The task creation result with id.
111
+ */
88
112
  async create(params, options) {
89
113
  return this.http.request("POST", ENDPOINT3, {
90
114
  body: (0, import_core3.compactParams)(params),
91
115
  ...options
92
116
  });
93
117
  }
118
+ /**
119
+ * Fetch the current status of a text-to-video task.
120
+ * @param id The task id.
121
+ * @param options Per-request overrides.
122
+ * @returns The current text-to-video status.
123
+ */
94
124
  async get(id, options) {
95
125
  return this.http.request("GET", `${ENDPOINT3}/${id}`, {
96
126
  ...options
@@ -99,15 +129,18 @@ var TextToVideo = class {
99
129
  };
100
130
 
101
131
  // src/client.ts
102
- var GeminiOmniClient = class {
132
+ var GeminiOmniClient = class extends import_core4.BaseClient {
133
+ /** Registers a reusable voice preset from a built-in voice identity (synchronous). */
103
134
  createAudio;
135
+ /** Builds a reusable character from a reference image and description (synchronous). */
104
136
  createCharacter;
137
+ /** Generates video from a prompt with optional characters, voices, images, and clips (async with polling). */
105
138
  textToVideo;
106
139
  constructor(options = {}) {
107
- const http = (0, import_core4.createHttpClient)(options);
108
- this.createAudio = new CreateAudio(http);
109
- this.createCharacter = new CreateCharacter(http);
110
- this.textToVideo = new TextToVideo(http);
140
+ super(options);
141
+ this.createAudio = new CreateAudio(this.http);
142
+ this.createCharacter = new CreateCharacter(this.http);
143
+ this.textToVideo = new TextToVideo(this.http);
111
144
  }
112
145
  };
113
146
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/create-audio.ts","../src/resources/create-character.ts","../src/resources/text-to-video.ts"],"sourcesContent":["export { GeminiOmniClient } from './client';\nexport * from './types';\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n} from '@runapi.ai/core';\n","import { createHttpClient, type ClientOptions } from '@runapi.ai/core';\nimport { CreateAudio } from './resources/create-audio';\nimport { CreateCharacter } from './resources/create-character';\nimport { TextToVideo } from './resources/text-to-video';\n\nexport class GeminiOmniClient {\n public readonly createAudio: CreateAudio;\n public readonly createCharacter: CreateCharacter;\n public readonly textToVideo: TextToVideo;\n\n constructor(options: ClientOptions = {}) {\n const http = createHttpClient(options);\n this.createAudio = new CreateAudio(http);\n this.createCharacter = new CreateCharacter(http);\n this.textToVideo = new TextToVideo(http);\n }\n}\n","import type { HttpClient, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport type { CreateAudioParams, CreateAudioResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_audio';\n\nexport class CreateAudio {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: CreateAudioParams, options?: RequestOptions): Promise<CreateAudioResponse> {\n return this.http.request<CreateAudioResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport type { CreateCharacterParams, CreateCharacterResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_character';\n\nexport class CreateCharacter {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: CreateCharacterParams, options?: RequestOptions): Promise<CreateCharacterResponse> {\n return this.http.request<CreateCharacterResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/text_to_video';\n\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,eAAqD;;;ACCrD,kBAA8B;AAG9B,IAAM,WAAW;AAEV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA2B,SAAwD;AAC3F,WAAO,KAAK,KAAK,QAA6B,QAAQ,UAAU;AAAA,MAC9D,UAAM,2BAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ACdA,IAAAC,eAA8B;AAG9B,IAAMC,YAAW;AAEV,IAAM,kBAAN,MAAsB;AAAA,EAC3B,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA+B,SAA4D;AACnG,WAAO,KAAK,KAAK,QAAiC,QAAQA,WAAU;AAAA,MAClE,UAAM,4BAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ACdA,IAAAC,eAA8B;AAC9B,sBAAkC;AAQlC,IAAMC,YAAW;AAEV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA2B,SAAkF;AACrH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,UAAM,mCAAuC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACzF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAO,QAA2B,SAAuD;AAC7F,WAAO,KAAK,KAAK,QAA4B,QAAQA,WAAU;AAAA,MAC7D,UAAM,4BAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAAwD;AAC5E,WAAO,KAAK,KAAK,QAA6B,OAAO,GAAGA,SAAQ,IAAI,EAAE,IAAI;AAAA,MACxE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;AH/BO,IAAM,mBAAN,MAAuB;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,WAAO,+BAAiB,OAAO;AACrC,SAAK,cAAc,IAAI,YAAY,IAAI;AACvC,SAAK,kBAAkB,IAAI,gBAAgB,IAAI;AAC/C,SAAK,cAAc,IAAI,YAAY,IAAI;AAAA,EACzC;AACF;;;ADdA,IAAAC,eAUO;","names":["import_core","import_core","ENDPOINT","import_core","ENDPOINT","import_core"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/create-audio.ts","../src/resources/create-character.ts","../src/resources/text-to-video.ts"],"sourcesContent":["export { GeminiOmniClient } from './client';\nexport * from './types';\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n} from '@runapi.ai/core';\n","import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { CreateAudio } from './resources/create-audio';\nimport { CreateCharacter } from './resources/create-character';\nimport { TextToVideo } from './resources/text-to-video';\n\n/**\n * Gemini Omni multimodal generation client for voice presets, character creation,\n * and text-to-video with optional characters, audio voices, and reference media.\n *\n * @example\n * ```typescript\n * import { GeminiOmniClient } from '@runapi.ai/gemini-omni';\n * const client = new GeminiOmniClient({ apiKey: 'sk-...' });\n *\n * // Create a voice preset, then generate a video using it\n * const audio = await client.createAudio.run({\n * audio_id: 'zephyr',\n * name: 'Narrator',\n * });\n * const video = await client.textToVideo.run({\n * prompt: 'A narrator walks through a futuristic city',\n * duration_seconds: 6,\n * audio_ids: [audio.audio!.id],\n * });\n * console.log(video.videos[0].url);\n * ```\n */\nexport class GeminiOmniClient extends BaseClient {\n /** Registers a reusable voice preset from a built-in voice identity (synchronous). */\n public readonly createAudio: CreateAudio;\n /** Builds a reusable character from a reference image and description (synchronous). */\n public readonly createCharacter: CreateCharacter;\n /** Generates video from a prompt with optional characters, voices, images, and clips (async with polling). */\n public readonly textToVideo: TextToVideo;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.createAudio = new CreateAudio(this.http);\n this.createCharacter = new CreateCharacter(this.http);\n this.textToVideo = new TextToVideo(this.http);\n }\n}\n","import type { HttpClient, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport type { CreateAudioParams, CreateAudioResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_audio';\n\n/**\n * Registers a reusable voice preset from a built-in voice identity.\n * This is a synchronous operation -- only `run()` is available (no create/get polling).\n */\nexport class CreateAudio {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Register a reusable voice preset (synchronous).\n * @param params Voice preset parameters.\n * @param options Per-request overrides.\n * @returns The created audio voice preset.\n */\n async run(params: CreateAudioParams, options?: RequestOptions): Promise<CreateAudioResponse> {\n return this.http.request<CreateAudioResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport type { CreateCharacterParams, CreateCharacterResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_character';\n\n/**\n * Builds a reusable character from a reference image and description.\n * Attach audio IDs to give the character a specific voice.\n * This is a synchronous operation -- only `run()` is available (no create/get polling).\n */\nexport class CreateCharacter {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Build a reusable character (synchronous).\n * @param params Character creation parameters.\n * @param options Per-request overrides.\n * @returns The created character.\n */\n async run(params: CreateCharacterParams, options?: RequestOptions): Promise<CreateCharacterResponse> {\n return this.http.request<CreateCharacterResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/text_to_video';\n\n/**\n * Generates video from a prompt with optional characters, audio voices, reference images, and video clips.\n * This is an async operation -- use `run()` for automatic polling or `create()`/`get()` for manual control.\n */\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate a video and wait until complete.\n * @param params Text-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed text-to-video result.\n */\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n /**\n * Create a text-to-video task; returns immediately with a task id.\n * @param params Text-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n /**\n * Fetch the current status of a text-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text-to-video status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,eAA+C;;;ACC/C,kBAA8B;AAG9B,IAAM,WAAW;AAMV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7B,MAAM,IAAI,QAA2B,SAAwD;AAC3F,WAAO,KAAK,KAAK,QAA6B,QAAQ,UAAU;AAAA,MAC9D,UAAM,2BAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ACxBA,IAAAC,eAA8B;AAG9B,IAAMC,YAAW;AAOV,IAAM,kBAAN,MAAsB;AAAA,EAC3B,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7B,MAAM,IAAI,QAA+B,SAA4D;AACnG,WAAO,KAAK,KAAK,QAAiC,QAAQA,WAAU;AAAA,MAClE,UAAM,4BAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ACzBA,IAAAC,eAA8B;AAC9B,sBAAkC;AAQlC,IAAMC,YAAW;AAMV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7B,MAAM,IAAI,QAA2B,SAAkF;AACrH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,UAAM,mCAAuC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACzF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,OAAO,QAA2B,SAAuD;AAC7F,WAAO,KAAK,KAAK,QAA4B,QAAQA,WAAU;AAAA,MAC7D,UAAM,4BAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,IAAI,IAAY,SAAwD;AAC5E,WAAO,KAAK,KAAK,QAA6B,OAAO,GAAGA,SAAQ,IAAI,EAAE,IAAI;AAAA,MACxE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;AH/BO,IAAM,mBAAN,cAA+B,wBAAW;AAAA;AAAA,EAE/B;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAC5C,SAAK,kBAAkB,IAAI,gBAAgB,KAAK,IAAI;AACpD,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAAA,EAC9C;AACF;;;ADvCA,IAAAC,eAUO;","names":["import_core","import_core","ENDPOINT","import_core","ENDPOINT","import_core"]}
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/client.ts
2
- import { createHttpClient } from "@runapi.ai/core";
2
+ import { BaseClient } from "@runapi.ai/core";
3
3
 
4
4
  // src/resources/create-audio.ts
5
5
  import { compactParams } from "@runapi.ai/core";
@@ -9,6 +9,12 @@ var CreateAudio = class {
9
9
  this.http = http;
10
10
  }
11
11
  http;
12
+ /**
13
+ * Register a reusable voice preset (synchronous).
14
+ * @param params Voice preset parameters.
15
+ * @param options Per-request overrides.
16
+ * @returns The created audio voice preset.
17
+ */
12
18
  async run(params, options) {
13
19
  return this.http.request("POST", ENDPOINT, {
14
20
  body: compactParams(params),
@@ -25,6 +31,12 @@ var CreateCharacter = class {
25
31
  this.http = http;
26
32
  }
27
33
  http;
34
+ /**
35
+ * Build a reusable character (synchronous).
36
+ * @param params Character creation parameters.
37
+ * @param options Per-request overrides.
38
+ * @returns The created character.
39
+ */
28
40
  async run(params, options) {
29
41
  return this.http.request("POST", ENDPOINT2, {
30
42
  body: compactParams2(params),
@@ -42,6 +54,12 @@ var TextToVideo = class {
42
54
  this.http = http;
43
55
  }
44
56
  http;
57
+ /**
58
+ * Generate a video and wait until complete.
59
+ * @param params Text-to-video parameters.
60
+ * @param options Per-request and polling overrides.
61
+ * @returns The completed text-to-video result.
62
+ */
45
63
  async run(params, options) {
46
64
  const { id } = await this.create(params, options);
47
65
  const response = await pollUntilComplete(() => this.get(id, options), {
@@ -50,12 +68,24 @@ var TextToVideo = class {
50
68
  });
51
69
  return response;
52
70
  }
71
+ /**
72
+ * Create a text-to-video task; returns immediately with a task id.
73
+ * @param params Text-to-video parameters.
74
+ * @param options Per-request overrides.
75
+ * @returns The task creation result with id.
76
+ */
53
77
  async create(params, options) {
54
78
  return this.http.request("POST", ENDPOINT3, {
55
79
  body: compactParams3(params),
56
80
  ...options
57
81
  });
58
82
  }
83
+ /**
84
+ * Fetch the current status of a text-to-video task.
85
+ * @param id The task id.
86
+ * @param options Per-request overrides.
87
+ * @returns The current text-to-video status.
88
+ */
59
89
  async get(id, options) {
60
90
  return this.http.request("GET", `${ENDPOINT3}/${id}`, {
61
91
  ...options
@@ -64,15 +94,18 @@ var TextToVideo = class {
64
94
  };
65
95
 
66
96
  // src/client.ts
67
- var GeminiOmniClient = class {
97
+ var GeminiOmniClient = class extends BaseClient {
98
+ /** Registers a reusable voice preset from a built-in voice identity (synchronous). */
68
99
  createAudio;
100
+ /** Builds a reusable character from a reference image and description (synchronous). */
69
101
  createCharacter;
102
+ /** Generates video from a prompt with optional characters, voices, images, and clips (async with polling). */
70
103
  textToVideo;
71
104
  constructor(options = {}) {
72
- const http = createHttpClient(options);
73
- this.createAudio = new CreateAudio(http);
74
- this.createCharacter = new CreateCharacter(http);
75
- this.textToVideo = new TextToVideo(http);
105
+ super(options);
106
+ this.createAudio = new CreateAudio(this.http);
107
+ this.createCharacter = new CreateCharacter(this.http);
108
+ this.textToVideo = new TextToVideo(this.http);
76
109
  }
77
110
  };
78
111
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client.ts","../src/resources/create-audio.ts","../src/resources/create-character.ts","../src/resources/text-to-video.ts","../src/index.ts"],"sourcesContent":["import { createHttpClient, type ClientOptions } from '@runapi.ai/core';\nimport { CreateAudio } from './resources/create-audio';\nimport { CreateCharacter } from './resources/create-character';\nimport { TextToVideo } from './resources/text-to-video';\n\nexport class GeminiOmniClient {\n public readonly createAudio: CreateAudio;\n public readonly createCharacter: CreateCharacter;\n public readonly textToVideo: TextToVideo;\n\n constructor(options: ClientOptions = {}) {\n const http = createHttpClient(options);\n this.createAudio = new CreateAudio(http);\n this.createCharacter = new CreateCharacter(http);\n this.textToVideo = new TextToVideo(http);\n }\n}\n","import type { HttpClient, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport type { CreateAudioParams, CreateAudioResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_audio';\n\nexport class CreateAudio {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: CreateAudioParams, options?: RequestOptions): Promise<CreateAudioResponse> {\n return this.http.request<CreateAudioResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport type { CreateCharacterParams, CreateCharacterResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_character';\n\nexport class CreateCharacter {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: CreateCharacterParams, options?: RequestOptions): Promise<CreateCharacterResponse> {\n return this.http.request<CreateCharacterResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/text_to_video';\n\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export { GeminiOmniClient } from './client';\nexport * from './types';\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n} from '@runapi.ai/core';\n"],"mappings":";AAAA,SAAS,wBAA4C;;;ACCrD,SAAS,qBAAqB;AAG9B,IAAM,WAAW;AAEV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA2B,SAAwD;AAC3F,WAAO,KAAK,KAAK,QAA6B,QAAQ,UAAU;AAAA,MAC9D,MAAM,cAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ACdA,SAAS,iBAAAA,sBAAqB;AAG9B,IAAMC,YAAW;AAEV,IAAM,kBAAN,MAAsB;AAAA,EAC3B,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA+B,SAA4D;AACnG,WAAO,KAAK,KAAK,QAAiC,QAAQA,WAAU;AAAA,MAClE,MAAMD,eAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ACdA,SAAS,iBAAAE,sBAAqB;AAC9B,SAAS,yBAAyB;AAQlC,IAAMC,YAAW;AAEV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAA2B,SAAkF;AACrH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,MAAM,kBAAuC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACzF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAO,QAA2B,SAAuD;AAC7F,WAAO,KAAK,KAAK,QAA4B,QAAQA,WAAU;AAAA,MAC7D,MAAMD,eAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAAwD;AAC5E,WAAO,KAAK,KAAK,QAA6B,OAAO,GAAGC,SAAQ,IAAI,EAAE,IAAI;AAAA,MACxE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;AH/BO,IAAM,mBAAN,MAAuB;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO,iBAAiB,OAAO;AACrC,SAAK,cAAc,IAAI,YAAY,IAAI;AACvC,SAAK,kBAAkB,IAAI,gBAAgB,IAAI;AAC/C,SAAK,cAAc,IAAI,YAAY,IAAI;AAAA,EACzC;AACF;;;AIdA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["compactParams","ENDPOINT","compactParams","ENDPOINT"]}
1
+ {"version":3,"sources":["../src/client.ts","../src/resources/create-audio.ts","../src/resources/create-character.ts","../src/resources/text-to-video.ts","../src/index.ts"],"sourcesContent":["import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { CreateAudio } from './resources/create-audio';\nimport { CreateCharacter } from './resources/create-character';\nimport { TextToVideo } from './resources/text-to-video';\n\n/**\n * Gemini Omni multimodal generation client for voice presets, character creation,\n * and text-to-video with optional characters, audio voices, and reference media.\n *\n * @example\n * ```typescript\n * import { GeminiOmniClient } from '@runapi.ai/gemini-omni';\n * const client = new GeminiOmniClient({ apiKey: 'sk-...' });\n *\n * // Create a voice preset, then generate a video using it\n * const audio = await client.createAudio.run({\n * audio_id: 'zephyr',\n * name: 'Narrator',\n * });\n * const video = await client.textToVideo.run({\n * prompt: 'A narrator walks through a futuristic city',\n * duration_seconds: 6,\n * audio_ids: [audio.audio!.id],\n * });\n * console.log(video.videos[0].url);\n * ```\n */\nexport class GeminiOmniClient extends BaseClient {\n /** Registers a reusable voice preset from a built-in voice identity (synchronous). */\n public readonly createAudio: CreateAudio;\n /** Builds a reusable character from a reference image and description (synchronous). */\n public readonly createCharacter: CreateCharacter;\n /** Generates video from a prompt with optional characters, voices, images, and clips (async with polling). */\n public readonly textToVideo: TextToVideo;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.createAudio = new CreateAudio(this.http);\n this.createCharacter = new CreateCharacter(this.http);\n this.textToVideo = new TextToVideo(this.http);\n }\n}\n","import type { HttpClient, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport type { CreateAudioParams, CreateAudioResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_audio';\n\n/**\n * Registers a reusable voice preset from a built-in voice identity.\n * This is a synchronous operation -- only `run()` is available (no create/get polling).\n */\nexport class CreateAudio {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Register a reusable voice preset (synchronous).\n * @param params Voice preset parameters.\n * @param options Per-request overrides.\n * @returns The created audio voice preset.\n */\n async run(params: CreateAudioParams, options?: RequestOptions): Promise<CreateAudioResponse> {\n return this.http.request<CreateAudioResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport type { CreateCharacterParams, CreateCharacterResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_character';\n\n/**\n * Builds a reusable character from a reference image and description.\n * Attach audio IDs to give the character a specific voice.\n * This is a synchronous operation -- only `run()` is available (no create/get polling).\n */\nexport class CreateCharacter {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Build a reusable character (synchronous).\n * @param params Character creation parameters.\n * @param options Per-request overrides.\n * @returns The created character.\n */\n async run(params: CreateCharacterParams, options?: RequestOptions): Promise<CreateCharacterResponse> {\n return this.http.request<CreateCharacterResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/text_to_video';\n\n/**\n * Generates video from a prompt with optional characters, audio voices, reference images, and video clips.\n * This is an async operation -- use `run()` for automatic polling or `create()`/`get()` for manual control.\n */\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate a video and wait until complete.\n * @param params Text-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed text-to-video result.\n */\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n /**\n * Create a text-to-video task; returns immediately with a task id.\n * @param params Text-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n /**\n * Fetch the current status of a text-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text-to-video status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export { GeminiOmniClient } from './client';\nexport * from './types';\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n} from '@runapi.ai/core';\n"],"mappings":";AAAA,SAAS,kBAAsC;;;ACC/C,SAAS,qBAAqB;AAG9B,IAAM,WAAW;AAMV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7B,MAAM,IAAI,QAA2B,SAAwD;AAC3F,WAAO,KAAK,KAAK,QAA6B,QAAQ,UAAU;AAAA,MAC9D,MAAM,cAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ACxBA,SAAS,iBAAAA,sBAAqB;AAG9B,IAAMC,YAAW;AAOV,IAAM,kBAAN,MAAsB;AAAA,EAC3B,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7B,MAAM,IAAI,QAA+B,SAA4D;AACnG,WAAO,KAAK,KAAK,QAAiC,QAAQA,WAAU;AAAA,MAClE,MAAMD,eAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;ACzBA,SAAS,iBAAAE,sBAAqB;AAC9B,SAAS,yBAAyB;AAQlC,IAAMC,YAAW;AAMV,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7B,MAAM,IAAI,QAA2B,SAAkF;AACrH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,MAAM,kBAAuC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACzF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,OAAO,QAA2B,SAAuD;AAC7F,WAAO,KAAK,KAAK,QAA4B,QAAQA,WAAU;AAAA,MAC7D,MAAMD,eAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,IAAI,IAAY,SAAwD;AAC5E,WAAO,KAAK,KAAK,QAA6B,OAAO,GAAGC,SAAQ,IAAI,EAAE,IAAI;AAAA,MACxE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;AH/BO,IAAM,mBAAN,cAA+B,WAAW;AAAA;AAAA,EAE/B;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAC5C,SAAK,kBAAkB,IAAI,gBAAgB,KAAK,IAAI;AACpD,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAAA,EAC9C;AACF;;;AIvCA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["compactParams","ENDPOINT","compactParams","ENDPOINT"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runapi.ai/gemini-omni",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "RunAPI Gemini Omni SDK for audio, character, and video workflows in JavaScript, Ruby, and Go",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -28,7 +28,7 @@
28
28
  "clean": "rm -rf dist"
29
29
  },
30
30
  "dependencies": {
31
- "@runapi.ai/core": "^0.2.5"
31
+ "@runapi.ai/core": "^0.2.6"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^20.0.0",
@@ -68,6 +68,11 @@ runapi wait <task-id> --service gemini-omni --action text-to-video
68
68
  - Provider comparison: https://runapi.ai/providers/google
69
69
  - Browse all RunAPI models and skills: https://runapi.ai/models
70
70
 
71
+ ## Agent rules
72
+
73
+ - Integration work uses the target language SDK; one-off generation, manual smoke tests, debugging, or user-requested CLI runs use the RunAPI CLI skill: https://github.com/runapi-ai/cli-skill
74
+ - RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
75
+
71
76
  ## License
72
77
 
73
78
  Licensed under the Apache License, Version 2.0.
@@ -25,10 +25,19 @@ metadata:
25
25
 
26
26
  Create Gemini Omni voice resources, character resources, and text-to-video tasks through RunAPI. The default path for one-off agent tasks is the `runapi` CLI; SDKs are for application integration.
27
27
 
28
- ## Routing decision
28
+ ## Critical: Integration Runtime
29
29
 
30
- - One-off voice, character, or video generation for the user use the **CLI path** with the `runapi` binary.
31
- - Building an app, backend, worker, library, or production codebase use the **SDK integration path**.
30
+ - Integration work (app, backend, worker, library, Rails service, Node service, Go service, webhook pipeline, or production codebase) uses the **SDK integration path** for the target language.
31
+ - One-off generation, editing, transformation, manual smoke tests, debugging, or user-requested CLI runs use the **CLI path** with the `runapi` binary. For full CLI-specific agent guidance, see https://github.com/runapi-ai/cli-skill.
32
+ - Never shell out to the `runapi` CLI as the production runtime integration layer.
33
+
34
+ ## SDK integration path
35
+
36
+ When integrating Gemini Omni into an app, backend, worker, library, Rails service, Node service, Go service, webhook pipeline, or production workflow, start by checking the current SDK package and official usage. Confirm install commands, client methods (`create`, `get`, `run`), request fields, response shape, and error classes before using CLI help or raw HTTP examples. Use a RunAPI SDK package:
37
+
38
+ - JavaScript / TypeScript: `@runapi.ai/gemini-omni`
39
+ - Ruby: `runapi-gemini-omni`
40
+ - Go: `github.com/runapi-ai/gemini-omni-sdk/go`
32
41
 
33
42
  ## Variants
34
43
 
@@ -38,7 +47,7 @@ Create Gemini Omni voice resources, character resources, and text-to-video tasks
38
47
 
39
48
  ## CLI path
40
49
 
41
- The `runapi` binary is the runtime dependency. Run `runapi auth status` first. For agents and headless runs, prefer `RUNAPI_API_KEY` or import it into saved config.
50
+ The `runapi` binary is the one-off and manual testing runtime dependency. For full CLI-specific agent guidance, see https://github.com/runapi-ai/cli-skill. Run `runapi auth status` first. For agents and headless runs, prefer `RUNAPI_API_KEY` or import it into saved config.
42
51
 
43
52
  Inspect the available commands and request fields with CLI help:
44
53
 
@@ -64,13 +73,9 @@ runapi wait <task-id> --service gemini-omni --action text-to-video
64
73
 
65
74
  Available commands: `create-audio`, `create-character`, `text-to-video`.
66
75
 
67
- ## SDK integration path
68
-
69
- When integrating Gemini Omni into an app, backend, worker, or library — not for one-off tasks — use a RunAPI SDK package:
76
+ ## Generated file storage
70
77
 
71
- - JavaScript / TypeScript: `@runapi.ai/gemini-omni`
72
- - Ruby: `runapi-gemini-omni`
73
- - Go: `github.com/runapi-ai/gemini-omni-sdk/go`
78
+ RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
74
79
 
75
80
  ## References
76
81