runapi-suno 0.2.10 → 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 +18 -1
- data/lib/runapi/suno/resources/blend_lyrics.rb +35 -0
- data/lib/runapi/suno/types.rb +9 -0
- data/lib/runapi/suno.rb +1 -0
- metadata +2 -1
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" => {
|
|
@@ -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
|
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
|
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
|
|
@@ -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
|