telnyx 5.70.0 → 5.71.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 (105) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/models/ai/assistant.rb +6 -149
  5. data/lib/telnyx/models/book_appointment_tool.rb +31 -0
  6. data/lib/telnyx/models/book_appointment_tool_params.rb +51 -0
  7. data/lib/telnyx/models/call_assistant_request.rb +176 -0
  8. data/lib/telnyx/models/call_control_bucket_ids.rb +23 -0
  9. data/lib/telnyx/models/call_control_retrieval_tool.rb +31 -0
  10. data/lib/telnyx/models/call_dial_params.rb +11 -1
  11. data/lib/telnyx/models/calls/action_answer_params.rb +11 -1
  12. data/lib/telnyx/models/calls/action_start_ai_assistant_params.rb +6 -39
  13. data/lib/telnyx/models/check_availability_tool.rb +31 -0
  14. data/lib/telnyx/models/check_availability_tool_params.rb +31 -0
  15. data/lib/telnyx/models/pronunciation_dict_alias_item.rb +51 -0
  16. data/lib/telnyx/models/pronunciation_dict_create_params.rb +5 -93
  17. data/lib/telnyx/models/pronunciation_dict_create_response.rb +3 -191
  18. data/lib/telnyx/models/pronunciation_dict_data.rb +101 -0
  19. data/lib/telnyx/models/pronunciation_dict_phoneme_item.rb +71 -0
  20. data/lib/telnyx/models/pronunciation_dict_retrieve_response.rb +3 -191
  21. data/lib/telnyx/models/pronunciation_dict_update_params.rb +5 -93
  22. data/lib/telnyx/models/pronunciation_dict_update_response.rb +3 -191
  23. data/lib/telnyx/models/texml/accounts/call_calls_params.rb +203 -191
  24. data/lib/telnyx/models/voice_clone_create_from_design_params.rb +3 -3
  25. data/lib/telnyx/models/voice_clone_create_from_upload_params.rb +61 -54
  26. data/lib/telnyx/models/voice_clone_create_params.rb +28 -28
  27. data/lib/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_params.rb +26 -0
  28. data/lib/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_response.rb +54 -0
  29. data/lib/telnyx/models.rb +20 -0
  30. data/lib/telnyx/resources/calls/actions.rb +4 -2
  31. data/lib/telnyx/resources/calls.rb +3 -1
  32. data/lib/telnyx/resources/pronunciation_dicts.rb +4 -4
  33. data/lib/telnyx/resources/texml/accounts/calls.rb +3 -3
  34. data/lib/telnyx/resources/voice_clones.rb +6 -6
  35. data/lib/telnyx/resources/whatsapp/phone_numbers/profile/photo.rb +20 -0
  36. data/lib/telnyx/version.rb +1 -1
  37. data/lib/telnyx.rb +12 -1
  38. data/rbi/telnyx/models/ai/assistant.rbi +15 -329
  39. data/rbi/telnyx/models/book_appointment_tool.rbi +65 -0
  40. data/rbi/telnyx/models/book_appointment_tool_params.rbi +83 -0
  41. data/rbi/telnyx/models/call_assistant_request.rbi +322 -0
  42. data/rbi/telnyx/models/call_control_bucket_ids.rbi +42 -0
  43. data/rbi/telnyx/models/call_control_retrieval_tool.rbi +63 -0
  44. data/rbi/telnyx/models/call_dial_params.rbi +15 -0
  45. data/rbi/telnyx/models/calls/action_answer_params.rbi +15 -0
  46. data/rbi/telnyx/models/calls/action_start_ai_assistant_params.rbi +10 -77
  47. data/rbi/telnyx/models/check_availability_tool.rbi +67 -0
  48. data/rbi/telnyx/models/check_availability_tool_params.rbi +45 -0
  49. data/rbi/telnyx/models/pronunciation_dict_alias_item.rbi +79 -0
  50. data/rbi/telnyx/models/pronunciation_dict_create_params.rbi +8 -154
  51. data/rbi/telnyx/models/pronunciation_dict_create_response.rbi +6 -366
  52. data/rbi/telnyx/models/pronunciation_dict_data.rbi +186 -0
  53. data/rbi/telnyx/models/pronunciation_dict_phoneme_item.rbi +117 -0
  54. data/rbi/telnyx/models/pronunciation_dict_retrieve_response.rbi +6 -366
  55. data/rbi/telnyx/models/pronunciation_dict_update_params.rbi +10 -156
  56. data/rbi/telnyx/models/pronunciation_dict_update_response.rbi +6 -366
  57. data/rbi/telnyx/models/texml/accounts/call_calls_params.rbi +391 -403
  58. data/rbi/telnyx/models/voice_clone_create_from_design_params.rbi +10 -10
  59. data/rbi/telnyx/models/voice_clone_create_from_upload_params.rbi +94 -92
  60. data/rbi/telnyx/models/voice_clone_create_params.rbi +53 -53
  61. data/rbi/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_params.rbi +47 -0
  62. data/rbi/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_response.rbi +118 -0
  63. data/rbi/telnyx/models.rbi +20 -0
  64. data/rbi/telnyx/resources/calls/actions.rbi +9 -3
  65. data/rbi/telnyx/resources/calls.rbi +5 -0
  66. data/rbi/telnyx/resources/pronunciation_dicts.rbi +5 -7
  67. data/rbi/telnyx/resources/texml/accounts/calls.rbi +5 -5
  68. data/rbi/telnyx/resources/voice_clones.rbi +9 -9
  69. data/rbi/telnyx/resources/whatsapp/phone_numbers/profile/photo.rbi +16 -0
  70. data/sig/telnyx/models/ai/assistant.rbs +3 -142
  71. data/sig/telnyx/models/book_appointment_tool.rbs +35 -0
  72. data/sig/telnyx/models/book_appointment_tool_params.rbs +39 -0
  73. data/sig/telnyx/models/call_assistant_request.rbs +132 -0
  74. data/sig/telnyx/models/call_control_bucket_ids.rbs +21 -0
  75. data/sig/telnyx/models/call_control_retrieval_tool.rbs +35 -0
  76. data/sig/telnyx/models/call_dial_params.rbs +9 -0
  77. data/sig/telnyx/models/calls/action_answer_params.rbs +9 -0
  78. data/sig/telnyx/models/calls/action_start_ai_assistant_params.rbs +6 -35
  79. data/sig/telnyx/models/check_availability_tool.rbs +35 -0
  80. data/sig/telnyx/models/check_availability_tool_params.rbs +16 -0
  81. data/sig/telnyx/models/pronunciation_dict_alias_item.rbs +40 -0
  82. data/sig/telnyx/models/pronunciation_dict_create_params.rbs +2 -58
  83. data/sig/telnyx/models/pronunciation_dict_create_response.rbs +6 -155
  84. data/sig/telnyx/models/pronunciation_dict_data.rbs +88 -0
  85. data/sig/telnyx/models/pronunciation_dict_phoneme_item.rbs +55 -0
  86. data/sig/telnyx/models/pronunciation_dict_retrieve_response.rbs +6 -155
  87. data/sig/telnyx/models/pronunciation_dict_update_params.rbs +2 -58
  88. data/sig/telnyx/models/pronunciation_dict_update_response.rbs +6 -155
  89. data/sig/telnyx/models/texml/accounts/call_calls_params.rbs +317 -325
  90. data/sig/telnyx/models/voice_clone_create_from_design_params.rbs +7 -7
  91. data/sig/telnyx/models/voice_clone_create_from_upload_params.rbs +63 -61
  92. data/sig/telnyx/models/voice_clone_create_params.rbs +35 -35
  93. data/sig/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_params.rbs +30 -0
  94. data/sig/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_response.rbs +63 -0
  95. data/sig/telnyx/models.rbs +20 -0
  96. data/sig/telnyx/resources/calls/actions.rbs +2 -1
  97. data/sig/telnyx/resources/calls.rbs +1 -0
  98. data/sig/telnyx/resources/pronunciation_dicts.rbs +1 -1
  99. data/sig/telnyx/resources/texml/accounts/calls.rbs +1 -1
  100. data/sig/telnyx/resources/voice_clones.rbs +2 -2
  101. data/sig/telnyx/resources/whatsapp/phone_numbers/profile/photo.rbs +5 -0
  102. metadata +38 -5
  103. data/lib/telnyx/models/pronunciation_dict_list_response.rb +0 -190
  104. data/rbi/telnyx/models/pronunciation_dict_list_response.rbi +0 -353
  105. data/sig/telnyx/models/pronunciation_dict_list_response.rbs +0 -144
@@ -0,0 +1,322 @@
1
+ # typed: strong
2
+
3
+ module Telnyx
4
+ module Models
5
+ class CallAssistantRequest < Telnyx::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Telnyx::CallAssistantRequest, Telnyx::Internal::AnyHash)
9
+ end
10
+
11
+ # The identifier of the AI assistant to use.
12
+ sig { returns(String) }
13
+ attr_accessor :id
14
+
15
+ # Map of dynamic variables and their default values. Dynamic variables can be
16
+ # referenced in instructions, greeting, and tool definitions using the
17
+ # `{{variable_name}}` syntax. Call-control-agent automatically merges in
18
+ # `telnyx_call_*` variables (telnyx_call_to, telnyx_call_from,
19
+ # telnyx_conversation_channel, telnyx_agent_target, telnyx_end_user_target,
20
+ # telnyx_call_caller_id_name) and custom header variables.
21
+ sig do
22
+ returns(
23
+ T.nilable(
24
+ T::Hash[
25
+ Symbol,
26
+ Telnyx::CallAssistantRequest::DynamicVariable::Variants
27
+ ]
28
+ )
29
+ )
30
+ end
31
+ attr_reader :dynamic_variables
32
+
33
+ sig do
34
+ params(
35
+ dynamic_variables:
36
+ T::Hash[
37
+ Symbol,
38
+ Telnyx::CallAssistantRequest::DynamicVariable::Variants
39
+ ]
40
+ ).void
41
+ end
42
+ attr_writer :dynamic_variables
43
+
44
+ # External LLM configuration for bringing your own LLM endpoint.
45
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
46
+ attr_reader :external_llm
47
+
48
+ sig { params(external_llm: T::Hash[Symbol, T.anything]).void }
49
+ attr_writer :external_llm
50
+
51
+ # Fallback LLM configuration used when the primary LLM provider is unavailable.
52
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
53
+ attr_reader :fallback_config
54
+
55
+ sig { params(fallback_config: T::Hash[Symbol, T.anything]).void }
56
+ attr_writer :fallback_config
57
+
58
+ # Initial greeting text spoken when the assistant starts. Can be plain text for
59
+ # any voice or SSML for `AWS.Polly.<voice_id>` voices. There is a 3,000 character
60
+ # limit.
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :greeting
63
+
64
+ sig { params(greeting: String).void }
65
+ attr_writer :greeting
66
+
67
+ # System instructions for the voice assistant. Can be templated with
68
+ # [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
69
+ # This will overwrite the instructions set in the assistant configuration.
70
+ sig { returns(T.nilable(String)) }
71
+ attr_reader :instructions
72
+
73
+ sig { params(instructions: String).void }
74
+ attr_writer :instructions
75
+
76
+ # Integration secret identifier for the LLM provider API key. Use this field to
77
+ # reference an
78
+ # [integration secret](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret)
79
+ # containing your LLM provider API key. Supports any LLM provider (OpenAI,
80
+ # Anthropic, etc.).
81
+ sig { returns(T.nilable(String)) }
82
+ attr_reader :llm_api_key_ref
83
+
84
+ sig { params(llm_api_key_ref: String).void }
85
+ attr_writer :llm_api_key_ref
86
+
87
+ # MCP (Model Context Protocol) server configurations for extending the assistant's
88
+ # capabilities with external tools and data sources.
89
+ sig { returns(T.nilable(T::Array[T::Hash[Symbol, T.anything]])) }
90
+ attr_reader :mcp_servers
91
+
92
+ sig { params(mcp_servers: T::Array[T::Hash[Symbol, T.anything]]).void }
93
+ attr_writer :mcp_servers
94
+
95
+ # LLM model override for this call. If omitted, the assistant's configured model
96
+ # is used.
97
+ sig { returns(T.nilable(String)) }
98
+ attr_reader :model
99
+
100
+ sig { params(model: String).void }
101
+ attr_writer :model
102
+
103
+ # Assistant name override for this call.
104
+ sig { returns(T.nilable(String)) }
105
+ attr_reader :name
106
+
107
+ sig { params(name: String).void }
108
+ attr_writer :name
109
+
110
+ # Observability configuration for the assistant session, including Langfuse
111
+ # integration for tracing and monitoring.
112
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
113
+ attr_reader :observability_settings
114
+
115
+ sig { params(observability_settings: T::Hash[Symbol, T.anything]).void }
116
+ attr_writer :observability_settings
117
+
118
+ # Deprecated — use `llm_api_key_ref` instead. Integration secret identifier for
119
+ # the OpenAI API key. This field is maintained for backward compatibility;
120
+ # `llm_api_key_ref` is the canonical field name and supports all LLM providers.
121
+ sig { returns(T.nilable(String)) }
122
+ attr_reader :openai_api_key_ref
123
+
124
+ sig { params(openai_api_key_ref: String).void }
125
+ attr_writer :openai_api_key_ref
126
+
127
+ # Inline tool definitions available to the assistant (webhook, retrieval,
128
+ # transfer, hangup, etc.). Overrides the assistant's stored tools if provided.
129
+ sig do
130
+ returns(
131
+ T.nilable(
132
+ T::Array[
133
+ T.any(
134
+ Telnyx::BookAppointmentTool,
135
+ Telnyx::CheckAvailabilityTool,
136
+ Telnyx::AI::WebhookTool,
137
+ Telnyx::AI::HangupTool,
138
+ Telnyx::AI::TransferTool,
139
+ Telnyx::CallControlRetrievalTool
140
+ )
141
+ ]
142
+ )
143
+ )
144
+ end
145
+ attr_reader :tools
146
+
147
+ sig do
148
+ params(
149
+ tools:
150
+ T::Array[
151
+ T.any(
152
+ Telnyx::BookAppointmentTool::OrHash,
153
+ Telnyx::CheckAvailabilityTool::OrHash,
154
+ Telnyx::AI::WebhookTool::OrHash,
155
+ Telnyx::AI::HangupTool::OrHash,
156
+ Telnyx::AI::TransferTool::OrHash,
157
+ Telnyx::CallControlRetrievalTool::OrHash
158
+ )
159
+ ]
160
+ ).void
161
+ end
162
+ attr_writer :tools
163
+
164
+ # AI Assistant configuration. All fields except `id` are optional — the
165
+ # assistant's stored configuration will be used as fallback for any omitted
166
+ # fields.
167
+ sig do
168
+ params(
169
+ id: String,
170
+ dynamic_variables:
171
+ T::Hash[
172
+ Symbol,
173
+ Telnyx::CallAssistantRequest::DynamicVariable::Variants
174
+ ],
175
+ external_llm: T::Hash[Symbol, T.anything],
176
+ fallback_config: T::Hash[Symbol, T.anything],
177
+ greeting: String,
178
+ instructions: String,
179
+ llm_api_key_ref: String,
180
+ mcp_servers: T::Array[T::Hash[Symbol, T.anything]],
181
+ model: String,
182
+ name: String,
183
+ observability_settings: T::Hash[Symbol, T.anything],
184
+ openai_api_key_ref: String,
185
+ tools:
186
+ T::Array[
187
+ T.any(
188
+ Telnyx::BookAppointmentTool::OrHash,
189
+ Telnyx::CheckAvailabilityTool::OrHash,
190
+ Telnyx::AI::WebhookTool::OrHash,
191
+ Telnyx::AI::HangupTool::OrHash,
192
+ Telnyx::AI::TransferTool::OrHash,
193
+ Telnyx::CallControlRetrievalTool::OrHash
194
+ )
195
+ ]
196
+ ).returns(T.attached_class)
197
+ end
198
+ def self.new(
199
+ # The identifier of the AI assistant to use.
200
+ id:,
201
+ # Map of dynamic variables and their default values. Dynamic variables can be
202
+ # referenced in instructions, greeting, and tool definitions using the
203
+ # `{{variable_name}}` syntax. Call-control-agent automatically merges in
204
+ # `telnyx_call_*` variables (telnyx_call_to, telnyx_call_from,
205
+ # telnyx_conversation_channel, telnyx_agent_target, telnyx_end_user_target,
206
+ # telnyx_call_caller_id_name) and custom header variables.
207
+ dynamic_variables: nil,
208
+ # External LLM configuration for bringing your own LLM endpoint.
209
+ external_llm: nil,
210
+ # Fallback LLM configuration used when the primary LLM provider is unavailable.
211
+ fallback_config: nil,
212
+ # Initial greeting text spoken when the assistant starts. Can be plain text for
213
+ # any voice or SSML for `AWS.Polly.<voice_id>` voices. There is a 3,000 character
214
+ # limit.
215
+ greeting: nil,
216
+ # System instructions for the voice assistant. Can be templated with
217
+ # [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
218
+ # This will overwrite the instructions set in the assistant configuration.
219
+ instructions: nil,
220
+ # Integration secret identifier for the LLM provider API key. Use this field to
221
+ # reference an
222
+ # [integration secret](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret)
223
+ # containing your LLM provider API key. Supports any LLM provider (OpenAI,
224
+ # Anthropic, etc.).
225
+ llm_api_key_ref: nil,
226
+ # MCP (Model Context Protocol) server configurations for extending the assistant's
227
+ # capabilities with external tools and data sources.
228
+ mcp_servers: nil,
229
+ # LLM model override for this call. If omitted, the assistant's configured model
230
+ # is used.
231
+ model: nil,
232
+ # Assistant name override for this call.
233
+ name: nil,
234
+ # Observability configuration for the assistant session, including Langfuse
235
+ # integration for tracing and monitoring.
236
+ observability_settings: nil,
237
+ # Deprecated — use `llm_api_key_ref` instead. Integration secret identifier for
238
+ # the OpenAI API key. This field is maintained for backward compatibility;
239
+ # `llm_api_key_ref` is the canonical field name and supports all LLM providers.
240
+ openai_api_key_ref: nil,
241
+ # Inline tool definitions available to the assistant (webhook, retrieval,
242
+ # transfer, hangup, etc.). Overrides the assistant's stored tools if provided.
243
+ tools: nil
244
+ )
245
+ end
246
+
247
+ sig do
248
+ override.returns(
249
+ {
250
+ id: String,
251
+ dynamic_variables:
252
+ T::Hash[
253
+ Symbol,
254
+ Telnyx::CallAssistantRequest::DynamicVariable::Variants
255
+ ],
256
+ external_llm: T::Hash[Symbol, T.anything],
257
+ fallback_config: T::Hash[Symbol, T.anything],
258
+ greeting: String,
259
+ instructions: String,
260
+ llm_api_key_ref: String,
261
+ mcp_servers: T::Array[T::Hash[Symbol, T.anything]],
262
+ model: String,
263
+ name: String,
264
+ observability_settings: T::Hash[Symbol, T.anything],
265
+ openai_api_key_ref: String,
266
+ tools:
267
+ T::Array[
268
+ T.any(
269
+ Telnyx::BookAppointmentTool,
270
+ Telnyx::CheckAvailabilityTool,
271
+ Telnyx::AI::WebhookTool,
272
+ Telnyx::AI::HangupTool,
273
+ Telnyx::AI::TransferTool,
274
+ Telnyx::CallControlRetrievalTool
275
+ )
276
+ ]
277
+ }
278
+ )
279
+ end
280
+ def to_hash
281
+ end
282
+
283
+ module DynamicVariable
284
+ extend Telnyx::Internal::Type::Union
285
+
286
+ Variants = T.type_alias { T.any(String, Float, T::Boolean) }
287
+
288
+ sig do
289
+ override.returns(
290
+ T::Array[Telnyx::CallAssistantRequest::DynamicVariable::Variants]
291
+ )
292
+ end
293
+ def self.variants
294
+ end
295
+ end
296
+
297
+ module Tool
298
+ extend Telnyx::Internal::Type::Union
299
+
300
+ Variants =
301
+ T.type_alias do
302
+ T.any(
303
+ Telnyx::BookAppointmentTool,
304
+ Telnyx::CheckAvailabilityTool,
305
+ Telnyx::AI::WebhookTool,
306
+ Telnyx::AI::HangupTool,
307
+ Telnyx::AI::TransferTool,
308
+ Telnyx::CallControlRetrievalTool
309
+ )
310
+ end
311
+
312
+ sig do
313
+ override.returns(
314
+ T::Array[Telnyx::CallAssistantRequest::Tool::Variants]
315
+ )
316
+ end
317
+ def self.variants
318
+ end
319
+ end
320
+ end
321
+ end
322
+ end
@@ -0,0 +1,42 @@
1
+ # typed: strong
2
+
3
+ module Telnyx
4
+ module Models
5
+ class CallControlBucketIDs < Telnyx::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Telnyx::CallControlBucketIDs, Telnyx::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(T::Array[String]) }
12
+ attr_accessor :bucket_ids
13
+
14
+ # The maximum number of results to retrieve as context for the language model.
15
+ sig { returns(T.nilable(Integer)) }
16
+ attr_reader :max_num_results
17
+
18
+ sig { params(max_num_results: Integer).void }
19
+ attr_writer :max_num_results
20
+
21
+ sig do
22
+ params(bucket_ids: T::Array[String], max_num_results: Integer).returns(
23
+ T.attached_class
24
+ )
25
+ end
26
+ def self.new(
27
+ bucket_ids:,
28
+ # The maximum number of results to retrieve as context for the language model.
29
+ max_num_results: nil
30
+ )
31
+ end
32
+
33
+ sig do
34
+ override.returns(
35
+ { bucket_ids: T::Array[String], max_num_results: Integer }
36
+ )
37
+ end
38
+ def to_hash
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,63 @@
1
+ # typed: strong
2
+
3
+ module Telnyx
4
+ module Models
5
+ class CallControlRetrievalTool < Telnyx::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Telnyx::CallControlRetrievalTool, Telnyx::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(Telnyx::CallControlBucketIDs) }
12
+ attr_reader :retrieval
13
+
14
+ sig { params(retrieval: Telnyx::CallControlBucketIDs::OrHash).void }
15
+ attr_writer :retrieval
16
+
17
+ sig { returns(Telnyx::CallControlRetrievalTool::Type::OrSymbol) }
18
+ attr_accessor :type
19
+
20
+ sig do
21
+ params(
22
+ retrieval: Telnyx::CallControlBucketIDs::OrHash,
23
+ type: Telnyx::CallControlRetrievalTool::Type::OrSymbol
24
+ ).returns(T.attached_class)
25
+ end
26
+ def self.new(retrieval:, type:)
27
+ end
28
+
29
+ sig do
30
+ override.returns(
31
+ {
32
+ retrieval: Telnyx::CallControlBucketIDs,
33
+ type: Telnyx::CallControlRetrievalTool::Type::OrSymbol
34
+ }
35
+ )
36
+ end
37
+ def to_hash
38
+ end
39
+
40
+ module Type
41
+ extend Telnyx::Internal::Type::Enum
42
+
43
+ TaggedSymbol =
44
+ T.type_alias { T.all(Symbol, Telnyx::CallControlRetrievalTool::Type) }
45
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
46
+
47
+ RETRIEVAL =
48
+ T.let(
49
+ :retrieval,
50
+ Telnyx::CallControlRetrievalTool::Type::TaggedSymbol
51
+ )
52
+
53
+ sig do
54
+ override.returns(
55
+ T::Array[Telnyx::CallControlRetrievalTool::Type::TaggedSymbol]
56
+ )
57
+ end
58
+ def self.values
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -75,6 +75,15 @@ module Telnyx
75
75
  end
76
76
  attr_writer :answering_machine_detection_config
77
77
 
78
+ # AI Assistant configuration. All fields except `id` are optional — the
79
+ # assistant's stored configuration will be used as fallback for any omitted
80
+ # fields.
81
+ sig { returns(T.nilable(Telnyx::CallAssistantRequest)) }
82
+ attr_reader :assistant
83
+
84
+ sig { params(assistant: Telnyx::CallAssistantRequest::OrHash).void }
85
+ attr_writer :assistant
86
+
78
87
  # The URL of a file to be played back to the callee when the call is answered. The
79
88
  # URL can point to either a WAV or MP3 file. media_name and audio_url cannot be
80
89
  # used together in one request.
@@ -562,6 +571,7 @@ module Telnyx
562
571
  Telnyx::CallDialParams::AnsweringMachineDetection::OrSymbol,
563
572
  answering_machine_detection_config:
564
573
  Telnyx::CallDialParams::AnsweringMachineDetectionConfig::OrHash,
574
+ assistant: Telnyx::CallAssistantRequest::OrHash,
565
575
  audio_url: String,
566
576
  billing_group_id: String,
567
577
  bridge_intent: T::Boolean,
@@ -652,6 +662,10 @@ module Telnyx
652
662
  # Optional configuration parameters to modify 'answering_machine_detection'
653
663
  # performance.
654
664
  answering_machine_detection_config: nil,
665
+ # AI Assistant configuration. All fields except `id` are optional — the
666
+ # assistant's stored configuration will be used as fallback for any omitted
667
+ # fields.
668
+ assistant: nil,
655
669
  # The URL of a file to be played back to the callee when the call is answered. The
656
670
  # URL can point to either a WAV or MP3 file. media_name and audio_url cannot be
657
671
  # used together in one request.
@@ -815,6 +829,7 @@ module Telnyx
815
829
  Telnyx::CallDialParams::AnsweringMachineDetection::OrSymbol,
816
830
  answering_machine_detection_config:
817
831
  Telnyx::CallDialParams::AnsweringMachineDetectionConfig,
832
+ assistant: Telnyx::CallAssistantRequest,
818
833
  audio_url: String,
819
834
  billing_group_id: String,
820
835
  bridge_intent: T::Boolean,
@@ -15,6 +15,15 @@ module Telnyx
15
15
  sig { returns(String) }
16
16
  attr_accessor :call_control_id
17
17
 
18
+ # AI Assistant configuration. All fields except `id` are optional — the
19
+ # assistant's stored configuration will be used as fallback for any omitted
20
+ # fields.
21
+ sig { returns(T.nilable(Telnyx::CallAssistantRequest)) }
22
+ attr_reader :assistant
23
+
24
+ sig { params(assistant: Telnyx::CallAssistantRequest::OrHash).void }
25
+ attr_writer :assistant
26
+
18
27
  # Use this field to set the Billing Group ID for the call. Must be a valid and
19
28
  # existing Billing Group ID.
20
29
  sig { returns(T.nilable(String)) }
@@ -372,6 +381,7 @@ module Telnyx
372
381
  sig do
373
382
  params(
374
383
  call_control_id: String,
384
+ assistant: Telnyx::CallAssistantRequest::OrHash,
375
385
  billing_group_id: String,
376
386
  client_state: String,
377
387
  command_id: String,
@@ -422,6 +432,10 @@ module Telnyx
422
432
  end
423
433
  def self.new(
424
434
  call_control_id:,
435
+ # AI Assistant configuration. All fields except `id` are optional — the
436
+ # assistant's stored configuration will be used as fallback for any omitted
437
+ # fields.
438
+ assistant: nil,
425
439
  # Use this field to set the Billing Group ID for the call. Must be a valid and
426
440
  # existing Billing Group ID.
427
441
  billing_group_id: nil,
@@ -510,6 +524,7 @@ module Telnyx
510
524
  override.returns(
511
525
  {
512
526
  call_control_id: String,
527
+ assistant: Telnyx::CallAssistantRequest,
513
528
  billing_group_id: String,
514
529
  client_state: String,
515
530
  command_id: String,
@@ -18,20 +18,13 @@ module Telnyx
18
18
  sig { returns(String) }
19
19
  attr_accessor :call_control_id
20
20
 
21
- # AI Assistant configuration
22
- sig do
23
- returns(
24
- T.nilable(Telnyx::Calls::ActionStartAIAssistantParams::Assistant)
25
- )
26
- end
21
+ # AI Assistant configuration. All fields except `id` are optional — the
22
+ # assistant's stored configuration will be used as fallback for any omitted
23
+ # fields.
24
+ sig { returns(T.nilable(Telnyx::CallAssistantRequest)) }
27
25
  attr_reader :assistant
28
26
 
29
- sig do
30
- params(
31
- assistant:
32
- Telnyx::Calls::ActionStartAIAssistantParams::Assistant::OrHash
33
- ).void
34
- end
27
+ sig { params(assistant: Telnyx::CallAssistantRequest::OrHash).void }
35
28
  attr_writer :assistant
36
29
 
37
30
  # Use this field to add state to every subsequent webhook. It must be a valid
@@ -210,8 +203,7 @@ module Telnyx
210
203
  sig do
211
204
  params(
212
205
  call_control_id: String,
213
- assistant:
214
- Telnyx::Calls::ActionStartAIAssistantParams::Assistant::OrHash,
206
+ assistant: Telnyx::CallAssistantRequest::OrHash,
215
207
  client_state: String,
216
208
  command_id: String,
217
209
  greeting: String,
@@ -247,7 +239,9 @@ module Telnyx
247
239
  end
248
240
  def self.new(
249
241
  call_control_id:,
250
- # AI Assistant configuration
242
+ # AI Assistant configuration. All fields except `id` are optional — the
243
+ # assistant's stored configuration will be used as fallback for any omitted
244
+ # fields.
251
245
  assistant: nil,
252
246
  # Use this field to add state to every subsequent webhook. It must be a valid
253
247
  # Base-64 encoded string.
@@ -309,7 +303,7 @@ module Telnyx
309
303
  override.returns(
310
304
  {
311
305
  call_control_id: String,
312
- assistant: Telnyx::Calls::ActionStartAIAssistantParams::Assistant,
306
+ assistant: Telnyx::CallAssistantRequest,
313
307
  client_state: String,
314
308
  command_id: String,
315
309
  greeting: String,
@@ -347,67 +341,6 @@ module Telnyx
347
341
  def to_hash
348
342
  end
349
343
 
350
- class Assistant < Telnyx::Internal::Type::BaseModel
351
- OrHash =
352
- T.type_alias do
353
- T.any(
354
- Telnyx::Calls::ActionStartAIAssistantParams::Assistant,
355
- Telnyx::Internal::AnyHash
356
- )
357
- end
358
-
359
- # The identifier of the AI assistant to use
360
- sig { returns(T.nilable(String)) }
361
- attr_reader :id
362
-
363
- sig { params(id: String).void }
364
- attr_writer :id
365
-
366
- # The system instructions that the voice assistant uses during the start assistant
367
- # command. This will overwrite the instructions set in the assistant
368
- # configuration.
369
- sig { returns(T.nilable(String)) }
370
- attr_reader :instructions
371
-
372
- sig { params(instructions: String).void }
373
- attr_writer :instructions
374
-
375
- # Reference to the OpenAI API key. Required only when using OpenAI models
376
- sig { returns(T.nilable(String)) }
377
- attr_reader :openai_api_key_ref
378
-
379
- sig { params(openai_api_key_ref: String).void }
380
- attr_writer :openai_api_key_ref
381
-
382
- # AI Assistant configuration
383
- sig do
384
- params(
385
- id: String,
386
- instructions: String,
387
- openai_api_key_ref: String
388
- ).returns(T.attached_class)
389
- end
390
- def self.new(
391
- # The identifier of the AI assistant to use
392
- id: nil,
393
- # The system instructions that the voice assistant uses during the start assistant
394
- # command. This will overwrite the instructions set in the assistant
395
- # configuration.
396
- instructions: nil,
397
- # Reference to the OpenAI API key. Required only when using OpenAI models
398
- openai_api_key_ref: nil
399
- )
400
- end
401
-
402
- sig do
403
- override.returns(
404
- { id: String, instructions: String, openai_api_key_ref: String }
405
- )
406
- end
407
- def to_hash
408
- end
409
- end
410
-
411
344
  # Messages sent by an end user
412
345
  module MessageHistory
413
346
  extend Telnyx::Internal::Type::Union
@@ -0,0 +1,67 @@
1
+ # typed: strong
2
+
3
+ module Telnyx
4
+ module Models
5
+ class CheckAvailabilityTool < Telnyx::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Telnyx::CheckAvailabilityTool, Telnyx::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(Telnyx::CheckAvailabilityToolParams) }
12
+ attr_reader :check_availability
13
+
14
+ sig do
15
+ params(
16
+ check_availability: Telnyx::CheckAvailabilityToolParams::OrHash
17
+ ).void
18
+ end
19
+ attr_writer :check_availability
20
+
21
+ sig { returns(Telnyx::CheckAvailabilityTool::Type::OrSymbol) }
22
+ attr_accessor :type
23
+
24
+ sig do
25
+ params(
26
+ check_availability: Telnyx::CheckAvailabilityToolParams::OrHash,
27
+ type: Telnyx::CheckAvailabilityTool::Type::OrSymbol
28
+ ).returns(T.attached_class)
29
+ end
30
+ def self.new(check_availability:, type:)
31
+ end
32
+
33
+ sig do
34
+ override.returns(
35
+ {
36
+ check_availability: Telnyx::CheckAvailabilityToolParams,
37
+ type: Telnyx::CheckAvailabilityTool::Type::OrSymbol
38
+ }
39
+ )
40
+ end
41
+ def to_hash
42
+ end
43
+
44
+ module Type
45
+ extend Telnyx::Internal::Type::Enum
46
+
47
+ TaggedSymbol =
48
+ T.type_alias { T.all(Symbol, Telnyx::CheckAvailabilityTool::Type) }
49
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
50
+
51
+ CHECK_AVAILABILITY =
52
+ T.let(
53
+ :check_availability,
54
+ Telnyx::CheckAvailabilityTool::Type::TaggedSymbol
55
+ )
56
+
57
+ sig do
58
+ override.returns(
59
+ T::Array[Telnyx::CheckAvailabilityTool::Type::TaggedSymbol]
60
+ )
61
+ end
62
+ def self.values
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end