telnyx 5.55.0 → 5.57.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 +17 -0
- data/README.md +1 -1
- data/lib/telnyx/client.rb +5 -0
- data/lib/telnyx/models/calls/action_join_ai_assistant_params.rb +119 -0
- data/lib/telnyx/models/calls/action_join_ai_assistant_response.rb +18 -0
- data/lib/telnyx/models/calls/action_start_ai_assistant_params.rb +332 -1
- data/lib/telnyx/models/porting/{loa_configuration_preview_0_params.rb → loa_configuration_preview_params.rb} +11 -11
- data/lib/telnyx/models/speech_to_text_transcribe_params.rb +140 -0
- data/lib/telnyx/models/text_to_speech_stream_params.rb +99 -1
- data/lib/telnyx/models.rb +2 -0
- data/lib/telnyx/resources/calls/actions.rb +41 -1
- data/lib/telnyx/resources/porting/loa_configurations.rb +8 -8
- data/lib/telnyx/resources/speech_to_text.rb +71 -0
- data/lib/telnyx/resources/text_to_speech.rb +57 -0
- data/lib/telnyx/version.rb +1 -1
- data/lib/telnyx.rb +5 -3
- data/rbi/telnyx/client.rbi +4 -0
- data/rbi/telnyx/models/calls/action_join_ai_assistant_params.rbi +245 -0
- data/rbi/telnyx/models/calls/action_join_ai_assistant_response.rbi +49 -0
- data/rbi/telnyx/models/calls/action_start_ai_assistant_params.rbi +723 -0
- data/rbi/telnyx/models/porting/{loa_configuration_preview_0_params.rbi → loa_configuration_preview_params.rbi} +17 -21
- data/rbi/telnyx/models/speech_to_text_transcribe_params.rbi +318 -0
- data/rbi/telnyx/models/text_to_speech_stream_params.rbi +213 -4
- data/rbi/telnyx/models.rbi +2 -0
- data/rbi/telnyx/resources/calls/actions.rbi +52 -0
- data/rbi/telnyx/resources/porting/loa_configurations.rbi +4 -4
- data/rbi/telnyx/resources/speech_to_text.rbi +71 -0
- data/rbi/telnyx/resources/text_to_speech.rbi +59 -0
- data/sig/telnyx/client.rbs +2 -0
- data/sig/telnyx/models/calls/action_join_ai_assistant_params.rbs +111 -0
- data/sig/telnyx/models/calls/action_join_ai_assistant_response.rbs +24 -0
- data/sig/telnyx/models/calls/action_start_ai_assistant_params.rbs +293 -0
- data/sig/telnyx/models/porting/{loa_configuration_preview_0_params.rbs → loa_configuration_preview_params.rbs} +14 -14
- data/sig/telnyx/models/speech_to_text_transcribe_params.rbs +141 -0
- data/sig/telnyx/models/text_to_speech_stream_params.rbs +100 -3
- data/sig/telnyx/models.rbs +2 -0
- data/sig/telnyx/resources/calls/actions.rbs +12 -0
- data/sig/telnyx/resources/porting/loa_configurations.rbs +4 -4
- data/sig/telnyx/resources/speech_to_text.rbs +20 -0
- data/sig/telnyx/resources/text_to_speech.rbs +11 -0
- metadata +17 -11
- data/lib/telnyx/models/stream_client_event.rb +0 -42
- data/lib/telnyx/models/stream_server_event.rb +0 -200
- data/rbi/telnyx/models/stream_client_event.rbi +0 -70
- data/rbi/telnyx/models/stream_server_event.rbi +0 -411
- data/sig/telnyx/models/stream_client_event.rbs +0 -30
- 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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 405dd494aa7f3dce98edc03fcd27140bf280f9e589cef656377fb179aedd101a
|
|
4
|
+
data.tar.gz: b42ea24ca45dce09795e9aacef2ffef3a0ba674fde951e75c1fd97b1457a1eaf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3ed6c00bf55e08d8b2d8226788360ae0ebe31249685cba99bceb689699f17cbee40a4bc51813a041b8d2df823ce7c040644937336f6cd26a89272f9d2bd5eb34
|
|
7
|
+
data.tar.gz: faceb2a68cd7b636bf4cbd1b5dffe630109fd5171941ffaf2b395ee84f019507d4eb80bb40a3be392b131983ca99e9debaa8c6759e5d185ff1851c5ea5fa371d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.57.0 (2026-03-18)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v5.56.0...v5.57.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.56.0...v5.57.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* add message_history, send_message_history_updates, participants to AIAssistantStartRequest ([db0e6fc](https://github.com/team-telnyx/telnyx-ruby/commit/db0e6fc8c78a08159aa2e9e73472c3fa2c092405))
|
|
10
|
+
* port-4690: fix LOA configuration preview path (singular → plural) ([faa937b](https://github.com/team-telnyx/telnyx-ruby/commit/faa937bce19e78bcc88bb13155e0ef57c897b97d))
|
|
11
|
+
|
|
12
|
+
## 5.56.0 (2026-03-17)
|
|
13
|
+
|
|
14
|
+
Full Changelog: [v5.55.0...v5.56.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.55.0...v5.56.0)
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* add ai_assistant_join call control command OpenAPI spec ([5ab91f5](https://github.com/team-telnyx/telnyx-ruby/commit/5ab91f5327fd55aa5338bdaf1ba33de84994f3e1))
|
|
19
|
+
|
|
3
20
|
## 5.55.0 (2026-03-16)
|
|
4
21
|
|
|
5
22
|
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
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
|
|
@@ -47,6 +47,28 @@ module Telnyx
|
|
|
47
47
|
# @return [Telnyx::Models::Calls::InterruptionSettings, nil]
|
|
48
48
|
optional :interruption_settings, -> { Telnyx::Calls::InterruptionSettings }
|
|
49
49
|
|
|
50
|
+
# @!attribute message_history
|
|
51
|
+
# A list of messages to seed the conversation history before the assistant starts.
|
|
52
|
+
# Follows the same message format as the `ai_assistant_add_messages` command.
|
|
53
|
+
#
|
|
54
|
+
# @return [Array<Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::User, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Tool, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::System, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Developer>, nil]
|
|
55
|
+
optional :message_history,
|
|
56
|
+
-> { Telnyx::Internal::Type::ArrayOf[union: Telnyx::Calls::ActionStartAIAssistantParams::MessageHistory] }
|
|
57
|
+
|
|
58
|
+
# @!attribute participants
|
|
59
|
+
# A list of participants to add to the conversation when it starts.
|
|
60
|
+
#
|
|
61
|
+
# @return [Array<Telnyx::Models::Calls::ActionStartAIAssistantParams::Participant>, nil]
|
|
62
|
+
optional :participants,
|
|
63
|
+
-> { Telnyx::Internal::Type::ArrayOf[Telnyx::Calls::ActionStartAIAssistantParams::Participant] }
|
|
64
|
+
|
|
65
|
+
# @!attribute send_message_history_updates
|
|
66
|
+
# When `true`, a webhook is sent each time the conversation message history is
|
|
67
|
+
# updated.
|
|
68
|
+
#
|
|
69
|
+
# @return [Boolean, nil]
|
|
70
|
+
optional :send_message_history_updates, Telnyx::Internal::Type::Boolean
|
|
71
|
+
|
|
50
72
|
# @!attribute transcription
|
|
51
73
|
# The settings associated with speech to text for the voice assistant. This is
|
|
52
74
|
# only relevant if the assistant uses a text-to-text language model. Any assistant
|
|
@@ -91,7 +113,7 @@ module Telnyx
|
|
|
91
113
|
# @return [Telnyx::Models::Calls::ElevenLabsVoiceSettings, Telnyx::Models::Calls::TelnyxVoiceSettings, Telnyx::Models::Calls::AwsVoiceSettings, Telnyx::Models::AzureVoiceSettings, Telnyx::Models::RimeVoiceSettings, Telnyx::Models::ResembleVoiceSettings, nil]
|
|
92
114
|
optional :voice_settings, union: -> { Telnyx::Calls::ActionStartAIAssistantParams::VoiceSettings }
|
|
93
115
|
|
|
94
|
-
# @!method initialize(call_control_id:, assistant: nil, client_state: nil, command_id: nil, greeting: nil, interruption_settings: nil, transcription: nil, voice: nil, voice_settings: nil, request_options: {})
|
|
116
|
+
# @!method initialize(call_control_id:, assistant: nil, client_state: nil, command_id: nil, greeting: nil, interruption_settings: nil, message_history: nil, participants: nil, send_message_history_updates: nil, transcription: nil, voice: nil, voice_settings: nil, request_options: {})
|
|
95
117
|
# Some parameter documentations has been truncated, see
|
|
96
118
|
# {Telnyx::Models::Calls::ActionStartAIAssistantParams} for more details.
|
|
97
119
|
#
|
|
@@ -107,6 +129,12 @@ module Telnyx
|
|
|
107
129
|
#
|
|
108
130
|
# @param interruption_settings [Telnyx::Models::Calls::InterruptionSettings] Settings for handling user interruptions during assistant speech
|
|
109
131
|
#
|
|
132
|
+
# @param message_history [Array<Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::User, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Tool, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::System, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Developer>] A list of messages to seed the conversation history before the assistant starts.
|
|
133
|
+
#
|
|
134
|
+
# @param participants [Array<Telnyx::Models::Calls::ActionStartAIAssistantParams::Participant>] A list of participants to add to the conversation when it starts.
|
|
135
|
+
#
|
|
136
|
+
# @param send_message_history_updates [Boolean] When `true`, a webhook is sent each time the conversation message history is upd
|
|
137
|
+
#
|
|
110
138
|
# @param transcription [Telnyx::Models::Calls::TranscriptionConfig] The settings associated with speech to text for the voice assistant. This is onl
|
|
111
139
|
#
|
|
112
140
|
# @param voice [String] The voice to be used by the voice assistant. Currently we support ElevenLabs, Te
|
|
@@ -150,6 +178,309 @@ module Telnyx
|
|
|
150
178
|
# @param openai_api_key_ref [String] Reference to the OpenAI API key. Required only when using OpenAI models
|
|
151
179
|
end
|
|
152
180
|
|
|
181
|
+
# Messages sent by an end user
|
|
182
|
+
module MessageHistory
|
|
183
|
+
extend Telnyx::Internal::Type::Union
|
|
184
|
+
|
|
185
|
+
discriminator :role
|
|
186
|
+
|
|
187
|
+
# Messages sent by an end user
|
|
188
|
+
variant :user, -> { Telnyx::Calls::ActionStartAIAssistantParams::MessageHistory::User }
|
|
189
|
+
|
|
190
|
+
# Messages sent by the model in response to user messages.
|
|
191
|
+
variant :assistant, -> { Telnyx::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant }
|
|
192
|
+
|
|
193
|
+
variant :tool, -> { Telnyx::Calls::ActionStartAIAssistantParams::MessageHistory::Tool }
|
|
194
|
+
|
|
195
|
+
# Developer-provided instructions that the model should follow, regardless of messages sent by the user.
|
|
196
|
+
variant :system, -> { Telnyx::Calls::ActionStartAIAssistantParams::MessageHistory::System }
|
|
197
|
+
|
|
198
|
+
# Developer-provided instructions that the model should follow, regardless of messages sent by the user.
|
|
199
|
+
variant :developer, -> { Telnyx::Calls::ActionStartAIAssistantParams::MessageHistory::Developer }
|
|
200
|
+
|
|
201
|
+
class User < Telnyx::Internal::Type::BaseModel
|
|
202
|
+
# @!attribute content
|
|
203
|
+
# The contents of the user message.
|
|
204
|
+
#
|
|
205
|
+
# @return [String]
|
|
206
|
+
required :content, String
|
|
207
|
+
|
|
208
|
+
# @!attribute role
|
|
209
|
+
# The role of the messages author, in this case `user`.
|
|
210
|
+
#
|
|
211
|
+
# @return [Symbol, :user]
|
|
212
|
+
required :role, const: :user
|
|
213
|
+
|
|
214
|
+
# @!attribute metadata
|
|
215
|
+
# Metadata to add to the message
|
|
216
|
+
#
|
|
217
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
218
|
+
optional :metadata, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]
|
|
219
|
+
|
|
220
|
+
# @!method initialize(content:, metadata: nil, role: :user)
|
|
221
|
+
# Messages sent by an end user
|
|
222
|
+
#
|
|
223
|
+
# @param content [String] The contents of the user message.
|
|
224
|
+
#
|
|
225
|
+
# @param metadata [Hash{Symbol=>Object}] Metadata to add to the message
|
|
226
|
+
#
|
|
227
|
+
# @param role [Symbol, :user] The role of the messages author, in this case `user`.
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
class Assistant < Telnyx::Internal::Type::BaseModel
|
|
231
|
+
# @!attribute role
|
|
232
|
+
# The role of the messages author, in this case `assistant`.
|
|
233
|
+
#
|
|
234
|
+
# @return [Symbol, :assistant]
|
|
235
|
+
required :role, const: :assistant
|
|
236
|
+
|
|
237
|
+
# @!attribute content
|
|
238
|
+
# The contents of the assistant message. Required unless `tool_calls`
|
|
239
|
+
#
|
|
240
|
+
# @return [String, nil]
|
|
241
|
+
optional :content, String
|
|
242
|
+
|
|
243
|
+
# @!attribute metadata
|
|
244
|
+
# Metadata to add to the message
|
|
245
|
+
#
|
|
246
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
247
|
+
optional :metadata, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]
|
|
248
|
+
|
|
249
|
+
# @!attribute tool_calls
|
|
250
|
+
# The tool calls generated by the model, such as function calls.
|
|
251
|
+
#
|
|
252
|
+
# @return [Array<Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant::ToolCall>, nil]
|
|
253
|
+
optional :tool_calls,
|
|
254
|
+
-> { Telnyx::Internal::Type::ArrayOf[Telnyx::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant::ToolCall] }
|
|
255
|
+
|
|
256
|
+
# @!method initialize(content: nil, metadata: nil, tool_calls: nil, role: :assistant)
|
|
257
|
+
# Messages sent by the model in response to user messages.
|
|
258
|
+
#
|
|
259
|
+
# @param content [String] The contents of the assistant message. Required unless `tool_calls`
|
|
260
|
+
#
|
|
261
|
+
# @param metadata [Hash{Symbol=>Object}] Metadata to add to the message
|
|
262
|
+
#
|
|
263
|
+
# @param tool_calls [Array<Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant::ToolCall>] The tool calls generated by the model, such as function calls.
|
|
264
|
+
#
|
|
265
|
+
# @param role [Symbol, :assistant] The role of the messages author, in this case `assistant`.
|
|
266
|
+
|
|
267
|
+
class ToolCall < Telnyx::Internal::Type::BaseModel
|
|
268
|
+
# @!attribute id
|
|
269
|
+
# The ID of the tool call.
|
|
270
|
+
#
|
|
271
|
+
# @return [String]
|
|
272
|
+
required :id, String
|
|
273
|
+
|
|
274
|
+
# @!attribute function
|
|
275
|
+
# The function that the model called.
|
|
276
|
+
#
|
|
277
|
+
# @return [Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant::ToolCall::Function]
|
|
278
|
+
required :function,
|
|
279
|
+
-> { Telnyx::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant::ToolCall::Function }
|
|
280
|
+
|
|
281
|
+
# @!attribute type
|
|
282
|
+
# The type of the tool. Currently, only `function` is supported.
|
|
283
|
+
#
|
|
284
|
+
# @return [Symbol, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant::ToolCall::Type]
|
|
285
|
+
required :type,
|
|
286
|
+
enum: -> { Telnyx::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant::ToolCall::Type }
|
|
287
|
+
|
|
288
|
+
# @!method initialize(id:, function:, type:)
|
|
289
|
+
# A call to a function tool created by the model.
|
|
290
|
+
#
|
|
291
|
+
# @param id [String] The ID of the tool call.
|
|
292
|
+
#
|
|
293
|
+
# @param function [Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant::ToolCall::Function] The function that the model called.
|
|
294
|
+
#
|
|
295
|
+
# @param type [Symbol, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant::ToolCall::Type] The type of the tool. Currently, only `function` is supported.
|
|
296
|
+
|
|
297
|
+
# @see Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant::ToolCall#function
|
|
298
|
+
class Function < Telnyx::Internal::Type::BaseModel
|
|
299
|
+
# @!attribute name
|
|
300
|
+
# The name of the function to call.
|
|
301
|
+
#
|
|
302
|
+
# @return [String]
|
|
303
|
+
required :name, String
|
|
304
|
+
|
|
305
|
+
# @!method initialize(name:)
|
|
306
|
+
# The function that the model called.
|
|
307
|
+
#
|
|
308
|
+
# @param name [String] The name of the function to call.
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
# The type of the tool. Currently, only `function` is supported.
|
|
312
|
+
#
|
|
313
|
+
# @see Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant::ToolCall#type
|
|
314
|
+
module Type
|
|
315
|
+
extend Telnyx::Internal::Type::Enum
|
|
316
|
+
|
|
317
|
+
FUNCTION = :function
|
|
318
|
+
|
|
319
|
+
# @!method self.values
|
|
320
|
+
# @return [Array<Symbol>]
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
class Tool < Telnyx::Internal::Type::BaseModel
|
|
326
|
+
# @!attribute content
|
|
327
|
+
# The contents of the tool message.
|
|
328
|
+
#
|
|
329
|
+
# @return [String]
|
|
330
|
+
required :content, String
|
|
331
|
+
|
|
332
|
+
# @!attribute role
|
|
333
|
+
# The role of the messages author, in this case `tool`.
|
|
334
|
+
#
|
|
335
|
+
# @return [Symbol, :tool]
|
|
336
|
+
required :role, const: :tool
|
|
337
|
+
|
|
338
|
+
# @!attribute tool_call_id
|
|
339
|
+
# Tool call that this message is responding to.
|
|
340
|
+
#
|
|
341
|
+
# @return [String]
|
|
342
|
+
required :tool_call_id, String
|
|
343
|
+
|
|
344
|
+
# @!attribute metadata
|
|
345
|
+
# Metadata to add to the message
|
|
346
|
+
#
|
|
347
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
348
|
+
optional :metadata, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]
|
|
349
|
+
|
|
350
|
+
# @!method initialize(content:, tool_call_id:, metadata: nil, role: :tool)
|
|
351
|
+
# @param content [String] The contents of the tool message.
|
|
352
|
+
#
|
|
353
|
+
# @param tool_call_id [String] Tool call that this message is responding to.
|
|
354
|
+
#
|
|
355
|
+
# @param metadata [Hash{Symbol=>Object}] Metadata to add to the message
|
|
356
|
+
#
|
|
357
|
+
# @param role [Symbol, :tool] The role of the messages author, in this case `tool`.
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
class System < Telnyx::Internal::Type::BaseModel
|
|
361
|
+
# @!attribute content
|
|
362
|
+
# The contents of the system message.
|
|
363
|
+
#
|
|
364
|
+
# @return [String]
|
|
365
|
+
required :content, String
|
|
366
|
+
|
|
367
|
+
# @!attribute role
|
|
368
|
+
# The role of the messages author, in this case `system`.
|
|
369
|
+
#
|
|
370
|
+
# @return [Symbol, :system]
|
|
371
|
+
required :role, const: :system
|
|
372
|
+
|
|
373
|
+
# @!attribute metadata
|
|
374
|
+
# Metadata to add to the message
|
|
375
|
+
#
|
|
376
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
377
|
+
optional :metadata, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]
|
|
378
|
+
|
|
379
|
+
# @!method initialize(content:, metadata: nil, role: :system)
|
|
380
|
+
# Developer-provided instructions that the model should follow, regardless of
|
|
381
|
+
# messages sent by the user.
|
|
382
|
+
#
|
|
383
|
+
# @param content [String] The contents of the system message.
|
|
384
|
+
#
|
|
385
|
+
# @param metadata [Hash{Symbol=>Object}] Metadata to add to the message
|
|
386
|
+
#
|
|
387
|
+
# @param role [Symbol, :system] The role of the messages author, in this case `system`.
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
class Developer < Telnyx::Internal::Type::BaseModel
|
|
391
|
+
# @!attribute content
|
|
392
|
+
# The contents of the developer message.
|
|
393
|
+
#
|
|
394
|
+
# @return [String]
|
|
395
|
+
required :content, String
|
|
396
|
+
|
|
397
|
+
# @!attribute role
|
|
398
|
+
# The role of the messages author, in this case developer.
|
|
399
|
+
#
|
|
400
|
+
# @return [Symbol, :developer]
|
|
401
|
+
required :role, const: :developer
|
|
402
|
+
|
|
403
|
+
# @!attribute metadata
|
|
404
|
+
# Metadata to add to the message
|
|
405
|
+
#
|
|
406
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
407
|
+
optional :metadata, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]
|
|
408
|
+
|
|
409
|
+
# @!method initialize(content:, metadata: nil, role: :developer)
|
|
410
|
+
# Developer-provided instructions that the model should follow, regardless of
|
|
411
|
+
# messages sent by the user.
|
|
412
|
+
#
|
|
413
|
+
# @param content [String] The contents of the developer message.
|
|
414
|
+
#
|
|
415
|
+
# @param metadata [Hash{Symbol=>Object}] Metadata to add to the message
|
|
416
|
+
#
|
|
417
|
+
# @param role [Symbol, :developer] The role of the messages author, in this case developer.
|
|
418
|
+
end
|
|
419
|
+
|
|
420
|
+
# @!method self.variants
|
|
421
|
+
# @return [Array(Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::User, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Assistant, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Tool, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::System, Telnyx::Models::Calls::ActionStartAIAssistantParams::MessageHistory::Developer)]
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
class Participant < Telnyx::Internal::Type::BaseModel
|
|
425
|
+
# @!attribute id
|
|
426
|
+
# The call_control_id of the participant to add to the conversation.
|
|
427
|
+
#
|
|
428
|
+
# @return [String]
|
|
429
|
+
required :id, String
|
|
430
|
+
|
|
431
|
+
# @!attribute role
|
|
432
|
+
# The role of the participant in the conversation.
|
|
433
|
+
#
|
|
434
|
+
# @return [Symbol, Telnyx::Models::Calls::ActionStartAIAssistantParams::Participant::Role]
|
|
435
|
+
required :role, enum: -> { Telnyx::Calls::ActionStartAIAssistantParams::Participant::Role }
|
|
436
|
+
|
|
437
|
+
# @!attribute name
|
|
438
|
+
# Display name for the participant.
|
|
439
|
+
#
|
|
440
|
+
# @return [String, nil]
|
|
441
|
+
optional :name, String
|
|
442
|
+
|
|
443
|
+
# @!attribute on_hangup
|
|
444
|
+
# Determines what happens to the conversation when this participant hangs up.
|
|
445
|
+
#
|
|
446
|
+
# @return [Symbol, Telnyx::Models::Calls::ActionStartAIAssistantParams::Participant::OnHangup, nil]
|
|
447
|
+
optional :on_hangup, enum: -> { Telnyx::Calls::ActionStartAIAssistantParams::Participant::OnHangup }
|
|
448
|
+
|
|
449
|
+
# @!method initialize(id:, role:, name: nil, on_hangup: nil)
|
|
450
|
+
# @param id [String] The call_control_id of the participant to add to the conversation.
|
|
451
|
+
#
|
|
452
|
+
# @param role [Symbol, Telnyx::Models::Calls::ActionStartAIAssistantParams::Participant::Role] The role of the participant in the conversation.
|
|
453
|
+
#
|
|
454
|
+
# @param name [String] Display name for the participant.
|
|
455
|
+
#
|
|
456
|
+
# @param on_hangup [Symbol, Telnyx::Models::Calls::ActionStartAIAssistantParams::Participant::OnHangup] Determines what happens to the conversation when this participant hangs up.
|
|
457
|
+
|
|
458
|
+
# The role of the participant in the conversation.
|
|
459
|
+
#
|
|
460
|
+
# @see Telnyx::Models::Calls::ActionStartAIAssistantParams::Participant#role
|
|
461
|
+
module Role
|
|
462
|
+
extend Telnyx::Internal::Type::Enum
|
|
463
|
+
|
|
464
|
+
USER = :user
|
|
465
|
+
|
|
466
|
+
# @!method self.values
|
|
467
|
+
# @return [Array<Symbol>]
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
# Determines what happens to the conversation when this participant hangs up.
|
|
471
|
+
#
|
|
472
|
+
# @see Telnyx::Models::Calls::ActionStartAIAssistantParams::Participant#on_hangup
|
|
473
|
+
module OnHangup
|
|
474
|
+
extend Telnyx::Internal::Type::Enum
|
|
475
|
+
|
|
476
|
+
CONTINUE_CONVERSATION = :continue_conversation
|
|
477
|
+
END_CONVERSATION = :end_conversation
|
|
478
|
+
|
|
479
|
+
# @!method self.values
|
|
480
|
+
# @return [Array<Symbol>]
|
|
481
|
+
end
|
|
482
|
+
end
|
|
483
|
+
|
|
153
484
|
# The settings associated with the voice selected
|
|
154
485
|
module VoiceSettings
|
|
155
486
|
extend Telnyx::Internal::Type::Union
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
module Telnyx
|
|
4
4
|
module Models
|
|
5
5
|
module Porting
|
|
6
|
-
# @see Telnyx::Resources::Porting::LoaConfigurations#
|
|
7
|
-
class
|
|
6
|
+
# @see Telnyx::Resources::Porting::LoaConfigurations#preview
|
|
7
|
+
class LoaConfigurationPreviewParams < Telnyx::Internal::Type::BaseModel
|
|
8
8
|
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
9
9
|
include Telnyx::Internal::Type::RequestParameters
|
|
10
10
|
|
|
11
11
|
# @!attribute address
|
|
12
12
|
# The address of the company.
|
|
13
13
|
#
|
|
14
|
-
# @return [Telnyx::Models::Porting::
|
|
15
|
-
required :address, -> { Telnyx::Porting::
|
|
14
|
+
# @return [Telnyx::Models::Porting::LoaConfigurationPreviewParams::Address]
|
|
15
|
+
required :address, -> { Telnyx::Porting::LoaConfigurationPreviewParams::Address }
|
|
16
16
|
|
|
17
17
|
# @!attribute company_name
|
|
18
18
|
# The name of the company
|
|
@@ -23,14 +23,14 @@ module Telnyx
|
|
|
23
23
|
# @!attribute contact
|
|
24
24
|
# The contact information of the company.
|
|
25
25
|
#
|
|
26
|
-
# @return [Telnyx::Models::Porting::
|
|
27
|
-
required :contact, -> { Telnyx::Porting::
|
|
26
|
+
# @return [Telnyx::Models::Porting::LoaConfigurationPreviewParams::Contact]
|
|
27
|
+
required :contact, -> { Telnyx::Porting::LoaConfigurationPreviewParams::Contact }
|
|
28
28
|
|
|
29
29
|
# @!attribute logo
|
|
30
30
|
# The logo of the LOA configuration
|
|
31
31
|
#
|
|
32
|
-
# @return [Telnyx::Models::Porting::
|
|
33
|
-
required :logo, -> { Telnyx::Porting::
|
|
32
|
+
# @return [Telnyx::Models::Porting::LoaConfigurationPreviewParams::Logo]
|
|
33
|
+
required :logo, -> { Telnyx::Porting::LoaConfigurationPreviewParams::Logo }
|
|
34
34
|
|
|
35
35
|
# @!attribute name
|
|
36
36
|
# The name of the LOA configuration
|
|
@@ -39,13 +39,13 @@ module Telnyx
|
|
|
39
39
|
required :name, String
|
|
40
40
|
|
|
41
41
|
# @!method initialize(address:, company_name:, contact:, logo:, name:, request_options: {})
|
|
42
|
-
# @param address [Telnyx::Models::Porting::
|
|
42
|
+
# @param address [Telnyx::Models::Porting::LoaConfigurationPreviewParams::Address] The address of the company.
|
|
43
43
|
#
|
|
44
44
|
# @param company_name [String] The name of the company
|
|
45
45
|
#
|
|
46
|
-
# @param contact [Telnyx::Models::Porting::
|
|
46
|
+
# @param contact [Telnyx::Models::Porting::LoaConfigurationPreviewParams::Contact] The contact information of the company.
|
|
47
47
|
#
|
|
48
|
-
# @param logo [Telnyx::Models::Porting::
|
|
48
|
+
# @param logo [Telnyx::Models::Porting::LoaConfigurationPreviewParams::Logo] The logo of the LOA configuration
|
|
49
49
|
#
|
|
50
50
|
# @param name [String] The name of the LOA configuration
|
|
51
51
|
#
|