Class: RunApi::RunwayAleph::Resources::EditVideo
- Inherits:
-
Object
- Object
- RunApi::RunwayAleph::Resources::EditVideo
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/runway_aleph/resources/edit_video.rb
Overview
Runway Aleph video editing resource. Transform an existing video using a text prompt and optional style reference image.
Constant Summary collapse
- ENDPOINT =
"/api/v1/runway_aleph/edit_video"- RESPONSE_CLASS =
Types::TaskCreateResponse
- COMPLETED_RESPONSE_CLASS =
Types::CompletedEditVideoResponse
Instance Method Summary collapse
-
#create(**params) ⇒ RunApi::RunwayAleph::Types::TaskCreateResponse
Start a video editing task.
-
#get(id) ⇒ RunApi::RunwayAleph::Types::EditVideoResponse
Get video editing task status by task ID.
-
#initialize(http) ⇒ EditVideo
constructor
A new instance of EditVideo.
-
#run(**params) ⇒ RunApi::RunwayAleph::Types::CompletedEditVideoResponse
Transform a video and wait until complete.
Constructor Details
#initialize(http) ⇒ EditVideo
Returns a new instance of EditVideo.
15 16 17 |
# File 'lib/runapi/runway_aleph/resources/edit_video.rb', line 15 def initialize(http) @http = http end |
Instance Method Details
#create(**params) ⇒ RunApi::RunwayAleph::Types::TaskCreateResponse
Start a video editing task.
32 33 34 35 36 |
# File 'lib/runapi/runway_aleph/resources/edit_video.rb', line 32 def create(**params) params = compact_params(params) validate_params!(params) request(:post, ENDPOINT, body: params) end |
#get(id) ⇒ RunApi::RunwayAleph::Types::EditVideoResponse
Get video editing task status by task ID.
42 43 44 |
# File 'lib/runapi/runway_aleph/resources/edit_video.rb', line 42 def get(id) request(:get, "#{ENDPOINT}/#{id}") end |
#run(**params) ⇒ RunApi::RunwayAleph::Types::CompletedEditVideoResponse
Transform a video and wait until complete.
23 24 25 26 |
# File 'lib/runapi/runway_aleph/resources/edit_video.rb', line 23 def run(**params) task = create(**params) poll_until_complete { get(task.id) } end |