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