telnyx 5.45.1 → 5.46.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 +8 -0
- data/README.md +1 -1
- data/lib/telnyx/models/conferences/action_record_start_params.rb +1 -22
- data/lib/telnyx/models/text_to_speech_generate_speech_params.rb +43 -0
- data/lib/telnyx/models.rb +2 -2
- data/lib/telnyx/resources/conferences/actions.rb +1 -3
- data/lib/telnyx/resources/text_to_speech.rb +27 -54
- data/lib/telnyx/version.rb +1 -1
- data/lib/telnyx.rb +1 -1
- data/rbi/telnyx/models/conferences/action_record_start_params.rbi +0 -62
- data/rbi/telnyx/models/text_to_speech_generate_speech_params.rbi +74 -0
- data/rbi/telnyx/models.rbi +3 -2
- data/rbi/telnyx/resources/conferences/actions.rbi +0 -5
- data/rbi/telnyx/resources/text_to_speech.rbi +28 -59
- data/sig/telnyx/models/conferences/action_record_start_params.rbs +0 -20
- data/sig/telnyx/models/text_to_speech_generate_speech_params.rbs +28 -0
- data/sig/telnyx/models.rbs +2 -2
- data/sig/telnyx/resources/conferences/actions.rbs +0 -1
- data/sig/telnyx/resources/text_to_speech.rbs +6 -11
- metadata +4 -4
- data/lib/telnyx/models/text_to_speech_stream_params.rb +0 -111
- data/rbi/telnyx/models/text_to_speech_stream_params.rbi +0 -231
- data/sig/telnyx/models/text_to_speech_stream_params.rbs +0 -110
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 749bf5ef83a010a272fc426685fa0828ecfdc3c17332e25d8cca1c4a726bed5f
|
|
4
|
+
data.tar.gz: 0b75c29a16638a121322cbf88868e7a0734f29ce3133749817febc914c88a728
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a730a04d6f7fb0c82dee5a3e5618eaac0485a22dcc160b9ed877abc929eced757121d1028bb4b46d8553556632aab84c47e13aebead31b7d75b9e14f82bade4a
|
|
7
|
+
data.tar.gz: 12a26c71fd124acbee0ce60ac4a82c4384bed5fb18bb516aa2e1648fbdd48d36bba579dc03d64161439f2b6f2b1af3cb693257ceed5d6f165520e74780528861
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.46.0 (2026-02-26)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v5.45.1...v5.46.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.45.1...v5.46.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([32046e9](https://github.com/team-telnyx/telnyx-ruby/commit/32046e9c36466e4f3c34da20d391b7fc7ae00256))
|
|
10
|
+
|
|
3
11
|
## 5.45.1 (2026-02-26)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v5.45.0...v5.45.1](https://github.com/team-telnyx/telnyx-ruby/compare/v5.45.0...v5.45.1)
|
data/README.md
CHANGED
|
@@ -19,13 +19,6 @@ module Telnyx
|
|
|
19
19
|
},
|
|
20
20
|
api_name: :format
|
|
21
21
|
|
|
22
|
-
# @!attribute channels
|
|
23
|
-
# When `dual`, final audio file will be stereo recorded with the conference
|
|
24
|
-
# creator on the first channel, and the rest on the second channel.
|
|
25
|
-
#
|
|
26
|
-
# @return [Symbol, Telnyx::Models::Conferences::ActionRecordStartParams::Channels, nil]
|
|
27
|
-
optional :channels, enum: -> { Telnyx::Conferences::ActionRecordStartParams::Channels }
|
|
28
|
-
|
|
29
22
|
# @!attribute command_id
|
|
30
23
|
# Use this field to avoid duplicate commands. Telnyx will ignore any command with
|
|
31
24
|
# the same `command_id` for the same `conference_id`.
|
|
@@ -60,14 +53,12 @@ module Telnyx
|
|
|
60
53
|
# @return [Symbol, Telnyx::Models::Conferences::ActionRecordStartParams::Trim, nil]
|
|
61
54
|
optional :trim, enum: -> { Telnyx::Conferences::ActionRecordStartParams::Trim }
|
|
62
55
|
|
|
63
|
-
# @!method initialize(format_:,
|
|
56
|
+
# @!method initialize(format_:, command_id: nil, custom_file_name: nil, play_beep: nil, region: nil, trim: nil, request_options: {})
|
|
64
57
|
# Some parameter documentations has been truncated, see
|
|
65
58
|
# {Telnyx::Models::Conferences::ActionRecordStartParams} for more details.
|
|
66
59
|
#
|
|
67
60
|
# @param format_ [Symbol, Telnyx::Models::Conferences::ActionRecordStartParams::Format] The audio file format used when storing the conference recording. Can be either
|
|
68
61
|
#
|
|
69
|
-
# @param channels [Symbol, Telnyx::Models::Conferences::ActionRecordStartParams::Channels] When `dual`, final audio file will be stereo recorded with the conference creato
|
|
70
|
-
#
|
|
71
62
|
# @param command_id [String] Use this field to avoid duplicate commands. Telnyx will ignore any command with
|
|
72
63
|
#
|
|
73
64
|
# @param custom_file_name [String] The custom recording file name to be used instead of the default `call_leg_id`.
|
|
@@ -92,18 +83,6 @@ module Telnyx
|
|
|
92
83
|
# @return [Array<Symbol>]
|
|
93
84
|
end
|
|
94
85
|
|
|
95
|
-
# When `dual`, final audio file will be stereo recorded with the conference
|
|
96
|
-
# creator on the first channel, and the rest on the second channel.
|
|
97
|
-
module Channels
|
|
98
|
-
extend Telnyx::Internal::Type::Enum
|
|
99
|
-
|
|
100
|
-
SINGLE = :single
|
|
101
|
-
DUAL = :dual
|
|
102
|
-
|
|
103
|
-
# @!method self.values
|
|
104
|
-
# @return [Array<Symbol>]
|
|
105
|
-
end
|
|
106
|
-
|
|
107
86
|
# Region where the conference data is located. Defaults to the region defined in
|
|
108
87
|
# user's data locality settings (Europe or US).
|
|
109
88
|
module Region
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
# @see Telnyx::Resources::TextToSpeech#generate_speech
|
|
6
|
+
class TextToSpeechGenerateSpeechParams < Telnyx::Internal::Type::BaseModel
|
|
7
|
+
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Telnyx::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute text
|
|
11
|
+
# The text to convert to speech
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :text, String
|
|
15
|
+
|
|
16
|
+
# @!attribute voice
|
|
17
|
+
# The voice ID in the format Provider.ModelId.VoiceId.
|
|
18
|
+
#
|
|
19
|
+
# Examples:
|
|
20
|
+
#
|
|
21
|
+
# - AWS.Polly.Joanna-Neural
|
|
22
|
+
# - Azure.en-US-AvaMultilingualNeural
|
|
23
|
+
# - ElevenLabs.eleven_multilingual_v2.Rachel
|
|
24
|
+
# - Telnyx.KokoroTTS.af
|
|
25
|
+
#
|
|
26
|
+
# Use the `GET /text-to-speech/voices` endpoint to get a complete list of
|
|
27
|
+
# available voices.
|
|
28
|
+
#
|
|
29
|
+
# @return [String]
|
|
30
|
+
required :voice, String
|
|
31
|
+
|
|
32
|
+
# @!method initialize(text:, voice:, request_options: {})
|
|
33
|
+
# Some parameter documentations has been truncated, see
|
|
34
|
+
# {Telnyx::Models::TextToSpeechGenerateSpeechParams} for more details.
|
|
35
|
+
#
|
|
36
|
+
# @param text [String] The text to convert to speech
|
|
37
|
+
#
|
|
38
|
+
# @param voice [String] The voice ID in the format Provider.ModelId.VoiceId.
|
|
39
|
+
#
|
|
40
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
data/lib/telnyx/models.rb
CHANGED
|
@@ -1488,9 +1488,9 @@ module Telnyx
|
|
|
1488
1488
|
|
|
1489
1489
|
TexmlSecretsParams = Telnyx::Models::TexmlSecretsParams
|
|
1490
1490
|
|
|
1491
|
-
|
|
1491
|
+
TextToSpeechGenerateSpeechParams = Telnyx::Models::TextToSpeechGenerateSpeechParams
|
|
1492
1492
|
|
|
1493
|
-
|
|
1493
|
+
TextToSpeechListVoicesParams = Telnyx::Models::TextToSpeechListVoicesParams
|
|
1494
1494
|
|
|
1495
1495
|
TrafficType = Telnyx::Models::TrafficType
|
|
1496
1496
|
|
|
@@ -391,14 +391,12 @@ module Telnyx
|
|
|
391
391
|
#
|
|
392
392
|
# - `conference.recording.saved`
|
|
393
393
|
#
|
|
394
|
-
# @overload record_start(id, format_:,
|
|
394
|
+
# @overload record_start(id, format_:, command_id: nil, custom_file_name: nil, play_beep: nil, region: nil, trim: nil, request_options: {})
|
|
395
395
|
#
|
|
396
396
|
# @param id [String] Specifies the conference to record by id or name
|
|
397
397
|
#
|
|
398
398
|
# @param format_ [Symbol, Telnyx::Models::Conferences::ActionRecordStartParams::Format] The audio file format used when storing the conference recording. Can be either
|
|
399
399
|
#
|
|
400
|
-
# @param channels [Symbol, Telnyx::Models::Conferences::ActionRecordStartParams::Channels] When `dual`, final audio file will be stereo recorded with the conference creato
|
|
401
|
-
#
|
|
402
400
|
# @param command_id [String] Use this field to avoid duplicate commands. Telnyx will ignore any command with
|
|
403
401
|
#
|
|
404
402
|
# @param custom_file_name [String] The custom recording file name to be used instead of the default `call_leg_id`.
|
|
@@ -3,82 +3,55 @@
|
|
|
3
3
|
module Telnyx
|
|
4
4
|
module Resources
|
|
5
5
|
class TextToSpeech
|
|
6
|
-
#
|
|
6
|
+
# Some parameter documentations has been truncated, see
|
|
7
|
+
# {Telnyx::Models::TextToSpeechGenerateSpeechParams} for more details.
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
+
# Converts the provided text to speech using the specified voice and returns audio
|
|
10
|
+
# data
|
|
9
11
|
#
|
|
10
|
-
# @
|
|
12
|
+
# @overload generate_speech(text:, voice:, request_options: {})
|
|
11
13
|
#
|
|
12
|
-
# @param
|
|
14
|
+
# @param text [String] The text to convert to speech
|
|
15
|
+
#
|
|
16
|
+
# @param voice [String] The voice ID in the format Provider.ModelId.VoiceId.
|
|
13
17
|
#
|
|
14
18
|
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
15
19
|
#
|
|
16
|
-
# @return [
|
|
20
|
+
# @return [StringIO]
|
|
17
21
|
#
|
|
18
|
-
# @see Telnyx::Models::
|
|
19
|
-
def
|
|
20
|
-
parsed, options = Telnyx::
|
|
22
|
+
# @see Telnyx::Models::TextToSpeechGenerateSpeechParams
|
|
23
|
+
def generate_speech(params)
|
|
24
|
+
parsed, options = Telnyx::TextToSpeechGenerateSpeechParams.dump_request(params)
|
|
21
25
|
@client.request(
|
|
22
|
-
method: :
|
|
23
|
-
path: "text-to-speech/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
method: :post,
|
|
27
|
+
path: "text-to-speech/speech",
|
|
28
|
+
headers: {"accept" => "audio/mpeg"},
|
|
29
|
+
body: parsed,
|
|
30
|
+
model: StringIO,
|
|
26
31
|
options: options
|
|
27
32
|
)
|
|
28
33
|
end
|
|
29
34
|
|
|
30
|
-
#
|
|
31
|
-
# {Telnyx::Models::TextToSpeechStreamParams} for more details.
|
|
32
|
-
#
|
|
33
|
-
# Open a WebSocket connection to stream text and receive synthesized audio in real
|
|
34
|
-
# time. Authentication is provided via the standard
|
|
35
|
-
# `Authorization: Bearer <API_KEY>` header. Send JSON frames with text to
|
|
36
|
-
# synthesize; receive JSON frames containing base64-encoded audio chunks.
|
|
37
|
-
#
|
|
38
|
-
# Supported providers: `aws`, `telnyx`, `azure`, `murfai`, `minimax`, `rime`,
|
|
39
|
-
# `resemble`, `elevenlabs`.
|
|
40
|
-
#
|
|
41
|
-
# **Connection flow:**
|
|
42
|
-
#
|
|
43
|
-
# 1. Open WebSocket with query parameters specifying provider, voice, and model.
|
|
44
|
-
# 2. Send an initial handshake message `{"text": " "}` (single space) with
|
|
45
|
-
# optional `voice_settings` to initialize the session.
|
|
46
|
-
# 3. Send text messages as `{"text": "Hello world"}`.
|
|
47
|
-
# 4. Receive audio chunks as JSON frames with base64-encoded audio.
|
|
48
|
-
# 5. A final frame with `isFinal: true` indicates the end of audio for the current
|
|
49
|
-
# text.
|
|
50
|
-
#
|
|
51
|
-
# To interrupt and restart synthesis mid-stream, send `{"force": true}` — the
|
|
52
|
-
# current worker is stopped and a new one is started.
|
|
53
|
-
#
|
|
54
|
-
# @overload stream(audio_format: nil, disable_cache: nil, model_id: nil, provider: nil, socket_id: nil, voice: nil, voice_id: nil, request_options: {})
|
|
55
|
-
#
|
|
56
|
-
# @param audio_format [Symbol, Telnyx::Models::TextToSpeechStreamParams::AudioFormat] Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
57
|
-
#
|
|
58
|
-
# @param disable_cache [Boolean] When `true`, bypass the audio cache and generate fresh audio.
|
|
59
|
-
#
|
|
60
|
-
# @param model_id [String] Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD` (Teln
|
|
61
|
-
#
|
|
62
|
-
# @param provider [Symbol, Telnyx::Models::TextToSpeechStreamParams::Provider] TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is pro
|
|
35
|
+
# Returns a list of voices that can be used with the text to speech commands.
|
|
63
36
|
#
|
|
64
|
-
# @
|
|
37
|
+
# @overload list_voices(elevenlabs_api_key_ref: nil, provider: nil, request_options: {})
|
|
65
38
|
#
|
|
66
|
-
# @param
|
|
39
|
+
# @param elevenlabs_api_key_ref [String] Reference to your ElevenLabs API key stored in the Telnyx Portal
|
|
67
40
|
#
|
|
68
|
-
# @param
|
|
41
|
+
# @param provider [Symbol, Telnyx::Models::TextToSpeechListVoicesParams::Provider] Filter voices by provider
|
|
69
42
|
#
|
|
70
43
|
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
71
44
|
#
|
|
72
|
-
# @return [
|
|
45
|
+
# @return [Telnyx::Models::TextToSpeechListVoicesResponse]
|
|
73
46
|
#
|
|
74
|
-
# @see Telnyx::Models::
|
|
75
|
-
def
|
|
76
|
-
parsed, options = Telnyx::
|
|
47
|
+
# @see Telnyx::Models::TextToSpeechListVoicesParams
|
|
48
|
+
def list_voices(params = {})
|
|
49
|
+
parsed, options = Telnyx::TextToSpeechListVoicesParams.dump_request(params)
|
|
77
50
|
@client.request(
|
|
78
51
|
method: :get,
|
|
79
|
-
path: "text-to-speech/
|
|
52
|
+
path: "text-to-speech/voices",
|
|
80
53
|
query: parsed,
|
|
81
|
-
model:
|
|
54
|
+
model: Telnyx::Models::TextToSpeechListVoicesResponse,
|
|
82
55
|
options: options
|
|
83
56
|
)
|
|
84
57
|
end
|
data/lib/telnyx/version.rb
CHANGED
data/lib/telnyx.rb
CHANGED
|
@@ -2036,9 +2036,9 @@ require_relative "telnyx/models/texml_application_update_params"
|
|
|
2036
2036
|
require_relative "telnyx/models/texml_application_update_response"
|
|
2037
2037
|
require_relative "telnyx/models/texml_secrets_params"
|
|
2038
2038
|
require_relative "telnyx/models/texml_secrets_response"
|
|
2039
|
+
require_relative "telnyx/models/text_to_speech_generate_speech_params"
|
|
2039
2040
|
require_relative "telnyx/models/text_to_speech_list_voices_params"
|
|
2040
2041
|
require_relative "telnyx/models/text_to_speech_list_voices_response"
|
|
2041
|
-
require_relative "telnyx/models/text_to_speech_stream_params"
|
|
2042
2042
|
require_relative "telnyx/models/traffic_type"
|
|
2043
2043
|
require_relative "telnyx/models/transcription"
|
|
2044
2044
|
require_relative "telnyx/models/transcription_webhook_event"
|
|
@@ -24,25 +24,6 @@ module Telnyx
|
|
|
24
24
|
end
|
|
25
25
|
attr_accessor :format_
|
|
26
26
|
|
|
27
|
-
# When `dual`, final audio file will be stereo recorded with the conference
|
|
28
|
-
# creator on the first channel, and the rest on the second channel.
|
|
29
|
-
sig do
|
|
30
|
-
returns(
|
|
31
|
-
T.nilable(
|
|
32
|
-
Telnyx::Conferences::ActionRecordStartParams::Channels::OrSymbol
|
|
33
|
-
)
|
|
34
|
-
)
|
|
35
|
-
end
|
|
36
|
-
attr_reader :channels
|
|
37
|
-
|
|
38
|
-
sig do
|
|
39
|
-
params(
|
|
40
|
-
channels:
|
|
41
|
-
Telnyx::Conferences::ActionRecordStartParams::Channels::OrSymbol
|
|
42
|
-
).void
|
|
43
|
-
end
|
|
44
|
-
attr_writer :channels
|
|
45
|
-
|
|
46
27
|
# Use this field to avoid duplicate commands. Telnyx will ignore any command with
|
|
47
28
|
# the same `command_id` for the same `conference_id`.
|
|
48
29
|
sig { returns(T.nilable(String)) }
|
|
@@ -107,8 +88,6 @@ module Telnyx
|
|
|
107
88
|
params(
|
|
108
89
|
format_:
|
|
109
90
|
Telnyx::Conferences::ActionRecordStartParams::Format::OrSymbol,
|
|
110
|
-
channels:
|
|
111
|
-
Telnyx::Conferences::ActionRecordStartParams::Channels::OrSymbol,
|
|
112
91
|
command_id: String,
|
|
113
92
|
custom_file_name: String,
|
|
114
93
|
play_beep: T::Boolean,
|
|
@@ -122,9 +101,6 @@ module Telnyx
|
|
|
122
101
|
# The audio file format used when storing the conference recording. Can be either
|
|
123
102
|
# `mp3` or `wav`.
|
|
124
103
|
format_:,
|
|
125
|
-
# When `dual`, final audio file will be stereo recorded with the conference
|
|
126
|
-
# creator on the first channel, and the rest on the second channel.
|
|
127
|
-
channels: nil,
|
|
128
104
|
# Use this field to avoid duplicate commands. Telnyx will ignore any command with
|
|
129
105
|
# the same `command_id` for the same `conference_id`.
|
|
130
106
|
command_id: nil,
|
|
@@ -148,8 +124,6 @@ module Telnyx
|
|
|
148
124
|
{
|
|
149
125
|
format_:
|
|
150
126
|
Telnyx::Conferences::ActionRecordStartParams::Format::OrSymbol,
|
|
151
|
-
channels:
|
|
152
|
-
Telnyx::Conferences::ActionRecordStartParams::Channels::OrSymbol,
|
|
153
127
|
command_id: String,
|
|
154
128
|
custom_file_name: String,
|
|
155
129
|
play_beep: T::Boolean,
|
|
@@ -200,42 +174,6 @@ module Telnyx
|
|
|
200
174
|
end
|
|
201
175
|
end
|
|
202
176
|
|
|
203
|
-
# When `dual`, final audio file will be stereo recorded with the conference
|
|
204
|
-
# creator on the first channel, and the rest on the second channel.
|
|
205
|
-
module Channels
|
|
206
|
-
extend Telnyx::Internal::Type::Enum
|
|
207
|
-
|
|
208
|
-
TaggedSymbol =
|
|
209
|
-
T.type_alias do
|
|
210
|
-
T.all(
|
|
211
|
-
Symbol,
|
|
212
|
-
Telnyx::Conferences::ActionRecordStartParams::Channels
|
|
213
|
-
)
|
|
214
|
-
end
|
|
215
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
216
|
-
|
|
217
|
-
SINGLE =
|
|
218
|
-
T.let(
|
|
219
|
-
:single,
|
|
220
|
-
Telnyx::Conferences::ActionRecordStartParams::Channels::TaggedSymbol
|
|
221
|
-
)
|
|
222
|
-
DUAL =
|
|
223
|
-
T.let(
|
|
224
|
-
:dual,
|
|
225
|
-
Telnyx::Conferences::ActionRecordStartParams::Channels::TaggedSymbol
|
|
226
|
-
)
|
|
227
|
-
|
|
228
|
-
sig do
|
|
229
|
-
override.returns(
|
|
230
|
-
T::Array[
|
|
231
|
-
Telnyx::Conferences::ActionRecordStartParams::Channels::TaggedSymbol
|
|
232
|
-
]
|
|
233
|
-
)
|
|
234
|
-
end
|
|
235
|
-
def self.values
|
|
236
|
-
end
|
|
237
|
-
end
|
|
238
|
-
|
|
239
177
|
# Region where the conference data is located. Defaults to the region defined in
|
|
240
178
|
# user's data locality settings (Europe or US).
|
|
241
179
|
module Region
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
class TextToSpeechGenerateSpeechParams < Telnyx::Internal::Type::BaseModel
|
|
6
|
+
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Telnyx::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Telnyx::TextToSpeechGenerateSpeechParams,
|
|
13
|
+
Telnyx::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The text to convert to speech
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :text
|
|
20
|
+
|
|
21
|
+
# The voice ID in the format Provider.ModelId.VoiceId.
|
|
22
|
+
#
|
|
23
|
+
# Examples:
|
|
24
|
+
#
|
|
25
|
+
# - AWS.Polly.Joanna-Neural
|
|
26
|
+
# - Azure.en-US-AvaMultilingualNeural
|
|
27
|
+
# - ElevenLabs.eleven_multilingual_v2.Rachel
|
|
28
|
+
# - Telnyx.KokoroTTS.af
|
|
29
|
+
#
|
|
30
|
+
# Use the `GET /text-to-speech/voices` endpoint to get a complete list of
|
|
31
|
+
# available voices.
|
|
32
|
+
sig { returns(String) }
|
|
33
|
+
attr_accessor :voice
|
|
34
|
+
|
|
35
|
+
sig do
|
|
36
|
+
params(
|
|
37
|
+
text: String,
|
|
38
|
+
voice: String,
|
|
39
|
+
request_options: Telnyx::RequestOptions::OrHash
|
|
40
|
+
).returns(T.attached_class)
|
|
41
|
+
end
|
|
42
|
+
def self.new(
|
|
43
|
+
# The text to convert to speech
|
|
44
|
+
text:,
|
|
45
|
+
# The voice ID in the format Provider.ModelId.VoiceId.
|
|
46
|
+
#
|
|
47
|
+
# Examples:
|
|
48
|
+
#
|
|
49
|
+
# - AWS.Polly.Joanna-Neural
|
|
50
|
+
# - Azure.en-US-AvaMultilingualNeural
|
|
51
|
+
# - ElevenLabs.eleven_multilingual_v2.Rachel
|
|
52
|
+
# - Telnyx.KokoroTTS.af
|
|
53
|
+
#
|
|
54
|
+
# Use the `GET /text-to-speech/voices` endpoint to get a complete list of
|
|
55
|
+
# available voices.
|
|
56
|
+
voice:,
|
|
57
|
+
request_options: {}
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
sig do
|
|
62
|
+
override.returns(
|
|
63
|
+
{
|
|
64
|
+
text: String,
|
|
65
|
+
voice: String,
|
|
66
|
+
request_options: Telnyx::RequestOptions
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
def to_hash
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
data/rbi/telnyx/models.rbi
CHANGED
|
@@ -1648,9 +1648,10 @@ module Telnyx
|
|
|
1648
1648
|
|
|
1649
1649
|
TexmlSecretsParams = Telnyx::Models::TexmlSecretsParams
|
|
1650
1650
|
|
|
1651
|
-
|
|
1651
|
+
TextToSpeechGenerateSpeechParams =
|
|
1652
|
+
Telnyx::Models::TextToSpeechGenerateSpeechParams
|
|
1652
1653
|
|
|
1653
|
-
|
|
1654
|
+
TextToSpeechListVoicesParams = Telnyx::Models::TextToSpeechListVoicesParams
|
|
1654
1655
|
|
|
1655
1656
|
TrafficType = Telnyx::Models::TrafficType
|
|
1656
1657
|
|
|
@@ -410,8 +410,6 @@ module Telnyx
|
|
|
410
410
|
id: String,
|
|
411
411
|
format_:
|
|
412
412
|
Telnyx::Conferences::ActionRecordStartParams::Format::OrSymbol,
|
|
413
|
-
channels:
|
|
414
|
-
Telnyx::Conferences::ActionRecordStartParams::Channels::OrSymbol,
|
|
415
413
|
command_id: String,
|
|
416
414
|
custom_file_name: String,
|
|
417
415
|
play_beep: T::Boolean,
|
|
@@ -427,9 +425,6 @@ module Telnyx
|
|
|
427
425
|
# The audio file format used when storing the conference recording. Can be either
|
|
428
426
|
# `mp3` or `wav`.
|
|
429
427
|
format_:,
|
|
430
|
-
# When `dual`, final audio file will be stereo recorded with the conference
|
|
431
|
-
# creator on the first channel, and the rest on the second channel.
|
|
432
|
-
channels: nil,
|
|
433
428
|
# Use this field to avoid duplicate commands. Telnyx will ignore any command with
|
|
434
429
|
# the same `command_id` for the same `conference_id`.
|
|
435
430
|
command_id: nil,
|
|
@@ -3,78 +3,47 @@
|
|
|
3
3
|
module Telnyx
|
|
4
4
|
module Resources
|
|
5
5
|
class TextToSpeech
|
|
6
|
-
#
|
|
6
|
+
# Converts the provided text to speech using the specified voice and returns audio
|
|
7
|
+
# data
|
|
7
8
|
sig do
|
|
8
9
|
params(
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
text: String,
|
|
11
|
+
voice: String,
|
|
11
12
|
request_options: Telnyx::RequestOptions::OrHash
|
|
12
|
-
).returns(
|
|
13
|
+
).returns(StringIO)
|
|
13
14
|
end
|
|
14
|
-
def
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
#
|
|
18
|
-
|
|
15
|
+
def generate_speech(
|
|
16
|
+
# The text to convert to speech
|
|
17
|
+
text:,
|
|
18
|
+
# The voice ID in the format Provider.ModelId.VoiceId.
|
|
19
|
+
#
|
|
20
|
+
# Examples:
|
|
21
|
+
#
|
|
22
|
+
# - AWS.Polly.Joanna-Neural
|
|
23
|
+
# - Azure.en-US-AvaMultilingualNeural
|
|
24
|
+
# - ElevenLabs.eleven_multilingual_v2.Rachel
|
|
25
|
+
# - Telnyx.KokoroTTS.af
|
|
26
|
+
#
|
|
27
|
+
# Use the `GET /text-to-speech/voices` endpoint to get a complete list of
|
|
28
|
+
# available voices.
|
|
29
|
+
voice:,
|
|
19
30
|
request_options: {}
|
|
20
31
|
)
|
|
21
32
|
end
|
|
22
33
|
|
|
23
|
-
#
|
|
24
|
-
# time. Authentication is provided via the standard
|
|
25
|
-
# `Authorization: Bearer <API_KEY>` header. Send JSON frames with text to
|
|
26
|
-
# synthesize; receive JSON frames containing base64-encoded audio chunks.
|
|
27
|
-
#
|
|
28
|
-
# Supported providers: `aws`, `telnyx`, `azure`, `murfai`, `minimax`, `rime`,
|
|
29
|
-
# `resemble`, `elevenlabs`.
|
|
30
|
-
#
|
|
31
|
-
# **Connection flow:**
|
|
32
|
-
#
|
|
33
|
-
# 1. Open WebSocket with query parameters specifying provider, voice, and model.
|
|
34
|
-
# 2. Send an initial handshake message `{"text": " "}` (single space) with
|
|
35
|
-
# optional `voice_settings` to initialize the session.
|
|
36
|
-
# 3. Send text messages as `{"text": "Hello world"}`.
|
|
37
|
-
# 4. Receive audio chunks as JSON frames with base64-encoded audio.
|
|
38
|
-
# 5. A final frame with `isFinal: true` indicates the end of audio for the current
|
|
39
|
-
# text.
|
|
40
|
-
#
|
|
41
|
-
# To interrupt and restart synthesis mid-stream, send `{"force": true}` — the
|
|
42
|
-
# current worker is stopped and a new one is started.
|
|
34
|
+
# Returns a list of voices that can be used with the text to speech commands.
|
|
43
35
|
sig do
|
|
44
36
|
params(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
model_id: String,
|
|
48
|
-
provider: Telnyx::TextToSpeechStreamParams::Provider::OrSymbol,
|
|
49
|
-
socket_id: String,
|
|
50
|
-
voice: String,
|
|
51
|
-
voice_id: String,
|
|
37
|
+
elevenlabs_api_key_ref: String,
|
|
38
|
+
provider: Telnyx::TextToSpeechListVoicesParams::Provider::OrSymbol,
|
|
52
39
|
request_options: Telnyx::RequestOptions::OrHash
|
|
53
|
-
).
|
|
40
|
+
).returns(Telnyx::Models::TextToSpeechListVoicesResponse)
|
|
54
41
|
end
|
|
55
|
-
def
|
|
56
|
-
#
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
# When `true`, bypass the audio cache and generate fresh audio.
|
|
60
|
-
disable_cache: nil,
|
|
61
|
-
# Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD`
|
|
62
|
-
# (Telnyx); `Polly.Generative` (AWS).
|
|
63
|
-
model_id: nil,
|
|
64
|
-
# TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is
|
|
65
|
-
# provided.
|
|
42
|
+
def list_voices(
|
|
43
|
+
# Reference to your ElevenLabs API key stored in the Telnyx Portal
|
|
44
|
+
elevenlabs_api_key_ref: nil,
|
|
45
|
+
# Filter voices by provider
|
|
66
46
|
provider: nil,
|
|
67
|
-
# Client-provided socket identifier for tracking. If not provided, one is
|
|
68
|
-
# generated server-side.
|
|
69
|
-
socket_id: nil,
|
|
70
|
-
# Voice identifier in the format `provider.model_id.voice_id` or
|
|
71
|
-
# `provider.voice_id` (e.g. `telnyx.NaturalHD.Telnyx_Alloy` or
|
|
72
|
-
# `azure.en-US-AvaMultilingualNeural`). When provided, the `provider`, `model_id`,
|
|
73
|
-
# and `voice_id` are extracted automatically. Takes precedence over individual
|
|
74
|
-
# `provider`/`model_id`/`voice_id` parameters.
|
|
75
|
-
voice: nil,
|
|
76
|
-
# Voice identifier for the chosen provider.
|
|
77
|
-
voice_id: nil,
|
|
78
47
|
request_options: {}
|
|
79
48
|
)
|
|
80
49
|
end
|
|
@@ -4,7 +4,6 @@ module Telnyx
|
|
|
4
4
|
type action_record_start_params =
|
|
5
5
|
{
|
|
6
6
|
format_: Telnyx::Models::Conferences::ActionRecordStartParams::format_,
|
|
7
|
-
channels: Telnyx::Models::Conferences::ActionRecordStartParams::channels,
|
|
8
7
|
command_id: String,
|
|
9
8
|
custom_file_name: String,
|
|
10
9
|
play_beep: bool,
|
|
@@ -19,12 +18,6 @@ module Telnyx
|
|
|
19
18
|
|
|
20
19
|
attr_accessor format_: Telnyx::Models::Conferences::ActionRecordStartParams::format_
|
|
21
20
|
|
|
22
|
-
attr_reader channels: Telnyx::Models::Conferences::ActionRecordStartParams::channels?
|
|
23
|
-
|
|
24
|
-
def channels=: (
|
|
25
|
-
Telnyx::Models::Conferences::ActionRecordStartParams::channels
|
|
26
|
-
) -> Telnyx::Models::Conferences::ActionRecordStartParams::channels
|
|
27
|
-
|
|
28
21
|
attr_reader command_id: String?
|
|
29
22
|
|
|
30
23
|
def command_id=: (String) -> String
|
|
@@ -51,7 +44,6 @@ module Telnyx
|
|
|
51
44
|
|
|
52
45
|
def initialize: (
|
|
53
46
|
format_: Telnyx::Models::Conferences::ActionRecordStartParams::format_,
|
|
54
|
-
?channels: Telnyx::Models::Conferences::ActionRecordStartParams::channels,
|
|
55
47
|
?command_id: String,
|
|
56
48
|
?custom_file_name: String,
|
|
57
49
|
?play_beep: bool,
|
|
@@ -62,7 +54,6 @@ module Telnyx
|
|
|
62
54
|
|
|
63
55
|
def to_hash: -> {
|
|
64
56
|
format_: Telnyx::Models::Conferences::ActionRecordStartParams::format_,
|
|
65
|
-
channels: Telnyx::Models::Conferences::ActionRecordStartParams::channels,
|
|
66
57
|
command_id: String,
|
|
67
58
|
custom_file_name: String,
|
|
68
59
|
play_beep: bool,
|
|
@@ -82,17 +73,6 @@ module Telnyx
|
|
|
82
73
|
def self?.values: -> ::Array[Telnyx::Models::Conferences::ActionRecordStartParams::format_]
|
|
83
74
|
end
|
|
84
75
|
|
|
85
|
-
type channels = :single | :dual
|
|
86
|
-
|
|
87
|
-
module Channels
|
|
88
|
-
extend Telnyx::Internal::Type::Enum
|
|
89
|
-
|
|
90
|
-
SINGLE: :single
|
|
91
|
-
DUAL: :dual
|
|
92
|
-
|
|
93
|
-
def self?.values: -> ::Array[Telnyx::Models::Conferences::ActionRecordStartParams::channels]
|
|
94
|
-
end
|
|
95
|
-
|
|
96
76
|
type region = :Australia | :Europe | :"Middle East" | :US
|
|
97
77
|
|
|
98
78
|
module Region
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Telnyx
|
|
2
|
+
module Models
|
|
3
|
+
type text_to_speech_generate_speech_params =
|
|
4
|
+
{ text: String, voice: String }
|
|
5
|
+
& Telnyx::Internal::Type::request_parameters
|
|
6
|
+
|
|
7
|
+
class TextToSpeechGenerateSpeechParams < Telnyx::Internal::Type::BaseModel
|
|
8
|
+
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Telnyx::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
attr_accessor text: String
|
|
12
|
+
|
|
13
|
+
attr_accessor voice: String
|
|
14
|
+
|
|
15
|
+
def initialize: (
|
|
16
|
+
text: String,
|
|
17
|
+
voice: String,
|
|
18
|
+
?request_options: Telnyx::request_opts
|
|
19
|
+
) -> void
|
|
20
|
+
|
|
21
|
+
def to_hash: -> {
|
|
22
|
+
text: String,
|
|
23
|
+
voice: String,
|
|
24
|
+
request_options: Telnyx::RequestOptions
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
data/sig/telnyx/models.rbs
CHANGED
|
@@ -1431,9 +1431,9 @@ module Telnyx
|
|
|
1431
1431
|
|
|
1432
1432
|
class TexmlSecretsParams = Telnyx::Models::TexmlSecretsParams
|
|
1433
1433
|
|
|
1434
|
-
class
|
|
1434
|
+
class TextToSpeechGenerateSpeechParams = Telnyx::Models::TextToSpeechGenerateSpeechParams
|
|
1435
1435
|
|
|
1436
|
-
class
|
|
1436
|
+
class TextToSpeechListVoicesParams = Telnyx::Models::TextToSpeechListVoicesParams
|
|
1437
1437
|
|
|
1438
1438
|
module TrafficType = Telnyx::Models::TrafficType
|
|
1439
1439
|
|
|
@@ -112,7 +112,6 @@ module Telnyx
|
|
|
112
112
|
def record_start: (
|
|
113
113
|
String id,
|
|
114
114
|
format_: Telnyx::Models::Conferences::ActionRecordStartParams::format_,
|
|
115
|
-
?channels: Telnyx::Models::Conferences::ActionRecordStartParams::channels,
|
|
116
115
|
?command_id: String,
|
|
117
116
|
?custom_file_name: String,
|
|
118
117
|
?play_beep: bool,
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
module Telnyx
|
|
2
2
|
module Resources
|
|
3
3
|
class TextToSpeech
|
|
4
|
+
def generate_speech: (
|
|
5
|
+
text: String,
|
|
6
|
+
voice: String,
|
|
7
|
+
?request_options: Telnyx::request_opts
|
|
8
|
+
) -> StringIO
|
|
9
|
+
|
|
4
10
|
def list_voices: (
|
|
5
11
|
?elevenlabs_api_key_ref: String,
|
|
6
12
|
?provider: Telnyx::Models::TextToSpeechListVoicesParams::provider,
|
|
7
13
|
?request_options: Telnyx::request_opts
|
|
8
14
|
) -> Telnyx::Models::TextToSpeechListVoicesResponse
|
|
9
15
|
|
|
10
|
-
def stream: (
|
|
11
|
-
?audio_format: Telnyx::Models::TextToSpeechStreamParams::audio_format,
|
|
12
|
-
?disable_cache: bool,
|
|
13
|
-
?model_id: String,
|
|
14
|
-
?provider: Telnyx::Models::TextToSpeechStreamParams::provider,
|
|
15
|
-
?socket_id: String,
|
|
16
|
-
?voice: String,
|
|
17
|
-
?voice_id: String,
|
|
18
|
-
?request_options: Telnyx::request_opts
|
|
19
|
-
) -> nil
|
|
20
|
-
|
|
21
16
|
def initialize: (client: Telnyx::Client) -> void
|
|
22
17
|
end
|
|
23
18
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: telnyx
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.46.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Telnyx
|
|
@@ -2053,9 +2053,9 @@ files:
|
|
|
2053
2053
|
- lib/telnyx/models/texml_application_update_response.rb
|
|
2054
2054
|
- lib/telnyx/models/texml_secrets_params.rb
|
|
2055
2055
|
- lib/telnyx/models/texml_secrets_response.rb
|
|
2056
|
+
- lib/telnyx/models/text_to_speech_generate_speech_params.rb
|
|
2056
2057
|
- lib/telnyx/models/text_to_speech_list_voices_params.rb
|
|
2057
2058
|
- lib/telnyx/models/text_to_speech_list_voices_response.rb
|
|
2058
|
-
- lib/telnyx/models/text_to_speech_stream_params.rb
|
|
2059
2059
|
- lib/telnyx/models/traffic_type.rb
|
|
2060
2060
|
- lib/telnyx/models/transcription.rb
|
|
2061
2061
|
- lib/telnyx/models/transcription_webhook_event.rb
|
|
@@ -4475,9 +4475,9 @@ files:
|
|
|
4475
4475
|
- rbi/telnyx/models/texml_application_update_response.rbi
|
|
4476
4476
|
- rbi/telnyx/models/texml_secrets_params.rbi
|
|
4477
4477
|
- rbi/telnyx/models/texml_secrets_response.rbi
|
|
4478
|
+
- rbi/telnyx/models/text_to_speech_generate_speech_params.rbi
|
|
4478
4479
|
- rbi/telnyx/models/text_to_speech_list_voices_params.rbi
|
|
4479
4480
|
- rbi/telnyx/models/text_to_speech_list_voices_response.rbi
|
|
4480
|
-
- rbi/telnyx/models/text_to_speech_stream_params.rbi
|
|
4481
4481
|
- rbi/telnyx/models/traffic_type.rbi
|
|
4482
4482
|
- rbi/telnyx/models/transcription.rbi
|
|
4483
4483
|
- rbi/telnyx/models/transcription_webhook_event.rbi
|
|
@@ -6896,9 +6896,9 @@ files:
|
|
|
6896
6896
|
- sig/telnyx/models/texml_application_update_response.rbs
|
|
6897
6897
|
- sig/telnyx/models/texml_secrets_params.rbs
|
|
6898
6898
|
- sig/telnyx/models/texml_secrets_response.rbs
|
|
6899
|
+
- sig/telnyx/models/text_to_speech_generate_speech_params.rbs
|
|
6899
6900
|
- sig/telnyx/models/text_to_speech_list_voices_params.rbs
|
|
6900
6901
|
- sig/telnyx/models/text_to_speech_list_voices_response.rbs
|
|
6901
|
-
- sig/telnyx/models/text_to_speech_stream_params.rbs
|
|
6902
6902
|
- sig/telnyx/models/traffic_type.rbs
|
|
6903
6903
|
- sig/telnyx/models/transcription.rbs
|
|
6904
6904
|
- sig/telnyx/models/transcription_webhook_event.rbs
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Telnyx
|
|
4
|
-
module Models
|
|
5
|
-
# @see Telnyx::Resources::TextToSpeech#stream
|
|
6
|
-
class TextToSpeechStreamParams < Telnyx::Internal::Type::BaseModel
|
|
7
|
-
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
8
|
-
include Telnyx::Internal::Type::RequestParameters
|
|
9
|
-
|
|
10
|
-
# @!attribute audio_format
|
|
11
|
-
# Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
12
|
-
# only. Accepted values: `pcm`, `wav`.
|
|
13
|
-
#
|
|
14
|
-
# @return [Symbol, Telnyx::Models::TextToSpeechStreamParams::AudioFormat, nil]
|
|
15
|
-
optional :audio_format, enum: -> { Telnyx::TextToSpeechStreamParams::AudioFormat }
|
|
16
|
-
|
|
17
|
-
# @!attribute disable_cache
|
|
18
|
-
# When `true`, bypass the audio cache and generate fresh audio.
|
|
19
|
-
#
|
|
20
|
-
# @return [Boolean, nil]
|
|
21
|
-
optional :disable_cache, Telnyx::Internal::Type::Boolean
|
|
22
|
-
|
|
23
|
-
# @!attribute model_id
|
|
24
|
-
# Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD`
|
|
25
|
-
# (Telnyx); `Polly.Generative` (AWS).
|
|
26
|
-
#
|
|
27
|
-
# @return [String, nil]
|
|
28
|
-
optional :model_id, String
|
|
29
|
-
|
|
30
|
-
# @!attribute provider
|
|
31
|
-
# TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is
|
|
32
|
-
# provided.
|
|
33
|
-
#
|
|
34
|
-
# @return [Symbol, Telnyx::Models::TextToSpeechStreamParams::Provider, nil]
|
|
35
|
-
optional :provider, enum: -> { Telnyx::TextToSpeechStreamParams::Provider }
|
|
36
|
-
|
|
37
|
-
# @!attribute socket_id
|
|
38
|
-
# Client-provided socket identifier for tracking. If not provided, one is
|
|
39
|
-
# generated server-side.
|
|
40
|
-
#
|
|
41
|
-
# @return [String, nil]
|
|
42
|
-
optional :socket_id, String
|
|
43
|
-
|
|
44
|
-
# @!attribute voice
|
|
45
|
-
# Voice identifier in the format `provider.model_id.voice_id` or
|
|
46
|
-
# `provider.voice_id` (e.g. `telnyx.NaturalHD.Telnyx_Alloy` or
|
|
47
|
-
# `azure.en-US-AvaMultilingualNeural`). When provided, the `provider`, `model_id`,
|
|
48
|
-
# and `voice_id` are extracted automatically. Takes precedence over individual
|
|
49
|
-
# `provider`/`model_id`/`voice_id` parameters.
|
|
50
|
-
#
|
|
51
|
-
# @return [String, nil]
|
|
52
|
-
optional :voice, String
|
|
53
|
-
|
|
54
|
-
# @!attribute voice_id
|
|
55
|
-
# Voice identifier for the chosen provider.
|
|
56
|
-
#
|
|
57
|
-
# @return [String, nil]
|
|
58
|
-
optional :voice_id, String
|
|
59
|
-
|
|
60
|
-
# @!method initialize(audio_format: nil, disable_cache: nil, model_id: nil, provider: nil, socket_id: nil, voice: nil, voice_id: nil, request_options: {})
|
|
61
|
-
# Some parameter documentations has been truncated, see
|
|
62
|
-
# {Telnyx::Models::TextToSpeechStreamParams} for more details.
|
|
63
|
-
#
|
|
64
|
-
# @param audio_format [Symbol, Telnyx::Models::TextToSpeechStreamParams::AudioFormat] Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
65
|
-
#
|
|
66
|
-
# @param disable_cache [Boolean] When `true`, bypass the audio cache and generate fresh audio.
|
|
67
|
-
#
|
|
68
|
-
# @param model_id [String] Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD` (Teln
|
|
69
|
-
#
|
|
70
|
-
# @param provider [Symbol, Telnyx::Models::TextToSpeechStreamParams::Provider] TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is pro
|
|
71
|
-
#
|
|
72
|
-
# @param socket_id [String] Client-provided socket identifier for tracking. If not provided, one is generate
|
|
73
|
-
#
|
|
74
|
-
# @param voice [String] Voice identifier in the format `provider.model_id.voice_id` or `provider.voice_i
|
|
75
|
-
#
|
|
76
|
-
# @param voice_id [String] Voice identifier for the chosen provider.
|
|
77
|
-
#
|
|
78
|
-
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
|
|
79
|
-
|
|
80
|
-
# Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
81
|
-
# only. Accepted values: `pcm`, `wav`.
|
|
82
|
-
module AudioFormat
|
|
83
|
-
extend Telnyx::Internal::Type::Enum
|
|
84
|
-
|
|
85
|
-
PCM = :pcm
|
|
86
|
-
WAV = :wav
|
|
87
|
-
|
|
88
|
-
# @!method self.values
|
|
89
|
-
# @return [Array<Symbol>]
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
# TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is
|
|
93
|
-
# provided.
|
|
94
|
-
module Provider
|
|
95
|
-
extend Telnyx::Internal::Type::Enum
|
|
96
|
-
|
|
97
|
-
AWS = :aws
|
|
98
|
-
TELNYX = :telnyx
|
|
99
|
-
AZURE = :azure
|
|
100
|
-
ELEVENLABS = :elevenlabs
|
|
101
|
-
MINIMAX = :minimax
|
|
102
|
-
MURFAI = :murfai
|
|
103
|
-
RIME = :rime
|
|
104
|
-
RESEMBLE = :resemble
|
|
105
|
-
|
|
106
|
-
# @!method self.values
|
|
107
|
-
# @return [Array<Symbol>]
|
|
108
|
-
end
|
|
109
|
-
end
|
|
110
|
-
end
|
|
111
|
-
end
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
# typed: strong
|
|
2
|
-
|
|
3
|
-
module Telnyx
|
|
4
|
-
module Models
|
|
5
|
-
class TextToSpeechStreamParams < Telnyx::Internal::Type::BaseModel
|
|
6
|
-
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
7
|
-
include Telnyx::Internal::Type::RequestParameters
|
|
8
|
-
|
|
9
|
-
OrHash =
|
|
10
|
-
T.type_alias do
|
|
11
|
-
T.any(Telnyx::TextToSpeechStreamParams, Telnyx::Internal::AnyHash)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
15
|
-
# only. Accepted values: `pcm`, `wav`.
|
|
16
|
-
sig do
|
|
17
|
-
returns(
|
|
18
|
-
T.nilable(Telnyx::TextToSpeechStreamParams::AudioFormat::OrSymbol)
|
|
19
|
-
)
|
|
20
|
-
end
|
|
21
|
-
attr_reader :audio_format
|
|
22
|
-
|
|
23
|
-
sig do
|
|
24
|
-
params(
|
|
25
|
-
audio_format: Telnyx::TextToSpeechStreamParams::AudioFormat::OrSymbol
|
|
26
|
-
).void
|
|
27
|
-
end
|
|
28
|
-
attr_writer :audio_format
|
|
29
|
-
|
|
30
|
-
# When `true`, bypass the audio cache and generate fresh audio.
|
|
31
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
32
|
-
attr_reader :disable_cache
|
|
33
|
-
|
|
34
|
-
sig { params(disable_cache: T::Boolean).void }
|
|
35
|
-
attr_writer :disable_cache
|
|
36
|
-
|
|
37
|
-
# Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD`
|
|
38
|
-
# (Telnyx); `Polly.Generative` (AWS).
|
|
39
|
-
sig { returns(T.nilable(String)) }
|
|
40
|
-
attr_reader :model_id
|
|
41
|
-
|
|
42
|
-
sig { params(model_id: String).void }
|
|
43
|
-
attr_writer :model_id
|
|
44
|
-
|
|
45
|
-
# TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is
|
|
46
|
-
# provided.
|
|
47
|
-
sig do
|
|
48
|
-
returns(T.nilable(Telnyx::TextToSpeechStreamParams::Provider::OrSymbol))
|
|
49
|
-
end
|
|
50
|
-
attr_reader :provider
|
|
51
|
-
|
|
52
|
-
sig do
|
|
53
|
-
params(
|
|
54
|
-
provider: Telnyx::TextToSpeechStreamParams::Provider::OrSymbol
|
|
55
|
-
).void
|
|
56
|
-
end
|
|
57
|
-
attr_writer :provider
|
|
58
|
-
|
|
59
|
-
# Client-provided socket identifier for tracking. If not provided, one is
|
|
60
|
-
# generated server-side.
|
|
61
|
-
sig { returns(T.nilable(String)) }
|
|
62
|
-
attr_reader :socket_id
|
|
63
|
-
|
|
64
|
-
sig { params(socket_id: String).void }
|
|
65
|
-
attr_writer :socket_id
|
|
66
|
-
|
|
67
|
-
# Voice identifier in the format `provider.model_id.voice_id` or
|
|
68
|
-
# `provider.voice_id` (e.g. `telnyx.NaturalHD.Telnyx_Alloy` or
|
|
69
|
-
# `azure.en-US-AvaMultilingualNeural`). When provided, the `provider`, `model_id`,
|
|
70
|
-
# and `voice_id` are extracted automatically. Takes precedence over individual
|
|
71
|
-
# `provider`/`model_id`/`voice_id` parameters.
|
|
72
|
-
sig { returns(T.nilable(String)) }
|
|
73
|
-
attr_reader :voice
|
|
74
|
-
|
|
75
|
-
sig { params(voice: String).void }
|
|
76
|
-
attr_writer :voice
|
|
77
|
-
|
|
78
|
-
# Voice identifier for the chosen provider.
|
|
79
|
-
sig { returns(T.nilable(String)) }
|
|
80
|
-
attr_reader :voice_id
|
|
81
|
-
|
|
82
|
-
sig { params(voice_id: String).void }
|
|
83
|
-
attr_writer :voice_id
|
|
84
|
-
|
|
85
|
-
sig do
|
|
86
|
-
params(
|
|
87
|
-
audio_format: Telnyx::TextToSpeechStreamParams::AudioFormat::OrSymbol,
|
|
88
|
-
disable_cache: T::Boolean,
|
|
89
|
-
model_id: String,
|
|
90
|
-
provider: Telnyx::TextToSpeechStreamParams::Provider::OrSymbol,
|
|
91
|
-
socket_id: String,
|
|
92
|
-
voice: String,
|
|
93
|
-
voice_id: String,
|
|
94
|
-
request_options: Telnyx::RequestOptions::OrHash
|
|
95
|
-
).returns(T.attached_class)
|
|
96
|
-
end
|
|
97
|
-
def self.new(
|
|
98
|
-
# Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
99
|
-
# only. Accepted values: `pcm`, `wav`.
|
|
100
|
-
audio_format: nil,
|
|
101
|
-
# When `true`, bypass the audio cache and generate fresh audio.
|
|
102
|
-
disable_cache: nil,
|
|
103
|
-
# Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD`
|
|
104
|
-
# (Telnyx); `Polly.Generative` (AWS).
|
|
105
|
-
model_id: nil,
|
|
106
|
-
# TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is
|
|
107
|
-
# provided.
|
|
108
|
-
provider: nil,
|
|
109
|
-
# Client-provided socket identifier for tracking. If not provided, one is
|
|
110
|
-
# generated server-side.
|
|
111
|
-
socket_id: nil,
|
|
112
|
-
# Voice identifier in the format `provider.model_id.voice_id` or
|
|
113
|
-
# `provider.voice_id` (e.g. `telnyx.NaturalHD.Telnyx_Alloy` or
|
|
114
|
-
# `azure.en-US-AvaMultilingualNeural`). When provided, the `provider`, `model_id`,
|
|
115
|
-
# and `voice_id` are extracted automatically. Takes precedence over individual
|
|
116
|
-
# `provider`/`model_id`/`voice_id` parameters.
|
|
117
|
-
voice: nil,
|
|
118
|
-
# Voice identifier for the chosen provider.
|
|
119
|
-
voice_id: nil,
|
|
120
|
-
request_options: {}
|
|
121
|
-
)
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
sig do
|
|
125
|
-
override.returns(
|
|
126
|
-
{
|
|
127
|
-
audio_format:
|
|
128
|
-
Telnyx::TextToSpeechStreamParams::AudioFormat::OrSymbol,
|
|
129
|
-
disable_cache: T::Boolean,
|
|
130
|
-
model_id: String,
|
|
131
|
-
provider: Telnyx::TextToSpeechStreamParams::Provider::OrSymbol,
|
|
132
|
-
socket_id: String,
|
|
133
|
-
voice: String,
|
|
134
|
-
voice_id: String,
|
|
135
|
-
request_options: Telnyx::RequestOptions
|
|
136
|
-
}
|
|
137
|
-
)
|
|
138
|
-
end
|
|
139
|
-
def to_hash
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
# Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
143
|
-
# only. Accepted values: `pcm`, `wav`.
|
|
144
|
-
module AudioFormat
|
|
145
|
-
extend Telnyx::Internal::Type::Enum
|
|
146
|
-
|
|
147
|
-
TaggedSymbol =
|
|
148
|
-
T.type_alias do
|
|
149
|
-
T.all(Symbol, Telnyx::TextToSpeechStreamParams::AudioFormat)
|
|
150
|
-
end
|
|
151
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
152
|
-
|
|
153
|
-
PCM =
|
|
154
|
-
T.let(
|
|
155
|
-
:pcm,
|
|
156
|
-
Telnyx::TextToSpeechStreamParams::AudioFormat::TaggedSymbol
|
|
157
|
-
)
|
|
158
|
-
WAV =
|
|
159
|
-
T.let(
|
|
160
|
-
:wav,
|
|
161
|
-
Telnyx::TextToSpeechStreamParams::AudioFormat::TaggedSymbol
|
|
162
|
-
)
|
|
163
|
-
|
|
164
|
-
sig do
|
|
165
|
-
override.returns(
|
|
166
|
-
T::Array[
|
|
167
|
-
Telnyx::TextToSpeechStreamParams::AudioFormat::TaggedSymbol
|
|
168
|
-
]
|
|
169
|
-
)
|
|
170
|
-
end
|
|
171
|
-
def self.values
|
|
172
|
-
end
|
|
173
|
-
end
|
|
174
|
-
|
|
175
|
-
# TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is
|
|
176
|
-
# provided.
|
|
177
|
-
module Provider
|
|
178
|
-
extend Telnyx::Internal::Type::Enum
|
|
179
|
-
|
|
180
|
-
TaggedSymbol =
|
|
181
|
-
T.type_alias do
|
|
182
|
-
T.all(Symbol, Telnyx::TextToSpeechStreamParams::Provider)
|
|
183
|
-
end
|
|
184
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
185
|
-
|
|
186
|
-
AWS =
|
|
187
|
-
T.let(:aws, Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol)
|
|
188
|
-
TELNYX =
|
|
189
|
-
T.let(
|
|
190
|
-
:telnyx,
|
|
191
|
-
Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol
|
|
192
|
-
)
|
|
193
|
-
AZURE =
|
|
194
|
-
T.let(
|
|
195
|
-
:azure,
|
|
196
|
-
Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol
|
|
197
|
-
)
|
|
198
|
-
ELEVENLABS =
|
|
199
|
-
T.let(
|
|
200
|
-
:elevenlabs,
|
|
201
|
-
Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol
|
|
202
|
-
)
|
|
203
|
-
MINIMAX =
|
|
204
|
-
T.let(
|
|
205
|
-
:minimax,
|
|
206
|
-
Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol
|
|
207
|
-
)
|
|
208
|
-
MURFAI =
|
|
209
|
-
T.let(
|
|
210
|
-
:murfai,
|
|
211
|
-
Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol
|
|
212
|
-
)
|
|
213
|
-
RIME =
|
|
214
|
-
T.let(:rime, Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol)
|
|
215
|
-
RESEMBLE =
|
|
216
|
-
T.let(
|
|
217
|
-
:resemble,
|
|
218
|
-
Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol
|
|
219
|
-
)
|
|
220
|
-
|
|
221
|
-
sig do
|
|
222
|
-
override.returns(
|
|
223
|
-
T::Array[Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol]
|
|
224
|
-
)
|
|
225
|
-
end
|
|
226
|
-
def self.values
|
|
227
|
-
end
|
|
228
|
-
end
|
|
229
|
-
end
|
|
230
|
-
end
|
|
231
|
-
end
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
module Telnyx
|
|
2
|
-
module Models
|
|
3
|
-
type text_to_speech_stream_params =
|
|
4
|
-
{
|
|
5
|
-
audio_format: Telnyx::Models::TextToSpeechStreamParams::audio_format,
|
|
6
|
-
disable_cache: bool,
|
|
7
|
-
model_id: String,
|
|
8
|
-
provider: Telnyx::Models::TextToSpeechStreamParams::provider,
|
|
9
|
-
socket_id: String,
|
|
10
|
-
voice: String,
|
|
11
|
-
voice_id: String
|
|
12
|
-
}
|
|
13
|
-
& Telnyx::Internal::Type::request_parameters
|
|
14
|
-
|
|
15
|
-
class TextToSpeechStreamParams < Telnyx::Internal::Type::BaseModel
|
|
16
|
-
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
17
|
-
include Telnyx::Internal::Type::RequestParameters
|
|
18
|
-
|
|
19
|
-
attr_reader audio_format: Telnyx::Models::TextToSpeechStreamParams::audio_format?
|
|
20
|
-
|
|
21
|
-
def audio_format=: (
|
|
22
|
-
Telnyx::Models::TextToSpeechStreamParams::audio_format
|
|
23
|
-
) -> Telnyx::Models::TextToSpeechStreamParams::audio_format
|
|
24
|
-
|
|
25
|
-
attr_reader disable_cache: bool?
|
|
26
|
-
|
|
27
|
-
def disable_cache=: (bool) -> bool
|
|
28
|
-
|
|
29
|
-
attr_reader model_id: String?
|
|
30
|
-
|
|
31
|
-
def model_id=: (String) -> String
|
|
32
|
-
|
|
33
|
-
attr_reader provider: Telnyx::Models::TextToSpeechStreamParams::provider?
|
|
34
|
-
|
|
35
|
-
def provider=: (
|
|
36
|
-
Telnyx::Models::TextToSpeechStreamParams::provider
|
|
37
|
-
) -> Telnyx::Models::TextToSpeechStreamParams::provider
|
|
38
|
-
|
|
39
|
-
attr_reader socket_id: String?
|
|
40
|
-
|
|
41
|
-
def socket_id=: (String) -> String
|
|
42
|
-
|
|
43
|
-
attr_reader voice: String?
|
|
44
|
-
|
|
45
|
-
def voice=: (String) -> String
|
|
46
|
-
|
|
47
|
-
attr_reader voice_id: String?
|
|
48
|
-
|
|
49
|
-
def voice_id=: (String) -> String
|
|
50
|
-
|
|
51
|
-
def initialize: (
|
|
52
|
-
?audio_format: Telnyx::Models::TextToSpeechStreamParams::audio_format,
|
|
53
|
-
?disable_cache: bool,
|
|
54
|
-
?model_id: String,
|
|
55
|
-
?provider: Telnyx::Models::TextToSpeechStreamParams::provider,
|
|
56
|
-
?socket_id: String,
|
|
57
|
-
?voice: String,
|
|
58
|
-
?voice_id: String,
|
|
59
|
-
?request_options: Telnyx::request_opts
|
|
60
|
-
) -> void
|
|
61
|
-
|
|
62
|
-
def to_hash: -> {
|
|
63
|
-
audio_format: Telnyx::Models::TextToSpeechStreamParams::audio_format,
|
|
64
|
-
disable_cache: bool,
|
|
65
|
-
model_id: String,
|
|
66
|
-
provider: Telnyx::Models::TextToSpeechStreamParams::provider,
|
|
67
|
-
socket_id: String,
|
|
68
|
-
voice: String,
|
|
69
|
-
voice_id: String,
|
|
70
|
-
request_options: Telnyx::RequestOptions
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
type audio_format = :pcm | :wav
|
|
74
|
-
|
|
75
|
-
module AudioFormat
|
|
76
|
-
extend Telnyx::Internal::Type::Enum
|
|
77
|
-
|
|
78
|
-
PCM: :pcm
|
|
79
|
-
WAV: :wav
|
|
80
|
-
|
|
81
|
-
def self?.values: -> ::Array[Telnyx::Models::TextToSpeechStreamParams::audio_format]
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
type provider =
|
|
85
|
-
:aws
|
|
86
|
-
| :telnyx
|
|
87
|
-
| :azure
|
|
88
|
-
| :elevenlabs
|
|
89
|
-
| :minimax
|
|
90
|
-
| :murfai
|
|
91
|
-
| :rime
|
|
92
|
-
| :resemble
|
|
93
|
-
|
|
94
|
-
module Provider
|
|
95
|
-
extend Telnyx::Internal::Type::Enum
|
|
96
|
-
|
|
97
|
-
AWS: :aws
|
|
98
|
-
TELNYX: :telnyx
|
|
99
|
-
AZURE: :azure
|
|
100
|
-
ELEVENLABS: :elevenlabs
|
|
101
|
-
MINIMAX: :minimax
|
|
102
|
-
MURFAI: :murfai
|
|
103
|
-
RIME: :rime
|
|
104
|
-
RESEMBLE: :resemble
|
|
105
|
-
|
|
106
|
-
def self?.values: -> ::Array[Telnyx::Models::TextToSpeechStreamParams::provider]
|
|
107
|
-
end
|
|
108
|
-
end
|
|
109
|
-
end
|
|
110
|
-
end
|