runapi-infinitetalk 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: e1a267d42796d65befec17a0e733b2db482e18c440d38edfb7be16c1a1fae597
4
- data.tar.gz: a2f1b73ad67eb6f5a34fafae990e9b411f41dd4bc235b12370bc9de3ef408a30
3
+ metadata.gz: e89cac6baa5f9d175c9fd56314131d2af51d6487c9a9367e61938f3627f003c8
4
+ data.tar.gz: fb5b1c2e61201b5a9d6459cfb361c7f967d9b35cd9264b9b37eab0692acc250c
5
5
  SHA512:
6
- metadata.gz: c2d66db62701612624579a88be2603250e752722233cfd11d379c4e95488b6dcb403265a344edc9491569b2eb9a87b393d4e669d160eec155caf635a35ccf145
7
- data.tar.gz: 2bf5dab96aa4bd2b640e8ec70b9bfc6c2ad3ba62e491f452c6e02f1c38b17719557e3f57833e5053d1218e0d2a1f581b070a5105f55bfd68f71cc50e498b08f3
6
+ metadata.gz: 7e77fd019642d0bfb19b9646134df5f273d6cc6dfde150d98d8d7fb5ea50ae3b64844031145ecfb9e9c8e3db4d78ef37795ec2c1e9db8a13cd55fb4446b0c539
7
+ data.tar.gz: 53d70b3746b85b30ff80863c5c50fcc615831ad0f0dd6fca4846a0db9d2f203d26e2d8152c09f58eb21d9b29bd80b9ce0d8b70fc3b72e6c6fbb91916283fcd54
data/README.md CHANGED
@@ -1,25 +1,25 @@
1
- # Infinitetalk API Ruby SDK for RunAPI
1
+ # InfiniteTalk Ruby SDK for RunAPI
2
2
 
3
- The infinitetalk api Ruby SDK is the language-specific package for InfiniteTalk on RunAPI. Use this infinitetalk 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 InfiniteTalk Ruby SDK is the language-specific package for InfiniteTalk 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 infinitetalk api README is the Ruby package guide inside the public `infinitalk-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/infinitalk; for API reference, use https://runapi.ai/docs#infinitalk; for SDK docs, use https://runapi.ai/docs#sdk-infinitalk.
5
+ This README is the Ruby package guide inside the public `infinitetalk-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/infinitetalk; for API reference, use https://runapi.ai/docs#infinitetalk; for SDK docs, use https://runapi.ai/docs#sdk-infinitetalk.
6
6
 
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- gem install runapi-infinitalk
10
+ gem install runapi-infinitetalk
11
11
  ```
12
12
 
13
13
  ## Quick start
14
14
 
15
15
  ```ruby
16
- require "runapi-infinitalk"
16
+ require "runapi-infinitetalk"
17
17
 
18
18
  client = RunApi::Infinitalk::Client.new
19
- task = client.from_audios.create(
20
- # Pass the InfiniteTalk JSON request body from https://runapi.ai/docs#infinitalk.
19
+ task = client.audio_to_video.create(
20
+ # Pass the InfiniteTalk JSON request body from https://runapi.ai/docs#infinitetalk.
21
21
  )
22
- status = client.from_audios.get(task.id)
22
+ status = client.audio_to_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,17 +28,17 @@ 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::Infinitalk` error classes when building video jobs, Rails workers, or scripts. The available resources include from audios. 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::Infinitalk` error classes when building video jobs, Rails workers, or scripts. The available resources are `audio_to_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
 
35
- - Model page: https://runapi.ai/models/infinitalk
36
- - SDK docs: https://runapi.ai/docs#sdk-infinitalk
37
- - Product docs: https://runapi.ai/docs#infinitalk
38
- - Pricing and rate limits: https://runapi.ai/models/infinitalk
35
+ - Model page: https://runapi.ai/models/infinitetalk
36
+ - SDK docs: https://runapi.ai/docs#sdk-infinitetalk
37
+ - Product docs: https://runapi.ai/docs#infinitetalk
38
+ - Pricing and rate limits: https://runapi.ai/models/infinitetalk
39
39
  - Provider comparison: https://runapi.ai/providers/meigen-ai
40
40
  - Full catalog: https://runapi.ai/models
41
- - Repository: https://github.com/runapi-ai/infinitalk-sdk
41
+ - Repository: https://github.com/runapi-ai/infinitetalk-sdk
42
42
 
43
43
  ## License
44
44
 
@@ -9,8 +9,8 @@ module RunApi
9
9
  # client = RunApi::Infinitetalk::Client.new(api_key: "sk-...")
10
10
  # result = client.audio_to_video.run(
11
11
  # model: "infinitetalk-from-audio",
12
- # source_image_url: "https://example.com/portrait.jpg",
13
- # source_audio_url: "https://example.com/voice.mp3",
12
+ # source_image_url: "https://cdn.runapi.ai/public/samples/portrait.jpg",
13
+ # source_audio_url: "https://cdn.runapi.ai/public/samples/voice.mp3",
14
14
  # prompt: "A young woman talking on a podcast"
15
15
  # )
16
16
  # puts result.videos.first.url
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RunApi
4
+ module Infinitetalk
5
+ CONTRACT = {
6
+ "audio-to-video" => {
7
+ "models" => ["infinitetalk-from-audio"],
8
+ "fields_by_model" => {
9
+ "infinitetalk-from-audio" => {
10
+ "output_resolution" => {
11
+ "enum" => ["480p", "720p"]
12
+ },
13
+ "seed" => {
14
+ "type" => "integer"
15
+ },
16
+ "source_audio_url" => {
17
+ "required" => true
18
+ },
19
+ "source_image_url" => {
20
+ "required" => true
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }.freeze
26
+ end
27
+ end
@@ -36,22 +36,14 @@ module RunApi
36
36
  private
37
37
 
38
38
  def validate_params!(params)
39
- model = param(params, :model)
40
- raise Core::ValidationError, "model is required" unless model
41
- unless Types::MODELS.include?(model)
42
- raise Core::ValidationError, "Invalid model: #{model}. Must be one of: #{Types::MODELS.join(", ")}"
43
- end
39
+ validate_contract!(CONTRACT["audio-to-video"], params)
44
40
 
45
- validate_required!(params, :source_image_url)
46
- validate_required!(params, :source_audio_url)
47
41
  prompt = param(params, :prompt)
48
42
  raise Core::ValidationError, "prompt is required" unless prompt.is_a?(String) && !prompt.empty?
49
43
  if prompt.length > PROMPT_MAX_LENGTH
50
44
  raise Core::ValidationError, "prompt must be at most #{PROMPT_MAX_LENGTH} characters"
51
45
  end
52
46
 
53
- validate_optional!(params, :output_resolution, Types::RESOLUTIONS)
54
-
55
47
  seed = param(params, :seed)
56
48
  return if seed.nil?
57
49
 
@@ -60,13 +52,6 @@ module RunApi
60
52
 
61
53
  raise Core::ValidationError, "seed must be an integer between #{SEED_RANGE.min} and #{SEED_RANGE.max}"
62
54
  end
63
-
64
- def validate_required!(params, key)
65
- value = param(params, key)
66
- return if value.is_a?(String) ? !value.empty? : !value.nil?
67
-
68
- raise Core::ValidationError, "#{key} is required"
69
- end
70
55
  end
71
56
  end
72
57
  end
@@ -3,11 +3,6 @@
3
3
  module RunApi
4
4
  module Infinitetalk
5
5
  module Types
6
- # Available model identifiers for audio-to-video generation.
7
- MODELS = %w[infinitetalk-from-audio].freeze
8
- # Output resolution options. Higher resolution increases fidelity but takes longer.
9
- RESOLUTIONS = %w[480p 720p].freeze
10
-
11
6
  # A generated video asset.
12
7
  class Video < RunApi::Core::BaseModel
13
8
  optional :url, String
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "runapi/core"
4
4
  require_relative "infinitetalk/types"
5
+ require_relative "infinitetalk/contract_gen"
5
6
  require_relative "infinitetalk/resources/audio_to_video"
6
7
  require_relative "infinitetalk/client"
7
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-infinitetalk
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 infinitetalk api Ruby SDK is the language-specific package for InfiniteTalk
27
- on RunAPI. Use this infinitetalk api package for text-to-video, image-to-video,
28
- video editing, and animation flows when your application needs JSON request bodies,
29
- task status lookup, and consistent RunAPI errors in Ruby.
25
+ version: 0.2.7
26
+ description: The InfiniteTalk Ruby SDK is the language-specific package for InfiniteTalk
27
+ on RunAPI. Use this package for video generation, animation, and video editing workflows
28
+ when 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-infinitetalk.rb
40
40
  - lib/runapi/infinitetalk.rb
41
41
  - lib/runapi/infinitetalk/client.rb
42
+ - lib/runapi/infinitetalk/contract_gen.rb
42
43
  - lib/runapi/infinitetalk/resources/audio_to_video.rb
43
44
  - lib/runapi/infinitetalk/types.rb
44
45
  homepage: https://runapi.ai/models/infinitetalk
45
46
  licenses:
46
47
  - Apache-2.0
47
48
  metadata:
49
+ runapi_slug: infinitetalk
48
50
  homepage_uri: https://runapi.ai/models/infinitetalk
49
51
  documentation_uri: https://github.com/runapi-ai/infinitetalk-sdk/blob/main/ruby/README.md
50
52
  source_code_uri: https://github.com/runapi-ai/infinitetalk-sdk
53
+ bug_tracker_uri: https://github.com/runapi-ai/infinitetalk-sdk/issues
51
54
  changelog_uri: https://github.com/runapi-ai/infinitetalk-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: Infinitetalk API Ruby SDK for RunAPI
71
+ summary: InfiniteTalk Ruby SDK for RunAPI
69
72
  test_files: []