telnyx 5.91.0 → 5.93.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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/models/ai/assistant_create_params.rb +480 -34
  5. data/lib/telnyx/models/ai/assistant_update_params.rb +481 -27
  6. data/lib/telnyx/models/ai/assistants/update_assistant.rb +487 -27
  7. data/lib/telnyx/models/ai/inference_embedding.rb +505 -26
  8. data/lib/telnyx/models/calls/transcription_start_request.rb +171 -3
  9. data/lib/telnyx/resources/ai/assistants/versions.rb +21 -9
  10. data/lib/telnyx/resources/ai/assistants.rb +41 -19
  11. data/lib/telnyx/resources/calls/actions.rb +1 -1
  12. data/lib/telnyx/version.rb +1 -1
  13. data/lib/telnyx.rb +0 -6
  14. data/rbi/telnyx/models/ai/assistant_create_params.rbi +945 -44
  15. data/rbi/telnyx/models/ai/assistant_update_params.rbi +945 -36
  16. data/rbi/telnyx/models/ai/assistants/update_assistant.rbi +967 -36
  17. data/rbi/telnyx/models/ai/inference_embedding.rbi +972 -36
  18. data/rbi/telnyx/models/calls/transcription_start_request.rbi +490 -0
  19. data/rbi/telnyx/resources/ai/assistants/versions.rbi +66 -16
  20. data/rbi/telnyx/resources/ai/assistants.rbi +122 -33
  21. data/rbi/telnyx/resources/calls/actions.rbi +2 -0
  22. data/sig/telnyx/models/ai/assistant_create_params.rbs +377 -23
  23. data/sig/telnyx/models/ai/assistant_update_params.rbs +377 -18
  24. data/sig/telnyx/models/ai/assistants/update_assistant.rbs +380 -18
  25. data/sig/telnyx/models/ai/inference_embedding.rbs +399 -17
  26. data/sig/telnyx/models/calls/transcription_start_request.rbs +187 -1
  27. data/sig/telnyx/resources/ai/assistants/versions.rbs +9 -3
  28. data/sig/telnyx/resources/ai/assistants.rbs +18 -7
  29. metadata +1 -19
  30. data/lib/telnyx/models/ai/external_llm.rb +0 -87
  31. data/lib/telnyx/models/ai/external_llm_req.rb +0 -87
  32. data/lib/telnyx/models/ai/fallback_config.rb +0 -37
  33. data/lib/telnyx/models/ai/fallback_config_req.rb +0 -37
  34. data/lib/telnyx/models/ai/post_conversation_settings.rb +0 -30
  35. data/lib/telnyx/models/ai/post_conversation_settings_req.rb +0 -30
  36. data/rbi/telnyx/models/ai/external_llm.rbi +0 -157
  37. data/rbi/telnyx/models/ai/external_llm_req.rbi +0 -157
  38. data/rbi/telnyx/models/ai/fallback_config.rbi +0 -64
  39. data/rbi/telnyx/models/ai/fallback_config_req.rbi +0 -64
  40. data/rbi/telnyx/models/ai/post_conversation_settings.rbi +0 -45
  41. data/rbi/telnyx/models/ai/post_conversation_settings_req.rbi +0 -45
  42. data/sig/telnyx/models/ai/external_llm.rbs +0 -75
  43. data/sig/telnyx/models/ai/external_llm_req.rbs +0 -75
  44. data/sig/telnyx/models/ai/fallback_config.rbs +0 -38
  45. data/sig/telnyx/models/ai/fallback_config_req.rbs +0 -40
  46. data/sig/telnyx/models/ai/post_conversation_settings.rbs +0 -17
  47. data/sig/telnyx/models/ai/post_conversation_settings_req.rbs +0 -17
@@ -16,11 +16,24 @@ module Telnyx
16
16
  # @return [Hash{Symbol=>Object}, nil]
17
17
  optional :dynamic_variables, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]
18
18
 
19
+ # @!attribute dynamic_variables_webhook_timeout_ms
20
+ # Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
21
+ # 10000 ms. If the webhook does not respond within this timeout, the call proceeds
22
+ # with default values. See the
23
+ # [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :dynamic_variables_webhook_timeout_ms, Integer
27
+
19
28
  # @!attribute dynamic_variables_webhook_url
20
- # If the dynamic_variables_webhook_url is set for the assistant, we will send a
21
- # request at the start of the conversation. See our
22
- # [guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
23
- # for more information.
29
+ # If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
30
+ # URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
31
+ # the webhook response must wrap variables under a top-level `dynamic_variables`
32
+ # object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
33
+ # flat object will be ignored and variables will fall back to their defaults. See
34
+ # the
35
+ # [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
36
+ # for the full request/response format and timeout behavior.
24
37
  #
25
38
  # @return [String, nil]
26
39
  optional :dynamic_variables_webhook_url, String
@@ -32,13 +45,13 @@ module Telnyx
32
45
 
33
46
  # @!attribute external_llm
34
47
  #
35
- # @return [Telnyx::Models::AI::ExternalLlmReq, nil]
36
- optional :external_llm, -> { Telnyx::AI::ExternalLlmReq }
48
+ # @return [Telnyx::Models::AI::Assistants::UpdateAssistant::ExternalLlm, nil]
49
+ optional :external_llm, -> { Telnyx::AI::Assistants::UpdateAssistant::ExternalLlm }
37
50
 
38
51
  # @!attribute fallback_config
39
52
  #
40
- # @return [Telnyx::Models::AI::FallbackConfigReq, nil]
41
- optional :fallback_config, -> { Telnyx::AI::FallbackConfigReq }
53
+ # @return [Telnyx::Models::AI::Assistants::UpdateAssistant::FallbackConfig, nil]
54
+ optional :fallback_config, -> { Telnyx::AI::Assistants::UpdateAssistant::FallbackConfig }
42
55
 
43
56
  # @!attribute greeting
44
57
  # Text that the assistant will use to start the conversation. This may be
@@ -63,25 +76,57 @@ module Telnyx
63
76
  # @return [String, nil]
64
77
  optional :instructions, String
65
78
 
79
+ # @!attribute integrations
80
+ # Connected integrations attached to the assistant. The catalog of available
81
+ # integrations is at `/ai/integrations`; the user's connected integrations are at
82
+ # `/ai/integrations/connections`. Each item references a catalog integration by
83
+ # `integration_id`.
84
+ #
85
+ # @return [Array<Telnyx::Models::AI::Assistants::UpdateAssistant::Integration>, nil]
86
+ optional :integrations,
87
+ -> { Telnyx::Internal::Type::ArrayOf[Telnyx::AI::Assistants::UpdateAssistant::Integration] }
88
+
89
+ # @!attribute interruption_settings
90
+ # Settings for interruptions and how the assistant decides the user has finished
91
+ # speaking. These timings are most relevant when using non turn-taking
92
+ # transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
93
+ # behavior is controlled by the transcription end-of-turn settings under
94
+ # `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
95
+ # `eager_eot_threshold`).
96
+ #
97
+ # @return [Telnyx::Models::AI::Assistants::UpdateAssistant::InterruptionSettings, nil]
98
+ optional :interruption_settings, -> { Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings }
99
+
66
100
  # @!attribute llm_api_key_ref
67
- # This is only needed when using third-party inference providers. The `identifier`
68
- # for an integration secret
101
+ # This is only needed when using third-party inference providers selected by
102
+ # `model`. The `identifier` for an integration secret
69
103
  # [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
70
- # that refers to your LLM provider's API key. Warning: Free plans are unlikely to
71
- # work with this integration.
104
+ # that refers to your LLM provider's API key. For bring-your-own endpoint
105
+ # authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
106
+ # are unlikely to work with this integration.
72
107
  #
73
108
  # @return [String, nil]
74
109
  optional :llm_api_key_ref, String
75
110
 
111
+ # @!attribute mcp_servers
112
+ # MCP servers attached to the assistant. Create MCP servers with
113
+ # `/ai/mcp_servers`, then reference them by `id` here.
114
+ #
115
+ # @return [Array<Telnyx::Models::AI::Assistants::UpdateAssistant::McpServer>, nil]
116
+ optional :mcp_servers,
117
+ -> { Telnyx::Internal::Type::ArrayOf[Telnyx::AI::Assistants::UpdateAssistant::McpServer] }
118
+
76
119
  # @!attribute messaging_settings
77
120
  #
78
121
  # @return [Telnyx::Models::AI::MessagingSettings, nil]
79
122
  optional :messaging_settings, -> { Telnyx::AI::MessagingSettings }
80
123
 
81
124
  # @!attribute model
82
- # ID of the model to use. You can use the
125
+ # ID of the model to use when `external_llm` is not set. You can use the
83
126
  # [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
84
- # to see all of your available models,
127
+ # to see available models. If `external_llm` is provided, the assistant uses
128
+ # `external_llm` instead of this field. If neither `model` nor `external_llm` is
129
+ # provided, Telnyx applies the default model.
85
130
  #
86
131
  # @return [String, nil]
87
132
  optional :model, String
@@ -104,27 +149,38 @@ module Telnyx
104
149
  # Telephony-control tools (e.g. hangup, transfer) are unavailable
105
150
  # post-conversation. Beta feature.
106
151
  #
107
- # @return [Telnyx::Models::AI::PostConversationSettingsReq, nil]
108
- optional :post_conversation_settings, -> { Telnyx::AI::PostConversationSettingsReq }
152
+ # @return [Telnyx::Models::AI::Assistants::UpdateAssistant::PostConversationSettings, nil]
153
+ optional :post_conversation_settings,
154
+ -> { Telnyx::AI::Assistants::UpdateAssistant::PostConversationSettings }
109
155
 
110
156
  # @!attribute privacy_settings
111
157
  #
112
158
  # @return [Telnyx::Models::AI::PrivacySettings, nil]
113
159
  optional :privacy_settings, -> { Telnyx::AI::PrivacySettings }
114
160
 
161
+ # @!attribute tags
162
+ # Tags associated with the assistant. Tags can also be managed with the assistant
163
+ # tag endpoints.
164
+ #
165
+ # @return [Array<String>, nil]
166
+ optional :tags, Telnyx::Internal::Type::ArrayOf[String]
167
+
115
168
  # @!attribute telephony_settings
116
169
  #
117
170
  # @return [Telnyx::Models::AI::TelephonySettings, nil]
118
171
  optional :telephony_settings, -> { Telnyx::AI::TelephonySettings }
119
172
 
120
173
  # @!attribute tool_ids
174
+ # IDs of shared tools to attach to the assistant. New integrations should prefer
175
+ # `tool_ids` over inline `tools`.
121
176
  #
122
177
  # @return [Array<String>, nil]
123
178
  optional :tool_ids, Telnyx::Internal::Type::ArrayOf[String]
124
179
 
125
180
  # @!attribute tools
126
- # The tools that the assistant can use. These may be templated with
127
- # [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
181
+ # Deprecated for new integrations. Inline tool definitions available to the
182
+ # assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
183
+ # endpoints.
128
184
  #
129
185
  # @return [Array<Telnyx::Models::AI::InferenceEmbeddingWebhookToolParams, Telnyx::Models::AI::RetrievalTool, Telnyx::Models::AI::AssistantTool::Handoff, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::AssistantTool::Transfer, Telnyx::Models::AI::AssistantTool::Invite, Telnyx::Models::AI::AssistantTool::Refer, Telnyx::Models::AI::AssistantTool::SendDtmf, Telnyx::Models::AI::AssistantTool::SendMessage, Telnyx::Models::AI::AssistantTool::SkipTurn>, nil]
130
186
  optional :tools, -> { Telnyx::Internal::Type::ArrayOf[union: Telnyx::AI::AssistantTool] }
@@ -134,6 +190,12 @@ module Telnyx
134
190
  # @return [Telnyx::Models::AI::TranscriptionSettings, nil]
135
191
  optional :transcription, -> { Telnyx::AI::TranscriptionSettings }
136
192
 
193
+ # @!attribute version_name
194
+ # Human-readable name for the assistant version.
195
+ #
196
+ # @return [String, nil]
197
+ optional :version_name, String
198
+
137
199
  # @!attribute voice_settings
138
200
  #
139
201
  # @return [Telnyx::Models::AI::VoiceSettings, nil]
@@ -145,7 +207,7 @@ module Telnyx
145
207
  # @return [Telnyx::Models::AI::WidgetSettings, nil]
146
208
  optional :widget_settings, -> { Telnyx::AI::WidgetSettings }
147
209
 
148
- # @!method initialize(description: nil, dynamic_variables: nil, dynamic_variables_webhook_url: nil, enabled_features: nil, external_llm: nil, fallback_config: nil, greeting: nil, insight_settings: nil, instructions: nil, llm_api_key_ref: nil, messaging_settings: nil, model: nil, name: nil, observability_settings: nil, post_conversation_settings: nil, privacy_settings: nil, telephony_settings: nil, tool_ids: nil, tools: nil, transcription: nil, voice_settings: nil, widget_settings: nil)
210
+ # @!method initialize(description: nil, dynamic_variables: nil, dynamic_variables_webhook_timeout_ms: nil, dynamic_variables_webhook_url: nil, enabled_features: nil, external_llm: nil, fallback_config: nil, greeting: nil, insight_settings: nil, instructions: nil, integrations: nil, interruption_settings: nil, llm_api_key_ref: nil, mcp_servers: nil, messaging_settings: nil, model: nil, name: nil, observability_settings: nil, post_conversation_settings: nil, privacy_settings: nil, tags: nil, telephony_settings: nil, tool_ids: nil, tools: nil, transcription: nil, version_name: nil, voice_settings: nil, widget_settings: nil)
149
211
  # Some parameter documentations has been truncated, see
150
212
  # {Telnyx::Models::AI::Assistants::UpdateAssistant} for more details.
151
213
  #
@@ -153,13 +215,15 @@ module Telnyx
153
215
  #
154
216
  # @param dynamic_variables [Hash{Symbol=>Object}] Map of dynamic variables and their default values
155
217
  #
156
- # @param dynamic_variables_webhook_url [String] If the dynamic_variables_webhook_url is set for the assistant, we will send a re
218
+ # @param dynamic_variables_webhook_timeout_ms [Integer] Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
219
+ #
220
+ # @param dynamic_variables_webhook_url [String] If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this U
157
221
  #
158
222
  # @param enabled_features [Array<Symbol, Telnyx::Models::AI::EnabledFeatures>]
159
223
  #
160
- # @param external_llm [Telnyx::Models::AI::ExternalLlmReq]
224
+ # @param external_llm [Telnyx::Models::AI::Assistants::UpdateAssistant::ExternalLlm]
161
225
  #
162
- # @param fallback_config [Telnyx::Models::AI::FallbackConfigReq]
226
+ # @param fallback_config [Telnyx::Models::AI::Assistants::UpdateAssistant::FallbackConfig]
163
227
  #
164
228
  # @param greeting [String] Text that the assistant will use to start the conversation. This may be template
165
229
  #
@@ -167,31 +231,427 @@ module Telnyx
167
231
  #
168
232
  # @param instructions [String] System instructions for the assistant. These may be templated with [dynamic vari
169
233
  #
170
- # @param llm_api_key_ref [String] This is only needed when using third-party inference providers. The `identifier`
234
+ # @param integrations [Array<Telnyx::Models::AI::Assistants::UpdateAssistant::Integration>] Connected integrations attached to the assistant. The catalog of available integ
235
+ #
236
+ # @param interruption_settings [Telnyx::Models::AI::Assistants::UpdateAssistant::InterruptionSettings] Settings for interruptions and how the assistant decides the user has finished s
237
+ #
238
+ # @param llm_api_key_ref [String] This is only needed when using third-party inference providers selected by `mode
239
+ #
240
+ # @param mcp_servers [Array<Telnyx::Models::AI::Assistants::UpdateAssistant::McpServer>] MCP servers attached to the assistant. Create MCP servers with `/ai/mcp_servers`
171
241
  #
172
242
  # @param messaging_settings [Telnyx::Models::AI::MessagingSettings]
173
243
  #
174
- # @param model [String] ID of the model to use. You can use the [Get models API](https://developers.teln
244
+ # @param model [String] ID of the model to use when `external_llm` is not set. You can use the [Get mode
175
245
  #
176
246
  # @param name [String]
177
247
  #
178
248
  # @param observability_settings [Telnyx::Models::AI::ObservabilityReq]
179
249
  #
180
- # @param post_conversation_settings [Telnyx::Models::AI::PostConversationSettingsReq] Configuration for post-conversation processing. When enabled, the assistant rece
250
+ # @param post_conversation_settings [Telnyx::Models::AI::Assistants::UpdateAssistant::PostConversationSettings] Configuration for post-conversation processing. When enabled, the assistant rece
181
251
  #
182
252
  # @param privacy_settings [Telnyx::Models::AI::PrivacySettings]
183
253
  #
254
+ # @param tags [Array<String>] Tags associated with the assistant. Tags can also be managed with the assistant
255
+ #
184
256
  # @param telephony_settings [Telnyx::Models::AI::TelephonySettings]
185
257
  #
186
- # @param tool_ids [Array<String>]
258
+ # @param tool_ids [Array<String>] IDs of shared tools to attach to the assistant. New integrations should prefer `
187
259
  #
188
- # @param tools [Array<Telnyx::Models::AI::InferenceEmbeddingWebhookToolParams, Telnyx::Models::AI::RetrievalTool, Telnyx::Models::AI::AssistantTool::Handoff, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::AssistantTool::Transfer, Telnyx::Models::AI::AssistantTool::Invite, Telnyx::Models::AI::AssistantTool::Refer, Telnyx::Models::AI::AssistantTool::SendDtmf, Telnyx::Models::AI::AssistantTool::SendMessage, Telnyx::Models::AI::AssistantTool::SkipTurn>] The tools that the assistant can use. These may be templated with [dynamic varia
260
+ # @param tools [Array<Telnyx::Models::AI::InferenceEmbeddingWebhookToolParams, Telnyx::Models::AI::RetrievalTool, Telnyx::Models::AI::AssistantTool::Handoff, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::AssistantTool::Transfer, Telnyx::Models::AI::AssistantTool::Invite, Telnyx::Models::AI::AssistantTool::Refer, Telnyx::Models::AI::AssistantTool::SendDtmf, Telnyx::Models::AI::AssistantTool::SendMessage, Telnyx::Models::AI::AssistantTool::SkipTurn>] Deprecated for new integrations. Inline tool definitions available to the assist
189
261
  #
190
262
  # @param transcription [Telnyx::Models::AI::TranscriptionSettings]
191
263
  #
264
+ # @param version_name [String] Human-readable name for the assistant version.
265
+ #
192
266
  # @param voice_settings [Telnyx::Models::AI::VoiceSettings]
193
267
  #
194
268
  # @param widget_settings [Telnyx::Models::AI::WidgetSettings] Configuration settings for the assistant's web widget.
269
+
270
+ # @see Telnyx::Models::AI::Assistants::UpdateAssistant#external_llm
271
+ class ExternalLlm < Telnyx::Internal::Type::BaseModel
272
+ # @!attribute base_url
273
+ # Base URL for the external LLM endpoint.
274
+ #
275
+ # @return [String]
276
+ required :base_url, String
277
+
278
+ # @!attribute model
279
+ # Model identifier to use with the external LLM endpoint.
280
+ #
281
+ # @return [String]
282
+ required :model, String
283
+
284
+ # @!attribute authentication_method
285
+ # Authentication method used when connecting to the external LLM endpoint.
286
+ #
287
+ # @return [Symbol, Telnyx::Models::AI::Assistants::UpdateAssistant::ExternalLlm::AuthenticationMethod, nil]
288
+ optional :authentication_method,
289
+ enum: -> { Telnyx::AI::Assistants::UpdateAssistant::ExternalLlm::AuthenticationMethod }
290
+
291
+ # @!attribute certificate_ref
292
+ # Integration secret identifier for the client certificate used with certificate
293
+ # authentication.
294
+ #
295
+ # @return [String, nil]
296
+ optional :certificate_ref, String
297
+
298
+ # @!attribute forward_metadata
299
+ # When `true`, Telnyx forwards the assistant's dynamic variables to the external
300
+ # LLM endpoint as a top-level `extra_metadata` object on the chat completion
301
+ # request body. Defaults to `false`. Example payload sent to the external
302
+ # endpoint:
303
+ # `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
304
+ # Distinct from OpenAI's native `metadata` field, which has its own size and type
305
+ # limits.
306
+ #
307
+ # @return [Boolean, nil]
308
+ optional :forward_metadata, Telnyx::Internal::Type::Boolean
309
+
310
+ # @!attribute llm_api_key_ref
311
+ # Integration secret identifier for the external LLM API key.
312
+ #
313
+ # @return [String, nil]
314
+ optional :llm_api_key_ref, String
315
+
316
+ # @!attribute token_retrieval_url
317
+ # URL used to retrieve an access token when certificate authentication is enabled.
318
+ #
319
+ # @return [String, nil]
320
+ optional :token_retrieval_url, String
321
+
322
+ # @!method initialize(base_url:, model:, authentication_method: nil, certificate_ref: nil, forward_metadata: nil, llm_api_key_ref: nil, token_retrieval_url: nil)
323
+ # Some parameter documentations has been truncated, see
324
+ # {Telnyx::Models::AI::Assistants::UpdateAssistant::ExternalLlm} for more details.
325
+ #
326
+ # @param base_url [String] Base URL for the external LLM endpoint.
327
+ #
328
+ # @param model [String] Model identifier to use with the external LLM endpoint.
329
+ #
330
+ # @param authentication_method [Symbol, Telnyx::Models::AI::Assistants::UpdateAssistant::ExternalLlm::AuthenticationMethod] Authentication method used when connecting to the external LLM endpoint.
331
+ #
332
+ # @param certificate_ref [String] Integration secret identifier for the client certificate used with certificate a
333
+ #
334
+ # @param forward_metadata [Boolean] When `true`, Telnyx forwards the assistant's dynamic variables to the external L
335
+ #
336
+ # @param llm_api_key_ref [String] Integration secret identifier for the external LLM API key.
337
+ #
338
+ # @param token_retrieval_url [String] URL used to retrieve an access token when certificate authentication is enabled.
339
+
340
+ # Authentication method used when connecting to the external LLM endpoint.
341
+ #
342
+ # @see Telnyx::Models::AI::Assistants::UpdateAssistant::ExternalLlm#authentication_method
343
+ module AuthenticationMethod
344
+ extend Telnyx::Internal::Type::Enum
345
+
346
+ TOKEN = :token
347
+ CERTIFICATE = :certificate
348
+
349
+ # @!method self.values
350
+ # @return [Array<Symbol>]
351
+ end
352
+ end
353
+
354
+ # @see Telnyx::Models::AI::Assistants::UpdateAssistant#fallback_config
355
+ class FallbackConfig < Telnyx::Internal::Type::BaseModel
356
+ # @!attribute external_llm
357
+ #
358
+ # @return [Telnyx::Models::AI::Assistants::UpdateAssistant::FallbackConfig::ExternalLlm, nil]
359
+ optional :external_llm, -> { Telnyx::AI::Assistants::UpdateAssistant::FallbackConfig::ExternalLlm }
360
+
361
+ # @!attribute llm_api_key_ref
362
+ # Integration secret identifier for the fallback model API key.
363
+ #
364
+ # @return [String, nil]
365
+ optional :llm_api_key_ref, String
366
+
367
+ # @!attribute model
368
+ # Fallback Telnyx-hosted model to use when the primary LLM provider is
369
+ # unavailable.
370
+ #
371
+ # @return [String, nil]
372
+ optional :model, String
373
+
374
+ # @!method initialize(external_llm: nil, llm_api_key_ref: nil, model: nil)
375
+ # Some parameter documentations has been truncated, see
376
+ # {Telnyx::Models::AI::Assistants::UpdateAssistant::FallbackConfig} for more
377
+ # details.
378
+ #
379
+ # @param external_llm [Telnyx::Models::AI::Assistants::UpdateAssistant::FallbackConfig::ExternalLlm]
380
+ #
381
+ # @param llm_api_key_ref [String] Integration secret identifier for the fallback model API key.
382
+ #
383
+ # @param model [String] Fallback Telnyx-hosted model to use when the primary LLM provider is unavailable
384
+
385
+ # @see Telnyx::Models::AI::Assistants::UpdateAssistant::FallbackConfig#external_llm
386
+ class ExternalLlm < Telnyx::Internal::Type::BaseModel
387
+ # @!attribute base_url
388
+ # Base URL for the external LLM endpoint.
389
+ #
390
+ # @return [String]
391
+ required :base_url, String
392
+
393
+ # @!attribute model
394
+ # Model identifier to use with the external LLM endpoint.
395
+ #
396
+ # @return [String]
397
+ required :model, String
398
+
399
+ # @!attribute authentication_method
400
+ # Authentication method used when connecting to the external LLM endpoint.
401
+ #
402
+ # @return [Symbol, Telnyx::Models::AI::Assistants::UpdateAssistant::FallbackConfig::ExternalLlm::AuthenticationMethod, nil]
403
+ optional :authentication_method,
404
+ enum: -> { Telnyx::AI::Assistants::UpdateAssistant::FallbackConfig::ExternalLlm::AuthenticationMethod }
405
+
406
+ # @!attribute certificate_ref
407
+ # Integration secret identifier for the client certificate used with certificate
408
+ # authentication.
409
+ #
410
+ # @return [String, nil]
411
+ optional :certificate_ref, String
412
+
413
+ # @!attribute forward_metadata
414
+ # When `true`, Telnyx forwards the assistant's dynamic variables to the external
415
+ # LLM endpoint as a top-level `extra_metadata` object on the chat completion
416
+ # request body. Defaults to `false`. Example payload sent to the external
417
+ # endpoint:
418
+ # `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
419
+ # Distinct from OpenAI's native `metadata` field, which has its own size and type
420
+ # limits.
421
+ #
422
+ # @return [Boolean, nil]
423
+ optional :forward_metadata, Telnyx::Internal::Type::Boolean
424
+
425
+ # @!attribute llm_api_key_ref
426
+ # Integration secret identifier for the external LLM API key.
427
+ #
428
+ # @return [String, nil]
429
+ optional :llm_api_key_ref, String
430
+
431
+ # @!attribute token_retrieval_url
432
+ # URL used to retrieve an access token when certificate authentication is enabled.
433
+ #
434
+ # @return [String, nil]
435
+ optional :token_retrieval_url, String
436
+
437
+ # @!method initialize(base_url:, model:, authentication_method: nil, certificate_ref: nil, forward_metadata: nil, llm_api_key_ref: nil, token_retrieval_url: nil)
438
+ # Some parameter documentations has been truncated, see
439
+ # {Telnyx::Models::AI::Assistants::UpdateAssistant::FallbackConfig::ExternalLlm}
440
+ # for more details.
441
+ #
442
+ # @param base_url [String] Base URL for the external LLM endpoint.
443
+ #
444
+ # @param model [String] Model identifier to use with the external LLM endpoint.
445
+ #
446
+ # @param authentication_method [Symbol, Telnyx::Models::AI::Assistants::UpdateAssistant::FallbackConfig::ExternalLlm::AuthenticationMethod] Authentication method used when connecting to the external LLM endpoint.
447
+ #
448
+ # @param certificate_ref [String] Integration secret identifier for the client certificate used with certificate a
449
+ #
450
+ # @param forward_metadata [Boolean] When `true`, Telnyx forwards the assistant's dynamic variables to the external L
451
+ #
452
+ # @param llm_api_key_ref [String] Integration secret identifier for the external LLM API key.
453
+ #
454
+ # @param token_retrieval_url [String] URL used to retrieve an access token when certificate authentication is enabled.
455
+
456
+ # Authentication method used when connecting to the external LLM endpoint.
457
+ #
458
+ # @see Telnyx::Models::AI::Assistants::UpdateAssistant::FallbackConfig::ExternalLlm#authentication_method
459
+ module AuthenticationMethod
460
+ extend Telnyx::Internal::Type::Enum
461
+
462
+ TOKEN = :token
463
+ CERTIFICATE = :certificate
464
+
465
+ # @!method self.values
466
+ # @return [Array<Symbol>]
467
+ end
468
+ end
469
+ end
470
+
471
+ class Integration < Telnyx::Internal::Type::BaseModel
472
+ # @!attribute integration_id
473
+ # Catalog integration ID to attach. This is the `id` from the integrations catalog
474
+ # at `/ai/integrations` (the same value also appears as `integration_id` on
475
+ # entries returned by `/ai/integrations/connections`). It is **not** the
476
+ # connection-level `id` from `/ai/integrations/connections`.
477
+ #
478
+ # @return [String]
479
+ required :integration_id, String
480
+
481
+ # @!attribute allowed_list
482
+ # Optional per-assistant allowlist of integration tool names. When omitted or
483
+ # empty, all tools allowed by the connected integration are available to the
484
+ # assistant.
485
+ #
486
+ # @return [Array<String>, nil]
487
+ optional :allowed_list, Telnyx::Internal::Type::ArrayOf[String]
488
+
489
+ # @!method initialize(integration_id:, allowed_list: nil)
490
+ # Some parameter documentations has been truncated, see
491
+ # {Telnyx::Models::AI::Assistants::UpdateAssistant::Integration} for more details.
492
+ #
493
+ # Reference to a connected integration attached to an assistant. Discover
494
+ # available integrations with `/ai/integrations` and connected integrations with
495
+ # `/ai/integrations/connections`.
496
+ #
497
+ # @param integration_id [String] Catalog integration ID to attach. This is the `id` from the integrations catalog
498
+ #
499
+ # @param allowed_list [Array<String>] Optional per-assistant allowlist of integration tool names. When omitted or empt
500
+ end
501
+
502
+ # @see Telnyx::Models::AI::Assistants::UpdateAssistant#interruption_settings
503
+ class InterruptionSettings < Telnyx::Internal::Type::BaseModel
504
+ # @!attribute enable
505
+ # Whether users can interrupt the assistant while it is speaking.
506
+ #
507
+ # @return [Boolean, nil]
508
+ optional :enable, Telnyx::Internal::Type::Boolean
509
+
510
+ # @!attribute start_speaking_plan
511
+ # Controls when the assistant starts speaking after the user stops. These
512
+ # thresholds primarily apply to non turn-taking transcription models. For
513
+ # turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
514
+ # transcription end-of-turn settings under `transcription.settings` instead.
515
+ #
516
+ # @return [Telnyx::Models::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan, nil]
517
+ optional :start_speaking_plan,
518
+ -> { Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan }
519
+
520
+ # @!method initialize(enable: nil, start_speaking_plan: nil)
521
+ # Some parameter documentations has been truncated, see
522
+ # {Telnyx::Models::AI::Assistants::UpdateAssistant::InterruptionSettings} for more
523
+ # details.
524
+ #
525
+ # Settings for interruptions and how the assistant decides the user has finished
526
+ # speaking. These timings are most relevant when using non turn-taking
527
+ # transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
528
+ # behavior is controlled by the transcription end-of-turn settings under
529
+ # `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
530
+ # `eager_eot_threshold`).
531
+ #
532
+ # @param enable [Boolean] Whether users can interrupt the assistant while it is speaking.
533
+ #
534
+ # @param start_speaking_plan [Telnyx::Models::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan] Controls when the assistant starts speaking after the user stops. These threshol
535
+
536
+ # @see Telnyx::Models::AI::Assistants::UpdateAssistant::InterruptionSettings#start_speaking_plan
537
+ class StartSpeakingPlan < Telnyx::Internal::Type::BaseModel
538
+ # @!attribute transcription_endpointing_plan
539
+ # Endpointing thresholds used to decide when the user has finished speaking.
540
+ # Applies to non turn-taking transcription models. For `deepgram/flux`, use
541
+ # `transcription.settings.eot_threshold` / `eot_timeout_ms` /
542
+ # `eager_eot_threshold`.
543
+ #
544
+ # @return [Telnyx::Models::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan, nil]
545
+ optional :transcription_endpointing_plan,
546
+ -> { Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan }
547
+
548
+ # @!attribute wait_seconds
549
+ # Minimum seconds to wait before the assistant starts speaking.
550
+ #
551
+ # @return [Float, nil]
552
+ optional :wait_seconds, Float
553
+
554
+ # @!method initialize(transcription_endpointing_plan: nil, wait_seconds: nil)
555
+ # Some parameter documentations has been truncated, see
556
+ # {Telnyx::Models::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan}
557
+ # for more details.
558
+ #
559
+ # Controls when the assistant starts speaking after the user stops. These
560
+ # thresholds primarily apply to non turn-taking transcription models. For
561
+ # turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
562
+ # transcription end-of-turn settings under `transcription.settings` instead.
563
+ #
564
+ # @param transcription_endpointing_plan [Telnyx::Models::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan] Endpointing thresholds used to decide when the user has finished speaking. Appli
565
+ #
566
+ # @param wait_seconds [Float] Minimum seconds to wait before the assistant starts speaking.
567
+
568
+ # @see Telnyx::Models::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan#transcription_endpointing_plan
569
+ class TranscriptionEndpointingPlan < Telnyx::Internal::Type::BaseModel
570
+ # @!attribute on_no_punctuation_seconds
571
+ # Seconds to wait after the transcript ends without punctuation.
572
+ #
573
+ # @return [Float, nil]
574
+ optional :on_no_punctuation_seconds, Float
575
+
576
+ # @!attribute on_number_seconds
577
+ # Seconds to wait after the transcript ends with a number.
578
+ #
579
+ # @return [Float, nil]
580
+ optional :on_number_seconds, Float
581
+
582
+ # @!attribute on_punctuation_seconds
583
+ # Seconds to wait after the transcript ends with punctuation.
584
+ #
585
+ # @return [Float, nil]
586
+ optional :on_punctuation_seconds, Float
587
+
588
+ # @!method initialize(on_no_punctuation_seconds: nil, on_number_seconds: nil, on_punctuation_seconds: nil)
589
+ # Endpointing thresholds used to decide when the user has finished speaking.
590
+ # Applies to non turn-taking transcription models. For `deepgram/flux`, use
591
+ # `transcription.settings.eot_threshold` / `eot_timeout_ms` /
592
+ # `eager_eot_threshold`.
593
+ #
594
+ # @param on_no_punctuation_seconds [Float] Seconds to wait after the transcript ends without punctuation.
595
+ #
596
+ # @param on_number_seconds [Float] Seconds to wait after the transcript ends with a number.
597
+ #
598
+ # @param on_punctuation_seconds [Float] Seconds to wait after the transcript ends with punctuation.
599
+ end
600
+ end
601
+ end
602
+
603
+ class McpServer < Telnyx::Internal::Type::BaseModel
604
+ # @!attribute id
605
+ # ID of the MCP server to attach. This must be the `id` of an MCP server returned
606
+ # by the `/ai/mcp_servers` endpoints.
607
+ #
608
+ # @return [String]
609
+ required :id, String
610
+
611
+ # @!attribute allowed_tools
612
+ # Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
613
+ # uses the MCP server's configured `allowed_tools`.
614
+ #
615
+ # @return [Array<String>, nil]
616
+ optional :allowed_tools, Telnyx::Internal::Type::ArrayOf[String]
617
+
618
+ # @!method initialize(id:, allowed_tools: nil)
619
+ # Some parameter documentations has been truncated, see
620
+ # {Telnyx::Models::AI::Assistants::UpdateAssistant::McpServer} for more details.
621
+ #
622
+ # Reference to an MCP server attached to an assistant. Create and manage MCP
623
+ # servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
624
+ # ID.
625
+ #
626
+ # @param id [String] ID of the MCP server to attach. This must be the `id` of an MCP server returned
627
+ #
628
+ # @param allowed_tools [Array<String>] Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
629
+ end
630
+
631
+ # @see Telnyx::Models::AI::Assistants::UpdateAssistant#post_conversation_settings
632
+ class PostConversationSettings < Telnyx::Internal::Type::BaseModel
633
+ # @!attribute enabled
634
+ # Whether post-conversation processing is enabled. When true, the assistant will
635
+ # be invoked after the conversation ends to perform any final tool calls. Defaults
636
+ # to false.
637
+ #
638
+ # @return [Boolean, nil]
639
+ optional :enabled, Telnyx::Internal::Type::Boolean
640
+
641
+ # @!method initialize(enabled: nil)
642
+ # Some parameter documentations has been truncated, see
643
+ # {Telnyx::Models::AI::Assistants::UpdateAssistant::PostConversationSettings} for
644
+ # more details.
645
+ #
646
+ # Configuration for post-conversation processing. When enabled, the assistant
647
+ # receives one additional LLM turn after the conversation ends, allowing it to
648
+ # execute tool calls such as logging to a CRM or sending a summary. The assistant
649
+ # can execute multiple parallel or sequential tools during this phase.
650
+ # Telephony-control tools (e.g. hangup, transfer) are unavailable
651
+ # post-conversation. Beta feature.
652
+ #
653
+ # @param enabled [Boolean] Whether post-conversation processing is enabled. When true, the assistant will b
654
+ end
195
655
  end
196
656
  end
197
657