runapi-suno 0.2.10 → 0.3.1

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: e778eebc0d01b454f8a2187126173625cd0c14925a2e238eef0a1015e8ff6a0c
4
- data.tar.gz: 404e68c9d3e9673d9ac80d393d6cebea8a4482e055f3b37de6f3961919712690
3
+ metadata.gz: a4e3a244b100dfe8f71e8ea593668fe9e777e12f95185c9c8a41867242d0f05c
4
+ data.tar.gz: 2c6b07235af6757253bff62842f07b62caa11692db5831d3be68360d2d8e888d
5
5
  SHA512:
6
- metadata.gz: 9a7ac2a46590a7869002485d2a8fb9e27bea5866a480ae3d70fbf3cf0bc6367d13cb5801fd12a30d86feeed15fd3fb0ffc06361f2fea59f9e96cbbb6398e2356
7
- data.tar.gz: 3dedafb65dada78f0c75ec572778813477fa44c24ab314de55f278c58dc0aa2fed613e26efc3834b5a273592398ec01c36eaea6bbef5a9d0eff02353d57fb097
6
+ metadata.gz: 9b0cf789e74b7fde42b3e6e83c672d0e3aea9c3f540e318c179e3ea86d0d90df4fd7fa6b834b4b95061cb7dad1b0708ad17f4fc7ae6ab833b3f5f91ac18ddb22
7
+ data.tar.gz: d11014c15425b11b120a0c4634e5deae5e5ac85abf8e217ed527f02f23a2d176ceb7a39d11d99ad004da0d2a129118ba6b877d3ec446faa6e50ac9773e700411
data/README.md CHANGED
@@ -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::Suno` error classes when building music jobs, Rails workers, or scripts. The available resources are `text_to_music`, `extend_music`, `generate_artwork`, `cover_audio`, `add_instrumental`, `add_vocals`, `separate_audio_stems`, `generate_midi`, `convert_audio`, `visualize_music`, `generate_lyrics`, `get_timestamped_lyrics`, `replace_section`, `create_mashup`, `text_to_sound`, `voice_to_validation_phrase`, `regenerate_validation_phrase`, `generate_voice`, `check_voice`, `generate_persona`, and `boost_style`. 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::Suno` error classes when building music jobs, Rails workers, or scripts. The available resources are `text_to_music`, `extend_music`, `generate_artwork`, `cover_audio`, `add_instrumental`, `add_vocals`, `separate_audio_stems`, `generate_midi`, `convert_audio`, `visualize_music`, `generate_lyrics`, `blend_lyrics`, `get_timestamped_lyrics`, `replace_section`, `create_mashup`, `text_to_sound`, `voice_to_validation_phrase`, `regenerate_validation_phrase`, `generate_voice`, `check_voice`, `generate_persona`, and `boost_style`. 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
 
@@ -34,6 +34,8 @@ module RunApi
34
34
  attr_reader :visualize_music
35
35
  # @return [Resources::GenerateLyrics] produces AI-generated lyrics from a text prompt
36
36
  attr_reader :generate_lyrics
37
+ # @return [Resources::BlendLyrics] blends two caller-authored lyrics texts
38
+ attr_reader :blend_lyrics
37
39
  # @return [Resources::GetTimestampedLyrics] retrieves word-level timing alignment for a track (synchronous)
38
40
  attr_reader :get_timestamped_lyrics
39
41
  # @return [Resources::ReplaceSection] re-generates a time range within an existing track
@@ -69,6 +71,7 @@ module RunApi
69
71
  @convert_audio = Resources::ConvertAudio.new(http)
70
72
  @visualize_music = Resources::VisualizeMusic.new(http)
71
73
  @generate_lyrics = Resources::GenerateLyrics.new(http)
74
+ @blend_lyrics = Resources::BlendLyrics.new(http)
72
75
  @get_timestamped_lyrics = Resources::GetTimestampedLyrics.new(http)
73
76
  @replace_section = Resources::ReplaceSection.new(http)
74
77
  @create_mashup = Resources::CreateMashup.new(http)
@@ -74,6 +74,19 @@ module RunApi
74
74
  }
75
75
  }
76
76
  },
77
+ "blend-lyrics" => {
78
+ "models" => [],
79
+ "fields_by_model" => {
80
+ "_" => {
81
+ "lyrics_a" => {
82
+ "required" => true
83
+ },
84
+ "lyrics_b" => {
85
+ "required" => true
86
+ }
87
+ }
88
+ }
89
+ },
77
90
  "boost-style" => {
78
91
  "models" => [],
79
92
  "fields_by_model" => {
@@ -474,7 +487,11 @@ module RunApi
474
487
  "generate-lyrics" => {
475
488
  "models" => [],
476
489
  "fields_by_model" => {
477
- "_" => {}
490
+ "_" => {
491
+ "prompt" => {
492
+ "required" => true
493
+ }
494
+ }
478
495
  }
479
496
  },
480
497
  "generate-midi" => {
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RunApi
4
+ module Suno
5
+ module Resources
6
+ # Blends two caller-authored lyrics texts into a new lyrics result.
7
+ class BlendLyrics
8
+ include RunApi::Core::ResourceHelpers
9
+
10
+ ENDPOINT = "/api/v1/suno/blend_lyrics"
11
+ RESPONSE_CLASS = Types::BlendLyricsResponse
12
+ COMPLETED_RESPONSE_CLASS = Types::CompletedBlendLyricsResponse
13
+
14
+ def initialize(http)
15
+ @http = http
16
+ end
17
+
18
+ def run(options: nil, **params)
19
+ task = create(options: options, **params)
20
+ poll_until_complete { get(task.id, options: options) }
21
+ end
22
+
23
+ def create(options: nil, **params)
24
+ params = compact_params(params)
25
+ validate_contract!(CONTRACT["blend-lyrics"], params)
26
+ request(:post, ENDPOINT, body: params, options: options)
27
+ end
28
+
29
+ def get(id, options: nil)
30
+ request(:get, "#{ENDPOINT}/#{id}", options: options)
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -193,12 +193,18 @@ module RunApi
193
193
  optional :lyrics, [-> { Lyric }]
194
194
  end
195
195
 
196
+ # Result of a lyrics blending task.
197
+ class BlendLyricsResponse < AsyncTaskResponse
198
+ optional :lyrics, [-> { Lyric }]
199
+ end
200
+
196
201
  # Synchronous response containing word-level timing data and waveform for a track.
197
202
  class GetTimestampedLyricsResponse < RunApi::Core::BaseModel
198
203
  optional :aligned_words, [-> { AlignedWord }]
199
204
  optional :waveform_data, [Numeric]
200
205
  optional :hoot_cer, Numeric
201
206
  optional :is_streamed
207
+ optional :billing, RunApi::Core::TaskBillingFacts
202
208
  end
203
209
 
204
210
  # Result of a section replacement task.
@@ -211,12 +217,14 @@ module RunApi
211
217
  class GeneratePersonaResponse < RunApi::Core::BaseModel
212
218
  required :persona, -> { Persona }
213
219
  optional :error, String
220
+ optional :billing, RunApi::Core::TaskBillingFacts
214
221
  end
215
222
 
216
223
  # Synchronous result of style tag generation. +style+ contains the generated tags string.
217
224
  class BoostStyleResponse < RunApi::Core::BaseModel
218
225
  optional :style, String
219
226
  optional :error, String
227
+ optional :billing, RunApi::Core::TaskBillingFacts
220
228
  end
221
229
 
222
230
  # Result of a mashup task.
@@ -241,6 +249,7 @@ module RunApi
241
249
  class CheckVoiceResponse < RunApi::Core::BaseModel
242
250
  optional :is_available
243
251
  optional :error, String
252
+ optional :billing, RunApi::Core::TaskBillingFacts
244
253
  end
245
254
 
246
255
  class CompletedTextToMusicResponse < TextToMusicResponse
@@ -287,6 +296,10 @@ module RunApi
287
296
  required :lyrics, [-> { Lyric }]
288
297
  end
289
298
 
299
+ class CompletedBlendLyricsResponse < BlendLyricsResponse
300
+ required :lyrics, [-> { Lyric }]
301
+ end
302
+
290
303
  class CompletedReplaceSectionResponse < ReplaceSectionResponse
291
304
  required :track, -> { Audio }
292
305
  end
data/lib/runapi/suno.rb CHANGED
@@ -15,6 +15,7 @@ require_relative "suno/resources/generate_midi"
15
15
  require_relative "suno/resources/convert_audio"
16
16
  require_relative "suno/resources/visualize_music"
17
17
  require_relative "suno/resources/generate_lyrics"
18
+ require_relative "suno/resources/blend_lyrics"
18
19
  require_relative "suno/resources/get_timestamped_lyrics"
19
20
  require_relative "suno/resources/replace_section"
20
21
  require_relative "suno/resources/create_mashup"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-suno
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.3.1
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.2.14
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.14
25
+ version: 0.3.0
26
26
  description: The Suno Ruby SDK is the language-specific package for Suno on RunAPI.
27
27
  Use this package for song generation, lyrics, vocals, extension, and audio transformation
28
28
  workflows when your application needs request bodies, task status lookup, and consistent
@@ -42,6 +42,7 @@ files:
42
42
  - lib/runapi/suno/contract_gen.rb
43
43
  - lib/runapi/suno/resources/add_instrumental.rb
44
44
  - lib/runapi/suno/resources/add_vocals.rb
45
+ - lib/runapi/suno/resources/blend_lyrics.rb
45
46
  - lib/runapi/suno/resources/boost_style.rb
46
47
  - lib/runapi/suno/resources/check_voice.rb
47
48
  - lib/runapi/suno/resources/convert_audio.rb
@@ -87,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
88
  - !ruby/object:Gem::Version
88
89
  version: '0'
89
90
  requirements: []
90
- rubygems_version: 4.0.10
91
+ rubygems_version: 4.0.17
91
92
  specification_version: 4
92
93
  summary: Suno API Ruby SDK for RunAPI
93
94
  test_files: []