runapi-runway-aleph 0.2.6 → 0.2.8

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: 6cd1a2c7953995524e7ce7c3f88f2667e2b923ed82a239d62fa63e4b9a1870b3
4
- data.tar.gz: d24449e7225a3550b3d4c060f05cdd39e36668cae35f0017b30de4d68afc879f
3
+ metadata.gz: 8639c2c2d11c0efe7d3983a5a4460c2aed33703ef93b0bb1ee4068e37ca97eb4
4
+ data.tar.gz: 3769b75c4223b85b22e4386a60ff6577a4e779b040b68ff525de344a16cfb1cb
5
5
  SHA512:
6
- metadata.gz: fc7b7a96bb69611bc2efb285636fe28eab811cf00ec7552d34caf9d77036bab3cbefc0af2a279f0f2ef2e137b874c1434adf6d12d95100643c1cc49e2cdbca73
7
- data.tar.gz: b1b83c07f3af2882cfce0f564d53ad7cd39bd9e54d95ac0b4ab13a42bd9ec3785de2f14f383c00cbb71cfe0289526f85afbbd4d49553c6be0d33322bbbd746c0
6
+ metadata.gz: 835997af0befd6a743d2fb21033082060803b4be6f0ad068b3ba00b19b041b501faa234768150313fa13b7ebea5201768df17293d3196715d7442fa69f5b7ede
7
+ data.tar.gz: cf0eaeebf856af02e2232a78bcb67c8f8c6dc01c17a319ba389a7154ee2fe2173aeb0db744c023aaf4b6f8cf90c08616ece68926e99a24201db01b05427396a9
data/README.md CHANGED
@@ -1,19 +1,19 @@
1
- # Runway Aleph API Ruby SDK for RunAPI
1
+ # Runway Aleph Ruby SDK for RunAPI
2
2
 
3
- The runway aleph api Ruby SDK is the language-specific package for Runway Aleph on RunAPI. Use this runway aleph api package for prompt-guided video editing when your application needs JSON request bodies, task status lookup, and consistent RunAPI errors in Ruby.
3
+ The Runway Aleph Ruby SDK is the language-specific package for Runway Aleph on RunAPI. Use this package for video generation, animation, and video editing workflows when your application needs request bodies, task status lookup, and consistent RunAPI errors in Ruby.
4
4
 
5
- This runway aleph api README is the Ruby package guide inside the public `runway-aleph-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/runway-aleph; for API reference, use https://runapi.ai/docs#runway-aleph; for SDK docs, use https://runapi.ai/docs#sdk-runway-aleph.
5
+ This README is the Ruby package guide inside the public `runway-aleph-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/runway-aleph; for API reference, use https://runapi.ai/docs#runway-aleph; for SDK docs, use https://runapi.ai/docs#sdk-runway-aleph.
6
6
 
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- gem install runapi-runway_aleph
10
+ gem install runapi-runway-aleph
11
11
  ```
12
12
 
13
13
  ## Quick start
14
14
 
15
15
  ```ruby
16
- require "runapi-runway_aleph"
16
+ require "runapi/runway_aleph"
17
17
 
18
18
  client = RunApi::RunwayAleph::Client.new
19
19
  task = client.edit_video.create(
@@ -10,7 +10,7 @@ module RunApi
10
10
  # client = RunApi::RunwayAleph::Client.new(api_key: "your-api-key")
11
11
  # result = client.edit_video.run(
12
12
  # prompt: "Make it look like a watercolor painting",
13
- # source_video_url: "https://example.com/input.mp4"
13
+ # source_video_url: "https://cdn.runapi.ai/public/samples/video.mp4"
14
14
  # )
15
15
  class Client < RunApi::Core::Client
16
16
  # @return [Resources::EditVideo] Prompt-driven video editing with optional style reference.
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RunApi
4
+ module RunwayAleph
5
+ CONTRACT = {
6
+ "edit-video" => {
7
+ "models" => ["runway-aleph"],
8
+ "fields_by_model" => {
9
+ "runway-aleph" => {
10
+ "aspect_ratio" => {
11
+ "enum" => ["16:9", "9:16", "4:3", "3:4", "1:1", "21:9"]
12
+ },
13
+ "prompt" => {
14
+ "required" => true
15
+ },
16
+ "seed" => {
17
+ "type" => "integer"
18
+ },
19
+ "source_video_url" => {
20
+ "required" => true
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }.freeze
26
+ end
27
+ end
@@ -11,6 +11,7 @@ module RunApi
11
11
  ENDPOINT = "/api/v1/runway_aleph/edit_video"
12
12
  RESPONSE_CLASS = Types::TaskCreateResponse
13
13
  COMPLETED_RESPONSE_CLASS = Types::CompletedEditVideoResponse
14
+ MODEL = "runway-aleph"
14
15
 
15
16
  def initialize(http)
16
17
  @http = http
@@ -20,35 +21,27 @@ module RunApi
20
21
  #
21
22
  # @param params [Hash] edit parameters
22
23
  # @return [RunApi::RunwayAleph::Types::CompletedEditVideoResponse] completed task with videos
23
- def run(**params)
24
- task = create(**params)
25
- poll_until_complete { get(task.id) }
24
+ def run(options: nil, **params)
25
+ task = create(options: options, **params)
26
+ poll_until_complete { get(task.id, options: options) }
26
27
  end
27
28
 
28
29
  # Start a video editing task.
29
30
  #
30
31
  # @param params [Hash] edit parameters
31
32
  # @return [RunApi::RunwayAleph::Types::TaskCreateResponse] task creation result with id
32
- def create(**params)
33
+ def create(options: nil, **params)
33
34
  params = compact_params(params)
34
- validate_params!(params)
35
- request(:post, ENDPOINT, body: params)
35
+ validate_contract!(CONTRACT["edit-video"], params.merge(model: MODEL))
36
+ request(:post, ENDPOINT, body: params, options: options)
36
37
  end
37
38
 
38
39
  # Get video editing task status by task ID.
39
40
  #
40
41
  # @param id [String] task ID
41
42
  # @return [RunApi::RunwayAleph::Types::EditVideoResponse] current task status
42
- def get(id)
43
- request(:get, "#{ENDPOINT}/#{id}")
44
- end
45
-
46
- private
47
-
48
- def validate_params!(params)
49
- raise Core::ValidationError, "prompt is required" unless param(params, :prompt)
50
- raise Core::ValidationError, "source_video_url is required" unless param(params, :source_video_url)
51
- validate_optional!(params, :aspect_ratio, Types::ASPECT_RATIOS)
43
+ def get(id, options: nil)
44
+ request(:get, "#{ENDPOINT}/#{id}", options: options)
52
45
  end
53
46
  end
54
47
  end
@@ -4,9 +4,6 @@ module RunApi
4
4
  module RunwayAleph
5
5
  # Type definitions and constants for Runway Aleph video editing.
6
6
  module Types
7
- # Output aspect ratio options. Includes 21:9 ultra-wide for cinematic letterbox output.
8
- ASPECT_RATIOS = %w[16:9 9:16 4:3 3:4 1:1 21:9].freeze
9
-
10
7
  # A generated output video.
11
8
  class Video < RunApi::Core::BaseModel
12
9
  optional :id, String
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "runapi/core"
4
4
  require_relative "runway_aleph/types"
5
+ require_relative "runway_aleph/contract_gen"
5
6
  require_relative "runway_aleph/resources/edit_video"
6
7
  require_relative "runway_aleph/client"
7
8
 
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.6
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - RunAPI
@@ -15,17 +15,17 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.2.6
18
+ version: 0.3.0
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.6
26
- description: The runway aleph api Ruby SDK is the language-specific package for Runway
27
- Aleph on RunAPI. Use this runway aleph api package for prompt-guided video editing
28
- when your application needs JSON request bodies, task status lookup, and consistent
25
+ version: 0.3.0
26
+ description: The Runway Aleph Ruby SDK is the language-specific package for Runway
27
+ Aleph on RunAPI. Use this package for video generation, animation, and video editing
28
+ workflows when your application needs request bodies, task status lookup, and consistent
29
29
  RunAPI errors in Ruby.
30
30
  email:
31
31
  - support@runapi.ai
@@ -39,15 +39,18 @@ files:
39
39
  - lib/runapi-runway_aleph.rb
40
40
  - lib/runapi/runway_aleph.rb
41
41
  - lib/runapi/runway_aleph/client.rb
42
+ - lib/runapi/runway_aleph/contract_gen.rb
42
43
  - lib/runapi/runway_aleph/resources/edit_video.rb
43
44
  - lib/runapi/runway_aleph/types.rb
44
45
  homepage: https://runapi.ai/models/runway-aleph
45
46
  licenses:
46
47
  - Apache-2.0
47
48
  metadata:
49
+ runapi_slug: runway-aleph
48
50
  homepage_uri: https://runapi.ai/models/runway-aleph
49
51
  documentation_uri: https://github.com/runapi-ai/runway-aleph-sdk/blob/main/ruby/README.md
50
52
  source_code_uri: https://github.com/runapi-ai/runway-aleph-sdk
53
+ bug_tracker_uri: https://github.com/runapi-ai/runway-aleph-sdk/issues
51
54
  changelog_uri: https://github.com/runapi-ai/runway-aleph-sdk/blob/main/CHANGELOG.md
52
55
  rdoc_options: []
53
56
  require_paths:
@@ -63,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
66
  - !ruby/object:Gem::Version
64
67
  version: '0'
65
68
  requirements: []
66
- rubygems_version: 4.0.10
69
+ rubygems_version: 4.0.17
67
70
  specification_version: 4
68
- summary: Runway Aleph API Ruby SDK for RunAPI
71
+ summary: Runway Aleph Ruby SDK for RunAPI
69
72
  test_files: []