runapi-luma 0.2.6 → 0.2.7

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: 564e060149498fd0586a42c53ddc6ca5379fa7c0d7f20d95f0ec3391521d7d91
4
+ data.tar.gz: d20f909564ecb4f108afa54b6370bfd1fa8b2169e47a7d3162712811fdfdda8a
5
5
  SHA512:
6
- metadata.gz: 8214de6e41dc2adde5aa44cfbdcc81b71834be141b85c8388de954b113512330281e83cb424e974700086fbcf6a879c44b1033326292066091d11f9dbf99cef2
7
- data.tar.gz: 1b01d42f7c69fbeef2670fc76f591e4c459f6dccb658dc4669832ce7b84d0fa12b5877cb373540b38e8f2150804e75a269d8410e87281b1c555bd4ab2508530e
6
+ metadata.gz: 2b6c45120f464db14f633bd5131cf9b18fe9bc1c304e88e6a2432f745aaf287945be99655b676476a98f919a9bb44b8d1cf05cdd49c743e3b2454a5922d83a5c
7
+ data.tar.gz: 292f08bbaaeeac22b5ce62dd29c8bc17d67271b53f213e3bf1696d705db40469dc57320a7b957cf6ba4f17028153692f7bfd2f0b62b8028bc0073b1d1ee07cb1
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
 
@@ -16,10 +16,10 @@ gem install runapi-luma
16
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
@@ -31,7 +31,7 @@ module RunApi
31
31
  # @return [RunApi::Luma::Types::ModifyVideoResponse] task creation result with id
32
32
  def create(**params)
33
33
  params = compact_params(params)
34
- validate_params!(params)
34
+ validate_contract!(CONTRACT["modify-video"], params)
35
35
  request(:post, ENDPOINT, body: params)
36
36
  end
37
37
 
@@ -42,13 +42,6 @@ module RunApi
42
42
  def get(id)
43
43
  request(:get, "#{ENDPOINT}/#{id}")
44
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
- end
52
45
  end
53
46
  end
54
47
  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.7
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.2.7
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.2.7
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:
@@ -65,5 +68,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
68
  requirements: []
66
69
  rubygems_version: 4.0.10
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: []