Class: RunApi::GeminiOmni::Resources::TextToVideo

Inherits:
Object
  • Object
show all
Includes:
Core::ResourceHelpers
Defined in:
lib/runapi/gemini_omni/resources/text_to_video.rb

Overview

Generates video from a prompt with optional characters, audio voices, reference images, and source video clips. Async -- use run for automatic polling or +create+/+get+ for manual control.

Constant Summary collapse

ENDPOINT =
"/api/v1/gemini_omni/text_to_video"
RESPONSE_CLASS =
Types::TextToVideoResponse
COMPLETED_RESPONSE_CLASS =
Types::CompletedTextToVideoResponse
DEFAULT_MODEL =
"gemini-omni-text-to-video"
PROMPT_MAX_LENGTH =
20_000
REFERENCE_UNITS_MAX =
7
VIDEO_REFERENCE_UNITS =
2
MAX_TRIM_SECONDS =
10

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ TextToVideo

Returns a new instance of TextToVideo.



21
22
23
# File 'lib/runapi/gemini_omni/resources/text_to_video.rb', line 21

def initialize(http)
  @http = http
end

Instance Method Details

#create(options: nil, **params) ⇒ Object



30
31
32
33
34
# File 'lib/runapi/gemini_omni/resources/text_to_video.rb', line 30

def create(options: nil, **params)
  params = compact_params(params)
  validate_params!(params)
  request(:post, ENDPOINT, body: params, options: options)
end

#get(id, options: nil) ⇒ Object



36
37
38
# File 'lib/runapi/gemini_omni/resources/text_to_video.rb', line 36

def get(id, options: nil)
  request(:get, "#{ENDPOINT}/#{id}", options: options)
end

#run(options: nil, **params) ⇒ Object



25
26
27
28
# File 'lib/runapi/gemini_omni/resources/text_to_video.rb', line 25

def run(options: nil, **params)
  task = create(options: options, **params)
  poll_until_complete { get(task.id, options: options) }
end