telnyx 5.91.0 → 5.93.0

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