@runapi.ai/gemini-omni 0.2.7 → 0.3.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.
- package/README.md +8 -8
- package/dist/index.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +127 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +130 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -5
- package/skills/gemini-omni/README.md +2 -2
- package/skills/gemini-omni/SKILL.md +15 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Gemini Omni
|
|
1
|
+
# Gemini Omni JavaScript SDK for RunAPI
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The Gemini Omni JavaScript SDK is the language-specific package for Gemini Omni on RunAPI. Use this package for voice resources, character resources, and multimodal video generation workflows when your application needs request bodies, task status lookup, and consistent RunAPI errors in JavaScript.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -21,14 +21,14 @@ const voice = await client.createAudio.run({
|
|
|
21
21
|
|
|
22
22
|
const character = await client.createCharacter.run({
|
|
23
23
|
descriptions: 'A silver-haired cyberpunk guide',
|
|
24
|
-
|
|
24
|
+
reference_image_url: 'https://cdn.runapi.ai/public/samples/reference-1.jpg',
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
const video = await client.textToVideo.run({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
model: 'gemini-omni-flash-preview',
|
|
29
|
+
prompt: 'A paper airplane glides through a sunlit studio.',
|
|
30
|
+
aspect_ratio: '16:9',
|
|
31
|
+
output_resolution: '720p',
|
|
32
32
|
});
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -39,7 +39,7 @@ RunAPI-generated file URLs are temporary. Download and store generated images, v
|
|
|
39
39
|
- Model page: https://runapi.ai/models/gemini-omni
|
|
40
40
|
- SDK docs: https://runapi.ai/docs#sdk-gemini-omni
|
|
41
41
|
- Product docs: https://runapi.ai/docs#gemini-omni
|
|
42
|
-
-
|
|
42
|
+
- Flash Preview pricing and rate limits: https://runapi.ai/models/gemini-omni/flash-preview
|
|
43
43
|
- Provider comparison: https://runapi.ai/providers/google
|
|
44
44
|
- Full catalog: https://runapi.ai/models
|
|
45
45
|
|
package/dist/index.d.mts
CHANGED
|
@@ -74,6 +74,8 @@ interface CreateCharacterResponse {
|
|
|
74
74
|
}
|
|
75
75
|
/** Video duration in seconds. Longer durations consume more credits. */
|
|
76
76
|
type GeminiOmniTextToVideoDuration = 4 | 6 | 8 | 10;
|
|
77
|
+
/** Gemini Omni model exposed by the text-to-video endpoint. */
|
|
78
|
+
type GeminiOmniTextToVideoModel = 'gemini-omni-flash-preview' | 'gemini-omni-text-to-video';
|
|
77
79
|
/** Output aspect ratio -- landscape (16:9) or portrait (9:16). */
|
|
78
80
|
type GeminiOmniTextToVideoAspectRatio = '16:9' | '9:16';
|
|
79
81
|
/** Output resolution -- higher resolutions produce sharper video at higher cost. */
|
|
@@ -100,10 +102,12 @@ interface GeminiOmniTextToVideoClip {
|
|
|
100
102
|
* must total 7 or fewer.
|
|
101
103
|
*/
|
|
102
104
|
interface TextToVideoParams {
|
|
105
|
+
/** Model to use. Defaults to gemini-omni-text-to-video for backward compatibility. */
|
|
106
|
+
model?: GeminiOmniTextToVideoModel;
|
|
103
107
|
/** Video generation prompt, max 20 000 characters. */
|
|
104
108
|
prompt: string;
|
|
105
|
-
/** Output video
|
|
106
|
-
duration_seconds
|
|
109
|
+
/** Output duration for gemini-omni-text-to-video; not accepted by gemini-omni-flash-preview. */
|
|
110
|
+
duration_seconds?: GeminiOmniTextToVideoDuration;
|
|
107
111
|
/** HTTPS callback URL for task completion notification. */
|
|
108
112
|
callback_url?: string;
|
|
109
113
|
/** Reference image URLs, max 7. Each consumes 1 reference unit. */
|
|
@@ -239,4 +243,4 @@ declare class GeminiOmniClient extends BaseClient {
|
|
|
239
243
|
constructor(options?: ClientOptions);
|
|
240
244
|
}
|
|
241
245
|
|
|
242
|
-
export { type CompletedTextToVideoResponse, type CreateAudioParams, type CreateAudioResponse, type CreateCharacterParams, type CreateCharacterResponse, type GeminiOmniAudio, type GeminiOmniAudioVoice, type GeminiOmniCharacter, GeminiOmniClient, type GeminiOmniTextToVideoAspectRatio, type GeminiOmniTextToVideoClip, type GeminiOmniTextToVideoDuration, type GeminiOmniTextToVideoResolution, type ImageMetadata, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type VideoMetadata };
|
|
246
|
+
export { type CompletedTextToVideoResponse, type CreateAudioParams, type CreateAudioResponse, type CreateCharacterParams, type CreateCharacterResponse, type GeminiOmniAudio, type GeminiOmniAudioVoice, type GeminiOmniCharacter, GeminiOmniClient, type GeminiOmniTextToVideoAspectRatio, type GeminiOmniTextToVideoClip, type GeminiOmniTextToVideoDuration, type GeminiOmniTextToVideoModel, type GeminiOmniTextToVideoResolution, type ImageMetadata, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type VideoMetadata };
|
package/dist/index.d.ts
CHANGED
|
@@ -74,6 +74,8 @@ interface CreateCharacterResponse {
|
|
|
74
74
|
}
|
|
75
75
|
/** Video duration in seconds. Longer durations consume more credits. */
|
|
76
76
|
type GeminiOmniTextToVideoDuration = 4 | 6 | 8 | 10;
|
|
77
|
+
/** Gemini Omni model exposed by the text-to-video endpoint. */
|
|
78
|
+
type GeminiOmniTextToVideoModel = 'gemini-omni-flash-preview' | 'gemini-omni-text-to-video';
|
|
77
79
|
/** Output aspect ratio -- landscape (16:9) or portrait (9:16). */
|
|
78
80
|
type GeminiOmniTextToVideoAspectRatio = '16:9' | '9:16';
|
|
79
81
|
/** Output resolution -- higher resolutions produce sharper video at higher cost. */
|
|
@@ -100,10 +102,12 @@ interface GeminiOmniTextToVideoClip {
|
|
|
100
102
|
* must total 7 or fewer.
|
|
101
103
|
*/
|
|
102
104
|
interface TextToVideoParams {
|
|
105
|
+
/** Model to use. Defaults to gemini-omni-text-to-video for backward compatibility. */
|
|
106
|
+
model?: GeminiOmniTextToVideoModel;
|
|
103
107
|
/** Video generation prompt, max 20 000 characters. */
|
|
104
108
|
prompt: string;
|
|
105
|
-
/** Output video
|
|
106
|
-
duration_seconds
|
|
109
|
+
/** Output duration for gemini-omni-text-to-video; not accepted by gemini-omni-flash-preview. */
|
|
110
|
+
duration_seconds?: GeminiOmniTextToVideoDuration;
|
|
107
111
|
/** HTTPS callback URL for task completion notification. */
|
|
108
112
|
callback_url?: string;
|
|
109
113
|
/** Reference image URLs, max 7. Each consumes 1 reference unit. */
|
|
@@ -239,4 +243,4 @@ declare class GeminiOmniClient extends BaseClient {
|
|
|
239
243
|
constructor(options?: ClientOptions);
|
|
240
244
|
}
|
|
241
245
|
|
|
242
|
-
export { type CompletedTextToVideoResponse, type CreateAudioParams, type CreateAudioResponse, type CreateCharacterParams, type CreateCharacterResponse, type GeminiOmniAudio, type GeminiOmniAudioVoice, type GeminiOmniCharacter, GeminiOmniClient, type GeminiOmniTextToVideoAspectRatio, type GeminiOmniTextToVideoClip, type GeminiOmniTextToVideoDuration, type GeminiOmniTextToVideoResolution, type ImageMetadata, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type VideoMetadata };
|
|
246
|
+
export { type CompletedTextToVideoResponse, type CreateAudioParams, type CreateAudioResponse, type CreateCharacterParams, type CreateCharacterResponse, type GeminiOmniAudio, type GeminiOmniAudioVoice, type GeminiOmniCharacter, GeminiOmniClient, type GeminiOmniTextToVideoAspectRatio, type GeminiOmniTextToVideoClip, type GeminiOmniTextToVideoDuration, type GeminiOmniTextToVideoModel, type GeminiOmniTextToVideoResolution, type ImageMetadata, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type VideoMetadata };
|
package/dist/index.js
CHANGED
|
@@ -38,7 +38,120 @@ var import_core4 = require("@runapi.ai/core");
|
|
|
38
38
|
|
|
39
39
|
// src/resources/create-audio.ts
|
|
40
40
|
var import_core = require("@runapi.ai/core");
|
|
41
|
+
|
|
42
|
+
// src/contract_gen.ts
|
|
43
|
+
var contract = {
|
|
44
|
+
"create-audio": {
|
|
45
|
+
"models": [
|
|
46
|
+
"gemini-omni-audio"
|
|
47
|
+
],
|
|
48
|
+
"fields_by_model": {
|
|
49
|
+
"gemini-omni-audio": {
|
|
50
|
+
"audio_id": {
|
|
51
|
+
"required": true
|
|
52
|
+
},
|
|
53
|
+
"name": {
|
|
54
|
+
"required": true
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"create-character": {
|
|
60
|
+
"models": [
|
|
61
|
+
"gemini-omni-character"
|
|
62
|
+
],
|
|
63
|
+
"fields_by_model": {
|
|
64
|
+
"gemini-omni-character": {
|
|
65
|
+
"descriptions": {
|
|
66
|
+
"required": true
|
|
67
|
+
},
|
|
68
|
+
"reference_image_url": {
|
|
69
|
+
"required": true
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"text-to-video": {
|
|
75
|
+
"models": [
|
|
76
|
+
"gemini-omni-flash-preview",
|
|
77
|
+
"gemini-omni-text-to-video"
|
|
78
|
+
],
|
|
79
|
+
"fields_by_model": {
|
|
80
|
+
"gemini-omni-flash-preview": {
|
|
81
|
+
"aspect_ratio": {
|
|
82
|
+
"enum": [
|
|
83
|
+
"16:9",
|
|
84
|
+
"9:16"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"duration_seconds": {
|
|
88
|
+
"type": "integer"
|
|
89
|
+
},
|
|
90
|
+
"output_resolution": {
|
|
91
|
+
"enum": [
|
|
92
|
+
"720p"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"prompt": {
|
|
96
|
+
"required": true
|
|
97
|
+
},
|
|
98
|
+
"seed": {
|
|
99
|
+
"type": "integer"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"gemini-omni-text-to-video": {
|
|
103
|
+
"aspect_ratio": {
|
|
104
|
+
"enum": [
|
|
105
|
+
"16:9",
|
|
106
|
+
"9:16"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"duration_seconds": {
|
|
110
|
+
"enum": [
|
|
111
|
+
4,
|
|
112
|
+
6,
|
|
113
|
+
8,
|
|
114
|
+
10
|
|
115
|
+
],
|
|
116
|
+
"required": true,
|
|
117
|
+
"type": "integer"
|
|
118
|
+
},
|
|
119
|
+
"output_resolution": {
|
|
120
|
+
"enum": [
|
|
121
|
+
"720p",
|
|
122
|
+
"1080p",
|
|
123
|
+
"4k"
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
"prompt": {
|
|
127
|
+
"required": true
|
|
128
|
+
},
|
|
129
|
+
"seed": {
|
|
130
|
+
"type": "integer"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"rules": [
|
|
135
|
+
{
|
|
136
|
+
"when": {
|
|
137
|
+
"model": "gemini-omni-flash-preview"
|
|
138
|
+
},
|
|
139
|
+
"forbidden": [
|
|
140
|
+
"reference_image_urls",
|
|
141
|
+
"audio_ids",
|
|
142
|
+
"video_list",
|
|
143
|
+
"character_ids",
|
|
144
|
+
"duration_seconds",
|
|
145
|
+
"seed"
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// src/resources/create-audio.ts
|
|
41
153
|
var ENDPOINT = "/api/v1/gemini_omni/create_audio";
|
|
154
|
+
var MODEL = "gemini-omni-audio";
|
|
42
155
|
var CreateAudio = class {
|
|
43
156
|
constructor(http) {
|
|
44
157
|
this.http = http;
|
|
@@ -51,8 +164,10 @@ var CreateAudio = class {
|
|
|
51
164
|
* @returns The created audio voice preset.
|
|
52
165
|
*/
|
|
53
166
|
async run(params, options) {
|
|
167
|
+
const body = (0, import_core.compactParams)(params);
|
|
168
|
+
(0, import_core.validateParams)(contract["create-audio"], { ...body, model: MODEL });
|
|
54
169
|
return this.http.request("POST", ENDPOINT, {
|
|
55
|
-
body
|
|
170
|
+
body,
|
|
56
171
|
...options
|
|
57
172
|
});
|
|
58
173
|
}
|
|
@@ -61,6 +176,7 @@ var CreateAudio = class {
|
|
|
61
176
|
// src/resources/create-character.ts
|
|
62
177
|
var import_core2 = require("@runapi.ai/core");
|
|
63
178
|
var ENDPOINT2 = "/api/v1/gemini_omni/create_character";
|
|
179
|
+
var MODEL2 = "gemini-omni-character";
|
|
64
180
|
var CreateCharacter = class {
|
|
65
181
|
constructor(http) {
|
|
66
182
|
this.http = http;
|
|
@@ -73,8 +189,10 @@ var CreateCharacter = class {
|
|
|
73
189
|
* @returns The created character.
|
|
74
190
|
*/
|
|
75
191
|
async run(params, options) {
|
|
192
|
+
const body = (0, import_core2.compactParams)(params);
|
|
193
|
+
(0, import_core2.validateParams)(contract["create-character"], { ...body, model: MODEL2 });
|
|
76
194
|
return this.http.request("POST", ENDPOINT2, {
|
|
77
|
-
body
|
|
195
|
+
body,
|
|
78
196
|
...options
|
|
79
197
|
});
|
|
80
198
|
}
|
|
@@ -84,6 +202,7 @@ var CreateCharacter = class {
|
|
|
84
202
|
var import_core3 = require("@runapi.ai/core");
|
|
85
203
|
var import_internal = require("@runapi.ai/core/internal");
|
|
86
204
|
var ENDPOINT3 = "/api/v1/gemini_omni/text_to_video";
|
|
205
|
+
var DEFAULT_MODEL = "gemini-omni-text-to-video";
|
|
87
206
|
var TextToVideo = class {
|
|
88
207
|
constructor(http) {
|
|
89
208
|
this.http = http;
|
|
@@ -110,8 +229,13 @@ var TextToVideo = class {
|
|
|
110
229
|
* @returns The task creation result with id.
|
|
111
230
|
*/
|
|
112
231
|
async create(params, options) {
|
|
232
|
+
const body = (0, import_core3.compactParams)(params);
|
|
233
|
+
(0, import_core3.validateParams)(contract["text-to-video"], {
|
|
234
|
+
...body,
|
|
235
|
+
model: body.model ?? DEFAULT_MODEL
|
|
236
|
+
});
|
|
113
237
|
return this.http.request("POST", ENDPOINT3, {
|
|
114
|
-
body
|
|
238
|
+
body,
|
|
115
239
|
...options
|
|
116
240
|
});
|
|
117
241
|
}
|
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 { 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,Y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A,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"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/create-audio.ts","../src/contract_gen.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, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { contract } from '../contract_gen';\nimport type { CreateAudioParams, CreateAudioResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_audio';\n\n// Fixed endpoint model, injected only for contract validation (never sent on the wire).\nconst MODEL = 'gemini-omni-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 const body = compactParams(params);\n validateParams(contract['create-audio'] as ActionSchema, { ...body, model: MODEL } as Record<string, unknown>);\n return this.http.request<CreateAudioResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n}\n","export const contract = {\n \"create-audio\": {\n \"models\": [\n \"gemini-omni-audio\"\n ],\n \"fields_by_model\": {\n \"gemini-omni-audio\": {\n \"audio_id\": {\n \"required\": true\n },\n \"name\": {\n \"required\": true\n }\n }\n }\n },\n \"create-character\": {\n \"models\": [\n \"gemini-omni-character\"\n ],\n \"fields_by_model\": {\n \"gemini-omni-character\": {\n \"descriptions\": {\n \"required\": true\n },\n \"reference_image_url\": {\n \"required\": true\n }\n }\n }\n },\n \"text-to-video\": {\n \"models\": [\n \"gemini-omni-flash-preview\",\n \"gemini-omni-text-to-video\"\n ],\n \"fields_by_model\": {\n \"gemini-omni-flash-preview\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\"\n ]\n },\n \"duration_seconds\": {\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\"\n ]\n },\n \"prompt\": {\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"gemini-omni-text-to-video\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\"\n ]\n },\n \"duration_seconds\": {\n \"enum\": [\n 4,\n 6,\n 8,\n 10\n ],\n \"required\": true,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\",\n \"4k\"\n ]\n },\n \"prompt\": {\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n }\n },\n \"rules\": [\n {\n \"when\": {\n \"model\": \"gemini-omni-flash-preview\"\n },\n \"forbidden\": [\n \"reference_image_urls\",\n \"audio_ids\",\n \"video_list\",\n \"character_ids\",\n \"duration_seconds\",\n \"seed\"\n ]\n }\n ]\n }\n} as const;\n","import type { HttpClient, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { contract } from '../contract_gen';\nimport type { CreateCharacterParams, CreateCharacterResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_character';\n\n// Fixed endpoint model, injected only for contract validation (never sent on the wire).\nconst MODEL = 'gemini-omni-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 const body = compactParams(params);\n validateParams(contract['create-character'] as ActionSchema, { ...body, model: MODEL } as Record<string, unknown>);\n return this.http.request<CreateCharacterResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/text_to_video';\n\nconst DEFAULT_MODEL = '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 const body = compactParams(params);\n validateParams(contract['text-to-video'] as ActionSchema, {\n ...body,\n model: body.model ?? DEFAULT_MODEL,\n } as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\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;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I,gBAAgB,KAAK,IAAI;AACpD,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAAA,EAC9C;AACF;;;ADvCA,IAAAC,eAUO;","names":["import_core","import_core","ENDPOINT","MODEL","import_core","ENDPOINT","import_core"]}
|
package/dist/index.mjs
CHANGED
|
@@ -2,8 +2,121 @@
|
|
|
2
2
|
import { BaseClient } from "@runapi.ai/core";
|
|
3
3
|
|
|
4
4
|
// src/resources/create-audio.ts
|
|
5
|
-
import { compactParams } from "@runapi.ai/core";
|
|
5
|
+
import { compactParams, validateParams } from "@runapi.ai/core";
|
|
6
|
+
|
|
7
|
+
// src/contract_gen.ts
|
|
8
|
+
var contract = {
|
|
9
|
+
"create-audio": {
|
|
10
|
+
"models": [
|
|
11
|
+
"gemini-omni-audio"
|
|
12
|
+
],
|
|
13
|
+
"fields_by_model": {
|
|
14
|
+
"gemini-omni-audio": {
|
|
15
|
+
"audio_id": {
|
|
16
|
+
"required": true
|
|
17
|
+
},
|
|
18
|
+
"name": {
|
|
19
|
+
"required": true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"create-character": {
|
|
25
|
+
"models": [
|
|
26
|
+
"gemini-omni-character"
|
|
27
|
+
],
|
|
28
|
+
"fields_by_model": {
|
|
29
|
+
"gemini-omni-character": {
|
|
30
|
+
"descriptions": {
|
|
31
|
+
"required": true
|
|
32
|
+
},
|
|
33
|
+
"reference_image_url": {
|
|
34
|
+
"required": true
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"text-to-video": {
|
|
40
|
+
"models": [
|
|
41
|
+
"gemini-omni-flash-preview",
|
|
42
|
+
"gemini-omni-text-to-video"
|
|
43
|
+
],
|
|
44
|
+
"fields_by_model": {
|
|
45
|
+
"gemini-omni-flash-preview": {
|
|
46
|
+
"aspect_ratio": {
|
|
47
|
+
"enum": [
|
|
48
|
+
"16:9",
|
|
49
|
+
"9:16"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"duration_seconds": {
|
|
53
|
+
"type": "integer"
|
|
54
|
+
},
|
|
55
|
+
"output_resolution": {
|
|
56
|
+
"enum": [
|
|
57
|
+
"720p"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"prompt": {
|
|
61
|
+
"required": true
|
|
62
|
+
},
|
|
63
|
+
"seed": {
|
|
64
|
+
"type": "integer"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"gemini-omni-text-to-video": {
|
|
68
|
+
"aspect_ratio": {
|
|
69
|
+
"enum": [
|
|
70
|
+
"16:9",
|
|
71
|
+
"9:16"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"duration_seconds": {
|
|
75
|
+
"enum": [
|
|
76
|
+
4,
|
|
77
|
+
6,
|
|
78
|
+
8,
|
|
79
|
+
10
|
|
80
|
+
],
|
|
81
|
+
"required": true,
|
|
82
|
+
"type": "integer"
|
|
83
|
+
},
|
|
84
|
+
"output_resolution": {
|
|
85
|
+
"enum": [
|
|
86
|
+
"720p",
|
|
87
|
+
"1080p",
|
|
88
|
+
"4k"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"prompt": {
|
|
92
|
+
"required": true
|
|
93
|
+
},
|
|
94
|
+
"seed": {
|
|
95
|
+
"type": "integer"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"rules": [
|
|
100
|
+
{
|
|
101
|
+
"when": {
|
|
102
|
+
"model": "gemini-omni-flash-preview"
|
|
103
|
+
},
|
|
104
|
+
"forbidden": [
|
|
105
|
+
"reference_image_urls",
|
|
106
|
+
"audio_ids",
|
|
107
|
+
"video_list",
|
|
108
|
+
"character_ids",
|
|
109
|
+
"duration_seconds",
|
|
110
|
+
"seed"
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// src/resources/create-audio.ts
|
|
6
118
|
var ENDPOINT = "/api/v1/gemini_omni/create_audio";
|
|
119
|
+
var MODEL = "gemini-omni-audio";
|
|
7
120
|
var CreateAudio = class {
|
|
8
121
|
constructor(http) {
|
|
9
122
|
this.http = http;
|
|
@@ -16,16 +129,19 @@ var CreateAudio = class {
|
|
|
16
129
|
* @returns The created audio voice preset.
|
|
17
130
|
*/
|
|
18
131
|
async run(params, options) {
|
|
132
|
+
const body = compactParams(params);
|
|
133
|
+
validateParams(contract["create-audio"], { ...body, model: MODEL });
|
|
19
134
|
return this.http.request("POST", ENDPOINT, {
|
|
20
|
-
body
|
|
135
|
+
body,
|
|
21
136
|
...options
|
|
22
137
|
});
|
|
23
138
|
}
|
|
24
139
|
};
|
|
25
140
|
|
|
26
141
|
// src/resources/create-character.ts
|
|
27
|
-
import { compactParams as compactParams2 } from "@runapi.ai/core";
|
|
142
|
+
import { compactParams as compactParams2, validateParams as validateParams2 } from "@runapi.ai/core";
|
|
28
143
|
var ENDPOINT2 = "/api/v1/gemini_omni/create_character";
|
|
144
|
+
var MODEL2 = "gemini-omni-character";
|
|
29
145
|
var CreateCharacter = class {
|
|
30
146
|
constructor(http) {
|
|
31
147
|
this.http = http;
|
|
@@ -38,17 +154,20 @@ var CreateCharacter = class {
|
|
|
38
154
|
* @returns The created character.
|
|
39
155
|
*/
|
|
40
156
|
async run(params, options) {
|
|
157
|
+
const body = compactParams2(params);
|
|
158
|
+
validateParams2(contract["create-character"], { ...body, model: MODEL2 });
|
|
41
159
|
return this.http.request("POST", ENDPOINT2, {
|
|
42
|
-
body
|
|
160
|
+
body,
|
|
43
161
|
...options
|
|
44
162
|
});
|
|
45
163
|
}
|
|
46
164
|
};
|
|
47
165
|
|
|
48
166
|
// src/resources/text-to-video.ts
|
|
49
|
-
import { compactParams as compactParams3 } from "@runapi.ai/core";
|
|
167
|
+
import { compactParams as compactParams3, validateParams as validateParams3 } from "@runapi.ai/core";
|
|
50
168
|
import { pollUntilComplete } from "@runapi.ai/core/internal";
|
|
51
169
|
var ENDPOINT3 = "/api/v1/gemini_omni/text_to_video";
|
|
170
|
+
var DEFAULT_MODEL = "gemini-omni-text-to-video";
|
|
52
171
|
var TextToVideo = class {
|
|
53
172
|
constructor(http) {
|
|
54
173
|
this.http = http;
|
|
@@ -75,8 +194,13 @@ var TextToVideo = class {
|
|
|
75
194
|
* @returns The task creation result with id.
|
|
76
195
|
*/
|
|
77
196
|
async create(params, options) {
|
|
197
|
+
const body = compactParams3(params);
|
|
198
|
+
validateParams3(contract["text-to-video"], {
|
|
199
|
+
...body,
|
|
200
|
+
model: body.model ?? DEFAULT_MODEL
|
|
201
|
+
});
|
|
78
202
|
return this.http.request("POST", ENDPOINT3, {
|
|
79
|
-
body
|
|
203
|
+
body,
|
|
80
204
|
...options
|
|
81
205
|
});
|
|
82
206
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -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 { 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,IA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AC7D,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"]}
|
|
1
|
+
{"version":3,"sources":["../src/client.ts","../src/resources/create-audio.ts","../src/contract_gen.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, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { contract } from '../contract_gen';\nimport type { CreateAudioParams, CreateAudioResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_audio';\n\n// Fixed endpoint model, injected only for contract validation (never sent on the wire).\nconst MODEL = 'gemini-omni-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 const body = compactParams(params);\n validateParams(contract['create-audio'] as ActionSchema, { ...body, model: MODEL } as Record<string, unknown>);\n return this.http.request<CreateAudioResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n}\n","export const contract = {\n \"create-audio\": {\n \"models\": [\n \"gemini-omni-audio\"\n ],\n \"fields_by_model\": {\n \"gemini-omni-audio\": {\n \"audio_id\": {\n \"required\": true\n },\n \"name\": {\n \"required\": true\n }\n }\n }\n },\n \"create-character\": {\n \"models\": [\n \"gemini-omni-character\"\n ],\n \"fields_by_model\": {\n \"gemini-omni-character\": {\n \"descriptions\": {\n \"required\": true\n },\n \"reference_image_url\": {\n \"required\": true\n }\n }\n }\n },\n \"text-to-video\": {\n \"models\": [\n \"gemini-omni-flash-preview\",\n \"gemini-omni-text-to-video\"\n ],\n \"fields_by_model\": {\n \"gemini-omni-flash-preview\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\"\n ]\n },\n \"duration_seconds\": {\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\"\n ]\n },\n \"prompt\": {\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"gemini-omni-text-to-video\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\"\n ]\n },\n \"duration_seconds\": {\n \"enum\": [\n 4,\n 6,\n 8,\n 10\n ],\n \"required\": true,\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\",\n \"4k\"\n ]\n },\n \"prompt\": {\n \"required\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n }\n },\n \"rules\": [\n {\n \"when\": {\n \"model\": \"gemini-omni-flash-preview\"\n },\n \"forbidden\": [\n \"reference_image_urls\",\n \"audio_ids\",\n \"video_list\",\n \"character_ids\",\n \"duration_seconds\",\n \"seed\"\n ]\n }\n ]\n }\n} as const;\n","import type { HttpClient, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { contract } from '../contract_gen';\nimport type { CreateCharacterParams, CreateCharacterResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/create_character';\n\n// Fixed endpoint model, injected only for contract validation (never sent on the wire).\nconst MODEL = 'gemini-omni-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 const body = compactParams(params);\n validateParams(contract['create-character'] as ActionSchema, { ...body, model: MODEL } as Record<string, unknown>);\n return this.http.request<CreateCharacterResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/gemini_omni/text_to_video';\n\nconst DEFAULT_MODEL = '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 const body = compactParams(params);\n validateParams(contract['text-to-video'] as ActionSchema, {\n ...body,\n model: body.model ?? DEFAULT_MODEL,\n } as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\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,eAAe,sBAAsB;;;ACDvC,IAAM,WAAW;AAAA,EACtB,gBAAgB;AAAA,IACd,UAAU;AAAA,MACR;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,qBAAqB;AAAA,QACnB,YAAY;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,QAAQ;AAAA,UACN,YAAY;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,oBAAoB;AAAA,IAClB,UAAU;AAAA,MACR;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,yBAAyB;AAAA,QACvB,gBAAgB;AAAA,UACd,YAAY;AAAA,QACd;AAAA,QACA,uBAAuB;AAAA,UACrB,YAAY;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,UAAU;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,6BAA6B;AAAA,QAC3B,gBAAgB;AAAA,UACd,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,oBAAoB;AAAA,UAClB,QAAQ;AAAA,QACV;AAAA,QACA,qBAAqB;AAAA,UACnB,QAAQ;AAAA,YACN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AAA,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;;;AJvCO,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;;;AKvCA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["compactParams","validateParams","ENDPOINT","MODEL","compactParams","validateParams","compactParams","validateParams","ENDPOINT","compactParams","validateParams"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runapi.ai/gemini-omni",
|
|
3
|
-
"
|
|
4
|
-
|
|
3
|
+
"runapi": {
|
|
4
|
+
"slug": "gemini-omni"
|
|
5
|
+
},
|
|
6
|
+
"version": "0.3.0",
|
|
7
|
+
"description": "RunAPI Gemini Omni SDK for audio, character, and video workflows in JavaScript, Python, Ruby, Go, Java, and PHP",
|
|
5
8
|
"main": "./dist/index.js",
|
|
6
9
|
"module": "./dist/index.mjs",
|
|
7
10
|
"types": "./dist/index.d.ts",
|
|
@@ -28,7 +31,7 @@
|
|
|
28
31
|
"clean": "rm -rf dist"
|
|
29
32
|
},
|
|
30
33
|
"dependencies": {
|
|
31
|
-
"@runapi.ai/core": "^0.2.
|
|
34
|
+
"@runapi.ai/core": "^0.2.13"
|
|
32
35
|
},
|
|
33
36
|
"devDependencies": {
|
|
34
37
|
"@types/node": "^20.0.0",
|
|
@@ -49,12 +52,17 @@
|
|
|
49
52
|
"audio",
|
|
50
53
|
"character",
|
|
51
54
|
"video",
|
|
52
|
-
"image",
|
|
53
55
|
"api",
|
|
54
56
|
"sdk",
|
|
55
57
|
"typescript",
|
|
58
|
+
"python",
|
|
56
59
|
"ruby",
|
|
57
|
-
"golang"
|
|
60
|
+
"golang",
|
|
61
|
+
"java",
|
|
62
|
+
"maven",
|
|
63
|
+
"gradle",
|
|
64
|
+
"multimodal",
|
|
65
|
+
"ai-video"
|
|
58
66
|
],
|
|
59
67
|
"author": "RunAPI",
|
|
60
68
|
"license": "Apache-2.0",
|
|
@@ -62,5 +70,8 @@
|
|
|
62
70
|
"repository": {
|
|
63
71
|
"type": "git",
|
|
64
72
|
"url": "git+https://github.com/runapi-ai/gemini-omni-sdk.git"
|
|
73
|
+
},
|
|
74
|
+
"bugs": {
|
|
75
|
+
"url": "https://github.com/runapi-ai/gemini-omni-sdk/issues"
|
|
65
76
|
}
|
|
66
77
|
}
|
|
@@ -29,7 +29,7 @@ The canonical agent file is `skills/gemini-omni/SKILL.md`.
|
|
|
29
29
|
|
|
30
30
|
- Audio: create reusable voice resources with `runapi gemini-omni create-audio`.
|
|
31
31
|
- Character: create reusable character resources with `runapi gemini-omni create-character`.
|
|
32
|
-
- Video:
|
|
32
|
+
- Video: use `gemini-omni-flash-preview` for prompt-only 720p generation, or `gemini-omni-text-to-video` for the existing multimodal workflow.
|
|
33
33
|
|
|
34
34
|
## Install
|
|
35
35
|
|
|
@@ -64,7 +64,7 @@ runapi wait <task-id> --service gemini-omni --action text-to-video
|
|
|
64
64
|
- Product docs: https://runapi.ai/docs#gemini-omni
|
|
65
65
|
- SDK docs: https://runapi.ai/docs#sdk-gemini-omni
|
|
66
66
|
- SDK repository: https://github.com/runapi-ai/gemini-omni-sdk
|
|
67
|
-
-
|
|
67
|
+
- Flash Preview pricing and rate limits: https://runapi.ai/models/gemini-omni/flash-preview
|
|
68
68
|
- Provider comparison: https://runapi.ai/providers/google
|
|
69
69
|
- Browse all RunAPI models and skills: https://runapi.ai/models
|
|
70
70
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gemini-omni
|
|
3
|
-
description: Create Gemini Omni voice resources, character resources, and text-to-video tasks through RunAPI. Use when the user asks an agent to create or manage Gemini Omni audio voices, character resources, or
|
|
3
|
+
description: Create Gemini Omni voice resources, character resources, and Flash Preview or multimodal text-to-video tasks through RunAPI. Use when the user asks an agent to create or manage Gemini Omni audio voices, character resources, or video. Default to the RunAPI CLI for one-off calls; use SDKs only when integrating RunAPI into an app or backend.
|
|
4
4
|
documentation: https://runapi.ai/models/gemini-omni.md
|
|
5
5
|
provider_page: https://runapi.ai/providers/google.md
|
|
6
6
|
catalog: https://runapi.ai/models.md
|
|
@@ -36,14 +36,17 @@ Create Gemini Omni voice resources, character resources, and text-to-video tasks
|
|
|
36
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
37
|
|
|
38
38
|
- JavaScript / TypeScript: `@runapi.ai/gemini-omni`
|
|
39
|
+
- Python: `runapi-gemini-omni`
|
|
39
40
|
- Ruby: `runapi-gemini-omni`
|
|
40
41
|
- Go: `github.com/runapi-ai/gemini-omni-sdk/go`
|
|
42
|
+
- Java: `ai.runapi:runapi-gemini-omni`
|
|
43
|
+
- PHP: `runapi-ai/gemini-omni`
|
|
41
44
|
|
|
42
45
|
## Variants
|
|
43
46
|
|
|
44
47
|
- Audio: create reusable voice resources with `runapi gemini-omni create-audio`.
|
|
45
48
|
- Character: create reusable character resources with `runapi gemini-omni create-character`.
|
|
46
|
-
- Video:
|
|
49
|
+
- Video: use `gemini-omni-flash-preview` for prompt-only 720p generation, or `gemini-omni-text-to-video` for the existing multimodal workflow.
|
|
47
50
|
|
|
48
51
|
## CLI path
|
|
49
52
|
|
|
@@ -66,6 +69,15 @@ runapi gemini-omni create-audio --input-file request.json
|
|
|
66
69
|
|
|
67
70
|
For video tasks, submit asynchronously and wait for completion:
|
|
68
71
|
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"model": "gemini-omni-flash-preview",
|
|
75
|
+
"prompt": "A paper airplane glides through a sunlit studio.",
|
|
76
|
+
"aspect_ratio": "16:9",
|
|
77
|
+
"output_resolution": "720p"
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
69
81
|
```shell
|
|
70
82
|
runapi gemini-omni text-to-video --async --input-file request.json
|
|
71
83
|
runapi wait <task-id> --service gemini-omni --action text-to-video
|
|
@@ -79,6 +91,6 @@ RunAPI-generated file URLs are temporary. Download and store generated images, v
|
|
|
79
91
|
|
|
80
92
|
## References
|
|
81
93
|
|
|
82
|
-
-
|
|
94
|
+
- Flash Preview model, pricing, and rate limits: https://runapi.ai/models/gemini-omni/flash-preview.md
|
|
83
95
|
- Provider comparison: https://runapi.ai/providers/google.md
|
|
84
96
|
- Full model catalog: https://runapi.ai/models.md
|