telnyx 5.55.0 → 5.56.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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/client.rb +5 -0
  5. data/lib/telnyx/models/calls/action_join_ai_assistant_params.rb +119 -0
  6. data/lib/telnyx/models/calls/action_join_ai_assistant_response.rb +18 -0
  7. data/lib/telnyx/models/speech_to_text_transcribe_params.rb +140 -0
  8. data/lib/telnyx/models/text_to_speech_stream_params.rb +99 -1
  9. data/lib/telnyx/models.rb +2 -0
  10. data/lib/telnyx/resources/calls/actions.rb +34 -0
  11. data/lib/telnyx/resources/speech_to_text.rb +71 -0
  12. data/lib/telnyx/resources/text_to_speech.rb +57 -0
  13. data/lib/telnyx/version.rb +1 -1
  14. data/lib/telnyx.rb +4 -2
  15. data/rbi/telnyx/client.rbi +4 -0
  16. data/rbi/telnyx/models/calls/action_join_ai_assistant_params.rbi +245 -0
  17. data/rbi/telnyx/models/calls/action_join_ai_assistant_response.rbi +49 -0
  18. data/rbi/telnyx/models/speech_to_text_transcribe_params.rbi +318 -0
  19. data/rbi/telnyx/models/text_to_speech_stream_params.rbi +213 -4
  20. data/rbi/telnyx/models.rbi +2 -0
  21. data/rbi/telnyx/resources/calls/actions.rbi +29 -0
  22. data/rbi/telnyx/resources/speech_to_text.rbi +71 -0
  23. data/rbi/telnyx/resources/text_to_speech.rbi +59 -0
  24. data/sig/telnyx/client.rbs +2 -0
  25. data/sig/telnyx/models/calls/action_join_ai_assistant_params.rbs +111 -0
  26. data/sig/telnyx/models/calls/action_join_ai_assistant_response.rbs +24 -0
  27. data/sig/telnyx/models/speech_to_text_transcribe_params.rbs +141 -0
  28. data/sig/telnyx/models/text_to_speech_stream_params.rbs +100 -3
  29. data/sig/telnyx/models.rbs +2 -0
  30. data/sig/telnyx/resources/calls/actions.rbs +9 -0
  31. data/sig/telnyx/resources/speech_to_text.rbs +20 -0
  32. data/sig/telnyx/resources/text_to_speech.rbs +11 -0
  33. metadata +14 -8
  34. data/lib/telnyx/models/stream_client_event.rb +0 -42
  35. data/lib/telnyx/models/stream_server_event.rb +0 -200
  36. data/rbi/telnyx/models/stream_client_event.rbi +0 -70
  37. data/rbi/telnyx/models/stream_server_event.rbi +0 -411
  38. data/sig/telnyx/models/stream_client_event.rbs +0 -30
  39. data/sig/telnyx/models/stream_server_event.rbs +0 -180
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 356e6c41b63f97ca790fb4ce787423939e5baa395db3d2f1ac1c578f5d0c62d8
4
- data.tar.gz: c89902273a5a02f7f098e51b59e0a9eac53b1bfe61a174bad47914aafab46ecd
3
+ metadata.gz: f1fa910eb357763c534e127ffdba479e62d9816bd2247a0851d4d5bb54a2946c
4
+ data.tar.gz: e31d13fbfbc448b8bd6f20da460909324512da59c59983284c67d288d69f6a68
5
5
  SHA512:
6
- metadata.gz: 396aad1572805770b72fd861aa39ae2b52d639bb912cebe46a966e0232e07f30cf3f3a4ce7b6f58da4c5cb523652276ae064968356224a9074513705ca8e2a1c
7
- data.tar.gz: 81c386d95f49aa38ffdbbcd3b6a5dd45ea2f4839822cf9f1c5014306b3b96c472ee4b5172fa97512797759dd4024a42489aef3e52049c26482a754e56be6cd04
6
+ metadata.gz: d84011d798fcfa77678a6e49b06f77fdf3431d5a26daaf0e5cf00261c001feada7c624eeee163c1931c30b7082bfe23534be726cb58be2b495b47e55c88c7f7d
7
+ data.tar.gz: dfbe61cfb6e0910241474c9429624b87c8c9c70843ed28b60311faf2e4e9ca21fffa3575b7107247e2bfa8afecd1a7df76485b35ccc6e7e50b59cf038fe0e9dc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.56.0 (2026-03-17)
4
+
5
+ Full Changelog: [v5.55.0...v5.56.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.55.0...v5.56.0)
6
+
7
+ ### Features
8
+
9
+ * add ai_assistant_join call control command OpenAPI spec ([5ab91f5](https://github.com/team-telnyx/telnyx-ruby/commit/5ab91f5327fd55aa5338bdaf1ba33de84994f3e1))
10
+
3
11
  ## 5.55.0 (2026-03-16)
4
12
 
5
13
  Full Changelog: [v5.54.0...v5.55.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.54.0...v5.55.0)
data/README.md CHANGED
@@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application
24
24
  <!-- x-release-please-start-version -->
25
25
 
26
26
  ```ruby
27
- gem "telnyx", "~> 5.55.0"
27
+ gem "telnyx", "~> 5.56.0"
28
28
  ```
29
29
 
30
30
  <!-- x-release-please-end -->
data/lib/telnyx/client.rb CHANGED
@@ -639,6 +639,10 @@ module Telnyx
639
639
  # @return [Telnyx::Resources::X402]
640
640
  attr_reader :x402
641
641
 
642
+ # Speech to text command operations
643
+ # @return [Telnyx::Resources::SpeechToText]
644
+ attr_reader :speech_to_text
645
+
642
646
  # @api private
643
647
  #
644
648
  # @return [Hash{String=>String}]
@@ -892,6 +896,7 @@ module Telnyx
892
896
  @voice_clones = Telnyx::Resources::VoiceClones.new(client: self)
893
897
  @voice_designs = Telnyx::Resources::VoiceDesigns.new(client: self)
894
898
  @x402 = Telnyx::Resources::X402.new(client: self)
899
+ @speech_to_text = Telnyx::Resources::SpeechToText.new(client: self)
895
900
  end
896
901
  end
897
902
  end
@@ -0,0 +1,119 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module Calls
6
+ # @see Telnyx::Resources::Calls::Actions#join_ai_assistant
7
+ class ActionJoinAIAssistantParams < Telnyx::Internal::Type::BaseModel
8
+ extend Telnyx::Internal::Type::RequestParameters::Converter
9
+ include Telnyx::Internal::Type::RequestParameters
10
+
11
+ # @!attribute call_control_id
12
+ #
13
+ # @return [String]
14
+ required :call_control_id, String
15
+
16
+ # @!attribute conversation_id
17
+ # The ID of the AI assistant conversation to join.
18
+ #
19
+ # @return [String]
20
+ required :conversation_id, String
21
+
22
+ # @!attribute participant
23
+ #
24
+ # @return [Telnyx::Models::Calls::ActionJoinAIAssistantParams::Participant]
25
+ required :participant, -> { Telnyx::Calls::ActionJoinAIAssistantParams::Participant }
26
+
27
+ # @!attribute client_state
28
+ # Use this field to add state to every subsequent webhook. It must be a valid
29
+ # Base-64 encoded string.
30
+ #
31
+ # @return [String, nil]
32
+ optional :client_state, String
33
+
34
+ # @!attribute command_id
35
+ # Use this field to avoid duplicate commands. Telnyx will ignore any command with
36
+ # the same `command_id` for the same `call_control_id`.
37
+ #
38
+ # @return [String, nil]
39
+ optional :command_id, String
40
+
41
+ # @!method initialize(call_control_id:, conversation_id:, participant:, client_state: nil, command_id: nil, request_options: {})
42
+ # Some parameter documentations has been truncated, see
43
+ # {Telnyx::Models::Calls::ActionJoinAIAssistantParams} for more details.
44
+ #
45
+ # @param call_control_id [String]
46
+ #
47
+ # @param conversation_id [String] The ID of the AI assistant conversation to join.
48
+ #
49
+ # @param participant [Telnyx::Models::Calls::ActionJoinAIAssistantParams::Participant]
50
+ #
51
+ # @param client_state [String] Use this field to add state to every subsequent webhook. It must be a valid Base
52
+ #
53
+ # @param command_id [String] Use this field to avoid duplicate commands. Telnyx will ignore any command with
54
+ #
55
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
56
+
57
+ class Participant < Telnyx::Internal::Type::BaseModel
58
+ # @!attribute id
59
+ # The call_control_id of the participant to add to the conversation.
60
+ #
61
+ # @return [String]
62
+ required :id, String
63
+
64
+ # @!attribute role
65
+ # The role of the participant in the conversation.
66
+ #
67
+ # @return [Symbol, Telnyx::Models::Calls::ActionJoinAIAssistantParams::Participant::Role]
68
+ required :role, enum: -> { Telnyx::Calls::ActionJoinAIAssistantParams::Participant::Role }
69
+
70
+ # @!attribute name
71
+ # Display name for the participant.
72
+ #
73
+ # @return [String, nil]
74
+ optional :name, String
75
+
76
+ # @!attribute on_hangup
77
+ # Determines what happens to the conversation when this participant hangs up.
78
+ #
79
+ # @return [Symbol, Telnyx::Models::Calls::ActionJoinAIAssistantParams::Participant::OnHangup, nil]
80
+ optional :on_hangup, enum: -> { Telnyx::Calls::ActionJoinAIAssistantParams::Participant::OnHangup }
81
+
82
+ # @!method initialize(id:, role:, name: nil, on_hangup: nil)
83
+ # @param id [String] The call_control_id of the participant to add to the conversation.
84
+ #
85
+ # @param role [Symbol, Telnyx::Models::Calls::ActionJoinAIAssistantParams::Participant::Role] The role of the participant in the conversation.
86
+ #
87
+ # @param name [String] Display name for the participant.
88
+ #
89
+ # @param on_hangup [Symbol, Telnyx::Models::Calls::ActionJoinAIAssistantParams::Participant::OnHangup] Determines what happens to the conversation when this participant hangs up.
90
+
91
+ # The role of the participant in the conversation.
92
+ #
93
+ # @see Telnyx::Models::Calls::ActionJoinAIAssistantParams::Participant#role
94
+ module Role
95
+ extend Telnyx::Internal::Type::Enum
96
+
97
+ USER = :user
98
+
99
+ # @!method self.values
100
+ # @return [Array<Symbol>]
101
+ end
102
+
103
+ # Determines what happens to the conversation when this participant hangs up.
104
+ #
105
+ # @see Telnyx::Models::Calls::ActionJoinAIAssistantParams::Participant#on_hangup
106
+ module OnHangup
107
+ extend Telnyx::Internal::Type::Enum
108
+
109
+ CONTINUE_CONVERSATION = :continue_conversation
110
+ END_CONVERSATION = :end_conversation
111
+
112
+ # @!method self.values
113
+ # @return [Array<Symbol>]
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
119
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module Calls
6
+ # @see Telnyx::Resources::Calls::Actions#join_ai_assistant
7
+ class ActionJoinAIAssistantResponse < Telnyx::Internal::Type::BaseModel
8
+ # @!attribute data
9
+ #
10
+ # @return [Telnyx::Models::Calls::CallControlCommandResultWithConversationID, nil]
11
+ optional :data, -> { Telnyx::Calls::CallControlCommandResultWithConversationID }
12
+
13
+ # @!method initialize(data: nil)
14
+ # @param data [Telnyx::Models::Calls::CallControlCommandResultWithConversationID]
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,140 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ # @see Telnyx::Resources::SpeechToText#transcribe
6
+ class SpeechToTextTranscribeParams < Telnyx::Internal::Type::BaseModel
7
+ extend Telnyx::Internal::Type::RequestParameters::Converter
8
+ include Telnyx::Internal::Type::RequestParameters
9
+
10
+ # @!attribute input_format
11
+ # The format of input audio stream.
12
+ #
13
+ # @return [Symbol, Telnyx::Models::SpeechToTextTranscribeParams::InputFormat]
14
+ required :input_format, enum: -> { Telnyx::SpeechToTextTranscribeParams::InputFormat }
15
+
16
+ # @!attribute transcription_engine
17
+ # The transcription engine to use for processing the audio stream.
18
+ #
19
+ # @return [Symbol, Telnyx::Models::SpeechToTextTranscribeParams::TranscriptionEngine]
20
+ required :transcription_engine, enum: -> { Telnyx::SpeechToTextTranscribeParams::TranscriptionEngine }
21
+
22
+ # @!attribute endpointing
23
+ # Silence duration (in milliseconds) that triggers end-of-speech detection. When
24
+ # set, the engine uses this value to determine when a speaker has stopped talking.
25
+ # Not all engines support this parameter.
26
+ #
27
+ # @return [Integer, nil]
28
+ optional :endpointing, Integer
29
+
30
+ # @!attribute interim_results
31
+ # Whether to receive interim transcription results.
32
+ #
33
+ # @return [Boolean, nil]
34
+ optional :interim_results, Telnyx::Internal::Type::Boolean
35
+
36
+ # @!attribute keyterm
37
+ # A key term to boost in the transcription. The engine will be more likely to
38
+ # recognize this term. Can be specified multiple times for multiple terms.
39
+ #
40
+ # @return [String, nil]
41
+ optional :keyterm, String
42
+
43
+ # @!attribute keywords
44
+ # Comma-separated list of keywords to boost in the transcription. The engine will
45
+ # prioritize recognition of these words.
46
+ #
47
+ # @return [String, nil]
48
+ optional :keywords, String
49
+
50
+ # @!attribute language
51
+ # The language spoken in the audio stream.
52
+ #
53
+ # @return [String, nil]
54
+ optional :language, String
55
+
56
+ # @!attribute model
57
+ # The specific model to use within the selected transcription engine.
58
+ #
59
+ # @return [Symbol, Telnyx::Models::SpeechToTextTranscribeParams::Model, nil]
60
+ optional :model, enum: -> { Telnyx::SpeechToTextTranscribeParams::Model }
61
+
62
+ # @!attribute redact
63
+ # Enable redaction of sensitive information (e.g., PCI data, SSN) from
64
+ # transcription results. Supported values depend on the transcription engine.
65
+ #
66
+ # @return [String, nil]
67
+ optional :redact, String
68
+
69
+ # @!method initialize(input_format:, transcription_engine:, endpointing: nil, interim_results: nil, keyterm: nil, keywords: nil, language: nil, model: nil, redact: nil, request_options: {})
70
+ # Some parameter documentations has been truncated, see
71
+ # {Telnyx::Models::SpeechToTextTranscribeParams} for more details.
72
+ #
73
+ # @param input_format [Symbol, Telnyx::Models::SpeechToTextTranscribeParams::InputFormat] The format of input audio stream.
74
+ #
75
+ # @param transcription_engine [Symbol, Telnyx::Models::SpeechToTextTranscribeParams::TranscriptionEngine] The transcription engine to use for processing the audio stream.
76
+ #
77
+ # @param endpointing [Integer] Silence duration (in milliseconds) that triggers end-of-speech detection. When s
78
+ #
79
+ # @param interim_results [Boolean] Whether to receive interim transcription results.
80
+ #
81
+ # @param keyterm [String] A key term to boost in the transcription. The engine will be more likely to reco
82
+ #
83
+ # @param keywords [String] Comma-separated list of keywords to boost in the transcription. The engine will
84
+ #
85
+ # @param language [String] The language spoken in the audio stream.
86
+ #
87
+ # @param model [Symbol, Telnyx::Models::SpeechToTextTranscribeParams::Model] The specific model to use within the selected transcription engine.
88
+ #
89
+ # @param redact [String] Enable redaction of sensitive information (e.g., PCI data, SSN) from transcripti
90
+ #
91
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
92
+
93
+ # The format of input audio stream.
94
+ module InputFormat
95
+ extend Telnyx::Internal::Type::Enum
96
+
97
+ MP3 = :mp3
98
+ WAV = :wav
99
+
100
+ # @!method self.values
101
+ # @return [Array<Symbol>]
102
+ end
103
+
104
+ # The transcription engine to use for processing the audio stream.
105
+ module TranscriptionEngine
106
+ extend Telnyx::Internal::Type::Enum
107
+
108
+ AZURE = :Azure
109
+ DEEPGRAM = :Deepgram
110
+ GOOGLE = :Google
111
+ TELNYX = :Telnyx
112
+
113
+ # @!method self.values
114
+ # @return [Array<Symbol>]
115
+ end
116
+
117
+ # The specific model to use within the selected transcription engine.
118
+ module Model
119
+ extend Telnyx::Internal::Type::Enum
120
+
121
+ FAST = :fast
122
+ DEEPGRAM_NOVA_2 = :"deepgram/nova-2"
123
+ DEEPGRAM_NOVA_3 = :"deepgram/nova-3"
124
+ LATEST_LONG = :latest_long
125
+ LATEST_SHORT = :latest_short
126
+ COMMAND_AND_SEARCH = :command_and_search
127
+ PHONE_CALL = :phone_call
128
+ VIDEO = :video
129
+ DEFAULT = :default
130
+ MEDICAL_CONVERSATION = :medical_conversation
131
+ MEDICAL_DICTATION = :medical_dictation
132
+ OPENAI_WHISPER_TINY = :"openai/whisper-tiny"
133
+ OPENAI_WHISPER_LARGE_V3_TURBO = :"openai/whisper-large-v3-turbo"
134
+
135
+ # @!method self.values
136
+ # @return [Array<Symbol>]
137
+ end
138
+ end
139
+ end
140
+ end
@@ -7,8 +7,106 @@ module Telnyx
7
7
  extend Telnyx::Internal::Type::RequestParameters::Converter
8
8
  include Telnyx::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
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
+ #
11
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
+ INWORLD = :inworld
106
+
107
+ # @!method self.values
108
+ # @return [Array<Symbol>]
109
+ end
12
110
  end
13
111
  end
14
112
  end
data/lib/telnyx/models.rb CHANGED
@@ -1453,6 +1453,8 @@ module Telnyx
1453
1453
 
1454
1454
  SoundModifications = Telnyx::Models::SoundModifications
1455
1455
 
1456
+ SpeechToTextTranscribeParams = Telnyx::Models::SpeechToTextTranscribeParams
1457
+
1456
1458
  Storage = Telnyx::Models::Storage
1457
1459
 
1458
1460
  StorageListMigrationSourceCoverageParams = Telnyx::Models::StorageListMigrationSourceCoverageParams
@@ -526,6 +526,40 @@ module Telnyx
526
526
  )
527
527
  end
528
528
 
529
+ # Some parameter documentations has been truncated, see
530
+ # {Telnyx::Models::Calls::ActionJoinAIAssistantParams} for more details.
531
+ #
532
+ # Add a participant to an existing AI assistant conversation. Use this command to
533
+ # bring an additional call leg into a running AI conversation.
534
+ #
535
+ # @overload join_ai_assistant(call_control_id, conversation_id:, participant:, client_state: nil, command_id: nil, request_options: {})
536
+ #
537
+ # @param call_control_id [String] Unique identifier and token for controlling the call
538
+ #
539
+ # @param conversation_id [String] The ID of the AI assistant conversation to join.
540
+ #
541
+ # @param participant [Telnyx::Models::Calls::ActionJoinAIAssistantParams::Participant]
542
+ #
543
+ # @param client_state [String] Use this field to add state to every subsequent webhook. It must be a valid Base
544
+ #
545
+ # @param command_id [String] Use this field to avoid duplicate commands. Telnyx will ignore any command with
546
+ #
547
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
548
+ #
549
+ # @return [Telnyx::Models::Calls::ActionJoinAIAssistantResponse]
550
+ #
551
+ # @see Telnyx::Models::Calls::ActionJoinAIAssistantParams
552
+ def join_ai_assistant(call_control_id, params)
553
+ parsed, options = Telnyx::Calls::ActionJoinAIAssistantParams.dump_request(params)
554
+ @client.request(
555
+ method: :post,
556
+ path: ["calls/%1$s/actions/ai_assistant_join", call_control_id],
557
+ body: parsed,
558
+ model: Telnyx::Models::Calls::ActionJoinAIAssistantResponse,
559
+ options: options
560
+ )
561
+ end
562
+
529
563
  # Some parameter documentations has been truncated, see
530
564
  # {Telnyx::Models::Calls::ActionLeaveQueueParams} for more details.
531
565
  #
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Resources
5
+ # Speech to text command operations
6
+ class SpeechToText
7
+ # Some parameter documentations has been truncated, see
8
+ # {Telnyx::Models::SpeechToTextTranscribeParams} for more details.
9
+ #
10
+ # Open a WebSocket connection to stream audio and receive transcriptions in
11
+ # real-time. Authentication is provided via the standard
12
+ # `Authorization: Bearer <API_KEY>` header.
13
+ #
14
+ # Supported engines: `Azure`, `Deepgram`, `Google`, `Telnyx`.
15
+ #
16
+ # **Connection flow:**
17
+ #
18
+ # 1. Open WebSocket with query parameters specifying engine, input format, and
19
+ # language.
20
+ # 2. Send binary audio frames (mp3/wav format).
21
+ # 3. Receive JSON transcript frames with `transcript`, `is_final`, and
22
+ # `confidence` fields.
23
+ # 4. Close connection when done.
24
+ #
25
+ # @overload transcribe(input_format:, transcription_engine:, endpointing: nil, interim_results: nil, keyterm: nil, keywords: nil, language: nil, model: nil, redact: nil, request_options: {})
26
+ #
27
+ # @param input_format [Symbol, Telnyx::Models::SpeechToTextTranscribeParams::InputFormat] The format of input audio stream.
28
+ #
29
+ # @param transcription_engine [Symbol, Telnyx::Models::SpeechToTextTranscribeParams::TranscriptionEngine] The transcription engine to use for processing the audio stream.
30
+ #
31
+ # @param endpointing [Integer] Silence duration (in milliseconds) that triggers end-of-speech detection. When s
32
+ #
33
+ # @param interim_results [Boolean] Whether to receive interim transcription results.
34
+ #
35
+ # @param keyterm [String] A key term to boost in the transcription. The engine will be more likely to reco
36
+ #
37
+ # @param keywords [String] Comma-separated list of keywords to boost in the transcription. The engine will
38
+ #
39
+ # @param language [String] The language spoken in the audio stream.
40
+ #
41
+ # @param model [Symbol, Telnyx::Models::SpeechToTextTranscribeParams::Model] The specific model to use within the selected transcription engine.
42
+ #
43
+ # @param redact [String] Enable redaction of sensitive information (e.g., PCI data, SSN) from transcripti
44
+ #
45
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
46
+ #
47
+ # @return [nil]
48
+ #
49
+ # @see Telnyx::Models::SpeechToTextTranscribeParams
50
+ def transcribe(params)
51
+ parsed, options = Telnyx::SpeechToTextTranscribeParams.dump_request(params)
52
+ query = Telnyx::Internal::Util.encode_query_params(parsed)
53
+ @client.request(
54
+ method: :get,
55
+ path: "speech-to-text/transcription",
56
+ query: query,
57
+ headers: {"content-type" => "application/octet-stream"},
58
+ model: NilClass,
59
+ options: options
60
+ )
61
+ end
62
+
63
+ # @api private
64
+ #
65
+ # @param client [Telnyx::Client]
66
+ def initialize(client:)
67
+ @client = client
68
+ end
69
+ end
70
+ end
71
+ end
@@ -101,6 +101,63 @@ module Telnyx
101
101
  )
102
102
  end
103
103
 
104
+ # Some parameter documentations has been truncated, see
105
+ # {Telnyx::Models::TextToSpeechStreamParams} for more details.
106
+ #
107
+ # Open a WebSocket connection to stream text and receive synthesized audio in real
108
+ # time. Authentication is provided via the standard
109
+ # `Authorization: Bearer <API_KEY>` header. Send JSON frames with text to
110
+ # synthesize; receive JSON frames containing base64-encoded audio chunks.
111
+ #
112
+ # Supported providers: `aws`, `telnyx`, `azure`, `murfai`, `minimax`, `rime`,
113
+ # `resemble`, `elevenlabs`, `inworld`.
114
+ #
115
+ # **Connection flow:**
116
+ #
117
+ # 1. Open WebSocket with query parameters specifying provider, voice, and model.
118
+ # 2. Send an initial handshake message `{"text": " "}` (single space) with
119
+ # optional `voice_settings` to initialize the session.
120
+ # 3. Send text messages as `{"text": "Hello world"}`.
121
+ # 4. Receive audio chunks as JSON frames with base64-encoded audio.
122
+ # 5. A final frame with `isFinal: true` indicates the end of audio for the current
123
+ # text.
124
+ #
125
+ # To interrupt and restart synthesis mid-stream, send `{"force": true}` — the
126
+ # current worker is stopped and a new one is started.
127
+ #
128
+ # @overload stream(audio_format: nil, disable_cache: nil, model_id: nil, provider: nil, socket_id: nil, voice: nil, voice_id: nil, request_options: {})
129
+ #
130
+ # @param audio_format [Symbol, Telnyx::Models::TextToSpeechStreamParams::AudioFormat] Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
131
+ #
132
+ # @param disable_cache [Boolean] When `true`, bypass the audio cache and generate fresh audio.
133
+ #
134
+ # @param model_id [String] Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD` (Teln
135
+ #
136
+ # @param provider [Symbol, Telnyx::Models::TextToSpeechStreamParams::Provider] TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is pro
137
+ #
138
+ # @param socket_id [String] Client-provided socket identifier for tracking. If not provided, one is generate
139
+ #
140
+ # @param voice [String] Voice identifier in the format `provider.model_id.voice_id` or `provider.voice_i
141
+ #
142
+ # @param voice_id [String] Voice identifier for the chosen provider.
143
+ #
144
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
145
+ #
146
+ # @return [nil]
147
+ #
148
+ # @see Telnyx::Models::TextToSpeechStreamParams
149
+ def stream(params = {})
150
+ parsed, options = Telnyx::TextToSpeechStreamParams.dump_request(params)
151
+ query = Telnyx::Internal::Util.encode_query_params(parsed)
152
+ @client.request(
153
+ method: :get,
154
+ path: "text-to-speech/speech",
155
+ query: query,
156
+ model: NilClass,
157
+ options: options
158
+ )
159
+ end
160
+
104
161
  # @api private
105
162
  #
106
163
  # @param client [Telnyx::Client]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Telnyx
4
- VERSION = "5.55.0"
4
+ VERSION = "5.56.0"
5
5
  end
data/lib/telnyx.rb CHANGED
@@ -534,6 +534,8 @@ require_relative "telnyx/models/calls/action_gather_using_speak_params"
534
534
  require_relative "telnyx/models/calls/action_gather_using_speak_response"
535
535
  require_relative "telnyx/models/calls/action_hangup_params"
536
536
  require_relative "telnyx/models/calls/action_hangup_response"
537
+ require_relative "telnyx/models/calls/action_join_ai_assistant_params"
538
+ require_relative "telnyx/models/calls/action_join_ai_assistant_response"
537
539
  require_relative "telnyx/models/calls/action_leave_queue_params"
538
540
  require_relative "telnyx/models/calls/action_leave_queue_response"
539
541
  require_relative "telnyx/models/calls/action_pause_recording_params"
@@ -1949,6 +1951,7 @@ require_relative "telnyx/models/siprec_connector_retrieve_response"
1949
1951
  require_relative "telnyx/models/siprec_connector_update_params"
1950
1952
  require_relative "telnyx/models/siprec_connector_update_response"
1951
1953
  require_relative "telnyx/models/sound_modifications"
1954
+ require_relative "telnyx/models/speech_to_text_transcribe_params"
1952
1955
  require_relative "telnyx/models/storage/bucket_create_presigned_url_params"
1953
1956
  require_relative "telnyx/models/storage/bucket_create_presigned_url_response"
1954
1957
  require_relative "telnyx/models/storage/buckets/ssl_certificate"
@@ -1985,9 +1988,7 @@ require_relative "telnyx/models/stream_bidirectional_codec"
1985
1988
  require_relative "telnyx/models/stream_bidirectional_mode"
1986
1989
  require_relative "telnyx/models/stream_bidirectional_sampling_rate"
1987
1990
  require_relative "telnyx/models/stream_bidirectional_target_legs"
1988
- require_relative "telnyx/models/stream_client_event"
1989
1991
  require_relative "telnyx/models/stream_codec"
1990
- require_relative "telnyx/models/stream_server_event"
1991
1992
  require_relative "telnyx/models/sub_number_order"
1992
1993
  require_relative "telnyx/models/sub_number_order_cancel_params"
1993
1994
  require_relative "telnyx/models/sub_number_order_cancel_response"
@@ -2541,6 +2542,7 @@ require_relative "telnyx/resources/sim_card_orders"
2541
2542
  require_relative "telnyx/resources/sim_cards"
2542
2543
  require_relative "telnyx/resources/sim_cards/actions"
2543
2544
  require_relative "telnyx/resources/siprec_connectors"
2545
+ require_relative "telnyx/resources/speech_to_text"
2544
2546
  require_relative "telnyx/resources/storage"
2545
2547
  require_relative "telnyx/resources/storage/buckets"
2546
2548
  require_relative "telnyx/resources/storage/buckets/ssl_certificate"