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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/telnyx/models/ai/assistant_create_params.rb +265 -37
- data/lib/telnyx/models/ai/assistant_update_params.rb +266 -30
- data/lib/telnyx/models/ai/assistants/update_assistant.rb +267 -30
- data/lib/telnyx/models/ai/inference_embedding.rb +287 -29
- data/lib/telnyx/resources/ai/assistants/versions.rb +18 -6
- data/lib/telnyx/resources/ai/assistants.rb +35 -13
- data/lib/telnyx/version.rb +1 -1
- data/rbi/telnyx/models/ai/assistant_create_params.rbi +510 -52
- data/rbi/telnyx/models/ai/assistant_update_params.rbi +510 -44
- data/rbi/telnyx/models/ai/assistants/update_assistant.rbi +526 -44
- data/rbi/telnyx/models/ai/inference_embedding.rbi +540 -44
- data/rbi/telnyx/resources/ai/assistants/versions.rbi +61 -13
- data/rbi/telnyx/resources/ai/assistants.rbi +112 -27
- data/sig/telnyx/models/ai/assistant_create_params.rbs +172 -5
- data/sig/telnyx/models/ai/assistant_update_params.rbs +172 -0
- data/sig/telnyx/models/ai/assistants/update_assistant.rbs +175 -0
- data/sig/telnyx/models/ai/inference_embedding.rbs +193 -0
- data/sig/telnyx/resources/ai/assistants/versions.rbs +6 -0
- data/sig/telnyx/resources/ai/assistants.rbs +12 -1
- metadata +1 -1
|
@@ -17,12 +17,6 @@ module Telnyx
|
|
|
17
17
|
sig { returns(String) }
|
|
18
18
|
attr_accessor :instructions
|
|
19
19
|
|
|
20
|
-
# ID of the model to use. You can use the
|
|
21
|
-
# [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
22
|
-
# to see all of your available models,
|
|
23
|
-
sig { returns(String) }
|
|
24
|
-
attr_accessor :model
|
|
25
|
-
|
|
26
20
|
sig { returns(String) }
|
|
27
21
|
attr_accessor :name
|
|
28
22
|
|
|
@@ -39,10 +33,24 @@ module Telnyx
|
|
|
39
33
|
sig { params(dynamic_variables: T::Hash[Symbol, T.anything]).void }
|
|
40
34
|
attr_writer :dynamic_variables
|
|
41
35
|
|
|
42
|
-
#
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
#
|
|
36
|
+
# Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
|
|
37
|
+
# 10000 ms. If the webhook does not respond within this timeout, the call proceeds
|
|
38
|
+
# with default values. See the
|
|
39
|
+
# [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
40
|
+
sig { returns(T.nilable(Integer)) }
|
|
41
|
+
attr_reader :dynamic_variables_webhook_timeout_ms
|
|
42
|
+
|
|
43
|
+
sig { params(dynamic_variables_webhook_timeout_ms: Integer).void }
|
|
44
|
+
attr_writer :dynamic_variables_webhook_timeout_ms
|
|
45
|
+
|
|
46
|
+
# If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
|
|
47
|
+
# URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
|
|
48
|
+
# the webhook response must wrap variables under a top-level `dynamic_variables`
|
|
49
|
+
# object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
|
|
50
|
+
# flat object will be ignored and variables will fall back to their defaults. See
|
|
51
|
+
# the
|
|
52
|
+
# [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
53
|
+
# for the full request/response format and timeout behavior.
|
|
46
54
|
sig { returns(T.nilable(String)) }
|
|
47
55
|
attr_reader :dynamic_variables_webhook_url
|
|
48
56
|
|
|
@@ -106,17 +114,75 @@ module Telnyx
|
|
|
106
114
|
end
|
|
107
115
|
attr_writer :insight_settings
|
|
108
116
|
|
|
109
|
-
#
|
|
110
|
-
#
|
|
117
|
+
# Connected integrations attached to the assistant. The catalog of available
|
|
118
|
+
# integrations is at `/ai/integrations`; the user's connected integrations are at
|
|
119
|
+
# `/ai/integrations/connections`. Each item references a catalog integration by
|
|
120
|
+
# `integration_id`.
|
|
121
|
+
sig do
|
|
122
|
+
returns(
|
|
123
|
+
T.nilable(T::Array[Telnyx::AI::AssistantCreateParams::Integration])
|
|
124
|
+
)
|
|
125
|
+
end
|
|
126
|
+
attr_reader :integrations
|
|
127
|
+
|
|
128
|
+
sig do
|
|
129
|
+
params(
|
|
130
|
+
integrations:
|
|
131
|
+
T::Array[Telnyx::AI::AssistantCreateParams::Integration::OrHash]
|
|
132
|
+
).void
|
|
133
|
+
end
|
|
134
|
+
attr_writer :integrations
|
|
135
|
+
|
|
136
|
+
# Settings for interruptions and how the assistant decides the user has finished
|
|
137
|
+
# speaking. These timings are most relevant when using non turn-taking
|
|
138
|
+
# transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
139
|
+
# behavior is controlled by the transcription end-of-turn settings under
|
|
140
|
+
# `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
141
|
+
# `eager_eot_threshold`).
|
|
142
|
+
sig do
|
|
143
|
+
returns(
|
|
144
|
+
T.nilable(Telnyx::AI::AssistantCreateParams::InterruptionSettings)
|
|
145
|
+
)
|
|
146
|
+
end
|
|
147
|
+
attr_reader :interruption_settings
|
|
148
|
+
|
|
149
|
+
sig do
|
|
150
|
+
params(
|
|
151
|
+
interruption_settings:
|
|
152
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings::OrHash
|
|
153
|
+
).void
|
|
154
|
+
end
|
|
155
|
+
attr_writer :interruption_settings
|
|
156
|
+
|
|
157
|
+
# This is only needed when using third-party inference providers selected by
|
|
158
|
+
# `model`. The `identifier` for an integration secret
|
|
111
159
|
# [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
112
|
-
# that refers to your LLM provider's API key.
|
|
113
|
-
#
|
|
160
|
+
# that refers to your LLM provider's API key. For bring-your-own endpoint
|
|
161
|
+
# authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
|
|
162
|
+
# are unlikely to work with this integration.
|
|
114
163
|
sig { returns(T.nilable(String)) }
|
|
115
164
|
attr_reader :llm_api_key_ref
|
|
116
165
|
|
|
117
166
|
sig { params(llm_api_key_ref: String).void }
|
|
118
167
|
attr_writer :llm_api_key_ref
|
|
119
168
|
|
|
169
|
+
# MCP servers attached to the assistant. Create MCP servers with
|
|
170
|
+
# `/ai/mcp_servers`, then reference them by `id` here.
|
|
171
|
+
sig do
|
|
172
|
+
returns(
|
|
173
|
+
T.nilable(T::Array[Telnyx::AI::AssistantCreateParams::McpServer])
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
attr_reader :mcp_servers
|
|
177
|
+
|
|
178
|
+
sig do
|
|
179
|
+
params(
|
|
180
|
+
mcp_servers:
|
|
181
|
+
T::Array[Telnyx::AI::AssistantCreateParams::McpServer::OrHash]
|
|
182
|
+
).void
|
|
183
|
+
end
|
|
184
|
+
attr_writer :mcp_servers
|
|
185
|
+
|
|
120
186
|
sig { returns(T.nilable(Telnyx::AI::MessagingSettings)) }
|
|
121
187
|
attr_reader :messaging_settings
|
|
122
188
|
|
|
@@ -125,6 +191,17 @@ module Telnyx
|
|
|
125
191
|
end
|
|
126
192
|
attr_writer :messaging_settings
|
|
127
193
|
|
|
194
|
+
# ID of the model to use when `external_llm` is not set. You can use the
|
|
195
|
+
# [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
196
|
+
# to see available models. If `external_llm` is provided, the assistant uses
|
|
197
|
+
# `external_llm` instead of this field. If neither `model` nor `external_llm` is
|
|
198
|
+
# provided, Telnyx applies the default model.
|
|
199
|
+
sig { returns(T.nilable(String)) }
|
|
200
|
+
attr_reader :model
|
|
201
|
+
|
|
202
|
+
sig { params(model: String).void }
|
|
203
|
+
attr_writer :model
|
|
204
|
+
|
|
128
205
|
sig { returns(T.nilable(Telnyx::AI::ObservabilityReq)) }
|
|
129
206
|
attr_reader :observability_settings
|
|
130
207
|
|
|
@@ -166,6 +243,14 @@ module Telnyx
|
|
|
166
243
|
end
|
|
167
244
|
attr_writer :privacy_settings
|
|
168
245
|
|
|
246
|
+
# Tags associated with the assistant. Tags can also be managed with the assistant
|
|
247
|
+
# tag endpoints.
|
|
248
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
249
|
+
attr_reader :tags
|
|
250
|
+
|
|
251
|
+
sig { params(tags: T::Array[String]).void }
|
|
252
|
+
attr_writer :tags
|
|
253
|
+
|
|
169
254
|
sig { returns(T.nilable(Telnyx::AI::TelephonySettings)) }
|
|
170
255
|
attr_reader :telephony_settings
|
|
171
256
|
|
|
@@ -174,14 +259,17 @@ module Telnyx
|
|
|
174
259
|
end
|
|
175
260
|
attr_writer :telephony_settings
|
|
176
261
|
|
|
262
|
+
# IDs of shared tools to attach to the assistant. New integrations should prefer
|
|
263
|
+
# `tool_ids` over inline `tools`.
|
|
177
264
|
sig { returns(T.nilable(T::Array[String])) }
|
|
178
265
|
attr_reader :tool_ids
|
|
179
266
|
|
|
180
267
|
sig { params(tool_ids: T::Array[String]).void }
|
|
181
268
|
attr_writer :tool_ids
|
|
182
269
|
|
|
183
|
-
#
|
|
184
|
-
#
|
|
270
|
+
# Deprecated for new integrations. Inline tool definitions available to the
|
|
271
|
+
# assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
|
|
272
|
+
# endpoints.
|
|
185
273
|
sig do
|
|
186
274
|
returns(
|
|
187
275
|
T.nilable(
|
|
@@ -249,10 +337,10 @@ module Telnyx
|
|
|
249
337
|
sig do
|
|
250
338
|
params(
|
|
251
339
|
instructions: String,
|
|
252
|
-
model: String,
|
|
253
340
|
name: String,
|
|
254
341
|
description: String,
|
|
255
342
|
dynamic_variables: T::Hash[Symbol, T.anything],
|
|
343
|
+
dynamic_variables_webhook_timeout_ms: Integer,
|
|
256
344
|
dynamic_variables_webhook_url: String,
|
|
257
345
|
enabled_features: T::Array[Telnyx::AI::EnabledFeatures::OrSymbol],
|
|
258
346
|
external_llm:
|
|
@@ -261,12 +349,20 @@ module Telnyx
|
|
|
261
349
|
Telnyx::AI::AssistantCreateParams::FallbackConfig::OrHash,
|
|
262
350
|
greeting: String,
|
|
263
351
|
insight_settings: Telnyx::AI::InsightSettings::OrHash,
|
|
352
|
+
integrations:
|
|
353
|
+
T::Array[Telnyx::AI::AssistantCreateParams::Integration::OrHash],
|
|
354
|
+
interruption_settings:
|
|
355
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings::OrHash,
|
|
264
356
|
llm_api_key_ref: String,
|
|
357
|
+
mcp_servers:
|
|
358
|
+
T::Array[Telnyx::AI::AssistantCreateParams::McpServer::OrHash],
|
|
265
359
|
messaging_settings: Telnyx::AI::MessagingSettings::OrHash,
|
|
360
|
+
model: String,
|
|
266
361
|
observability_settings: Telnyx::AI::ObservabilityReq::OrHash,
|
|
267
362
|
post_conversation_settings:
|
|
268
363
|
Telnyx::AI::AssistantCreateParams::PostConversationSettings::OrHash,
|
|
269
364
|
privacy_settings: Telnyx::AI::PrivacySettings::OrHash,
|
|
365
|
+
tags: T::Array[String],
|
|
270
366
|
telephony_settings: Telnyx::AI::TelephonySettings::OrHash,
|
|
271
367
|
tool_ids: T::Array[String],
|
|
272
368
|
tools:
|
|
@@ -294,18 +390,23 @@ module Telnyx
|
|
|
294
390
|
# System instructions for the assistant. These may be templated with
|
|
295
391
|
# [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
296
392
|
instructions:,
|
|
297
|
-
# ID of the model to use. You can use the
|
|
298
|
-
# [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
299
|
-
# to see all of your available models,
|
|
300
|
-
model:,
|
|
301
393
|
name:,
|
|
302
394
|
description: nil,
|
|
303
395
|
# Map of dynamic variables and their default values
|
|
304
396
|
dynamic_variables: nil,
|
|
305
|
-
#
|
|
306
|
-
#
|
|
307
|
-
#
|
|
308
|
-
#
|
|
397
|
+
# Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
|
|
398
|
+
# 10000 ms. If the webhook does not respond within this timeout, the call proceeds
|
|
399
|
+
# with default values. See the
|
|
400
|
+
# [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
401
|
+
dynamic_variables_webhook_timeout_ms: nil,
|
|
402
|
+
# If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
|
|
403
|
+
# URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
|
|
404
|
+
# the webhook response must wrap variables under a top-level `dynamic_variables`
|
|
405
|
+
# object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
|
|
406
|
+
# flat object will be ignored and variables will fall back to their defaults. See
|
|
407
|
+
# the
|
|
408
|
+
# [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
409
|
+
# for the full request/response format and timeout behavior.
|
|
309
410
|
dynamic_variables_webhook_url: nil,
|
|
310
411
|
enabled_features: nil,
|
|
311
412
|
external_llm: nil,
|
|
@@ -318,13 +419,35 @@ module Telnyx
|
|
|
318
419
|
# have the assistant generate the greeting based on the system instructions.
|
|
319
420
|
greeting: nil,
|
|
320
421
|
insight_settings: nil,
|
|
321
|
-
#
|
|
322
|
-
#
|
|
422
|
+
# Connected integrations attached to the assistant. The catalog of available
|
|
423
|
+
# integrations is at `/ai/integrations`; the user's connected integrations are at
|
|
424
|
+
# `/ai/integrations/connections`. Each item references a catalog integration by
|
|
425
|
+
# `integration_id`.
|
|
426
|
+
integrations: nil,
|
|
427
|
+
# Settings for interruptions and how the assistant decides the user has finished
|
|
428
|
+
# speaking. These timings are most relevant when using non turn-taking
|
|
429
|
+
# transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
430
|
+
# behavior is controlled by the transcription end-of-turn settings under
|
|
431
|
+
# `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
432
|
+
# `eager_eot_threshold`).
|
|
433
|
+
interruption_settings: nil,
|
|
434
|
+
# This is only needed when using third-party inference providers selected by
|
|
435
|
+
# `model`. The `identifier` for an integration secret
|
|
323
436
|
# [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
324
|
-
# that refers to your LLM provider's API key.
|
|
325
|
-
#
|
|
437
|
+
# that refers to your LLM provider's API key. For bring-your-own endpoint
|
|
438
|
+
# authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
|
|
439
|
+
# are unlikely to work with this integration.
|
|
326
440
|
llm_api_key_ref: nil,
|
|
441
|
+
# MCP servers attached to the assistant. Create MCP servers with
|
|
442
|
+
# `/ai/mcp_servers`, then reference them by `id` here.
|
|
443
|
+
mcp_servers: nil,
|
|
327
444
|
messaging_settings: nil,
|
|
445
|
+
# ID of the model to use when `external_llm` is not set. You can use the
|
|
446
|
+
# [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
447
|
+
# to see available models. If `external_llm` is provided, the assistant uses
|
|
448
|
+
# `external_llm` instead of this field. If neither `model` nor `external_llm` is
|
|
449
|
+
# provided, Telnyx applies the default model.
|
|
450
|
+
model: nil,
|
|
328
451
|
observability_settings: nil,
|
|
329
452
|
# Configuration for post-conversation processing. When enabled, the assistant
|
|
330
453
|
# receives one additional LLM turn after the conversation ends, allowing it to
|
|
@@ -334,10 +457,16 @@ module Telnyx
|
|
|
334
457
|
# post-conversation. Beta feature.
|
|
335
458
|
post_conversation_settings: nil,
|
|
336
459
|
privacy_settings: nil,
|
|
460
|
+
# Tags associated with the assistant. Tags can also be managed with the assistant
|
|
461
|
+
# tag endpoints.
|
|
462
|
+
tags: nil,
|
|
337
463
|
telephony_settings: nil,
|
|
464
|
+
# IDs of shared tools to attach to the assistant. New integrations should prefer
|
|
465
|
+
# `tool_ids` over inline `tools`.
|
|
338
466
|
tool_ids: nil,
|
|
339
|
-
#
|
|
340
|
-
#
|
|
467
|
+
# Deprecated for new integrations. Inline tool definitions available to the
|
|
468
|
+
# assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
|
|
469
|
+
# endpoints.
|
|
341
470
|
tools: nil,
|
|
342
471
|
transcription: nil,
|
|
343
472
|
voice_settings: nil,
|
|
@@ -351,10 +480,10 @@ module Telnyx
|
|
|
351
480
|
override.returns(
|
|
352
481
|
{
|
|
353
482
|
instructions: String,
|
|
354
|
-
model: String,
|
|
355
483
|
name: String,
|
|
356
484
|
description: String,
|
|
357
485
|
dynamic_variables: T::Hash[Symbol, T.anything],
|
|
486
|
+
dynamic_variables_webhook_timeout_ms: Integer,
|
|
358
487
|
dynamic_variables_webhook_url: String,
|
|
359
488
|
enabled_features: T::Array[Telnyx::AI::EnabledFeatures::OrSymbol],
|
|
360
489
|
external_llm: Telnyx::AI::AssistantCreateParams::ExternalLlm,
|
|
@@ -362,12 +491,20 @@ module Telnyx
|
|
|
362
491
|
Telnyx::AI::AssistantCreateParams::FallbackConfig,
|
|
363
492
|
greeting: String,
|
|
364
493
|
insight_settings: Telnyx::AI::InsightSettings,
|
|
494
|
+
integrations:
|
|
495
|
+
T::Array[Telnyx::AI::AssistantCreateParams::Integration],
|
|
496
|
+
interruption_settings:
|
|
497
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings,
|
|
365
498
|
llm_api_key_ref: String,
|
|
499
|
+
mcp_servers:
|
|
500
|
+
T::Array[Telnyx::AI::AssistantCreateParams::McpServer],
|
|
366
501
|
messaging_settings: Telnyx::AI::MessagingSettings,
|
|
502
|
+
model: String,
|
|
367
503
|
observability_settings: Telnyx::AI::ObservabilityReq,
|
|
368
504
|
post_conversation_settings:
|
|
369
505
|
Telnyx::AI::AssistantCreateParams::PostConversationSettings,
|
|
370
506
|
privacy_settings: Telnyx::AI::PrivacySettings,
|
|
507
|
+
tags: T::Array[String],
|
|
371
508
|
telephony_settings: Telnyx::AI::TelephonySettings,
|
|
372
509
|
tool_ids: T::Array[String],
|
|
373
510
|
tools:
|
|
@@ -438,11 +575,13 @@ module Telnyx
|
|
|
438
575
|
sig { params(certificate_ref: String).void }
|
|
439
576
|
attr_writer :certificate_ref
|
|
440
577
|
|
|
441
|
-
# When
|
|
442
|
-
# LLM endpoint
|
|
443
|
-
#
|
|
444
|
-
#
|
|
445
|
-
# `{"extra_metadata":{"customer_name":"Jane","account_id":"acct_789","telnyx_agent_target":"+13125550100","telnyx_end_user_target":"+13125550123"}}`.
|
|
578
|
+
# When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
579
|
+
# LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
580
|
+
# request body. Defaults to `false`. Example payload sent to the external
|
|
581
|
+
# endpoint:
|
|
582
|
+
# `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
583
|
+
# Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
584
|
+
# limits.
|
|
446
585
|
sig { returns(T.nilable(T::Boolean)) }
|
|
447
586
|
attr_reader :forward_metadata
|
|
448
587
|
|
|
@@ -485,11 +624,13 @@ module Telnyx
|
|
|
485
624
|
# Integration secret identifier for the client certificate used with certificate
|
|
486
625
|
# authentication.
|
|
487
626
|
certificate_ref: nil,
|
|
488
|
-
# When
|
|
489
|
-
# LLM endpoint
|
|
490
|
-
#
|
|
491
|
-
#
|
|
492
|
-
# `{"extra_metadata":{"customer_name":"Jane","account_id":"acct_789","telnyx_agent_target":"+13125550100","telnyx_end_user_target":"+13125550123"}}`.
|
|
627
|
+
# When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
628
|
+
# LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
629
|
+
# request body. Defaults to `false`. Example payload sent to the external
|
|
630
|
+
# endpoint:
|
|
631
|
+
# `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
632
|
+
# Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
633
|
+
# limits.
|
|
493
634
|
forward_metadata: nil,
|
|
494
635
|
# Integration secret identifier for the external LLM API key.
|
|
495
636
|
llm_api_key_ref: nil,
|
|
@@ -666,11 +807,13 @@ module Telnyx
|
|
|
666
807
|
sig { params(certificate_ref: String).void }
|
|
667
808
|
attr_writer :certificate_ref
|
|
668
809
|
|
|
669
|
-
# When
|
|
670
|
-
# LLM endpoint
|
|
671
|
-
#
|
|
672
|
-
#
|
|
673
|
-
# `{"extra_metadata":{"customer_name":"Jane","account_id":"acct_789","telnyx_agent_target":"+13125550100","telnyx_end_user_target":"+13125550123"}}`.
|
|
810
|
+
# When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
811
|
+
# LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
812
|
+
# request body. Defaults to `false`. Example payload sent to the external
|
|
813
|
+
# endpoint:
|
|
814
|
+
# `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
815
|
+
# Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
816
|
+
# limits.
|
|
674
817
|
sig { returns(T.nilable(T::Boolean)) }
|
|
675
818
|
attr_reader :forward_metadata
|
|
676
819
|
|
|
@@ -713,11 +856,13 @@ module Telnyx
|
|
|
713
856
|
# Integration secret identifier for the client certificate used with certificate
|
|
714
857
|
# authentication.
|
|
715
858
|
certificate_ref: nil,
|
|
716
|
-
# When
|
|
717
|
-
# LLM endpoint
|
|
718
|
-
#
|
|
719
|
-
#
|
|
720
|
-
# `{"extra_metadata":{"customer_name":"Jane","account_id":"acct_789","telnyx_agent_target":"+13125550100","telnyx_end_user_target":"+13125550123"}}`.
|
|
859
|
+
# When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
860
|
+
# LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
861
|
+
# request body. Defaults to `false`. Example payload sent to the external
|
|
862
|
+
# endpoint:
|
|
863
|
+
# `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
864
|
+
# Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
865
|
+
# limits.
|
|
721
866
|
forward_metadata: nil,
|
|
722
867
|
# Integration secret identifier for the external LLM API key.
|
|
723
868
|
llm_api_key_ref: nil,
|
|
@@ -780,6 +925,319 @@ module Telnyx
|
|
|
780
925
|
end
|
|
781
926
|
end
|
|
782
927
|
|
|
928
|
+
class Integration < Telnyx::Internal::Type::BaseModel
|
|
929
|
+
OrHash =
|
|
930
|
+
T.type_alias do
|
|
931
|
+
T.any(
|
|
932
|
+
Telnyx::AI::AssistantCreateParams::Integration,
|
|
933
|
+
Telnyx::Internal::AnyHash
|
|
934
|
+
)
|
|
935
|
+
end
|
|
936
|
+
|
|
937
|
+
# Catalog integration ID to attach. This is the `id` from the integrations catalog
|
|
938
|
+
# at `/ai/integrations` (the same value also appears as `integration_id` on
|
|
939
|
+
# entries returned by `/ai/integrations/connections`). It is **not** the
|
|
940
|
+
# connection-level `id` from `/ai/integrations/connections`.
|
|
941
|
+
sig { returns(String) }
|
|
942
|
+
attr_accessor :integration_id
|
|
943
|
+
|
|
944
|
+
# Optional per-assistant allowlist of integration tool names. When omitted or
|
|
945
|
+
# empty, all tools allowed by the connected integration are available to the
|
|
946
|
+
# assistant.
|
|
947
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
948
|
+
attr_reader :allowed_list
|
|
949
|
+
|
|
950
|
+
sig { params(allowed_list: T::Array[String]).void }
|
|
951
|
+
attr_writer :allowed_list
|
|
952
|
+
|
|
953
|
+
# Reference to a connected integration attached to an assistant. Discover
|
|
954
|
+
# available integrations with `/ai/integrations` and connected integrations with
|
|
955
|
+
# `/ai/integrations/connections`.
|
|
956
|
+
sig do
|
|
957
|
+
params(
|
|
958
|
+
integration_id: String,
|
|
959
|
+
allowed_list: T::Array[String]
|
|
960
|
+
).returns(T.attached_class)
|
|
961
|
+
end
|
|
962
|
+
def self.new(
|
|
963
|
+
# Catalog integration ID to attach. This is the `id` from the integrations catalog
|
|
964
|
+
# at `/ai/integrations` (the same value also appears as `integration_id` on
|
|
965
|
+
# entries returned by `/ai/integrations/connections`). It is **not** the
|
|
966
|
+
# connection-level `id` from `/ai/integrations/connections`.
|
|
967
|
+
integration_id:,
|
|
968
|
+
# Optional per-assistant allowlist of integration tool names. When omitted or
|
|
969
|
+
# empty, all tools allowed by the connected integration are available to the
|
|
970
|
+
# assistant.
|
|
971
|
+
allowed_list: nil
|
|
972
|
+
)
|
|
973
|
+
end
|
|
974
|
+
|
|
975
|
+
sig do
|
|
976
|
+
override.returns(
|
|
977
|
+
{ integration_id: String, allowed_list: T::Array[String] }
|
|
978
|
+
)
|
|
979
|
+
end
|
|
980
|
+
def to_hash
|
|
981
|
+
end
|
|
982
|
+
end
|
|
983
|
+
|
|
984
|
+
class InterruptionSettings < Telnyx::Internal::Type::BaseModel
|
|
985
|
+
OrHash =
|
|
986
|
+
T.type_alias do
|
|
987
|
+
T.any(
|
|
988
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings,
|
|
989
|
+
Telnyx::Internal::AnyHash
|
|
990
|
+
)
|
|
991
|
+
end
|
|
992
|
+
|
|
993
|
+
# Whether users can interrupt the assistant while it is speaking.
|
|
994
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
995
|
+
attr_reader :enable
|
|
996
|
+
|
|
997
|
+
sig { params(enable: T::Boolean).void }
|
|
998
|
+
attr_writer :enable
|
|
999
|
+
|
|
1000
|
+
# Controls when the assistant starts speaking after the user stops. These
|
|
1001
|
+
# thresholds primarily apply to non turn-taking transcription models. For
|
|
1002
|
+
# turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
1003
|
+
# transcription end-of-turn settings under `transcription.settings` instead.
|
|
1004
|
+
sig do
|
|
1005
|
+
returns(
|
|
1006
|
+
T.nilable(
|
|
1007
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings::StartSpeakingPlan
|
|
1008
|
+
)
|
|
1009
|
+
)
|
|
1010
|
+
end
|
|
1011
|
+
attr_reader :start_speaking_plan
|
|
1012
|
+
|
|
1013
|
+
sig do
|
|
1014
|
+
params(
|
|
1015
|
+
start_speaking_plan:
|
|
1016
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings::StartSpeakingPlan::OrHash
|
|
1017
|
+
).void
|
|
1018
|
+
end
|
|
1019
|
+
attr_writer :start_speaking_plan
|
|
1020
|
+
|
|
1021
|
+
# Settings for interruptions and how the assistant decides the user has finished
|
|
1022
|
+
# speaking. These timings are most relevant when using non turn-taking
|
|
1023
|
+
# transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
1024
|
+
# behavior is controlled by the transcription end-of-turn settings under
|
|
1025
|
+
# `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
1026
|
+
# `eager_eot_threshold`).
|
|
1027
|
+
sig do
|
|
1028
|
+
params(
|
|
1029
|
+
enable: T::Boolean,
|
|
1030
|
+
start_speaking_plan:
|
|
1031
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings::StartSpeakingPlan::OrHash
|
|
1032
|
+
).returns(T.attached_class)
|
|
1033
|
+
end
|
|
1034
|
+
def self.new(
|
|
1035
|
+
# Whether users can interrupt the assistant while it is speaking.
|
|
1036
|
+
enable: nil,
|
|
1037
|
+
# Controls when the assistant starts speaking after the user stops. These
|
|
1038
|
+
# thresholds primarily apply to non turn-taking transcription models. For
|
|
1039
|
+
# turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
1040
|
+
# transcription end-of-turn settings under `transcription.settings` instead.
|
|
1041
|
+
start_speaking_plan: nil
|
|
1042
|
+
)
|
|
1043
|
+
end
|
|
1044
|
+
|
|
1045
|
+
sig do
|
|
1046
|
+
override.returns(
|
|
1047
|
+
{
|
|
1048
|
+
enable: T::Boolean,
|
|
1049
|
+
start_speaking_plan:
|
|
1050
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings::StartSpeakingPlan
|
|
1051
|
+
}
|
|
1052
|
+
)
|
|
1053
|
+
end
|
|
1054
|
+
def to_hash
|
|
1055
|
+
end
|
|
1056
|
+
|
|
1057
|
+
class StartSpeakingPlan < Telnyx::Internal::Type::BaseModel
|
|
1058
|
+
OrHash =
|
|
1059
|
+
T.type_alias do
|
|
1060
|
+
T.any(
|
|
1061
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings::StartSpeakingPlan,
|
|
1062
|
+
Telnyx::Internal::AnyHash
|
|
1063
|
+
)
|
|
1064
|
+
end
|
|
1065
|
+
|
|
1066
|
+
# Endpointing thresholds used to decide when the user has finished speaking.
|
|
1067
|
+
# Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
1068
|
+
# `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
1069
|
+
# `eager_eot_threshold`.
|
|
1070
|
+
sig do
|
|
1071
|
+
returns(
|
|
1072
|
+
T.nilable(
|
|
1073
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan
|
|
1074
|
+
)
|
|
1075
|
+
)
|
|
1076
|
+
end
|
|
1077
|
+
attr_reader :transcription_endpointing_plan
|
|
1078
|
+
|
|
1079
|
+
sig do
|
|
1080
|
+
params(
|
|
1081
|
+
transcription_endpointing_plan:
|
|
1082
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan::OrHash
|
|
1083
|
+
).void
|
|
1084
|
+
end
|
|
1085
|
+
attr_writer :transcription_endpointing_plan
|
|
1086
|
+
|
|
1087
|
+
# Minimum seconds to wait before the assistant starts speaking.
|
|
1088
|
+
sig { returns(T.nilable(Float)) }
|
|
1089
|
+
attr_reader :wait_seconds
|
|
1090
|
+
|
|
1091
|
+
sig { params(wait_seconds: Float).void }
|
|
1092
|
+
attr_writer :wait_seconds
|
|
1093
|
+
|
|
1094
|
+
# Controls when the assistant starts speaking after the user stops. These
|
|
1095
|
+
# thresholds primarily apply to non turn-taking transcription models. For
|
|
1096
|
+
# turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
1097
|
+
# transcription end-of-turn settings under `transcription.settings` instead.
|
|
1098
|
+
sig do
|
|
1099
|
+
params(
|
|
1100
|
+
transcription_endpointing_plan:
|
|
1101
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan::OrHash,
|
|
1102
|
+
wait_seconds: Float
|
|
1103
|
+
).returns(T.attached_class)
|
|
1104
|
+
end
|
|
1105
|
+
def self.new(
|
|
1106
|
+
# Endpointing thresholds used to decide when the user has finished speaking.
|
|
1107
|
+
# Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
1108
|
+
# `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
1109
|
+
# `eager_eot_threshold`.
|
|
1110
|
+
transcription_endpointing_plan: nil,
|
|
1111
|
+
# Minimum seconds to wait before the assistant starts speaking.
|
|
1112
|
+
wait_seconds: nil
|
|
1113
|
+
)
|
|
1114
|
+
end
|
|
1115
|
+
|
|
1116
|
+
sig do
|
|
1117
|
+
override.returns(
|
|
1118
|
+
{
|
|
1119
|
+
transcription_endpointing_plan:
|
|
1120
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan,
|
|
1121
|
+
wait_seconds: Float
|
|
1122
|
+
}
|
|
1123
|
+
)
|
|
1124
|
+
end
|
|
1125
|
+
def to_hash
|
|
1126
|
+
end
|
|
1127
|
+
|
|
1128
|
+
class TranscriptionEndpointingPlan < Telnyx::Internal::Type::BaseModel
|
|
1129
|
+
OrHash =
|
|
1130
|
+
T.type_alias do
|
|
1131
|
+
T.any(
|
|
1132
|
+
Telnyx::AI::AssistantCreateParams::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan,
|
|
1133
|
+
Telnyx::Internal::AnyHash
|
|
1134
|
+
)
|
|
1135
|
+
end
|
|
1136
|
+
|
|
1137
|
+
# Seconds to wait after the transcript ends without punctuation.
|
|
1138
|
+
sig { returns(T.nilable(Float)) }
|
|
1139
|
+
attr_reader :on_no_punctuation_seconds
|
|
1140
|
+
|
|
1141
|
+
sig { params(on_no_punctuation_seconds: Float).void }
|
|
1142
|
+
attr_writer :on_no_punctuation_seconds
|
|
1143
|
+
|
|
1144
|
+
# Seconds to wait after the transcript ends with a number.
|
|
1145
|
+
sig { returns(T.nilable(Float)) }
|
|
1146
|
+
attr_reader :on_number_seconds
|
|
1147
|
+
|
|
1148
|
+
sig { params(on_number_seconds: Float).void }
|
|
1149
|
+
attr_writer :on_number_seconds
|
|
1150
|
+
|
|
1151
|
+
# Seconds to wait after the transcript ends with punctuation.
|
|
1152
|
+
sig { returns(T.nilable(Float)) }
|
|
1153
|
+
attr_reader :on_punctuation_seconds
|
|
1154
|
+
|
|
1155
|
+
sig { params(on_punctuation_seconds: Float).void }
|
|
1156
|
+
attr_writer :on_punctuation_seconds
|
|
1157
|
+
|
|
1158
|
+
# Endpointing thresholds used to decide when the user has finished speaking.
|
|
1159
|
+
# Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
1160
|
+
# `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
1161
|
+
# `eager_eot_threshold`.
|
|
1162
|
+
sig do
|
|
1163
|
+
params(
|
|
1164
|
+
on_no_punctuation_seconds: Float,
|
|
1165
|
+
on_number_seconds: Float,
|
|
1166
|
+
on_punctuation_seconds: Float
|
|
1167
|
+
).returns(T.attached_class)
|
|
1168
|
+
end
|
|
1169
|
+
def self.new(
|
|
1170
|
+
# Seconds to wait after the transcript ends without punctuation.
|
|
1171
|
+
on_no_punctuation_seconds: nil,
|
|
1172
|
+
# Seconds to wait after the transcript ends with a number.
|
|
1173
|
+
on_number_seconds: nil,
|
|
1174
|
+
# Seconds to wait after the transcript ends with punctuation.
|
|
1175
|
+
on_punctuation_seconds: nil
|
|
1176
|
+
)
|
|
1177
|
+
end
|
|
1178
|
+
|
|
1179
|
+
sig do
|
|
1180
|
+
override.returns(
|
|
1181
|
+
{
|
|
1182
|
+
on_no_punctuation_seconds: Float,
|
|
1183
|
+
on_number_seconds: Float,
|
|
1184
|
+
on_punctuation_seconds: Float
|
|
1185
|
+
}
|
|
1186
|
+
)
|
|
1187
|
+
end
|
|
1188
|
+
def to_hash
|
|
1189
|
+
end
|
|
1190
|
+
end
|
|
1191
|
+
end
|
|
1192
|
+
end
|
|
1193
|
+
|
|
1194
|
+
class McpServer < Telnyx::Internal::Type::BaseModel
|
|
1195
|
+
OrHash =
|
|
1196
|
+
T.type_alias do
|
|
1197
|
+
T.any(
|
|
1198
|
+
Telnyx::AI::AssistantCreateParams::McpServer,
|
|
1199
|
+
Telnyx::Internal::AnyHash
|
|
1200
|
+
)
|
|
1201
|
+
end
|
|
1202
|
+
|
|
1203
|
+
# ID of the MCP server to attach. This must be the `id` of an MCP server returned
|
|
1204
|
+
# by the `/ai/mcp_servers` endpoints.
|
|
1205
|
+
sig { returns(String) }
|
|
1206
|
+
attr_accessor :id
|
|
1207
|
+
|
|
1208
|
+
# Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
|
|
1209
|
+
# uses the MCP server's configured `allowed_tools`.
|
|
1210
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
1211
|
+
attr_reader :allowed_tools
|
|
1212
|
+
|
|
1213
|
+
sig { params(allowed_tools: T::Array[String]).void }
|
|
1214
|
+
attr_writer :allowed_tools
|
|
1215
|
+
|
|
1216
|
+
# Reference to an MCP server attached to an assistant. Create and manage MCP
|
|
1217
|
+
# servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
|
|
1218
|
+
# ID.
|
|
1219
|
+
sig do
|
|
1220
|
+
params(id: String, allowed_tools: T::Array[String]).returns(
|
|
1221
|
+
T.attached_class
|
|
1222
|
+
)
|
|
1223
|
+
end
|
|
1224
|
+
def self.new(
|
|
1225
|
+
# ID of the MCP server to attach. This must be the `id` of an MCP server returned
|
|
1226
|
+
# by the `/ai/mcp_servers` endpoints.
|
|
1227
|
+
id:,
|
|
1228
|
+
# Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
|
|
1229
|
+
# uses the MCP server's configured `allowed_tools`.
|
|
1230
|
+
allowed_tools: nil
|
|
1231
|
+
)
|
|
1232
|
+
end
|
|
1233
|
+
|
|
1234
|
+
sig do
|
|
1235
|
+
override.returns({ id: String, allowed_tools: T::Array[String] })
|
|
1236
|
+
end
|
|
1237
|
+
def to_hash
|
|
1238
|
+
end
|
|
1239
|
+
end
|
|
1240
|
+
|
|
783
1241
|
class PostConversationSettings < Telnyx::Internal::Type::BaseModel
|
|
784
1242
|
OrHash =
|
|
785
1243
|
T.type_alias do
|