runapi-gemini-omni 0.2.5 → 0.2.6
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d7eeb20441c69a3760cb85713f6089a3945f0338f689977e4389e6cd61247536
|
|
4
|
+
data.tar.gz: faeff081599dba899a2c097fa5ff24f9232abb6e36b93359f81e93c1ef5ad3d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: be6ba08cff48a8edbd3d7e5ec10e8363aca7c08f822798a4a6b1ed52bfba3f5a1fa4efc4c0854cf322c052a708c81f9bb4c233bd6df0e55598ca154a4dc25132
|
|
7
|
+
data.tar.gz: c78fb526856111cd7b37206fcfdf324719b7375095ef1e2a47f79f668a6e7efc9048f8355aed37c01a1d729642603bc7d05d47dadba8fd755342c2960459e1c4
|
|
@@ -10,7 +10,6 @@ module RunApi
|
|
|
10
10
|
RESPONSE_CLASS = Types::CreateCharacterResponse
|
|
11
11
|
DESCRIPTIONS_MAX_LENGTH = 20_000
|
|
12
12
|
CHARACTER_NAME_MAX_LENGTH = 210
|
|
13
|
-
IMAGE_URLS_MAX = 1
|
|
14
13
|
|
|
15
14
|
def initialize(http)
|
|
16
15
|
@http = http
|
|
@@ -26,10 +25,8 @@ module RunApi
|
|
|
26
25
|
|
|
27
26
|
def validate_params!(params)
|
|
28
27
|
validate_required!(params, :descriptions)
|
|
29
|
-
validate_required!(params, :
|
|
30
|
-
validate_array!(params, :image_urls)
|
|
28
|
+
validate_required!(params, :reference_image_url)
|
|
31
29
|
validate_array!(params, :audio_ids) if param(params, :audio_ids)
|
|
32
|
-
validate_image_count!(params)
|
|
33
30
|
validate_length!(params, :descriptions, DESCRIPTIONS_MAX_LENGTH)
|
|
34
31
|
validate_length!(params, :character_name, CHARACTER_NAME_MAX_LENGTH)
|
|
35
32
|
end
|
|
@@ -52,12 +49,6 @@ module RunApi
|
|
|
52
49
|
raise Core::ValidationError, "#{key} must be an array"
|
|
53
50
|
end
|
|
54
51
|
|
|
55
|
-
def validate_image_count!(params)
|
|
56
|
-
return if param(params, :image_urls).length <= IMAGE_URLS_MAX
|
|
57
|
-
|
|
58
|
-
raise Core::ValidationError, "image_urls accepts at most #{IMAGE_URLS_MAX} image"
|
|
59
|
-
end
|
|
60
|
-
|
|
61
52
|
def validate_length!(params, key, max_length)
|
|
62
53
|
value = param(params, key)
|
|
63
54
|
return if value.nil? || value.to_s.length <= max_length
|
|
@@ -10,7 +10,7 @@ module RunApi
|
|
|
10
10
|
RESPONSE_CLASS = Types::TextToVideoResponse
|
|
11
11
|
COMPLETED_RESPONSE_CLASS = Types::CompletedTextToVideoResponse
|
|
12
12
|
PROMPT_MAX_LENGTH = 20_000
|
|
13
|
-
|
|
13
|
+
REFERENCE_IMAGE_URLS_MAX = 7
|
|
14
14
|
AUDIO_IDS_MAX = 3
|
|
15
15
|
VIDEO_LIST_MAX = 1
|
|
16
16
|
CHARACTER_IDS_MAX = 3
|
|
@@ -41,12 +41,12 @@ module RunApi
|
|
|
41
41
|
|
|
42
42
|
def validate_params!(params)
|
|
43
43
|
validate_required!(params, :prompt)
|
|
44
|
-
validate_required!(params, :
|
|
44
|
+
validate_required!(params, :duration_seconds)
|
|
45
45
|
validate_length!(params, :prompt, PROMPT_MAX_LENGTH)
|
|
46
|
-
validate_optional!(params, :
|
|
46
|
+
validate_optional!(params, :duration_seconds, Types::DURATIONS)
|
|
47
47
|
validate_optional!(params, :aspect_ratio, Types::ASPECT_RATIOS)
|
|
48
|
-
validate_optional!(params, :
|
|
49
|
-
validate_array!(params, :
|
|
48
|
+
validate_optional!(params, :output_resolution, Types::OUTPUT_RESOLUTIONS)
|
|
49
|
+
validate_array!(params, :reference_image_urls, REFERENCE_IMAGE_URLS_MAX) if param(params, :reference_image_urls)
|
|
50
50
|
validate_array!(params, :audio_ids, AUDIO_IDS_MAX) if param(params, :audio_ids)
|
|
51
51
|
validate_array!(params, :video_list, VIDEO_LIST_MAX) if param(params, :video_list)
|
|
52
52
|
validate_array!(params, :character_ids, CHARACTER_IDS_MAX) if param(params, :character_ids)
|
|
@@ -99,12 +99,12 @@ module RunApi
|
|
|
99
99
|
end
|
|
100
100
|
|
|
101
101
|
def validate_reference_units!(params)
|
|
102
|
-
units = Array(param(params, :
|
|
102
|
+
units = Array(param(params, :reference_image_urls)).count +
|
|
103
103
|
(Array(param(params, :video_list)).count * VIDEO_REFERENCE_UNITS) +
|
|
104
104
|
Array(param(params, :character_ids)).count
|
|
105
105
|
return if units <= REFERENCE_UNITS_MAX
|
|
106
106
|
|
|
107
|
-
raise Core::ValidationError, "
|
|
107
|
+
raise Core::ValidationError, "reference_image_urls + video_list*2 + character_ids must use #{REFERENCE_UNITS_MAX} reference units or fewer"
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
def validate_seed!(params)
|
|
@@ -21,10 +21,14 @@ module RunApi
|
|
|
21
21
|
optional :error, String
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
class Image < RunApi::Core::BaseModel
|
|
25
|
+
optional :url, String
|
|
26
|
+
end
|
|
27
|
+
|
|
24
28
|
class Character < RunApi::Core::BaseModel
|
|
25
29
|
required :id, String
|
|
26
30
|
optional :name, String
|
|
27
|
-
optional :
|
|
31
|
+
optional :images, [-> { Image }]
|
|
28
32
|
end
|
|
29
33
|
|
|
30
34
|
class CreateCharacterResponse < RunApi::Core::BaseModel
|
|
@@ -33,9 +37,9 @@ module RunApi
|
|
|
33
37
|
optional :error, String
|
|
34
38
|
end
|
|
35
39
|
|
|
36
|
-
DURATIONS =
|
|
40
|
+
DURATIONS = [4, 6, 8, 10].freeze
|
|
37
41
|
ASPECT_RATIOS = %w[16:9 9:16].freeze
|
|
38
|
-
|
|
42
|
+
OUTPUT_RESOLUTIONS = %w[720p 1080p 4k].freeze
|
|
39
43
|
SEED_RANGE = (0..2_147_483_647)
|
|
40
44
|
|
|
41
45
|
class Video < RunApi::Core::BaseModel
|
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.6
|
|
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.5
|
|
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.5
|
|
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
|