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
|
@@ -28,10 +28,24 @@ module Telnyx
|
|
|
28
28
|
sig { params(dynamic_variables: T::Hash[Symbol, T.anything]).void }
|
|
29
29
|
attr_writer :dynamic_variables
|
|
30
30
|
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
31
|
+
# Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
|
|
32
|
+
# 10000 ms. If the webhook does not respond within this timeout, the call proceeds
|
|
33
|
+
# with default values. See the
|
|
34
|
+
# [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
35
|
+
sig { returns(T.nilable(Integer)) }
|
|
36
|
+
attr_reader :dynamic_variables_webhook_timeout_ms
|
|
37
|
+
|
|
38
|
+
sig { params(dynamic_variables_webhook_timeout_ms: Integer).void }
|
|
39
|
+
attr_writer :dynamic_variables_webhook_timeout_ms
|
|
40
|
+
|
|
41
|
+
# If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
|
|
42
|
+
# URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
|
|
43
|
+
# the webhook response must wrap variables under a top-level `dynamic_variables`
|
|
44
|
+
# object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
|
|
45
|
+
# flat object will be ignored and variables will fall back to their defaults. See
|
|
46
|
+
# the
|
|
47
|
+
# [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
48
|
+
# for the full request/response format and timeout behavior.
|
|
35
49
|
sig { returns(T.nilable(String)) }
|
|
36
50
|
attr_reader :dynamic_variables_webhook_url
|
|
37
51
|
|
|
@@ -108,17 +122,85 @@ module Telnyx
|
|
|
108
122
|
sig { params(instructions: String).void }
|
|
109
123
|
attr_writer :instructions
|
|
110
124
|
|
|
111
|
-
#
|
|
112
|
-
#
|
|
125
|
+
# Connected integrations attached to the assistant. The catalog of available
|
|
126
|
+
# integrations is at `/ai/integrations`; the user's connected integrations are at
|
|
127
|
+
# `/ai/integrations/connections`. Each item references a catalog integration by
|
|
128
|
+
# `integration_id`.
|
|
129
|
+
sig do
|
|
130
|
+
returns(
|
|
131
|
+
T.nilable(
|
|
132
|
+
T::Array[Telnyx::AI::Assistants::UpdateAssistant::Integration]
|
|
133
|
+
)
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
attr_reader :integrations
|
|
137
|
+
|
|
138
|
+
sig do
|
|
139
|
+
params(
|
|
140
|
+
integrations:
|
|
141
|
+
T::Array[
|
|
142
|
+
Telnyx::AI::Assistants::UpdateAssistant::Integration::OrHash
|
|
143
|
+
]
|
|
144
|
+
).void
|
|
145
|
+
end
|
|
146
|
+
attr_writer :integrations
|
|
147
|
+
|
|
148
|
+
# Settings for interruptions and how the assistant decides the user has finished
|
|
149
|
+
# speaking. These timings are most relevant when using non turn-taking
|
|
150
|
+
# transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
151
|
+
# behavior is controlled by the transcription end-of-turn settings under
|
|
152
|
+
# `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
153
|
+
# `eager_eot_threshold`).
|
|
154
|
+
sig do
|
|
155
|
+
returns(
|
|
156
|
+
T.nilable(
|
|
157
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings
|
|
158
|
+
)
|
|
159
|
+
)
|
|
160
|
+
end
|
|
161
|
+
attr_reader :interruption_settings
|
|
162
|
+
|
|
163
|
+
sig do
|
|
164
|
+
params(
|
|
165
|
+
interruption_settings:
|
|
166
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::OrHash
|
|
167
|
+
).void
|
|
168
|
+
end
|
|
169
|
+
attr_writer :interruption_settings
|
|
170
|
+
|
|
171
|
+
# This is only needed when using third-party inference providers selected by
|
|
172
|
+
# `model`. The `identifier` for an integration secret
|
|
113
173
|
# [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
114
|
-
# that refers to your LLM provider's API key.
|
|
115
|
-
#
|
|
174
|
+
# that refers to your LLM provider's API key. For bring-your-own endpoint
|
|
175
|
+
# authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
|
|
176
|
+
# are unlikely to work with this integration.
|
|
116
177
|
sig { returns(T.nilable(String)) }
|
|
117
178
|
attr_reader :llm_api_key_ref
|
|
118
179
|
|
|
119
180
|
sig { params(llm_api_key_ref: String).void }
|
|
120
181
|
attr_writer :llm_api_key_ref
|
|
121
182
|
|
|
183
|
+
# MCP servers attached to the assistant. Create MCP servers with
|
|
184
|
+
# `/ai/mcp_servers`, then reference them by `id` here.
|
|
185
|
+
sig do
|
|
186
|
+
returns(
|
|
187
|
+
T.nilable(
|
|
188
|
+
T::Array[Telnyx::AI::Assistants::UpdateAssistant::McpServer]
|
|
189
|
+
)
|
|
190
|
+
)
|
|
191
|
+
end
|
|
192
|
+
attr_reader :mcp_servers
|
|
193
|
+
|
|
194
|
+
sig do
|
|
195
|
+
params(
|
|
196
|
+
mcp_servers:
|
|
197
|
+
T::Array[
|
|
198
|
+
Telnyx::AI::Assistants::UpdateAssistant::McpServer::OrHash
|
|
199
|
+
]
|
|
200
|
+
).void
|
|
201
|
+
end
|
|
202
|
+
attr_writer :mcp_servers
|
|
203
|
+
|
|
122
204
|
sig { returns(T.nilable(Telnyx::AI::MessagingSettings)) }
|
|
123
205
|
attr_reader :messaging_settings
|
|
124
206
|
|
|
@@ -129,9 +211,11 @@ module Telnyx
|
|
|
129
211
|
end
|
|
130
212
|
attr_writer :messaging_settings
|
|
131
213
|
|
|
132
|
-
# ID of the model to use. You can use the
|
|
214
|
+
# ID of the model to use when `external_llm` is not set. You can use the
|
|
133
215
|
# [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
134
|
-
# to see
|
|
216
|
+
# to see available models. If `external_llm` is provided, the assistant uses
|
|
217
|
+
# `external_llm` instead of this field. If neither `model` nor `external_llm` is
|
|
218
|
+
# provided, Telnyx applies the default model.
|
|
135
219
|
sig { returns(T.nilable(String)) }
|
|
136
220
|
attr_reader :model
|
|
137
221
|
|
|
@@ -185,6 +269,14 @@ module Telnyx
|
|
|
185
269
|
end
|
|
186
270
|
attr_writer :privacy_settings
|
|
187
271
|
|
|
272
|
+
# Tags associated with the assistant. Tags can also be managed with the assistant
|
|
273
|
+
# tag endpoints.
|
|
274
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
275
|
+
attr_reader :tags
|
|
276
|
+
|
|
277
|
+
sig { params(tags: T::Array[String]).void }
|
|
278
|
+
attr_writer :tags
|
|
279
|
+
|
|
188
280
|
sig { returns(T.nilable(Telnyx::AI::TelephonySettings)) }
|
|
189
281
|
attr_reader :telephony_settings
|
|
190
282
|
|
|
@@ -195,14 +287,17 @@ module Telnyx
|
|
|
195
287
|
end
|
|
196
288
|
attr_writer :telephony_settings
|
|
197
289
|
|
|
290
|
+
# IDs of shared tools to attach to the assistant. New integrations should prefer
|
|
291
|
+
# `tool_ids` over inline `tools`.
|
|
198
292
|
sig { returns(T.nilable(T::Array[String])) }
|
|
199
293
|
attr_reader :tool_ids
|
|
200
294
|
|
|
201
295
|
sig { params(tool_ids: T::Array[String]).void }
|
|
202
296
|
attr_writer :tool_ids
|
|
203
297
|
|
|
204
|
-
#
|
|
205
|
-
#
|
|
298
|
+
# Deprecated for new integrations. Inline tool definitions available to the
|
|
299
|
+
# assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
|
|
300
|
+
# endpoints.
|
|
206
301
|
sig do
|
|
207
302
|
returns(
|
|
208
303
|
T.nilable(
|
|
@@ -256,6 +351,13 @@ module Telnyx
|
|
|
256
351
|
end
|
|
257
352
|
attr_writer :transcription
|
|
258
353
|
|
|
354
|
+
# Human-readable name for the assistant version.
|
|
355
|
+
sig { returns(T.nilable(String)) }
|
|
356
|
+
attr_reader :version_name
|
|
357
|
+
|
|
358
|
+
sig { params(version_name: String).void }
|
|
359
|
+
attr_writer :version_name
|
|
360
|
+
|
|
259
361
|
sig { returns(T.nilable(Telnyx::AI::VoiceSettings)) }
|
|
260
362
|
attr_reader :voice_settings
|
|
261
363
|
|
|
@@ -275,6 +377,7 @@ module Telnyx
|
|
|
275
377
|
params(
|
|
276
378
|
description: String,
|
|
277
379
|
dynamic_variables: T::Hash[Symbol, T.anything],
|
|
380
|
+
dynamic_variables_webhook_timeout_ms: Integer,
|
|
278
381
|
dynamic_variables_webhook_url: String,
|
|
279
382
|
enabled_features: T::Array[Telnyx::AI::EnabledFeatures::OrSymbol],
|
|
280
383
|
external_llm:
|
|
@@ -284,7 +387,17 @@ module Telnyx
|
|
|
284
387
|
greeting: String,
|
|
285
388
|
insight_settings: Telnyx::AI::InsightSettings::OrHash,
|
|
286
389
|
instructions: String,
|
|
390
|
+
integrations:
|
|
391
|
+
T::Array[
|
|
392
|
+
Telnyx::AI::Assistants::UpdateAssistant::Integration::OrHash
|
|
393
|
+
],
|
|
394
|
+
interruption_settings:
|
|
395
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::OrHash,
|
|
287
396
|
llm_api_key_ref: String,
|
|
397
|
+
mcp_servers:
|
|
398
|
+
T::Array[
|
|
399
|
+
Telnyx::AI::Assistants::UpdateAssistant::McpServer::OrHash
|
|
400
|
+
],
|
|
288
401
|
messaging_settings: Telnyx::AI::MessagingSettings::OrHash,
|
|
289
402
|
model: String,
|
|
290
403
|
name: String,
|
|
@@ -292,6 +405,7 @@ module Telnyx
|
|
|
292
405
|
post_conversation_settings:
|
|
293
406
|
Telnyx::AI::Assistants::UpdateAssistant::PostConversationSettings::OrHash,
|
|
294
407
|
privacy_settings: Telnyx::AI::PrivacySettings::OrHash,
|
|
408
|
+
tags: T::Array[String],
|
|
295
409
|
telephony_settings: Telnyx::AI::TelephonySettings::OrHash,
|
|
296
410
|
tool_ids: T::Array[String],
|
|
297
411
|
tools:
|
|
@@ -310,6 +424,7 @@ module Telnyx
|
|
|
310
424
|
)
|
|
311
425
|
],
|
|
312
426
|
transcription: Telnyx::AI::TranscriptionSettings::OrHash,
|
|
427
|
+
version_name: String,
|
|
313
428
|
voice_settings: Telnyx::AI::VoiceSettings::OrHash,
|
|
314
429
|
widget_settings: Telnyx::AI::WidgetSettings::OrHash
|
|
315
430
|
).returns(T.attached_class)
|
|
@@ -318,10 +433,19 @@ module Telnyx
|
|
|
318
433
|
description: nil,
|
|
319
434
|
# Map of dynamic variables and their default values
|
|
320
435
|
dynamic_variables: nil,
|
|
321
|
-
#
|
|
322
|
-
#
|
|
323
|
-
#
|
|
324
|
-
#
|
|
436
|
+
# Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
|
|
437
|
+
# 10000 ms. If the webhook does not respond within this timeout, the call proceeds
|
|
438
|
+
# with default values. See the
|
|
439
|
+
# [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
440
|
+
dynamic_variables_webhook_timeout_ms: nil,
|
|
441
|
+
# If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
|
|
442
|
+
# URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
|
|
443
|
+
# the webhook response must wrap variables under a top-level `dynamic_variables`
|
|
444
|
+
# object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
|
|
445
|
+
# flat object will be ignored and variables will fall back to their defaults. See
|
|
446
|
+
# the
|
|
447
|
+
# [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
448
|
+
# for the full request/response format and timeout behavior.
|
|
325
449
|
dynamic_variables_webhook_url: nil,
|
|
326
450
|
enabled_features: nil,
|
|
327
451
|
external_llm: nil,
|
|
@@ -337,16 +461,34 @@ module Telnyx
|
|
|
337
461
|
# System instructions for the assistant. These may be templated with
|
|
338
462
|
# [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
339
463
|
instructions: nil,
|
|
340
|
-
#
|
|
341
|
-
#
|
|
464
|
+
# Connected integrations attached to the assistant. The catalog of available
|
|
465
|
+
# integrations is at `/ai/integrations`; the user's connected integrations are at
|
|
466
|
+
# `/ai/integrations/connections`. Each item references a catalog integration by
|
|
467
|
+
# `integration_id`.
|
|
468
|
+
integrations: nil,
|
|
469
|
+
# Settings for interruptions and how the assistant decides the user has finished
|
|
470
|
+
# speaking. These timings are most relevant when using non turn-taking
|
|
471
|
+
# transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
472
|
+
# behavior is controlled by the transcription end-of-turn settings under
|
|
473
|
+
# `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
474
|
+
# `eager_eot_threshold`).
|
|
475
|
+
interruption_settings: nil,
|
|
476
|
+
# This is only needed when using third-party inference providers selected by
|
|
477
|
+
# `model`. The `identifier` for an integration secret
|
|
342
478
|
# [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
343
|
-
# that refers to your LLM provider's API key.
|
|
344
|
-
#
|
|
479
|
+
# that refers to your LLM provider's API key. For bring-your-own endpoint
|
|
480
|
+
# authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
|
|
481
|
+
# are unlikely to work with this integration.
|
|
345
482
|
llm_api_key_ref: nil,
|
|
483
|
+
# MCP servers attached to the assistant. Create MCP servers with
|
|
484
|
+
# `/ai/mcp_servers`, then reference them by `id` here.
|
|
485
|
+
mcp_servers: nil,
|
|
346
486
|
messaging_settings: nil,
|
|
347
|
-
# ID of the model to use. You can use the
|
|
487
|
+
# ID of the model to use when `external_llm` is not set. You can use the
|
|
348
488
|
# [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
349
|
-
# to see
|
|
489
|
+
# to see available models. If `external_llm` is provided, the assistant uses
|
|
490
|
+
# `external_llm` instead of this field. If neither `model` nor `external_llm` is
|
|
491
|
+
# provided, Telnyx applies the default model.
|
|
350
492
|
model: nil,
|
|
351
493
|
name: nil,
|
|
352
494
|
observability_settings: nil,
|
|
@@ -358,12 +500,20 @@ module Telnyx
|
|
|
358
500
|
# post-conversation. Beta feature.
|
|
359
501
|
post_conversation_settings: nil,
|
|
360
502
|
privacy_settings: nil,
|
|
503
|
+
# Tags associated with the assistant. Tags can also be managed with the assistant
|
|
504
|
+
# tag endpoints.
|
|
505
|
+
tags: nil,
|
|
361
506
|
telephony_settings: nil,
|
|
507
|
+
# IDs of shared tools to attach to the assistant. New integrations should prefer
|
|
508
|
+
# `tool_ids` over inline `tools`.
|
|
362
509
|
tool_ids: nil,
|
|
363
|
-
#
|
|
364
|
-
#
|
|
510
|
+
# Deprecated for new integrations. Inline tool definitions available to the
|
|
511
|
+
# assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
|
|
512
|
+
# endpoints.
|
|
365
513
|
tools: nil,
|
|
366
514
|
transcription: nil,
|
|
515
|
+
# Human-readable name for the assistant version.
|
|
516
|
+
version_name: nil,
|
|
367
517
|
voice_settings: nil,
|
|
368
518
|
# Configuration settings for the assistant's web widget.
|
|
369
519
|
widget_settings: nil
|
|
@@ -375,6 +525,7 @@ module Telnyx
|
|
|
375
525
|
{
|
|
376
526
|
description: String,
|
|
377
527
|
dynamic_variables: T::Hash[Symbol, T.anything],
|
|
528
|
+
dynamic_variables_webhook_timeout_ms: Integer,
|
|
378
529
|
dynamic_variables_webhook_url: String,
|
|
379
530
|
enabled_features:
|
|
380
531
|
T::Array[Telnyx::AI::EnabledFeatures::OrSymbol],
|
|
@@ -385,7 +536,15 @@ module Telnyx
|
|
|
385
536
|
greeting: String,
|
|
386
537
|
insight_settings: Telnyx::AI::InsightSettings,
|
|
387
538
|
instructions: String,
|
|
539
|
+
integrations:
|
|
540
|
+
T::Array[
|
|
541
|
+
Telnyx::AI::Assistants::UpdateAssistant::Integration
|
|
542
|
+
],
|
|
543
|
+
interruption_settings:
|
|
544
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings,
|
|
388
545
|
llm_api_key_ref: String,
|
|
546
|
+
mcp_servers:
|
|
547
|
+
T::Array[Telnyx::AI::Assistants::UpdateAssistant::McpServer],
|
|
389
548
|
messaging_settings: Telnyx::AI::MessagingSettings,
|
|
390
549
|
model: String,
|
|
391
550
|
name: String,
|
|
@@ -393,6 +552,7 @@ module Telnyx
|
|
|
393
552
|
post_conversation_settings:
|
|
394
553
|
Telnyx::AI::Assistants::UpdateAssistant::PostConversationSettings,
|
|
395
554
|
privacy_settings: Telnyx::AI::PrivacySettings,
|
|
555
|
+
tags: T::Array[String],
|
|
396
556
|
telephony_settings: Telnyx::AI::TelephonySettings,
|
|
397
557
|
tool_ids: T::Array[String],
|
|
398
558
|
tools:
|
|
@@ -411,6 +571,7 @@ module Telnyx
|
|
|
411
571
|
)
|
|
412
572
|
],
|
|
413
573
|
transcription: Telnyx::AI::TranscriptionSettings,
|
|
574
|
+
version_name: String,
|
|
414
575
|
voice_settings: Telnyx::AI::VoiceSettings,
|
|
415
576
|
widget_settings: Telnyx::AI::WidgetSettings
|
|
416
577
|
}
|
|
@@ -462,11 +623,13 @@ module Telnyx
|
|
|
462
623
|
sig { params(certificate_ref: String).void }
|
|
463
624
|
attr_writer :certificate_ref
|
|
464
625
|
|
|
465
|
-
# When
|
|
466
|
-
# LLM endpoint
|
|
467
|
-
#
|
|
468
|
-
#
|
|
469
|
-
# `{"extra_metadata":{"customer_name":"Jane","account_id":"acct_789","telnyx_agent_target":"+13125550100","telnyx_end_user_target":"+13125550123"}}`.
|
|
626
|
+
# When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
627
|
+
# LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
628
|
+
# request body. Defaults to `false`. Example payload sent to the external
|
|
629
|
+
# endpoint:
|
|
630
|
+
# `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
631
|
+
# Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
632
|
+
# limits.
|
|
470
633
|
sig { returns(T.nilable(T::Boolean)) }
|
|
471
634
|
attr_reader :forward_metadata
|
|
472
635
|
|
|
@@ -509,11 +672,13 @@ module Telnyx
|
|
|
509
672
|
# Integration secret identifier for the client certificate used with certificate
|
|
510
673
|
# authentication.
|
|
511
674
|
certificate_ref: nil,
|
|
512
|
-
# When
|
|
513
|
-
# LLM endpoint
|
|
514
|
-
#
|
|
515
|
-
#
|
|
516
|
-
# `{"extra_metadata":{"customer_name":"Jane","account_id":"acct_789","telnyx_agent_target":"+13125550100","telnyx_end_user_target":"+13125550123"}}`.
|
|
675
|
+
# When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
676
|
+
# LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
677
|
+
# request body. Defaults to `false`. Example payload sent to the external
|
|
678
|
+
# endpoint:
|
|
679
|
+
# `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
680
|
+
# Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
681
|
+
# limits.
|
|
517
682
|
forward_metadata: nil,
|
|
518
683
|
# Integration secret identifier for the external LLM API key.
|
|
519
684
|
llm_api_key_ref: nil,
|
|
@@ -690,11 +855,13 @@ module Telnyx
|
|
|
690
855
|
sig { params(certificate_ref: String).void }
|
|
691
856
|
attr_writer :certificate_ref
|
|
692
857
|
|
|
693
|
-
# When
|
|
694
|
-
# LLM endpoint
|
|
695
|
-
#
|
|
696
|
-
#
|
|
697
|
-
# `{"extra_metadata":{"customer_name":"Jane","account_id":"acct_789","telnyx_agent_target":"+13125550100","telnyx_end_user_target":"+13125550123"}}`.
|
|
858
|
+
# When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
859
|
+
# LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
860
|
+
# request body. Defaults to `false`. Example payload sent to the external
|
|
861
|
+
# endpoint:
|
|
862
|
+
# `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
863
|
+
# Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
864
|
+
# limits.
|
|
698
865
|
sig { returns(T.nilable(T::Boolean)) }
|
|
699
866
|
attr_reader :forward_metadata
|
|
700
867
|
|
|
@@ -737,11 +904,13 @@ module Telnyx
|
|
|
737
904
|
# Integration secret identifier for the client certificate used with certificate
|
|
738
905
|
# authentication.
|
|
739
906
|
certificate_ref: nil,
|
|
740
|
-
# When
|
|
741
|
-
# LLM endpoint
|
|
742
|
-
#
|
|
743
|
-
#
|
|
744
|
-
# `{"extra_metadata":{"customer_name":"Jane","account_id":"acct_789","telnyx_agent_target":"+13125550100","telnyx_end_user_target":"+13125550123"}}`.
|
|
907
|
+
# When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
908
|
+
# LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
909
|
+
# request body. Defaults to `false`. Example payload sent to the external
|
|
910
|
+
# endpoint:
|
|
911
|
+
# `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
912
|
+
# Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
913
|
+
# limits.
|
|
745
914
|
forward_metadata: nil,
|
|
746
915
|
# Integration secret identifier for the external LLM API key.
|
|
747
916
|
llm_api_key_ref: nil,
|
|
@@ -804,6 +973,319 @@ module Telnyx
|
|
|
804
973
|
end
|
|
805
974
|
end
|
|
806
975
|
|
|
976
|
+
class Integration < Telnyx::Internal::Type::BaseModel
|
|
977
|
+
OrHash =
|
|
978
|
+
T.type_alias do
|
|
979
|
+
T.any(
|
|
980
|
+
Telnyx::AI::Assistants::UpdateAssistant::Integration,
|
|
981
|
+
Telnyx::Internal::AnyHash
|
|
982
|
+
)
|
|
983
|
+
end
|
|
984
|
+
|
|
985
|
+
# Catalog integration ID to attach. This is the `id` from the integrations catalog
|
|
986
|
+
# at `/ai/integrations` (the same value also appears as `integration_id` on
|
|
987
|
+
# entries returned by `/ai/integrations/connections`). It is **not** the
|
|
988
|
+
# connection-level `id` from `/ai/integrations/connections`.
|
|
989
|
+
sig { returns(String) }
|
|
990
|
+
attr_accessor :integration_id
|
|
991
|
+
|
|
992
|
+
# Optional per-assistant allowlist of integration tool names. When omitted or
|
|
993
|
+
# empty, all tools allowed by the connected integration are available to the
|
|
994
|
+
# assistant.
|
|
995
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
996
|
+
attr_reader :allowed_list
|
|
997
|
+
|
|
998
|
+
sig { params(allowed_list: T::Array[String]).void }
|
|
999
|
+
attr_writer :allowed_list
|
|
1000
|
+
|
|
1001
|
+
# Reference to a connected integration attached to an assistant. Discover
|
|
1002
|
+
# available integrations with `/ai/integrations` and connected integrations with
|
|
1003
|
+
# `/ai/integrations/connections`.
|
|
1004
|
+
sig do
|
|
1005
|
+
params(
|
|
1006
|
+
integration_id: String,
|
|
1007
|
+
allowed_list: T::Array[String]
|
|
1008
|
+
).returns(T.attached_class)
|
|
1009
|
+
end
|
|
1010
|
+
def self.new(
|
|
1011
|
+
# Catalog integration ID to attach. This is the `id` from the integrations catalog
|
|
1012
|
+
# at `/ai/integrations` (the same value also appears as `integration_id` on
|
|
1013
|
+
# entries returned by `/ai/integrations/connections`). It is **not** the
|
|
1014
|
+
# connection-level `id` from `/ai/integrations/connections`.
|
|
1015
|
+
integration_id:,
|
|
1016
|
+
# Optional per-assistant allowlist of integration tool names. When omitted or
|
|
1017
|
+
# empty, all tools allowed by the connected integration are available to the
|
|
1018
|
+
# assistant.
|
|
1019
|
+
allowed_list: nil
|
|
1020
|
+
)
|
|
1021
|
+
end
|
|
1022
|
+
|
|
1023
|
+
sig do
|
|
1024
|
+
override.returns(
|
|
1025
|
+
{ integration_id: String, allowed_list: T::Array[String] }
|
|
1026
|
+
)
|
|
1027
|
+
end
|
|
1028
|
+
def to_hash
|
|
1029
|
+
end
|
|
1030
|
+
end
|
|
1031
|
+
|
|
1032
|
+
class InterruptionSettings < Telnyx::Internal::Type::BaseModel
|
|
1033
|
+
OrHash =
|
|
1034
|
+
T.type_alias do
|
|
1035
|
+
T.any(
|
|
1036
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings,
|
|
1037
|
+
Telnyx::Internal::AnyHash
|
|
1038
|
+
)
|
|
1039
|
+
end
|
|
1040
|
+
|
|
1041
|
+
# Whether users can interrupt the assistant while it is speaking.
|
|
1042
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
1043
|
+
attr_reader :enable
|
|
1044
|
+
|
|
1045
|
+
sig { params(enable: T::Boolean).void }
|
|
1046
|
+
attr_writer :enable
|
|
1047
|
+
|
|
1048
|
+
# Controls when the assistant starts speaking after the user stops. These
|
|
1049
|
+
# thresholds primarily apply to non turn-taking transcription models. For
|
|
1050
|
+
# turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
1051
|
+
# transcription end-of-turn settings under `transcription.settings` instead.
|
|
1052
|
+
sig do
|
|
1053
|
+
returns(
|
|
1054
|
+
T.nilable(
|
|
1055
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan
|
|
1056
|
+
)
|
|
1057
|
+
)
|
|
1058
|
+
end
|
|
1059
|
+
attr_reader :start_speaking_plan
|
|
1060
|
+
|
|
1061
|
+
sig do
|
|
1062
|
+
params(
|
|
1063
|
+
start_speaking_plan:
|
|
1064
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan::OrHash
|
|
1065
|
+
).void
|
|
1066
|
+
end
|
|
1067
|
+
attr_writer :start_speaking_plan
|
|
1068
|
+
|
|
1069
|
+
# Settings for interruptions and how the assistant decides the user has finished
|
|
1070
|
+
# speaking. These timings are most relevant when using non turn-taking
|
|
1071
|
+
# transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
1072
|
+
# behavior is controlled by the transcription end-of-turn settings under
|
|
1073
|
+
# `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
1074
|
+
# `eager_eot_threshold`).
|
|
1075
|
+
sig do
|
|
1076
|
+
params(
|
|
1077
|
+
enable: T::Boolean,
|
|
1078
|
+
start_speaking_plan:
|
|
1079
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan::OrHash
|
|
1080
|
+
).returns(T.attached_class)
|
|
1081
|
+
end
|
|
1082
|
+
def self.new(
|
|
1083
|
+
# Whether users can interrupt the assistant while it is speaking.
|
|
1084
|
+
enable: nil,
|
|
1085
|
+
# Controls when the assistant starts speaking after the user stops. These
|
|
1086
|
+
# thresholds primarily apply to non turn-taking transcription models. For
|
|
1087
|
+
# turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
1088
|
+
# transcription end-of-turn settings under `transcription.settings` instead.
|
|
1089
|
+
start_speaking_plan: nil
|
|
1090
|
+
)
|
|
1091
|
+
end
|
|
1092
|
+
|
|
1093
|
+
sig do
|
|
1094
|
+
override.returns(
|
|
1095
|
+
{
|
|
1096
|
+
enable: T::Boolean,
|
|
1097
|
+
start_speaking_plan:
|
|
1098
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan
|
|
1099
|
+
}
|
|
1100
|
+
)
|
|
1101
|
+
end
|
|
1102
|
+
def to_hash
|
|
1103
|
+
end
|
|
1104
|
+
|
|
1105
|
+
class StartSpeakingPlan < Telnyx::Internal::Type::BaseModel
|
|
1106
|
+
OrHash =
|
|
1107
|
+
T.type_alias do
|
|
1108
|
+
T.any(
|
|
1109
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan,
|
|
1110
|
+
Telnyx::Internal::AnyHash
|
|
1111
|
+
)
|
|
1112
|
+
end
|
|
1113
|
+
|
|
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
|
+
sig do
|
|
1119
|
+
returns(
|
|
1120
|
+
T.nilable(
|
|
1121
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan
|
|
1122
|
+
)
|
|
1123
|
+
)
|
|
1124
|
+
end
|
|
1125
|
+
attr_reader :transcription_endpointing_plan
|
|
1126
|
+
|
|
1127
|
+
sig do
|
|
1128
|
+
params(
|
|
1129
|
+
transcription_endpointing_plan:
|
|
1130
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan::OrHash
|
|
1131
|
+
).void
|
|
1132
|
+
end
|
|
1133
|
+
attr_writer :transcription_endpointing_plan
|
|
1134
|
+
|
|
1135
|
+
# Minimum seconds to wait before the assistant starts speaking.
|
|
1136
|
+
sig { returns(T.nilable(Float)) }
|
|
1137
|
+
attr_reader :wait_seconds
|
|
1138
|
+
|
|
1139
|
+
sig { params(wait_seconds: Float).void }
|
|
1140
|
+
attr_writer :wait_seconds
|
|
1141
|
+
|
|
1142
|
+
# Controls when the assistant starts speaking after the user stops. These
|
|
1143
|
+
# thresholds primarily apply to non turn-taking transcription models. For
|
|
1144
|
+
# turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
1145
|
+
# transcription end-of-turn settings under `transcription.settings` instead.
|
|
1146
|
+
sig do
|
|
1147
|
+
params(
|
|
1148
|
+
transcription_endpointing_plan:
|
|
1149
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan::OrHash,
|
|
1150
|
+
wait_seconds: Float
|
|
1151
|
+
).returns(T.attached_class)
|
|
1152
|
+
end
|
|
1153
|
+
def self.new(
|
|
1154
|
+
# Endpointing thresholds used to decide when the user has finished speaking.
|
|
1155
|
+
# Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
1156
|
+
# `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
1157
|
+
# `eager_eot_threshold`.
|
|
1158
|
+
transcription_endpointing_plan: nil,
|
|
1159
|
+
# Minimum seconds to wait before the assistant starts speaking.
|
|
1160
|
+
wait_seconds: nil
|
|
1161
|
+
)
|
|
1162
|
+
end
|
|
1163
|
+
|
|
1164
|
+
sig do
|
|
1165
|
+
override.returns(
|
|
1166
|
+
{
|
|
1167
|
+
transcription_endpointing_plan:
|
|
1168
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan,
|
|
1169
|
+
wait_seconds: Float
|
|
1170
|
+
}
|
|
1171
|
+
)
|
|
1172
|
+
end
|
|
1173
|
+
def to_hash
|
|
1174
|
+
end
|
|
1175
|
+
|
|
1176
|
+
class TranscriptionEndpointingPlan < Telnyx::Internal::Type::BaseModel
|
|
1177
|
+
OrHash =
|
|
1178
|
+
T.type_alias do
|
|
1179
|
+
T.any(
|
|
1180
|
+
Telnyx::AI::Assistants::UpdateAssistant::InterruptionSettings::StartSpeakingPlan::TranscriptionEndpointingPlan,
|
|
1181
|
+
Telnyx::Internal::AnyHash
|
|
1182
|
+
)
|
|
1183
|
+
end
|
|
1184
|
+
|
|
1185
|
+
# Seconds to wait after the transcript ends without punctuation.
|
|
1186
|
+
sig { returns(T.nilable(Float)) }
|
|
1187
|
+
attr_reader :on_no_punctuation_seconds
|
|
1188
|
+
|
|
1189
|
+
sig { params(on_no_punctuation_seconds: Float).void }
|
|
1190
|
+
attr_writer :on_no_punctuation_seconds
|
|
1191
|
+
|
|
1192
|
+
# Seconds to wait after the transcript ends with a number.
|
|
1193
|
+
sig { returns(T.nilable(Float)) }
|
|
1194
|
+
attr_reader :on_number_seconds
|
|
1195
|
+
|
|
1196
|
+
sig { params(on_number_seconds: Float).void }
|
|
1197
|
+
attr_writer :on_number_seconds
|
|
1198
|
+
|
|
1199
|
+
# Seconds to wait after the transcript ends with punctuation.
|
|
1200
|
+
sig { returns(T.nilable(Float)) }
|
|
1201
|
+
attr_reader :on_punctuation_seconds
|
|
1202
|
+
|
|
1203
|
+
sig { params(on_punctuation_seconds: Float).void }
|
|
1204
|
+
attr_writer :on_punctuation_seconds
|
|
1205
|
+
|
|
1206
|
+
# Endpointing thresholds used to decide when the user has finished speaking.
|
|
1207
|
+
# Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
1208
|
+
# `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
1209
|
+
# `eager_eot_threshold`.
|
|
1210
|
+
sig do
|
|
1211
|
+
params(
|
|
1212
|
+
on_no_punctuation_seconds: Float,
|
|
1213
|
+
on_number_seconds: Float,
|
|
1214
|
+
on_punctuation_seconds: Float
|
|
1215
|
+
).returns(T.attached_class)
|
|
1216
|
+
end
|
|
1217
|
+
def self.new(
|
|
1218
|
+
# Seconds to wait after the transcript ends without punctuation.
|
|
1219
|
+
on_no_punctuation_seconds: nil,
|
|
1220
|
+
# Seconds to wait after the transcript ends with a number.
|
|
1221
|
+
on_number_seconds: nil,
|
|
1222
|
+
# Seconds to wait after the transcript ends with punctuation.
|
|
1223
|
+
on_punctuation_seconds: nil
|
|
1224
|
+
)
|
|
1225
|
+
end
|
|
1226
|
+
|
|
1227
|
+
sig do
|
|
1228
|
+
override.returns(
|
|
1229
|
+
{
|
|
1230
|
+
on_no_punctuation_seconds: Float,
|
|
1231
|
+
on_number_seconds: Float,
|
|
1232
|
+
on_punctuation_seconds: Float
|
|
1233
|
+
}
|
|
1234
|
+
)
|
|
1235
|
+
end
|
|
1236
|
+
def to_hash
|
|
1237
|
+
end
|
|
1238
|
+
end
|
|
1239
|
+
end
|
|
1240
|
+
end
|
|
1241
|
+
|
|
1242
|
+
class McpServer < Telnyx::Internal::Type::BaseModel
|
|
1243
|
+
OrHash =
|
|
1244
|
+
T.type_alias do
|
|
1245
|
+
T.any(
|
|
1246
|
+
Telnyx::AI::Assistants::UpdateAssistant::McpServer,
|
|
1247
|
+
Telnyx::Internal::AnyHash
|
|
1248
|
+
)
|
|
1249
|
+
end
|
|
1250
|
+
|
|
1251
|
+
# ID of the MCP server to attach. This must be the `id` of an MCP server returned
|
|
1252
|
+
# by the `/ai/mcp_servers` endpoints.
|
|
1253
|
+
sig { returns(String) }
|
|
1254
|
+
attr_accessor :id
|
|
1255
|
+
|
|
1256
|
+
# Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
|
|
1257
|
+
# uses the MCP server's configured `allowed_tools`.
|
|
1258
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
1259
|
+
attr_reader :allowed_tools
|
|
1260
|
+
|
|
1261
|
+
sig { params(allowed_tools: T::Array[String]).void }
|
|
1262
|
+
attr_writer :allowed_tools
|
|
1263
|
+
|
|
1264
|
+
# Reference to an MCP server attached to an assistant. Create and manage MCP
|
|
1265
|
+
# servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
|
|
1266
|
+
# ID.
|
|
1267
|
+
sig do
|
|
1268
|
+
params(id: String, allowed_tools: T::Array[String]).returns(
|
|
1269
|
+
T.attached_class
|
|
1270
|
+
)
|
|
1271
|
+
end
|
|
1272
|
+
def self.new(
|
|
1273
|
+
# ID of the MCP server to attach. This must be the `id` of an MCP server returned
|
|
1274
|
+
# by the `/ai/mcp_servers` endpoints.
|
|
1275
|
+
id:,
|
|
1276
|
+
# Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
|
|
1277
|
+
# uses the MCP server's configured `allowed_tools`.
|
|
1278
|
+
allowed_tools: nil
|
|
1279
|
+
)
|
|
1280
|
+
end
|
|
1281
|
+
|
|
1282
|
+
sig do
|
|
1283
|
+
override.returns({ id: String, allowed_tools: T::Array[String] })
|
|
1284
|
+
end
|
|
1285
|
+
def to_hash
|
|
1286
|
+
end
|
|
1287
|
+
end
|
|
1288
|
+
|
|
807
1289
|
class PostConversationSettings < Telnyx::Internal::Type::BaseModel
|
|
808
1290
|
OrHash =
|
|
809
1291
|
T.type_alias do
|