@orq-ai/node 3.14.5-rc.1 → 3.14.6

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 (494) hide show
  1. package/bin/mcp-server.js +213 -210
  2. package/bin/mcp-server.js.map +38 -38
  3. package/docs/sdks/agents/README.md +4 -8
  4. package/docs/sdks/budgets/README.md +2 -4
  5. package/docs/sdks/tools/README.md +2 -4
  6. package/examples/package-lock.json +6 -5
  7. package/jsr.json +1 -1
  8. package/lib/config.d.ts +2 -2
  9. package/lib/config.js +2 -2
  10. package/lib/config.js.map +1 -1
  11. package/mcp-server/mcp-server.js +1 -1
  12. package/mcp-server/mcp-server.js.map +1 -1
  13. package/mcp-server/server.js +1 -1
  14. package/mcp-server/server.js.map +1 -1
  15. package/models/operations/createbudget.js +2 -2
  16. package/models/operations/createcontact.js +2 -2
  17. package/models/operations/createdataset.js +2 -2
  18. package/models/operations/createdatasetitem.js +8 -8
  19. package/models/operations/createdatasource.js +2 -2
  20. package/models/operations/createeval.js +28 -28
  21. package/models/operations/createtool.js +10 -10
  22. package/models/operations/duplicatetool.js +10 -10
  23. package/models/operations/fileget.js +2 -2
  24. package/models/operations/filelist.js +2 -2
  25. package/models/operations/fileupload.js +2 -2
  26. package/models/operations/getalltools.js +10 -10
  27. package/models/operations/getbudget.js +2 -2
  28. package/models/operations/getevals.js +28 -28
  29. package/models/operations/listbudgets.js +2 -2
  30. package/models/operations/listcontacts.js +2 -2
  31. package/models/operations/listdatasetdatapoints.js +8 -8
  32. package/models/operations/listdatasets.js +2 -2
  33. package/models/operations/listdatasources.js +2 -2
  34. package/models/operations/retrievecontact.js +2 -2
  35. package/models/operations/retrievedatapoint.js +8 -8
  36. package/models/operations/retrievedataset.js +2 -2
  37. package/models/operations/retrievedatasource.js +2 -2
  38. package/models/operations/retrievetool.js +10 -10
  39. package/models/operations/updatebudget.js +2 -2
  40. package/models/operations/updatecontact.js +2 -2
  41. package/models/operations/updatedatapoint.js +8 -8
  42. package/models/operations/updatedataset.js +2 -2
  43. package/models/operations/updatedatasource.js +2 -2
  44. package/models/operations/updateeval.js +28 -28
  45. package/models/operations/updatetool.js +10 -10
  46. package/package.json +4 -4
  47. package/packages/orq-rc/FUNCTIONS.md +103 -0
  48. package/packages/orq-rc/README.md +909 -0
  49. package/packages/orq-rc/RUNTIMES.md +48 -0
  50. package/packages/orq-rc/docs/sdks/agents/README.md +1319 -0
  51. package/packages/orq-rc/docs/sdks/budgets/README.md +401 -0
  52. package/packages/orq-rc/docs/sdks/chunking/README.md +95 -0
  53. package/packages/orq-rc/docs/sdks/contacts/README.md +450 -0
  54. package/packages/orq-rc/docs/sdks/datasets/README.md +836 -0
  55. package/packages/orq-rc/docs/sdks/deployments/README.md +312 -0
  56. package/packages/orq-rc/docs/sdks/evals/README.md +339 -0
  57. package/packages/orq-rc/docs/sdks/feedback/README.md +89 -0
  58. package/packages/orq-rc/docs/sdks/files/README.md +301 -0
  59. package/packages/orq-rc/docs/sdks/knowledge/README.md +1489 -0
  60. package/packages/orq-rc/docs/sdks/memorystores/README.md +1172 -0
  61. package/packages/orq-rc/docs/sdks/metrics/README.md +83 -0
  62. package/packages/orq-rc/docs/sdks/models/README.md +76 -0
  63. package/packages/orq-rc/docs/sdks/prompts/README.md +591 -0
  64. package/packages/orq-rc/docs/sdks/remoteconfigs/README.md +77 -0
  65. package/packages/orq-rc/docs/sdks/tools/README.md +490 -0
  66. package/packages/orq-rc/examples/README.md +31 -0
  67. package/packages/orq-rc/examples/contactsCreate.example.ts +42 -0
  68. package/packages/orq-rc/examples/package-lock.json +627 -0
  69. package/packages/orq-rc/examples/package.json +18 -0
  70. package/packages/orq-rc/jsr.json +28 -0
  71. package/packages/orq-rc/package-lock.json +3071 -0
  72. package/packages/orq-rc/package.json +43 -0
  73. package/packages/orq-rc/src/core.ts +13 -0
  74. package/packages/orq-rc/src/funcs/agentsCreate.ts +172 -0
  75. package/packages/orq-rc/src/funcs/agentsDelete.ts +176 -0
  76. package/packages/orq-rc/src/funcs/agentsInvoke.ts +167 -0
  77. package/packages/orq-rc/src/funcs/agentsList.ts +167 -0
  78. package/packages/orq-rc/src/funcs/agentsListActions.ts +169 -0
  79. package/packages/orq-rc/src/funcs/agentsListTasks.ts +183 -0
  80. package/packages/orq-rc/src/funcs/agentsRetrieve.ts +175 -0
  81. package/packages/orq-rc/src/funcs/agentsRetrieveAction.ts +173 -0
  82. package/packages/orq-rc/src/funcs/agentsRetrieveTask.ts +179 -0
  83. package/packages/orq-rc/src/funcs/agentsRun.ts +163 -0
  84. package/packages/orq-rc/src/funcs/agentsStream.ts +190 -0
  85. package/packages/orq-rc/src/funcs/agentsStreamRun.ts +188 -0
  86. package/packages/orq-rc/src/funcs/agentsUpdate.ts +176 -0
  87. package/packages/orq-rc/src/funcs/budgetsCreate.ts +160 -0
  88. package/packages/orq-rc/src/funcs/budgetsDelete.ts +167 -0
  89. package/packages/orq-rc/src/funcs/budgetsGet.ts +166 -0
  90. package/packages/orq-rc/src/funcs/budgetsList.ts +170 -0
  91. package/packages/orq-rc/src/funcs/budgetsUpdate.ts +167 -0
  92. package/packages/orq-rc/src/funcs/chunkingParse.ts +160 -0
  93. package/packages/orq-rc/src/funcs/contactsCreate.ts +165 -0
  94. package/packages/orq-rc/src/funcs/contactsDelete.ts +176 -0
  95. package/packages/orq-rc/src/funcs/contactsList.ts +169 -0
  96. package/packages/orq-rc/src/funcs/contactsRetrieve.ts +175 -0
  97. package/packages/orq-rc/src/funcs/contactsUpdate.ts +176 -0
  98. package/packages/orq-rc/src/funcs/datasetsClear.ts +167 -0
  99. package/packages/orq-rc/src/funcs/datasetsCreate.ts +165 -0
  100. package/packages/orq-rc/src/funcs/datasetsCreateDatapoint.ts +171 -0
  101. package/packages/orq-rc/src/funcs/datasetsDelete.ts +167 -0
  102. package/packages/orq-rc/src/funcs/datasetsDeleteDatapoint.ts +182 -0
  103. package/packages/orq-rc/src/funcs/datasetsList.ts +167 -0
  104. package/packages/orq-rc/src/funcs/datasetsListDatapoints.ts +174 -0
  105. package/packages/orq-rc/src/funcs/datasetsRetrieve.ts +175 -0
  106. package/packages/orq-rc/src/funcs/datasetsRetrieveDatapoint.ts +181 -0
  107. package/packages/orq-rc/src/funcs/datasetsUpdate.ts +176 -0
  108. package/packages/orq-rc/src/funcs/datasetsUpdateDatapoint.ts +179 -0
  109. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +168 -0
  110. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +176 -0
  111. package/packages/orq-rc/src/funcs/deploymentsList.ts +176 -0
  112. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +168 -0
  113. package/packages/orq-rc/src/funcs/deploymentsStream.ts +183 -0
  114. package/packages/orq-rc/src/funcs/evalsAll.ts +173 -0
  115. package/packages/orq-rc/src/funcs/evalsCreate.ts +169 -0
  116. package/packages/orq-rc/src/funcs/evalsDelete.ts +173 -0
  117. package/packages/orq-rc/src/funcs/evalsUpdate.ts +173 -0
  118. package/packages/orq-rc/src/funcs/feedbackCreate.ts +160 -0
  119. package/packages/orq-rc/src/funcs/filesCreate.ts +187 -0
  120. package/packages/orq-rc/src/funcs/filesDelete.ts +164 -0
  121. package/packages/orq-rc/src/funcs/filesGet.ts +166 -0
  122. package/packages/orq-rc/src/funcs/filesList.ts +167 -0
  123. package/packages/orq-rc/src/funcs/knowledgeCreate.ts +158 -0
  124. package/packages/orq-rc/src/funcs/knowledgeCreateChunks.ts +171 -0
  125. package/packages/orq-rc/src/funcs/knowledgeCreateDatasource.ts +166 -0
  126. package/packages/orq-rc/src/funcs/knowledgeDelete.ts +167 -0
  127. package/packages/orq-rc/src/funcs/knowledgeDeleteChunk.ts +174 -0
  128. package/packages/orq-rc/src/funcs/knowledgeDeleteChunks.ts +170 -0
  129. package/packages/orq-rc/src/funcs/knowledgeDeleteDatasource.ts +173 -0
  130. package/packages/orq-rc/src/funcs/knowledgeGetChunksCount.ts +170 -0
  131. package/packages/orq-rc/src/funcs/knowledgeList.ts +169 -0
  132. package/packages/orq-rc/src/funcs/knowledgeListChunks.ts +178 -0
  133. package/packages/orq-rc/src/funcs/knowledgeListChunksPaginated.ts +171 -0
  134. package/packages/orq-rc/src/funcs/knowledgeListDatasources.ts +174 -0
  135. package/packages/orq-rc/src/funcs/knowledgeRetrieve.ts +166 -0
  136. package/packages/orq-rc/src/funcs/knowledgeRetrieveChunk.ts +173 -0
  137. package/packages/orq-rc/src/funcs/knowledgeRetrieveDatasource.ts +169 -0
  138. package/packages/orq-rc/src/funcs/knowledgeSearch.ts +167 -0
  139. package/packages/orq-rc/src/funcs/knowledgeUpdate.ts +164 -0
  140. package/packages/orq-rc/src/funcs/knowledgeUpdateChunk.ts +174 -0
  141. package/packages/orq-rc/src/funcs/knowledgeUpdateDatasource.ts +170 -0
  142. package/packages/orq-rc/src/funcs/memoryStoresCreate.ts +171 -0
  143. package/packages/orq-rc/src/funcs/memoryStoresCreateDocument.ts +175 -0
  144. package/packages/orq-rc/src/funcs/memoryStoresCreateMemory.ts +170 -0
  145. package/packages/orq-rc/src/funcs/memoryStoresDelete.ts +168 -0
  146. package/packages/orq-rc/src/funcs/memoryStoresDeleteDocument.ts +184 -0
  147. package/packages/orq-rc/src/funcs/memoryStoresDeleteMemory.ts +179 -0
  148. package/packages/orq-rc/src/funcs/memoryStoresList.ts +178 -0
  149. package/packages/orq-rc/src/funcs/memoryStoresListDocuments.ts +181 -0
  150. package/packages/orq-rc/src/funcs/memoryStoresListMemories.ts +176 -0
  151. package/packages/orq-rc/src/funcs/memoryStoresRetrieve.ts +177 -0
  152. package/packages/orq-rc/src/funcs/memoryStoresRetrieveDocument.ts +178 -0
  153. package/packages/orq-rc/src/funcs/memoryStoresRetrieveMemory.ts +173 -0
  154. package/packages/orq-rc/src/funcs/memoryStoresUpdate.ts +168 -0
  155. package/packages/orq-rc/src/funcs/memoryStoresUpdateDocument.ts +179 -0
  156. package/packages/orq-rc/src/funcs/memoryStoresUpdateMemory.ts +174 -0
  157. package/packages/orq-rc/src/funcs/modelsList.ts +142 -0
  158. package/packages/orq-rc/src/funcs/promptsCreate.ts +160 -0
  159. package/packages/orq-rc/src/funcs/promptsDelete.ts +164 -0
  160. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +181 -0
  161. package/packages/orq-rc/src/funcs/promptsList.ts +167 -0
  162. package/packages/orq-rc/src/funcs/promptsListVersions.ts +173 -0
  163. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +166 -0
  164. package/packages/orq-rc/src/funcs/promptsUpdate.ts +173 -0
  165. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +161 -0
  166. package/packages/orq-rc/src/funcs/toolsCreate.ts +163 -0
  167. package/packages/orq-rc/src/funcs/toolsDelete.ts +167 -0
  168. package/packages/orq-rc/src/funcs/toolsDuplicate.ts +175 -0
  169. package/packages/orq-rc/src/funcs/toolsList.ts +176 -0
  170. package/packages/orq-rc/src/funcs/toolsRetrieve.ts +166 -0
  171. package/packages/orq-rc/src/funcs/toolsUpdate.ts +176 -0
  172. package/packages/orq-rc/src/hooks/global.ts +44 -0
  173. package/packages/orq-rc/src/hooks/hooks.ts +132 -0
  174. package/packages/orq-rc/src/hooks/index.ts +6 -0
  175. package/packages/orq-rc/src/hooks/registration.ts +15 -0
  176. package/packages/orq-rc/src/hooks/types.ts +112 -0
  177. package/packages/orq-rc/src/index.ts +9 -0
  178. package/packages/orq-rc/src/lib/base64.ts +37 -0
  179. package/packages/orq-rc/src/lib/config.ts +74 -0
  180. package/packages/orq-rc/src/lib/dlv.ts +53 -0
  181. package/packages/orq-rc/src/lib/encodings.ts +483 -0
  182. package/packages/orq-rc/src/lib/env.ts +89 -0
  183. package/packages/orq-rc/src/lib/event-streams.ts +135 -0
  184. package/packages/orq-rc/src/lib/files.ts +82 -0
  185. package/packages/orq-rc/src/lib/http.ts +323 -0
  186. package/packages/orq-rc/src/lib/is-plain-object.ts +43 -0
  187. package/packages/orq-rc/src/lib/logger.ts +9 -0
  188. package/packages/orq-rc/src/lib/matchers.ts +345 -0
  189. package/packages/orq-rc/src/lib/primitives.ts +150 -0
  190. package/packages/orq-rc/src/lib/retries.ts +218 -0
  191. package/packages/orq-rc/src/lib/schemas.ts +91 -0
  192. package/packages/orq-rc/src/lib/sdks.ts +407 -0
  193. package/packages/orq-rc/src/lib/security.ts +264 -0
  194. package/packages/orq-rc/src/lib/url.ts +33 -0
  195. package/packages/orq-rc/src/mcp-server/cli/start/command.ts +111 -0
  196. package/packages/orq-rc/src/mcp-server/cli/start/impl.ts +136 -0
  197. package/packages/orq-rc/src/mcp-server/cli.ts +13 -0
  198. package/packages/orq-rc/src/mcp-server/console-logger.ts +71 -0
  199. package/packages/orq-rc/src/mcp-server/extensions.ts +17 -0
  200. package/packages/orq-rc/src/mcp-server/mcp-server.ts +26 -0
  201. package/packages/orq-rc/src/mcp-server/prompts.ts +117 -0
  202. package/packages/orq-rc/src/mcp-server/resources.ts +172 -0
  203. package/packages/orq-rc/src/mcp-server/scopes.ts +7 -0
  204. package/packages/orq-rc/src/mcp-server/server.ts +259 -0
  205. package/packages/orq-rc/src/mcp-server/shared.ts +74 -0
  206. package/packages/orq-rc/src/mcp-server/tools/agentsCreate.ts +37 -0
  207. package/packages/orq-rc/src/mcp-server/tools/agentsDelete.ts +35 -0
  208. package/packages/orq-rc/src/mcp-server/tools/agentsInvoke.ts +37 -0
  209. package/packages/orq-rc/src/mcp-server/tools/agentsList.ts +37 -0
  210. package/packages/orq-rc/src/mcp-server/tools/agentsListActions.ts +35 -0
  211. package/packages/orq-rc/src/mcp-server/tools/agentsListTasks.ts +37 -0
  212. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieve.ts +37 -0
  213. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveAction.ts +35 -0
  214. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveTask.ts +37 -0
  215. package/packages/orq-rc/src/mcp-server/tools/agentsRun.ts +37 -0
  216. package/packages/orq-rc/src/mcp-server/tools/agentsStream.ts +37 -0
  217. package/packages/orq-rc/src/mcp-server/tools/agentsStreamRun.ts +37 -0
  218. package/packages/orq-rc/src/mcp-server/tools/agentsUpdate.ts +37 -0
  219. package/packages/orq-rc/src/mcp-server/tools/budgetsCreate.ts +37 -0
  220. package/packages/orq-rc/src/mcp-server/tools/budgetsDelete.ts +35 -0
  221. package/packages/orq-rc/src/mcp-server/tools/budgetsGet.ts +37 -0
  222. package/packages/orq-rc/src/mcp-server/tools/budgetsList.ts +37 -0
  223. package/packages/orq-rc/src/mcp-server/tools/budgetsUpdate.ts +37 -0
  224. package/packages/orq-rc/src/mcp-server/tools/chunkingParse.ts +37 -0
  225. package/packages/orq-rc/src/mcp-server/tools/contactsCreate.ts +37 -0
  226. package/packages/orq-rc/src/mcp-server/tools/contactsDelete.ts +35 -0
  227. package/packages/orq-rc/src/mcp-server/tools/contactsList.ts +37 -0
  228. package/packages/orq-rc/src/mcp-server/tools/contactsRetrieve.ts +37 -0
  229. package/packages/orq-rc/src/mcp-server/tools/contactsUpdate.ts +37 -0
  230. package/packages/orq-rc/src/mcp-server/tools/datasetsClear.ts +35 -0
  231. package/packages/orq-rc/src/mcp-server/tools/datasetsCreate.ts +37 -0
  232. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateDatapoint.ts +37 -0
  233. package/packages/orq-rc/src/mcp-server/tools/datasetsDelete.ts +35 -0
  234. package/packages/orq-rc/src/mcp-server/tools/datasetsDeleteDatapoint.ts +35 -0
  235. package/packages/orq-rc/src/mcp-server/tools/datasetsList.ts +37 -0
  236. package/packages/orq-rc/src/mcp-server/tools/datasetsListDatapoints.ts +37 -0
  237. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieve.ts +37 -0
  238. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieveDatapoint.ts +37 -0
  239. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdate.ts +37 -0
  240. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdateDatapoint.ts +35 -0
  241. package/packages/orq-rc/src/mcp-server/tools/deploymentsGetConfig.ts +37 -0
  242. package/packages/orq-rc/src/mcp-server/tools/deploymentsInvoke.ts +37 -0
  243. package/packages/orq-rc/src/mcp-server/tools/deploymentsList.ts +37 -0
  244. package/packages/orq-rc/src/mcp-server/tools/deploymentsMetricsCreate.ts +37 -0
  245. package/packages/orq-rc/src/mcp-server/tools/deploymentsStream.ts +37 -0
  246. package/packages/orq-rc/src/mcp-server/tools/evalsAll.ts +35 -0
  247. package/packages/orq-rc/src/mcp-server/tools/evalsCreate.ts +35 -0
  248. package/packages/orq-rc/src/mcp-server/tools/evalsDelete.ts +33 -0
  249. package/packages/orq-rc/src/mcp-server/tools/evalsUpdate.ts +35 -0
  250. package/packages/orq-rc/src/mcp-server/tools/feedbackCreate.ts +37 -0
  251. package/packages/orq-rc/src/mcp-server/tools/filesCreate.ts +37 -0
  252. package/packages/orq-rc/src/mcp-server/tools/filesDelete.ts +33 -0
  253. package/packages/orq-rc/src/mcp-server/tools/filesGet.ts +37 -0
  254. package/packages/orq-rc/src/mcp-server/tools/filesList.ts +37 -0
  255. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreate.ts +35 -0
  256. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateChunks.ts +35 -0
  257. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateDatasource.ts +35 -0
  258. package/packages/orq-rc/src/mcp-server/tools/knowledgeDelete.ts +35 -0
  259. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteChunk.ts +33 -0
  260. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteChunks.ts +35 -0
  261. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteDatasource.ts +35 -0
  262. package/packages/orq-rc/src/mcp-server/tools/knowledgeGetChunksCount.ts +35 -0
  263. package/packages/orq-rc/src/mcp-server/tools/knowledgeList.ts +37 -0
  264. package/packages/orq-rc/src/mcp-server/tools/knowledgeListChunks.ts +35 -0
  265. package/packages/orq-rc/src/mcp-server/tools/knowledgeListChunksPaginated.ts +35 -0
  266. package/packages/orq-rc/src/mcp-server/tools/knowledgeListDatasources.ts +35 -0
  267. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieve.ts +37 -0
  268. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveChunk.ts +35 -0
  269. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveDatasource.ts +35 -0
  270. package/packages/orq-rc/src/mcp-server/tools/knowledgeSearch.ts +37 -0
  271. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdate.ts +35 -0
  272. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateChunk.ts +35 -0
  273. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateDatasource.ts +35 -0
  274. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreate.ts +35 -0
  275. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreateDocument.ts +37 -0
  276. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreateMemory.ts +37 -0
  277. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDelete.ts +35 -0
  278. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDeleteDocument.ts +40 -0
  279. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDeleteMemory.ts +40 -0
  280. package/packages/orq-rc/src/mcp-server/tools/memoryStoresList.ts +37 -0
  281. package/packages/orq-rc/src/mcp-server/tools/memoryStoresListDocuments.ts +37 -0
  282. package/packages/orq-rc/src/mcp-server/tools/memoryStoresListMemories.ts +37 -0
  283. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieve.ts +37 -0
  284. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieveDocument.ts +37 -0
  285. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieveMemory.ts +37 -0
  286. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdate.ts +37 -0
  287. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdateDocument.ts +37 -0
  288. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdateMemory.ts +37 -0
  289. package/packages/orq-rc/src/mcp-server/tools/modelsList.ts +30 -0
  290. package/packages/orq-rc/src/mcp-server/tools/promptsCreate.ts +35 -0
  291. package/packages/orq-rc/src/mcp-server/tools/promptsDelete.ts +33 -0
  292. package/packages/orq-rc/src/mcp-server/tools/promptsGetVersion.ts +37 -0
  293. package/packages/orq-rc/src/mcp-server/tools/promptsList.ts +37 -0
  294. package/packages/orq-rc/src/mcp-server/tools/promptsListVersions.ts +37 -0
  295. package/packages/orq-rc/src/mcp-server/tools/promptsRetrieve.ts +37 -0
  296. package/packages/orq-rc/src/mcp-server/tools/promptsUpdate.ts +35 -0
  297. package/packages/orq-rc/src/mcp-server/tools/remoteconfigsRetrieve.ts +36 -0
  298. package/packages/orq-rc/src/mcp-server/tools/toolsCreate.ts +37 -0
  299. package/packages/orq-rc/src/mcp-server/tools/toolsDelete.ts +35 -0
  300. package/packages/orq-rc/src/mcp-server/tools/toolsDuplicate.ts +37 -0
  301. package/packages/orq-rc/src/mcp-server/tools/toolsList.ts +37 -0
  302. package/packages/orq-rc/src/mcp-server/tools/toolsRetrieve.ts +37 -0
  303. package/packages/orq-rc/src/mcp-server/tools/toolsUpdate.ts +37 -0
  304. package/packages/orq-rc/src/mcp-server/tools.ts +129 -0
  305. package/packages/orq-rc/src/models/components/deployments.ts +8147 -0
  306. package/packages/orq-rc/src/models/components/index.ts +6 -0
  307. package/packages/orq-rc/src/models/components/security.ts +71 -0
  308. package/packages/orq-rc/src/models/errors/apierror.ts +40 -0
  309. package/packages/orq-rc/src/models/errors/createagent.ts +80 -0
  310. package/packages/orq-rc/src/models/errors/createeval.ts +80 -0
  311. package/packages/orq-rc/src/models/errors/deleteagent.ts +80 -0
  312. package/packages/orq-rc/src/models/errors/deletecontact.ts +91 -0
  313. package/packages/orq-rc/src/models/errors/deleteeval.ts +80 -0
  314. package/packages/orq-rc/src/models/errors/duplicatetool.ts +91 -0
  315. package/packages/orq-rc/src/models/errors/getagent.ts +80 -0
  316. package/packages/orq-rc/src/models/errors/getagenttask.ts +80 -0
  317. package/packages/orq-rc/src/models/errors/getevals.ts +80 -0
  318. package/packages/orq-rc/src/models/errors/getpromptversion.ts +80 -0
  319. package/packages/orq-rc/src/models/errors/honoapierror.ts +90 -0
  320. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +62 -0
  321. package/packages/orq-rc/src/models/errors/index.ts +29 -0
  322. package/packages/orq-rc/src/models/errors/listagenttasks.ts +80 -0
  323. package/packages/orq-rc/src/models/errors/orqerror.ts +35 -0
  324. package/packages/orq-rc/src/models/errors/responsevalidationerror.ts +50 -0
  325. package/packages/orq-rc/src/models/errors/retrievecontact.ts +91 -0
  326. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +109 -0
  327. package/packages/orq-rc/src/models/errors/streamagent.ts +80 -0
  328. package/packages/orq-rc/src/models/errors/streamrunagent.ts +80 -0
  329. package/packages/orq-rc/src/models/errors/updateagent.ts +80 -0
  330. package/packages/orq-rc/src/models/errors/updatecontact.ts +83 -0
  331. package/packages/orq-rc/src/models/errors/updateeval.ts +80 -0
  332. package/packages/orq-rc/src/models/errors/updateprompt.ts +80 -0
  333. package/packages/orq-rc/src/models/errors/updatetool.ts +91 -0
  334. package/packages/orq-rc/src/models/operations/cleardataset.ts +78 -0
  335. package/packages/orq-rc/src/models/operations/createagent.ts +3104 -0
  336. package/packages/orq-rc/src/models/operations/createbudget.ts +745 -0
  337. package/packages/orq-rc/src/models/operations/createchunk.ts +428 -0
  338. package/packages/orq-rc/src/models/operations/createcontact.ts +267 -0
  339. package/packages/orq-rc/src/models/operations/createdataset.ts +302 -0
  340. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +6943 -0
  341. package/packages/orq-rc/src/models/operations/createdatasource.ts +852 -0
  342. package/packages/orq-rc/src/models/operations/createeval.ts +9341 -0
  343. package/packages/orq-rc/src/models/operations/createfeedback.ts +286 -0
  344. package/packages/orq-rc/src/models/operations/createknowledge.ts +1850 -0
  345. package/packages/orq-rc/src/models/operations/creatememory.ts +274 -0
  346. package/packages/orq-rc/src/models/operations/creatememorydocument.ts +287 -0
  347. package/packages/orq-rc/src/models/operations/creatememorystore.ts +2032 -0
  348. package/packages/orq-rc/src/models/operations/createprompt.ts +7812 -0
  349. package/packages/orq-rc/src/models/operations/createtool.ts +4077 -0
  350. package/packages/orq-rc/src/models/operations/deleteagent.ts +78 -0
  351. package/packages/orq-rc/src/models/operations/deletebudget.ts +69 -0
  352. package/packages/orq-rc/src/models/operations/deletechunk.ts +96 -0
  353. package/packages/orq-rc/src/models/operations/deletechunks.ts +243 -0
  354. package/packages/orq-rc/src/models/operations/deletecontact.ts +69 -0
  355. package/packages/orq-rc/src/models/operations/deletedatapoint.ts +87 -0
  356. package/packages/orq-rc/src/models/operations/deletedataset.ts +78 -0
  357. package/packages/orq-rc/src/models/operations/deletedatasource.ts +87 -0
  358. package/packages/orq-rc/src/models/operations/deleteeval.ts +66 -0
  359. package/packages/orq-rc/src/models/operations/deleteknowledge.ts +78 -0
  360. package/packages/orq-rc/src/models/operations/deletememory.ts +87 -0
  361. package/packages/orq-rc/src/models/operations/deletememorydocument.ts +98 -0
  362. package/packages/orq-rc/src/models/operations/deletememorystore.ts +78 -0
  363. package/packages/orq-rc/src/models/operations/deleteprompt.ts +69 -0
  364. package/packages/orq-rc/src/models/operations/deletetool.ts +75 -0
  365. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +6547 -0
  366. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +10532 -0
  367. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +1266 -0
  368. package/packages/orq-rc/src/models/operations/deployments.ts +2606 -0
  369. package/packages/orq-rc/src/models/operations/deploymentstream.ts +10655 -0
  370. package/packages/orq-rc/src/models/operations/duplicatetool.ts +2349 -0
  371. package/packages/orq-rc/src/models/operations/filedelete.ts +78 -0
  372. package/packages/orq-rc/src/models/operations/fileget.ts +223 -0
  373. package/packages/orq-rc/src/models/operations/filelist.ts +337 -0
  374. package/packages/orq-rc/src/models/operations/fileupload.ts +327 -0
  375. package/packages/orq-rc/src/models/operations/getagent.ts +957 -0
  376. package/packages/orq-rc/src/models/operations/getagenttask.ts +259 -0
  377. package/packages/orq-rc/src/models/operations/getallmemories.ts +318 -0
  378. package/packages/orq-rc/src/models/operations/getallmemorydocuments.ts +338 -0
  379. package/packages/orq-rc/src/models/operations/getallmemorystores.ts +1277 -0
  380. package/packages/orq-rc/src/models/operations/getallprompts.ts +2572 -0
  381. package/packages/orq-rc/src/models/operations/getalltools.ts +2308 -0
  382. package/packages/orq-rc/src/models/operations/getbudget.ts +441 -0
  383. package/packages/orq-rc/src/models/operations/getchunkscount.ts +230 -0
  384. package/packages/orq-rc/src/models/operations/getevals.ts +7486 -0
  385. package/packages/orq-rc/src/models/operations/getonechunk.ts +315 -0
  386. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +1292 -0
  387. package/packages/orq-rc/src/models/operations/getoneprompt.ts +2437 -0
  388. package/packages/orq-rc/src/models/operations/getpromptversion.ts +2444 -0
  389. package/packages/orq-rc/src/models/operations/index.ts +102 -0
  390. package/packages/orq-rc/src/models/operations/invokeagent.ts +1569 -0
  391. package/packages/orq-rc/src/models/operations/listactions.ts +526 -0
  392. package/packages/orq-rc/src/models/operations/listagents.ts +1077 -0
  393. package/packages/orq-rc/src/models/operations/listagenttasks.ts +1106 -0
  394. package/packages/orq-rc/src/models/operations/listbudgets.ts +617 -0
  395. package/packages/orq-rc/src/models/operations/listchunks.ts +494 -0
  396. package/packages/orq-rc/src/models/operations/listchunkspaginated.ts +507 -0
  397. package/packages/orq-rc/src/models/operations/listcontacts.ts +500 -0
  398. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +4086 -0
  399. package/packages/orq-rc/src/models/operations/listdatasets.ts +406 -0
  400. package/packages/orq-rc/src/models/operations/listdatasources.ts +454 -0
  401. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +1303 -0
  402. package/packages/orq-rc/src/models/operations/listmodels.ts +273 -0
  403. package/packages/orq-rc/src/models/operations/listpromptversions.ts +2580 -0
  404. package/packages/orq-rc/src/models/operations/parse.ts +1295 -0
  405. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +190 -0
  406. package/packages/orq-rc/src/models/operations/retrieveaction.ts +426 -0
  407. package/packages/orq-rc/src/models/operations/retrievecontact.ts +210 -0
  408. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +3853 -0
  409. package/packages/orq-rc/src/models/operations/retrievedataset.ts +291 -0
  410. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +273 -0
  411. package/packages/orq-rc/src/models/operations/retrievememory.ts +201 -0
  412. package/packages/orq-rc/src/models/operations/retrievememorydocument.ts +220 -0
  413. package/packages/orq-rc/src/models/operations/retrievememorystore.ts +1160 -0
  414. package/packages/orq-rc/src/models/operations/retrievetool.ts +2333 -0
  415. package/packages/orq-rc/src/models/operations/runagent.ts +4342 -0
  416. package/packages/orq-rc/src/models/operations/searchknowledge.ts +3573 -0
  417. package/packages/orq-rc/src/models/operations/streamagent.ts +1367 -0
  418. package/packages/orq-rc/src/models/operations/streamrunagent.ts +4355 -0
  419. package/packages/orq-rc/src/models/operations/updateagent.ts +3321 -0
  420. package/packages/orq-rc/src/models/operations/updatebudget.ts +628 -0
  421. package/packages/orq-rc/src/models/operations/updatechunk.ts +448 -0
  422. package/packages/orq-rc/src/models/operations/updatecontact.ts +325 -0
  423. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +6934 -0
  424. package/packages/orq-rc/src/models/operations/updatedataset.ts +386 -0
  425. package/packages/orq-rc/src/models/operations/updatedatasource.ts +345 -0
  426. package/packages/orq-rc/src/models/operations/updateeval.ts +9704 -0
  427. package/packages/orq-rc/src/models/operations/updateknowledge.ts +2341 -0
  428. package/packages/orq-rc/src/models/operations/updatememory.ts +283 -0
  429. package/packages/orq-rc/src/models/operations/updatememorydocument.ts +296 -0
  430. package/packages/orq-rc/src/models/operations/updatememorystore.ts +1363 -0
  431. package/packages/orq-rc/src/models/operations/updateprompt.ts +8176 -0
  432. package/packages/orq-rc/src/models/operations/updatetool.ts +4288 -0
  433. package/packages/orq-rc/src/sdk/agents.ts +238 -0
  434. package/packages/orq-rc/src/sdk/budgets.ts +99 -0
  435. package/packages/orq-rc/src/sdk/chunking.ts +27 -0
  436. package/packages/orq-rc/src/sdk/contacts.ts +99 -0
  437. package/packages/orq-rc/src/sdk/datasets.ts +204 -0
  438. package/packages/orq-rc/src/sdk/deployments.ts +89 -0
  439. package/packages/orq-rc/src/sdk/evals.ts +69 -0
  440. package/packages/orq-rc/src/sdk/feedback.ts +27 -0
  441. package/packages/orq-rc/src/sdk/files.ts +78 -0
  442. package/packages/orq-rc/src/sdk/index.ts +5 -0
  443. package/packages/orq-rc/src/sdk/knowledge.ts +309 -0
  444. package/packages/orq-rc/src/sdk/memorystores.ts +286 -0
  445. package/packages/orq-rc/src/sdk/metrics.ts +27 -0
  446. package/packages/orq-rc/src/sdk/models.ts +25 -0
  447. package/packages/orq-rc/src/sdk/prompts.ts +126 -0
  448. package/packages/orq-rc/src/sdk/remoteconfigs.ts +24 -0
  449. package/packages/orq-rc/src/sdk/sdk.ts +97 -0
  450. package/packages/orq-rc/src/sdk/tools.ts +117 -0
  451. package/packages/orq-rc/src/types/async.ts +68 -0
  452. package/packages/orq-rc/src/types/blobs.ts +32 -0
  453. package/packages/orq-rc/src/types/constdatetime.ts +15 -0
  454. package/packages/orq-rc/src/types/enums.ts +16 -0
  455. package/packages/orq-rc/src/types/fp.ts +50 -0
  456. package/packages/orq-rc/src/types/index.ts +11 -0
  457. package/packages/orq-rc/src/types/operations.ts +105 -0
  458. package/packages/orq-rc/src/types/rfcdate.ts +54 -0
  459. package/packages/orq-rc/src/types/streams.ts +21 -0
  460. package/packages/orq-rc/tsconfig.json +41 -0
  461. package/src/lib/config.ts +2 -2
  462. package/src/mcp-server/mcp-server.ts +1 -1
  463. package/src/mcp-server/server.ts +1 -1
  464. package/src/models/operations/createbudget.ts +2 -2
  465. package/src/models/operations/createcontact.ts +2 -2
  466. package/src/models/operations/createdataset.ts +2 -2
  467. package/src/models/operations/createdatasetitem.ts +8 -8
  468. package/src/models/operations/createdatasource.ts +2 -2
  469. package/src/models/operations/createeval.ts +28 -28
  470. package/src/models/operations/createtool.ts +10 -10
  471. package/src/models/operations/duplicatetool.ts +10 -10
  472. package/src/models/operations/fileget.ts +2 -2
  473. package/src/models/operations/filelist.ts +2 -2
  474. package/src/models/operations/fileupload.ts +2 -2
  475. package/src/models/operations/getalltools.ts +10 -10
  476. package/src/models/operations/getbudget.ts +2 -2
  477. package/src/models/operations/getevals.ts +28 -28
  478. package/src/models/operations/listbudgets.ts +2 -2
  479. package/src/models/operations/listcontacts.ts +2 -2
  480. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  481. package/src/models/operations/listdatasets.ts +2 -2
  482. package/src/models/operations/listdatasources.ts +2 -2
  483. package/src/models/operations/retrievecontact.ts +2 -2
  484. package/src/models/operations/retrievedatapoint.ts +8 -8
  485. package/src/models/operations/retrievedataset.ts +2 -2
  486. package/src/models/operations/retrievedatasource.ts +2 -2
  487. package/src/models/operations/retrievetool.ts +10 -10
  488. package/src/models/operations/updatebudget.ts +2 -2
  489. package/src/models/operations/updatecontact.ts +2 -2
  490. package/src/models/operations/updatedatapoint.ts +8 -8
  491. package/src/models/operations/updatedataset.ts +2 -2
  492. package/src/models/operations/updatedatasource.ts +2 -2
  493. package/src/models/operations/updateeval.ts +28 -28
  494. package/src/models/operations/updatetool.ts +10 -10
@@ -0,0 +1,1295 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ /**
13
+ * Return format: chunks (with metadata) or texts (plain strings)
14
+ */
15
+ export const ParseChunkingRequestChunkingRequestReturnType = {
16
+ Chunks: "chunks",
17
+ Texts: "texts",
18
+ } as const;
19
+ /**
20
+ * Return format: chunks (with metadata) or texts (plain strings)
21
+ */
22
+ export type ParseChunkingRequestChunkingRequestReturnType = ClosedEnum<
23
+ typeof ParseChunkingRequestChunkingRequestReturnType
24
+ >;
25
+
26
+ export const AgenticChunker = {
27
+ Agentic: "agentic",
28
+ } as const;
29
+ export type AgenticChunker = ClosedEnum<typeof AgenticChunker>;
30
+
31
+ /**
32
+ * Agentic LLM-powered chunker that uses AI to determine optimal split points. Best for complex documents requiring intelligent segmentation.
33
+ */
34
+ export type AgenticChunkerStrategy = {
35
+ /**
36
+ * The text content to be chunked
37
+ */
38
+ text: string;
39
+ /**
40
+ * Whether to include metadata for each chunk
41
+ */
42
+ metadata?: boolean | undefined;
43
+ /**
44
+ * Return format: chunks (with metadata) or texts (plain strings)
45
+ */
46
+ returnType?: ParseChunkingRequestChunkingRequestReturnType | undefined;
47
+ strategy: AgenticChunker;
48
+ /**
49
+ * Chat model to use for chunking. (Available models)[https://docs.orq.ai/docs/proxy#chat-models]
50
+ */
51
+ model: string;
52
+ /**
53
+ * Maximum tokens per chunk
54
+ */
55
+ chunkSize?: number | undefined;
56
+ /**
57
+ * Size of candidate splits for LLM evaluation
58
+ */
59
+ candidateSize?: number | undefined;
60
+ /**
61
+ * Minimum characters allowed per chunk
62
+ */
63
+ minCharactersPerChunk?: number | undefined;
64
+ };
65
+
66
+ /**
67
+ * Return format: chunks (with metadata) or texts (plain strings)
68
+ */
69
+ export const ParseChunkingRequestChunkingReturnType = {
70
+ Chunks: "chunks",
71
+ Texts: "texts",
72
+ } as const;
73
+ /**
74
+ * Return format: chunks (with metadata) or texts (plain strings)
75
+ */
76
+ export type ParseChunkingRequestChunkingReturnType = ClosedEnum<
77
+ typeof ParseChunkingRequestChunkingReturnType
78
+ >;
79
+
80
+ export const SemanticChunker = {
81
+ Semantic: "semantic",
82
+ } as const;
83
+ export type SemanticChunker = ClosedEnum<typeof SemanticChunker>;
84
+
85
+ export const Threshold2 = {
86
+ Auto: "auto",
87
+ } as const;
88
+ export type Threshold2 = ClosedEnum<typeof Threshold2>;
89
+
90
+ /**
91
+ * Similarity threshold for grouping (0-1) or "auto" for automatic detection
92
+ */
93
+ export type Threshold = number | Threshold2;
94
+
95
+ /**
96
+ * Chunking mode: window-based or sentence-based similarity
97
+ */
98
+ export const Mode = {
99
+ Window: "window",
100
+ Sentence: "sentence",
101
+ } as const;
102
+ /**
103
+ * Chunking mode: window-based or sentence-based similarity
104
+ */
105
+ export type Mode = ClosedEnum<typeof Mode>;
106
+
107
+ /**
108
+ * Groups semantically similar sentences using embeddings. Excellent for maintaining topic coherence and context within chunks.
109
+ */
110
+ export type SemanticChunkerStrategy = {
111
+ /**
112
+ * The text content to be chunked
113
+ */
114
+ text: string;
115
+ /**
116
+ * Whether to include metadata for each chunk
117
+ */
118
+ metadata?: boolean | undefined;
119
+ /**
120
+ * Return format: chunks (with metadata) or texts (plain strings)
121
+ */
122
+ returnType?: ParseChunkingRequestChunkingReturnType | undefined;
123
+ strategy: SemanticChunker;
124
+ /**
125
+ * Maximum tokens per chunk
126
+ */
127
+ chunkSize?: number | undefined;
128
+ /**
129
+ * Similarity threshold for grouping (0-1) or "auto" for automatic detection
130
+ */
131
+ threshold?: number | Threshold2 | undefined;
132
+ /**
133
+ * Embedding model to use for semantic similarity. (Available embedding models)[https://docs.orq.ai/docs/proxy#embedding-models]
134
+ */
135
+ embeddingModel: string;
136
+ /**
137
+ * Chunking mode: window-based or sentence-based similarity
138
+ */
139
+ mode?: Mode | undefined;
140
+ /**
141
+ * Window size for similarity comparison
142
+ */
143
+ similarityWindow?: number | undefined;
144
+ };
145
+
146
+ /**
147
+ * Return format: chunks (with metadata) or texts (plain strings)
148
+ */
149
+ export const ParseChunkingRequestReturnType = {
150
+ Chunks: "chunks",
151
+ Texts: "texts",
152
+ } as const;
153
+ /**
154
+ * Return format: chunks (with metadata) or texts (plain strings)
155
+ */
156
+ export type ParseChunkingRequestReturnType = ClosedEnum<
157
+ typeof ParseChunkingRequestReturnType
158
+ >;
159
+
160
+ export const RecursiveChunker = {
161
+ Recursive: "recursive",
162
+ } as const;
163
+ export type RecursiveChunker = ClosedEnum<typeof RecursiveChunker>;
164
+
165
+ /**
166
+ * Recursively splits text using a hierarchy of separators (paragraphs, sentences, words). Versatile general-purpose chunker that preserves document structure.
167
+ */
168
+ export type RecursiveChunkerStrategy = {
169
+ /**
170
+ * The text content to be chunked
171
+ */
172
+ text: string;
173
+ /**
174
+ * Whether to include metadata for each chunk
175
+ */
176
+ metadata?: boolean | undefined;
177
+ /**
178
+ * Return format: chunks (with metadata) or texts (plain strings)
179
+ */
180
+ returnType?: ParseChunkingRequestReturnType | undefined;
181
+ strategy: RecursiveChunker;
182
+ /**
183
+ * Maximum tokens per chunk
184
+ */
185
+ chunkSize?: number | undefined;
186
+ /**
187
+ * Hierarchy of separators to use for splitting
188
+ */
189
+ separators?: Array<string> | undefined;
190
+ /**
191
+ * Minimum characters allowed per chunk
192
+ */
193
+ minCharactersPerChunk?: number | undefined;
194
+ };
195
+
196
+ /**
197
+ * Return format: chunks (with metadata) or texts (plain strings)
198
+ */
199
+ export const ChunkingRequestReturnType = {
200
+ Chunks: "chunks",
201
+ Texts: "texts",
202
+ } as const;
203
+ /**
204
+ * Return format: chunks (with metadata) or texts (plain strings)
205
+ */
206
+ export type ChunkingRequestReturnType = ClosedEnum<
207
+ typeof ChunkingRequestReturnType
208
+ >;
209
+
210
+ export const SentenceChunker = {
211
+ Sentence: "sentence",
212
+ } as const;
213
+ export type SentenceChunker = ClosedEnum<typeof SentenceChunker>;
214
+
215
+ /**
216
+ * Splits text at sentence boundaries while respecting token limits. Ideal for maintaining semantic coherence and readability.
217
+ */
218
+ export type SentenceChunkerStrategy = {
219
+ /**
220
+ * The text content to be chunked
221
+ */
222
+ text: string;
223
+ /**
224
+ * Whether to include metadata for each chunk
225
+ */
226
+ metadata?: boolean | undefined;
227
+ /**
228
+ * Return format: chunks (with metadata) or texts (plain strings)
229
+ */
230
+ returnType?: ChunkingRequestReturnType | undefined;
231
+ strategy: SentenceChunker;
232
+ /**
233
+ * Maximum tokens per chunk
234
+ */
235
+ chunkSize?: number | undefined;
236
+ /**
237
+ * Number of overlapping tokens between chunks
238
+ */
239
+ chunkOverlap?: number | undefined;
240
+ /**
241
+ * Minimum number of sentences per chunk
242
+ */
243
+ minSentencesPerChunk?: number | undefined;
244
+ };
245
+
246
+ /**
247
+ * Return format: chunks (with metadata) or texts (plain strings)
248
+ */
249
+ export const ReturnTypeT = {
250
+ Chunks: "chunks",
251
+ Texts: "texts",
252
+ } as const;
253
+ /**
254
+ * Return format: chunks (with metadata) or texts (plain strings)
255
+ */
256
+ export type ReturnTypeT = ClosedEnum<typeof ReturnTypeT>;
257
+
258
+ export const TokenChunker = {
259
+ Token: "token",
260
+ } as const;
261
+ export type TokenChunker = ClosedEnum<typeof TokenChunker>;
262
+
263
+ /**
264
+ * Splits text based on token count. Best for ensuring chunks fit within LLM context windows and maintaining consistent chunk sizes for embedding models.
265
+ */
266
+ export type TokenChunkerStrategy = {
267
+ /**
268
+ * The text content to be chunked
269
+ */
270
+ text: string;
271
+ /**
272
+ * Whether to include metadata for each chunk
273
+ */
274
+ metadata?: boolean | undefined;
275
+ /**
276
+ * Return format: chunks (with metadata) or texts (plain strings)
277
+ */
278
+ returnType?: ReturnTypeT | undefined;
279
+ strategy: TokenChunker;
280
+ /**
281
+ * Maximum tokens per chunk
282
+ */
283
+ chunkSize?: number | undefined;
284
+ /**
285
+ * Number of tokens to overlap between chunks
286
+ */
287
+ chunkOverlap?: number | undefined;
288
+ };
289
+
290
+ /**
291
+ * Request payload for text chunking with strategy-specific configuration
292
+ */
293
+ export type ParseChunkingRequest =
294
+ | SemanticChunkerStrategy
295
+ | AgenticChunkerStrategy
296
+ | TokenChunkerStrategy
297
+ | SentenceChunkerStrategy
298
+ | RecursiveChunkerStrategy;
299
+
300
+ export type ParseMetadata = {
301
+ startIndex: number | null;
302
+ endIndex: number | null;
303
+ tokenCount: number | null;
304
+ };
305
+
306
+ export type Chunks = {
307
+ /**
308
+ * The text content of the chunk
309
+ */
310
+ text: string;
311
+ /**
312
+ * The position index of this chunk in the sequence
313
+ */
314
+ index: number;
315
+ metadata?: ParseMetadata | undefined;
316
+ };
317
+
318
+ /**
319
+ * Text successfully chunked
320
+ */
321
+ export type ParseResponseBody = {
322
+ chunks: Array<Chunks>;
323
+ };
324
+
325
+ /** @internal */
326
+ export const ParseChunkingRequestChunkingRequestReturnType$inboundSchema:
327
+ z.ZodNativeEnum<typeof ParseChunkingRequestChunkingRequestReturnType> = z
328
+ .nativeEnum(ParseChunkingRequestChunkingRequestReturnType);
329
+
330
+ /** @internal */
331
+ export const ParseChunkingRequestChunkingRequestReturnType$outboundSchema:
332
+ z.ZodNativeEnum<typeof ParseChunkingRequestChunkingRequestReturnType> =
333
+ ParseChunkingRequestChunkingRequestReturnType$inboundSchema;
334
+
335
+ /**
336
+ * @internal
337
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
338
+ */
339
+ export namespace ParseChunkingRequestChunkingRequestReturnType$ {
340
+ /** @deprecated use `ParseChunkingRequestChunkingRequestReturnType$inboundSchema` instead. */
341
+ export const inboundSchema =
342
+ ParseChunkingRequestChunkingRequestReturnType$inboundSchema;
343
+ /** @deprecated use `ParseChunkingRequestChunkingRequestReturnType$outboundSchema` instead. */
344
+ export const outboundSchema =
345
+ ParseChunkingRequestChunkingRequestReturnType$outboundSchema;
346
+ }
347
+
348
+ /** @internal */
349
+ export const AgenticChunker$inboundSchema: z.ZodNativeEnum<
350
+ typeof AgenticChunker
351
+ > = z.nativeEnum(AgenticChunker);
352
+
353
+ /** @internal */
354
+ export const AgenticChunker$outboundSchema: z.ZodNativeEnum<
355
+ typeof AgenticChunker
356
+ > = AgenticChunker$inboundSchema;
357
+
358
+ /**
359
+ * @internal
360
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
361
+ */
362
+ export namespace AgenticChunker$ {
363
+ /** @deprecated use `AgenticChunker$inboundSchema` instead. */
364
+ export const inboundSchema = AgenticChunker$inboundSchema;
365
+ /** @deprecated use `AgenticChunker$outboundSchema` instead. */
366
+ export const outboundSchema = AgenticChunker$outboundSchema;
367
+ }
368
+
369
+ /** @internal */
370
+ export const AgenticChunkerStrategy$inboundSchema: z.ZodType<
371
+ AgenticChunkerStrategy,
372
+ z.ZodTypeDef,
373
+ unknown
374
+ > = z.object({
375
+ text: z.string(),
376
+ metadata: z.boolean().default(true),
377
+ return_type: ParseChunkingRequestChunkingRequestReturnType$inboundSchema
378
+ .default("chunks"),
379
+ strategy: AgenticChunker$inboundSchema,
380
+ model: z.string(),
381
+ chunk_size: z.number().int().default(1024),
382
+ candidate_size: z.number().int().default(128),
383
+ min_characters_per_chunk: z.number().int().default(24),
384
+ }).transform((v) => {
385
+ return remap$(v, {
386
+ "return_type": "returnType",
387
+ "chunk_size": "chunkSize",
388
+ "candidate_size": "candidateSize",
389
+ "min_characters_per_chunk": "minCharactersPerChunk",
390
+ });
391
+ });
392
+
393
+ /** @internal */
394
+ export type AgenticChunkerStrategy$Outbound = {
395
+ text: string;
396
+ metadata: boolean;
397
+ return_type: string;
398
+ strategy: string;
399
+ model: string;
400
+ chunk_size: number;
401
+ candidate_size: number;
402
+ min_characters_per_chunk: number;
403
+ };
404
+
405
+ /** @internal */
406
+ export const AgenticChunkerStrategy$outboundSchema: z.ZodType<
407
+ AgenticChunkerStrategy$Outbound,
408
+ z.ZodTypeDef,
409
+ AgenticChunkerStrategy
410
+ > = z.object({
411
+ text: z.string(),
412
+ metadata: z.boolean().default(true),
413
+ returnType: ParseChunkingRequestChunkingRequestReturnType$outboundSchema
414
+ .default("chunks"),
415
+ strategy: AgenticChunker$outboundSchema,
416
+ model: z.string(),
417
+ chunkSize: z.number().int().default(1024),
418
+ candidateSize: z.number().int().default(128),
419
+ minCharactersPerChunk: z.number().int().default(24),
420
+ }).transform((v) => {
421
+ return remap$(v, {
422
+ returnType: "return_type",
423
+ chunkSize: "chunk_size",
424
+ candidateSize: "candidate_size",
425
+ minCharactersPerChunk: "min_characters_per_chunk",
426
+ });
427
+ });
428
+
429
+ /**
430
+ * @internal
431
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
432
+ */
433
+ export namespace AgenticChunkerStrategy$ {
434
+ /** @deprecated use `AgenticChunkerStrategy$inboundSchema` instead. */
435
+ export const inboundSchema = AgenticChunkerStrategy$inboundSchema;
436
+ /** @deprecated use `AgenticChunkerStrategy$outboundSchema` instead. */
437
+ export const outboundSchema = AgenticChunkerStrategy$outboundSchema;
438
+ /** @deprecated use `AgenticChunkerStrategy$Outbound` instead. */
439
+ export type Outbound = AgenticChunkerStrategy$Outbound;
440
+ }
441
+
442
+ export function agenticChunkerStrategyToJSON(
443
+ agenticChunkerStrategy: AgenticChunkerStrategy,
444
+ ): string {
445
+ return JSON.stringify(
446
+ AgenticChunkerStrategy$outboundSchema.parse(agenticChunkerStrategy),
447
+ );
448
+ }
449
+
450
+ export function agenticChunkerStrategyFromJSON(
451
+ jsonString: string,
452
+ ): SafeParseResult<AgenticChunkerStrategy, SDKValidationError> {
453
+ return safeParse(
454
+ jsonString,
455
+ (x) => AgenticChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
456
+ `Failed to parse 'AgenticChunkerStrategy' from JSON`,
457
+ );
458
+ }
459
+
460
+ /** @internal */
461
+ export const ParseChunkingRequestChunkingReturnType$inboundSchema:
462
+ z.ZodNativeEnum<typeof ParseChunkingRequestChunkingReturnType> = z.nativeEnum(
463
+ ParseChunkingRequestChunkingReturnType,
464
+ );
465
+
466
+ /** @internal */
467
+ export const ParseChunkingRequestChunkingReturnType$outboundSchema:
468
+ z.ZodNativeEnum<typeof ParseChunkingRequestChunkingReturnType> =
469
+ ParseChunkingRequestChunkingReturnType$inboundSchema;
470
+
471
+ /**
472
+ * @internal
473
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
474
+ */
475
+ export namespace ParseChunkingRequestChunkingReturnType$ {
476
+ /** @deprecated use `ParseChunkingRequestChunkingReturnType$inboundSchema` instead. */
477
+ export const inboundSchema =
478
+ ParseChunkingRequestChunkingReturnType$inboundSchema;
479
+ /** @deprecated use `ParseChunkingRequestChunkingReturnType$outboundSchema` instead. */
480
+ export const outboundSchema =
481
+ ParseChunkingRequestChunkingReturnType$outboundSchema;
482
+ }
483
+
484
+ /** @internal */
485
+ export const SemanticChunker$inboundSchema: z.ZodNativeEnum<
486
+ typeof SemanticChunker
487
+ > = z.nativeEnum(SemanticChunker);
488
+
489
+ /** @internal */
490
+ export const SemanticChunker$outboundSchema: z.ZodNativeEnum<
491
+ typeof SemanticChunker
492
+ > = SemanticChunker$inboundSchema;
493
+
494
+ /**
495
+ * @internal
496
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
497
+ */
498
+ export namespace SemanticChunker$ {
499
+ /** @deprecated use `SemanticChunker$inboundSchema` instead. */
500
+ export const inboundSchema = SemanticChunker$inboundSchema;
501
+ /** @deprecated use `SemanticChunker$outboundSchema` instead. */
502
+ export const outboundSchema = SemanticChunker$outboundSchema;
503
+ }
504
+
505
+ /** @internal */
506
+ export const Threshold2$inboundSchema: z.ZodNativeEnum<typeof Threshold2> = z
507
+ .nativeEnum(Threshold2);
508
+
509
+ /** @internal */
510
+ export const Threshold2$outboundSchema: z.ZodNativeEnum<typeof Threshold2> =
511
+ Threshold2$inboundSchema;
512
+
513
+ /**
514
+ * @internal
515
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
516
+ */
517
+ export namespace Threshold2$ {
518
+ /** @deprecated use `Threshold2$inboundSchema` instead. */
519
+ export const inboundSchema = Threshold2$inboundSchema;
520
+ /** @deprecated use `Threshold2$outboundSchema` instead. */
521
+ export const outboundSchema = Threshold2$outboundSchema;
522
+ }
523
+
524
+ /** @internal */
525
+ export const Threshold$inboundSchema: z.ZodType<
526
+ Threshold,
527
+ z.ZodTypeDef,
528
+ unknown
529
+ > = z.union([z.number(), Threshold2$inboundSchema]);
530
+
531
+ /** @internal */
532
+ export type Threshold$Outbound = number | string;
533
+
534
+ /** @internal */
535
+ export const Threshold$outboundSchema: z.ZodType<
536
+ Threshold$Outbound,
537
+ z.ZodTypeDef,
538
+ Threshold
539
+ > = z.union([z.number(), Threshold2$outboundSchema]);
540
+
541
+ /**
542
+ * @internal
543
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
544
+ */
545
+ export namespace Threshold$ {
546
+ /** @deprecated use `Threshold$inboundSchema` instead. */
547
+ export const inboundSchema = Threshold$inboundSchema;
548
+ /** @deprecated use `Threshold$outboundSchema` instead. */
549
+ export const outboundSchema = Threshold$outboundSchema;
550
+ /** @deprecated use `Threshold$Outbound` instead. */
551
+ export type Outbound = Threshold$Outbound;
552
+ }
553
+
554
+ export function thresholdToJSON(threshold: Threshold): string {
555
+ return JSON.stringify(Threshold$outboundSchema.parse(threshold));
556
+ }
557
+
558
+ export function thresholdFromJSON(
559
+ jsonString: string,
560
+ ): SafeParseResult<Threshold, SDKValidationError> {
561
+ return safeParse(
562
+ jsonString,
563
+ (x) => Threshold$inboundSchema.parse(JSON.parse(x)),
564
+ `Failed to parse 'Threshold' from JSON`,
565
+ );
566
+ }
567
+
568
+ /** @internal */
569
+ export const Mode$inboundSchema: z.ZodNativeEnum<typeof Mode> = z.nativeEnum(
570
+ Mode,
571
+ );
572
+
573
+ /** @internal */
574
+ export const Mode$outboundSchema: z.ZodNativeEnum<typeof Mode> =
575
+ Mode$inboundSchema;
576
+
577
+ /**
578
+ * @internal
579
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
580
+ */
581
+ export namespace Mode$ {
582
+ /** @deprecated use `Mode$inboundSchema` instead. */
583
+ export const inboundSchema = Mode$inboundSchema;
584
+ /** @deprecated use `Mode$outboundSchema` instead. */
585
+ export const outboundSchema = Mode$outboundSchema;
586
+ }
587
+
588
+ /** @internal */
589
+ export const SemanticChunkerStrategy$inboundSchema: z.ZodType<
590
+ SemanticChunkerStrategy,
591
+ z.ZodTypeDef,
592
+ unknown
593
+ > = z.object({
594
+ text: z.string(),
595
+ metadata: z.boolean().default(true),
596
+ return_type: ParseChunkingRequestChunkingReturnType$inboundSchema.default(
597
+ "chunks",
598
+ ),
599
+ strategy: SemanticChunker$inboundSchema,
600
+ chunk_size: z.number().int().default(512),
601
+ threshold: z.union([z.number(), Threshold2$inboundSchema]).optional(),
602
+ embedding_model: z.string(),
603
+ mode: Mode$inboundSchema.default("window"),
604
+ similarity_window: z.number().int().default(1),
605
+ }).transform((v) => {
606
+ return remap$(v, {
607
+ "return_type": "returnType",
608
+ "chunk_size": "chunkSize",
609
+ "embedding_model": "embeddingModel",
610
+ "similarity_window": "similarityWindow",
611
+ });
612
+ });
613
+
614
+ /** @internal */
615
+ export type SemanticChunkerStrategy$Outbound = {
616
+ text: string;
617
+ metadata: boolean;
618
+ return_type: string;
619
+ strategy: string;
620
+ chunk_size: number;
621
+ threshold?: number | string | undefined;
622
+ embedding_model: string;
623
+ mode: string;
624
+ similarity_window: number;
625
+ };
626
+
627
+ /** @internal */
628
+ export const SemanticChunkerStrategy$outboundSchema: z.ZodType<
629
+ SemanticChunkerStrategy$Outbound,
630
+ z.ZodTypeDef,
631
+ SemanticChunkerStrategy
632
+ > = z.object({
633
+ text: z.string(),
634
+ metadata: z.boolean().default(true),
635
+ returnType: ParseChunkingRequestChunkingReturnType$outboundSchema.default(
636
+ "chunks",
637
+ ),
638
+ strategy: SemanticChunker$outboundSchema,
639
+ chunkSize: z.number().int().default(512),
640
+ threshold: z.union([z.number(), Threshold2$outboundSchema]).optional(),
641
+ embeddingModel: z.string(),
642
+ mode: Mode$outboundSchema.default("window"),
643
+ similarityWindow: z.number().int().default(1),
644
+ }).transform((v) => {
645
+ return remap$(v, {
646
+ returnType: "return_type",
647
+ chunkSize: "chunk_size",
648
+ embeddingModel: "embedding_model",
649
+ similarityWindow: "similarity_window",
650
+ });
651
+ });
652
+
653
+ /**
654
+ * @internal
655
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
656
+ */
657
+ export namespace SemanticChunkerStrategy$ {
658
+ /** @deprecated use `SemanticChunkerStrategy$inboundSchema` instead. */
659
+ export const inboundSchema = SemanticChunkerStrategy$inboundSchema;
660
+ /** @deprecated use `SemanticChunkerStrategy$outboundSchema` instead. */
661
+ export const outboundSchema = SemanticChunkerStrategy$outboundSchema;
662
+ /** @deprecated use `SemanticChunkerStrategy$Outbound` instead. */
663
+ export type Outbound = SemanticChunkerStrategy$Outbound;
664
+ }
665
+
666
+ export function semanticChunkerStrategyToJSON(
667
+ semanticChunkerStrategy: SemanticChunkerStrategy,
668
+ ): string {
669
+ return JSON.stringify(
670
+ SemanticChunkerStrategy$outboundSchema.parse(semanticChunkerStrategy),
671
+ );
672
+ }
673
+
674
+ export function semanticChunkerStrategyFromJSON(
675
+ jsonString: string,
676
+ ): SafeParseResult<SemanticChunkerStrategy, SDKValidationError> {
677
+ return safeParse(
678
+ jsonString,
679
+ (x) => SemanticChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
680
+ `Failed to parse 'SemanticChunkerStrategy' from JSON`,
681
+ );
682
+ }
683
+
684
+ /** @internal */
685
+ export const ParseChunkingRequestReturnType$inboundSchema: z.ZodNativeEnum<
686
+ typeof ParseChunkingRequestReturnType
687
+ > = z.nativeEnum(ParseChunkingRequestReturnType);
688
+
689
+ /** @internal */
690
+ export const ParseChunkingRequestReturnType$outboundSchema: z.ZodNativeEnum<
691
+ typeof ParseChunkingRequestReturnType
692
+ > = ParseChunkingRequestReturnType$inboundSchema;
693
+
694
+ /**
695
+ * @internal
696
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
697
+ */
698
+ export namespace ParseChunkingRequestReturnType$ {
699
+ /** @deprecated use `ParseChunkingRequestReturnType$inboundSchema` instead. */
700
+ export const inboundSchema = ParseChunkingRequestReturnType$inboundSchema;
701
+ /** @deprecated use `ParseChunkingRequestReturnType$outboundSchema` instead. */
702
+ export const outboundSchema = ParseChunkingRequestReturnType$outboundSchema;
703
+ }
704
+
705
+ /** @internal */
706
+ export const RecursiveChunker$inboundSchema: z.ZodNativeEnum<
707
+ typeof RecursiveChunker
708
+ > = z.nativeEnum(RecursiveChunker);
709
+
710
+ /** @internal */
711
+ export const RecursiveChunker$outboundSchema: z.ZodNativeEnum<
712
+ typeof RecursiveChunker
713
+ > = RecursiveChunker$inboundSchema;
714
+
715
+ /**
716
+ * @internal
717
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
718
+ */
719
+ export namespace RecursiveChunker$ {
720
+ /** @deprecated use `RecursiveChunker$inboundSchema` instead. */
721
+ export const inboundSchema = RecursiveChunker$inboundSchema;
722
+ /** @deprecated use `RecursiveChunker$outboundSchema` instead. */
723
+ export const outboundSchema = RecursiveChunker$outboundSchema;
724
+ }
725
+
726
+ /** @internal */
727
+ export const RecursiveChunkerStrategy$inboundSchema: z.ZodType<
728
+ RecursiveChunkerStrategy,
729
+ z.ZodTypeDef,
730
+ unknown
731
+ > = z.object({
732
+ text: z.string(),
733
+ metadata: z.boolean().default(true),
734
+ return_type: ParseChunkingRequestReturnType$inboundSchema.default("chunks"),
735
+ strategy: RecursiveChunker$inboundSchema,
736
+ chunk_size: z.number().int().default(512),
737
+ separators: z.array(z.string()).optional(),
738
+ min_characters_per_chunk: z.number().int().default(24),
739
+ }).transform((v) => {
740
+ return remap$(v, {
741
+ "return_type": "returnType",
742
+ "chunk_size": "chunkSize",
743
+ "min_characters_per_chunk": "minCharactersPerChunk",
744
+ });
745
+ });
746
+
747
+ /** @internal */
748
+ export type RecursiveChunkerStrategy$Outbound = {
749
+ text: string;
750
+ metadata: boolean;
751
+ return_type: string;
752
+ strategy: string;
753
+ chunk_size: number;
754
+ separators?: Array<string> | undefined;
755
+ min_characters_per_chunk: number;
756
+ };
757
+
758
+ /** @internal */
759
+ export const RecursiveChunkerStrategy$outboundSchema: z.ZodType<
760
+ RecursiveChunkerStrategy$Outbound,
761
+ z.ZodTypeDef,
762
+ RecursiveChunkerStrategy
763
+ > = z.object({
764
+ text: z.string(),
765
+ metadata: z.boolean().default(true),
766
+ returnType: ParseChunkingRequestReturnType$outboundSchema.default("chunks"),
767
+ strategy: RecursiveChunker$outboundSchema,
768
+ chunkSize: z.number().int().default(512),
769
+ separators: z.array(z.string()).optional(),
770
+ minCharactersPerChunk: z.number().int().default(24),
771
+ }).transform((v) => {
772
+ return remap$(v, {
773
+ returnType: "return_type",
774
+ chunkSize: "chunk_size",
775
+ minCharactersPerChunk: "min_characters_per_chunk",
776
+ });
777
+ });
778
+
779
+ /**
780
+ * @internal
781
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
782
+ */
783
+ export namespace RecursiveChunkerStrategy$ {
784
+ /** @deprecated use `RecursiveChunkerStrategy$inboundSchema` instead. */
785
+ export const inboundSchema = RecursiveChunkerStrategy$inboundSchema;
786
+ /** @deprecated use `RecursiveChunkerStrategy$outboundSchema` instead. */
787
+ export const outboundSchema = RecursiveChunkerStrategy$outboundSchema;
788
+ /** @deprecated use `RecursiveChunkerStrategy$Outbound` instead. */
789
+ export type Outbound = RecursiveChunkerStrategy$Outbound;
790
+ }
791
+
792
+ export function recursiveChunkerStrategyToJSON(
793
+ recursiveChunkerStrategy: RecursiveChunkerStrategy,
794
+ ): string {
795
+ return JSON.stringify(
796
+ RecursiveChunkerStrategy$outboundSchema.parse(recursiveChunkerStrategy),
797
+ );
798
+ }
799
+
800
+ export function recursiveChunkerStrategyFromJSON(
801
+ jsonString: string,
802
+ ): SafeParseResult<RecursiveChunkerStrategy, SDKValidationError> {
803
+ return safeParse(
804
+ jsonString,
805
+ (x) => RecursiveChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
806
+ `Failed to parse 'RecursiveChunkerStrategy' from JSON`,
807
+ );
808
+ }
809
+
810
+ /** @internal */
811
+ export const ChunkingRequestReturnType$inboundSchema: z.ZodNativeEnum<
812
+ typeof ChunkingRequestReturnType
813
+ > = z.nativeEnum(ChunkingRequestReturnType);
814
+
815
+ /** @internal */
816
+ export const ChunkingRequestReturnType$outboundSchema: z.ZodNativeEnum<
817
+ typeof ChunkingRequestReturnType
818
+ > = ChunkingRequestReturnType$inboundSchema;
819
+
820
+ /**
821
+ * @internal
822
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
823
+ */
824
+ export namespace ChunkingRequestReturnType$ {
825
+ /** @deprecated use `ChunkingRequestReturnType$inboundSchema` instead. */
826
+ export const inboundSchema = ChunkingRequestReturnType$inboundSchema;
827
+ /** @deprecated use `ChunkingRequestReturnType$outboundSchema` instead. */
828
+ export const outboundSchema = ChunkingRequestReturnType$outboundSchema;
829
+ }
830
+
831
+ /** @internal */
832
+ export const SentenceChunker$inboundSchema: z.ZodNativeEnum<
833
+ typeof SentenceChunker
834
+ > = z.nativeEnum(SentenceChunker);
835
+
836
+ /** @internal */
837
+ export const SentenceChunker$outboundSchema: z.ZodNativeEnum<
838
+ typeof SentenceChunker
839
+ > = SentenceChunker$inboundSchema;
840
+
841
+ /**
842
+ * @internal
843
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
844
+ */
845
+ export namespace SentenceChunker$ {
846
+ /** @deprecated use `SentenceChunker$inboundSchema` instead. */
847
+ export const inboundSchema = SentenceChunker$inboundSchema;
848
+ /** @deprecated use `SentenceChunker$outboundSchema` instead. */
849
+ export const outboundSchema = SentenceChunker$outboundSchema;
850
+ }
851
+
852
+ /** @internal */
853
+ export const SentenceChunkerStrategy$inboundSchema: z.ZodType<
854
+ SentenceChunkerStrategy,
855
+ z.ZodTypeDef,
856
+ unknown
857
+ > = z.object({
858
+ text: z.string(),
859
+ metadata: z.boolean().default(true),
860
+ return_type: ChunkingRequestReturnType$inboundSchema.default("chunks"),
861
+ strategy: SentenceChunker$inboundSchema,
862
+ chunk_size: z.number().int().default(512),
863
+ chunk_overlap: z.number().int().default(0),
864
+ min_sentences_per_chunk: z.number().int().default(1),
865
+ }).transform((v) => {
866
+ return remap$(v, {
867
+ "return_type": "returnType",
868
+ "chunk_size": "chunkSize",
869
+ "chunk_overlap": "chunkOverlap",
870
+ "min_sentences_per_chunk": "minSentencesPerChunk",
871
+ });
872
+ });
873
+
874
+ /** @internal */
875
+ export type SentenceChunkerStrategy$Outbound = {
876
+ text: string;
877
+ metadata: boolean;
878
+ return_type: string;
879
+ strategy: string;
880
+ chunk_size: number;
881
+ chunk_overlap: number;
882
+ min_sentences_per_chunk: number;
883
+ };
884
+
885
+ /** @internal */
886
+ export const SentenceChunkerStrategy$outboundSchema: z.ZodType<
887
+ SentenceChunkerStrategy$Outbound,
888
+ z.ZodTypeDef,
889
+ SentenceChunkerStrategy
890
+ > = z.object({
891
+ text: z.string(),
892
+ metadata: z.boolean().default(true),
893
+ returnType: ChunkingRequestReturnType$outboundSchema.default("chunks"),
894
+ strategy: SentenceChunker$outboundSchema,
895
+ chunkSize: z.number().int().default(512),
896
+ chunkOverlap: z.number().int().default(0),
897
+ minSentencesPerChunk: z.number().int().default(1),
898
+ }).transform((v) => {
899
+ return remap$(v, {
900
+ returnType: "return_type",
901
+ chunkSize: "chunk_size",
902
+ chunkOverlap: "chunk_overlap",
903
+ minSentencesPerChunk: "min_sentences_per_chunk",
904
+ });
905
+ });
906
+
907
+ /**
908
+ * @internal
909
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
910
+ */
911
+ export namespace SentenceChunkerStrategy$ {
912
+ /** @deprecated use `SentenceChunkerStrategy$inboundSchema` instead. */
913
+ export const inboundSchema = SentenceChunkerStrategy$inboundSchema;
914
+ /** @deprecated use `SentenceChunkerStrategy$outboundSchema` instead. */
915
+ export const outboundSchema = SentenceChunkerStrategy$outboundSchema;
916
+ /** @deprecated use `SentenceChunkerStrategy$Outbound` instead. */
917
+ export type Outbound = SentenceChunkerStrategy$Outbound;
918
+ }
919
+
920
+ export function sentenceChunkerStrategyToJSON(
921
+ sentenceChunkerStrategy: SentenceChunkerStrategy,
922
+ ): string {
923
+ return JSON.stringify(
924
+ SentenceChunkerStrategy$outboundSchema.parse(sentenceChunkerStrategy),
925
+ );
926
+ }
927
+
928
+ export function sentenceChunkerStrategyFromJSON(
929
+ jsonString: string,
930
+ ): SafeParseResult<SentenceChunkerStrategy, SDKValidationError> {
931
+ return safeParse(
932
+ jsonString,
933
+ (x) => SentenceChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
934
+ `Failed to parse 'SentenceChunkerStrategy' from JSON`,
935
+ );
936
+ }
937
+
938
+ /** @internal */
939
+ export const ReturnTypeT$inboundSchema: z.ZodNativeEnum<typeof ReturnTypeT> = z
940
+ .nativeEnum(ReturnTypeT);
941
+
942
+ /** @internal */
943
+ export const ReturnTypeT$outboundSchema: z.ZodNativeEnum<typeof ReturnTypeT> =
944
+ ReturnTypeT$inboundSchema;
945
+
946
+ /**
947
+ * @internal
948
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
949
+ */
950
+ export namespace ReturnTypeT$ {
951
+ /** @deprecated use `ReturnTypeT$inboundSchema` instead. */
952
+ export const inboundSchema = ReturnTypeT$inboundSchema;
953
+ /** @deprecated use `ReturnTypeT$outboundSchema` instead. */
954
+ export const outboundSchema = ReturnTypeT$outboundSchema;
955
+ }
956
+
957
+ /** @internal */
958
+ export const TokenChunker$inboundSchema: z.ZodNativeEnum<typeof TokenChunker> =
959
+ z.nativeEnum(TokenChunker);
960
+
961
+ /** @internal */
962
+ export const TokenChunker$outboundSchema: z.ZodNativeEnum<typeof TokenChunker> =
963
+ TokenChunker$inboundSchema;
964
+
965
+ /**
966
+ * @internal
967
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
968
+ */
969
+ export namespace TokenChunker$ {
970
+ /** @deprecated use `TokenChunker$inboundSchema` instead. */
971
+ export const inboundSchema = TokenChunker$inboundSchema;
972
+ /** @deprecated use `TokenChunker$outboundSchema` instead. */
973
+ export const outboundSchema = TokenChunker$outboundSchema;
974
+ }
975
+
976
+ /** @internal */
977
+ export const TokenChunkerStrategy$inboundSchema: z.ZodType<
978
+ TokenChunkerStrategy,
979
+ z.ZodTypeDef,
980
+ unknown
981
+ > = z.object({
982
+ text: z.string(),
983
+ metadata: z.boolean().default(true),
984
+ return_type: ReturnTypeT$inboundSchema.default("chunks"),
985
+ strategy: TokenChunker$inboundSchema,
986
+ chunk_size: z.number().int().default(512),
987
+ chunk_overlap: z.number().int().default(0),
988
+ }).transform((v) => {
989
+ return remap$(v, {
990
+ "return_type": "returnType",
991
+ "chunk_size": "chunkSize",
992
+ "chunk_overlap": "chunkOverlap",
993
+ });
994
+ });
995
+
996
+ /** @internal */
997
+ export type TokenChunkerStrategy$Outbound = {
998
+ text: string;
999
+ metadata: boolean;
1000
+ return_type: string;
1001
+ strategy: string;
1002
+ chunk_size: number;
1003
+ chunk_overlap: number;
1004
+ };
1005
+
1006
+ /** @internal */
1007
+ export const TokenChunkerStrategy$outboundSchema: z.ZodType<
1008
+ TokenChunkerStrategy$Outbound,
1009
+ z.ZodTypeDef,
1010
+ TokenChunkerStrategy
1011
+ > = z.object({
1012
+ text: z.string(),
1013
+ metadata: z.boolean().default(true),
1014
+ returnType: ReturnTypeT$outboundSchema.default("chunks"),
1015
+ strategy: TokenChunker$outboundSchema,
1016
+ chunkSize: z.number().int().default(512),
1017
+ chunkOverlap: z.number().int().default(0),
1018
+ }).transform((v) => {
1019
+ return remap$(v, {
1020
+ returnType: "return_type",
1021
+ chunkSize: "chunk_size",
1022
+ chunkOverlap: "chunk_overlap",
1023
+ });
1024
+ });
1025
+
1026
+ /**
1027
+ * @internal
1028
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1029
+ */
1030
+ export namespace TokenChunkerStrategy$ {
1031
+ /** @deprecated use `TokenChunkerStrategy$inboundSchema` instead. */
1032
+ export const inboundSchema = TokenChunkerStrategy$inboundSchema;
1033
+ /** @deprecated use `TokenChunkerStrategy$outboundSchema` instead. */
1034
+ export const outboundSchema = TokenChunkerStrategy$outboundSchema;
1035
+ /** @deprecated use `TokenChunkerStrategy$Outbound` instead. */
1036
+ export type Outbound = TokenChunkerStrategy$Outbound;
1037
+ }
1038
+
1039
+ export function tokenChunkerStrategyToJSON(
1040
+ tokenChunkerStrategy: TokenChunkerStrategy,
1041
+ ): string {
1042
+ return JSON.stringify(
1043
+ TokenChunkerStrategy$outboundSchema.parse(tokenChunkerStrategy),
1044
+ );
1045
+ }
1046
+
1047
+ export function tokenChunkerStrategyFromJSON(
1048
+ jsonString: string,
1049
+ ): SafeParseResult<TokenChunkerStrategy, SDKValidationError> {
1050
+ return safeParse(
1051
+ jsonString,
1052
+ (x) => TokenChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
1053
+ `Failed to parse 'TokenChunkerStrategy' from JSON`,
1054
+ );
1055
+ }
1056
+
1057
+ /** @internal */
1058
+ export const ParseChunkingRequest$inboundSchema: z.ZodType<
1059
+ ParseChunkingRequest,
1060
+ z.ZodTypeDef,
1061
+ unknown
1062
+ > = z.union([
1063
+ z.lazy(() => SemanticChunkerStrategy$inboundSchema),
1064
+ z.lazy(() => AgenticChunkerStrategy$inboundSchema),
1065
+ z.lazy(() => TokenChunkerStrategy$inboundSchema),
1066
+ z.lazy(() => SentenceChunkerStrategy$inboundSchema),
1067
+ z.lazy(() => RecursiveChunkerStrategy$inboundSchema),
1068
+ ]);
1069
+
1070
+ /** @internal */
1071
+ export type ParseChunkingRequest$Outbound =
1072
+ | SemanticChunkerStrategy$Outbound
1073
+ | AgenticChunkerStrategy$Outbound
1074
+ | TokenChunkerStrategy$Outbound
1075
+ | SentenceChunkerStrategy$Outbound
1076
+ | RecursiveChunkerStrategy$Outbound;
1077
+
1078
+ /** @internal */
1079
+ export const ParseChunkingRequest$outboundSchema: z.ZodType<
1080
+ ParseChunkingRequest$Outbound,
1081
+ z.ZodTypeDef,
1082
+ ParseChunkingRequest
1083
+ > = z.union([
1084
+ z.lazy(() => SemanticChunkerStrategy$outboundSchema),
1085
+ z.lazy(() => AgenticChunkerStrategy$outboundSchema),
1086
+ z.lazy(() => TokenChunkerStrategy$outboundSchema),
1087
+ z.lazy(() => SentenceChunkerStrategy$outboundSchema),
1088
+ z.lazy(() => RecursiveChunkerStrategy$outboundSchema),
1089
+ ]);
1090
+
1091
+ /**
1092
+ * @internal
1093
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1094
+ */
1095
+ export namespace ParseChunkingRequest$ {
1096
+ /** @deprecated use `ParseChunkingRequest$inboundSchema` instead. */
1097
+ export const inboundSchema = ParseChunkingRequest$inboundSchema;
1098
+ /** @deprecated use `ParseChunkingRequest$outboundSchema` instead. */
1099
+ export const outboundSchema = ParseChunkingRequest$outboundSchema;
1100
+ /** @deprecated use `ParseChunkingRequest$Outbound` instead. */
1101
+ export type Outbound = ParseChunkingRequest$Outbound;
1102
+ }
1103
+
1104
+ export function parseChunkingRequestToJSON(
1105
+ parseChunkingRequest: ParseChunkingRequest,
1106
+ ): string {
1107
+ return JSON.stringify(
1108
+ ParseChunkingRequest$outboundSchema.parse(parseChunkingRequest),
1109
+ );
1110
+ }
1111
+
1112
+ export function parseChunkingRequestFromJSON(
1113
+ jsonString: string,
1114
+ ): SafeParseResult<ParseChunkingRequest, SDKValidationError> {
1115
+ return safeParse(
1116
+ jsonString,
1117
+ (x) => ParseChunkingRequest$inboundSchema.parse(JSON.parse(x)),
1118
+ `Failed to parse 'ParseChunkingRequest' from JSON`,
1119
+ );
1120
+ }
1121
+
1122
+ /** @internal */
1123
+ export const ParseMetadata$inboundSchema: z.ZodType<
1124
+ ParseMetadata,
1125
+ z.ZodTypeDef,
1126
+ unknown
1127
+ > = z.object({
1128
+ start_index: z.nullable(z.number()),
1129
+ end_index: z.nullable(z.number()),
1130
+ token_count: z.nullable(z.number()),
1131
+ }).transform((v) => {
1132
+ return remap$(v, {
1133
+ "start_index": "startIndex",
1134
+ "end_index": "endIndex",
1135
+ "token_count": "tokenCount",
1136
+ });
1137
+ });
1138
+
1139
+ /** @internal */
1140
+ export type ParseMetadata$Outbound = {
1141
+ start_index: number | null;
1142
+ end_index: number | null;
1143
+ token_count: number | null;
1144
+ };
1145
+
1146
+ /** @internal */
1147
+ export const ParseMetadata$outboundSchema: z.ZodType<
1148
+ ParseMetadata$Outbound,
1149
+ z.ZodTypeDef,
1150
+ ParseMetadata
1151
+ > = z.object({
1152
+ startIndex: z.nullable(z.number()),
1153
+ endIndex: z.nullable(z.number()),
1154
+ tokenCount: z.nullable(z.number()),
1155
+ }).transform((v) => {
1156
+ return remap$(v, {
1157
+ startIndex: "start_index",
1158
+ endIndex: "end_index",
1159
+ tokenCount: "token_count",
1160
+ });
1161
+ });
1162
+
1163
+ /**
1164
+ * @internal
1165
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1166
+ */
1167
+ export namespace ParseMetadata$ {
1168
+ /** @deprecated use `ParseMetadata$inboundSchema` instead. */
1169
+ export const inboundSchema = ParseMetadata$inboundSchema;
1170
+ /** @deprecated use `ParseMetadata$outboundSchema` instead. */
1171
+ export const outboundSchema = ParseMetadata$outboundSchema;
1172
+ /** @deprecated use `ParseMetadata$Outbound` instead. */
1173
+ export type Outbound = ParseMetadata$Outbound;
1174
+ }
1175
+
1176
+ export function parseMetadataToJSON(parseMetadata: ParseMetadata): string {
1177
+ return JSON.stringify(ParseMetadata$outboundSchema.parse(parseMetadata));
1178
+ }
1179
+
1180
+ export function parseMetadataFromJSON(
1181
+ jsonString: string,
1182
+ ): SafeParseResult<ParseMetadata, SDKValidationError> {
1183
+ return safeParse(
1184
+ jsonString,
1185
+ (x) => ParseMetadata$inboundSchema.parse(JSON.parse(x)),
1186
+ `Failed to parse 'ParseMetadata' from JSON`,
1187
+ );
1188
+ }
1189
+
1190
+ /** @internal */
1191
+ export const Chunks$inboundSchema: z.ZodType<Chunks, z.ZodTypeDef, unknown> = z
1192
+ .object({
1193
+ text: z.string(),
1194
+ index: z.number(),
1195
+ metadata: z.lazy(() => ParseMetadata$inboundSchema).optional(),
1196
+ });
1197
+
1198
+ /** @internal */
1199
+ export type Chunks$Outbound = {
1200
+ text: string;
1201
+ index: number;
1202
+ metadata?: ParseMetadata$Outbound | undefined;
1203
+ };
1204
+
1205
+ /** @internal */
1206
+ export const Chunks$outboundSchema: z.ZodType<
1207
+ Chunks$Outbound,
1208
+ z.ZodTypeDef,
1209
+ Chunks
1210
+ > = z.object({
1211
+ text: z.string(),
1212
+ index: z.number(),
1213
+ metadata: z.lazy(() => ParseMetadata$outboundSchema).optional(),
1214
+ });
1215
+
1216
+ /**
1217
+ * @internal
1218
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1219
+ */
1220
+ export namespace Chunks$ {
1221
+ /** @deprecated use `Chunks$inboundSchema` instead. */
1222
+ export const inboundSchema = Chunks$inboundSchema;
1223
+ /** @deprecated use `Chunks$outboundSchema` instead. */
1224
+ export const outboundSchema = Chunks$outboundSchema;
1225
+ /** @deprecated use `Chunks$Outbound` instead. */
1226
+ export type Outbound = Chunks$Outbound;
1227
+ }
1228
+
1229
+ export function chunksToJSON(chunks: Chunks): string {
1230
+ return JSON.stringify(Chunks$outboundSchema.parse(chunks));
1231
+ }
1232
+
1233
+ export function chunksFromJSON(
1234
+ jsonString: string,
1235
+ ): SafeParseResult<Chunks, SDKValidationError> {
1236
+ return safeParse(
1237
+ jsonString,
1238
+ (x) => Chunks$inboundSchema.parse(JSON.parse(x)),
1239
+ `Failed to parse 'Chunks' from JSON`,
1240
+ );
1241
+ }
1242
+
1243
+ /** @internal */
1244
+ export const ParseResponseBody$inboundSchema: z.ZodType<
1245
+ ParseResponseBody,
1246
+ z.ZodTypeDef,
1247
+ unknown
1248
+ > = z.object({
1249
+ chunks: z.array(z.lazy(() => Chunks$inboundSchema)),
1250
+ });
1251
+
1252
+ /** @internal */
1253
+ export type ParseResponseBody$Outbound = {
1254
+ chunks: Array<Chunks$Outbound>;
1255
+ };
1256
+
1257
+ /** @internal */
1258
+ export const ParseResponseBody$outboundSchema: z.ZodType<
1259
+ ParseResponseBody$Outbound,
1260
+ z.ZodTypeDef,
1261
+ ParseResponseBody
1262
+ > = z.object({
1263
+ chunks: z.array(z.lazy(() => Chunks$outboundSchema)),
1264
+ });
1265
+
1266
+ /**
1267
+ * @internal
1268
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1269
+ */
1270
+ export namespace ParseResponseBody$ {
1271
+ /** @deprecated use `ParseResponseBody$inboundSchema` instead. */
1272
+ export const inboundSchema = ParseResponseBody$inboundSchema;
1273
+ /** @deprecated use `ParseResponseBody$outboundSchema` instead. */
1274
+ export const outboundSchema = ParseResponseBody$outboundSchema;
1275
+ /** @deprecated use `ParseResponseBody$Outbound` instead. */
1276
+ export type Outbound = ParseResponseBody$Outbound;
1277
+ }
1278
+
1279
+ export function parseResponseBodyToJSON(
1280
+ parseResponseBody: ParseResponseBody,
1281
+ ): string {
1282
+ return JSON.stringify(
1283
+ ParseResponseBody$outboundSchema.parse(parseResponseBody),
1284
+ );
1285
+ }
1286
+
1287
+ export function parseResponseBodyFromJSON(
1288
+ jsonString: string,
1289
+ ): SafeParseResult<ParseResponseBody, SDKValidationError> {
1290
+ return safeParse(
1291
+ jsonString,
1292
+ (x) => ParseResponseBody$inboundSchema.parse(JSON.parse(x)),
1293
+ `Failed to parse 'ParseResponseBody' from JSON`,
1294
+ );
1295
+ }