elevenlabs_client 0.4.0 → 0.6.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/CHANGELOG.md +140 -0
- data/README.md +163 -5
- data/lib/elevenlabs_client/client.rb +80 -3
- data/lib/elevenlabs_client/endpoints/admin/history.rb +106 -0
- data/lib/elevenlabs_client/endpoints/admin/models.rb +27 -0
- data/lib/elevenlabs_client/endpoints/admin/usage.rb +46 -0
- data/lib/elevenlabs_client/endpoints/admin/user.rb +28 -0
- data/lib/elevenlabs_client/endpoints/admin/voice_library.rb +86 -0
- data/lib/elevenlabs_client/endpoints/audio_isolation.rb +71 -0
- data/lib/elevenlabs_client/endpoints/audio_native.rb +103 -0
- data/lib/elevenlabs_client/endpoints/dubs.rb +52 -2
- data/lib/elevenlabs_client/endpoints/forced_alignment.rb +41 -0
- data/lib/elevenlabs_client/endpoints/sound_generation.rb +0 -1
- data/lib/elevenlabs_client/endpoints/speech_to_speech.rb +125 -0
- data/lib/elevenlabs_client/endpoints/speech_to_text.rb +121 -0
- data/lib/elevenlabs_client/endpoints/text_to_dialogue.rb +34 -1
- data/lib/elevenlabs_client/endpoints/text_to_speech.rb +147 -1
- data/lib/elevenlabs_client/endpoints/text_to_voice.rb +13 -1
- data/lib/elevenlabs_client/endpoints/voices.rb +368 -7
- data/lib/elevenlabs_client/endpoints/websocket_text_to_speech.rb +250 -0
- data/lib/elevenlabs_client/version.rb +1 -1
- data/lib/elevenlabs_client.rb +11 -4
- metadata +41 -4
- data/lib/elevenlabs_client/endpoints/models.rb +0 -26
- data/lib/elevenlabs_client/endpoints/text_to_speech_stream.rb +0 -42
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elevenlabs_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitor Oliveira
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-09-
|
11
|
+
date: 2025-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: websocket-client-simple
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.8'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.8'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +122,20 @@ dependencies:
|
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: '3.0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: bundler-audit
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0.9'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0.9'
|
111
139
|
description: A Ruby client library for interacting with ElevenLabs dubbing and voice
|
112
140
|
synthesis APIs
|
113
141
|
email:
|
@@ -121,15 +149,24 @@ files:
|
|
121
149
|
- README.md
|
122
150
|
- lib/elevenlabs_client.rb
|
123
151
|
- lib/elevenlabs_client/client.rb
|
152
|
+
- lib/elevenlabs_client/endpoints/admin/history.rb
|
153
|
+
- lib/elevenlabs_client/endpoints/admin/models.rb
|
154
|
+
- lib/elevenlabs_client/endpoints/admin/usage.rb
|
155
|
+
- lib/elevenlabs_client/endpoints/admin/user.rb
|
156
|
+
- lib/elevenlabs_client/endpoints/admin/voice_library.rb
|
157
|
+
- lib/elevenlabs_client/endpoints/audio_isolation.rb
|
158
|
+
- lib/elevenlabs_client/endpoints/audio_native.rb
|
124
159
|
- lib/elevenlabs_client/endpoints/dubs.rb
|
125
|
-
- lib/elevenlabs_client/endpoints/
|
160
|
+
- lib/elevenlabs_client/endpoints/forced_alignment.rb
|
126
161
|
- lib/elevenlabs_client/endpoints/music.rb
|
127
162
|
- lib/elevenlabs_client/endpoints/sound_generation.rb
|
163
|
+
- lib/elevenlabs_client/endpoints/speech_to_speech.rb
|
164
|
+
- lib/elevenlabs_client/endpoints/speech_to_text.rb
|
128
165
|
- lib/elevenlabs_client/endpoints/text_to_dialogue.rb
|
129
166
|
- lib/elevenlabs_client/endpoints/text_to_speech.rb
|
130
|
-
- lib/elevenlabs_client/endpoints/text_to_speech_stream.rb
|
131
167
|
- lib/elevenlabs_client/endpoints/text_to_voice.rb
|
132
168
|
- lib/elevenlabs_client/endpoints/voices.rb
|
169
|
+
- lib/elevenlabs_client/endpoints/websocket_text_to_speech.rb
|
133
170
|
- lib/elevenlabs_client/errors.rb
|
134
171
|
- lib/elevenlabs_client/settings.rb
|
135
172
|
- lib/elevenlabs_client/version.rb
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ElevenlabsClient
|
4
|
-
class Models
|
5
|
-
def initialize(client)
|
6
|
-
@client = client
|
7
|
-
end
|
8
|
-
|
9
|
-
# GET /v1/models
|
10
|
-
# Gets a list of available models
|
11
|
-
# Documentation: https://elevenlabs.io/docs/api-reference/models/list
|
12
|
-
#
|
13
|
-
# @return [Hash] The JSON response containing an array of models
|
14
|
-
def list
|
15
|
-
endpoint = "/v1/models"
|
16
|
-
@client.get(endpoint)
|
17
|
-
end
|
18
|
-
|
19
|
-
# Alias for backward compatibility and convenience
|
20
|
-
alias_method :list_models, :list
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
attr_reader :client
|
25
|
-
end
|
26
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ElevenlabsClient
|
4
|
-
class TextToSpeechStream
|
5
|
-
def initialize(client)
|
6
|
-
@client = client
|
7
|
-
end
|
8
|
-
|
9
|
-
# POST /v1/text-to-speech/{voice_id}/stream
|
10
|
-
# Stream text-to-speech audio in real-time chunks
|
11
|
-
#
|
12
|
-
# @param voice_id [String] The ID of the voice to use
|
13
|
-
# @param text [String] Text to synthesize
|
14
|
-
# @param options [Hash] Optional TTS parameters
|
15
|
-
# @option options [String] :model_id Model to use (defaults to "eleven_multilingual_v2")
|
16
|
-
# @option options [String] :output_format Output format (defaults to "mp3_44100_128")
|
17
|
-
# @option options [Hash] :voice_settings Voice configuration
|
18
|
-
# @param block [Proc] Block to handle each audio chunk
|
19
|
-
# @return [Faraday::Response] The response object
|
20
|
-
def stream(voice_id, text, **options, &block)
|
21
|
-
output_format = options[:output_format] || "mp3_44100_128"
|
22
|
-
endpoint = "/v1/text-to-speech/#{voice_id}/stream?output_format=#{output_format}"
|
23
|
-
|
24
|
-
request_body = {
|
25
|
-
text: text,
|
26
|
-
model_id: options[:model_id] || "eleven_multilingual_v2"
|
27
|
-
}
|
28
|
-
|
29
|
-
# Add voice_settings if provided
|
30
|
-
request_body[:voice_settings] = options[:voice_settings] if options[:voice_settings]
|
31
|
-
|
32
|
-
@client.post_streaming(endpoint, request_body, &block)
|
33
|
-
end
|
34
|
-
|
35
|
-
# Alias for backward compatibility
|
36
|
-
alias_method :text_to_speech_stream, :stream
|
37
|
-
|
38
|
-
private
|
39
|
-
|
40
|
-
attr_reader :client
|
41
|
-
end
|
42
|
-
end
|