runapi-runway-aleph 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: 56167311723e82f55c4fb956d06b4341f787b73b69a107e12e22d318ecd8366e
4
- data.tar.gz: 93d5a544147ec1d698971b76ca604926ccd391585ff149c5685e7cb3ea391b71
3
+ metadata.gz: 6cd1a2c7953995524e7ce7c3f88f2667e2b923ed82a239d62fa63e4b9a1870b3
4
+ data.tar.gz: d24449e7225a3550b3d4c060f05cdd39e36668cae35f0017b30de4d68afc879f
5
5
  SHA512:
6
- metadata.gz: 7564b5a2e8bcd99e638505fbcf55d87c51ac77c5b2f91a8d8e28b9a4af51acc833167cc8505e6e8dd0f83ed8e0a158602ad7b4e1e8f520ec2b5c9d83967dd44e
7
- data.tar.gz: b63e2ba44057ea67f67fea3bf7f58aa5724979170b300edc8c7c53f5285196b4125b10d641d8e4f0651e264aae0d1a36eff0765074e2c9f48bdaa0aa40ad6713
6
+ metadata.gz: fc7b7a96bb69611bc2efb285636fe28eab811cf00ec7552d34caf9d77036bab3cbefc0af2a279f0f2ef2e137b874c1434adf6d12d95100643c1cc49e2cdbca73
7
+ data.tar.gz: b1b83c07f3af2882cfce0f564d53ad7cd39bd9e54d95ac0b4ab13a42bd9ec3785de2f14f383c00cbb71cfe0289526f85afbbd4d49553c6be0d33322bbbd746c0
data/README.md CHANGED
@@ -26,6 +26,8 @@ status = client.edit_video.get(task.id)
26
26
 
27
27
  Use `create` when you want to submit a task and return quickly, `get` when you need the latest task state, and `run` when a script should create and poll until completion. In web request handlers, prefer `create` plus webhook or later `get` polling so a worker is not held open.
28
28
 
29
+ 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.
30
+
29
31
  ## Language notes
30
32
 
31
33
  Use Ruby keyword arguments and the `RunApi::RunwayAleph` error classes when building video jobs, Rails workers, or scripts. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
@@ -2,14 +2,22 @@
2
2
 
3
3
  module RunApi
4
4
  module RunwayAleph
5
- class Client
5
+ # Runway Aleph prompt-driven video editing API client.
6
+ # Unlike generation from scratch, Runway Aleph transforms an existing video
7
+ # using a text prompt, with optional style reference images.
8
+ #
9
+ # @example
10
+ # client = RunApi::RunwayAleph::Client.new(api_key: "your-api-key")
11
+ # result = client.edit_video.run(
12
+ # prompt: "Make it look like a watercolor painting",
13
+ # source_video_url: "https://example.com/input.mp4"
14
+ # )
15
+ class Client < RunApi::Core::Client
16
+ # @return [Resources::EditVideo] Prompt-driven video editing with optional style reference.
6
17
  attr_reader :edit_video
7
18
 
8
19
  def initialize(api_key: nil, **options)
9
- @api_key = Core::Auth.resolve_api_key(api_key)
10
-
11
- client_options = Core::ClientOptions.new(api_key: @api_key, **options)
12
- http = client_options.http_client || Core::HttpClient.new(client_options)
20
+ super
13
21
  @edit_video = Resources::EditVideo.new(http)
14
22
  end
15
23
  end
@@ -3,6 +3,8 @@
3
3
  module RunApi
4
4
  module RunwayAleph
5
5
  module Resources
6
+ # Runway Aleph video editing resource.
7
+ # Transform an existing video using a text prompt and optional style reference image.
6
8
  class EditVideo
7
9
  include RunApi::Core::ResourceHelpers
8
10
 
@@ -14,17 +16,29 @@ module RunApi
14
16
  @http = http
15
17
  end
16
18
 
19
+ # Transform a video and wait until complete.
20
+ #
21
+ # @param params [Hash] edit parameters
22
+ # @return [RunApi::RunwayAleph::Types::CompletedEditVideoResponse] completed task with videos
17
23
  def run(**params)
18
24
  task = create(**params)
19
25
  poll_until_complete { get(task.id) }
20
26
  end
21
27
 
28
+ # Start a video editing task.
29
+ #
30
+ # @param params [Hash] edit parameters
31
+ # @return [RunApi::RunwayAleph::Types::TaskCreateResponse] task creation result with id
22
32
  def create(**params)
23
33
  params = compact_params(params)
24
34
  validate_params!(params)
25
35
  request(:post, ENDPOINT, body: params)
26
36
  end
27
37
 
38
+ # Get video editing task status by task ID.
39
+ #
40
+ # @param id [String] task ID
41
+ # @return [RunApi::RunwayAleph::Types::EditVideoResponse] current task status
28
42
  def get(id)
29
43
  request(:get, "#{ENDPOINT}/#{id}")
30
44
  end
@@ -2,18 +2,24 @@
2
2
 
3
3
  module RunApi
4
4
  module RunwayAleph
5
+ # Type definitions and constants for Runway Aleph video editing.
5
6
  module Types
7
+ # Output aspect ratio options. Includes 21:9 ultra-wide for cinematic letterbox output.
6
8
  ASPECT_RATIOS = %w[16:9 9:16 4:3 3:4 1:1 21:9].freeze
7
9
 
10
+ # A generated output video.
8
11
  class Video < RunApi::Core::BaseModel
9
12
  optional :id, String
10
13
  required :url, String
11
14
  end
12
15
 
16
+ # A reference or extracted image.
13
17
  class Image < RunApi::Core::BaseModel
14
18
  required :url, String
15
19
  end
16
20
 
21
+ # Task status response for a video editing operation.
22
+ # Includes output videos and images when the task completes.
17
23
  class EditVideoResponse < RunApi::Core::TaskResponse
18
24
  required :id, String
19
25
  optional :status, String, enum: -> { RunApi::Core::TaskResponse::Status::ALL }
@@ -22,8 +28,10 @@ module RunApi
22
28
  optional :error, String
23
29
  end
24
30
 
31
+ # Initial response when a video editing task is created.
25
32
  class TaskCreateResponse < EditVideoResponse; end
26
33
 
34
+ # Completed video editing response with guaranteed output videos.
27
35
  class CompletedEditVideoResponse < EditVideoResponse
28
36
  required :videos, [-> { Video }]
29
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-runway-aleph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
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.5
18
+ version: 0.2.6
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.5
25
+ version: 0.2.6
26
26
  description: The runway aleph api Ruby SDK is the language-specific package for Runway
27
27
  Aleph on RunAPI. Use this runway aleph api package for prompt-guided video editing
28
28
  when your application needs JSON request bodies, task status lookup, and consistent