telnyx 7.17.0 → 7.19.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 (260) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/client.d.mts +5 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +5 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/lib/webhooks.d.mts +1 -1
  11. package/lib/webhooks.d.mts.map +1 -1
  12. package/lib/webhooks.d.ts +1 -1
  13. package/lib/webhooks.d.ts.map +1 -1
  14. package/lib/webhooks.js +74 -39
  15. package/lib/webhooks.js.map +1 -1
  16. package/lib/webhooks.mjs +52 -17
  17. package/lib/webhooks.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/ai/ai.d.mts +6 -2
  20. package/resources/ai/ai.d.mts.map +1 -1
  21. package/resources/ai/ai.d.ts +6 -2
  22. package/resources/ai/ai.d.ts.map +1 -1
  23. package/resources/ai/ai.js +4 -0
  24. package/resources/ai/ai.js.map +1 -1
  25. package/resources/ai/ai.mjs +4 -0
  26. package/resources/ai/ai.mjs.map +1 -1
  27. package/resources/ai/anthropic/v1.d.mts +4 -3
  28. package/resources/ai/anthropic/v1.d.mts.map +1 -1
  29. package/resources/ai/anthropic/v1.d.ts +4 -3
  30. package/resources/ai/anthropic/v1.d.ts.map +1 -1
  31. package/resources/ai/anthropic/v1.js +1 -1
  32. package/resources/ai/anthropic/v1.mjs +1 -1
  33. package/resources/ai/assistants/assistants.d.mts +124 -18
  34. package/resources/ai/assistants/assistants.d.mts.map +1 -1
  35. package/resources/ai/assistants/assistants.d.ts +124 -18
  36. package/resources/ai/assistants/assistants.d.ts.map +1 -1
  37. package/resources/ai/assistants/assistants.js.map +1 -1
  38. package/resources/ai/assistants/assistants.mjs.map +1 -1
  39. package/resources/ai/chat.d.mts +8 -0
  40. package/resources/ai/chat.d.mts.map +1 -1
  41. package/resources/ai/chat.d.ts +8 -0
  42. package/resources/ai/chat.d.ts.map +1 -1
  43. package/resources/ai/collections/collections.d.mts +1 -102
  44. package/resources/ai/collections/collections.d.mts.map +1 -1
  45. package/resources/ai/collections/collections.d.ts +1 -102
  46. package/resources/ai/collections/collections.d.ts.map +1 -1
  47. package/resources/ai/collections/collections.js +0 -44
  48. package/resources/ai/collections/collections.js.map +1 -1
  49. package/resources/ai/collections/collections.mjs +0 -44
  50. package/resources/ai/collections/collections.mjs.map +1 -1
  51. package/resources/ai/collections/index.d.mts +1 -1
  52. package/resources/ai/collections/index.d.mts.map +1 -1
  53. package/resources/ai/collections/index.d.ts +1 -1
  54. package/resources/ai/collections/index.d.ts.map +1 -1
  55. package/resources/ai/collections/index.js.map +1 -1
  56. package/resources/ai/collections/index.mjs.map +1 -1
  57. package/resources/ai/collections/settings.d.mts +4 -1
  58. package/resources/ai/collections/settings.d.mts.map +1 -1
  59. package/resources/ai/collections/settings.d.ts +4 -1
  60. package/resources/ai/collections/settings.d.ts.map +1 -1
  61. package/resources/ai/index.d.mts +2 -1
  62. package/resources/ai/index.d.mts.map +1 -1
  63. package/resources/ai/index.d.ts +2 -1
  64. package/resources/ai/index.d.ts.map +1 -1
  65. package/resources/ai/index.js +7 -5
  66. package/resources/ai/index.js.map +1 -1
  67. package/resources/ai/index.mjs +1 -0
  68. package/resources/ai/index.mjs.map +1 -1
  69. package/resources/ai/knowledge/collections.d.mts +140 -0
  70. package/resources/ai/knowledge/collections.d.mts.map +1 -0
  71. package/resources/ai/knowledge/collections.d.ts +140 -0
  72. package/resources/ai/knowledge/collections.d.ts.map +1 -0
  73. package/resources/ai/knowledge/collections.js +58 -0
  74. package/resources/ai/knowledge/collections.js.map +1 -0
  75. package/resources/ai/knowledge/collections.mjs +54 -0
  76. package/resources/ai/knowledge/collections.mjs.map +1 -0
  77. package/resources/ai/knowledge/index.d.mts +3 -0
  78. package/resources/ai/knowledge/index.d.mts.map +1 -0
  79. package/resources/ai/knowledge/index.d.ts +3 -0
  80. package/resources/ai/knowledge/index.d.ts.map +1 -0
  81. package/resources/ai/knowledge/index.js +9 -0
  82. package/resources/ai/knowledge/index.js.map +1 -0
  83. package/resources/ai/knowledge/index.mjs +4 -0
  84. package/resources/ai/knowledge/index.mjs.map +1 -0
  85. package/resources/ai/knowledge/knowledge.d.mts +10 -0
  86. package/resources/ai/knowledge/knowledge.d.mts.map +1 -0
  87. package/resources/ai/knowledge/knowledge.d.ts +10 -0
  88. package/resources/ai/knowledge/knowledge.d.ts.map +1 -0
  89. package/resources/ai/knowledge/knowledge.js +17 -0
  90. package/resources/ai/knowledge/knowledge.js.map +1 -0
  91. package/resources/ai/knowledge/knowledge.mjs +12 -0
  92. package/resources/ai/knowledge/knowledge.mjs.map +1 -0
  93. package/resources/ai/knowledge.d.mts +2 -0
  94. package/resources/ai/knowledge.d.mts.map +1 -0
  95. package/resources/ai/knowledge.d.ts +2 -0
  96. package/resources/ai/knowledge.d.ts.map +1 -0
  97. package/resources/ai/knowledge.js +6 -0
  98. package/resources/ai/knowledge.js.map +1 -0
  99. package/resources/ai/knowledge.mjs +3 -0
  100. package/resources/ai/knowledge.mjs.map +1 -0
  101. package/resources/ai/openai/chat.d.mts +8 -0
  102. package/resources/ai/openai/chat.d.mts.map +1 -1
  103. package/resources/ai/openai/chat.d.ts +8 -0
  104. package/resources/ai/openai/chat.d.ts.map +1 -1
  105. package/resources/ai/openai/openai.d.mts +10 -0
  106. package/resources/ai/openai/openai.d.mts.map +1 -1
  107. package/resources/ai/openai/openai.d.ts +10 -0
  108. package/resources/ai/openai/openai.d.ts.map +1 -1
  109. package/resources/ai/openai/openai.js.map +1 -1
  110. package/resources/ai/openai/openai.mjs.map +1 -1
  111. package/resources/calls/actions.d.mts +35 -12
  112. package/resources/calls/actions.d.mts.map +1 -1
  113. package/resources/calls/actions.d.ts +35 -12
  114. package/resources/calls/actions.d.ts.map +1 -1
  115. package/resources/calls/calls.d.mts +2 -2
  116. package/resources/calls/calls.d.mts.map +1 -1
  117. package/resources/calls/calls.d.ts +2 -2
  118. package/resources/calls/calls.d.ts.map +1 -1
  119. package/resources/calls/calls.js.map +1 -1
  120. package/resources/calls/calls.mjs.map +1 -1
  121. package/resources/calls/index.d.mts +1 -1
  122. package/resources/calls/index.d.mts.map +1 -1
  123. package/resources/calls/index.d.ts +1 -1
  124. package/resources/calls/index.d.ts.map +1 -1
  125. package/resources/calls/index.js.map +1 -1
  126. package/resources/calls/index.mjs.map +1 -1
  127. package/resources/conferences/actions.d.mts +3 -1
  128. package/resources/conferences/actions.d.mts.map +1 -1
  129. package/resources/conferences/actions.d.ts +3 -1
  130. package/resources/conferences/actions.d.ts.map +1 -1
  131. package/resources/credential-connections/credential-connections.d.mts +2 -2
  132. package/resources/credential-connections/credential-connections.d.ts +2 -2
  133. package/resources/external-requirements/external-requirements.d.mts +10 -0
  134. package/resources/external-requirements/external-requirements.d.mts.map +1 -0
  135. package/resources/external-requirements/external-requirements.d.ts +10 -0
  136. package/resources/external-requirements/external-requirements.d.ts.map +1 -0
  137. package/resources/external-requirements/external-requirements.js +17 -0
  138. package/resources/external-requirements/external-requirements.js.map +1 -0
  139. package/resources/external-requirements/external-requirements.mjs +12 -0
  140. package/resources/external-requirements/external-requirements.mjs.map +1 -0
  141. package/resources/external-requirements/index.d.mts +3 -0
  142. package/resources/external-requirements/index.d.mts.map +1 -0
  143. package/resources/external-requirements/index.d.ts +3 -0
  144. package/resources/external-requirements/index.d.ts.map +1 -0
  145. package/resources/external-requirements/index.js +9 -0
  146. package/resources/external-requirements/index.js.map +1 -0
  147. package/resources/external-requirements/index.mjs +4 -0
  148. package/resources/external-requirements/index.mjs.map +1 -0
  149. package/resources/external-requirements/sub-number-orders.d.mts +151 -0
  150. package/resources/external-requirements/sub-number-orders.d.mts.map +1 -0
  151. package/resources/external-requirements/sub-number-orders.d.ts +151 -0
  152. package/resources/external-requirements/sub-number-orders.d.ts.map +1 -0
  153. package/resources/external-requirements/sub-number-orders.js +61 -0
  154. package/resources/external-requirements/sub-number-orders.js.map +1 -0
  155. package/resources/external-requirements/sub-number-orders.mjs +57 -0
  156. package/resources/external-requirements/sub-number-orders.mjs.map +1 -0
  157. package/resources/external-requirements.d.mts +2 -0
  158. package/resources/external-requirements.d.mts.map +1 -0
  159. package/resources/external-requirements.d.ts +2 -0
  160. package/resources/external-requirements.d.ts.map +1 -0
  161. package/resources/external-requirements.js +6 -0
  162. package/resources/external-requirements.js.map +1 -0
  163. package/resources/external-requirements.mjs +3 -0
  164. package/resources/external-requirements.mjs.map +1 -0
  165. package/resources/index.d.mts +2 -1
  166. package/resources/index.d.mts.map +1 -1
  167. package/resources/index.d.ts +2 -1
  168. package/resources/index.d.ts.map +1 -1
  169. package/resources/index.js +6 -4
  170. package/resources/index.js.map +1 -1
  171. package/resources/index.mjs +1 -0
  172. package/resources/index.mjs.map +1 -1
  173. package/resources/outbound-voice-profiles.d.mts +30 -30
  174. package/resources/outbound-voice-profiles.d.ts +30 -30
  175. package/resources/phone-numbers/jobs.d.mts +21 -4
  176. package/resources/phone-numbers/jobs.d.mts.map +1 -1
  177. package/resources/phone-numbers/jobs.d.ts +21 -4
  178. package/resources/phone-numbers/jobs.d.ts.map +1 -1
  179. package/resources/phone-numbers/jobs.js +4 -2
  180. package/resources/phone-numbers/jobs.js.map +1 -1
  181. package/resources/phone-numbers/jobs.mjs +4 -2
  182. package/resources/phone-numbers/jobs.mjs.map +1 -1
  183. package/resources/sim-card-groups/actions.d.mts +10 -4
  184. package/resources/sim-card-groups/actions.d.mts.map +1 -1
  185. package/resources/sim-card-groups/actions.d.ts +10 -4
  186. package/resources/sim-card-groups/actions.d.ts.map +1 -1
  187. package/resources/sim-card-groups/actions.js +6 -4
  188. package/resources/sim-card-groups/actions.js.map +1 -1
  189. package/resources/sim-card-groups/actions.mjs +6 -4
  190. package/resources/sim-card-groups/actions.mjs.map +1 -1
  191. package/resources/speech-to-text/speech-to-text.d.mts +20 -10
  192. package/resources/speech-to-text/speech-to-text.d.mts.map +1 -1
  193. package/resources/speech-to-text/speech-to-text.d.ts +20 -10
  194. package/resources/speech-to-text/speech-to-text.d.ts.map +1 -1
  195. package/resources/speech-to-text/speech-to-text.js +3 -2
  196. package/resources/speech-to-text/speech-to-text.js.map +1 -1
  197. package/resources/speech-to-text/speech-to-text.mjs +3 -2
  198. package/resources/speech-to-text/speech-to-text.mjs.map +1 -1
  199. package/resources/webhooks.d.mts +4 -3
  200. package/resources/webhooks.d.mts.map +1 -1
  201. package/resources/webhooks.d.ts +4 -3
  202. package/resources/webhooks.d.ts.map +1 -1
  203. package/resources/webhooks.js +4 -11
  204. package/resources/webhooks.js.map +1 -1
  205. package/resources/webhooks.mjs +4 -11
  206. package/resources/webhooks.mjs.map +1 -1
  207. package/resources/wireless-blocklist-values.d.mts +6 -19
  208. package/resources/wireless-blocklist-values.d.mts.map +1 -1
  209. package/resources/wireless-blocklist-values.d.ts +6 -19
  210. package/resources/wireless-blocklist-values.d.ts.map +1 -1
  211. package/resources/wireless-blocklist-values.js +2 -1
  212. package/resources/wireless-blocklist-values.js.map +1 -1
  213. package/resources/wireless-blocklist-values.mjs +2 -1
  214. package/resources/wireless-blocklist-values.mjs.map +1 -1
  215. package/resources/wireless-blocklists.d.mts +40 -20
  216. package/resources/wireless-blocklists.d.mts.map +1 -1
  217. package/resources/wireless-blocklists.d.ts +40 -20
  218. package/resources/wireless-blocklists.d.ts.map +1 -1
  219. package/resources/wireless-blocklists.js +12 -7
  220. package/resources/wireless-blocklists.js.map +1 -1
  221. package/resources/wireless-blocklists.mjs +12 -7
  222. package/resources/wireless-blocklists.mjs.map +1 -1
  223. package/src/client.ts +9 -4
  224. package/src/lib/webhooks.ts +59 -18
  225. package/src/resources/ai/ai.ts +6 -6
  226. package/src/resources/ai/anthropic/v1.ts +4 -3
  227. package/src/resources/ai/assistants/assistants.ts +130 -17
  228. package/src/resources/ai/chat.ts +9 -0
  229. package/src/resources/ai/collections/collections.ts +0 -134
  230. package/src/resources/ai/collections/index.ts +0 -3
  231. package/src/resources/ai/collections/settings.ts +4 -1
  232. package/src/resources/ai/index.ts +1 -3
  233. package/src/resources/ai/knowledge/collections.ts +179 -0
  234. package/src/resources/ai/knowledge/index.ts +8 -0
  235. package/src/resources/ai/knowledge/knowledge.ts +23 -0
  236. package/src/resources/ai/knowledge.ts +3 -0
  237. package/src/resources/ai/openai/chat.ts +9 -0
  238. package/src/resources/ai/openai/openai.ts +12 -0
  239. package/src/resources/calls/actions.ts +38 -6
  240. package/src/resources/calls/calls.ts +2 -0
  241. package/src/resources/calls/index.ts +1 -0
  242. package/src/resources/conferences/actions.ts +3 -1
  243. package/src/resources/credential-connections/credential-connections.ts +2 -2
  244. package/src/resources/external-requirements/external-requirements.ts +27 -0
  245. package/src/resources/external-requirements/index.ts +10 -0
  246. package/src/resources/external-requirements/sub-number-orders.ts +202 -0
  247. package/src/resources/external-requirements.ts +3 -0
  248. package/src/resources/index.ts +3 -2
  249. package/src/resources/outbound-voice-profiles.ts +30 -30
  250. package/src/resources/phone-numbers/jobs.ts +23 -4
  251. package/src/resources/sim-card-groups/actions.ts +11 -4
  252. package/src/resources/speech-to-text/speech-to-text.ts +23 -9
  253. package/src/resources/webhooks.ts +8 -13
  254. package/src/resources/wireless-blocklist-values.ts +6 -23
  255. package/src/resources/wireless-blocklists.ts +54 -25
  256. package/src/version.ts +1 -1
  257. package/version.d.mts +1 -1
  258. package/version.d.ts +1 -1
  259. package/version.js +1 -1
  260. package/version.mjs +1 -1
@@ -574,6 +574,21 @@ export namespace AssistantTool {
574
574
  */
575
575
  warm_message_delay_ms?: number | null;
576
576
 
577
+ /**
578
+ * Requires the transfer destination to accept the call before the caller is
579
+ * bridged. When enabled, the assistant speaks privately with the destination after
580
+ * they answer — delivering the warm transfer message and asking whether they take
581
+ * the call — while the caller keeps hearing ringback. The assistant then finalizes
582
+ * the transfer with the built-in `complete_transfer` tool: an accept bridges the
583
+ * calls, a decline hangs up the destination and returns the assistant to the
584
+ * caller with the reason the destination gave. Requires either
585
+ * `warm_transfer_instructions` or a `message` on every target, otherwise the
586
+ * assistant fails to save. Only available for calls started with
587
+ * `ai_assistant_start`; single-caller conversations only (a conference or
588
+ * additional invited participants fall back to a regular warm transfer).
589
+ */
590
+ warm_transfer_acceptance?: Transfer.WarmTransferAcceptance;
591
+
577
592
  /**
578
593
  * Natural language instructions for your agent for how to provide context for the
579
594
  * transfer recipient.
@@ -588,6 +603,13 @@ export namespace AssistantTool {
588
603
  */
589
604
  to: string;
590
605
 
606
+ /**
607
+ * The warm transfer message to deliver to this specific target. When set, it takes
608
+ * precedence over the message the assistant composes from
609
+ * `warm_transfer_instructions`.
610
+ */
611
+ message?: string;
612
+
591
613
  /**
592
614
  * The name of the target.
593
615
  */
@@ -730,6 +752,35 @@ export namespace AssistantTool {
730
752
  }
731
753
  }
732
754
  }
755
+
756
+ /**
757
+ * Requires the transfer destination to accept the call before the caller is
758
+ * bridged. When enabled, the assistant speaks privately with the destination after
759
+ * they answer — delivering the warm transfer message and asking whether they take
760
+ * the call — while the caller keeps hearing ringback. The assistant then finalizes
761
+ * the transfer with the built-in `complete_transfer` tool: an accept bridges the
762
+ * calls, a decline hangs up the destination and returns the assistant to the
763
+ * caller with the reason the destination gave. Requires either
764
+ * `warm_transfer_instructions` or a `message` on every target, otherwise the
765
+ * assistant fails to save. Only available for calls started with
766
+ * `ai_assistant_start`; single-caller conversations only (a conference or
767
+ * additional invited participants fall back to a regular warm transfer).
768
+ */
769
+ export interface WarmTransferAcceptance {
770
+ /**
771
+ * Whether the destination must accept the transfer before the calls are bridged.
772
+ */
773
+ enabled?: boolean;
774
+
775
+ /**
776
+ * Controls whether the private exchange between the assistant and the transfer
777
+ * destination is kept out of the conversation. With `private` (default) the
778
+ * exchange never reaches the conversation history, AI conversations, webhooks or
779
+ * insights, and the transfer tool result is rewritten with the outcome only. With
780
+ * `shared` the exchange stays in the conversation like any other messages.
781
+ */
782
+ end_user_target_context_mode?: 'private' | 'shared';
783
+ }
733
784
  }
734
785
  }
735
786
 
@@ -1907,6 +1958,29 @@ export namespace InferenceEmbeddingWebhookToolParams {
1907
1958
  */
1908
1959
  path_parameters?: Webhook.PathParameters;
1909
1960
 
1961
+ /**
1962
+ * Body fields supplied by the assistant configuration rather than by the model.
1963
+ * They are never advertised in the tool definition, so the LLM can neither see nor
1964
+ * set them, and they take precedence over a `body_parameters` value of the same
1965
+ * name. Values support mustache templating, so they can hold dynamic variables
1966
+ * (`{{customer_id}}`) and integration secrets
1967
+ * (`{{#integration_secret}}my-secret{{/integration_secret}}`). Not sent on `GET`
1968
+ * requests, which carry no body.
1969
+ */
1970
+ preset_body_fields?: { [key: string]: unknown };
1971
+
1972
+ /**
1973
+ * Query string parameters supplied by the assistant configuration rather than by
1974
+ * the model. They are never advertised in the tool definition, so the LLM can
1975
+ * neither see nor set them, and they take precedence over a `query_parameters`
1976
+ * value of the same name. Values support mustache templating, so they can hold
1977
+ * dynamic variables (`{{telnyx_end_user_target}}`) and integration secrets
1978
+ * (`{{#integration_secret}}my-secret{{/integration_secret}}`). Unlike values
1979
+ * templated directly into the `url`, these are percent-encoded, so a value such as
1980
+ * `+15551234567` survives the round trip.
1981
+ */
1982
+ preset_query_params?: { [key: string]: unknown };
1983
+
1910
1984
  /**
1911
1985
  * The query parameters the webhook tool accepts, described as a JSON Schema
1912
1986
  * object. These parameters will be passed to the webhook as the query of the
@@ -2348,6 +2422,18 @@ export interface TelephonySettings {
2348
2422
  */
2349
2423
  recording_settings?: TelephonySettings.RecordingSettings;
2350
2424
 
2425
+ /**
2426
+ * Whether the assistant sends a `call.ai_gather.message_history_updated` webhook
2427
+ * with the full message history every time the conversation history changes. Leave
2428
+ * unset to inherit the `send_message_history_updates` value from the
2429
+ * `ai_assistant_start` or `gather_using_ai` command that started the conversation.
2430
+ * Setting it here is authoritative: `true` turns the webhooks on even when the
2431
+ * start command did not request them, and `false` turns them off even when it did.
2432
+ * Messages exchanged during a private warm transfer acceptance phase are never
2433
+ * included.
2434
+ */
2435
+ send_message_history_updates?: boolean;
2436
+
2351
2437
  /**
2352
2438
  * When enabled, allows users to interact with your AI assistant directly from your
2353
2439
  * website without requiring authentication. This is required for FE widgets that
@@ -2615,15 +2701,19 @@ export interface TranscriptionSettings {
2615
2701
  * supported models will automatically detect the language. For `deepgram/flux`,
2616
2702
  * supported values are: `auto` (Telnyx language detection controls the language
2617
2703
  * hint), `multi` (no language hint), and language-specific hints `en`, `es`, `fr`,
2618
- * `de`, `hi`, `ru`, `pt`, `ja`, `it`, and `nl`. For `soniox/stt-rt-v4`, `auto`
2619
- * omits the language hint and lets Soniox auto-detect; ISO 639-1 codes (e.g. `en`,
2620
- * `es`) bias detection toward that language. For `humain/realtime`, supported
2621
- * values are `ar`, `en`, `codeswitch` (Arabic/English code-switching), and `auto`
2622
- * (resolves server-side to code-switching). Unlike other models, `humain/realtime`
2623
- * does not fall back to `auto` when `language` is omitted — omitting it applies
2624
- * `en` instead. For `reson8/turns`, supported values are `auto` (or unset) for
2625
- * automatic language detection, and the language codes `nl`, `en`, `fr`, `fy`,
2626
- * `de`, `it`, `pl`, `pt`, `es`, and `sv` to fix the transcription language.
2704
+ * `de`, `hi`, `ru`, `pt`, `ja`, `it`, and `nl`. For `soniox/stt-rt-v4` and
2705
+ * `soniox/stt-rt-v5`, `auto` omits the language hint and lets Soniox auto-detect;
2706
+ * ISO 639-1 codes (e.g. `en`, `es`) bias detection toward that language;
2707
+ * `settings.language_hints` can pin multiple languages at once instead. For
2708
+ * `humain/realtime`, supported values are `ar`, `en`, `codeswitch` (Arabic/English
2709
+ * code-switching), and `auto` (resolves server-side to code-switching). Unlike
2710
+ * other models, `humain/realtime` does not fall back to `auto` when `language` is
2711
+ * omitted — omitting it applies `en` instead. For `reson8/turns`, supported values
2712
+ * are `auto` (or unset) for automatic language detection, and the language codes
2713
+ * `nl`, `en`, `fr`, `fy`, `de`, `it`, `pl`, `pt`, `es`, and `sv` to fix the
2714
+ * transcription language. For `cohere/ar-stt`, supported values are `ar` and `en`;
2715
+ * unlike other models, this model does not auto-detect and defaults to `ar` when
2716
+ * `language` is omitted.
2627
2717
  */
2628
2718
  language?: string;
2629
2719
 
@@ -2638,14 +2728,16 @@ export interface TranscriptionSettings {
2638
2728
  * - `assemblyai/universal-streaming` is a multilingual streaming model with
2639
2729
  * configurable turn detection.
2640
2730
  * - `xai/grok-stt` is a multilingual Grok STT model.
2641
- * - `soniox/stt-rt-v4` is a multilingual streaming model with automatic language
2642
- * detection and configurable endpointing.
2731
+ * - `soniox/stt-rt-v4` and `soniox/stt-rt-v5` are multilingual streaming models
2732
+ * with automatic language detection, configurable endpointing, term biasing
2733
+ * (`context`), and `language_hints`.
2643
2734
  * - `nvidia/parakeet-v3` is a multilingual transcription model with automatic
2644
2735
  * language detection.
2645
2736
  * - `humain/realtime` is a streaming model with native Arabic and Arabic/English
2646
2737
  * code-switching support.
2647
2738
  * - `reson8/turns` is a turn-based streaming model covering 10 European languages
2648
2739
  * with automatic language detection.
2740
+ * - `cohere/ar-stt` is a non-streaming Arabic and English transcription model.
2649
2741
  */
2650
2742
  model?:
2651
2743
  | 'deepgram/flux'
@@ -2655,9 +2747,11 @@ export interface TranscriptionSettings {
2655
2747
  | 'assemblyai/universal-streaming'
2656
2748
  | 'xai/grok-stt'
2657
2749
  | 'soniox/stt-rt-v4'
2750
+ | 'soniox/stt-rt-v5'
2658
2751
  | 'nvidia/parakeet-v3'
2659
2752
  | 'humain/realtime'
2660
2753
  | 'reson8/turns'
2754
+ | 'cohere/ar-stt'
2661
2755
  | 'distil-whisper/distil-large-v2'
2662
2756
  | 'openai/whisper-large-v3-turbo';
2663
2757
 
@@ -2671,6 +2765,17 @@ export interface TranscriptionSettings {
2671
2765
  }
2672
2766
 
2673
2767
  export interface TranscriptionSettingsConfig {
2768
+ /**
2769
+ * Available only for soniox/stt-rt-v4 and soniox/stt-rt-v5. A comma-separated list
2770
+ * of terms to boost for recognition during transcription, for staff names,
2771
+ * building names, or other domain-specific vocabulary. This field may be templated
2772
+ * with
2773
+ * [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
2774
+ * using mustache syntax (e.g. `Telnyx,{{customer_name}},VoIP`). Variables are
2775
+ * resolved at call time before the value is sent to Soniox.
2776
+ */
2777
+ context?: string;
2778
+
2674
2779
  /**
2675
2780
  * Available only for deepgram/flux. Confidence threshold for eager end of turn
2676
2781
  * detection. Must be lower than or equal to eot_threshold. Setting this equal to
@@ -2679,8 +2784,9 @@ export interface TranscriptionSettingsConfig {
2679
2784
  eager_eot_threshold?: number;
2680
2785
 
2681
2786
  /**
2682
- * Available only for soniox/stt-rt-v4. When true, Soniox emits end-of-utterance
2683
- * events at the cadence configured by `max_endpoint_delay_ms`.
2787
+ * Available only for soniox/stt-rt-v4 and soniox/stt-rt-v5. When true, Soniox
2788
+ * emits end-of-utterance events at the cadence configured by
2789
+ * `max_endpoint_delay_ms`.
2684
2790
  */
2685
2791
  enable_endpoint_detection?: boolean;
2686
2792
 
@@ -2704,8 +2810,8 @@ export interface TranscriptionSettingsConfig {
2704
2810
  eot_timeout_ms?: number;
2705
2811
 
2706
2812
  /**
2707
- * Available only for soniox/stt-rt-v4. When true, Soniox streams interim
2708
- * (non-final) results in addition to finalized transcripts.
2813
+ * Available only for soniox/stt-rt-v4 and soniox/stt-rt-v5. When true, Soniox
2814
+ * streams interim (non-final) results in addition to finalized transcripts.
2709
2815
  */
2710
2816
  interim_results?: boolean;
2711
2817
 
@@ -2721,8 +2827,15 @@ export interface TranscriptionSettingsConfig {
2721
2827
  keyterm?: string;
2722
2828
 
2723
2829
  /**
2724
- * Available only for soniox/stt-rt-v4. Maximum silence (in milliseconds) before
2725
- * Soniox emits an end-of-utterance event. Only honored when
2830
+ * Available only for soniox/stt-rt-v4 and soniox/stt-rt-v5. A list of ISO 639-1
2831
+ * language codes (e.g. `["nl", "fr"]`) to pin recognition to multiple languages at
2832
+ * once, overriding the single hint derived from `language`.
2833
+ */
2834
+ language_hints?: Array<string>;
2835
+
2836
+ /**
2837
+ * Available only for soniox/stt-rt-v4 and soniox/stt-rt-v5. Maximum silence (in
2838
+ * milliseconds) before Soniox emits an end-of-utterance event. Only honored when
2726
2839
  * `enable_endpoint_detection` is true.
2727
2840
  */
2728
2841
  max_endpoint_delay_ms?: number;
@@ -113,6 +113,15 @@ export interface ChatCompletionRequest {
113
113
  */
114
114
  presence_penalty?: number;
115
115
 
116
+ /**
117
+ * Controls the reasoning effort for models that support it. When set, the model
118
+ * spends more or less compute on internal reasoning before generating its
119
+ * response. Supported values: none, minimal, low, medium, high, xhigh, max. Not
120
+ * all models support all values; unsupported values are rejected with a 400 error.
121
+ * When omitted, reasoning models use their default effort level.
122
+ */
123
+ reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
124
+
116
125
  /**
117
126
  * Use this is you want to guarantee a JSON output without defining a schema. For
118
127
  * control over the schema, use `guided_json`.
@@ -109,62 +109,6 @@ export class Collections extends APIResource {
109
109
  return this._client.get(path`/ai/collections/slug/${slug}`, options);
110
110
  }
111
111
 
112
- /**
113
- * Runs search over the documents in a collection, ranked by relevance to `query`.
114
- * The collection's `retrieval_type` setting selects the strategy: `vector`
115
- * (semantic similarity), `hybrid` (vector similarity fused with keyword matching),
116
- * or `keyword` (lexical BM25 matching). When `query` is omitted, returns a plain
117
- * catalog listing of the collection's documents.
118
- *
119
- * **How it works:**
120
- *
121
- * 1. For `vector` and `hybrid`, the `query` text is embedded into a
122
- * 1024-dimensional vector using the multilingual-e5-large model.
123
- * 2. For `vector`, the embedding is compared against the collection's indexed
124
- * document chunks using semantic similarity; for `hybrid`, those similarity
125
- * scores are fused with keyword-match scores; for `keyword`, only lexical BM25
126
- * matching is applied.
127
- * 3. Results are ranked by `score` (descending) and paginated via `page[number]` /
128
- * `page[size]`.
129
- *
130
- * **Authentication:** Requires a Telnyx API key via `Authorization: Bearer <key>`.
131
- * Results are automatically scoped to your organization and cannot be overridden.
132
- *
133
- * **Filtering:** Use `filter[field][operator]=value` query parameters to narrow
134
- * results before search. Supported operators: `eq` (default), `in`, `gte`, `gt`,
135
- * `lte`, `lt`, `contains`. Metadata fields resolve to `metadata.<field>`.
136
- *
137
- * **Examples:**
138
- *
139
- * - `GET /v2/ai/collections/my-collection/documents?query=billing+issue&top_k=10`
140
- * - `GET /v2/ai/collections/my-collection/documents?query=refund&sources=voice,message`
141
- * - `GET /v2/ai/collections/my-collection/documents?query=outage&filter[record_created_at][gte]=2026-01-01T00:00:00Z`
142
- *
143
- * @example
144
- * ```ts
145
- * // Automatically fetches more pages as needed.
146
- * for await (const collectionRetrieveDocumentsResponse of client.ai.collections.retrieveDocuments(
147
- * 'support-transcripts',
148
- * )) {
149
- * // ...
150
- * }
151
- * ```
152
- */
153
- retrieveDocuments(
154
- slug: string,
155
- query: CollectionRetrieveDocumentsParams | null | undefined = {},
156
- options?: RequestOptions,
157
- ): PagePromise<
158
- CollectionRetrieveDocumentsResponsesDefaultFlatPagination,
159
- CollectionRetrieveDocumentsResponse
160
- > {
161
- return this._client.getAPIList(
162
- path`/ai/collections/${slug}/documents`,
163
- DefaultFlatPagination<CollectionRetrieveDocumentsResponse>,
164
- { query, ...options },
165
- );
166
- }
167
-
168
112
  /**
169
113
  * Soft-deletes a collection. Its `slug` is freed and may be reused by a new
170
114
  * collection.
@@ -206,9 +150,6 @@ export class Collections extends APIResource {
206
150
 
207
151
  export type CollectionsDefaultFlatPagination = DefaultFlatPagination<Collection>;
208
152
 
209
- export type CollectionRetrieveDocumentsResponsesDefaultFlatPagination =
210
- DefaultFlatPagination<CollectionRetrieveDocumentsResponse>;
211
-
212
153
  export interface Collection {
213
154
  created_at?: string;
214
155
 
@@ -238,42 +179,6 @@ export interface CollectionEnvelope {
238
179
  data?: Collection;
239
180
  }
240
181
 
241
- export interface CollectionRetrieveDocumentsResponse {
242
- id?: string;
243
-
244
- chunk_index?: number;
245
-
246
- chunk_total?: number;
247
-
248
- ingested_at?: string;
249
-
250
- metadata?: { [key: string]: unknown };
251
-
252
- organization_id?: string;
253
-
254
- record_created_at?: string;
255
-
256
- record_id?: string;
257
-
258
- /**
259
- * The source record kind this chunk came from (e.g. `voice`, `meeting_bot`,
260
- * `message`).
261
- */
262
- record_type?: string;
263
-
264
- region?: string;
265
-
266
- /**
267
- * Relevance score (higher = more relevant) for ranked search. `0.0` for plain
268
- * catalog listings (when `query` is omitted).
269
- */
270
- score?: number;
271
-
272
- text?: string;
273
-
274
- user_id?: string;
275
- }
276
-
277
182
  export interface CollectionListParams extends DefaultFlatPaginationParams {}
278
183
 
279
184
  export interface CollectionCreateParams {
@@ -303,42 +208,6 @@ export interface CollectionCreateParams {
303
208
  sources?: Array<SourcesAPI.SourceRequest>;
304
209
  }
305
210
 
306
- export interface CollectionRetrieveDocumentsParams extends DefaultFlatPaginationParams {
307
- /**
308
- * Field filters applied before ranking, using `filter[field][operator]=value`.
309
- * Supported operators: `eq` (default), `in`, `gte`, `gt`, `lte`, `lt`, `contains`.
310
- * Known fields: `record_type`, `record_id`, `user_id`, `record_created_at`,
311
- * `ingested_at`; any other name resolves to a `metadata.<field>` filter. Example:
312
- * `filter[record_id][eq]=rec_123`.
313
- */
314
- filter?: { [key: string]: unknown };
315
-
316
- /**
317
- * Natural-language search query. When provided, the text is matched against the
318
- * collection's document chunks using the collection's `retrieval_type` (vector or
319
- * hybrid). When omitted, documents are returned as a plain catalog listing.
320
- */
321
- query?: string;
322
-
323
- /**
324
- * Override the collection's configured retrieval strategy for this request. Echoed
325
- * back in `meta.retrieval_type`.
326
- */
327
- retrieval_type?: 'vector' | 'hybrid' | 'keyword';
328
-
329
- /**
330
- * Comma-separated list of source types to restrict the search to. When omitted,
331
- * all of the collection's sources are searched.
332
- */
333
- sources?: string;
334
-
335
- /**
336
- * Maximum number of ranked results to consider. When omitted, the collection's
337
- * configured `top_k` setting is used.
338
- */
339
- top_k?: number;
340
- }
341
-
342
211
  export interface CollectionUpdateParams {
343
212
  description?: string;
344
213
 
@@ -352,12 +221,9 @@ export declare namespace Collections {
352
221
  export {
353
222
  type Collection as Collection,
354
223
  type CollectionEnvelope as CollectionEnvelope,
355
- type CollectionRetrieveDocumentsResponse as CollectionRetrieveDocumentsResponse,
356
224
  type CollectionsDefaultFlatPagination as CollectionsDefaultFlatPagination,
357
- type CollectionRetrieveDocumentsResponsesDefaultFlatPagination as CollectionRetrieveDocumentsResponsesDefaultFlatPagination,
358
225
  type CollectionListParams as CollectionListParams,
359
226
  type CollectionCreateParams as CollectionCreateParams,
360
- type CollectionRetrieveDocumentsParams as CollectionRetrieveDocumentsParams,
361
227
  type CollectionUpdateParams as CollectionUpdateParams,
362
228
  };
363
229
 
@@ -4,13 +4,10 @@ export {
4
4
  Collections,
5
5
  type Collection,
6
6
  type CollectionEnvelope,
7
- type CollectionRetrieveDocumentsResponse,
8
7
  type CollectionListParams,
9
8
  type CollectionCreateParams,
10
- type CollectionRetrieveDocumentsParams,
11
9
  type CollectionUpdateParams,
12
10
  type CollectionsDefaultFlatPagination,
13
- type CollectionRetrieveDocumentsResponsesDefaultFlatPagination,
14
11
  } from './collections';
15
12
  export {
16
13
  Settings,
@@ -66,8 +66,11 @@ export interface RetrievalSettings {
66
66
  /**
67
67
  * Retrieval strategy. `vector` runs semantic similarity search; `hybrid` combines
68
68
  * vector similarity with keyword matching; `keyword` runs lexical (BM25) matching.
69
+ * `keyword` is not accepted yet: setting it returns 422
70
+ * `unsupported_retrieval_type`. A collection set to `hybrid` is accepted here but
71
+ * cannot be searched until hybrid execution ships.
69
72
  */
70
- retrieval_type?: 'vector' | 'hybrid' | 'keyword';
73
+ retrieval_type?: 'vector' | 'hybrid';
71
74
 
72
75
  /**
73
76
  * Number of top results to retrieve (1–50).
@@ -94,13 +94,10 @@ export {
94
94
  Collections,
95
95
  type Collection,
96
96
  type CollectionEnvelope,
97
- type CollectionRetrieveDocumentsResponse,
98
97
  type CollectionListParams,
99
98
  type CollectionCreateParams,
100
- type CollectionRetrieveDocumentsParams,
101
99
  type CollectionUpdateParams,
102
100
  type CollectionsDefaultFlatPagination,
103
- type CollectionRetrieveDocumentsResponsesDefaultFlatPagination,
104
101
  } from './collections/index';
105
102
  export {
106
103
  Conversations,
@@ -128,6 +125,7 @@ export {
128
125
  } from './embeddings/index';
129
126
  export { FineTuning } from './fine-tuning/index';
130
127
  export { Integrations, type Integration, type IntegrationListResponse } from './integrations/index';
128
+ export { Knowledge } from './knowledge/index';
131
129
  export {
132
130
  McpServers,
133
131
  type McpServer,
@@ -0,0 +1,179 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import { APIPromise } from '../../../core/api-promise';
5
+ import { RequestOptions } from '../../../internal/request-options';
6
+ import { path } from '../../../internal/utils/path';
7
+
8
+ /**
9
+ * Create and manage logical collections of your Telnyx data, tune retrieval settings, manage sources, and run collection-scoped semantic search.
10
+ */
11
+ export class Collections extends APIResource {
12
+ /**
13
+ * Runs search over the documents in a collection, ranked by relevance to `query`.
14
+ * Searches currently run `vector` retrieval (semantic similarity). The
15
+ * collection's `retrieval_type` setting is the forward-compatible selector:
16
+ * `hybrid` (vector similarity fused with keyword matching) can be set but cannot
17
+ * be searched yet, and `keyword` (lexical BM25 matching) is not accepted yet --
18
+ * setting it returns 422 `unsupported_retrieval_type`. A per-request
19
+ * `retrieval_type` is accepted but ignored; `meta.retrieval_type` echoes the mode
20
+ * that actually ran. When `query` is omitted, returns a plain catalog listing of
21
+ * the collection's documents.
22
+ *
23
+ * **How it works:**
24
+ *
25
+ * 1. The `query` text is embedded into a 1024-dimensional vector using the
26
+ * multilingual-e5-large model.
27
+ * 2. The embedding is compared against the collection's indexed document chunks
28
+ * using semantic similarity. When `hybrid` and `keyword` execution ship, those
29
+ * scores will be fused with, or replaced by, lexical BM25 matching.
30
+ * 3. Results are ranked by `score` (descending) and paginated via `page[number]` /
31
+ * `page[size]`.
32
+ *
33
+ * **Authentication:** Requires a Telnyx API key via `Authorization: Bearer <key>`.
34
+ * Results are automatically scoped to your organization and cannot be overridden.
35
+ *
36
+ * **Filtering:** Use `filter[field][operator]=value` query parameters to narrow
37
+ * results before search. Supported operators: `eq` (default), `in`, `gte`, `gt`,
38
+ * `lte`, `lt`, `contains`. Metadata fields resolve to `metadata.<field>`.
39
+ *
40
+ * **Examples:**
41
+ *
42
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=billing+issue&top_k=10`
43
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=refund&sources=voice,message`
44
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=outage&filter[record_created_at][gte]=2026-01-01T00:00:00Z`
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const response =
49
+ * await client.ai.knowledge.collections.retrieveDocuments(
50
+ * 'support-transcripts',
51
+ * );
52
+ * ```
53
+ */
54
+ retrieveDocuments(
55
+ slug: string,
56
+ query: CollectionRetrieveDocumentsParams | null | undefined = {},
57
+ options?: RequestOptions,
58
+ ): APIPromise<CollectionRetrieveDocumentsResponse> {
59
+ return this._client.get(path`/ai/knowledge/collections/${slug}/documents`, { query, ...options });
60
+ }
61
+ }
62
+
63
+ export interface CollectionRetrieveDocumentsResponse {
64
+ data?: Array<CollectionRetrieveDocumentsResponse.Data>;
65
+
66
+ meta?: CollectionRetrieveDocumentsResponse.Meta;
67
+ }
68
+
69
+ export namespace CollectionRetrieveDocumentsResponse {
70
+ export interface Data {
71
+ id?: string;
72
+
73
+ chunk_index?: number;
74
+
75
+ chunk_total?: number;
76
+
77
+ ingested_at?: string;
78
+
79
+ metadata?: { [key: string]: unknown };
80
+
81
+ organization_id?: string;
82
+
83
+ record_created_at?: string;
84
+
85
+ record_id?: string;
86
+
87
+ /**
88
+ * The source record kind this chunk came from (e.g. `voice`, `meeting_bot`,
89
+ * `message`).
90
+ */
91
+ record_type?: string;
92
+
93
+ region?: string;
94
+
95
+ /**
96
+ * Relevance score (higher = more relevant) for ranked search. `0.0` for plain
97
+ * catalog listings (when `query` is omitted).
98
+ */
99
+ score?: number;
100
+
101
+ text?: string;
102
+
103
+ user_id?: string;
104
+ }
105
+
106
+ export interface Meta {
107
+ collection_slug?: string;
108
+
109
+ page_number?: number;
110
+
111
+ page_size?: number;
112
+
113
+ retrieval_type?: string;
114
+
115
+ searched_sources?: Array<string>;
116
+
117
+ top_k?: number;
118
+
119
+ total_pages?: number;
120
+
121
+ total_results?: number;
122
+ }
123
+ }
124
+
125
+ export interface CollectionRetrieveDocumentsParams {
126
+ /**
127
+ * Field filters applied before ranking, using `filter[field][operator]=value`.
128
+ * Supported operators: `eq` (default), `in`, `gte`, `gt`, `lte`, `lt`, `contains`.
129
+ * Known fields: `record_type`, `record_id`, `user_id`, `record_created_at`,
130
+ * `ingested_at`; any other name resolves to a `metadata.<field>` filter. Example:
131
+ * `filter[record_id][eq]=rec_123`.
132
+ */
133
+ filter?: { [key: string]: unknown };
134
+
135
+ /**
136
+ * Page number to return (1-based). Defaults to 1.
137
+ */
138
+ 'page[number]'?: number;
139
+
140
+ /**
141
+ * Number of results per page. Defaults to 20.
142
+ */
143
+ 'page[size]'?: number;
144
+
145
+ /**
146
+ * Natural-language search query. When provided, the text is matched against the
147
+ * collection's document chunks using the collection's `retrieval_type` (vector or
148
+ * hybrid). When omitted, documents are returned as a plain catalog listing.
149
+ */
150
+ query?: string;
151
+
152
+ /**
153
+ * Reserved; not yet functional. A value supplied here is accepted but ignored — it
154
+ * does not override the collection's configured strategy, and it is not echoed
155
+ * back. Searches run `vector` retrieval, and `meta.retrieval_type` reports the
156
+ * mode that actually ran. To change retrieval strategy, set it on the collection's
157
+ * settings subresource.
158
+ */
159
+ retrieval_type?: 'vector' | 'hybrid' | 'keyword';
160
+
161
+ /**
162
+ * Comma-separated list of source types to restrict the search to. When omitted,
163
+ * all of the collection's sources are searched.
164
+ */
165
+ sources?: string;
166
+
167
+ /**
168
+ * Maximum number of ranked results to consider. When omitted, the collection's
169
+ * configured `top_k` setting is used.
170
+ */
171
+ top_k?: number;
172
+ }
173
+
174
+ export declare namespace Collections {
175
+ export {
176
+ type CollectionRetrieveDocumentsResponse as CollectionRetrieveDocumentsResponse,
177
+ type CollectionRetrieveDocumentsParams as CollectionRetrieveDocumentsParams,
178
+ };
179
+ }
@@ -0,0 +1,8 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ Collections,
5
+ type CollectionRetrieveDocumentsResponse,
6
+ type CollectionRetrieveDocumentsParams,
7
+ } from './collections';
8
+ export { Knowledge } from './knowledge';