runapi-luma 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: a534b8161b9606234d3c2c79dafaa70ea8d7108c766e3c2abc582d9dfe9efef9
4
- data.tar.gz: 4b6e1751bb3952d519fe4be8f3c636753fe1fcd41f2892cfd7696156adea9aca
3
+ metadata.gz: 6f3a9935337054660c49221757d58ca7955e6a8bc84c22d022b49ab785e4a6db
4
+ data.tar.gz: 5f9beacc2172af016a55c3d3db21b9da716f090a8c85e819d0c76de7682aefb4
5
5
  SHA512:
6
- metadata.gz: 8214de6e41dc2adde5aa44cfbdcc81b71834be141b85c8388de954b113512330281e83cb424e974700086fbcf6a879c44b1033326292066091d11f9dbf99cef2
7
- data.tar.gz: 1b01d42f7c69fbeef2670fc76f591e4c459f6dccb658dc4669832ce7b84d0fa12b5877cb373540b38e8f2150804e75a269d8410e87281b1c555bd4ab2508530e
6
+ metadata.gz: 447f1f970668a50728f5ab16fc4997a5974e7190c5c3370a088b113a03cf3d4cde6e4a4b2846f63fb6828003230768a21e269712a4a4ae21ca4417b3c8091e0c
7
+ data.tar.gz: 64a9e4489d0e3e55e6de84c609e6e1f3773998ccd39b6b37f624f5ba67c8006cbd8ed485e1df99bea0adcfe6582eeec5378e15bbca9c08219b9e75668a31b546
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # Luma AI API Ruby SDK for RunAPI
1
+ # Luma API Ruby SDK for RunAPI
2
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.
3
+ The Luma Ruby SDK is the language-specific package for Luma 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 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.
5
+ This 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
6
 
7
7
  ## Install
8
8
 
@@ -13,13 +13,13 @@ gem install runapi-luma
13
13
  ## Quick start
14
14
 
15
15
  ```ruby
16
- require "runapi-luma"
16
+ require "runapi/luma"
17
17
 
18
18
  client = RunApi::Luma::Client.new
19
- task = client.video_modifications.create(
19
+ task = client.modify_video.create(
20
20
  # Pass the Luma JSON request body from https://runapi.ai/docs#luma.
21
21
  )
22
- status = client.video_modifications.get(task.id)
22
+ status = client.modify_video.get(task.id)
23
23
  ```
24
24
 
25
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.
@@ -28,7 +28,7 @@ RunAPI-generated file URLs are temporary. Download and store generated images, v
28
28
 
29
29
  ## Language notes
30
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.
31
+ Use Ruby keyword arguments and the `RunApi::Luma` error classes when building video jobs, Rails workers, or scripts. The available resources are `modify_video`. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
32
32
 
33
33
  ## Links
34
34
 
@@ -10,7 +10,7 @@ module RunApi
10
10
  # client = RunApi::Luma::Client.new(api_key: "your-api-key")
11
11
  # result = client.modify_video.run(
12
12
  # prompt: "Add a dramatic sunset lighting effect",
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::ModifyVideo] Prompt-guided video editing that preserves source motion.
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RunApi
4
+ module Luma
5
+ CONTRACT = {
6
+ "modify-video" => {
7
+ "models" => ["luma-modify-video"],
8
+ "fields_by_model" => {
9
+ "luma-modify-video" => {
10
+ "prompt" => {
11
+ "required" => true
12
+ },
13
+ "source_video_url" => {
14
+ "required" => true
15
+ }
16
+ }
17
+ }
18
+ }
19
+ }.freeze
20
+ end
21
+ end
@@ -20,34 +20,27 @@ module RunApi
20
20
  #
21
21
  # @param params [Hash] modification parameters
22
22
  # @return [RunApi::Luma::Types::CompletedModifyVideoResponse] completed task with videos
23
- def run(**params)
24
- task = create(**params)
25
- poll_until_complete { get(task.id) }
23
+ def run(options: nil, **params)
24
+ task = create(options: options, **params)
25
+ poll_until_complete { get(task.id, options: options) }
26
26
  end
27
27
 
28
28
  # Start a video modification task.
29
29
  #
30
30
  # @param params [Hash] modification parameters
31
31
  # @return [RunApi::Luma::Types::ModifyVideoResponse] task creation result with id
32
- def create(**params)
32
+ def create(options: nil, **params)
33
33
  params = compact_params(params)
34
- validate_params!(params)
35
- request(:post, ENDPOINT, body: params)
34
+ validate_contract!(CONTRACT["modify-video"], params)
35
+ request(:post, ENDPOINT, body: params, options: options)
36
36
  end
37
37
 
38
38
  # Get video modification task status by task ID.
39
39
  #
40
40
  # @param id [String] task ID
41
41
  # @return [RunApi::Luma::Types::ModifyVideoResponse] 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)
42
+ def get(id, options: nil)
43
+ request(:get, "#{ENDPOINT}/#{id}", options: options)
51
44
  end
52
45
  end
53
46
  end
data/lib/runapi/luma.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "runapi/core"
4
4
  require_relative "luma/types"
5
+ require_relative "luma/contract_gen"
5
6
  require_relative "luma/resources/modify_video"
6
7
  require_relative "luma/client"
7
8
 
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.6
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - RunAPI
@@ -15,18 +15,18 @@ 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 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.
25
+ version: 0.3.0
26
+ description: The Luma Ruby SDK is the language-specific package for Luma on RunAPI.
27
+ Use this package for video generation, animation, and video editing workflows when
28
+ your application needs request bodies, task status lookup, and consistent RunAPI
29
+ errors in Ruby.
30
30
  email:
31
31
  - contact@runapi.ai
32
32
  executables: []
@@ -39,15 +39,18 @@ files:
39
39
  - lib/runapi-luma.rb
40
40
  - lib/runapi/luma.rb
41
41
  - lib/runapi/luma/client.rb
42
+ - lib/runapi/luma/contract_gen.rb
42
43
  - lib/runapi/luma/resources/modify_video.rb
43
44
  - lib/runapi/luma/types.rb
44
45
  homepage: https://runapi.ai/models/luma
45
46
  licenses:
46
47
  - Apache-2.0
47
48
  metadata:
49
+ runapi_slug: luma
48
50
  homepage_uri: https://runapi.ai/models/luma
49
51
  documentation_uri: https://github.com/runapi-ai/luma-sdk/blob/main/ruby/README.md
50
52
  source_code_uri: https://github.com/runapi-ai/luma-sdk
53
+ bug_tracker_uri: https://github.com/runapi-ai/luma-sdk/issues
51
54
  changelog_uri: https://github.com/runapi-ai/luma-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: Luma AI API Ruby SDK for RunAPI
71
+ summary: Luma API Ruby SDK for RunAPI
69
72
  test_files: []