telnyx 5.92.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.
@@ -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
 
@@ -115,17 +131,75 @@ module Telnyx
115
131
  end
116
132
  attr_writer :insight_settings
117
133
 
118
- # This is only needed when using third-party inference providers. The `identifier`
119
- # 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
120
176
  # [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
121
- # that refers to your LLM provider's API key. Warning: Free plans are unlikely to
122
- # 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.
123
180
  sig { returns(T.nilable(String)) }
124
181
  attr_reader :llm_api_key_ref
125
182
 
126
183
  sig { params(llm_api_key_ref: String).void }
127
184
  attr_writer :llm_api_key_ref
128
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
+
129
203
  sig { returns(T.nilable(Telnyx::AI::MessagingSettings)) }
130
204
  attr_reader :messaging_settings
131
205
 
@@ -171,6 +245,21 @@ module Telnyx
171
245
  end
172
246
  attr_writer :privacy_settings
173
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
+
174
263
  sig { returns(T.nilable(Telnyx::AI::TelephonySettings)) }
175
264
  attr_reader :telephony_settings
176
265
 
@@ -179,8 +268,9 @@ module Telnyx
179
268
  end
180
269
  attr_writer :telephony_settings
181
270
 
182
- # The tools that the assistant can use. These may be templated with
183
- # [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.
184
274
  sig do
185
275
  returns(T.nilable(T::Array[Telnyx::AI::AssistantTool::Variants]))
186
276
  end
@@ -215,6 +305,28 @@ module Telnyx
215
305
  end
216
306
  attr_writer :transcription
217
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
+
218
330
  sig { returns(T.nilable(Telnyx::AI::VoiceSettings)) }
219
331
  attr_reader :voice_settings
220
332
 
@@ -237,6 +349,7 @@ module Telnyx
237
349
  name: String,
238
350
  description: String,
239
351
  dynamic_variables: T::Hash[Symbol, T.anything],
352
+ dynamic_variables_webhook_timeout_ms: Integer,
240
353
  dynamic_variables_webhook_url: String,
241
354
  enabled_features: T::Array[Telnyx::AI::EnabledFeatures::OrSymbol],
242
355
  external_llm: Telnyx::AI::InferenceEmbedding::ExternalLlm::OrHash,
@@ -245,12 +358,20 @@ module Telnyx
245
358
  greeting: String,
246
359
  import_metadata: Telnyx::AI::ImportMetadata::OrHash,
247
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,
248
365
  llm_api_key_ref: String,
366
+ mcp_servers:
367
+ T::Array[Telnyx::AI::InferenceEmbedding::McpServer::OrHash],
249
368
  messaging_settings: Telnyx::AI::MessagingSettings::OrHash,
250
369
  observability_settings: Telnyx::AI::Observability::OrHash,
251
370
  post_conversation_settings:
252
371
  Telnyx::AI::InferenceEmbedding::PostConversationSettings::OrHash,
253
372
  privacy_settings: Telnyx::AI::PrivacySettings::OrHash,
373
+ related_mission_ids: T::Array[String],
374
+ tags: T::Array[String],
254
375
  telephony_settings: Telnyx::AI::TelephonySettings::OrHash,
255
376
  tools:
256
377
  T::Array[
@@ -268,6 +389,9 @@ module Telnyx
268
389
  )
269
390
  ],
270
391
  transcription: Telnyx::AI::TranscriptionSettings::OrHash,
392
+ version_created_at: Time,
393
+ version_id: String,
394
+ version_name: String,
271
395
  voice_settings: Telnyx::AI::VoiceSettings::OrHash,
272
396
  widget_settings: Telnyx::AI::WidgetSettings::OrHash
273
397
  ).returns(T.attached_class)
@@ -278,18 +402,29 @@ module Telnyx
278
402
  # System instructions for the assistant. These may be templated with
279
403
  # [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
280
404
  instructions:,
281
- # 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
282
406
  # [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
283
- # 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.
284
410
  model:,
285
411
  name:,
286
412
  description: nil,
287
413
  # Map of dynamic variables and their values
288
414
  dynamic_variables: nil,
289
- # If the dynamic_variables_webhook_url is set for the assistant, we will send a
290
- # request at the start of the conversation. See our
291
- # [guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
292
- # 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.
293
428
  dynamic_variables_webhook_url: nil,
294
429
  enabled_features: nil,
295
430
  external_llm: nil,
@@ -303,12 +438,28 @@ module Telnyx
303
438
  greeting: nil,
304
439
  import_metadata: nil,
305
440
  insight_settings: nil,
306
- # This is only needed when using third-party inference providers. The `identifier`
307
- # 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
308
455
  # [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
309
- # that refers to your LLM provider's API key. Warning: Free plans are unlikely to
310
- # 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.
311
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,
312
463
  messaging_settings: nil,
313
464
  observability_settings: nil,
314
465
  # Configuration for post-conversation processing. When enabled, the assistant
@@ -319,11 +470,24 @@ module Telnyx
319
470
  # post-conversation. Beta feature.
320
471
  post_conversation_settings: nil,
321
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,
322
478
  telephony_settings: nil,
323
- # The tools that the assistant can use. These may be templated with
324
- # [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.
325
482
  tools: nil,
326
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,
327
491
  voice_settings: nil,
328
492
  # Configuration settings for the assistant's web widget.
329
493
  widget_settings: nil
@@ -340,6 +504,7 @@ module Telnyx
340
504
  name: String,
341
505
  description: String,
342
506
  dynamic_variables: T::Hash[Symbol, T.anything],
507
+ dynamic_variables_webhook_timeout_ms: Integer,
343
508
  dynamic_variables_webhook_url: String,
344
509
  enabled_features:
345
510
  T::Array[Telnyx::AI::EnabledFeatures::TaggedSymbol],
@@ -348,15 +513,25 @@ module Telnyx
348
513
  greeting: String,
349
514
  import_metadata: Telnyx::AI::ImportMetadata,
350
515
  insight_settings: Telnyx::AI::InsightSettings,
516
+ integrations:
517
+ T::Array[Telnyx::AI::InferenceEmbedding::Integration],
518
+ interruption_settings:
519
+ Telnyx::AI::InferenceEmbedding::InterruptionSettings,
351
520
  llm_api_key_ref: String,
521
+ mcp_servers: T::Array[Telnyx::AI::InferenceEmbedding::McpServer],
352
522
  messaging_settings: Telnyx::AI::MessagingSettings,
353
523
  observability_settings: Telnyx::AI::Observability,
354
524
  post_conversation_settings:
355
525
  Telnyx::AI::InferenceEmbedding::PostConversationSettings,
356
526
  privacy_settings: Telnyx::AI::PrivacySettings,
527
+ related_mission_ids: T::Array[String],
528
+ tags: T::Array[String],
357
529
  telephony_settings: Telnyx::AI::TelephonySettings,
358
530
  tools: T::Array[Telnyx::AI::AssistantTool::Variants],
359
531
  transcription: Telnyx::AI::TranscriptionSettings,
532
+ version_created_at: Time,
533
+ version_id: String,
534
+ version_name: String,
360
535
  voice_settings: Telnyx::AI::VoiceSettings,
361
536
  widget_settings: Telnyx::AI::WidgetSettings
362
537
  }
@@ -408,11 +583,13 @@ module Telnyx
408
583
  sig { params(certificate_ref: String).void }
409
584
  attr_writer :certificate_ref
410
585
 
411
- # When enabled, Telnyx forwards the assistant's dynamic variables to the external
412
- # LLM endpoint. Defaults to false. The chat completion request includes a
413
- # top-level `extra_metadata` object when dynamic variables are available. For
414
- # example:
415
- # `{"extra_metadata":{"customer_name":"Jane","account_id":"acct_789","telnyx_agent_target":"+13125550100","telnyx_end_user_target":"+13125550123"}}`.
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.
416
593
  sig { returns(T.nilable(T::Boolean)) }
417
594
  attr_reader :forward_metadata
418
595
 
@@ -455,11 +632,13 @@ module Telnyx
455
632
  # Integration secret identifier for the client certificate used with certificate
456
633
  # authentication.
457
634
  certificate_ref: nil,
458
- # When enabled, Telnyx forwards the assistant's dynamic variables to the external
459
- # LLM endpoint. Defaults to false. The chat completion request includes a
460
- # top-level `extra_metadata` object when dynamic variables are available. For
461
- # example:
462
- # `{"extra_metadata":{"customer_name":"Jane","account_id":"acct_789","telnyx_agent_target":"+13125550100","telnyx_end_user_target":"+13125550123"}}`.
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.
463
642
  forward_metadata: nil,
464
643
  # Integration secret identifier for the external LLM API key.
465
644
  llm_api_key_ref: nil,
@@ -636,11 +815,13 @@ module Telnyx
636
815
  sig { params(certificate_ref: String).void }
637
816
  attr_writer :certificate_ref
638
817
 
639
- # When enabled, Telnyx forwards the assistant's dynamic variables to the external
640
- # LLM endpoint. Defaults to false. The chat completion request includes a
641
- # top-level `extra_metadata` object when dynamic variables are available. For
642
- # example:
643
- # `{"extra_metadata":{"customer_name":"Jane","account_id":"acct_789","telnyx_agent_target":"+13125550100","telnyx_end_user_target":"+13125550123"}}`.
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.
644
825
  sig { returns(T.nilable(T::Boolean)) }
645
826
  attr_reader :forward_metadata
646
827
 
@@ -683,11 +864,13 @@ module Telnyx
683
864
  # Integration secret identifier for the client certificate used with certificate
684
865
  # authentication.
685
866
  certificate_ref: nil,
686
- # When enabled, Telnyx forwards the assistant's dynamic variables to the external
687
- # LLM endpoint. Defaults to false. The chat completion request includes a
688
- # top-level `extra_metadata` object when dynamic variables are available. For
689
- # example:
690
- # `{"extra_metadata":{"customer_name":"Jane","account_id":"acct_789","telnyx_agent_target":"+13125550100","telnyx_end_user_target":"+13125550123"}}`.
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.
691
874
  forward_metadata: nil,
692
875
  # Integration secret identifier for the external LLM API key.
693
876
  llm_api_key_ref: nil,
@@ -750,6 +933,319 @@ module Telnyx
750
933
  end
751
934
  end
752
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
+
753
1249
  class PostConversationSettings < Telnyx::Internal::Type::BaseModel
754
1250
  OrHash =
755
1251
  T.type_alias do