Class: RunApi::GeminiOmni::Resources::TextToVideo
- Inherits:
-
Object
- Object
- RunApi::GeminiOmni::Resources::TextToVideo
- 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_IMAGE_URLS_MAX =
7- AUDIO_IDS_MAX =
3- VIDEO_LIST_MAX =
1- CHARACTER_IDS_MAX =
3- REFERENCE_UNITS_MAX =
7- VIDEO_REFERENCE_UNITS =
2- MAX_TRIM_SECONDS =
10
Instance Method Summary collapse
- #create(options: nil, **params) ⇒ Object
- #get(id, options: nil) ⇒ Object
-
#initialize(http) ⇒ TextToVideo
constructor
A new instance of TextToVideo.
- #run(options: nil, **params) ⇒ Object
Constructor Details
#initialize(http) ⇒ TextToVideo
Returns a new instance of TextToVideo.
25 26 27 |
# File 'lib/runapi/gemini_omni/resources/text_to_video.rb', line 25 def initialize(http) @http = http end |
Instance Method Details
#create(options: nil, **params) ⇒ Object
34 35 36 37 38 |
# File 'lib/runapi/gemini_omni/resources/text_to_video.rb', line 34 def create(options: nil, **params) params = compact_params(params) validate_params!(params) request(:post, ENDPOINT, body: params, options: ) end |
#get(id, options: nil) ⇒ Object
40 41 42 |
# File 'lib/runapi/gemini_omni/resources/text_to_video.rb', line 40 def get(id, options: nil) request(:get, "#{ENDPOINT}/#{id}", options: ) end |
#run(options: nil, **params) ⇒ Object
29 30 31 32 |
# File 'lib/runapi/gemini_omni/resources/text_to_video.rb', line 29 def run(options: nil, **params) task = create(options: , **params) poll_until_complete { get(task.id, options: ) } end |