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
@@ -20,9 +20,11 @@ module Telnyx
20
20
  sig { returns(String) }
21
21
  attr_accessor :instructions
22
22
 
23
- # ID of the model to use. You can use the
23
+ # ID of the model to use when `external_llm` is not set. You can use the
24
24
  # [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
25
- # to see all of your available models,
25
+ # to see available models. If `external_llm` is provided, the assistant uses
26
+ # `external_llm` instead of this field. If neither `model` nor `external_llm` is
27
+ # provided, Telnyx applies the default model.
26
28
  sig { returns(String) }
27
29
  attr_accessor :model
28
30
 
@@ -42,10 +44,24 @@ module Telnyx
42
44
  sig { params(dynamic_variables: T::Hash[Symbol, T.anything]).void }
43
45
  attr_writer :dynamic_variables
44
46
 
45
- # If the dynamic_variables_webhook_url is set for the assistant, we will send a
46
- # request at the start of the conversation. See our
47
- # [guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
48
- # for more information.
47
+ # Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
48
+ # 10000 ms. If the webhook does not respond within this timeout, the call proceeds
49
+ # with default values. See the
50
+ # [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
51
+ sig { returns(T.nilable(Integer)) }
52
+ attr_reader :dynamic_variables_webhook_timeout_ms
53
+
54
+ sig { params(dynamic_variables_webhook_timeout_ms: Integer).void }
55
+ attr_writer :dynamic_variables_webhook_timeout_ms
56
+
57
+ # If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
58
+ # URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
59
+ # the webhook response must wrap variables under a top-level `dynamic_variables`
60
+ # object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
61
+ # flat object will be ignored and variables will fall back to their defaults. See
62
+ # the
63
+ # [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
64
+ # for the full request/response format and timeout behavior.
49
65
  sig { returns(T.nilable(String)) }
50
66
  attr_reader :dynamic_variables_webhook_url
51
67
 
@@ -66,16 +82,27 @@ module Telnyx
66
82
  end
67
83
  attr_writer :enabled_features
68
84
 
69
- sig { returns(T.nilable(Telnyx::AI::ExternalLlm)) }
85
+ sig { returns(T.nilable(Telnyx::AI::InferenceEmbedding::ExternalLlm)) }
70
86
  attr_reader :external_llm
71
87
 
72
- sig { params(external_llm: Telnyx::AI::ExternalLlm::OrHash).void }
88
+ sig do
89
+ params(
90
+ external_llm: Telnyx::AI::InferenceEmbedding::ExternalLlm::OrHash
91
+ ).void
92
+ end
73
93
  attr_writer :external_llm
74
94
 
75
- sig { returns(T.nilable(Telnyx::AI::FallbackConfig)) }
95
+ sig do
96
+ returns(T.nilable(Telnyx::AI::InferenceEmbedding::FallbackConfig))
97
+ end
76
98
  attr_reader :fallback_config
77
99
 
78
- sig { params(fallback_config: Telnyx::AI::FallbackConfig::OrHash).void }
100
+ sig do
101
+ params(
102
+ fallback_config:
103
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::OrHash
104
+ ).void
105
+ end
79
106
  attr_writer :fallback_config
80
107
 
81
108
  # Text that the assistant will use to start the conversation. This may be
@@ -104,17 +131,75 @@ module Telnyx
104
131
  end
105
132
  attr_writer :insight_settings
106
133
 
107
- # This is only needed when using third-party inference providers. The `identifier`
108
- # for an integration secret
134
+ # Connected integrations attached to the assistant. The catalog of available
135
+ # integrations is at `/ai/integrations`; the user's connected integrations are at
136
+ # `/ai/integrations/connections`. Each item references a catalog integration by
137
+ # `integration_id`.
138
+ sig do
139
+ returns(
140
+ T.nilable(T::Array[Telnyx::AI::InferenceEmbedding::Integration])
141
+ )
142
+ end
143
+ attr_reader :integrations
144
+
145
+ sig do
146
+ params(
147
+ integrations:
148
+ T::Array[Telnyx::AI::InferenceEmbedding::Integration::OrHash]
149
+ ).void
150
+ end
151
+ attr_writer :integrations
152
+
153
+ # Settings for interruptions and how the assistant decides the user has finished
154
+ # speaking. These timings are most relevant when using non turn-taking
155
+ # transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
156
+ # behavior is controlled by the transcription end-of-turn settings under
157
+ # `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
158
+ # `eager_eot_threshold`).
159
+ sig do
160
+ returns(
161
+ T.nilable(Telnyx::AI::InferenceEmbedding::InterruptionSettings)
162
+ )
163
+ end
164
+ attr_reader :interruption_settings
165
+
166
+ sig do
167
+ params(
168
+ interruption_settings:
169
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings::OrHash
170
+ ).void
171
+ end
172
+ attr_writer :interruption_settings
173
+
174
+ # This is only needed when using third-party inference providers selected by
175
+ # `model`. The `identifier` for an integration secret
109
176
  # [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
110
- # that refers to your LLM provider's API key. Warning: Free plans are unlikely to
111
- # work with this integration.
177
+ # that refers to your LLM provider's API key. For bring-your-own endpoint
178
+ # authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
179
+ # are unlikely to work with this integration.
112
180
  sig { returns(T.nilable(String)) }
113
181
  attr_reader :llm_api_key_ref
114
182
 
115
183
  sig { params(llm_api_key_ref: String).void }
116
184
  attr_writer :llm_api_key_ref
117
185
 
186
+ # MCP servers attached to the assistant. Create MCP servers with
187
+ # `/ai/mcp_servers`, then reference them by `id` here.
188
+ sig do
189
+ returns(
190
+ T.nilable(T::Array[Telnyx::AI::InferenceEmbedding::McpServer])
191
+ )
192
+ end
193
+ attr_reader :mcp_servers
194
+
195
+ sig do
196
+ params(
197
+ mcp_servers:
198
+ T::Array[Telnyx::AI::InferenceEmbedding::McpServer::OrHash]
199
+ ).void
200
+ end
201
+ attr_writer :mcp_servers
202
+
118
203
  sig { returns(T.nilable(Telnyx::AI::MessagingSettings)) }
119
204
  attr_reader :messaging_settings
120
205
 
@@ -137,13 +222,17 @@ module Telnyx
137
222
  # can execute multiple parallel or sequential tools during this phase.
138
223
  # Telephony-control tools (e.g. hangup, transfer) are unavailable
139
224
  # post-conversation. Beta feature.
140
- sig { returns(T.nilable(Telnyx::AI::PostConversationSettings)) }
225
+ sig do
226
+ returns(
227
+ T.nilable(Telnyx::AI::InferenceEmbedding::PostConversationSettings)
228
+ )
229
+ end
141
230
  attr_reader :post_conversation_settings
142
231
 
143
232
  sig do
144
233
  params(
145
234
  post_conversation_settings:
146
- Telnyx::AI::PostConversationSettings::OrHash
235
+ Telnyx::AI::InferenceEmbedding::PostConversationSettings::OrHash
147
236
  ).void
148
237
  end
149
238
  attr_writer :post_conversation_settings
@@ -156,6 +245,21 @@ module Telnyx
156
245
  end
157
246
  attr_writer :privacy_settings
158
247
 
248
+ # IDs of missions related to this assistant.
249
+ sig { returns(T.nilable(T::Array[String])) }
250
+ attr_reader :related_mission_ids
251
+
252
+ sig { params(related_mission_ids: T::Array[String]).void }
253
+ attr_writer :related_mission_ids
254
+
255
+ # Tags associated with the assistant. Tags can also be managed with the assistant
256
+ # tag endpoints.
257
+ sig { returns(T.nilable(T::Array[String])) }
258
+ attr_reader :tags
259
+
260
+ sig { params(tags: T::Array[String]).void }
261
+ attr_writer :tags
262
+
159
263
  sig { returns(T.nilable(Telnyx::AI::TelephonySettings)) }
160
264
  attr_reader :telephony_settings
161
265
 
@@ -164,8 +268,9 @@ module Telnyx
164
268
  end
165
269
  attr_writer :telephony_settings
166
270
 
167
- # The tools that the assistant can use. These may be templated with
168
- # [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
271
+ # Deprecated for new integrations. Inline tool definitions available to the
272
+ # assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
273
+ # endpoints.
169
274
  sig do
170
275
  returns(T.nilable(T::Array[Telnyx::AI::AssistantTool::Variants]))
171
276
  end
@@ -200,6 +305,28 @@ module Telnyx
200
305
  end
201
306
  attr_writer :transcription
202
307
 
308
+ # Timestamp when this assistant version was created.
309
+ sig { returns(T.nilable(Time)) }
310
+ attr_reader :version_created_at
311
+
312
+ sig { params(version_created_at: Time).void }
313
+ attr_writer :version_created_at
314
+
315
+ # Identifier for the assistant version returned by version-aware assistant
316
+ # endpoints.
317
+ sig { returns(T.nilable(String)) }
318
+ attr_reader :version_id
319
+
320
+ sig { params(version_id: String).void }
321
+ attr_writer :version_id
322
+
323
+ # Human-readable name for the assistant version.
324
+ sig { returns(T.nilable(String)) }
325
+ attr_reader :version_name
326
+
327
+ sig { params(version_name: String).void }
328
+ attr_writer :version_name
329
+
203
330
  sig { returns(T.nilable(Telnyx::AI::VoiceSettings)) }
204
331
  attr_reader :voice_settings
205
332
 
@@ -222,19 +349,29 @@ module Telnyx
222
349
  name: String,
223
350
  description: String,
224
351
  dynamic_variables: T::Hash[Symbol, T.anything],
352
+ dynamic_variables_webhook_timeout_ms: Integer,
225
353
  dynamic_variables_webhook_url: String,
226
354
  enabled_features: T::Array[Telnyx::AI::EnabledFeatures::OrSymbol],
227
- external_llm: Telnyx::AI::ExternalLlm::OrHash,
228
- fallback_config: Telnyx::AI::FallbackConfig::OrHash,
355
+ external_llm: Telnyx::AI::InferenceEmbedding::ExternalLlm::OrHash,
356
+ fallback_config:
357
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::OrHash,
229
358
  greeting: String,
230
359
  import_metadata: Telnyx::AI::ImportMetadata::OrHash,
231
360
  insight_settings: Telnyx::AI::InsightSettings::OrHash,
361
+ integrations:
362
+ T::Array[Telnyx::AI::InferenceEmbedding::Integration::OrHash],
363
+ interruption_settings:
364
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings::OrHash,
232
365
  llm_api_key_ref: String,
366
+ mcp_servers:
367
+ T::Array[Telnyx::AI::InferenceEmbedding::McpServer::OrHash],
233
368
  messaging_settings: Telnyx::AI::MessagingSettings::OrHash,
234
369
  observability_settings: Telnyx::AI::Observability::OrHash,
235
370
  post_conversation_settings:
236
- Telnyx::AI::PostConversationSettings::OrHash,
371
+ Telnyx::AI::InferenceEmbedding::PostConversationSettings::OrHash,
237
372
  privacy_settings: Telnyx::AI::PrivacySettings::OrHash,
373
+ related_mission_ids: T::Array[String],
374
+ tags: T::Array[String],
238
375
  telephony_settings: Telnyx::AI::TelephonySettings::OrHash,
239
376
  tools:
240
377
  T::Array[
@@ -252,6 +389,9 @@ module Telnyx
252
389
  )
253
390
  ],
254
391
  transcription: Telnyx::AI::TranscriptionSettings::OrHash,
392
+ version_created_at: Time,
393
+ version_id: String,
394
+ version_name: String,
255
395
  voice_settings: Telnyx::AI::VoiceSettings::OrHash,
256
396
  widget_settings: Telnyx::AI::WidgetSettings::OrHash
257
397
  ).returns(T.attached_class)
@@ -262,18 +402,29 @@ module Telnyx
262
402
  # System instructions for the assistant. These may be templated with
263
403
  # [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
264
404
  instructions:,
265
- # ID of the model to use. You can use the
405
+ # ID of the model to use when `external_llm` is not set. You can use the
266
406
  # [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
267
- # to see all of your available models,
407
+ # to see available models. If `external_llm` is provided, the assistant uses
408
+ # `external_llm` instead of this field. If neither `model` nor `external_llm` is
409
+ # provided, Telnyx applies the default model.
268
410
  model:,
269
411
  name:,
270
412
  description: nil,
271
413
  # Map of dynamic variables and their values
272
414
  dynamic_variables: nil,
273
- # If the dynamic_variables_webhook_url is set for the assistant, we will send a
274
- # request at the start of the conversation. See our
275
- # [guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
276
- # for more information.
415
+ # Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
416
+ # 10000 ms. If the webhook does not respond within this timeout, the call proceeds
417
+ # with default values. See the
418
+ # [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
419
+ dynamic_variables_webhook_timeout_ms: nil,
420
+ # If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
421
+ # URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
422
+ # the webhook response must wrap variables under a top-level `dynamic_variables`
423
+ # object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
424
+ # flat object will be ignored and variables will fall back to their defaults. See
425
+ # the
426
+ # [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
427
+ # for the full request/response format and timeout behavior.
277
428
  dynamic_variables_webhook_url: nil,
278
429
  enabled_features: nil,
279
430
  external_llm: nil,
@@ -287,12 +438,28 @@ module Telnyx
287
438
  greeting: nil,
288
439
  import_metadata: nil,
289
440
  insight_settings: nil,
290
- # This is only needed when using third-party inference providers. The `identifier`
291
- # for an integration secret
441
+ # Connected integrations attached to the assistant. The catalog of available
442
+ # integrations is at `/ai/integrations`; the user's connected integrations are at
443
+ # `/ai/integrations/connections`. Each item references a catalog integration by
444
+ # `integration_id`.
445
+ integrations: nil,
446
+ # Settings for interruptions and how the assistant decides the user has finished
447
+ # speaking. These timings are most relevant when using non turn-taking
448
+ # transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
449
+ # behavior is controlled by the transcription end-of-turn settings under
450
+ # `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
451
+ # `eager_eot_threshold`).
452
+ interruption_settings: nil,
453
+ # This is only needed when using third-party inference providers selected by
454
+ # `model`. The `identifier` for an integration secret
292
455
  # [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
293
- # that refers to your LLM provider's API key. Warning: Free plans are unlikely to
294
- # work with this integration.
456
+ # that refers to your LLM provider's API key. For bring-your-own endpoint
457
+ # authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
458
+ # are unlikely to work with this integration.
295
459
  llm_api_key_ref: nil,
460
+ # MCP servers attached to the assistant. Create MCP servers with
461
+ # `/ai/mcp_servers`, then reference them by `id` here.
462
+ mcp_servers: nil,
296
463
  messaging_settings: nil,
297
464
  observability_settings: nil,
298
465
  # Configuration for post-conversation processing. When enabled, the assistant
@@ -303,11 +470,24 @@ module Telnyx
303
470
  # post-conversation. Beta feature.
304
471
  post_conversation_settings: nil,
305
472
  privacy_settings: nil,
473
+ # IDs of missions related to this assistant.
474
+ related_mission_ids: nil,
475
+ # Tags associated with the assistant. Tags can also be managed with the assistant
476
+ # tag endpoints.
477
+ tags: nil,
306
478
  telephony_settings: nil,
307
- # The tools that the assistant can use. These may be templated with
308
- # [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
479
+ # Deprecated for new integrations. Inline tool definitions available to the
480
+ # assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
481
+ # endpoints.
309
482
  tools: nil,
310
483
  transcription: nil,
484
+ # Timestamp when this assistant version was created.
485
+ version_created_at: nil,
486
+ # Identifier for the assistant version returned by version-aware assistant
487
+ # endpoints.
488
+ version_id: nil,
489
+ # Human-readable name for the assistant version.
490
+ version_name: nil,
311
491
  voice_settings: nil,
312
492
  # Configuration settings for the assistant's web widget.
313
493
  widget_settings: nil
@@ -324,22 +504,34 @@ module Telnyx
324
504
  name: String,
325
505
  description: String,
326
506
  dynamic_variables: T::Hash[Symbol, T.anything],
507
+ dynamic_variables_webhook_timeout_ms: Integer,
327
508
  dynamic_variables_webhook_url: String,
328
509
  enabled_features:
329
510
  T::Array[Telnyx::AI::EnabledFeatures::TaggedSymbol],
330
- external_llm: Telnyx::AI::ExternalLlm,
331
- fallback_config: Telnyx::AI::FallbackConfig,
511
+ external_llm: Telnyx::AI::InferenceEmbedding::ExternalLlm,
512
+ fallback_config: Telnyx::AI::InferenceEmbedding::FallbackConfig,
332
513
  greeting: String,
333
514
  import_metadata: Telnyx::AI::ImportMetadata,
334
515
  insight_settings: Telnyx::AI::InsightSettings,
516
+ integrations:
517
+ T::Array[Telnyx::AI::InferenceEmbedding::Integration],
518
+ interruption_settings:
519
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings,
335
520
  llm_api_key_ref: String,
521
+ mcp_servers: T::Array[Telnyx::AI::InferenceEmbedding::McpServer],
336
522
  messaging_settings: Telnyx::AI::MessagingSettings,
337
523
  observability_settings: Telnyx::AI::Observability,
338
- post_conversation_settings: Telnyx::AI::PostConversationSettings,
524
+ post_conversation_settings:
525
+ Telnyx::AI::InferenceEmbedding::PostConversationSettings,
339
526
  privacy_settings: Telnyx::AI::PrivacySettings,
527
+ related_mission_ids: T::Array[String],
528
+ tags: T::Array[String],
340
529
  telephony_settings: Telnyx::AI::TelephonySettings,
341
530
  tools: T::Array[Telnyx::AI::AssistantTool::Variants],
342
531
  transcription: Telnyx::AI::TranscriptionSettings,
532
+ version_created_at: Time,
533
+ version_id: String,
534
+ version_name: String,
343
535
  voice_settings: Telnyx::AI::VoiceSettings,
344
536
  widget_settings: Telnyx::AI::WidgetSettings
345
537
  }
@@ -347,6 +539,750 @@ module Telnyx
347
539
  end
348
540
  def to_hash
349
541
  end
542
+
543
+ class ExternalLlm < Telnyx::Internal::Type::BaseModel
544
+ OrHash =
545
+ T.type_alias do
546
+ T.any(
547
+ Telnyx::AI::InferenceEmbedding::ExternalLlm,
548
+ Telnyx::Internal::AnyHash
549
+ )
550
+ end
551
+
552
+ # Base URL for the external LLM endpoint.
553
+ sig { returns(String) }
554
+ attr_accessor :base_url
555
+
556
+ # Model identifier to use with the external LLM endpoint.
557
+ sig { returns(String) }
558
+ attr_accessor :model
559
+
560
+ # Authentication method used when connecting to the external LLM endpoint.
561
+ sig do
562
+ returns(
563
+ T.nilable(
564
+ Telnyx::AI::InferenceEmbedding::ExternalLlm::AuthenticationMethod::TaggedSymbol
565
+ )
566
+ )
567
+ end
568
+ attr_reader :authentication_method
569
+
570
+ sig do
571
+ params(
572
+ authentication_method:
573
+ Telnyx::AI::InferenceEmbedding::ExternalLlm::AuthenticationMethod::OrSymbol
574
+ ).void
575
+ end
576
+ attr_writer :authentication_method
577
+
578
+ # Integration secret identifier for the client certificate used with certificate
579
+ # authentication.
580
+ sig { returns(T.nilable(String)) }
581
+ attr_reader :certificate_ref
582
+
583
+ sig { params(certificate_ref: String).void }
584
+ attr_writer :certificate_ref
585
+
586
+ # When `true`, Telnyx forwards the assistant's dynamic variables to the external
587
+ # LLM endpoint as a top-level `extra_metadata` object on the chat completion
588
+ # request body. Defaults to `false`. Example payload sent to the external
589
+ # endpoint:
590
+ # `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
591
+ # Distinct from OpenAI's native `metadata` field, which has its own size and type
592
+ # limits.
593
+ sig { returns(T.nilable(T::Boolean)) }
594
+ attr_reader :forward_metadata
595
+
596
+ sig { params(forward_metadata: T::Boolean).void }
597
+ attr_writer :forward_metadata
598
+
599
+ # Integration secret identifier for the external LLM API key.
600
+ sig { returns(T.nilable(String)) }
601
+ attr_reader :llm_api_key_ref
602
+
603
+ sig { params(llm_api_key_ref: String).void }
604
+ attr_writer :llm_api_key_ref
605
+
606
+ # URL used to retrieve an access token when certificate authentication is enabled.
607
+ sig { returns(T.nilable(String)) }
608
+ attr_reader :token_retrieval_url
609
+
610
+ sig { params(token_retrieval_url: String).void }
611
+ attr_writer :token_retrieval_url
612
+
613
+ sig do
614
+ params(
615
+ base_url: String,
616
+ model: String,
617
+ authentication_method:
618
+ Telnyx::AI::InferenceEmbedding::ExternalLlm::AuthenticationMethod::OrSymbol,
619
+ certificate_ref: String,
620
+ forward_metadata: T::Boolean,
621
+ llm_api_key_ref: String,
622
+ token_retrieval_url: String
623
+ ).returns(T.attached_class)
624
+ end
625
+ def self.new(
626
+ # Base URL for the external LLM endpoint.
627
+ base_url:,
628
+ # Model identifier to use with the external LLM endpoint.
629
+ model:,
630
+ # Authentication method used when connecting to the external LLM endpoint.
631
+ authentication_method: nil,
632
+ # Integration secret identifier for the client certificate used with certificate
633
+ # authentication.
634
+ certificate_ref: nil,
635
+ # When `true`, Telnyx forwards the assistant's dynamic variables to the external
636
+ # LLM endpoint as a top-level `extra_metadata` object on the chat completion
637
+ # request body. Defaults to `false`. Example payload sent to the external
638
+ # endpoint:
639
+ # `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
640
+ # Distinct from OpenAI's native `metadata` field, which has its own size and type
641
+ # limits.
642
+ forward_metadata: nil,
643
+ # Integration secret identifier for the external LLM API key.
644
+ llm_api_key_ref: nil,
645
+ # URL used to retrieve an access token when certificate authentication is enabled.
646
+ token_retrieval_url: nil
647
+ )
648
+ end
649
+
650
+ sig do
651
+ override.returns(
652
+ {
653
+ base_url: String,
654
+ model: String,
655
+ authentication_method:
656
+ Telnyx::AI::InferenceEmbedding::ExternalLlm::AuthenticationMethod::TaggedSymbol,
657
+ certificate_ref: String,
658
+ forward_metadata: T::Boolean,
659
+ llm_api_key_ref: String,
660
+ token_retrieval_url: String
661
+ }
662
+ )
663
+ end
664
+ def to_hash
665
+ end
666
+
667
+ # Authentication method used when connecting to the external LLM endpoint.
668
+ module AuthenticationMethod
669
+ extend Telnyx::Internal::Type::Enum
670
+
671
+ TaggedSymbol =
672
+ T.type_alias do
673
+ T.all(
674
+ Symbol,
675
+ Telnyx::AI::InferenceEmbedding::ExternalLlm::AuthenticationMethod
676
+ )
677
+ end
678
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
679
+
680
+ TOKEN =
681
+ T.let(
682
+ :token,
683
+ Telnyx::AI::InferenceEmbedding::ExternalLlm::AuthenticationMethod::TaggedSymbol
684
+ )
685
+ CERTIFICATE =
686
+ T.let(
687
+ :certificate,
688
+ Telnyx::AI::InferenceEmbedding::ExternalLlm::AuthenticationMethod::TaggedSymbol
689
+ )
690
+
691
+ sig do
692
+ override.returns(
693
+ T::Array[
694
+ Telnyx::AI::InferenceEmbedding::ExternalLlm::AuthenticationMethod::TaggedSymbol
695
+ ]
696
+ )
697
+ end
698
+ def self.values
699
+ end
700
+ end
701
+ end
702
+
703
+ class FallbackConfig < Telnyx::Internal::Type::BaseModel
704
+ OrHash =
705
+ T.type_alias do
706
+ T.any(
707
+ Telnyx::AI::InferenceEmbedding::FallbackConfig,
708
+ Telnyx::Internal::AnyHash
709
+ )
710
+ end
711
+
712
+ sig do
713
+ returns(
714
+ T.nilable(
715
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::ExternalLlm
716
+ )
717
+ )
718
+ end
719
+ attr_reader :external_llm
720
+
721
+ sig do
722
+ params(
723
+ external_llm:
724
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::ExternalLlm::OrHash
725
+ ).void
726
+ end
727
+ attr_writer :external_llm
728
+
729
+ # Integration secret identifier for the fallback model API key.
730
+ sig { returns(T.nilable(String)) }
731
+ attr_reader :llm_api_key_ref
732
+
733
+ sig { params(llm_api_key_ref: String).void }
734
+ attr_writer :llm_api_key_ref
735
+
736
+ # Fallback Telnyx-hosted model to use when the primary LLM provider is
737
+ # unavailable.
738
+ sig { returns(T.nilable(String)) }
739
+ attr_reader :model
740
+
741
+ sig { params(model: String).void }
742
+ attr_writer :model
743
+
744
+ sig do
745
+ params(
746
+ external_llm:
747
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::ExternalLlm::OrHash,
748
+ llm_api_key_ref: String,
749
+ model: String
750
+ ).returns(T.attached_class)
751
+ end
752
+ def self.new(
753
+ external_llm: nil,
754
+ # Integration secret identifier for the fallback model API key.
755
+ llm_api_key_ref: nil,
756
+ # Fallback Telnyx-hosted model to use when the primary LLM provider is
757
+ # unavailable.
758
+ model: nil
759
+ )
760
+ end
761
+
762
+ sig do
763
+ override.returns(
764
+ {
765
+ external_llm:
766
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::ExternalLlm,
767
+ llm_api_key_ref: String,
768
+ model: String
769
+ }
770
+ )
771
+ end
772
+ def to_hash
773
+ end
774
+
775
+ class ExternalLlm < Telnyx::Internal::Type::BaseModel
776
+ OrHash =
777
+ T.type_alias do
778
+ T.any(
779
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::ExternalLlm,
780
+ Telnyx::Internal::AnyHash
781
+ )
782
+ end
783
+
784
+ # Base URL for the external LLM endpoint.
785
+ sig { returns(String) }
786
+ attr_accessor :base_url
787
+
788
+ # Model identifier to use with the external LLM endpoint.
789
+ sig { returns(String) }
790
+ attr_accessor :model
791
+
792
+ # Authentication method used when connecting to the external LLM endpoint.
793
+ sig do
794
+ returns(
795
+ T.nilable(
796
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::ExternalLlm::AuthenticationMethod::TaggedSymbol
797
+ )
798
+ )
799
+ end
800
+ attr_reader :authentication_method
801
+
802
+ sig do
803
+ params(
804
+ authentication_method:
805
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::ExternalLlm::AuthenticationMethod::OrSymbol
806
+ ).void
807
+ end
808
+ attr_writer :authentication_method
809
+
810
+ # Integration secret identifier for the client certificate used with certificate
811
+ # authentication.
812
+ sig { returns(T.nilable(String)) }
813
+ attr_reader :certificate_ref
814
+
815
+ sig { params(certificate_ref: String).void }
816
+ attr_writer :certificate_ref
817
+
818
+ # When `true`, Telnyx forwards the assistant's dynamic variables to the external
819
+ # LLM endpoint as a top-level `extra_metadata` object on the chat completion
820
+ # request body. Defaults to `false`. Example payload sent to the external
821
+ # endpoint:
822
+ # `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
823
+ # Distinct from OpenAI's native `metadata` field, which has its own size and type
824
+ # limits.
825
+ sig { returns(T.nilable(T::Boolean)) }
826
+ attr_reader :forward_metadata
827
+
828
+ sig { params(forward_metadata: T::Boolean).void }
829
+ attr_writer :forward_metadata
830
+
831
+ # Integration secret identifier for the external LLM API key.
832
+ sig { returns(T.nilable(String)) }
833
+ attr_reader :llm_api_key_ref
834
+
835
+ sig { params(llm_api_key_ref: String).void }
836
+ attr_writer :llm_api_key_ref
837
+
838
+ # URL used to retrieve an access token when certificate authentication is enabled.
839
+ sig { returns(T.nilable(String)) }
840
+ attr_reader :token_retrieval_url
841
+
842
+ sig { params(token_retrieval_url: String).void }
843
+ attr_writer :token_retrieval_url
844
+
845
+ sig do
846
+ params(
847
+ base_url: String,
848
+ model: String,
849
+ authentication_method:
850
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::ExternalLlm::AuthenticationMethod::OrSymbol,
851
+ certificate_ref: String,
852
+ forward_metadata: T::Boolean,
853
+ llm_api_key_ref: String,
854
+ token_retrieval_url: String
855
+ ).returns(T.attached_class)
856
+ end
857
+ def self.new(
858
+ # Base URL for the external LLM endpoint.
859
+ base_url:,
860
+ # Model identifier to use with the external LLM endpoint.
861
+ model:,
862
+ # Authentication method used when connecting to the external LLM endpoint.
863
+ authentication_method: nil,
864
+ # Integration secret identifier for the client certificate used with certificate
865
+ # authentication.
866
+ certificate_ref: nil,
867
+ # When `true`, Telnyx forwards the assistant's dynamic variables to the external
868
+ # LLM endpoint as a top-level `extra_metadata` object on the chat completion
869
+ # request body. Defaults to `false`. Example payload sent to the external
870
+ # endpoint:
871
+ # `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
872
+ # Distinct from OpenAI's native `metadata` field, which has its own size and type
873
+ # limits.
874
+ forward_metadata: nil,
875
+ # Integration secret identifier for the external LLM API key.
876
+ llm_api_key_ref: nil,
877
+ # URL used to retrieve an access token when certificate authentication is enabled.
878
+ token_retrieval_url: nil
879
+ )
880
+ end
881
+
882
+ sig do
883
+ override.returns(
884
+ {
885
+ base_url: String,
886
+ model: String,
887
+ authentication_method:
888
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::ExternalLlm::AuthenticationMethod::TaggedSymbol,
889
+ certificate_ref: String,
890
+ forward_metadata: T::Boolean,
891
+ llm_api_key_ref: String,
892
+ token_retrieval_url: String
893
+ }
894
+ )
895
+ end
896
+ def to_hash
897
+ end
898
+
899
+ # Authentication method used when connecting to the external LLM endpoint.
900
+ module AuthenticationMethod
901
+ extend Telnyx::Internal::Type::Enum
902
+
903
+ TaggedSymbol =
904
+ T.type_alias do
905
+ T.all(
906
+ Symbol,
907
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::ExternalLlm::AuthenticationMethod
908
+ )
909
+ end
910
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
911
+
912
+ TOKEN =
913
+ T.let(
914
+ :token,
915
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::ExternalLlm::AuthenticationMethod::TaggedSymbol
916
+ )
917
+ CERTIFICATE =
918
+ T.let(
919
+ :certificate,
920
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::ExternalLlm::AuthenticationMethod::TaggedSymbol
921
+ )
922
+
923
+ sig do
924
+ override.returns(
925
+ T::Array[
926
+ Telnyx::AI::InferenceEmbedding::FallbackConfig::ExternalLlm::AuthenticationMethod::TaggedSymbol
927
+ ]
928
+ )
929
+ end
930
+ def self.values
931
+ end
932
+ end
933
+ end
934
+ end
935
+
936
+ class Integration < Telnyx::Internal::Type::BaseModel
937
+ OrHash =
938
+ T.type_alias do
939
+ T.any(
940
+ Telnyx::AI::InferenceEmbedding::Integration,
941
+ Telnyx::Internal::AnyHash
942
+ )
943
+ end
944
+
945
+ # Catalog integration ID to attach. This is the `id` from the integrations catalog
946
+ # at `/ai/integrations` (the same value also appears as `integration_id` on
947
+ # entries returned by `/ai/integrations/connections`). It is **not** the
948
+ # connection-level `id` from `/ai/integrations/connections`.
949
+ sig { returns(String) }
950
+ attr_accessor :integration_id
951
+
952
+ # Optional per-assistant allowlist of integration tool names. When omitted or
953
+ # empty, all tools allowed by the connected integration are available to the
954
+ # assistant.
955
+ sig { returns(T.nilable(T::Array[String])) }
956
+ attr_reader :allowed_list
957
+
958
+ sig { params(allowed_list: T::Array[String]).void }
959
+ attr_writer :allowed_list
960
+
961
+ # Reference to a connected integration attached to an assistant. Discover
962
+ # available integrations with `/ai/integrations` and connected integrations with
963
+ # `/ai/integrations/connections`.
964
+ sig do
965
+ params(
966
+ integration_id: String,
967
+ allowed_list: T::Array[String]
968
+ ).returns(T.attached_class)
969
+ end
970
+ def self.new(
971
+ # Catalog integration ID to attach. This is the `id` from the integrations catalog
972
+ # at `/ai/integrations` (the same value also appears as `integration_id` on
973
+ # entries returned by `/ai/integrations/connections`). It is **not** the
974
+ # connection-level `id` from `/ai/integrations/connections`.
975
+ integration_id:,
976
+ # Optional per-assistant allowlist of integration tool names. When omitted or
977
+ # empty, all tools allowed by the connected integration are available to the
978
+ # assistant.
979
+ allowed_list: nil
980
+ )
981
+ end
982
+
983
+ sig do
984
+ override.returns(
985
+ { integration_id: String, allowed_list: T::Array[String] }
986
+ )
987
+ end
988
+ def to_hash
989
+ end
990
+ end
991
+
992
+ class InterruptionSettings < Telnyx::Internal::Type::BaseModel
993
+ OrHash =
994
+ T.type_alias do
995
+ T.any(
996
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings,
997
+ Telnyx::Internal::AnyHash
998
+ )
999
+ end
1000
+
1001
+ # Whether users can interrupt the assistant while it is speaking.
1002
+ sig { returns(T.nilable(T::Boolean)) }
1003
+ attr_reader :enable
1004
+
1005
+ sig { params(enable: T::Boolean).void }
1006
+ attr_writer :enable
1007
+
1008
+ # Controls when the assistant starts speaking after the user stops. These
1009
+ # thresholds primarily apply to non turn-taking transcription models. For
1010
+ # turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
1011
+ # transcription end-of-turn settings under `transcription.settings` instead.
1012
+ sig do
1013
+ returns(
1014
+ T.nilable(
1015
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings::StartSpeakingPlan
1016
+ )
1017
+ )
1018
+ end
1019
+ attr_reader :start_speaking_plan
1020
+
1021
+ sig do
1022
+ params(
1023
+ start_speaking_plan:
1024
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings::StartSpeakingPlan::OrHash
1025
+ ).void
1026
+ end
1027
+ attr_writer :start_speaking_plan
1028
+
1029
+ # Settings for interruptions and how the assistant decides the user has finished
1030
+ # speaking. These timings are most relevant when using non turn-taking
1031
+ # transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
1032
+ # behavior is controlled by the transcription end-of-turn settings under
1033
+ # `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
1034
+ # `eager_eot_threshold`).
1035
+ sig do
1036
+ params(
1037
+ enable: T::Boolean,
1038
+ start_speaking_plan:
1039
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings::StartSpeakingPlan::OrHash
1040
+ ).returns(T.attached_class)
1041
+ end
1042
+ def self.new(
1043
+ # Whether users can interrupt the assistant while it is speaking.
1044
+ enable: nil,
1045
+ # Controls when the assistant starts speaking after the user stops. These
1046
+ # thresholds primarily apply to non turn-taking transcription models. For
1047
+ # turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
1048
+ # transcription end-of-turn settings under `transcription.settings` instead.
1049
+ start_speaking_plan: nil
1050
+ )
1051
+ end
1052
+
1053
+ sig do
1054
+ override.returns(
1055
+ {
1056
+ enable: T::Boolean,
1057
+ start_speaking_plan:
1058
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings::StartSpeakingPlan
1059
+ }
1060
+ )
1061
+ end
1062
+ def to_hash
1063
+ end
1064
+
1065
+ class StartSpeakingPlan < Telnyx::Internal::Type::BaseModel
1066
+ OrHash =
1067
+ T.type_alias do
1068
+ T.any(
1069
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings::StartSpeakingPlan,
1070
+ Telnyx::Internal::AnyHash
1071
+ )
1072
+ end
1073
+
1074
+ # Endpointing thresholds used to decide when the user has finished speaking.
1075
+ # Applies to non turn-taking transcription models. For `deepgram/flux`, use
1076
+ # `transcription.settings.eot_threshold` / `eot_timeout_ms` /
1077
+ # `eager_eot_threshold`.
1078
+ sig do
1079
+ returns(
1080
+ T.nilable(
1081
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan
1082
+ )
1083
+ )
1084
+ end
1085
+ attr_reader :transcription_endpointing_plan
1086
+
1087
+ sig do
1088
+ params(
1089
+ transcription_endpointing_plan:
1090
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan::OrHash
1091
+ ).void
1092
+ end
1093
+ attr_writer :transcription_endpointing_plan
1094
+
1095
+ # Minimum seconds to wait before the assistant starts speaking.
1096
+ sig { returns(T.nilable(Float)) }
1097
+ attr_reader :wait_seconds
1098
+
1099
+ sig { params(wait_seconds: Float).void }
1100
+ attr_writer :wait_seconds
1101
+
1102
+ # Controls when the assistant starts speaking after the user stops. These
1103
+ # thresholds primarily apply to non turn-taking transcription models. For
1104
+ # turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
1105
+ # transcription end-of-turn settings under `transcription.settings` instead.
1106
+ sig do
1107
+ params(
1108
+ transcription_endpointing_plan:
1109
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan::OrHash,
1110
+ wait_seconds: Float
1111
+ ).returns(T.attached_class)
1112
+ end
1113
+ def self.new(
1114
+ # Endpointing thresholds used to decide when the user has finished speaking.
1115
+ # Applies to non turn-taking transcription models. For `deepgram/flux`, use
1116
+ # `transcription.settings.eot_threshold` / `eot_timeout_ms` /
1117
+ # `eager_eot_threshold`.
1118
+ transcription_endpointing_plan: nil,
1119
+ # Minimum seconds to wait before the assistant starts speaking.
1120
+ wait_seconds: nil
1121
+ )
1122
+ end
1123
+
1124
+ sig do
1125
+ override.returns(
1126
+ {
1127
+ transcription_endpointing_plan:
1128
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan,
1129
+ wait_seconds: Float
1130
+ }
1131
+ )
1132
+ end
1133
+ def to_hash
1134
+ end
1135
+
1136
+ class TranscriptionEndpointingPlan < Telnyx::Internal::Type::BaseModel
1137
+ OrHash =
1138
+ T.type_alias do
1139
+ T.any(
1140
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan,
1141
+ Telnyx::Internal::AnyHash
1142
+ )
1143
+ end
1144
+
1145
+ # Seconds to wait after the transcript ends without punctuation.
1146
+ sig { returns(T.nilable(Float)) }
1147
+ attr_reader :on_no_punctuation_seconds
1148
+
1149
+ sig { params(on_no_punctuation_seconds: Float).void }
1150
+ attr_writer :on_no_punctuation_seconds
1151
+
1152
+ # Seconds to wait after the transcript ends with a number.
1153
+ sig { returns(T.nilable(Float)) }
1154
+ attr_reader :on_number_seconds
1155
+
1156
+ sig { params(on_number_seconds: Float).void }
1157
+ attr_writer :on_number_seconds
1158
+
1159
+ # Seconds to wait after the transcript ends with punctuation.
1160
+ sig { returns(T.nilable(Float)) }
1161
+ attr_reader :on_punctuation_seconds
1162
+
1163
+ sig { params(on_punctuation_seconds: Float).void }
1164
+ attr_writer :on_punctuation_seconds
1165
+
1166
+ # Endpointing thresholds used to decide when the user has finished speaking.
1167
+ # Applies to non turn-taking transcription models. For `deepgram/flux`, use
1168
+ # `transcription.settings.eot_threshold` / `eot_timeout_ms` /
1169
+ # `eager_eot_threshold`.
1170
+ sig do
1171
+ params(
1172
+ on_no_punctuation_seconds: Float,
1173
+ on_number_seconds: Float,
1174
+ on_punctuation_seconds: Float
1175
+ ).returns(T.attached_class)
1176
+ end
1177
+ def self.new(
1178
+ # Seconds to wait after the transcript ends without punctuation.
1179
+ on_no_punctuation_seconds: nil,
1180
+ # Seconds to wait after the transcript ends with a number.
1181
+ on_number_seconds: nil,
1182
+ # Seconds to wait after the transcript ends with punctuation.
1183
+ on_punctuation_seconds: nil
1184
+ )
1185
+ end
1186
+
1187
+ sig do
1188
+ override.returns(
1189
+ {
1190
+ on_no_punctuation_seconds: Float,
1191
+ on_number_seconds: Float,
1192
+ on_punctuation_seconds: Float
1193
+ }
1194
+ )
1195
+ end
1196
+ def to_hash
1197
+ end
1198
+ end
1199
+ end
1200
+ end
1201
+
1202
+ class McpServer < Telnyx::Internal::Type::BaseModel
1203
+ OrHash =
1204
+ T.type_alias do
1205
+ T.any(
1206
+ Telnyx::AI::InferenceEmbedding::McpServer,
1207
+ Telnyx::Internal::AnyHash
1208
+ )
1209
+ end
1210
+
1211
+ # ID of the MCP server to attach. This must be the `id` of an MCP server returned
1212
+ # by the `/ai/mcp_servers` endpoints.
1213
+ sig { returns(String) }
1214
+ attr_accessor :id
1215
+
1216
+ # Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
1217
+ # uses the MCP server's configured `allowed_tools`.
1218
+ sig { returns(T.nilable(T::Array[String])) }
1219
+ attr_reader :allowed_tools
1220
+
1221
+ sig { params(allowed_tools: T::Array[String]).void }
1222
+ attr_writer :allowed_tools
1223
+
1224
+ # Reference to an MCP server attached to an assistant. Create and manage MCP
1225
+ # servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
1226
+ # ID.
1227
+ sig do
1228
+ params(id: String, allowed_tools: T::Array[String]).returns(
1229
+ T.attached_class
1230
+ )
1231
+ end
1232
+ def self.new(
1233
+ # ID of the MCP server to attach. This must be the `id` of an MCP server returned
1234
+ # by the `/ai/mcp_servers` endpoints.
1235
+ id:,
1236
+ # Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
1237
+ # uses the MCP server's configured `allowed_tools`.
1238
+ allowed_tools: nil
1239
+ )
1240
+ end
1241
+
1242
+ sig do
1243
+ override.returns({ id: String, allowed_tools: T::Array[String] })
1244
+ end
1245
+ def to_hash
1246
+ end
1247
+ end
1248
+
1249
+ class PostConversationSettings < Telnyx::Internal::Type::BaseModel
1250
+ OrHash =
1251
+ T.type_alias do
1252
+ T.any(
1253
+ Telnyx::AI::InferenceEmbedding::PostConversationSettings,
1254
+ Telnyx::Internal::AnyHash
1255
+ )
1256
+ end
1257
+
1258
+ # Whether post-conversation processing is enabled. When true, the assistant will
1259
+ # be invoked after the conversation ends to perform any final tool calls. Defaults
1260
+ # to false.
1261
+ sig { returns(T.nilable(T::Boolean)) }
1262
+ attr_reader :enabled
1263
+
1264
+ sig { params(enabled: T::Boolean).void }
1265
+ attr_writer :enabled
1266
+
1267
+ # Configuration for post-conversation processing. When enabled, the assistant
1268
+ # receives one additional LLM turn after the conversation ends, allowing it to
1269
+ # execute tool calls such as logging to a CRM or sending a summary. The assistant
1270
+ # can execute multiple parallel or sequential tools during this phase.
1271
+ # Telephony-control tools (e.g. hangup, transfer) are unavailable
1272
+ # post-conversation. Beta feature.
1273
+ sig { params(enabled: T::Boolean).returns(T.attached_class) }
1274
+ def self.new(
1275
+ # Whether post-conversation processing is enabled. When true, the assistant will
1276
+ # be invoked after the conversation ends to perform any final tool calls. Defaults
1277
+ # to false.
1278
+ enabled: nil
1279
+ )
1280
+ end
1281
+
1282
+ sig { override.returns({ enabled: T::Boolean }) }
1283
+ def to_hash
1284
+ end
1285
+ end
350
1286
  end
351
1287
  end
352
1288
  end