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
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Tools = exports.OpenAI = exports.Missions = exports.McpServers = exports.Integrations = exports.FineTuning = exports.Embeddings = exports.Conversations = exports.Collections = exports.Clusters = exports.Chat = exports.Audio = exports.Assistants = exports.Anthropic = exports.AI = void 0;
4
+ exports.Tools = exports.OpenAI = exports.Missions = exports.McpServers = exports.Knowledge = exports.Integrations = exports.FineTuning = exports.Embeddings = exports.Conversations = exports.Collections = exports.Clusters = exports.Chat = exports.Audio = exports.Assistants = exports.Anthropic = exports.AI = void 0;
5
5
  var ai_1 = require("./ai.js");
6
6
  Object.defineProperty(exports, "AI", { enumerable: true, get: function () { return ai_1.AI; } });
7
7
  var index_1 = require("./anthropic/index.js");
@@ -24,12 +24,14 @@ var index_6 = require("./fine-tuning/index.js");
24
24
  Object.defineProperty(exports, "FineTuning", { enumerable: true, get: function () { return index_6.FineTuning; } });
25
25
  var index_7 = require("./integrations/index.js");
26
26
  Object.defineProperty(exports, "Integrations", { enumerable: true, get: function () { return index_7.Integrations; } });
27
+ var index_8 = require("./knowledge/index.js");
28
+ Object.defineProperty(exports, "Knowledge", { enumerable: true, get: function () { return index_8.Knowledge; } });
27
29
  var mcp_servers_1 = require("./mcp-servers.js");
28
30
  Object.defineProperty(exports, "McpServers", { enumerable: true, get: function () { return mcp_servers_1.McpServers; } });
29
- var index_8 = require("./missions/index.js");
30
- Object.defineProperty(exports, "Missions", { enumerable: true, get: function () { return index_8.Missions; } });
31
- var index_9 = require("./openai/index.js");
32
- Object.defineProperty(exports, "OpenAI", { enumerable: true, get: function () { return index_9.OpenAI; } });
31
+ var index_9 = require("./missions/index.js");
32
+ Object.defineProperty(exports, "Missions", { enumerable: true, get: function () { return index_9.Missions; } });
33
+ var index_10 = require("./openai/index.js");
34
+ Object.defineProperty(exports, "OpenAI", { enumerable: true, get: function () { return index_10.OpenAI; } });
33
35
  var tools_1 = require("./tools.js");
34
36
  Object.defineProperty(exports, "Tools", { enumerable: true, get: function () { return tools_1.Tools; } });
35
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/ai/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8BASc;AARZ,wFAAA,EAAE,OAAA;AASJ,8CAA8C;AAArC,kGAAA,SAAS,OAAA;AAClB,+CAgE4B;AA/D1B,mGAAA,UAAU,OAAA;AAgEZ,oCAA0F;AAAjF,8FAAA,KAAK,OAAA;AACd,kCAA0E;AAAjE,4FAAA,IAAI,OAAA;AACb,0CAWoB;AAVlB,oGAAA,QAAQ,OAAA;AAWV,gDAW6B;AAV3B,oGAAA,WAAW,OAAA;AAWb,kDAW+B;AAV7B,sGAAA,aAAa,OAAA;AAWf,+CAW4B;AAV1B,mGAAA,UAAU,OAAA;AAWZ,gDAAiD;AAAxC,mGAAA,UAAU,OAAA;AACnB,iDAAoG;AAA3F,qGAAA,YAAY,OAAA;AACrB,gDAOuB;AANrB,yGAAA,UAAU,OAAA;AAOZ,6CAY0B;AAXxB,iGAAA,QAAQ,OAAA;AAYV,2CAA4G;AAAnG,+FAAA,MAAM,OAAA;AACf,oCAUiB;AATf,8FAAA,KAAK,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/ai/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8BASc;AARZ,wFAAA,EAAE,OAAA;AASJ,8CAA8C;AAArC,kGAAA,SAAS,OAAA;AAClB,+CAgE4B;AA/D1B,mGAAA,UAAU,OAAA;AAgEZ,oCAA0F;AAAjF,8FAAA,KAAK,OAAA;AACd,kCAA0E;AAAjE,4FAAA,IAAI,OAAA;AACb,0CAWoB;AAVlB,oGAAA,QAAQ,OAAA;AAWV,gDAQ6B;AAP3B,oGAAA,WAAW,OAAA;AAQb,kDAW+B;AAV7B,sGAAA,aAAa,OAAA;AAWf,+CAW4B;AAV1B,mGAAA,UAAU,OAAA;AAWZ,gDAAiD;AAAxC,mGAAA,UAAU,OAAA;AACnB,iDAAoG;AAA3F,qGAAA,YAAY,OAAA;AACrB,8CAA8C;AAArC,kGAAA,SAAS,OAAA;AAClB,gDAOuB;AANrB,yGAAA,UAAU,OAAA;AAOZ,6CAY0B;AAXxB,iGAAA,QAAQ,OAAA;AAYV,4CAA4G;AAAnG,gGAAA,MAAM,OAAA;AACf,oCAUiB;AATf,8FAAA,KAAK,OAAA"}
@@ -10,6 +10,7 @@ export { Conversations, } from "./conversations/index.mjs";
10
10
  export { Embeddings, } from "./embeddings/index.mjs";
11
11
  export { FineTuning } from "./fine-tuning/index.mjs";
12
12
  export { Integrations } from "./integrations/index.mjs";
13
+ export { Knowledge } from "./knowledge/index.mjs";
13
14
  export { McpServers, } from "./mcp-servers.mjs";
14
15
  export { Missions, } from "./missions/index.mjs";
15
16
  export { OpenAI } from "./openai/index.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/ai/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,EAAE,GAQH,iBAAa;AACd,OAAO,EAAE,SAAS,EAAE,8BAA0B;AAC9C,OAAO,EACL,UAAU,GA+DX,+BAA2B;AAC5B,OAAO,EAAE,KAAK,EAA4D,oBAAgB;AAC1F,OAAO,EAAE,IAAI,EAA8C,mBAAe;AAC1E,OAAO,EACL,QAAQ,GAUT,uBAAmB;AACpB,OAAO,EACL,WAAW,GAUZ,gCAA4B;AAC7B,OAAO,EACL,aAAa,GAUd,kCAA8B;AAC/B,OAAO,EACL,UAAU,GAUX,+BAA2B;AAC5B,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,YAAY,EAAkD,iCAA6B;AACpG,OAAO,EACL,UAAU,GAMX,0BAAsB;AACvB,OAAO,EACL,QAAQ,GAWT,6BAAyB;AAC1B,OAAO,EAAE,MAAM,EAAsE,2BAAuB;AAC5G,OAAO,EACL,KAAK,GASN,oBAAgB"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/ai/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,EAAE,GAQH,iBAAa;AACd,OAAO,EAAE,SAAS,EAAE,8BAA0B;AAC9C,OAAO,EACL,UAAU,GA+DX,+BAA2B;AAC5B,OAAO,EAAE,KAAK,EAA4D,oBAAgB;AAC1F,OAAO,EAAE,IAAI,EAA8C,mBAAe;AAC1E,OAAO,EACL,QAAQ,GAUT,uBAAmB;AACpB,OAAO,EACL,WAAW,GAOZ,gCAA4B;AAC7B,OAAO,EACL,aAAa,GAUd,kCAA8B;AAC/B,OAAO,EACL,UAAU,GAUX,+BAA2B;AAC5B,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,YAAY,EAAkD,iCAA6B;AACpG,OAAO,EAAE,SAAS,EAAE,8BAA0B;AAC9C,OAAO,EACL,UAAU,GAMX,0BAAsB;AACvB,OAAO,EACL,QAAQ,GAWT,6BAAyB;AAC1B,OAAO,EAAE,MAAM,EAAsE,2BAAuB;AAC5G,OAAO,EACL,KAAK,GASN,oBAAgB"}
@@ -0,0 +1,140 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import { APIPromise } from "../../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../../internal/request-options.mjs";
4
+ /**
5
+ * Create and manage logical collections of your Telnyx data, tune retrieval settings, manage sources, and run collection-scoped semantic search.
6
+ */
7
+ export declare class Collections extends APIResource {
8
+ /**
9
+ * Runs search over the documents in a collection, ranked by relevance to `query`.
10
+ * Searches currently run `vector` retrieval (semantic similarity). The
11
+ * collection's `retrieval_type` setting is the forward-compatible selector:
12
+ * `hybrid` (vector similarity fused with keyword matching) can be set but cannot
13
+ * be searched yet, and `keyword` (lexical BM25 matching) is not accepted yet --
14
+ * setting it returns 422 `unsupported_retrieval_type`. A per-request
15
+ * `retrieval_type` is accepted but ignored; `meta.retrieval_type` echoes the mode
16
+ * that actually ran. When `query` is omitted, returns a plain catalog listing of
17
+ * the collection's documents.
18
+ *
19
+ * **How it works:**
20
+ *
21
+ * 1. The `query` text is embedded into a 1024-dimensional vector using the
22
+ * multilingual-e5-large model.
23
+ * 2. The embedding is compared against the collection's indexed document chunks
24
+ * using semantic similarity. When `hybrid` and `keyword` execution ship, those
25
+ * scores will be fused with, or replaced by, lexical BM25 matching.
26
+ * 3. Results are ranked by `score` (descending) and paginated via `page[number]` /
27
+ * `page[size]`.
28
+ *
29
+ * **Authentication:** Requires a Telnyx API key via `Authorization: Bearer <key>`.
30
+ * Results are automatically scoped to your organization and cannot be overridden.
31
+ *
32
+ * **Filtering:** Use `filter[field][operator]=value` query parameters to narrow
33
+ * results before search. Supported operators: `eq` (default), `in`, `gte`, `gt`,
34
+ * `lte`, `lt`, `contains`. Metadata fields resolve to `metadata.<field>`.
35
+ *
36
+ * **Examples:**
37
+ *
38
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=billing+issue&top_k=10`
39
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=refund&sources=voice,message`
40
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=outage&filter[record_created_at][gte]=2026-01-01T00:00:00Z`
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const response =
45
+ * await client.ai.knowledge.collections.retrieveDocuments(
46
+ * 'support-transcripts',
47
+ * );
48
+ * ```
49
+ */
50
+ retrieveDocuments(slug: string, query?: CollectionRetrieveDocumentsParams | null | undefined, options?: RequestOptions): APIPromise<CollectionRetrieveDocumentsResponse>;
51
+ }
52
+ export interface CollectionRetrieveDocumentsResponse {
53
+ data?: Array<CollectionRetrieveDocumentsResponse.Data>;
54
+ meta?: CollectionRetrieveDocumentsResponse.Meta;
55
+ }
56
+ export declare namespace CollectionRetrieveDocumentsResponse {
57
+ interface Data {
58
+ id?: string;
59
+ chunk_index?: number;
60
+ chunk_total?: number;
61
+ ingested_at?: string;
62
+ metadata?: {
63
+ [key: string]: unknown;
64
+ };
65
+ organization_id?: string;
66
+ record_created_at?: string;
67
+ record_id?: string;
68
+ /**
69
+ * The source record kind this chunk came from (e.g. `voice`, `meeting_bot`,
70
+ * `message`).
71
+ */
72
+ record_type?: string;
73
+ region?: string;
74
+ /**
75
+ * Relevance score (higher = more relevant) for ranked search. `0.0` for plain
76
+ * catalog listings (when `query` is omitted).
77
+ */
78
+ score?: number;
79
+ text?: string;
80
+ user_id?: string;
81
+ }
82
+ interface Meta {
83
+ collection_slug?: string;
84
+ page_number?: number;
85
+ page_size?: number;
86
+ retrieval_type?: string;
87
+ searched_sources?: Array<string>;
88
+ top_k?: number;
89
+ total_pages?: number;
90
+ total_results?: number;
91
+ }
92
+ }
93
+ export interface CollectionRetrieveDocumentsParams {
94
+ /**
95
+ * Field filters applied before ranking, using `filter[field][operator]=value`.
96
+ * Supported operators: `eq` (default), `in`, `gte`, `gt`, `lte`, `lt`, `contains`.
97
+ * Known fields: `record_type`, `record_id`, `user_id`, `record_created_at`,
98
+ * `ingested_at`; any other name resolves to a `metadata.<field>` filter. Example:
99
+ * `filter[record_id][eq]=rec_123`.
100
+ */
101
+ filter?: {
102
+ [key: string]: unknown;
103
+ };
104
+ /**
105
+ * Page number to return (1-based). Defaults to 1.
106
+ */
107
+ 'page[number]'?: number;
108
+ /**
109
+ * Number of results per page. Defaults to 20.
110
+ */
111
+ 'page[size]'?: number;
112
+ /**
113
+ * Natural-language search query. When provided, the text is matched against the
114
+ * collection's document chunks using the collection's `retrieval_type` (vector or
115
+ * hybrid). When omitted, documents are returned as a plain catalog listing.
116
+ */
117
+ query?: string;
118
+ /**
119
+ * Reserved; not yet functional. A value supplied here is accepted but ignored — it
120
+ * does not override the collection's configured strategy, and it is not echoed
121
+ * back. Searches run `vector` retrieval, and `meta.retrieval_type` reports the
122
+ * mode that actually ran. To change retrieval strategy, set it on the collection's
123
+ * settings subresource.
124
+ */
125
+ retrieval_type?: 'vector' | 'hybrid' | 'keyword';
126
+ /**
127
+ * Comma-separated list of source types to restrict the search to. When omitted,
128
+ * all of the collection's sources are searched.
129
+ */
130
+ sources?: string;
131
+ /**
132
+ * Maximum number of ranked results to consider. When omitted, the collection's
133
+ * configured `top_k` setting is used.
134
+ */
135
+ top_k?: number;
136
+ }
137
+ export declare namespace Collections {
138
+ export { type CollectionRetrieveDocumentsResponse as CollectionRetrieveDocumentsResponse, type CollectionRetrieveDocumentsParams as CollectionRetrieveDocumentsParams, };
139
+ }
140
+ //# sourceMappingURL=collections.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.d.mts","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/collections.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAGnE;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,iBAAiB,CACf,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,iCAAiC,GAAG,IAAI,GAAG,SAAc,EAChE,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mCAAmC,CAAC;CAGnD;AAED,MAAM,WAAW,mCAAmC;IAClD,IAAI,CAAC,EAAE,KAAK,CAAC,mCAAmC,CAAC,IAAI,CAAC,CAAC;IAEvD,IAAI,CAAC,EAAE,mCAAmC,CAAC,IAAI,CAAC;CACjD;AAED,yBAAiB,mCAAmC,CAAC;IACnD,UAAiB,IAAI;QACnB,EAAE,CAAC,EAAE,MAAM,CAAC;QAEZ,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,QAAQ,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;QAEtC,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAE3B,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;;WAGG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAED,UAAiB,IAAI;QACnB,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEjC,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;CACF;AAED,MAAM,WAAW,iCAAiC;IAChD;;;;;;OAMG;IACH,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEpC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IAEjD;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
@@ -0,0 +1,140 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import { APIPromise } from "../../../core/api-promise.js";
3
+ import { RequestOptions } from "../../../internal/request-options.js";
4
+ /**
5
+ * Create and manage logical collections of your Telnyx data, tune retrieval settings, manage sources, and run collection-scoped semantic search.
6
+ */
7
+ export declare class Collections extends APIResource {
8
+ /**
9
+ * Runs search over the documents in a collection, ranked by relevance to `query`.
10
+ * Searches currently run `vector` retrieval (semantic similarity). The
11
+ * collection's `retrieval_type` setting is the forward-compatible selector:
12
+ * `hybrid` (vector similarity fused with keyword matching) can be set but cannot
13
+ * be searched yet, and `keyword` (lexical BM25 matching) is not accepted yet --
14
+ * setting it returns 422 `unsupported_retrieval_type`. A per-request
15
+ * `retrieval_type` is accepted but ignored; `meta.retrieval_type` echoes the mode
16
+ * that actually ran. When `query` is omitted, returns a plain catalog listing of
17
+ * the collection's documents.
18
+ *
19
+ * **How it works:**
20
+ *
21
+ * 1. The `query` text is embedded into a 1024-dimensional vector using the
22
+ * multilingual-e5-large model.
23
+ * 2. The embedding is compared against the collection's indexed document chunks
24
+ * using semantic similarity. When `hybrid` and `keyword` execution ship, those
25
+ * scores will be fused with, or replaced by, lexical BM25 matching.
26
+ * 3. Results are ranked by `score` (descending) and paginated via `page[number]` /
27
+ * `page[size]`.
28
+ *
29
+ * **Authentication:** Requires a Telnyx API key via `Authorization: Bearer <key>`.
30
+ * Results are automatically scoped to your organization and cannot be overridden.
31
+ *
32
+ * **Filtering:** Use `filter[field][operator]=value` query parameters to narrow
33
+ * results before search. Supported operators: `eq` (default), `in`, `gte`, `gt`,
34
+ * `lte`, `lt`, `contains`. Metadata fields resolve to `metadata.<field>`.
35
+ *
36
+ * **Examples:**
37
+ *
38
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=billing+issue&top_k=10`
39
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=refund&sources=voice,message`
40
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=outage&filter[record_created_at][gte]=2026-01-01T00:00:00Z`
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const response =
45
+ * await client.ai.knowledge.collections.retrieveDocuments(
46
+ * 'support-transcripts',
47
+ * );
48
+ * ```
49
+ */
50
+ retrieveDocuments(slug: string, query?: CollectionRetrieveDocumentsParams | null | undefined, options?: RequestOptions): APIPromise<CollectionRetrieveDocumentsResponse>;
51
+ }
52
+ export interface CollectionRetrieveDocumentsResponse {
53
+ data?: Array<CollectionRetrieveDocumentsResponse.Data>;
54
+ meta?: CollectionRetrieveDocumentsResponse.Meta;
55
+ }
56
+ export declare namespace CollectionRetrieveDocumentsResponse {
57
+ interface Data {
58
+ id?: string;
59
+ chunk_index?: number;
60
+ chunk_total?: number;
61
+ ingested_at?: string;
62
+ metadata?: {
63
+ [key: string]: unknown;
64
+ };
65
+ organization_id?: string;
66
+ record_created_at?: string;
67
+ record_id?: string;
68
+ /**
69
+ * The source record kind this chunk came from (e.g. `voice`, `meeting_bot`,
70
+ * `message`).
71
+ */
72
+ record_type?: string;
73
+ region?: string;
74
+ /**
75
+ * Relevance score (higher = more relevant) for ranked search. `0.0` for plain
76
+ * catalog listings (when `query` is omitted).
77
+ */
78
+ score?: number;
79
+ text?: string;
80
+ user_id?: string;
81
+ }
82
+ interface Meta {
83
+ collection_slug?: string;
84
+ page_number?: number;
85
+ page_size?: number;
86
+ retrieval_type?: string;
87
+ searched_sources?: Array<string>;
88
+ top_k?: number;
89
+ total_pages?: number;
90
+ total_results?: number;
91
+ }
92
+ }
93
+ export interface CollectionRetrieveDocumentsParams {
94
+ /**
95
+ * Field filters applied before ranking, using `filter[field][operator]=value`.
96
+ * Supported operators: `eq` (default), `in`, `gte`, `gt`, `lte`, `lt`, `contains`.
97
+ * Known fields: `record_type`, `record_id`, `user_id`, `record_created_at`,
98
+ * `ingested_at`; any other name resolves to a `metadata.<field>` filter. Example:
99
+ * `filter[record_id][eq]=rec_123`.
100
+ */
101
+ filter?: {
102
+ [key: string]: unknown;
103
+ };
104
+ /**
105
+ * Page number to return (1-based). Defaults to 1.
106
+ */
107
+ 'page[number]'?: number;
108
+ /**
109
+ * Number of results per page. Defaults to 20.
110
+ */
111
+ 'page[size]'?: number;
112
+ /**
113
+ * Natural-language search query. When provided, the text is matched against the
114
+ * collection's document chunks using the collection's `retrieval_type` (vector or
115
+ * hybrid). When omitted, documents are returned as a plain catalog listing.
116
+ */
117
+ query?: string;
118
+ /**
119
+ * Reserved; not yet functional. A value supplied here is accepted but ignored — it
120
+ * does not override the collection's configured strategy, and it is not echoed
121
+ * back. Searches run `vector` retrieval, and `meta.retrieval_type` reports the
122
+ * mode that actually ran. To change retrieval strategy, set it on the collection's
123
+ * settings subresource.
124
+ */
125
+ retrieval_type?: 'vector' | 'hybrid' | 'keyword';
126
+ /**
127
+ * Comma-separated list of source types to restrict the search to. When omitted,
128
+ * all of the collection's sources are searched.
129
+ */
130
+ sources?: string;
131
+ /**
132
+ * Maximum number of ranked results to consider. When omitted, the collection's
133
+ * configured `top_k` setting is used.
134
+ */
135
+ top_k?: number;
136
+ }
137
+ export declare namespace Collections {
138
+ export { type CollectionRetrieveDocumentsResponse as CollectionRetrieveDocumentsResponse, type CollectionRetrieveDocumentsParams as CollectionRetrieveDocumentsParams, };
139
+ }
140
+ //# sourceMappingURL=collections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/collections.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,iBAAiB,CACf,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,iCAAiC,GAAG,IAAI,GAAG,SAAc,EAChE,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mCAAmC,CAAC;CAGnD;AAED,MAAM,WAAW,mCAAmC;IAClD,IAAI,CAAC,EAAE,KAAK,CAAC,mCAAmC,CAAC,IAAI,CAAC,CAAC;IAEvD,IAAI,CAAC,EAAE,mCAAmC,CAAC,IAAI,CAAC;CACjD;AAED,yBAAiB,mCAAmC,CAAC;IACnD,UAAiB,IAAI;QACnB,EAAE,CAAC,EAAE,MAAM,CAAC;QAEZ,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,QAAQ,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;QAEtC,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAE3B,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;;WAGG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAED,UAAiB,IAAI;QACnB,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEjC,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;CACF;AAED,MAAM,WAAW,iCAAiC;IAChD;;;;;;OAMG;IACH,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEpC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IAEjD;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Collections = void 0;
5
+ const resource_1 = require("../../../core/resource.js");
6
+ const path_1 = require("../../../internal/utils/path.js");
7
+ /**
8
+ * Create and manage logical collections of your Telnyx data, tune retrieval settings, manage sources, and run collection-scoped semantic search.
9
+ */
10
+ class Collections extends resource_1.APIResource {
11
+ /**
12
+ * Runs search over the documents in a collection, ranked by relevance to `query`.
13
+ * Searches currently run `vector` retrieval (semantic similarity). The
14
+ * collection's `retrieval_type` setting is the forward-compatible selector:
15
+ * `hybrid` (vector similarity fused with keyword matching) can be set but cannot
16
+ * be searched yet, and `keyword` (lexical BM25 matching) is not accepted yet --
17
+ * setting it returns 422 `unsupported_retrieval_type`. A per-request
18
+ * `retrieval_type` is accepted but ignored; `meta.retrieval_type` echoes the mode
19
+ * that actually ran. When `query` is omitted, returns a plain catalog listing of
20
+ * the collection's documents.
21
+ *
22
+ * **How it works:**
23
+ *
24
+ * 1. The `query` text is embedded into a 1024-dimensional vector using the
25
+ * multilingual-e5-large model.
26
+ * 2. The embedding is compared against the collection's indexed document chunks
27
+ * using semantic similarity. When `hybrid` and `keyword` execution ship, those
28
+ * scores will be fused with, or replaced by, lexical BM25 matching.
29
+ * 3. Results are ranked by `score` (descending) and paginated via `page[number]` /
30
+ * `page[size]`.
31
+ *
32
+ * **Authentication:** Requires a Telnyx API key via `Authorization: Bearer <key>`.
33
+ * Results are automatically scoped to your organization and cannot be overridden.
34
+ *
35
+ * **Filtering:** Use `filter[field][operator]=value` query parameters to narrow
36
+ * results before search. Supported operators: `eq` (default), `in`, `gte`, `gt`,
37
+ * `lte`, `lt`, `contains`. Metadata fields resolve to `metadata.<field>`.
38
+ *
39
+ * **Examples:**
40
+ *
41
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=billing+issue&top_k=10`
42
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=refund&sources=voice,message`
43
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=outage&filter[record_created_at][gte]=2026-01-01T00:00:00Z`
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const response =
48
+ * await client.ai.knowledge.collections.retrieveDocuments(
49
+ * 'support-transcripts',
50
+ * );
51
+ * ```
52
+ */
53
+ retrieveDocuments(slug, query = {}, options) {
54
+ return this._client.get((0, path_1.path) `/ai/knowledge/collections/${slug}/documents`, { query, ...options });
55
+ }
56
+ }
57
+ exports.Collections = Collections;
58
+ //# sourceMappingURL=collections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.js","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/collections.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAoD;AAEpD;;GAEG;AACH,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,iBAAiB,CACf,IAAY,EACZ,QAA8D,EAAE,EAChE,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,6BAA6B,IAAI,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;CACF;AAlDD,kCAkDC"}
@@ -0,0 +1,54 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../core/resource.mjs";
3
+ import { path } from "../../../internal/utils/path.mjs";
4
+ /**
5
+ * Create and manage logical collections of your Telnyx data, tune retrieval settings, manage sources, and run collection-scoped semantic search.
6
+ */
7
+ export class Collections extends APIResource {
8
+ /**
9
+ * Runs search over the documents in a collection, ranked by relevance to `query`.
10
+ * Searches currently run `vector` retrieval (semantic similarity). The
11
+ * collection's `retrieval_type` setting is the forward-compatible selector:
12
+ * `hybrid` (vector similarity fused with keyword matching) can be set but cannot
13
+ * be searched yet, and `keyword` (lexical BM25 matching) is not accepted yet --
14
+ * setting it returns 422 `unsupported_retrieval_type`. A per-request
15
+ * `retrieval_type` is accepted but ignored; `meta.retrieval_type` echoes the mode
16
+ * that actually ran. When `query` is omitted, returns a plain catalog listing of
17
+ * the collection's documents.
18
+ *
19
+ * **How it works:**
20
+ *
21
+ * 1. The `query` text is embedded into a 1024-dimensional vector using the
22
+ * multilingual-e5-large model.
23
+ * 2. The embedding is compared against the collection's indexed document chunks
24
+ * using semantic similarity. When `hybrid` and `keyword` execution ship, those
25
+ * scores will be fused with, or replaced by, lexical BM25 matching.
26
+ * 3. Results are ranked by `score` (descending) and paginated via `page[number]` /
27
+ * `page[size]`.
28
+ *
29
+ * **Authentication:** Requires a Telnyx API key via `Authorization: Bearer <key>`.
30
+ * Results are automatically scoped to your organization and cannot be overridden.
31
+ *
32
+ * **Filtering:** Use `filter[field][operator]=value` query parameters to narrow
33
+ * results before search. Supported operators: `eq` (default), `in`, `gte`, `gt`,
34
+ * `lte`, `lt`, `contains`. Metadata fields resolve to `metadata.<field>`.
35
+ *
36
+ * **Examples:**
37
+ *
38
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=billing+issue&top_k=10`
39
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=refund&sources=voice,message`
40
+ * - `GET /v2/ai/knowledge/collections/my-collection/documents?query=outage&filter[record_created_at][gte]=2026-01-01T00:00:00Z`
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const response =
45
+ * await client.ai.knowledge.collections.retrieveDocuments(
46
+ * 'support-transcripts',
47
+ * );
48
+ * ```
49
+ */
50
+ retrieveDocuments(slug, query = {}, options) {
51
+ return this._client.get(path `/ai/knowledge/collections/${slug}/documents`, { query, ...options });
52
+ }
53
+ }
54
+ //# sourceMappingURL=collections.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.mjs","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/collections.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAGrD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,iBAAiB,CACf,IAAY,EACZ,QAA8D,EAAE,EAChE,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,6BAA6B,IAAI,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ export { Collections, type CollectionRetrieveDocumentsResponse, type CollectionRetrieveDocumentsParams, } from "./collections.mjs";
2
+ export { Knowledge } from "./knowledge.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,GACvC,0BAAsB;AACvB,OAAO,EAAE,SAAS,EAAE,wBAAoB"}
@@ -0,0 +1,3 @@
1
+ export { Collections, type CollectionRetrieveDocumentsResponse, type CollectionRetrieveDocumentsParams, } from "./collections.js";
2
+ export { Knowledge } from "./knowledge.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,GACvC,yBAAsB;AACvB,OAAO,EAAE,SAAS,EAAE,uBAAoB"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Knowledge = exports.Collections = void 0;
5
+ var collections_1 = require("./collections.js");
6
+ Object.defineProperty(exports, "Collections", { enumerable: true, get: function () { return collections_1.Collections; } });
7
+ var knowledge_1 = require("./knowledge.js");
8
+ Object.defineProperty(exports, "Knowledge", { enumerable: true, get: function () { return knowledge_1.Knowledge; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAIuB;AAHrB,0GAAA,WAAW,OAAA;AAIb,4CAAwC;AAA/B,sGAAA,SAAS,OAAA"}
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { Collections, } from "./collections.mjs";
3
+ export { Knowledge } from "./knowledge.mjs";
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,WAAW,GAGZ,0BAAsB;AACvB,OAAO,EAAE,SAAS,EAAE,wBAAoB"}
@@ -0,0 +1,10 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import * as CollectionsAPI from "./collections.mjs";
3
+ import { CollectionRetrieveDocumentsParams, CollectionRetrieveDocumentsResponse, Collections } from "./collections.mjs";
4
+ export declare class Knowledge extends APIResource {
5
+ collections: CollectionsAPI.Collections;
6
+ }
7
+ export declare namespace Knowledge {
8
+ export { Collections as Collections, type CollectionRetrieveDocumentsResponse as CollectionRetrieveDocumentsResponse, type CollectionRetrieveDocumentsParams as CollectionRetrieveDocumentsParams, };
9
+ }
10
+ //# sourceMappingURL=knowledge.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.d.mts","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/knowledge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,cAAc,0BAAsB;AAChD,OAAO,EACL,iCAAiC,EACjC,mCAAmC,EACnC,WAAW,EACZ,0BAAsB;AAEvB,qBAAa,SAAU,SAAQ,WAAW;IACxC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;CACxF;AAID,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
@@ -0,0 +1,10 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import * as CollectionsAPI from "./collections.js";
3
+ import { CollectionRetrieveDocumentsParams, CollectionRetrieveDocumentsResponse, Collections } from "./collections.js";
4
+ export declare class Knowledge extends APIResource {
5
+ collections: CollectionsAPI.Collections;
6
+ }
7
+ export declare namespace Knowledge {
8
+ export { Collections as Collections, type CollectionRetrieveDocumentsResponse as CollectionRetrieveDocumentsResponse, type CollectionRetrieveDocumentsParams as CollectionRetrieveDocumentsParams, };
9
+ }
10
+ //# sourceMappingURL=knowledge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.d.ts","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/knowledge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,KAAK,cAAc,yBAAsB;AAChD,OAAO,EACL,iCAAiC,EACjC,mCAAmC,EACnC,WAAW,EACZ,yBAAsB;AAEvB,qBAAa,SAAU,SAAQ,WAAW;IACxC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;CACxF;AAID,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Knowledge = void 0;
5
+ const tslib_1 = require("../../../internal/tslib.js");
6
+ const resource_1 = require("../../../core/resource.js");
7
+ const CollectionsAPI = tslib_1.__importStar(require("./collections.js"));
8
+ const collections_1 = require("./collections.js");
9
+ class Knowledge extends resource_1.APIResource {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.collections = new CollectionsAPI.Collections(this._client);
13
+ }
14
+ }
15
+ exports.Knowledge = Knowledge;
16
+ Knowledge.Collections = collections_1.Collections;
17
+ //# sourceMappingURL=knowledge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.js","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/knowledge.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,yEAAgD;AAChD,kDAIuB;AAEvB,MAAa,SAAU,SAAQ,sBAAW;IAA1C;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC;CAAA;AAFD,8BAEC;AAED,SAAS,CAAC,WAAW,GAAG,yBAAW,CAAC"}
@@ -0,0 +1,12 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../core/resource.mjs";
3
+ import * as CollectionsAPI from "./collections.mjs";
4
+ import { Collections, } from "./collections.mjs";
5
+ export class Knowledge extends APIResource {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.collections = new CollectionsAPI.Collections(this._client);
9
+ }
10
+ }
11
+ Knowledge.Collections = Collections;
12
+ //# sourceMappingURL=knowledge.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.mjs","sourceRoot":"","sources":["../../../src/resources/ai/knowledge/knowledge.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,cAAc,0BAAsB;AAChD,OAAO,EAGL,WAAW,GACZ,0BAAsB;AAEvB,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC;CAAA;AAED,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./knowledge/index.mjs";
2
+ //# sourceMappingURL=knowledge.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.d.mts","sourceRoot":"","sources":["../../src/resources/ai/knowledge.ts"],"names":[],"mappings":"AAEA,sCAAkC"}
@@ -0,0 +1,2 @@
1
+ export * from "./knowledge/index.js";
2
+ //# sourceMappingURL=knowledge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.d.ts","sourceRoot":"","sources":["../../src/resources/ai/knowledge.ts"],"names":[],"mappings":"AAEA,qCAAkC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("../../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./knowledge/index.js"), exports);
6
+ //# sourceMappingURL=knowledge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.js","sourceRoot":"","sources":["../../src/resources/ai/knowledge.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,+DAAkC"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from "./knowledge/index.mjs";
3
+ //# sourceMappingURL=knowledge.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.mjs","sourceRoot":"","sources":["../../src/resources/ai/knowledge.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,sCAAkC"}
@@ -108,6 +108,14 @@ export interface ChatCreateCompletionParams {
108
108
  * Higher values will penalize the model from repeating the same output tokens.
109
109
  */
110
110
  presence_penalty?: number;
111
+ /**
112
+ * Controls the reasoning effort for models that support it. When set, the model
113
+ * spends more or less compute on internal reasoning before generating its
114
+ * response. Supported values: none, minimal, low, medium, high, xhigh, max. Not
115
+ * all models support all values; unsupported values are rejected with a 400 error.
116
+ * When omitted, reasoning models use their default effort level.
117
+ */
118
+ reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
111
119
  /**
112
120
  * Use this is you want to guarantee a JSON output without defining a schema. For
113
121
  * control over the schema, use `guided_json`.