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
@@ -80,13 +80,26 @@ export interface UpdateAssistant {
80
80
  [key: string]: unknown;
81
81
  };
82
82
  /**
83
- * If the dynamic_variables_webhook_url is set for the assistant, we will send a
84
- * request at the start of the conversation. See our
85
- * [guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
86
- * for more information.
83
+ * Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
84
+ * 10000 ms. If the webhook does not respond within this timeout, the call proceeds
85
+ * with default values. See the
86
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
87
+ */
88
+ dynamic_variables_webhook_timeout_ms?: number;
89
+ /**
90
+ * If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
91
+ * URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
92
+ * the webhook response must wrap variables under a top-level `dynamic_variables`
93
+ * object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
94
+ * flat object will be ignored and variables will fall back to their defaults. See
95
+ * the
96
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
97
+ * for the full request/response format and timeout behavior.
87
98
  */
88
99
  dynamic_variables_webhook_url?: string;
89
100
  enabled_features?: Array<AssistantsAPI.EnabledFeatures>;
101
+ external_llm?: UpdateAssistant.ExternalLlm;
102
+ fallback_config?: UpdateAssistant.FallbackConfig;
90
103
  /**
91
104
  * Text that the assistant will use to start the conversation. This may be
92
105
  * templated with
@@ -103,37 +116,291 @@ export interface UpdateAssistant {
103
116
  */
104
117
  instructions?: string;
105
118
  /**
106
- * This is only needed when using third-party inference providers. The `identifier`
107
- * for an integration secret
119
+ * Connected integrations attached to the assistant. The catalog of available
120
+ * integrations is at `/ai/integrations`; the user's connected integrations are at
121
+ * `/ai/integrations/connections`. Each item references a catalog integration by
122
+ * `integration_id`.
123
+ */
124
+ integrations?: Array<UpdateAssistant.Integration>;
125
+ /**
126
+ * Settings for interruptions and how the assistant decides the user has finished
127
+ * speaking. These timings are most relevant when using non turn-taking
128
+ * transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
129
+ * behavior is controlled by the transcription end-of-turn settings under
130
+ * `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
131
+ * `eager_eot_threshold`).
132
+ */
133
+ interruption_settings?: UpdateAssistant.InterruptionSettings;
134
+ /**
135
+ * This is only needed when using third-party inference providers selected by
136
+ * `model`. The `identifier` for an integration secret
108
137
  * [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
109
- * that refers to your LLM provider's API key. Warning: Free plans are unlikely to
110
- * work with this integration.
138
+ * that refers to your LLM provider's API key. For bring-your-own endpoint
139
+ * authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
140
+ * are unlikely to work with this integration.
111
141
  */
112
142
  llm_api_key_ref?: string;
143
+ /**
144
+ * MCP servers attached to the assistant. Create MCP servers with
145
+ * `/ai/mcp_servers`, then reference them by `id` here.
146
+ */
147
+ mcp_servers?: Array<UpdateAssistant.McpServer>;
113
148
  messaging_settings?: AssistantsAPI.MessagingSettings;
114
149
  /**
115
- * ID of the model to use. You can use the
150
+ * ID of the model to use when `external_llm` is not set. You can use the
116
151
  * [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
117
- * to see all of your available models,
152
+ * to see available models. If `external_llm` is provided, the assistant uses
153
+ * `external_llm` instead of this field. If neither `model` nor `external_llm` is
154
+ * provided, Telnyx applies the default model.
118
155
  */
119
156
  model?: string;
120
157
  name?: string;
121
158
  observability_settings?: AssistantsAPI.ObservabilityReq;
159
+ /**
160
+ * Configuration for post-conversation processing. When enabled, the assistant
161
+ * receives one additional LLM turn after the conversation ends, allowing it to
162
+ * execute tool calls such as logging to a CRM or sending a summary. The assistant
163
+ * can execute multiple parallel or sequential tools during this phase.
164
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
165
+ * post-conversation. Beta feature.
166
+ */
167
+ post_conversation_settings?: UpdateAssistant.PostConversationSettings;
122
168
  privacy_settings?: AssistantsAPI.PrivacySettings;
169
+ /**
170
+ * Tags associated with the assistant. Tags can also be managed with the assistant
171
+ * tag endpoints.
172
+ */
173
+ tags?: Array<string>;
123
174
  telephony_settings?: AssistantsAPI.TelephonySettings;
175
+ /**
176
+ * IDs of shared tools to attach to the assistant. New integrations should prefer
177
+ * `tool_ids` over inline `tools`.
178
+ */
124
179
  tool_ids?: Array<string>;
125
180
  /**
126
- * The tools that the assistant can use. These may be templated with
127
- * [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
181
+ * Deprecated for new integrations. Inline tool definitions available to the
182
+ * assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
183
+ * endpoints.
128
184
  */
129
185
  tools?: Array<AssistantsAPI.AssistantTool>;
130
186
  transcription?: AssistantsAPI.TranscriptionSettings;
187
+ /**
188
+ * Human-readable name for the assistant version.
189
+ */
190
+ version_name?: string;
131
191
  voice_settings?: AssistantsAPI.VoiceSettings;
132
192
  /**
133
193
  * Configuration settings for the assistant's web widget.
134
194
  */
135
195
  widget_settings?: AssistantsAPI.WidgetSettings;
136
196
  }
197
+ export declare namespace UpdateAssistant {
198
+ interface ExternalLlm {
199
+ /**
200
+ * Base URL for the external LLM endpoint.
201
+ */
202
+ base_url: string;
203
+ /**
204
+ * Model identifier to use with the external LLM endpoint.
205
+ */
206
+ model: string;
207
+ /**
208
+ * Authentication method used when connecting to the external LLM endpoint.
209
+ */
210
+ authentication_method?: 'token' | 'certificate';
211
+ /**
212
+ * Integration secret identifier for the client certificate used with certificate
213
+ * authentication.
214
+ */
215
+ certificate_ref?: string;
216
+ /**
217
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
218
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
219
+ * request body. Defaults to `false`. Example payload sent to the external
220
+ * endpoint:
221
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
222
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
223
+ * limits.
224
+ */
225
+ forward_metadata?: boolean;
226
+ /**
227
+ * Integration secret identifier for the external LLM API key.
228
+ */
229
+ llm_api_key_ref?: string;
230
+ /**
231
+ * URL used to retrieve an access token when certificate authentication is enabled.
232
+ */
233
+ token_retrieval_url?: string;
234
+ }
235
+ interface FallbackConfig {
236
+ external_llm?: FallbackConfig.ExternalLlm;
237
+ /**
238
+ * Integration secret identifier for the fallback model API key.
239
+ */
240
+ llm_api_key_ref?: string;
241
+ /**
242
+ * Fallback Telnyx-hosted model to use when the primary LLM provider is
243
+ * unavailable.
244
+ */
245
+ model?: string;
246
+ }
247
+ namespace FallbackConfig {
248
+ interface ExternalLlm {
249
+ /**
250
+ * Base URL for the external LLM endpoint.
251
+ */
252
+ base_url: string;
253
+ /**
254
+ * Model identifier to use with the external LLM endpoint.
255
+ */
256
+ model: string;
257
+ /**
258
+ * Authentication method used when connecting to the external LLM endpoint.
259
+ */
260
+ authentication_method?: 'token' | 'certificate';
261
+ /**
262
+ * Integration secret identifier for the client certificate used with certificate
263
+ * authentication.
264
+ */
265
+ certificate_ref?: string;
266
+ /**
267
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
268
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
269
+ * request body. Defaults to `false`. Example payload sent to the external
270
+ * endpoint:
271
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
272
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
273
+ * limits.
274
+ */
275
+ forward_metadata?: boolean;
276
+ /**
277
+ * Integration secret identifier for the external LLM API key.
278
+ */
279
+ llm_api_key_ref?: string;
280
+ /**
281
+ * URL used to retrieve an access token when certificate authentication is enabled.
282
+ */
283
+ token_retrieval_url?: string;
284
+ }
285
+ }
286
+ /**
287
+ * Reference to a connected integration attached to an assistant. Discover
288
+ * available integrations with `/ai/integrations` and connected integrations with
289
+ * `/ai/integrations/connections`.
290
+ */
291
+ interface Integration {
292
+ /**
293
+ * Catalog integration ID to attach. This is the `id` from the integrations catalog
294
+ * at `/ai/integrations` (the same value also appears as `integration_id` on
295
+ * entries returned by `/ai/integrations/connections`). It is **not** the
296
+ * connection-level `id` from `/ai/integrations/connections`.
297
+ */
298
+ integration_id: string;
299
+ /**
300
+ * Optional per-assistant allowlist of integration tool names. When omitted or
301
+ * empty, all tools allowed by the connected integration are available to the
302
+ * assistant.
303
+ */
304
+ allowed_list?: Array<string>;
305
+ }
306
+ /**
307
+ * Settings for interruptions and how the assistant decides the user has finished
308
+ * speaking. These timings are most relevant when using non turn-taking
309
+ * transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
310
+ * behavior is controlled by the transcription end-of-turn settings under
311
+ * `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
312
+ * `eager_eot_threshold`).
313
+ */
314
+ interface InterruptionSettings {
315
+ /**
316
+ * Whether users can interrupt the assistant while it is speaking.
317
+ */
318
+ enable?: boolean;
319
+ /**
320
+ * Controls when the assistant starts speaking after the user stops. These
321
+ * thresholds primarily apply to non turn-taking transcription models. For
322
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
323
+ * transcription end-of-turn settings under `transcription.settings` instead.
324
+ */
325
+ start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
326
+ }
327
+ namespace InterruptionSettings {
328
+ /**
329
+ * Controls when the assistant starts speaking after the user stops. These
330
+ * thresholds primarily apply to non turn-taking transcription models. For
331
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
332
+ * transcription end-of-turn settings under `transcription.settings` instead.
333
+ */
334
+ interface StartSpeakingPlan {
335
+ /**
336
+ * Endpointing thresholds used to decide when the user has finished speaking.
337
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
338
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
339
+ * `eager_eot_threshold`.
340
+ */
341
+ transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
342
+ /**
343
+ * Minimum seconds to wait before the assistant starts speaking.
344
+ */
345
+ wait_seconds?: number;
346
+ }
347
+ namespace StartSpeakingPlan {
348
+ /**
349
+ * Endpointing thresholds used to decide when the user has finished speaking.
350
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
351
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
352
+ * `eager_eot_threshold`.
353
+ */
354
+ interface TranscriptionEndpointingPlan {
355
+ /**
356
+ * Seconds to wait after the transcript ends without punctuation.
357
+ */
358
+ on_no_punctuation_seconds?: number;
359
+ /**
360
+ * Seconds to wait after the transcript ends with a number.
361
+ */
362
+ on_number_seconds?: number;
363
+ /**
364
+ * Seconds to wait after the transcript ends with punctuation.
365
+ */
366
+ on_punctuation_seconds?: number;
367
+ }
368
+ }
369
+ }
370
+ /**
371
+ * Reference to an MCP server attached to an assistant. Create and manage MCP
372
+ * servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
373
+ * ID.
374
+ */
375
+ interface McpServer {
376
+ /**
377
+ * ID of the MCP server to attach. This must be the `id` of an MCP server returned
378
+ * by the `/ai/mcp_servers` endpoints.
379
+ */
380
+ id: string;
381
+ /**
382
+ * Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
383
+ * uses the MCP server's configured `allowed_tools`.
384
+ */
385
+ allowed_tools?: Array<string>;
386
+ }
387
+ /**
388
+ * Configuration for post-conversation processing. When enabled, the assistant
389
+ * receives one additional LLM turn after the conversation ends, allowing it to
390
+ * execute tool calls such as logging to a CRM or sending a summary. The assistant
391
+ * can execute multiple parallel or sequential tools during this phase.
392
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
393
+ * post-conversation. Beta feature.
394
+ */
395
+ interface PostConversationSettings {
396
+ /**
397
+ * Whether post-conversation processing is enabled. When true, the assistant will
398
+ * be invoked after the conversation ends to perform any final tool calls. Defaults
399
+ * to false.
400
+ */
401
+ enabled?: boolean;
402
+ }
403
+ }
137
404
  export interface VersionRetrieveParams {
138
405
  /**
139
406
  * Path param
@@ -160,16 +427,35 @@ export interface VersionUpdateParams {
160
427
  [key: string]: unknown;
161
428
  };
162
429
  /**
163
- * Body param: If the dynamic_variables_webhook_url is set for the assistant, we
164
- * will send a request at the start of the conversation. See our
165
- * [guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
166
- * for more information.
430
+ * Body param: Timeout in milliseconds for the dynamic variables webhook. Must be
431
+ * between 1 and 10000 ms. If the webhook does not respond within this timeout, the
432
+ * call proceeds with default values. See the
433
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
434
+ */
435
+ dynamic_variables_webhook_timeout_ms?: number;
436
+ /**
437
+ * Body param: If `dynamic_variables_webhook_url` is set, Telnyx sends a POST
438
+ * request to this URL at the start of the conversation to resolve dynamic
439
+ * variables. **Gotcha:** the webhook response must wrap variables under a
440
+ * top-level `dynamic_variables` object, e.g.
441
+ * `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a flat object will
442
+ * be ignored and variables will fall back to their defaults. See the
443
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
444
+ * for the full request/response format and timeout behavior.
167
445
  */
168
446
  dynamic_variables_webhook_url?: string;
169
447
  /**
170
448
  * Body param
171
449
  */
172
450
  enabled_features?: Array<AssistantsAPI.EnabledFeatures>;
451
+ /**
452
+ * Body param
453
+ */
454
+ external_llm?: VersionUpdateParams.ExternalLlm;
455
+ /**
456
+ * Body param
457
+ */
458
+ fallback_config?: VersionUpdateParams.FallbackConfig;
173
459
  /**
174
460
  * Body param: Text that the assistant will use to start the conversation. This may
175
461
  * be templated with
@@ -189,21 +475,46 @@ export interface VersionUpdateParams {
189
475
  */
190
476
  instructions?: string;
191
477
  /**
192
- * Body param: This is only needed when using third-party inference providers. The
193
- * `identifier` for an integration secret
478
+ * Body param: Connected integrations attached to the assistant. The catalog of
479
+ * available integrations is at `/ai/integrations`; the user's connected
480
+ * integrations are at `/ai/integrations/connections`. Each item references a
481
+ * catalog integration by `integration_id`.
482
+ */
483
+ integrations?: Array<VersionUpdateParams.Integration>;
484
+ /**
485
+ * Body param: Settings for interruptions and how the assistant decides the user
486
+ * has finished speaking. These timings are most relevant when using non
487
+ * turn-taking transcription models. For turn-taking models like `deepgram/flux`,
488
+ * end-of-turn behavior is controlled by the transcription end-of-turn settings
489
+ * under `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
490
+ * `eager_eot_threshold`).
491
+ */
492
+ interruption_settings?: VersionUpdateParams.InterruptionSettings;
493
+ /**
494
+ * Body param: This is only needed when using third-party inference providers
495
+ * selected by `model`. The `identifier` for an integration secret
194
496
  * [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
195
- * that refers to your LLM provider's API key. Warning: Free plans are unlikely to
196
- * work with this integration.
497
+ * that refers to your LLM provider's API key. For bring-your-own endpoint
498
+ * authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
499
+ * are unlikely to work with this integration.
197
500
  */
198
501
  llm_api_key_ref?: string;
502
+ /**
503
+ * Body param: MCP servers attached to the assistant. Create MCP servers with
504
+ * `/ai/mcp_servers`, then reference them by `id` here.
505
+ */
506
+ mcp_servers?: Array<VersionUpdateParams.McpServer>;
199
507
  /**
200
508
  * Body param
201
509
  */
202
510
  messaging_settings?: AssistantsAPI.MessagingSettings;
203
511
  /**
204
- * Body param: ID of the model to use. You can use the
512
+ * Body param: ID of the model to use when `external_llm` is not set. You can use
513
+ * the
205
514
  * [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
206
- * to see all of your available models,
515
+ * to see available models. If `external_llm` is provided, the assistant uses
516
+ * `external_llm` instead of this field. If neither `model` nor `external_llm` is
517
+ * provided, Telnyx applies the default model.
207
518
  */
208
519
  model?: string;
209
520
  /**
@@ -214,27 +525,47 @@ export interface VersionUpdateParams {
214
525
  * Body param
215
526
  */
216
527
  observability_settings?: AssistantsAPI.ObservabilityReq;
528
+ /**
529
+ * Body param: Configuration for post-conversation processing. When enabled, the
530
+ * assistant receives one additional LLM turn after the conversation ends, allowing
531
+ * it to execute tool calls such as logging to a CRM or sending a summary. The
532
+ * assistant can execute multiple parallel or sequential tools during this phase.
533
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
534
+ * post-conversation. Beta feature.
535
+ */
536
+ post_conversation_settings?: VersionUpdateParams.PostConversationSettings;
217
537
  /**
218
538
  * Body param
219
539
  */
220
540
  privacy_settings?: AssistantsAPI.PrivacySettings;
541
+ /**
542
+ * Body param: Tags associated with the assistant. Tags can also be managed with
543
+ * the assistant tag endpoints.
544
+ */
545
+ tags?: Array<string>;
221
546
  /**
222
547
  * Body param
223
548
  */
224
549
  telephony_settings?: AssistantsAPI.TelephonySettings;
225
550
  /**
226
- * Body param
551
+ * Body param: IDs of shared tools to attach to the assistant. New integrations
552
+ * should prefer `tool_ids` over inline `tools`.
227
553
  */
228
554
  tool_ids?: Array<string>;
229
555
  /**
230
- * Body param: The tools that the assistant can use. These may be templated with
231
- * [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
556
+ * Body param: Deprecated for new integrations. Inline tool definitions available
557
+ * to the assistant. Prefer `tool_ids` to attach shared tools created with the AI
558
+ * Tools endpoints.
232
559
  */
233
560
  tools?: Array<AssistantsAPI.AssistantTool>;
234
561
  /**
235
562
  * Body param
236
563
  */
237
564
  transcription?: AssistantsAPI.TranscriptionSettings;
565
+ /**
566
+ * Body param: Human-readable name for the assistant version.
567
+ */
568
+ version_name?: string;
238
569
  /**
239
570
  * Body param
240
571
  */
@@ -244,6 +575,213 @@ export interface VersionUpdateParams {
244
575
  */
245
576
  widget_settings?: AssistantsAPI.WidgetSettings;
246
577
  }
578
+ export declare namespace VersionUpdateParams {
579
+ interface ExternalLlm {
580
+ /**
581
+ * Base URL for the external LLM endpoint.
582
+ */
583
+ base_url: string;
584
+ /**
585
+ * Model identifier to use with the external LLM endpoint.
586
+ */
587
+ model: string;
588
+ /**
589
+ * Authentication method used when connecting to the external LLM endpoint.
590
+ */
591
+ authentication_method?: 'token' | 'certificate';
592
+ /**
593
+ * Integration secret identifier for the client certificate used with certificate
594
+ * authentication.
595
+ */
596
+ certificate_ref?: string;
597
+ /**
598
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
599
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
600
+ * request body. Defaults to `false`. Example payload sent to the external
601
+ * endpoint:
602
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
603
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
604
+ * limits.
605
+ */
606
+ forward_metadata?: boolean;
607
+ /**
608
+ * Integration secret identifier for the external LLM API key.
609
+ */
610
+ llm_api_key_ref?: string;
611
+ /**
612
+ * URL used to retrieve an access token when certificate authentication is enabled.
613
+ */
614
+ token_retrieval_url?: string;
615
+ }
616
+ interface FallbackConfig {
617
+ external_llm?: FallbackConfig.ExternalLlm;
618
+ /**
619
+ * Integration secret identifier for the fallback model API key.
620
+ */
621
+ llm_api_key_ref?: string;
622
+ /**
623
+ * Fallback Telnyx-hosted model to use when the primary LLM provider is
624
+ * unavailable.
625
+ */
626
+ model?: string;
627
+ }
628
+ namespace FallbackConfig {
629
+ interface ExternalLlm {
630
+ /**
631
+ * Base URL for the external LLM endpoint.
632
+ */
633
+ base_url: string;
634
+ /**
635
+ * Model identifier to use with the external LLM endpoint.
636
+ */
637
+ model: string;
638
+ /**
639
+ * Authentication method used when connecting to the external LLM endpoint.
640
+ */
641
+ authentication_method?: 'token' | 'certificate';
642
+ /**
643
+ * Integration secret identifier for the client certificate used with certificate
644
+ * authentication.
645
+ */
646
+ certificate_ref?: string;
647
+ /**
648
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
649
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
650
+ * request body. Defaults to `false`. Example payload sent to the external
651
+ * endpoint:
652
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
653
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
654
+ * limits.
655
+ */
656
+ forward_metadata?: boolean;
657
+ /**
658
+ * Integration secret identifier for the external LLM API key.
659
+ */
660
+ llm_api_key_ref?: string;
661
+ /**
662
+ * URL used to retrieve an access token when certificate authentication is enabled.
663
+ */
664
+ token_retrieval_url?: string;
665
+ }
666
+ }
667
+ /**
668
+ * Reference to a connected integration attached to an assistant. Discover
669
+ * available integrations with `/ai/integrations` and connected integrations with
670
+ * `/ai/integrations/connections`.
671
+ */
672
+ interface Integration {
673
+ /**
674
+ * Catalog integration ID to attach. This is the `id` from the integrations catalog
675
+ * at `/ai/integrations` (the same value also appears as `integration_id` on
676
+ * entries returned by `/ai/integrations/connections`). It is **not** the
677
+ * connection-level `id` from `/ai/integrations/connections`.
678
+ */
679
+ integration_id: string;
680
+ /**
681
+ * Optional per-assistant allowlist of integration tool names. When omitted or
682
+ * empty, all tools allowed by the connected integration are available to the
683
+ * assistant.
684
+ */
685
+ allowed_list?: Array<string>;
686
+ }
687
+ /**
688
+ * Settings for interruptions and how the assistant decides the user has finished
689
+ * speaking. These timings are most relevant when using non turn-taking
690
+ * transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
691
+ * behavior is controlled by the transcription end-of-turn settings under
692
+ * `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
693
+ * `eager_eot_threshold`).
694
+ */
695
+ interface InterruptionSettings {
696
+ /**
697
+ * Whether users can interrupt the assistant while it is speaking.
698
+ */
699
+ enable?: boolean;
700
+ /**
701
+ * Controls when the assistant starts speaking after the user stops. These
702
+ * thresholds primarily apply to non turn-taking transcription models. For
703
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
704
+ * transcription end-of-turn settings under `transcription.settings` instead.
705
+ */
706
+ start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
707
+ }
708
+ namespace InterruptionSettings {
709
+ /**
710
+ * Controls when the assistant starts speaking after the user stops. These
711
+ * thresholds primarily apply to non turn-taking transcription models. For
712
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
713
+ * transcription end-of-turn settings under `transcription.settings` instead.
714
+ */
715
+ interface StartSpeakingPlan {
716
+ /**
717
+ * Endpointing thresholds used to decide when the user has finished speaking.
718
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
719
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
720
+ * `eager_eot_threshold`.
721
+ */
722
+ transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
723
+ /**
724
+ * Minimum seconds to wait before the assistant starts speaking.
725
+ */
726
+ wait_seconds?: number;
727
+ }
728
+ namespace StartSpeakingPlan {
729
+ /**
730
+ * Endpointing thresholds used to decide when the user has finished speaking.
731
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
732
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
733
+ * `eager_eot_threshold`.
734
+ */
735
+ interface TranscriptionEndpointingPlan {
736
+ /**
737
+ * Seconds to wait after the transcript ends without punctuation.
738
+ */
739
+ on_no_punctuation_seconds?: number;
740
+ /**
741
+ * Seconds to wait after the transcript ends with a number.
742
+ */
743
+ on_number_seconds?: number;
744
+ /**
745
+ * Seconds to wait after the transcript ends with punctuation.
746
+ */
747
+ on_punctuation_seconds?: number;
748
+ }
749
+ }
750
+ }
751
+ /**
752
+ * Reference to an MCP server attached to an assistant. Create and manage MCP
753
+ * servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
754
+ * ID.
755
+ */
756
+ interface McpServer {
757
+ /**
758
+ * ID of the MCP server to attach. This must be the `id` of an MCP server returned
759
+ * by the `/ai/mcp_servers` endpoints.
760
+ */
761
+ id: string;
762
+ /**
763
+ * Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
764
+ * uses the MCP server's configured `allowed_tools`.
765
+ */
766
+ allowed_tools?: Array<string>;
767
+ }
768
+ /**
769
+ * Configuration for post-conversation processing. When enabled, the assistant
770
+ * receives one additional LLM turn after the conversation ends, allowing it to
771
+ * execute tool calls such as logging to a CRM or sending a summary. The assistant
772
+ * can execute multiple parallel or sequential tools during this phase.
773
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
774
+ * post-conversation. Beta feature.
775
+ */
776
+ interface PostConversationSettings {
777
+ /**
778
+ * Whether post-conversation processing is enabled. When true, the assistant will
779
+ * be invoked after the conversation ends to perform any final tool calls. Defaults
780
+ * to false.
781
+ */
782
+ enabled?: boolean;
783
+ }
784
+ }
247
785
  export interface VersionDeleteParams {
248
786
  assistant_id: string;
249
787
  }