telnyx 6.41.1 → 6.43.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 (256) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +11 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +11 -0
  9. package/client.mjs.map +1 -1
  10. package/core/EventEmitter.d.mts +11 -0
  11. package/core/EventEmitter.d.mts.map +1 -1
  12. package/core/EventEmitter.d.ts +11 -0
  13. package/core/EventEmitter.d.ts.map +1 -1
  14. package/core/EventEmitter.js +15 -1
  15. package/core/EventEmitter.js.map +1 -1
  16. package/core/EventEmitter.mjs +13 -0
  17. package/core/EventEmitter.mjs.map +1 -1
  18. package/internal/types.d.mts +6 -6
  19. package/internal/types.d.mts.map +1 -1
  20. package/internal/types.d.ts +6 -6
  21. package/internal/types.d.ts.map +1 -1
  22. package/internal/utils/env.js +2 -2
  23. package/internal/utils/env.js.map +1 -1
  24. package/internal/utils/env.mjs +2 -2
  25. package/internal/utils/env.mjs.map +1 -1
  26. package/internal/ws-adapter-browser.d.mts +34 -0
  27. package/internal/ws-adapter-browser.d.mts.map +1 -0
  28. package/internal/ws-adapter-browser.d.ts +34 -0
  29. package/internal/ws-adapter-browser.d.ts.map +1 -0
  30. package/internal/ws-adapter-browser.js +88 -0
  31. package/internal/ws-adapter-browser.js.map +1 -0
  32. package/internal/ws-adapter-browser.mjs +84 -0
  33. package/internal/ws-adapter-browser.mjs.map +1 -0
  34. package/internal/ws-adapter-node.d.mts +27 -0
  35. package/internal/ws-adapter-node.d.mts.map +1 -0
  36. package/internal/ws-adapter-node.d.ts +27 -0
  37. package/internal/ws-adapter-node.d.ts.map +1 -0
  38. package/internal/ws-adapter-node.js +90 -0
  39. package/internal/ws-adapter-node.js.map +1 -0
  40. package/internal/ws-adapter-node.mjs +86 -0
  41. package/internal/ws-adapter-node.mjs.map +1 -0
  42. package/internal/ws-adapter.d.mts +24 -0
  43. package/internal/ws-adapter.d.mts.map +1 -0
  44. package/internal/ws-adapter.d.ts +24 -0
  45. package/internal/ws-adapter.d.ts.map +1 -0
  46. package/internal/ws-adapter.js +11 -0
  47. package/internal/ws-adapter.js.map +1 -0
  48. package/internal/ws-adapter.mjs +8 -0
  49. package/internal/ws-adapter.mjs.map +1 -0
  50. package/internal/ws.d.mts +80 -0
  51. package/internal/ws.d.mts.map +1 -0
  52. package/internal/ws.d.ts +80 -0
  53. package/internal/ws.d.ts.map +1 -0
  54. package/internal/ws.js +153 -0
  55. package/internal/ws.js.map +1 -0
  56. package/internal/ws.mjs +147 -0
  57. package/internal/ws.mjs.map +1 -0
  58. package/lib/text-to-speech-ws-base.d.mts +106 -0
  59. package/lib/text-to-speech-ws-base.d.mts.map +1 -0
  60. package/lib/text-to-speech-ws-base.d.ts +106 -0
  61. package/lib/text-to-speech-ws-base.d.ts.map +1 -0
  62. package/lib/text-to-speech-ws-base.js +475 -0
  63. package/lib/text-to-speech-ws-base.js.map +1 -0
  64. package/lib/text-to-speech-ws-base.mjs +471 -0
  65. package/lib/text-to-speech-ws-base.mjs.map +1 -0
  66. package/lib/text-to-speech-ws-internal.d.mts +71 -0
  67. package/lib/text-to-speech-ws-internal.d.mts.map +1 -0
  68. package/lib/text-to-speech-ws-internal.d.ts +71 -0
  69. package/lib/text-to-speech-ws-internal.d.ts.map +1 -0
  70. package/lib/text-to-speech-ws-internal.js +47 -0
  71. package/lib/text-to-speech-ws-internal.js.map +1 -0
  72. package/lib/text-to-speech-ws-internal.mjs +41 -0
  73. package/lib/text-to-speech-ws-internal.mjs.map +1 -0
  74. package/lib/text-to-speech-ws.d.mts +13 -0
  75. package/lib/text-to-speech-ws.d.mts.map +1 -0
  76. package/lib/text-to-speech-ws.d.ts +13 -0
  77. package/lib/text-to-speech-ws.d.ts.map +1 -0
  78. package/lib/text-to-speech-ws.js +30 -0
  79. package/lib/text-to-speech-ws.js.map +1 -0
  80. package/lib/text-to-speech-ws.mjs +25 -0
  81. package/lib/text-to-speech-ws.mjs.map +1 -0
  82. package/lib/webhooks.d.mts +6 -0
  83. package/lib/webhooks.d.mts.map +1 -1
  84. package/lib/webhooks.d.ts +6 -0
  85. package/lib/webhooks.d.ts.map +1 -1
  86. package/lib/webhooks.js +16 -0
  87. package/lib/webhooks.js.map +1 -1
  88. package/lib/webhooks.mjs +14 -0
  89. package/lib/webhooks.mjs.map +1 -1
  90. package/package.json +1 -1
  91. package/resources/ai/assistants/assistants.d.mts +938 -65
  92. package/resources/ai/assistants/assistants.d.mts.map +1 -1
  93. package/resources/ai/assistants/assistants.d.ts +938 -65
  94. package/resources/ai/assistants/assistants.d.ts.map +1 -1
  95. package/resources/ai/assistants/assistants.js +0 -1
  96. package/resources/ai/assistants/assistants.js.map +1 -1
  97. package/resources/ai/assistants/assistants.mjs +0 -1
  98. package/resources/ai/assistants/assistants.mjs.map +1 -1
  99. package/resources/ai/assistants/versions.d.mts +563 -25
  100. package/resources/ai/assistants/versions.d.mts.map +1 -1
  101. package/resources/ai/assistants/versions.d.ts +563 -25
  102. package/resources/ai/assistants/versions.d.ts.map +1 -1
  103. package/resources/ai/conversations/conversations.d.mts +2 -2
  104. package/resources/ai/conversations/conversations.d.mts.map +1 -1
  105. package/resources/ai/conversations/conversations.d.ts +2 -2
  106. package/resources/ai/conversations/conversations.d.ts.map +1 -1
  107. package/resources/ai/conversations/conversations.js.map +1 -1
  108. package/resources/ai/conversations/conversations.mjs +1 -1
  109. package/resources/ai/conversations/conversations.mjs.map +1 -1
  110. package/resources/ai/conversations/index.d.mts +1 -1
  111. package/resources/ai/conversations/index.d.mts.map +1 -1
  112. package/resources/ai/conversations/index.d.ts +1 -1
  113. package/resources/ai/conversations/index.d.ts.map +1 -1
  114. package/resources/ai/conversations/index.js.map +1 -1
  115. package/resources/ai/conversations/index.mjs +1 -1
  116. package/resources/ai/conversations/index.mjs.map +1 -1
  117. package/resources/ai/conversations/messages.d.mts +46 -48
  118. package/resources/ai/conversations/messages.d.mts.map +1 -1
  119. package/resources/ai/conversations/messages.d.ts +46 -48
  120. package/resources/ai/conversations/messages.d.ts.map +1 -1
  121. package/resources/ai/conversations/messages.js +9 -6
  122. package/resources/ai/conversations/messages.js.map +1 -1
  123. package/resources/ai/conversations/messages.mjs +9 -6
  124. package/resources/ai/conversations/messages.mjs.map +1 -1
  125. package/resources/calls/actions.d.mts +114 -6
  126. package/resources/calls/actions.d.mts.map +1 -1
  127. package/resources/calls/actions.d.ts +114 -6
  128. package/resources/calls/actions.d.ts.map +1 -1
  129. package/resources/calls/actions.js +4 -0
  130. package/resources/calls/actions.js.map +1 -1
  131. package/resources/calls/actions.mjs +4 -0
  132. package/resources/calls/actions.mjs.map +1 -1
  133. package/resources/calls/calls.d.mts +168 -8
  134. package/resources/calls/calls.d.mts.map +1 -1
  135. package/resources/calls/calls.d.ts +168 -8
  136. package/resources/calls/calls.d.ts.map +1 -1
  137. package/resources/calls/calls.js +4 -0
  138. package/resources/calls/calls.js.map +1 -1
  139. package/resources/calls/calls.mjs +4 -0
  140. package/resources/calls/calls.mjs.map +1 -1
  141. package/resources/index.d.mts +2 -3
  142. package/resources/index.d.mts.map +1 -1
  143. package/resources/index.d.ts +2 -3
  144. package/resources/index.d.ts.map +1 -1
  145. package/resources/index.js +2 -7
  146. package/resources/index.js.map +1 -1
  147. package/resources/index.mjs +1 -2
  148. package/resources/index.mjs.map +1 -1
  149. package/resources/messages/messages.d.mts +4 -0
  150. package/resources/messages/messages.d.mts.map +1 -1
  151. package/resources/messages/messages.d.ts +4 -0
  152. package/resources/messages/messages.d.ts.map +1 -1
  153. package/resources/messages/messages.js.map +1 -1
  154. package/resources/messages/messages.mjs.map +1 -1
  155. package/resources/session-analysis/session-analysis.d.mts +3 -13
  156. package/resources/session-analysis/session-analysis.d.mts.map +1 -1
  157. package/resources/session-analysis/session-analysis.d.ts +3 -13
  158. package/resources/session-analysis/session-analysis.d.ts.map +1 -1
  159. package/resources/session-analysis/session-analysis.js.map +1 -1
  160. package/resources/session-analysis/session-analysis.mjs.map +1 -1
  161. package/resources/texml/accounts/calls/calls.d.mts +45 -0
  162. package/resources/texml/accounts/calls/calls.d.mts.map +1 -1
  163. package/resources/texml/accounts/calls/calls.d.ts +45 -0
  164. package/resources/texml/accounts/calls/calls.d.ts.map +1 -1
  165. package/resources/texml/accounts/calls/calls.js.map +1 -1
  166. package/resources/texml/accounts/calls/calls.mjs.map +1 -1
  167. package/resources/text-to-speech/index.d.mts +2 -1
  168. package/resources/text-to-speech/index.d.mts.map +1 -1
  169. package/resources/text-to-speech/index.d.ts +2 -1
  170. package/resources/text-to-speech/index.d.ts.map +1 -1
  171. package/resources/text-to-speech/index.js.map +1 -1
  172. package/resources/text-to-speech/index.mjs.map +1 -1
  173. package/resources/text-to-speech/internal-base.d.mts +1 -48
  174. package/resources/text-to-speech/internal-base.d.mts.map +1 -1
  175. package/resources/text-to-speech/internal-base.d.ts +1 -48
  176. package/resources/text-to-speech/internal-base.d.ts.map +1 -1
  177. package/resources/text-to-speech/internal-base.js +5 -48
  178. package/resources/text-to-speech/internal-base.js.map +1 -1
  179. package/resources/text-to-speech/internal-base.mjs +1 -44
  180. package/resources/text-to-speech/internal-base.mjs.map +1 -1
  181. package/resources/text-to-speech/text-to-speech.d.mts +28 -3
  182. package/resources/text-to-speech/text-to-speech.d.mts.map +1 -1
  183. package/resources/text-to-speech/text-to-speech.d.ts +28 -3
  184. package/resources/text-to-speech/text-to-speech.d.ts.map +1 -1
  185. package/resources/text-to-speech/text-to-speech.js +1 -1
  186. package/resources/text-to-speech/text-to-speech.mjs +1 -1
  187. package/resources/text-to-speech/ws-base.d.mts +2 -0
  188. package/resources/text-to-speech/ws-base.d.mts.map +1 -0
  189. package/resources/text-to-speech/ws-base.d.ts +2 -0
  190. package/resources/text-to-speech/ws-base.d.ts.map +1 -0
  191. package/resources/text-to-speech/ws-base.js +7 -0
  192. package/resources/text-to-speech/ws-base.js.map +1 -0
  193. package/resources/text-to-speech/ws-base.mjs +3 -0
  194. package/resources/text-to-speech/ws-base.mjs.map +1 -0
  195. package/resources/text-to-speech/ws.d.mts +2 -41
  196. package/resources/text-to-speech/ws.d.mts.map +1 -1
  197. package/resources/text-to-speech/ws.d.ts +2 -41
  198. package/resources/text-to-speech/ws.d.ts.map +1 -1
  199. package/resources/text-to-speech/ws.js +2 -182
  200. package/resources/text-to-speech/ws.js.map +1 -1
  201. package/resources/text-to-speech/ws.mjs +1 -180
  202. package/resources/text-to-speech/ws.mjs.map +1 -1
  203. package/resources/verify-profiles.d.mts +97 -121
  204. package/resources/verify-profiles.d.mts.map +1 -1
  205. package/resources/verify-profiles.d.ts +97 -121
  206. package/resources/verify-profiles.d.ts.map +1 -1
  207. package/resources/webhooks.d.mts +642 -7
  208. package/resources/webhooks.d.mts.map +1 -1
  209. package/resources/webhooks.d.ts +642 -7
  210. package/resources/webhooks.d.ts.map +1 -1
  211. package/resources/webhooks.js +4 -10
  212. package/resources/webhooks.js.map +1 -1
  213. package/resources/webhooks.mjs +5 -11
  214. package/resources/webhooks.mjs.map +1 -1
  215. package/resources/whatsapp/phone-numbers/profile/profile.d.mts +5 -0
  216. package/resources/whatsapp/phone-numbers/profile/profile.d.mts.map +1 -1
  217. package/resources/whatsapp/phone-numbers/profile/profile.d.ts +5 -0
  218. package/resources/whatsapp/phone-numbers/profile/profile.d.ts.map +1 -1
  219. package/resources/whatsapp/phone-numbers/profile/profile.js.map +1 -1
  220. package/resources/whatsapp/phone-numbers/profile/profile.mjs.map +1 -1
  221. package/src/client.ts +22 -0
  222. package/src/core/EventEmitter.ts +16 -0
  223. package/src/internal/types.ts +6 -8
  224. package/src/internal/utils/env.ts +2 -2
  225. package/src/internal/ws-adapter-browser.ts +123 -0
  226. package/src/internal/ws-adapter-node.ts +105 -0
  227. package/src/internal/ws-adapter.ts +30 -0
  228. package/src/internal/ws.ts +193 -0
  229. package/src/lib/text-to-speech-ws-base.ts +618 -0
  230. package/src/lib/text-to-speech-ws-internal.ts +111 -0
  231. package/src/lib/text-to-speech-ws.ts +40 -0
  232. package/src/lib/webhooks.ts +27 -0
  233. package/src/resources/ai/assistants/assistants.ts +1065 -65
  234. package/src/resources/ai/assistants/versions.ts +639 -25
  235. package/src/resources/ai/conversations/conversations.ts +12 -2
  236. package/src/resources/ai/conversations/index.ts +6 -1
  237. package/src/resources/ai/conversations/messages.ts +67 -54
  238. package/src/resources/calls/actions.ts +184 -4
  239. package/src/resources/calls/calls.ts +191 -4
  240. package/src/resources/index.ts +6 -12
  241. package/src/resources/messages/messages.ts +5 -0
  242. package/src/resources/session-analysis/session-analysis.ts +3 -16
  243. package/src/resources/texml/accounts/calls/calls.ts +54 -0
  244. package/src/resources/text-to-speech/index.ts +2 -1
  245. package/src/resources/text-to-speech/internal-base.ts +6 -95
  246. package/src/resources/text-to-speech/text-to-speech.ts +33 -3
  247. package/src/resources/text-to-speech/ws-base.ts +7 -0
  248. package/src/resources/text-to-speech/ws.ts +2 -201
  249. package/src/resources/verify-profiles.ts +109 -142
  250. package/src/resources/webhooks.ts +886 -45
  251. package/src/resources/whatsapp/phone-numbers/profile/profile.ts +7 -0
  252. package/src/version.ts +1 -1
  253. package/version.d.mts +1 -1
  254. package/version.d.ts +1 -1
  255. package/version.js +1 -1
  256. package/version.mjs +1 -1
@@ -125,15 +125,31 @@ export interface UpdateAssistant {
125
125
  dynamic_variables?: { [key: string]: unknown };
126
126
 
127
127
  /**
128
- * If the dynamic_variables_webhook_url is set for the assistant, we will send a
129
- * request at the start of the conversation. See our
130
- * [guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
131
- * for more information.
128
+ * Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
129
+ * 10000 ms. If the webhook does not respond within this timeout, the call proceeds
130
+ * with default values. See the
131
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
132
+ */
133
+ dynamic_variables_webhook_timeout_ms?: number;
134
+
135
+ /**
136
+ * If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
137
+ * URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
138
+ * the webhook response must wrap variables under a top-level `dynamic_variables`
139
+ * object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
140
+ * flat object will be ignored and variables will fall back to their defaults. See
141
+ * the
142
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
143
+ * for the full request/response format and timeout behavior.
132
144
  */
133
145
  dynamic_variables_webhook_url?: string;
134
146
 
135
147
  enabled_features?: Array<AssistantsAPI.EnabledFeatures>;
136
148
 
149
+ external_llm?: UpdateAssistant.ExternalLlm;
150
+
151
+ fallback_config?: UpdateAssistant.FallbackConfig;
152
+
137
153
  /**
138
154
  * Text that the assistant will use to start the conversation. This may be
139
155
  * templated with
@@ -153,20 +169,47 @@ export interface UpdateAssistant {
153
169
  instructions?: string;
154
170
 
155
171
  /**
156
- * This is only needed when using third-party inference providers. The `identifier`
157
- * for an integration secret
172
+ * Connected integrations attached to the assistant. The catalog of available
173
+ * integrations is at `/ai/integrations`; the user's connected integrations are at
174
+ * `/ai/integrations/connections`. Each item references a catalog integration by
175
+ * `integration_id`.
176
+ */
177
+ integrations?: Array<UpdateAssistant.Integration>;
178
+
179
+ /**
180
+ * Settings for interruptions and how the assistant decides the user has finished
181
+ * speaking. These timings are most relevant when using non turn-taking
182
+ * transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
183
+ * behavior is controlled by the transcription end-of-turn settings under
184
+ * `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
185
+ * `eager_eot_threshold`).
186
+ */
187
+ interruption_settings?: UpdateAssistant.InterruptionSettings;
188
+
189
+ /**
190
+ * This is only needed when using third-party inference providers selected by
191
+ * `model`. The `identifier` for an integration secret
158
192
  * [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
159
- * that refers to your LLM provider's API key. Warning: Free plans are unlikely to
160
- * work with this integration.
193
+ * that refers to your LLM provider's API key. For bring-your-own endpoint
194
+ * authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
195
+ * are unlikely to work with this integration.
161
196
  */
162
197
  llm_api_key_ref?: string;
163
198
 
199
+ /**
200
+ * MCP servers attached to the assistant. Create MCP servers with
201
+ * `/ai/mcp_servers`, then reference them by `id` here.
202
+ */
203
+ mcp_servers?: Array<UpdateAssistant.McpServer>;
204
+
164
205
  messaging_settings?: AssistantsAPI.MessagingSettings;
165
206
 
166
207
  /**
167
- * ID of the model to use. You can use the
208
+ * ID of the model to use when `external_llm` is not set. You can use the
168
209
  * [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
169
- * to see all of your available models,
210
+ * to see available models. If `external_llm` is provided, the assistant uses
211
+ * `external_llm` instead of this field. If neither `model` nor `external_llm` is
212
+ * provided, Telnyx applies the default model.
170
213
  */
171
214
  model?: string;
172
215
 
@@ -174,20 +217,46 @@ export interface UpdateAssistant {
174
217
 
175
218
  observability_settings?: AssistantsAPI.ObservabilityReq;
176
219
 
220
+ /**
221
+ * Configuration for post-conversation processing. When enabled, the assistant
222
+ * receives one additional LLM turn after the conversation ends, allowing it to
223
+ * execute tool calls such as logging to a CRM or sending a summary. The assistant
224
+ * can execute multiple parallel or sequential tools during this phase.
225
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
226
+ * post-conversation. Beta feature.
227
+ */
228
+ post_conversation_settings?: UpdateAssistant.PostConversationSettings;
229
+
177
230
  privacy_settings?: AssistantsAPI.PrivacySettings;
178
231
 
232
+ /**
233
+ * Tags associated with the assistant. Tags can also be managed with the assistant
234
+ * tag endpoints.
235
+ */
236
+ tags?: Array<string>;
237
+
179
238
  telephony_settings?: AssistantsAPI.TelephonySettings;
180
239
 
240
+ /**
241
+ * IDs of shared tools to attach to the assistant. New integrations should prefer
242
+ * `tool_ids` over inline `tools`.
243
+ */
181
244
  tool_ids?: Array<string>;
182
245
 
183
246
  /**
184
- * The tools that the assistant can use. These may be templated with
185
- * [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
247
+ * Deprecated for new integrations. Inline tool definitions available to the
248
+ * assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
249
+ * endpoints.
186
250
  */
187
251
  tools?: Array<AssistantsAPI.AssistantTool>;
188
252
 
189
253
  transcription?: AssistantsAPI.TranscriptionSettings;
190
254
 
255
+ /**
256
+ * Human-readable name for the assistant version.
257
+ */
258
+ version_name?: string;
259
+
191
260
  voice_settings?: AssistantsAPI.VoiceSettings;
192
261
 
193
262
  /**
@@ -196,6 +265,242 @@ export interface UpdateAssistant {
196
265
  widget_settings?: AssistantsAPI.WidgetSettings;
197
266
  }
198
267
 
268
+ export namespace UpdateAssistant {
269
+ export interface ExternalLlm {
270
+ /**
271
+ * Base URL for the external LLM endpoint.
272
+ */
273
+ base_url: string;
274
+
275
+ /**
276
+ * Model identifier to use with the external LLM endpoint.
277
+ */
278
+ model: string;
279
+
280
+ /**
281
+ * Authentication method used when connecting to the external LLM endpoint.
282
+ */
283
+ authentication_method?: 'token' | 'certificate';
284
+
285
+ /**
286
+ * Integration secret identifier for the client certificate used with certificate
287
+ * authentication.
288
+ */
289
+ certificate_ref?: string;
290
+
291
+ /**
292
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
293
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
294
+ * request body. Defaults to `false`. Example payload sent to the external
295
+ * endpoint:
296
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
297
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
298
+ * limits.
299
+ */
300
+ forward_metadata?: boolean;
301
+
302
+ /**
303
+ * Integration secret identifier for the external LLM API key.
304
+ */
305
+ llm_api_key_ref?: string;
306
+
307
+ /**
308
+ * URL used to retrieve an access token when certificate authentication is enabled.
309
+ */
310
+ token_retrieval_url?: string;
311
+ }
312
+
313
+ export interface FallbackConfig {
314
+ external_llm?: FallbackConfig.ExternalLlm;
315
+
316
+ /**
317
+ * Integration secret identifier for the fallback model API key.
318
+ */
319
+ llm_api_key_ref?: string;
320
+
321
+ /**
322
+ * Fallback Telnyx-hosted model to use when the primary LLM provider is
323
+ * unavailable.
324
+ */
325
+ model?: string;
326
+ }
327
+
328
+ export namespace FallbackConfig {
329
+ export interface ExternalLlm {
330
+ /**
331
+ * Base URL for the external LLM endpoint.
332
+ */
333
+ base_url: string;
334
+
335
+ /**
336
+ * Model identifier to use with the external LLM endpoint.
337
+ */
338
+ model: string;
339
+
340
+ /**
341
+ * Authentication method used when connecting to the external LLM endpoint.
342
+ */
343
+ authentication_method?: 'token' | 'certificate';
344
+
345
+ /**
346
+ * Integration secret identifier for the client certificate used with certificate
347
+ * authentication.
348
+ */
349
+ certificate_ref?: string;
350
+
351
+ /**
352
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
353
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
354
+ * request body. Defaults to `false`. Example payload sent to the external
355
+ * endpoint:
356
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
357
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
358
+ * limits.
359
+ */
360
+ forward_metadata?: boolean;
361
+
362
+ /**
363
+ * Integration secret identifier for the external LLM API key.
364
+ */
365
+ llm_api_key_ref?: string;
366
+
367
+ /**
368
+ * URL used to retrieve an access token when certificate authentication is enabled.
369
+ */
370
+ token_retrieval_url?: string;
371
+ }
372
+ }
373
+
374
+ /**
375
+ * Reference to a connected integration attached to an assistant. Discover
376
+ * available integrations with `/ai/integrations` and connected integrations with
377
+ * `/ai/integrations/connections`.
378
+ */
379
+ export interface Integration {
380
+ /**
381
+ * Catalog integration ID to attach. This is the `id` from the integrations catalog
382
+ * at `/ai/integrations` (the same value also appears as `integration_id` on
383
+ * entries returned by `/ai/integrations/connections`). It is **not** the
384
+ * connection-level `id` from `/ai/integrations/connections`.
385
+ */
386
+ integration_id: string;
387
+
388
+ /**
389
+ * Optional per-assistant allowlist of integration tool names. When omitted or
390
+ * empty, all tools allowed by the connected integration are available to the
391
+ * assistant.
392
+ */
393
+ allowed_list?: Array<string>;
394
+ }
395
+
396
+ /**
397
+ * Settings for interruptions and how the assistant decides the user has finished
398
+ * speaking. These timings are most relevant when using non turn-taking
399
+ * transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
400
+ * behavior is controlled by the transcription end-of-turn settings under
401
+ * `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
402
+ * `eager_eot_threshold`).
403
+ */
404
+ export interface InterruptionSettings {
405
+ /**
406
+ * Whether users can interrupt the assistant while it is speaking.
407
+ */
408
+ enable?: boolean;
409
+
410
+ /**
411
+ * Controls when the assistant starts speaking after the user stops. These
412
+ * thresholds primarily apply to non turn-taking transcription models. For
413
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
414
+ * transcription end-of-turn settings under `transcription.settings` instead.
415
+ */
416
+ start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
417
+ }
418
+
419
+ export namespace InterruptionSettings {
420
+ /**
421
+ * Controls when the assistant starts speaking after the user stops. These
422
+ * thresholds primarily apply to non turn-taking transcription models. For
423
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
424
+ * transcription end-of-turn settings under `transcription.settings` instead.
425
+ */
426
+ export interface StartSpeakingPlan {
427
+ /**
428
+ * Endpointing thresholds used to decide when the user has finished speaking.
429
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
430
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
431
+ * `eager_eot_threshold`.
432
+ */
433
+ transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
434
+
435
+ /**
436
+ * Minimum seconds to wait before the assistant starts speaking.
437
+ */
438
+ wait_seconds?: number;
439
+ }
440
+
441
+ export namespace StartSpeakingPlan {
442
+ /**
443
+ * Endpointing thresholds used to decide when the user has finished speaking.
444
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
445
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
446
+ * `eager_eot_threshold`.
447
+ */
448
+ export interface TranscriptionEndpointingPlan {
449
+ /**
450
+ * Seconds to wait after the transcript ends without punctuation.
451
+ */
452
+ on_no_punctuation_seconds?: number;
453
+
454
+ /**
455
+ * Seconds to wait after the transcript ends with a number.
456
+ */
457
+ on_number_seconds?: number;
458
+
459
+ /**
460
+ * Seconds to wait after the transcript ends with punctuation.
461
+ */
462
+ on_punctuation_seconds?: number;
463
+ }
464
+ }
465
+ }
466
+
467
+ /**
468
+ * Reference to an MCP server attached to an assistant. Create and manage MCP
469
+ * servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
470
+ * ID.
471
+ */
472
+ export interface McpServer {
473
+ /**
474
+ * ID of the MCP server to attach. This must be the `id` of an MCP server returned
475
+ * by the `/ai/mcp_servers` endpoints.
476
+ */
477
+ id: string;
478
+
479
+ /**
480
+ * Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
481
+ * uses the MCP server's configured `allowed_tools`.
482
+ */
483
+ allowed_tools?: Array<string>;
484
+ }
485
+
486
+ /**
487
+ * Configuration for post-conversation processing. When enabled, the assistant
488
+ * receives one additional LLM turn after the conversation ends, allowing it to
489
+ * execute tool calls such as logging to a CRM or sending a summary. The assistant
490
+ * can execute multiple parallel or sequential tools during this phase.
491
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
492
+ * post-conversation. Beta feature.
493
+ */
494
+ export interface PostConversationSettings {
495
+ /**
496
+ * Whether post-conversation processing is enabled. When true, the assistant will
497
+ * be invoked after the conversation ends to perform any final tool calls. Defaults
498
+ * to false.
499
+ */
500
+ enabled?: boolean;
501
+ }
502
+ }
503
+
199
504
  export interface VersionRetrieveParams {
200
505
  /**
201
506
  * Path param
@@ -225,10 +530,22 @@ export interface VersionUpdateParams {
225
530
  dynamic_variables?: { [key: string]: unknown };
226
531
 
227
532
  /**
228
- * Body param: If the dynamic_variables_webhook_url is set for the assistant, we
229
- * will send a request at the start of the conversation. See our
230
- * [guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
231
- * for more information.
533
+ * Body param: Timeout in milliseconds for the dynamic variables webhook. Must be
534
+ * between 1 and 10000 ms. If the webhook does not respond within this timeout, the
535
+ * call proceeds with default values. See the
536
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
537
+ */
538
+ dynamic_variables_webhook_timeout_ms?: number;
539
+
540
+ /**
541
+ * Body param: If `dynamic_variables_webhook_url` is set, Telnyx sends a POST
542
+ * request to this URL at the start of the conversation to resolve dynamic
543
+ * variables. **Gotcha:** the webhook response must wrap variables under a
544
+ * top-level `dynamic_variables` object, e.g.
545
+ * `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a flat object will
546
+ * be ignored and variables will fall back to their defaults. See the
547
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
548
+ * for the full request/response format and timeout behavior.
232
549
  */
233
550
  dynamic_variables_webhook_url?: string;
234
551
 
@@ -237,6 +554,16 @@ export interface VersionUpdateParams {
237
554
  */
238
555
  enabled_features?: Array<AssistantsAPI.EnabledFeatures>;
239
556
 
557
+ /**
558
+ * Body param
559
+ */
560
+ external_llm?: VersionUpdateParams.ExternalLlm;
561
+
562
+ /**
563
+ * Body param
564
+ */
565
+ fallback_config?: VersionUpdateParams.FallbackConfig;
566
+
240
567
  /**
241
568
  * Body param: Text that the assistant will use to start the conversation. This may
242
569
  * be templated with
@@ -259,23 +586,51 @@ export interface VersionUpdateParams {
259
586
  instructions?: string;
260
587
 
261
588
  /**
262
- * Body param: This is only needed when using third-party inference providers. The
263
- * `identifier` for an integration secret
589
+ * Body param: Connected integrations attached to the assistant. The catalog of
590
+ * available integrations is at `/ai/integrations`; the user's connected
591
+ * integrations are at `/ai/integrations/connections`. Each item references a
592
+ * catalog integration by `integration_id`.
593
+ */
594
+ integrations?: Array<VersionUpdateParams.Integration>;
595
+
596
+ /**
597
+ * Body param: Settings for interruptions and how the assistant decides the user
598
+ * has finished speaking. These timings are most relevant when using non
599
+ * turn-taking transcription models. For turn-taking models like `deepgram/flux`,
600
+ * end-of-turn behavior is controlled by the transcription end-of-turn settings
601
+ * under `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
602
+ * `eager_eot_threshold`).
603
+ */
604
+ interruption_settings?: VersionUpdateParams.InterruptionSettings;
605
+
606
+ /**
607
+ * Body param: This is only needed when using third-party inference providers
608
+ * selected by `model`. The `identifier` for an integration secret
264
609
  * [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
265
- * that refers to your LLM provider's API key. Warning: Free plans are unlikely to
266
- * work with this integration.
610
+ * that refers to your LLM provider's API key. For bring-your-own endpoint
611
+ * authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
612
+ * are unlikely to work with this integration.
267
613
  */
268
614
  llm_api_key_ref?: string;
269
615
 
616
+ /**
617
+ * Body param: MCP servers attached to the assistant. Create MCP servers with
618
+ * `/ai/mcp_servers`, then reference them by `id` here.
619
+ */
620
+ mcp_servers?: Array<VersionUpdateParams.McpServer>;
621
+
270
622
  /**
271
623
  * Body param
272
624
  */
273
625
  messaging_settings?: AssistantsAPI.MessagingSettings;
274
626
 
275
627
  /**
276
- * Body param: ID of the model to use. You can use the
628
+ * Body param: ID of the model to use when `external_llm` is not set. You can use
629
+ * the
277
630
  * [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
278
- * to see all of your available models,
631
+ * to see available models. If `external_llm` is provided, the assistant uses
632
+ * `external_llm` instead of this field. If neither `model` nor `external_llm` is
633
+ * provided, Telnyx applies the default model.
279
634
  */
280
635
  model?: string;
281
636
 
@@ -289,24 +644,42 @@ export interface VersionUpdateParams {
289
644
  */
290
645
  observability_settings?: AssistantsAPI.ObservabilityReq;
291
646
 
647
+ /**
648
+ * Body param: Configuration for post-conversation processing. When enabled, the
649
+ * assistant receives one additional LLM turn after the conversation ends, allowing
650
+ * it to execute tool calls such as logging to a CRM or sending a summary. The
651
+ * assistant can execute multiple parallel or sequential tools during this phase.
652
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
653
+ * post-conversation. Beta feature.
654
+ */
655
+ post_conversation_settings?: VersionUpdateParams.PostConversationSettings;
656
+
292
657
  /**
293
658
  * Body param
294
659
  */
295
660
  privacy_settings?: AssistantsAPI.PrivacySettings;
296
661
 
662
+ /**
663
+ * Body param: Tags associated with the assistant. Tags can also be managed with
664
+ * the assistant tag endpoints.
665
+ */
666
+ tags?: Array<string>;
667
+
297
668
  /**
298
669
  * Body param
299
670
  */
300
671
  telephony_settings?: AssistantsAPI.TelephonySettings;
301
672
 
302
673
  /**
303
- * Body param
674
+ * Body param: IDs of shared tools to attach to the assistant. New integrations
675
+ * should prefer `tool_ids` over inline `tools`.
304
676
  */
305
677
  tool_ids?: Array<string>;
306
678
 
307
679
  /**
308
- * Body param: The tools that the assistant can use. These may be templated with
309
- * [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
680
+ * Body param: Deprecated for new integrations. Inline tool definitions available
681
+ * to the assistant. Prefer `tool_ids` to attach shared tools created with the AI
682
+ * Tools endpoints.
310
683
  */
311
684
  tools?: Array<AssistantsAPI.AssistantTool>;
312
685
 
@@ -315,6 +688,11 @@ export interface VersionUpdateParams {
315
688
  */
316
689
  transcription?: AssistantsAPI.TranscriptionSettings;
317
690
 
691
+ /**
692
+ * Body param: Human-readable name for the assistant version.
693
+ */
694
+ version_name?: string;
695
+
318
696
  /**
319
697
  * Body param
320
698
  */
@@ -326,6 +704,242 @@ export interface VersionUpdateParams {
326
704
  widget_settings?: AssistantsAPI.WidgetSettings;
327
705
  }
328
706
 
707
+ export namespace VersionUpdateParams {
708
+ export interface ExternalLlm {
709
+ /**
710
+ * Base URL for the external LLM endpoint.
711
+ */
712
+ base_url: string;
713
+
714
+ /**
715
+ * Model identifier to use with the external LLM endpoint.
716
+ */
717
+ model: string;
718
+
719
+ /**
720
+ * Authentication method used when connecting to the external LLM endpoint.
721
+ */
722
+ authentication_method?: 'token' | 'certificate';
723
+
724
+ /**
725
+ * Integration secret identifier for the client certificate used with certificate
726
+ * authentication.
727
+ */
728
+ certificate_ref?: string;
729
+
730
+ /**
731
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
732
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
733
+ * request body. Defaults to `false`. Example payload sent to the external
734
+ * endpoint:
735
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
736
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
737
+ * limits.
738
+ */
739
+ forward_metadata?: boolean;
740
+
741
+ /**
742
+ * Integration secret identifier for the external LLM API key.
743
+ */
744
+ llm_api_key_ref?: string;
745
+
746
+ /**
747
+ * URL used to retrieve an access token when certificate authentication is enabled.
748
+ */
749
+ token_retrieval_url?: string;
750
+ }
751
+
752
+ export interface FallbackConfig {
753
+ external_llm?: FallbackConfig.ExternalLlm;
754
+
755
+ /**
756
+ * Integration secret identifier for the fallback model API key.
757
+ */
758
+ llm_api_key_ref?: string;
759
+
760
+ /**
761
+ * Fallback Telnyx-hosted model to use when the primary LLM provider is
762
+ * unavailable.
763
+ */
764
+ model?: string;
765
+ }
766
+
767
+ export namespace FallbackConfig {
768
+ export interface ExternalLlm {
769
+ /**
770
+ * Base URL for the external LLM endpoint.
771
+ */
772
+ base_url: string;
773
+
774
+ /**
775
+ * Model identifier to use with the external LLM endpoint.
776
+ */
777
+ model: string;
778
+
779
+ /**
780
+ * Authentication method used when connecting to the external LLM endpoint.
781
+ */
782
+ authentication_method?: 'token' | 'certificate';
783
+
784
+ /**
785
+ * Integration secret identifier for the client certificate used with certificate
786
+ * authentication.
787
+ */
788
+ certificate_ref?: string;
789
+
790
+ /**
791
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
792
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
793
+ * request body. Defaults to `false`. Example payload sent to the external
794
+ * endpoint:
795
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
796
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
797
+ * limits.
798
+ */
799
+ forward_metadata?: boolean;
800
+
801
+ /**
802
+ * Integration secret identifier for the external LLM API key.
803
+ */
804
+ llm_api_key_ref?: string;
805
+
806
+ /**
807
+ * URL used to retrieve an access token when certificate authentication is enabled.
808
+ */
809
+ token_retrieval_url?: string;
810
+ }
811
+ }
812
+
813
+ /**
814
+ * Reference to a connected integration attached to an assistant. Discover
815
+ * available integrations with `/ai/integrations` and connected integrations with
816
+ * `/ai/integrations/connections`.
817
+ */
818
+ export interface Integration {
819
+ /**
820
+ * Catalog integration ID to attach. This is the `id` from the integrations catalog
821
+ * at `/ai/integrations` (the same value also appears as `integration_id` on
822
+ * entries returned by `/ai/integrations/connections`). It is **not** the
823
+ * connection-level `id` from `/ai/integrations/connections`.
824
+ */
825
+ integration_id: string;
826
+
827
+ /**
828
+ * Optional per-assistant allowlist of integration tool names. When omitted or
829
+ * empty, all tools allowed by the connected integration are available to the
830
+ * assistant.
831
+ */
832
+ allowed_list?: Array<string>;
833
+ }
834
+
835
+ /**
836
+ * Settings for interruptions and how the assistant decides the user has finished
837
+ * speaking. These timings are most relevant when using non turn-taking
838
+ * transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
839
+ * behavior is controlled by the transcription end-of-turn settings under
840
+ * `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
841
+ * `eager_eot_threshold`).
842
+ */
843
+ export interface InterruptionSettings {
844
+ /**
845
+ * Whether users can interrupt the assistant while it is speaking.
846
+ */
847
+ enable?: boolean;
848
+
849
+ /**
850
+ * Controls when the assistant starts speaking after the user stops. These
851
+ * thresholds primarily apply to non turn-taking transcription models. For
852
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
853
+ * transcription end-of-turn settings under `transcription.settings` instead.
854
+ */
855
+ start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
856
+ }
857
+
858
+ export namespace InterruptionSettings {
859
+ /**
860
+ * Controls when the assistant starts speaking after the user stops. These
861
+ * thresholds primarily apply to non turn-taking transcription models. For
862
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
863
+ * transcription end-of-turn settings under `transcription.settings` instead.
864
+ */
865
+ export interface StartSpeakingPlan {
866
+ /**
867
+ * Endpointing thresholds used to decide when the user has finished speaking.
868
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
869
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
870
+ * `eager_eot_threshold`.
871
+ */
872
+ transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
873
+
874
+ /**
875
+ * Minimum seconds to wait before the assistant starts speaking.
876
+ */
877
+ wait_seconds?: number;
878
+ }
879
+
880
+ export namespace StartSpeakingPlan {
881
+ /**
882
+ * Endpointing thresholds used to decide when the user has finished speaking.
883
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
884
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
885
+ * `eager_eot_threshold`.
886
+ */
887
+ export interface TranscriptionEndpointingPlan {
888
+ /**
889
+ * Seconds to wait after the transcript ends without punctuation.
890
+ */
891
+ on_no_punctuation_seconds?: number;
892
+
893
+ /**
894
+ * Seconds to wait after the transcript ends with a number.
895
+ */
896
+ on_number_seconds?: number;
897
+
898
+ /**
899
+ * Seconds to wait after the transcript ends with punctuation.
900
+ */
901
+ on_punctuation_seconds?: number;
902
+ }
903
+ }
904
+ }
905
+
906
+ /**
907
+ * Reference to an MCP server attached to an assistant. Create and manage MCP
908
+ * servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
909
+ * ID.
910
+ */
911
+ export interface McpServer {
912
+ /**
913
+ * ID of the MCP server to attach. This must be the `id` of an MCP server returned
914
+ * by the `/ai/mcp_servers` endpoints.
915
+ */
916
+ id: string;
917
+
918
+ /**
919
+ * Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
920
+ * uses the MCP server's configured `allowed_tools`.
921
+ */
922
+ allowed_tools?: Array<string>;
923
+ }
924
+
925
+ /**
926
+ * Configuration for post-conversation processing. When enabled, the assistant
927
+ * receives one additional LLM turn after the conversation ends, allowing it to
928
+ * execute tool calls such as logging to a CRM or sending a summary. The assistant
929
+ * can execute multiple parallel or sequential tools during this phase.
930
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
931
+ * post-conversation. Beta feature.
932
+ */
933
+ export interface PostConversationSettings {
934
+ /**
935
+ * Whether post-conversation processing is enabled. When true, the assistant will
936
+ * be invoked after the conversation ends to perform any final tool calls. Defaults
937
+ * to false.
938
+ */
939
+ enabled?: boolean;
940
+ }
941
+ }
942
+
329
943
  export interface VersionDeleteParams {
330
944
  assistant_id: string;
331
945
  }