runapi-topaz 0.2.1 → 0.2.5

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: e86dbb9f547efb7a1c3bbbf9ad5f1f30f7a3b2e8a682ce6821f96578d7e3fc36
4
- data.tar.gz: d9fedb3f0ddd26c9a7c0ed24385e50f37004e3522e42974f84b07392d35062f6
3
+ metadata.gz: 40f94d07e2d993a379822f44b3a4c56e630472b9ec8a0a882c38d746f223206f
4
+ data.tar.gz: f8649bed0ba63f962c14e335546b81dc2d6ec61304b51976309d5bd076e39f23
5
5
  SHA512:
6
- metadata.gz: 97f076f67882de3898f7e0956f626f93cbc4e62f7dfde553f614f5d560824ba52ee854754744dd2cbcddf61510a64f41078afb03646c3cae65bbdc514870815f
7
- data.tar.gz: 80cc131adf8bac5eca114001426c96ecbc461ef09dfcb1a4687d5b8393998ed4172c983a3f08e8a34dcf07eb892b082f46f68a44214748394780ec567483c2f9
6
+ metadata.gz: 59b8eee6de311173b3cd3159918352d2a6ae98714e3ec99d730dfaad9d27e3be87ac185fd76a6a9f20e2cfcbf3fa04f4a86cd6001c5c44474ee997164f27b3fb
7
+ data.tar.gz: 196b238d9eb37a8aecc2574515778dd46469ad2239d9015731cb2599db57e9aadacabfaebedb5797a0930f1fca120d07ea4a352721b7896989ca30139e3401ac
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Topaz API Ruby SDK for RunAPI
2
+
3
+ The topaz api Ruby SDK is the language-specific package for Topaz on RunAPI. Use this topaz api package for image upscale, video upscale, restoration, and production cleanup flows when your application needs JSON request bodies, task status lookup, and consistent RunAPI errors in Ruby.
4
+
5
+ This topaz api README is the Ruby package guide inside the public `topaz-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/topaz; for API reference, use https://runapi.ai/docs#topaz; for SDK docs, use https://runapi.ai/docs#sdk-topaz.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ gem install runapi-topaz
11
+ ```
12
+
13
+ ## Quick start
14
+
15
+ ```ruby
16
+ require "runapi-topaz"
17
+
18
+ client = RunApi::Topaz::Client.new
19
+ task = client.image_upscales.create(
20
+ # Pass the Topaz JSON request body from https://runapi.ai/docs#topaz.
21
+ )
22
+ status = client.image_upscales.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
+ ## Language notes
28
+
29
+ Use Ruby keyword arguments and the `RunApi::Topaz` error classes when building upscaling jobs, Rails workers, or scripts. The available resources include image upscales, and video upscales. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
30
+
31
+ ## Links
32
+
33
+ - Model page: https://runapi.ai/models/topaz
34
+ - SDK docs: https://runapi.ai/docs#sdk-topaz
35
+ - Product docs: https://runapi.ai/docs#topaz
36
+ - Pricing and rate limits: https://runapi.ai/models/topaz/upscale-image
37
+ - Provider comparison: https://runapi.ai/providers/topaz
38
+ - Full catalog: https://runapi.ai/models
39
+ - Repository: https://github.com/runapi-ai/topaz-sdk
40
+
41
+ ## License
42
+
43
+ Licensed under the Apache License, Version 2.0.
@@ -34,11 +34,11 @@ module RunApi
34
34
 
35
35
  def validate_params!(params)
36
36
  raise Core::ValidationError, "model is required" unless param(params, :model) == Types::UPSCALE_IMAGE_MODEL
37
- raise Core::ValidationError, "image_url is required" unless param(params, :image_url)
37
+ raise Core::ValidationError, "source_image_url is required" unless param(params, :source_image_url)
38
38
 
39
39
  factor = param(params, :upscale_factor)
40
40
  raise Core::ValidationError, "upscale_factor is required" unless factor
41
- return if Types::UPSCALE_IMAGE_FACTORS.include?(factor.to_s)
41
+ return if Types::UPSCALE_IMAGE_FACTORS.include?(factor)
42
42
 
43
43
  raise Core::ValidationError, "upscale_factor must be one of: #{Types::UPSCALE_IMAGE_FACTORS.join(", ")}"
44
44
  end
@@ -34,10 +34,10 @@ module RunApi
34
34
 
35
35
  def validate_params!(params)
36
36
  raise Core::ValidationError, "model is required" unless param(params, :model) == Types::UPSCALE_VIDEO_MODEL
37
- raise Core::ValidationError, "video_url is required" unless param(params, :video_url)
37
+ raise Core::ValidationError, "source_video_url is required" unless param(params, :source_video_url)
38
38
 
39
39
  factor = param(params, :upscale_factor)
40
- return unless factor && !Types::UPSCALE_VIDEO_FACTORS.include?(factor.to_s)
40
+ return unless factor && !Types::UPSCALE_VIDEO_FACTORS.include?(factor)
41
41
 
42
42
  raise Core::ValidationError, "upscale_factor must be one of: #{Types::UPSCALE_VIDEO_FACTORS.join(", ")}"
43
43
  end
@@ -3,10 +3,10 @@
3
3
  module RunApi
4
4
  module Topaz
5
5
  module Types
6
- UPSCALE_IMAGE_MODEL = "topaz-image-upscale"
7
- UPSCALE_VIDEO_MODEL = "topaz-video-upscale"
8
- UPSCALE_IMAGE_FACTORS = %w[1 2 4 8].freeze
9
- UPSCALE_VIDEO_FACTORS = %w[1 2 4].freeze
6
+ UPSCALE_IMAGE_MODEL = "topaz-upscale-image"
7
+ UPSCALE_VIDEO_MODEL = "topaz-upscale-video"
8
+ UPSCALE_IMAGE_FACTORS = [1, 2, 4, 8].freeze
9
+ UPSCALE_VIDEO_FACTORS = [1, 2, 4].freeze
10
10
 
11
11
  class Image < RunApi::Core::BaseModel
12
12
  optional :url, String
@@ -19,23 +19,23 @@ module RunApi
19
19
  class UpscaleImageResponse < RunApi::Core::TaskResponse
20
20
  required :id, String
21
21
  optional :status, String, enum: -> { RunApi::Core::TaskResponse::Status::ALL }
22
- optional :images, [ -> { Image } ]
22
+ optional :images, [-> { Image }]
23
23
  optional :error, String
24
24
  end
25
25
 
26
26
  class UpscaleVideoResponse < RunApi::Core::TaskResponse
27
27
  required :id, String
28
28
  optional :status, String, enum: -> { RunApi::Core::TaskResponse::Status::ALL }
29
- optional :videos, [ -> { Video } ]
29
+ optional :videos, [-> { Video }]
30
30
  optional :error, String
31
31
  end
32
32
 
33
33
  class CompletedUpscaleImageResponse < UpscaleImageResponse
34
- required :images, [ -> { Image } ]
34
+ required :images, [-> { Image }]
35
35
  end
36
36
 
37
37
  class CompletedUpscaleVideoResponse < UpscaleVideoResponse
38
- required :videos, [ -> { Video } ]
38
+ required :videos, [-> { Video }]
39
39
  end
40
40
  end
41
41
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-topaz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.5
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.1'
18
+ version: 0.2.5
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.1'
26
- description: RunAPI Topaz SDK for JavaScript, Ruby, and Go
25
+ version: 0.2.5
26
+ description: The topaz api Ruby SDK is the language-specific package for Topaz on
27
+ RunAPI. Use this topaz api package for image upscale, video upscale, restoration,
28
+ and production cleanup flows when your application needs JSON request bodies, task
29
+ status 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-topaz.rb
35
40
  - lib/runapi/topaz.rb
36
41
  - lib/runapi/topaz/client.rb
@@ -42,7 +47,7 @@ licenses:
42
47
  - Apache-2.0
43
48
  metadata:
44
49
  homepage_uri: https://runapi.ai/models/topaz
45
- documentation_uri: https://runapi.ai/models/topaz
50
+ documentation_uri: https://github.com/runapi-ai/topaz-sdk/blob/main/ruby/README.md
46
51
  source_code_uri: https://github.com/runapi-ai/topaz-sdk
47
52
  changelog_uri: https://github.com/runapi-ai/topaz-sdk/blob/main/CHANGELOG.md
48
53
  rdoc_options: []
@@ -59,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
64
  - !ruby/object:Gem::Version
60
65
  version: '0'
61
66
  requirements: []
62
- rubygems_version: 4.0.6
67
+ rubygems_version: 4.0.10
63
68
  specification_version: 4
64
- summary: Topaz API SDKs for JavaScript, Ruby, and Go on RunAPI.
69
+ summary: Topaz API Ruby SDK for RunAPI
65
70
  test_files: []