runapi-gemini-omni 0.4.0 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 315a15e319d647d39aeaf7e8f75e0831c1255cff05158eaf0beaed5903974f39
4
- data.tar.gz: a0c715ee79057f4bde550e49b601f27a75ef2be243bbcc7ec7694c9cdd4b270a
3
+ metadata.gz: b05713bdf95910a00d248eac8bcc121c34bb94a00cbedc7246fc6277c09c2372
4
+ data.tar.gz: 1758ba10f4e165e2f7f2687cae0f8cbdbbfbe4eb1949100810c5425b49cc1b66
5
5
  SHA512:
6
- metadata.gz: 23dc3858605a2cba240eac1ae302287f601d9d21e3f154cf3431c7aa8cd533353e526a79e5ba5addfbbbc918b9fd4852dac4776b7c58e0eede1a4bbdf8782854
7
- data.tar.gz: 465fb2003c592eeb00640d1335de475ae147bb39904c062100fb412645d0266d37ecc34e3b850a22263cac84dacb5d9a80f40ce03f7beaf7964a8e8d75ea29c4
6
+ metadata.gz: c991128c2ee5f8bc738a354897524de6ce804149bf1b407a208d87d726af580897cc526478c5788d73d159b37fdfe273877de25805de24cb435cbacaece23e11
7
+ data.tar.gz: 144ac7e23e719a1de28afd8cdf14cca0f4c9882dd9095d759d0f330f7eb63891343f23be971e94f26eb0f50fc291ba4f135bbc3542c284312c0485b36c832354
data/README.md CHANGED
@@ -36,12 +36,30 @@ video = client.text_to_video.run(
36
36
  )
37
37
  ```
38
38
 
39
- `character.images` returns the portrait first and the optional full-body image second. A character created with both references consumes two of the seven reference units in a multimodal video request.
39
+ `character.images` returns the portrait first and the optional full-body image second. For Flash 1.1 and the original text-to-video model, a character created with both references consumes two of the seven reference units.
40
40
 
41
41
  For `gemini-omni-flash-1-1`, `first_frame_image_url` cannot be combined with reference images, audio IDs, video clips, or character IDs. `last_frame_image_url` requires `first_frame_image_url`.
42
42
 
43
43
  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.
44
44
 
45
+ ## Flash 1.2 generation and continuation
46
+
47
+ Flash 1.2 uses `model=gemini-omni-flash-1-2` and an integer `duration_seconds` from 3 through 15 for generation. Omit `duration_seconds` when editing with `reference_video_urls`; output duration follows the source video. When supplying both first and last frames, generation accepts 3 through 10 seconds. It accepts `reference_image_urls` with up to 6 images and `reference_video_urls` with up to 1 video. Images count as one reference slot and a video counts as two, with at most 7 slots total. Up to 2 account-owned `character_ids` consume no reference slots. Frame inputs cannot accompany reference inputs or characters. `aspect_ratio` also accepts `auto`, and `seed` is an integer from 10000 through 99999.
48
+
49
+ Continuation uses a completed Flash 1.2 generation or continuation task owned by your account. The source must be at most 15 seconds long at 360p or 720p. `duration_seconds` adds 3 through 10 seconds, and `reference_image_urls` accepts up to 3 images. The result contains the full original video plus the added segment. Retrieve its status with the continuation resource's `get` method.
50
+
51
+ ```ruby
52
+ source = client.text_to_video.run(
53
+ model: "gemini-omni-flash-1-2", prompt: "A paper airplane glides across a studio",
54
+ duration_seconds: 7, output_resolution: "720p"
55
+ )
56
+ continued = client.extend_video.run(
57
+ model: "gemini-omni-flash-1-2", source_task_id: source.id,
58
+ prompt: "Follow the airplane to the window", duration_seconds: 3
59
+ )
60
+ ```
61
+
62
+
45
63
  ## Links
46
64
 
47
65
  - Model page: https://runapi.ai/models/gemini-omni
@@ -21,12 +21,13 @@ module RunApi
21
21
  # @return [Resources::CreateCharacter] Builds reusable characters and follows accepted Tasks to completion.
22
22
  attr_reader :create_character
23
23
  # @return [Resources::TextToVideo] Generates video from prompts with optional characters and voices (async).
24
- attr_reader :text_to_video
24
+ attr_reader :text_to_video, :extend_video
25
25
 
26
26
  def initialize(api_key: nil, **options)
27
27
  super
28
28
  @create_audio = Resources::CreateAudio.new(http)
29
29
  @create_character = Resources::CreateCharacter.new(http)
30
+ @extend_video = Resources::ExtendVideo.new(http)
30
31
  @text_to_video = Resources::TextToVideo.new(http)
31
32
  end
32
33
  end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RunApi
4
+ module GeminiOmni
5
+ module Resources
6
+ # Continues a completed Flash 1.2 task and returns the full combined video.
7
+ # Async -- use +run+ for automatic polling or +create+/+get+ for manual control.
8
+ class ExtendVideo
9
+ include RunApi::Core::ResourceHelpers
10
+
11
+ ENDPOINT = "/api/v1/gemini_omni/extend_video"
12
+ RESPONSE_CLASS = Types::TextToVideoResponse
13
+ COMPLETED_RESPONSE_CLASS = Types::CompletedTextToVideoResponse
14
+
15
+ def initialize(http)
16
+ @http = http
17
+ end
18
+
19
+ def run(options: nil, **params)
20
+ task = create(options: options, **params)
21
+ poll_until_complete { get(task.id, options: options) }
22
+ end
23
+
24
+ def create(options: nil, **params)
25
+ params = compact_params(params)
26
+ request(:post, ENDPOINT, body: params, options: options)
27
+ end
28
+
29
+ def get(id, options: nil)
30
+ request(:get, "#{ENDPOINT}/#{id}", options: options)
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -5,6 +5,7 @@ require_relative "gemini_omni/types"
5
5
  require_relative "gemini_omni/resources/create_audio"
6
6
  require_relative "gemini_omni/resources/create_character"
7
7
  require_relative "gemini_omni/resources/text_to_video"
8
+ require_relative "gemini_omni/resources/extend_video"
8
9
  require_relative "gemini_omni/client"
9
10
 
10
11
  module RunApi
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.4.0
4
+ version: 0.5.0
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.6.0
18
+ version: 0.6.1
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.6.0
25
+ version: 0.6.1
26
26
  description: The Gemini Omni 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 generation workflows when your application needs request bodies, task status
@@ -41,6 +41,7 @@ files:
41
41
  - lib/runapi/gemini_omni/client.rb
42
42
  - lib/runapi/gemini_omni/resources/create_audio.rb
43
43
  - lib/runapi/gemini_omni/resources/create_character.rb
44
+ - lib/runapi/gemini_omni/resources/extend_video.rb
44
45
  - lib/runapi/gemini_omni/resources/text_to_video.rb
45
46
  - lib/runapi/gemini_omni/types.rb
46
47
  homepage: https://runapi.ai/models/gemini-omni