runapi-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.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/runapi/gemini_omni/client.rb +21 -6
- data/lib/runapi/gemini_omni/resources/create_audio.rb +2 -0
- data/lib/runapi/gemini_omni/resources/create_character.rb +3 -0
- data/lib/runapi/gemini_omni/resources/text_to_video.rb +3 -0
- data/lib/runapi/gemini_omni/types.rb +15 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7befcdce5d30097c0c8ad440c86bd8cd873e14aef90f59304f60d89eed3c2a29
|
|
4
|
+
data.tar.gz: ae2353b876a73b19681e151c46310e67edf1dc2f0c04565b5a5c7b10ff3630ce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3bc31cf371de32b41d86090294fa7feb13ca132d777fa2944ec71a13e015cafed6ef6ec1a6a0f99a8b96c0401703e63d4d38f1d1c4f4e91d0b2639a9734a940e
|
|
7
|
+
data.tar.gz: 6056184058b318efb10aaf4eacf012b571fb27d64536faa374f33e1bc182458c1e6dbd2e7cb3b0d7ef2473fc4a07fd3f655bf5d9ce259bcbb4cce672a734b3fd
|
data/README.md
CHANGED
|
@@ -32,6 +32,8 @@ video = client.text_to_video.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
|
|
@@ -2,14 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module GeminiOmni
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
# Gemini Omni multimodal generation client for voice presets, character creation,
|
|
6
|
+
# and text-to-video with optional characters, audio voices, and reference media.
|
|
7
|
+
#
|
|
8
|
+
# @example
|
|
9
|
+
# client = RunApi::GeminiOmni::Client.new(api_key: "sk-...")
|
|
10
|
+
#
|
|
11
|
+
# audio = client.create_audio.run(audio_id: "zephyr", name: "Narrator")
|
|
12
|
+
# video = client.text_to_video.run(
|
|
13
|
+
# prompt: "A narrator walks through a futuristic city",
|
|
14
|
+
# duration_seconds: 6,
|
|
15
|
+
# audio_ids: [audio.audio.id]
|
|
16
|
+
# )
|
|
17
|
+
# puts video.videos.first.url
|
|
18
|
+
class Client < RunApi::Core::Client
|
|
19
|
+
# @return [Resources::CreateAudio] Registers reusable voice presets (synchronous).
|
|
20
|
+
attr_reader :create_audio
|
|
21
|
+
# @return [Resources::CreateCharacter] Builds reusable characters from reference images (synchronous).
|
|
22
|
+
attr_reader :create_character
|
|
23
|
+
# @return [Resources::TextToVideo] Generates video from prompts with optional characters and voices (async).
|
|
24
|
+
attr_reader :text_to_video
|
|
7
25
|
|
|
8
26
|
def initialize(api_key: nil, **options)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
client_options = Core::ClientOptions.new(api_key: @api_key, **options)
|
|
12
|
-
http = client_options.http_client || Core::HttpClient.new(client_options)
|
|
27
|
+
super
|
|
13
28
|
@create_audio = Resources::CreateAudio.new(http)
|
|
14
29
|
@create_character = Resources::CreateCharacter.new(http)
|
|
15
30
|
@text_to_video = Resources::TextToVideo.new(http)
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module GeminiOmni
|
|
5
5
|
module Resources
|
|
6
|
+
# Builds a reusable character from a reference image and description.
|
|
7
|
+
# Attach audio IDs to give the character a specific voice.
|
|
8
|
+
# Synchronous -- only +run+ is available (no create/get polling).
|
|
6
9
|
class CreateCharacter
|
|
7
10
|
include RunApi::Core::ResourceHelpers
|
|
8
11
|
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module GeminiOmni
|
|
5
5
|
module Resources
|
|
6
|
+
# Generates video from a prompt with optional characters, audio voices,
|
|
7
|
+
# reference images, and source video clips.
|
|
8
|
+
# Async -- use +run+ for automatic polling or +create+/+get+ for manual control.
|
|
6
9
|
class TextToVideo
|
|
7
10
|
include RunApi::Core::ResourceHelpers
|
|
8
11
|
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module GeminiOmni
|
|
5
|
+
# Type definitions and constants for the Gemini Omni API.
|
|
5
6
|
module Types
|
|
7
|
+
# The 30 preset voice identities, each with distinct pitch, cadence, and personality.
|
|
6
8
|
AUDIO_VOICES = %w[
|
|
7
9
|
achernar achird algenib algieba alnilam aoede autonoe callirrhoe charon
|
|
8
10
|
despina enceladus erinome fenrir gacrux iapetus kore laomedeia leda orus
|
|
@@ -10,46 +12,59 @@ module RunApi
|
|
|
10
12
|
vindemiatrix zephyr zubenelgenubi
|
|
11
13
|
].freeze
|
|
12
14
|
|
|
15
|
+
# A created voice preset with its server-assigned ID.
|
|
13
16
|
class Audio < RunApi::Core::BaseModel
|
|
14
17
|
required :id, String
|
|
15
18
|
optional :name, String
|
|
16
19
|
end
|
|
17
20
|
|
|
21
|
+
# Result of a synchronous create-audio call.
|
|
18
22
|
class CreateAudioResponse < RunApi::Core::BaseModel
|
|
19
23
|
required :id, String
|
|
20
24
|
optional :audio, -> { Audio }
|
|
21
25
|
optional :error, String
|
|
22
26
|
end
|
|
23
27
|
|
|
28
|
+
# URL to a generated or reference image.
|
|
24
29
|
class Image < RunApi::Core::BaseModel
|
|
25
30
|
optional :url, String
|
|
26
31
|
end
|
|
27
32
|
|
|
33
|
+
# A created character with its ID, name, and reference images.
|
|
28
34
|
class Character < RunApi::Core::BaseModel
|
|
29
35
|
required :id, String
|
|
30
36
|
optional :name, String
|
|
31
37
|
optional :images, [-> { Image }]
|
|
32
38
|
end
|
|
33
39
|
|
|
40
|
+
# Result of a synchronous create-character call.
|
|
34
41
|
class CreateCharacterResponse < RunApi::Core::BaseModel
|
|
35
42
|
required :id, String
|
|
36
43
|
optional :character, -> { Character }
|
|
37
44
|
optional :error, String
|
|
38
45
|
end
|
|
39
46
|
|
|
47
|
+
# Allowed video durations in seconds. Longer durations consume more credits.
|
|
40
48
|
DURATIONS = [4, 6, 8, 10].freeze
|
|
49
|
+
# Output aspect ratios: landscape (16:9) or portrait (9:16).
|
|
41
50
|
ASPECT_RATIOS = %w[16:9 9:16].freeze
|
|
51
|
+
# Output resolutions -- higher values produce sharper video at higher cost.
|
|
42
52
|
OUTPUT_RESOLUTIONS = %w[720p 1080p 4k].freeze
|
|
53
|
+
# Valid seed range for reproducible generation.
|
|
43
54
|
SEED_RANGE = (0..2_147_483_647)
|
|
44
55
|
|
|
56
|
+
# URL to a generated video file.
|
|
45
57
|
class Video < RunApi::Core::BaseModel
|
|
46
58
|
optional :url, String
|
|
47
59
|
end
|
|
48
60
|
|
|
61
|
+
# Async text-to-video task result with lifecycle status and generated videos.
|
|
49
62
|
class TextToVideoResponse < RunApi::Core::TaskResponse
|
|
50
63
|
optional :videos, [-> { Video }]
|
|
51
64
|
end
|
|
52
65
|
|
|
66
|
+
# Narrowed response returned by +run+ once polling confirms completion.
|
|
67
|
+
# Videos are guaranteed present.
|
|
53
68
|
class CompletedTextToVideoResponse < TextToVideoResponse
|
|
54
69
|
required :videos, [-> { Video }]
|
|
55
70
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: runapi-gemini-omni
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- RunAPI
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.2.
|
|
18
|
+
version: 0.2.6
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.2.
|
|
25
|
+
version: 0.2.6
|
|
26
26
|
description: The gemini omni api Ruby SDK is the language-specific package for Gemini
|
|
27
27
|
Omni on RunAPI. Use this package for voice resources, character resources, and multimodal
|
|
28
28
|
video workflows that need JSON request bodies, task status lookup, and consistent
|