runapi-hailuo 0.2.12 → 0.4.0

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: b2d8d4c804b4f9670a51cf9a27d0d2402075171ba9880adf4e78249f42ef0e8e
4
- data.tar.gz: 1507a5422bfb40e1b8a101f20ca2fc8b430a037badcb4dbd1f48e3b827b3c01a
3
+ metadata.gz: f4a52e34be8cf51a594d3191ae16b9623435ef85e4e9c7770dd0439d8c36490f
4
+ data.tar.gz: d6ef96176caa93d6f7c4171d99faa94e066abdd6a22e176e2ac19df7b3713534
5
5
  SHA512:
6
- metadata.gz: d96319c9936307a6258cf34d31add634948baa5e90da6a7e6d8260b2fa54af10e4a815d01c24a123b1aaa7de7d26e0051dcbc7d82fa19eb5f5a347ae53fd01a6
7
- data.tar.gz: d79a08e5b0b8c08be12809902c20af61dcc6575a528bc2ff479ab22767a91041ea81c65ea15829819f8cf2f2406925803f0b51d031f75ad6282de1052f98b8bd
6
+ metadata.gz: cc0b094c91ff7cb7adb1fa9011f866371cb35bc6c0543ebd84379bd9d97f4163b6cdfffba46311d20217428aa7d92bfccaeed638f17304cf802cf037e081adbd
7
+ data.tar.gz: 4dbe68466745fe574664d1c6086d92798ca2059df3229b12cf1a656d0c471d374ee2d2b62bc04f0cce8b3336978a357a5bbdaaa68b57b1b2a72cabdb477c877f
@@ -32,7 +32,6 @@ module RunApi
32
32
  # @return [RunApi::Hailuo::Types::VideoTaskResponse] task creation result with id
33
33
  def create(options: nil, **params)
34
34
  params = compact_params(params)
35
- validate_params!(params)
36
35
  request(:post, ENDPOINT, body: params, options: options)
37
36
  end
38
37
 
@@ -43,30 +42,6 @@ module RunApi
43
42
  def get(id, options: nil)
44
43
  request(:get, "#{ENDPOINT}/#{id}", options: options)
45
44
  end
46
-
47
- private
48
-
49
- def validate_params!(params)
50
- validate_contract!(CONTRACT["image-to-video"], params)
51
-
52
- raise Core::ValidationError, "prompt is required" unless param(params, :prompt)
53
-
54
- model = param(params, :model)
55
- duration_seconds = param(params, :duration_seconds)
56
- output_resolution = param(params, :output_resolution)
57
-
58
- case model
59
- when "hailuo-02-image-to-video-pro"
60
- raise Core::ValidationError, "duration_seconds is not supported for #{model}" if duration_seconds
61
- raise Core::ValidationError, "output_resolution is not supported for #{model}" if output_resolution
62
- when "hailuo-2.3-image-to-video-pro", "hailuo-2.3-image-to-video-standard"
63
- raise Core::ValidationError, "last_frame_image_url is not supported for #{model}" if param(params, :last_frame_image_url)
64
- raise Core::ValidationError, "prompt_optimizer is not supported for #{model}" if param(params, :prompt_optimizer)
65
- if duration_seconds == 10 && output_resolution.to_s == "1080p"
66
- raise Core::ValidationError, "1080p does not support 10-second duration"
67
- end
68
- end
69
- end
70
45
  end
71
46
  end
72
47
  end
@@ -32,7 +32,6 @@ module RunApi
32
32
  # @return [RunApi::Hailuo::Types::VideoTaskResponse] task creation result with id
33
33
  def create(options: nil, **params)
34
34
  params = compact_params(params)
35
- validate_params!(params)
36
35
  request(:post, ENDPOINT, body: params, options: options)
37
36
  end
38
37
 
@@ -43,19 +42,6 @@ module RunApi
43
42
  def get(id, options: nil)
44
43
  request(:get, "#{ENDPOINT}/#{id}", options: options)
45
44
  end
46
-
47
- private
48
-
49
- def validate_params!(params)
50
- validate_contract!(CONTRACT["text-to-video"], params)
51
-
52
- raise Core::ValidationError, "prompt is required" unless param(params, :prompt)
53
-
54
- model = param(params, :model)
55
- if model == "hailuo-02-text-to-video-pro" && param(params, :duration_seconds)
56
- raise Core::ValidationError, "duration_seconds is not supported for #{model}"
57
- end
58
- end
59
45
  end
60
46
  end
61
47
  end
data/lib/runapi/hailuo.rb CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "runapi/core"
4
4
  require_relative "hailuo/types"
5
- require_relative "hailuo/contract_gen"
6
5
  require_relative "hailuo/resources/text_to_video"
7
6
  require_relative "hailuo/resources/image_to_video"
8
7
  require_relative "hailuo/client"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-hailuo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - RunAPI
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.5.0
18
+ version: 0.6.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.5.0
25
+ version: 0.6.0
26
26
  description: The Hailuo Ruby SDK is the language-specific package for Hailuo on RunAPI.
27
27
  Use this package for video generation, animation, and video editing workflows when
28
28
  your application needs request bodies, task status lookup, and consistent RunAPI
@@ -39,7 +39,6 @@ files:
39
39
  - lib/runapi-hailuo.rb
40
40
  - lib/runapi/hailuo.rb
41
41
  - lib/runapi/hailuo/client.rb
42
- - lib/runapi/hailuo/contract_gen.rb
43
42
  - lib/runapi/hailuo/resources/image_to_video.rb
44
43
  - lib/runapi/hailuo/resources/text_to_video.rb
45
44
  - lib/runapi/hailuo/types.rb
@@ -67,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
66
  - !ruby/object:Gem::Version
68
67
  version: '0'
69
68
  requirements: []
70
- rubygems_version: 4.0.17
69
+ rubygems_version: 4.0.10
71
70
  specification_version: 4
72
71
  summary: Hailuo API Ruby SDK for RunAPI
73
72
  test_files: []
@@ -1,73 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RunApi
4
- module Hailuo
5
- CONTRACT = {
6
- "image-to-video" => {
7
- "models" => ["hailuo-02-image-to-video-pro", "hailuo-02-image-to-video-standard", "hailuo-2.3-image-to-video-pro", "hailuo-2.3-image-to-video-standard"],
8
- "fields_by_model" => {
9
- "hailuo-02-image-to-video-pro" => {
10
- "duration_seconds" => {
11
- "type" => "integer"
12
- },
13
- "first_frame_image_url" => {
14
- "required" => true
15
- }
16
- },
17
- "hailuo-02-image-to-video-standard" => {
18
- "duration_seconds" => {
19
- "enum" => [6, 10],
20
- "type" => "integer"
21
- },
22
- "first_frame_image_url" => {
23
- "required" => true
24
- },
25
- "output_resolution" => {
26
- "enum" => ["512p", "768p"]
27
- }
28
- },
29
- "hailuo-2.3-image-to-video-pro" => {
30
- "duration_seconds" => {
31
- "enum" => [6, 10],
32
- "type" => "integer"
33
- },
34
- "first_frame_image_url" => {
35
- "required" => true
36
- },
37
- "output_resolution" => {
38
- "enum" => ["768p", "1080p"]
39
- }
40
- },
41
- "hailuo-2.3-image-to-video-standard" => {
42
- "duration_seconds" => {
43
- "enum" => [6, 10],
44
- "type" => "integer"
45
- },
46
- "first_frame_image_url" => {
47
- "required" => true
48
- },
49
- "output_resolution" => {
50
- "enum" => ["768p", "1080p"]
51
- }
52
- }
53
- }
54
- },
55
- "text-to-video" => {
56
- "models" => ["hailuo-02-text-to-video-pro", "hailuo-02-text-to-video-standard"],
57
- "fields_by_model" => {
58
- "hailuo-02-text-to-video-pro" => {
59
- "duration_seconds" => {
60
- "type" => "integer"
61
- }
62
- },
63
- "hailuo-02-text-to-video-standard" => {
64
- "duration_seconds" => {
65
- "enum" => [6, 10],
66
- "type" => "integer"
67
- }
68
- }
69
- }
70
- }
71
- }.freeze
72
- end
73
- end