runapi-suno 0.2.9 → 0.3.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 +4 -4
- data/README.md +1 -1
- data/lib/runapi/suno/client.rb +3 -0
- data/lib/runapi/suno/contract_gen.rb +36 -7
- data/lib/runapi/suno/resources/blend_lyrics.rb +35 -0
- data/lib/runapi/suno/types.rb +9 -0
- data/lib/runapi/suno/validators.rb +0 -4
- data/lib/runapi/suno.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 255e9261a9f3bd30fd2a10f7ead347008a2933aac0593150828551b624e0841c
|
|
4
|
+
data.tar.gz: 514d9027b71e6b4b4db6993de72c1031801a3aa640ef93272f82cfc35d8cbfe6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e3643f48ee51d9566c3e9217e075796140944ec5f16e56f4bddd2778d50bd017e892355d6c01287f6d6829477e56a9cfafba402b37a56e48f1da542ed1ff8da5
|
|
7
|
+
data.tar.gz: 8bdb7ebaf3f9664e165ca5ab8134cf95c726dcd9b57738e041ad33c51be79cc600eb70748b0fc35ced7dad393dd9f7f0b0c24f8b38b868c0b6ee939f3349045f
|
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
|
|
data/lib/runapi/suno/client.rb
CHANGED
|
@@ -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" => {
|
|
@@ -239,7 +252,9 @@ module RunApi
|
|
|
239
252
|
"enum" => ["style", "voice"]
|
|
240
253
|
},
|
|
241
254
|
"upload_url_list" => {
|
|
242
|
-
"required" => true
|
|
255
|
+
"required" => true,
|
|
256
|
+
"min_items" => 2,
|
|
257
|
+
"max_items" => 2
|
|
243
258
|
},
|
|
244
259
|
"vocal_gender" => {
|
|
245
260
|
"enum" => ["male", "female"]
|
|
@@ -257,7 +272,9 @@ module RunApi
|
|
|
257
272
|
"enum" => ["style", "voice"]
|
|
258
273
|
},
|
|
259
274
|
"upload_url_list" => {
|
|
260
|
-
"required" => true
|
|
275
|
+
"required" => true,
|
|
276
|
+
"min_items" => 2,
|
|
277
|
+
"max_items" => 2
|
|
261
278
|
},
|
|
262
279
|
"vocal_gender" => {
|
|
263
280
|
"enum" => ["male", "female"]
|
|
@@ -275,7 +292,9 @@ module RunApi
|
|
|
275
292
|
"enum" => ["style", "voice"]
|
|
276
293
|
},
|
|
277
294
|
"upload_url_list" => {
|
|
278
|
-
"required" => true
|
|
295
|
+
"required" => true,
|
|
296
|
+
"min_items" => 2,
|
|
297
|
+
"max_items" => 2
|
|
279
298
|
},
|
|
280
299
|
"vocal_gender" => {
|
|
281
300
|
"enum" => ["male", "female"]
|
|
@@ -293,7 +312,9 @@ module RunApi
|
|
|
293
312
|
"enum" => ["style", "voice"]
|
|
294
313
|
},
|
|
295
314
|
"upload_url_list" => {
|
|
296
|
-
"required" => true
|
|
315
|
+
"required" => true,
|
|
316
|
+
"min_items" => 2,
|
|
317
|
+
"max_items" => 2
|
|
297
318
|
},
|
|
298
319
|
"vocal_gender" => {
|
|
299
320
|
"enum" => ["male", "female"]
|
|
@@ -311,7 +332,9 @@ module RunApi
|
|
|
311
332
|
"enum" => ["style", "voice"]
|
|
312
333
|
},
|
|
313
334
|
"upload_url_list" => {
|
|
314
|
-
"required" => true
|
|
335
|
+
"required" => true,
|
|
336
|
+
"min_items" => 2,
|
|
337
|
+
"max_items" => 2
|
|
315
338
|
},
|
|
316
339
|
"vocal_gender" => {
|
|
317
340
|
"enum" => ["male", "female"]
|
|
@@ -329,7 +352,9 @@ module RunApi
|
|
|
329
352
|
"enum" => ["style", "voice"]
|
|
330
353
|
},
|
|
331
354
|
"upload_url_list" => {
|
|
332
|
-
"required" => true
|
|
355
|
+
"required" => true,
|
|
356
|
+
"min_items" => 2,
|
|
357
|
+
"max_items" => 2
|
|
333
358
|
},
|
|
334
359
|
"vocal_gender" => {
|
|
335
360
|
"enum" => ["male", "female"]
|
|
@@ -462,7 +487,11 @@ module RunApi
|
|
|
462
487
|
"generate-lyrics" => {
|
|
463
488
|
"models" => [],
|
|
464
489
|
"fields_by_model" => {
|
|
465
|
-
"_" => {
|
|
490
|
+
"_" => {
|
|
491
|
+
"prompt" => {
|
|
492
|
+
"required" => true
|
|
493
|
+
}
|
|
494
|
+
}
|
|
466
495
|
}
|
|
467
496
|
},
|
|
468
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
|
data/lib/runapi/suno/types.rb
CHANGED
|
@@ -193,6 +193,11 @@ 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 }]
|
|
@@ -287,6 +292,10 @@ module RunApi
|
|
|
287
292
|
required :lyrics, [-> { Lyric }]
|
|
288
293
|
end
|
|
289
294
|
|
|
295
|
+
class CompletedBlendLyricsResponse < BlendLyricsResponse
|
|
296
|
+
required :lyrics, [-> { Lyric }]
|
|
297
|
+
end
|
|
298
|
+
|
|
290
299
|
class CompletedReplaceSectionResponse < ReplaceSectionResponse
|
|
291
300
|
required :track, -> { Audio }
|
|
292
301
|
end
|
|
@@ -88,10 +88,6 @@ module RunApi
|
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
def validate_create_mashup!(params, resource)
|
|
91
|
-
upload_url_list = param(resource, params, :upload_url_list)
|
|
92
|
-
unless upload_url_list.is_a?(Array) && upload_url_list.size == 2
|
|
93
|
-
raise Core::ValidationError, "upload_url_list must contain exactly 2 URLs"
|
|
94
|
-
end
|
|
95
91
|
resource.send(:validate_contract!, CONTRACT["create-mashup"], params)
|
|
96
92
|
end
|
|
97
93
|
|
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.
|
|
4
|
+
version: 0.3.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.2.
|
|
18
|
+
version: 0.2.14
|
|
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.
|
|
25
|
+
version: 0.2.14
|
|
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
|