elevenlabs_client 0.6.0 → 0.8.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 +220 -0
- data/README.md +181 -58
- data/lib/elevenlabs_client/client.rb +110 -269
- data/lib/elevenlabs_client/configuration.rb +119 -0
- data/lib/elevenlabs_client/endpoints/admin/history.rb +1 -1
- data/lib/elevenlabs_client/endpoints/admin/pronunciation_dictionaries.rb +103 -0
- data/lib/elevenlabs_client/endpoints/admin/samples.rb +30 -0
- data/lib/elevenlabs_client/endpoints/admin/service_account_api_keys.rb +77 -0
- data/lib/elevenlabs_client/endpoints/admin/service_accounts.rb +29 -0
- data/lib/elevenlabs_client/endpoints/admin/user.rb +12 -0
- data/lib/elevenlabs_client/endpoints/admin/webhooks.rb +33 -0
- data/lib/elevenlabs_client/endpoints/admin/workspace_groups.rb +56 -0
- data/lib/elevenlabs_client/endpoints/admin/workspace_invites.rb +52 -0
- data/lib/elevenlabs_client/endpoints/admin/workspace_members.rb +31 -0
- data/lib/elevenlabs_client/endpoints/admin/workspace_resources.rb +53 -0
- data/lib/elevenlabs_client/endpoints/admin/workspace_webhooks.rb +30 -0
- data/lib/elevenlabs_client/endpoints/agents_platform/agents.rb +165 -0
- data/lib/elevenlabs_client/endpoints/agents_platform/batch_calling.rb +89 -0
- data/lib/elevenlabs_client/endpoints/agents_platform/conversations.rb +121 -0
- data/lib/elevenlabs_client/endpoints/agents_platform/knowledge_base.rb +234 -0
- data/lib/elevenlabs_client/endpoints/agents_platform/llm_usage.rb +50 -0
- data/lib/elevenlabs_client/endpoints/agents_platform/mcp_servers.rb +139 -0
- data/lib/elevenlabs_client/endpoints/agents_platform/outbound_calling.rb +55 -0
- data/lib/elevenlabs_client/endpoints/agents_platform/phone_numbers.rb +86 -0
- data/lib/elevenlabs_client/endpoints/agents_platform/test_invocations.rb +44 -0
- data/lib/elevenlabs_client/endpoints/agents_platform/tests.rb +138 -0
- data/lib/elevenlabs_client/endpoints/agents_platform/tools.rb +107 -0
- data/lib/elevenlabs_client/endpoints/agents_platform/widgets.rb +52 -0
- data/lib/elevenlabs_client/endpoints/agents_platform/workspace.rb +130 -0
- data/lib/elevenlabs_client/errors.rb +4 -0
- data/lib/elevenlabs_client/http_client.rb +325 -0
- data/lib/elevenlabs_client/version.rb +1 -1
- data/lib/elevenlabs_client.rb +99 -15
- metadata +27 -2
@@ -0,0 +1,325 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "faraday"
|
4
|
+
require "faraday/multipart"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module ElevenlabsClient
|
8
|
+
# HTTP client wrapper that handles all HTTP communication
|
9
|
+
# Separates HTTP concerns from business logic
|
10
|
+
class HttpClient
|
11
|
+
DEFAULT_BASE_URL = "https://api.elevenlabs.io"
|
12
|
+
|
13
|
+
attr_reader :base_url, :api_key
|
14
|
+
|
15
|
+
def initialize(api_key:, base_url: DEFAULT_BASE_URL)
|
16
|
+
@api_key = api_key
|
17
|
+
@base_url = base_url
|
18
|
+
@conn = build_connection
|
19
|
+
end
|
20
|
+
|
21
|
+
# Makes an authenticated GET request
|
22
|
+
# @param path [String] API endpoint path
|
23
|
+
# @param params [Hash] Query parameters
|
24
|
+
# @return [Hash] Response body
|
25
|
+
def get(path, params = {})
|
26
|
+
response = @conn.get(path, params) do |req|
|
27
|
+
req.headers["xi-api-key"] = api_key
|
28
|
+
end
|
29
|
+
|
30
|
+
handle_response(response)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Makes an authenticated POST request
|
34
|
+
# @param path [String] API endpoint path
|
35
|
+
# @param body [Hash, nil] Request body
|
36
|
+
# @return [Hash] Response body
|
37
|
+
def post(path, body = nil)
|
38
|
+
response = @conn.post(path) do |req|
|
39
|
+
req.headers["xi-api-key"] = api_key
|
40
|
+
req.headers["Content-Type"] = "application/json"
|
41
|
+
req.body = body.to_json if body
|
42
|
+
end
|
43
|
+
|
44
|
+
handle_response(response)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Makes an authenticated DELETE request
|
48
|
+
# @param path [String] API endpoint path
|
49
|
+
# @return [Hash] Response body
|
50
|
+
def delete(path)
|
51
|
+
response = @conn.delete(path) do |req|
|
52
|
+
req.headers["xi-api-key"] = api_key
|
53
|
+
end
|
54
|
+
|
55
|
+
handle_response(response)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Makes an authenticated DELETE request with JSON body
|
59
|
+
# @param path [String] API endpoint path
|
60
|
+
# @param body [Hash, nil] Request body
|
61
|
+
# @return [Hash] Response body
|
62
|
+
def delete_with_body(path, body = nil)
|
63
|
+
response = @conn.delete(path) do |req|
|
64
|
+
req.headers["xi-api-key"] = api_key
|
65
|
+
req.headers["Content-Type"] = "application/json"
|
66
|
+
req.body = body.to_json if body
|
67
|
+
end
|
68
|
+
|
69
|
+
handle_response(response)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Makes an authenticated PATCH request
|
73
|
+
# @param path [String] API endpoint path
|
74
|
+
# @param body [Hash, nil] Request body
|
75
|
+
# @return [Hash] Response body
|
76
|
+
def patch(path, body = nil)
|
77
|
+
response = @conn.patch(path) do |req|
|
78
|
+
req.headers["xi-api-key"] = api_key
|
79
|
+
req.headers["Content-Type"] = "application/json"
|
80
|
+
req.body = body.to_json if body
|
81
|
+
end
|
82
|
+
|
83
|
+
handle_response(response)
|
84
|
+
end
|
85
|
+
|
86
|
+
# Makes an authenticated multipart POST request
|
87
|
+
# @param path [String] API endpoint path
|
88
|
+
# @param payload [Hash] Multipart payload
|
89
|
+
# @return [Hash] Response body
|
90
|
+
def post_multipart(path, payload)
|
91
|
+
response = @conn.post(path) do |req|
|
92
|
+
req.headers["xi-api-key"] = api_key
|
93
|
+
req.body = payload
|
94
|
+
end
|
95
|
+
|
96
|
+
handle_response(response)
|
97
|
+
end
|
98
|
+
|
99
|
+
# Makes an authenticated GET request expecting binary response
|
100
|
+
# @param path [String] API endpoint path
|
101
|
+
# @return [String] Binary response body
|
102
|
+
def get_binary(path)
|
103
|
+
response = @conn.get(path) do |req|
|
104
|
+
req.headers["xi-api-key"] = api_key
|
105
|
+
end
|
106
|
+
|
107
|
+
handle_response(response)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Makes an authenticated POST request expecting binary response
|
111
|
+
# @param path [String] API endpoint path
|
112
|
+
# @param body [Hash, nil] Request body
|
113
|
+
# @return [String] Binary response body
|
114
|
+
def post_binary(path, body = nil)
|
115
|
+
response = @conn.post(path) do |req|
|
116
|
+
req.headers["xi-api-key"] = api_key
|
117
|
+
req.headers["Content-Type"] = "application/json"
|
118
|
+
req.body = body.to_json if body
|
119
|
+
end
|
120
|
+
|
121
|
+
handle_response(response)
|
122
|
+
end
|
123
|
+
|
124
|
+
# Makes an authenticated POST request with custom headers
|
125
|
+
# @param path [String] API endpoint path
|
126
|
+
# @param body [Hash, nil] Request body
|
127
|
+
# @param custom_headers [Hash] Additional headers
|
128
|
+
# @return [String] Response body (binary or text)
|
129
|
+
def post_with_custom_headers(path, body = nil, custom_headers = {})
|
130
|
+
response = @conn.post(path) do |req|
|
131
|
+
req.headers["xi-api-key"] = api_key
|
132
|
+
req.headers["Content-Type"] = "application/json"
|
133
|
+
custom_headers.each { |key, value| req.headers[key] = value }
|
134
|
+
req.body = body.to_json if body
|
135
|
+
end
|
136
|
+
|
137
|
+
# For streaming/binary responses, return raw body
|
138
|
+
if custom_headers["Accept"]&.include?("audio") || custom_headers["Transfer-Encoding"] == "chunked"
|
139
|
+
handle_response(response)
|
140
|
+
else
|
141
|
+
handle_response(response)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# Makes an authenticated POST request with streaming response
|
146
|
+
# @param path [String] API endpoint path
|
147
|
+
# @param body [Hash, nil] Request body
|
148
|
+
# @param block [Proc] Block to handle each chunk
|
149
|
+
# @return [Faraday::Response] Response object
|
150
|
+
def post_streaming(path, body = nil, &block)
|
151
|
+
response = @conn.post(path) do |req|
|
152
|
+
req.headers["xi-api-key"] = api_key
|
153
|
+
req.headers["Content-Type"] = "application/json"
|
154
|
+
req.headers["Accept"] = "audio/mpeg"
|
155
|
+
req.body = body.to_json if body
|
156
|
+
|
157
|
+
# Set up streaming callback
|
158
|
+
req.options.on_data = proc do |chunk, _|
|
159
|
+
block.call(chunk) if block_given?
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
handle_response(response)
|
164
|
+
end
|
165
|
+
|
166
|
+
# Makes an authenticated GET request with streaming response
|
167
|
+
# @param path [String] API endpoint path
|
168
|
+
# @param block [Proc] Block to handle each chunk
|
169
|
+
# @return [Faraday::Response] Response object
|
170
|
+
def get_streaming(path, &block)
|
171
|
+
response = @conn.get(path) do |req|
|
172
|
+
req.headers["xi-api-key"] = api_key
|
173
|
+
req.headers["Accept"] = "audio/mpeg"
|
174
|
+
|
175
|
+
# Set up streaming callback
|
176
|
+
req.options.on_data = proc do |chunk, _|
|
177
|
+
block.call(chunk) if block_given?
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
handle_response(response)
|
182
|
+
end
|
183
|
+
|
184
|
+
# Makes an authenticated POST request with streaming response for timestamp data
|
185
|
+
# @param path [String] API endpoint path
|
186
|
+
# @param body [Hash, nil] Request body
|
187
|
+
# @param block [Proc] Block to handle each JSON chunk with timestamps
|
188
|
+
# @return [Faraday::Response] Response object
|
189
|
+
def post_streaming_with_timestamps(path, body = nil, &block)
|
190
|
+
buffer = ""
|
191
|
+
|
192
|
+
response = @conn.post(path) do |req|
|
193
|
+
req.headers["xi-api-key"] = api_key
|
194
|
+
req.headers["Content-Type"] = "application/json"
|
195
|
+
req.body = body.to_json if body
|
196
|
+
|
197
|
+
# Set up streaming callback for JSON chunks
|
198
|
+
req.options.on_data = proc do |chunk, _|
|
199
|
+
if block_given?
|
200
|
+
buffer += chunk
|
201
|
+
|
202
|
+
# Process complete JSON objects
|
203
|
+
while buffer.include?("\n")
|
204
|
+
line, buffer = buffer.split("\n", 2)
|
205
|
+
next if line.strip.empty?
|
206
|
+
|
207
|
+
begin
|
208
|
+
json_data = JSON.parse(line)
|
209
|
+
block.call(json_data)
|
210
|
+
rescue JSON::ParserError
|
211
|
+
# Skip malformed JSON lines
|
212
|
+
next
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
handle_response(response)
|
220
|
+
end
|
221
|
+
|
222
|
+
# Helper method to create Faraday::Multipart::FilePart
|
223
|
+
# @param file_io [IO] File IO object
|
224
|
+
# @param filename [String] Original filename
|
225
|
+
# @return [Faraday::Multipart::FilePart]
|
226
|
+
def file_part(file_io, filename)
|
227
|
+
Faraday::Multipart::FilePart.new(file_io, mime_for(filename), filename)
|
228
|
+
end
|
229
|
+
|
230
|
+
private
|
231
|
+
|
232
|
+
def build_connection
|
233
|
+
Faraday.new(url: base_url) do |f|
|
234
|
+
f.request :multipart
|
235
|
+
f.request :url_encoded
|
236
|
+
f.response :json, content_type: /\bjson$/
|
237
|
+
f.adapter Faraday.default_adapter
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
def handle_response(response)
|
242
|
+
case response.status
|
243
|
+
when 200..299
|
244
|
+
response.body
|
245
|
+
when 400
|
246
|
+
error_message = extract_error_message(response.body)
|
247
|
+
raise BadRequestError, error_message.empty? ? "Bad request - invalid parameters" : error_message
|
248
|
+
when 401
|
249
|
+
error_message = extract_error_message(response.body)
|
250
|
+
raise AuthenticationError, error_message.empty? ? "Invalid API key or authentication failed" : error_message
|
251
|
+
when 402
|
252
|
+
error_message = extract_error_message(response.body)
|
253
|
+
raise PaymentRequiredError, error_message.empty? ? "Payment required" : error_message
|
254
|
+
when 403
|
255
|
+
error_message = extract_error_message(response.body)
|
256
|
+
raise ForbiddenError, error_message.empty? ? "Access forbidden" : error_message
|
257
|
+
when 404
|
258
|
+
error_message = extract_error_message(response.body)
|
259
|
+
raise NotFoundError, error_message.empty? ? "Resource not found" : error_message
|
260
|
+
when 408
|
261
|
+
error_message = extract_error_message(response.body)
|
262
|
+
raise TimeoutError, error_message.empty? ? "Request timeout" : error_message
|
263
|
+
when 422
|
264
|
+
error_message = extract_error_message(response.body)
|
265
|
+
raise UnprocessableEntityError, error_message.empty? ? "Unprocessable entity - invalid data" : error_message
|
266
|
+
when 429
|
267
|
+
error_message = extract_error_message(response.body)
|
268
|
+
raise RateLimitError, error_message.empty? ? "Rate limit exceeded" : error_message
|
269
|
+
when 503
|
270
|
+
error_message = extract_error_message(response.body)
|
271
|
+
raise ServiceUnavailableError, error_message.empty? ? "Service unavailable" : error_message
|
272
|
+
when 400..499
|
273
|
+
error_message = extract_error_message(response.body)
|
274
|
+
raise ValidationError, error_message.empty? ? "Client error occurred with status #{response.status}" : error_message
|
275
|
+
else
|
276
|
+
error_message = extract_error_message(response.body)
|
277
|
+
raise APIError, error_message.empty? ? "API request failed with status #{response.status}" : error_message
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
281
|
+
def extract_error_message(response_body)
|
282
|
+
return "" if response_body.nil? || response_body.empty?
|
283
|
+
|
284
|
+
# Handle non-string response bodies
|
285
|
+
body_str = response_body.is_a?(String) ? response_body : response_body.to_s
|
286
|
+
|
287
|
+
begin
|
288
|
+
error_info = JSON.parse(body_str)
|
289
|
+
|
290
|
+
# Try different common error message fields
|
291
|
+
message = error_info["detail"] ||
|
292
|
+
error_info["message"] ||
|
293
|
+
error_info["error"] ||
|
294
|
+
error_info["errors"]
|
295
|
+
|
296
|
+
# Handle nested detail objects
|
297
|
+
if message.is_a?(Hash)
|
298
|
+
message = message["message"] || message.to_s
|
299
|
+
elsif message.is_a?(Array)
|
300
|
+
message = message.first.to_s
|
301
|
+
end
|
302
|
+
|
303
|
+
message.to_s
|
304
|
+
rescue JSON::ParserError, TypeError
|
305
|
+
# If not JSON or can't be parsed, return the raw body (truncated if too long)
|
306
|
+
body_str.length > 200 ? "#{body_str[0..200]}..." : body_str
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
310
|
+
def mime_for(filename)
|
311
|
+
ext = File.extname(filename).downcase
|
312
|
+
case ext
|
313
|
+
when ".mp4" then "video/mp4"
|
314
|
+
when ".mov" then "video/quicktime"
|
315
|
+
when ".avi" then "video/x-msvideo"
|
316
|
+
when ".mkv" then "video/x-matroska"
|
317
|
+
when ".mp3" then "audio/mpeg"
|
318
|
+
when ".wav" then "audio/wav"
|
319
|
+
when ".flac" then "audio/flac"
|
320
|
+
when ".m4a" then "audio/mp4"
|
321
|
+
else "application/octet-stream"
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|
325
|
+
end
|
data/lib/elevenlabs_client.rb
CHANGED
@@ -3,34 +3,118 @@
|
|
3
3
|
require_relative "elevenlabs_client/version"
|
4
4
|
require_relative "elevenlabs_client/errors"
|
5
5
|
require_relative "elevenlabs_client/settings"
|
6
|
-
require_relative "elevenlabs_client/
|
7
|
-
require_relative "elevenlabs_client/
|
8
|
-
|
9
|
-
|
10
|
-
require_relative "elevenlabs_client/endpoints/text_to_voice"
|
11
|
-
require_relative "elevenlabs_client/endpoints/admin/models"
|
6
|
+
require_relative "elevenlabs_client/configuration"
|
7
|
+
require_relative "elevenlabs_client/http_client"
|
8
|
+
|
9
|
+
# Load all endpoint files
|
12
10
|
require_relative "elevenlabs_client/endpoints/admin/history"
|
11
|
+
require_relative "elevenlabs_client/endpoints/admin/models"
|
12
|
+
require_relative "elevenlabs_client/endpoints/admin/pronunciation_dictionaries"
|
13
|
+
require_relative "elevenlabs_client/endpoints/admin/samples"
|
14
|
+
require_relative "elevenlabs_client/endpoints/admin/service_accounts"
|
15
|
+
require_relative "elevenlabs_client/endpoints/admin/service_account_api_keys"
|
13
16
|
require_relative "elevenlabs_client/endpoints/admin/usage"
|
14
17
|
require_relative "elevenlabs_client/endpoints/admin/user"
|
15
18
|
require_relative "elevenlabs_client/endpoints/admin/voice_library"
|
16
|
-
require_relative "elevenlabs_client/endpoints/
|
17
|
-
require_relative "elevenlabs_client/endpoints/
|
19
|
+
require_relative "elevenlabs_client/endpoints/admin/webhooks"
|
20
|
+
require_relative "elevenlabs_client/endpoints/admin/workspace_groups"
|
21
|
+
require_relative "elevenlabs_client/endpoints/admin/workspace_invites"
|
22
|
+
require_relative "elevenlabs_client/endpoints/admin/workspace_members"
|
23
|
+
require_relative "elevenlabs_client/endpoints/admin/workspace_resources"
|
24
|
+
require_relative "elevenlabs_client/endpoints/admin/workspace_webhooks"
|
25
|
+
|
26
|
+
require_relative "elevenlabs_client/endpoints/agents_platform/agents"
|
27
|
+
require_relative "elevenlabs_client/endpoints/agents_platform/batch_calling"
|
28
|
+
require_relative "elevenlabs_client/endpoints/agents_platform/conversations"
|
29
|
+
require_relative "elevenlabs_client/endpoints/agents_platform/knowledge_base"
|
30
|
+
require_relative "elevenlabs_client/endpoints/agents_platform/mcp_servers"
|
31
|
+
require_relative "elevenlabs_client/endpoints/agents_platform/llm_usage"
|
32
|
+
require_relative "elevenlabs_client/endpoints/agents_platform/phone_numbers"
|
33
|
+
require_relative "elevenlabs_client/endpoints/agents_platform/outbound_calling"
|
34
|
+
require_relative "elevenlabs_client/endpoints/agents_platform/tools"
|
35
|
+
require_relative "elevenlabs_client/endpoints/agents_platform/tests"
|
36
|
+
require_relative "elevenlabs_client/endpoints/agents_platform/test_invocations"
|
37
|
+
require_relative "elevenlabs_client/endpoints/agents_platform/widgets"
|
38
|
+
require_relative "elevenlabs_client/endpoints/agents_platform/workspace"
|
39
|
+
|
18
40
|
require_relative "elevenlabs_client/endpoints/audio_isolation"
|
19
41
|
require_relative "elevenlabs_client/endpoints/audio_native"
|
42
|
+
require_relative "elevenlabs_client/endpoints/dubs"
|
20
43
|
require_relative "elevenlabs_client/endpoints/forced_alignment"
|
44
|
+
require_relative "elevenlabs_client/endpoints/music"
|
45
|
+
require_relative "elevenlabs_client/endpoints/sound_generation"
|
21
46
|
require_relative "elevenlabs_client/endpoints/speech_to_speech"
|
22
47
|
require_relative "elevenlabs_client/endpoints/speech_to_text"
|
48
|
+
require_relative "elevenlabs_client/endpoints/text_to_speech"
|
49
|
+
require_relative "elevenlabs_client/endpoints/text_to_dialogue"
|
50
|
+
require_relative "elevenlabs_client/endpoints/text_to_voice"
|
51
|
+
require_relative "elevenlabs_client/endpoints/voices"
|
23
52
|
require_relative "elevenlabs_client/endpoints/websocket_text_to_speech"
|
24
53
|
require_relative "elevenlabs_client/client"
|
25
54
|
|
26
55
|
module ElevenlabsClient
|
27
|
-
|
28
|
-
|
29
|
-
Client
|
30
|
-
|
56
|
+
class << self
|
57
|
+
# Create a new client instance
|
58
|
+
# @param options [Hash] Client configuration options
|
59
|
+
# @return [Client] New client instance
|
60
|
+
def new(**options)
|
61
|
+
Client.new(**options)
|
62
|
+
end
|
63
|
+
|
64
|
+
# Configure the client globally
|
65
|
+
# @yield [Settings] Global settings object
|
66
|
+
def configure(&block)
|
67
|
+
Settings.configure(&block)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Get global configuration
|
71
|
+
# @return [Configuration] Global configuration instance
|
72
|
+
def configuration
|
73
|
+
@configuration ||= Configuration.new
|
74
|
+
end
|
75
|
+
|
76
|
+
# Reset global configuration to defaults
|
77
|
+
def reset_configuration!
|
78
|
+
@configuration = Configuration.new
|
79
|
+
end
|
80
|
+
|
81
|
+
# Get a client using global configuration
|
82
|
+
# @return [Client] Client with global configuration
|
83
|
+
def client
|
84
|
+
new
|
85
|
+
end
|
86
|
+
|
87
|
+
# Get version information
|
88
|
+
# @return [Hash] Version and build information
|
89
|
+
def version_info
|
90
|
+
{
|
91
|
+
version: VERSION,
|
92
|
+
ruby_version: RUBY_VERSION
|
93
|
+
}
|
94
|
+
end
|
95
|
+
|
96
|
+
# Health check for the library
|
97
|
+
# @return [Hash] Health status
|
98
|
+
def health_check
|
99
|
+
begin
|
100
|
+
client_instance = client
|
101
|
+
api_health = client_instance.health_check
|
102
|
+
|
103
|
+
{
|
104
|
+
status: :ok,
|
105
|
+
library_version: VERSION,
|
106
|
+
api_health: api_health
|
107
|
+
}
|
108
|
+
rescue => e
|
109
|
+
{
|
110
|
+
status: :error,
|
111
|
+
error: e.message,
|
112
|
+
error_class: e.class.name
|
113
|
+
}
|
114
|
+
end
|
115
|
+
end
|
31
116
|
|
32
|
-
|
33
|
-
|
34
|
-
Settings.configure(&block)
|
117
|
+
# Backward compatibility method
|
118
|
+
alias_method :configure_v1, :configure
|
35
119
|
end
|
36
120
|
end
|
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.8.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-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -149,11 +149,35 @@ files:
|
|
149
149
|
- README.md
|
150
150
|
- lib/elevenlabs_client.rb
|
151
151
|
- lib/elevenlabs_client/client.rb
|
152
|
+
- lib/elevenlabs_client/configuration.rb
|
152
153
|
- lib/elevenlabs_client/endpoints/admin/history.rb
|
153
154
|
- lib/elevenlabs_client/endpoints/admin/models.rb
|
155
|
+
- lib/elevenlabs_client/endpoints/admin/pronunciation_dictionaries.rb
|
156
|
+
- lib/elevenlabs_client/endpoints/admin/samples.rb
|
157
|
+
- lib/elevenlabs_client/endpoints/admin/service_account_api_keys.rb
|
158
|
+
- lib/elevenlabs_client/endpoints/admin/service_accounts.rb
|
154
159
|
- lib/elevenlabs_client/endpoints/admin/usage.rb
|
155
160
|
- lib/elevenlabs_client/endpoints/admin/user.rb
|
156
161
|
- lib/elevenlabs_client/endpoints/admin/voice_library.rb
|
162
|
+
- lib/elevenlabs_client/endpoints/admin/webhooks.rb
|
163
|
+
- lib/elevenlabs_client/endpoints/admin/workspace_groups.rb
|
164
|
+
- lib/elevenlabs_client/endpoints/admin/workspace_invites.rb
|
165
|
+
- lib/elevenlabs_client/endpoints/admin/workspace_members.rb
|
166
|
+
- lib/elevenlabs_client/endpoints/admin/workspace_resources.rb
|
167
|
+
- lib/elevenlabs_client/endpoints/admin/workspace_webhooks.rb
|
168
|
+
- lib/elevenlabs_client/endpoints/agents_platform/agents.rb
|
169
|
+
- lib/elevenlabs_client/endpoints/agents_platform/batch_calling.rb
|
170
|
+
- lib/elevenlabs_client/endpoints/agents_platform/conversations.rb
|
171
|
+
- lib/elevenlabs_client/endpoints/agents_platform/knowledge_base.rb
|
172
|
+
- lib/elevenlabs_client/endpoints/agents_platform/llm_usage.rb
|
173
|
+
- lib/elevenlabs_client/endpoints/agents_platform/mcp_servers.rb
|
174
|
+
- lib/elevenlabs_client/endpoints/agents_platform/outbound_calling.rb
|
175
|
+
- lib/elevenlabs_client/endpoints/agents_platform/phone_numbers.rb
|
176
|
+
- lib/elevenlabs_client/endpoints/agents_platform/test_invocations.rb
|
177
|
+
- lib/elevenlabs_client/endpoints/agents_platform/tests.rb
|
178
|
+
- lib/elevenlabs_client/endpoints/agents_platform/tools.rb
|
179
|
+
- lib/elevenlabs_client/endpoints/agents_platform/widgets.rb
|
180
|
+
- lib/elevenlabs_client/endpoints/agents_platform/workspace.rb
|
157
181
|
- lib/elevenlabs_client/endpoints/audio_isolation.rb
|
158
182
|
- lib/elevenlabs_client/endpoints/audio_native.rb
|
159
183
|
- lib/elevenlabs_client/endpoints/dubs.rb
|
@@ -168,6 +192,7 @@ files:
|
|
168
192
|
- lib/elevenlabs_client/endpoints/voices.rb
|
169
193
|
- lib/elevenlabs_client/endpoints/websocket_text_to_speech.rb
|
170
194
|
- lib/elevenlabs_client/errors.rb
|
195
|
+
- lib/elevenlabs_client/http_client.rb
|
171
196
|
- lib/elevenlabs_client/settings.rb
|
172
197
|
- lib/elevenlabs_client/version.rb
|
173
198
|
homepage: https://github.com/vbrazo/elevenlabs_client
|