runapi-luma 0.2.4 → 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: d353328b60c0131de6c6507b61bce500f54199a690651297fb6a1cd3a1aff6f7
4
- data.tar.gz: 65d9526976c6564cad2c5bbe806dc7404584b6a185f35546a50c4ff4a3e32819
3
+ metadata.gz: a534b8161b9606234d3c2c79dafaa70ea8d7108c766e3c2abc582d9dfe9efef9
4
+ data.tar.gz: 4b6e1751bb3952d519fe4be8f3c636753fe1fcd41f2892cfd7696156adea9aca
5
5
  SHA512:
6
- metadata.gz: 924973089eee683e2a01619e2c002431e16704bbb52c7246df90a76b7a9ff0331eaf05e9af916d149b137920f701d9baf185703323d03d2e094c47b722323a5f
7
- data.tar.gz: 2b9031377013a26bda82a79ccf0178bfcec43d5741f5fb05f440047b71a69678e3ca0ed6e9a8aeaaff4ccf09b1885295a81e4650aa5b18c185cc7385b6172529
6
+ metadata.gz: 8214de6e41dc2adde5aa44cfbdcc81b71834be141b85c8388de954b113512330281e83cb424e974700086fbcf6a879c44b1033326292066091d11f9dbf99cef2
7
+ data.tar.gz: 1b01d42f7c69fbeef2670fc76f591e4c459f6dccb658dc4669832ce7b84d0fa12b5877cb373540b38e8f2150804e75a269d8410e87281b1c555bd4ab2508530e
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Luma AI API Ruby SDK for RunAPI
2
+
3
+ The luma ai api Ruby SDK is the language-specific package for Luma on RunAPI. Use this luma ai api package for text-to-video, image-to-video, video editing, and animation flows when your application needs JSON request bodies, task status lookup, and consistent RunAPI errors in Ruby.
4
+
5
+ This luma ai api README is the Ruby package guide inside the public `luma-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/luma; for API reference, use https://runapi.ai/docs#luma; for SDK docs, use https://runapi.ai/docs#sdk-luma.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ gem install runapi-luma
11
+ ```
12
+
13
+ ## Quick start
14
+
15
+ ```ruby
16
+ require "runapi-luma"
17
+
18
+ client = RunApi::Luma::Client.new
19
+ task = client.video_modifications.create(
20
+ # Pass the Luma JSON request body from https://runapi.ai/docs#luma.
21
+ )
22
+ status = client.video_modifications.get(task.id)
23
+ ```
24
+
25
+ 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.
26
+
27
+ 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.
28
+
29
+ ## Language notes
30
+
31
+ Use Ruby keyword arguments and the `RunApi::Luma` error classes when building video jobs, Rails workers, or scripts. The available resources include video modifications. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
32
+
33
+ ## Links
34
+
35
+ - Model page: https://runapi.ai/models/luma
36
+ - SDK docs: https://runapi.ai/docs#sdk-luma
37
+ - Product docs: https://runapi.ai/docs#luma
38
+ - Pricing and rate limits: https://runapi.ai/models/luma
39
+ - Provider comparison: https://runapi.ai/providers/luma
40
+ - Full catalog: https://runapi.ai/models
41
+ - Repository: https://github.com/runapi-ai/luma-sdk
42
+
43
+ ## License
44
+
45
+ Licensed under the Apache License, Version 2.0.
@@ -2,14 +2,22 @@
2
2
 
3
3
  module RunApi
4
4
  module Luma
5
- class Client
5
+ # Luma prompt-guided video modification API client.
6
+ # Applies visual edits to an existing video -- changing style, adjusting atmosphere,
7
+ # or adding effects -- while preserving the source motion.
8
+ #
9
+ # @example
10
+ # client = RunApi::Luma::Client.new(api_key: "your-api-key")
11
+ # result = client.modify_video.run(
12
+ # prompt: "Add a dramatic sunset lighting effect",
13
+ # source_video_url: "https://example.com/input.mp4"
14
+ # )
15
+ class Client < RunApi::Core::Client
16
+ # @return [Resources::ModifyVideo] Prompt-guided video editing that preserves source motion.
6
17
  attr_reader :modify_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
  @modify_video = Resources::ModifyVideo.new(http)
14
22
  end
15
23
  end
@@ -3,6 +3,8 @@
3
3
  module RunApi
4
4
  module Luma
5
5
  module Resources
6
+ # Luma video modification resource.
7
+ # Apply prompt-guided visual edits to an existing video while preserving its motion.
6
8
  class ModifyVideo
7
9
  include RunApi::Core::ResourceHelpers
8
10
 
@@ -14,17 +16,29 @@ module RunApi
14
16
  @http = http
15
17
  end
16
18
 
19
+ # Modify a video and wait until complete.
20
+ #
21
+ # @param params [Hash] modification parameters
22
+ # @return [RunApi::Luma::Types::CompletedModifyVideoResponse] 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 modification task.
29
+ #
30
+ # @param params [Hash] modification parameters
31
+ # @return [RunApi::Luma::Types::ModifyVideoResponse] 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 modification task status by task ID.
39
+ #
40
+ # @param id [String] task ID
41
+ # @return [RunApi::Luma::Types::ModifyVideoResponse] current task status
28
42
  def get(id)
29
43
  request(:get, "#{ENDPOINT}/#{id}")
30
44
  end
@@ -33,7 +47,7 @@ module RunApi
33
47
 
34
48
  def validate_params!(params)
35
49
  raise Core::ValidationError, "prompt is required" unless param(params, :prompt)
36
- raise Core::ValidationError, "video_url is required" unless param(params, :video_url)
50
+ raise Core::ValidationError, "source_video_url is required" unless param(params, :source_video_url)
37
51
  end
38
52
  end
39
53
  end
@@ -2,24 +2,30 @@
2
2
 
3
3
  module RunApi
4
4
  module Luma
5
+ # Type definitions and constants for Luma video modification.
5
6
  module Types
7
+ # A video file with a download URL.
6
8
  class Video < RunApi::Core::BaseModel
7
9
  optional :url, String
8
10
  end
9
11
 
12
+ # Base async task response with id and status tracking.
10
13
  class AsyncTaskResponse < RunApi::Core::TaskResponse
11
14
  required :id, String
12
15
  optional :status, String, enum: -> { RunApi::Core::TaskResponse::Status::ALL }
13
16
  end
14
17
 
18
+ # Task status response for a video modification operation.
19
+ # On completion, +videos+ contains the modified output and +sources+ contains the original input.
15
20
  class ModifyVideoResponse < AsyncTaskResponse
16
- optional :videos, [ -> { Video } ]
17
- optional :sources, [ -> { Video } ]
21
+ optional :videos, [-> { Video }]
22
+ optional :sources, [-> { Video }]
18
23
  optional :error, String
19
24
  end
20
25
 
26
+ # Completed video modification response with guaranteed output videos.
21
27
  class CompletedModifyVideoResponse < ModifyVideoResponse
22
- required :videos, [ -> { Video } ]
28
+ required :videos, [-> { Video }]
23
29
  end
24
30
  end
25
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-luma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - RunAPI
@@ -15,22 +15,27 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.2.4
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.4
26
- description: RunAPI Luma SDK for JavaScript, Ruby, and Go
25
+ version: 0.2.6
26
+ description: The luma ai api Ruby SDK is the language-specific package for Luma on
27
+ RunAPI. Use this luma ai api package for text-to-video, image-to-video, video editing,
28
+ and animation flows when your application needs JSON request bodies, task status
29
+ lookup, and consistent RunAPI errors in Ruby.
27
30
  email:
28
31
  - contact@runapi.ai
29
32
  executables: []
30
33
  extensions: []
31
- extra_rdoc_files: []
34
+ extra_rdoc_files:
35
+ - README.md
32
36
  files:
33
37
  - LICENSE
38
+ - README.md
34
39
  - lib/runapi-luma.rb
35
40
  - lib/runapi/luma.rb
36
41
  - lib/runapi/luma/client.rb
@@ -41,7 +46,7 @@ licenses:
41
46
  - Apache-2.0
42
47
  metadata:
43
48
  homepage_uri: https://runapi.ai/models/luma
44
- documentation_uri: https://github.com/runapi-ai/luma-sdk/blob/main/README.md
49
+ documentation_uri: https://github.com/runapi-ai/luma-sdk/blob/main/ruby/README.md
45
50
  source_code_uri: https://github.com/runapi-ai/luma-sdk
46
51
  changelog_uri: https://github.com/runapi-ai/luma-sdk/blob/main/CHANGELOG.md
47
52
  rdoc_options: []
@@ -60,5 +65,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
65
  requirements: []
61
66
  rubygems_version: 4.0.10
62
67
  specification_version: 4
63
- summary: Luma API SDKs for JavaScript, Ruby, and Go on RunAPI.
68
+ summary: Luma AI API Ruby SDK for RunAPI
64
69
  test_files: []