@orq-ai/node 4.0.4 → 4.1.0-rc.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 (497) hide show
  1. package/bin/mcp-server.js +214 -217
  2. package/bin/mcp-server.js.map +39 -39
  3. package/docs/sdks/agents/README.md +8 -4
  4. package/docs/sdks/budgets/README.md +4 -2
  5. package/docs/sdks/tools/README.md +2 -2
  6. package/examples/package-lock.json +4 -7
  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 +12 -12
  22. package/models/operations/fileget.js +2 -2
  23. package/models/operations/filelist.js +2 -2
  24. package/models/operations/fileupload.js +2 -2
  25. package/models/operations/getalltools.js +12 -12
  26. package/models/operations/getbudget.js +2 -2
  27. package/models/operations/getevals.js +28 -28
  28. package/models/operations/listbudgets.js +2 -2
  29. package/models/operations/listcontacts.js +2 -2
  30. package/models/operations/listdatasetdatapoints.js +8 -8
  31. package/models/operations/listdatasets.js +2 -2
  32. package/models/operations/listdatasources.js +2 -2
  33. package/models/operations/retrievecontact.js +2 -2
  34. package/models/operations/retrievedatapoint.js +8 -8
  35. package/models/operations/retrievedataset.js +2 -2
  36. package/models/operations/retrievedatasource.js +2 -2
  37. package/models/operations/retrievetool.js +12 -12
  38. package/models/operations/runagent.js +2 -2
  39. package/models/operations/streamrunagent.js +2 -2
  40. package/models/operations/updatebudget.js +2 -2
  41. package/models/operations/updatecontact.js +2 -2
  42. package/models/operations/updatedatapoint.js +8 -8
  43. package/models/operations/updatedataset.js +2 -2
  44. package/models/operations/updatedatasource.js +2 -2
  45. package/models/operations/updateeval.js +28 -28
  46. package/models/operations/updatetool.js +14 -14
  47. package/package.json +4 -3
  48. package/src/lib/config.ts +2 -2
  49. package/src/mcp-server/mcp-server.ts +1 -1
  50. package/src/mcp-server/server.ts +1 -1
  51. package/src/models/operations/createbudget.ts +2 -2
  52. package/src/models/operations/createcontact.ts +2 -2
  53. package/src/models/operations/createdataset.ts +2 -2
  54. package/src/models/operations/createdatasetitem.ts +8 -8
  55. package/src/models/operations/createdatasource.ts +2 -2
  56. package/src/models/operations/createeval.ts +28 -28
  57. package/src/models/operations/createtool.ts +12 -12
  58. package/src/models/operations/fileget.ts +2 -2
  59. package/src/models/operations/filelist.ts +2 -2
  60. package/src/models/operations/fileupload.ts +2 -2
  61. package/src/models/operations/getalltools.ts +12 -12
  62. package/src/models/operations/getbudget.ts +2 -2
  63. package/src/models/operations/getevals.ts +28 -28
  64. package/src/models/operations/listbudgets.ts +2 -2
  65. package/src/models/operations/listcontacts.ts +2 -2
  66. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  67. package/src/models/operations/listdatasets.ts +2 -2
  68. package/src/models/operations/listdatasources.ts +2 -2
  69. package/src/models/operations/retrievecontact.ts +2 -2
  70. package/src/models/operations/retrievedatapoint.ts +8 -8
  71. package/src/models/operations/retrievedataset.ts +2 -2
  72. package/src/models/operations/retrievedatasource.ts +2 -2
  73. package/src/models/operations/retrievetool.ts +12 -12
  74. package/src/models/operations/runagent.ts +2 -2
  75. package/src/models/operations/streamrunagent.ts +2 -2
  76. package/src/models/operations/updatebudget.ts +2 -2
  77. package/src/models/operations/updatecontact.ts +2 -2
  78. package/src/models/operations/updatedatapoint.ts +8 -8
  79. package/src/models/operations/updatedataset.ts +2 -2
  80. package/src/models/operations/updatedatasource.ts +2 -2
  81. package/src/models/operations/updateeval.ts +28 -28
  82. package/src/models/operations/updatetool.ts +14 -14
  83. package/packages/orq-rc/FUNCTIONS.md +0 -103
  84. package/packages/orq-rc/README.md +0 -910
  85. package/packages/orq-rc/RUNTIMES.md +0 -48
  86. package/packages/orq-rc/docs/sdks/agents/README.md +0 -1363
  87. package/packages/orq-rc/docs/sdks/budgets/README.md +0 -401
  88. package/packages/orq-rc/docs/sdks/chunking/README.md +0 -97
  89. package/packages/orq-rc/docs/sdks/contacts/README.md +0 -450
  90. package/packages/orq-rc/docs/sdks/datasets/README.md +0 -836
  91. package/packages/orq-rc/docs/sdks/deployments/README.md +0 -312
  92. package/packages/orq-rc/docs/sdks/evals/README.md +0 -339
  93. package/packages/orq-rc/docs/sdks/feedback/README.md +0 -89
  94. package/packages/orq-rc/docs/sdks/files/README.md +0 -301
  95. package/packages/orq-rc/docs/sdks/knowledge/README.md +0 -1487
  96. package/packages/orq-rc/docs/sdks/memorystores/README.md +0 -1171
  97. package/packages/orq-rc/docs/sdks/metrics/README.md +0 -83
  98. package/packages/orq-rc/docs/sdks/models/README.md +0 -76
  99. package/packages/orq-rc/docs/sdks/prompts/README.md +0 -591
  100. package/packages/orq-rc/docs/sdks/remoteconfigs/README.md +0 -77
  101. package/packages/orq-rc/docs/sdks/responses/README.md +0 -139
  102. package/packages/orq-rc/docs/sdks/tools/README.md +0 -420
  103. package/packages/orq-rc/examples/README.md +0 -31
  104. package/packages/orq-rc/examples/contactsCreate.example.ts +0 -42
  105. package/packages/orq-rc/examples/package-lock.json +0 -619
  106. package/packages/orq-rc/examples/package.json +0 -18
  107. package/packages/orq-rc/jsr.json +0 -28
  108. package/packages/orq-rc/package-lock.json +0 -3047
  109. package/packages/orq-rc/package.json +0 -40
  110. package/packages/orq-rc/src/core.ts +0 -13
  111. package/packages/orq-rc/src/funcs/agentsCreate.ts +0 -172
  112. package/packages/orq-rc/src/funcs/agentsDelete.ts +0 -176
  113. package/packages/orq-rc/src/funcs/agentsInvoke.ts +0 -167
  114. package/packages/orq-rc/src/funcs/agentsList.ts +0 -167
  115. package/packages/orq-rc/src/funcs/agentsListActions.ts +0 -169
  116. package/packages/orq-rc/src/funcs/agentsListTasks.ts +0 -183
  117. package/packages/orq-rc/src/funcs/agentsResponsesCreate.ts +0 -168
  118. package/packages/orq-rc/src/funcs/agentsRetrieve.ts +0 -175
  119. package/packages/orq-rc/src/funcs/agentsRetrieveAction.ts +0 -173
  120. package/packages/orq-rc/src/funcs/agentsRetrieveTask.ts +0 -179
  121. package/packages/orq-rc/src/funcs/agentsRun.ts +0 -163
  122. package/packages/orq-rc/src/funcs/agentsStream.ts +0 -191
  123. package/packages/orq-rc/src/funcs/agentsStreamRun.ts +0 -189
  124. package/packages/orq-rc/src/funcs/agentsUpdate.ts +0 -176
  125. package/packages/orq-rc/src/funcs/budgetsCreate.ts +0 -160
  126. package/packages/orq-rc/src/funcs/budgetsDelete.ts +0 -167
  127. package/packages/orq-rc/src/funcs/budgetsGet.ts +0 -166
  128. package/packages/orq-rc/src/funcs/budgetsList.ts +0 -170
  129. package/packages/orq-rc/src/funcs/budgetsUpdate.ts +0 -167
  130. package/packages/orq-rc/src/funcs/chunkingParse.ts +0 -160
  131. package/packages/orq-rc/src/funcs/contactsCreate.ts +0 -165
  132. package/packages/orq-rc/src/funcs/contactsDelete.ts +0 -176
  133. package/packages/orq-rc/src/funcs/contactsList.ts +0 -169
  134. package/packages/orq-rc/src/funcs/contactsRetrieve.ts +0 -175
  135. package/packages/orq-rc/src/funcs/contactsUpdate.ts +0 -176
  136. package/packages/orq-rc/src/funcs/datasetsClear.ts +0 -167
  137. package/packages/orq-rc/src/funcs/datasetsCreate.ts +0 -165
  138. package/packages/orq-rc/src/funcs/datasetsCreateDatapoint.ts +0 -171
  139. package/packages/orq-rc/src/funcs/datasetsDelete.ts +0 -167
  140. package/packages/orq-rc/src/funcs/datasetsDeleteDatapoint.ts +0 -182
  141. package/packages/orq-rc/src/funcs/datasetsList.ts +0 -167
  142. package/packages/orq-rc/src/funcs/datasetsListDatapoints.ts +0 -174
  143. package/packages/orq-rc/src/funcs/datasetsRetrieve.ts +0 -175
  144. package/packages/orq-rc/src/funcs/datasetsRetrieveDatapoint.ts +0 -181
  145. package/packages/orq-rc/src/funcs/datasetsUpdate.ts +0 -176
  146. package/packages/orq-rc/src/funcs/datasetsUpdateDatapoint.ts +0 -179
  147. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +0 -168
  148. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +0 -176
  149. package/packages/orq-rc/src/funcs/deploymentsList.ts +0 -176
  150. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +0 -168
  151. package/packages/orq-rc/src/funcs/deploymentsStream.ts +0 -183
  152. package/packages/orq-rc/src/funcs/evalsAll.ts +0 -173
  153. package/packages/orq-rc/src/funcs/evalsCreate.ts +0 -169
  154. package/packages/orq-rc/src/funcs/evalsDelete.ts +0 -173
  155. package/packages/orq-rc/src/funcs/evalsUpdate.ts +0 -173
  156. package/packages/orq-rc/src/funcs/feedbackCreate.ts +0 -160
  157. package/packages/orq-rc/src/funcs/filesCreate.ts +0 -187
  158. package/packages/orq-rc/src/funcs/filesDelete.ts +0 -164
  159. package/packages/orq-rc/src/funcs/filesGet.ts +0 -166
  160. package/packages/orq-rc/src/funcs/filesList.ts +0 -167
  161. package/packages/orq-rc/src/funcs/knowledgeCreate.ts +0 -158
  162. package/packages/orq-rc/src/funcs/knowledgeCreateChunks.ts +0 -171
  163. package/packages/orq-rc/src/funcs/knowledgeCreateDatasource.ts +0 -166
  164. package/packages/orq-rc/src/funcs/knowledgeDelete.ts +0 -167
  165. package/packages/orq-rc/src/funcs/knowledgeDeleteChunk.ts +0 -174
  166. package/packages/orq-rc/src/funcs/knowledgeDeleteChunks.ts +0 -170
  167. package/packages/orq-rc/src/funcs/knowledgeDeleteDatasource.ts +0 -173
  168. package/packages/orq-rc/src/funcs/knowledgeGetChunksCount.ts +0 -170
  169. package/packages/orq-rc/src/funcs/knowledgeList.ts +0 -169
  170. package/packages/orq-rc/src/funcs/knowledgeListChunks.ts +0 -178
  171. package/packages/orq-rc/src/funcs/knowledgeListChunksPaginated.ts +0 -171
  172. package/packages/orq-rc/src/funcs/knowledgeListDatasources.ts +0 -174
  173. package/packages/orq-rc/src/funcs/knowledgeRetrieve.ts +0 -166
  174. package/packages/orq-rc/src/funcs/knowledgeRetrieveChunk.ts +0 -173
  175. package/packages/orq-rc/src/funcs/knowledgeRetrieveDatasource.ts +0 -169
  176. package/packages/orq-rc/src/funcs/knowledgeSearch.ts +0 -167
  177. package/packages/orq-rc/src/funcs/knowledgeUpdate.ts +0 -164
  178. package/packages/orq-rc/src/funcs/knowledgeUpdateChunk.ts +0 -174
  179. package/packages/orq-rc/src/funcs/knowledgeUpdateDatasource.ts +0 -170
  180. package/packages/orq-rc/src/funcs/memoryStoresCreate.ts +0 -162
  181. package/packages/orq-rc/src/funcs/memoryStoresCreateDocument.ts +0 -175
  182. package/packages/orq-rc/src/funcs/memoryStoresCreateMemory.ts +0 -170
  183. package/packages/orq-rc/src/funcs/memoryStoresDelete.ts +0 -168
  184. package/packages/orq-rc/src/funcs/memoryStoresDeleteDocument.ts +0 -184
  185. package/packages/orq-rc/src/funcs/memoryStoresDeleteMemory.ts +0 -179
  186. package/packages/orq-rc/src/funcs/memoryStoresList.ts +0 -178
  187. package/packages/orq-rc/src/funcs/memoryStoresListDocuments.ts +0 -181
  188. package/packages/orq-rc/src/funcs/memoryStoresListMemories.ts +0 -176
  189. package/packages/orq-rc/src/funcs/memoryStoresRetrieve.ts +0 -177
  190. package/packages/orq-rc/src/funcs/memoryStoresRetrieveDocument.ts +0 -178
  191. package/packages/orq-rc/src/funcs/memoryStoresRetrieveMemory.ts +0 -173
  192. package/packages/orq-rc/src/funcs/memoryStoresUpdate.ts +0 -168
  193. package/packages/orq-rc/src/funcs/memoryStoresUpdateDocument.ts +0 -179
  194. package/packages/orq-rc/src/funcs/memoryStoresUpdateMemory.ts +0 -174
  195. package/packages/orq-rc/src/funcs/modelsList.ts +0 -142
  196. package/packages/orq-rc/src/funcs/promptsCreate.ts +0 -160
  197. package/packages/orq-rc/src/funcs/promptsDelete.ts +0 -164
  198. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +0 -181
  199. package/packages/orq-rc/src/funcs/promptsList.ts +0 -167
  200. package/packages/orq-rc/src/funcs/promptsListVersions.ts +0 -173
  201. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +0 -166
  202. package/packages/orq-rc/src/funcs/promptsUpdate.ts +0 -173
  203. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +0 -161
  204. package/packages/orq-rc/src/funcs/toolsCreate.ts +0 -172
  205. package/packages/orq-rc/src/funcs/toolsDelete.ts +0 -167
  206. package/packages/orq-rc/src/funcs/toolsList.ts +0 -176
  207. package/packages/orq-rc/src/funcs/toolsRetrieve.ts +0 -166
  208. package/packages/orq-rc/src/funcs/toolsUpdate.ts +0 -176
  209. package/packages/orq-rc/src/hooks/global.ts +0 -44
  210. package/packages/orq-rc/src/hooks/hooks.ts +0 -132
  211. package/packages/orq-rc/src/hooks/index.ts +0 -6
  212. package/packages/orq-rc/src/hooks/registration.ts +0 -15
  213. package/packages/orq-rc/src/hooks/types.ts +0 -112
  214. package/packages/orq-rc/src/index.ts +0 -9
  215. package/packages/orq-rc/src/lib/base64.ts +0 -37
  216. package/packages/orq-rc/src/lib/config.ts +0 -74
  217. package/packages/orq-rc/src/lib/dlv.ts +0 -53
  218. package/packages/orq-rc/src/lib/encodings.ts +0 -483
  219. package/packages/orq-rc/src/lib/env.ts +0 -89
  220. package/packages/orq-rc/src/lib/event-streams.ts +0 -135
  221. package/packages/orq-rc/src/lib/files.ts +0 -82
  222. package/packages/orq-rc/src/lib/http.ts +0 -323
  223. package/packages/orq-rc/src/lib/is-plain-object.ts +0 -43
  224. package/packages/orq-rc/src/lib/logger.ts +0 -9
  225. package/packages/orq-rc/src/lib/matchers.ts +0 -345
  226. package/packages/orq-rc/src/lib/primitives.ts +0 -150
  227. package/packages/orq-rc/src/lib/retries.ts +0 -218
  228. package/packages/orq-rc/src/lib/schemas.ts +0 -91
  229. package/packages/orq-rc/src/lib/sdks.ts +0 -407
  230. package/packages/orq-rc/src/lib/security.ts +0 -264
  231. package/packages/orq-rc/src/lib/url.ts +0 -33
  232. package/packages/orq-rc/src/mcp-server/cli/start/command.ts +0 -111
  233. package/packages/orq-rc/src/mcp-server/cli/start/impl.ts +0 -136
  234. package/packages/orq-rc/src/mcp-server/cli.ts +0 -13
  235. package/packages/orq-rc/src/mcp-server/console-logger.ts +0 -71
  236. package/packages/orq-rc/src/mcp-server/extensions.ts +0 -17
  237. package/packages/orq-rc/src/mcp-server/mcp-server.ts +0 -26
  238. package/packages/orq-rc/src/mcp-server/prompts.ts +0 -117
  239. package/packages/orq-rc/src/mcp-server/resources.ts +0 -172
  240. package/packages/orq-rc/src/mcp-server/scopes.ts +0 -7
  241. package/packages/orq-rc/src/mcp-server/server.ts +0 -259
  242. package/packages/orq-rc/src/mcp-server/shared.ts +0 -74
  243. package/packages/orq-rc/src/mcp-server/tools/agentsCreate.ts +0 -37
  244. package/packages/orq-rc/src/mcp-server/tools/agentsDelete.ts +0 -35
  245. package/packages/orq-rc/src/mcp-server/tools/agentsInvoke.ts +0 -37
  246. package/packages/orq-rc/src/mcp-server/tools/agentsList.ts +0 -37
  247. package/packages/orq-rc/src/mcp-server/tools/agentsListActions.ts +0 -35
  248. package/packages/orq-rc/src/mcp-server/tools/agentsListTasks.ts +0 -37
  249. package/packages/orq-rc/src/mcp-server/tools/agentsResponsesCreate.ts +0 -37
  250. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieve.ts +0 -37
  251. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveAction.ts +0 -35
  252. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveTask.ts +0 -37
  253. package/packages/orq-rc/src/mcp-server/tools/agentsRun.ts +0 -37
  254. package/packages/orq-rc/src/mcp-server/tools/agentsStream.ts +0 -37
  255. package/packages/orq-rc/src/mcp-server/tools/agentsStreamRun.ts +0 -37
  256. package/packages/orq-rc/src/mcp-server/tools/agentsUpdate.ts +0 -37
  257. package/packages/orq-rc/src/mcp-server/tools/budgetsCreate.ts +0 -37
  258. package/packages/orq-rc/src/mcp-server/tools/budgetsDelete.ts +0 -35
  259. package/packages/orq-rc/src/mcp-server/tools/budgetsGet.ts +0 -37
  260. package/packages/orq-rc/src/mcp-server/tools/budgetsList.ts +0 -37
  261. package/packages/orq-rc/src/mcp-server/tools/budgetsUpdate.ts +0 -37
  262. package/packages/orq-rc/src/mcp-server/tools/chunkingParse.ts +0 -37
  263. package/packages/orq-rc/src/mcp-server/tools/contactsCreate.ts +0 -37
  264. package/packages/orq-rc/src/mcp-server/tools/contactsDelete.ts +0 -35
  265. package/packages/orq-rc/src/mcp-server/tools/contactsList.ts +0 -37
  266. package/packages/orq-rc/src/mcp-server/tools/contactsRetrieve.ts +0 -37
  267. package/packages/orq-rc/src/mcp-server/tools/contactsUpdate.ts +0 -37
  268. package/packages/orq-rc/src/mcp-server/tools/datasetsClear.ts +0 -35
  269. package/packages/orq-rc/src/mcp-server/tools/datasetsCreate.ts +0 -37
  270. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateDatapoint.ts +0 -37
  271. package/packages/orq-rc/src/mcp-server/tools/datasetsDelete.ts +0 -35
  272. package/packages/orq-rc/src/mcp-server/tools/datasetsDeleteDatapoint.ts +0 -35
  273. package/packages/orq-rc/src/mcp-server/tools/datasetsList.ts +0 -37
  274. package/packages/orq-rc/src/mcp-server/tools/datasetsListDatapoints.ts +0 -37
  275. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieve.ts +0 -37
  276. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieveDatapoint.ts +0 -37
  277. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdate.ts +0 -37
  278. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdateDatapoint.ts +0 -35
  279. package/packages/orq-rc/src/mcp-server/tools/deploymentsGetConfig.ts +0 -37
  280. package/packages/orq-rc/src/mcp-server/tools/deploymentsInvoke.ts +0 -37
  281. package/packages/orq-rc/src/mcp-server/tools/deploymentsList.ts +0 -37
  282. package/packages/orq-rc/src/mcp-server/tools/deploymentsMetricsCreate.ts +0 -37
  283. package/packages/orq-rc/src/mcp-server/tools/deploymentsStream.ts +0 -37
  284. package/packages/orq-rc/src/mcp-server/tools/evalsAll.ts +0 -35
  285. package/packages/orq-rc/src/mcp-server/tools/evalsCreate.ts +0 -35
  286. package/packages/orq-rc/src/mcp-server/tools/evalsDelete.ts +0 -33
  287. package/packages/orq-rc/src/mcp-server/tools/evalsUpdate.ts +0 -35
  288. package/packages/orq-rc/src/mcp-server/tools/feedbackCreate.ts +0 -37
  289. package/packages/orq-rc/src/mcp-server/tools/filesCreate.ts +0 -37
  290. package/packages/orq-rc/src/mcp-server/tools/filesDelete.ts +0 -33
  291. package/packages/orq-rc/src/mcp-server/tools/filesGet.ts +0 -37
  292. package/packages/orq-rc/src/mcp-server/tools/filesList.ts +0 -37
  293. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreate.ts +0 -35
  294. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateChunks.ts +0 -35
  295. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateDatasource.ts +0 -35
  296. package/packages/orq-rc/src/mcp-server/tools/knowledgeDelete.ts +0 -35
  297. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteChunk.ts +0 -33
  298. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteChunks.ts +0 -35
  299. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteDatasource.ts +0 -35
  300. package/packages/orq-rc/src/mcp-server/tools/knowledgeGetChunksCount.ts +0 -35
  301. package/packages/orq-rc/src/mcp-server/tools/knowledgeList.ts +0 -37
  302. package/packages/orq-rc/src/mcp-server/tools/knowledgeListChunks.ts +0 -35
  303. package/packages/orq-rc/src/mcp-server/tools/knowledgeListChunksPaginated.ts +0 -35
  304. package/packages/orq-rc/src/mcp-server/tools/knowledgeListDatasources.ts +0 -35
  305. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieve.ts +0 -37
  306. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveChunk.ts +0 -35
  307. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveDatasource.ts +0 -35
  308. package/packages/orq-rc/src/mcp-server/tools/knowledgeSearch.ts +0 -37
  309. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdate.ts +0 -35
  310. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateChunk.ts +0 -35
  311. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateDatasource.ts +0 -35
  312. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreate.ts +0 -35
  313. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreateDocument.ts +0 -37
  314. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreateMemory.ts +0 -37
  315. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDelete.ts +0 -35
  316. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDeleteDocument.ts +0 -40
  317. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDeleteMemory.ts +0 -40
  318. package/packages/orq-rc/src/mcp-server/tools/memoryStoresList.ts +0 -37
  319. package/packages/orq-rc/src/mcp-server/tools/memoryStoresListDocuments.ts +0 -37
  320. package/packages/orq-rc/src/mcp-server/tools/memoryStoresListMemories.ts +0 -37
  321. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieve.ts +0 -37
  322. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieveDocument.ts +0 -37
  323. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieveMemory.ts +0 -37
  324. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdate.ts +0 -37
  325. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdateDocument.ts +0 -37
  326. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdateMemory.ts +0 -37
  327. package/packages/orq-rc/src/mcp-server/tools/modelsList.ts +0 -30
  328. package/packages/orq-rc/src/mcp-server/tools/promptsCreate.ts +0 -35
  329. package/packages/orq-rc/src/mcp-server/tools/promptsDelete.ts +0 -33
  330. package/packages/orq-rc/src/mcp-server/tools/promptsGetVersion.ts +0 -37
  331. package/packages/orq-rc/src/mcp-server/tools/promptsList.ts +0 -37
  332. package/packages/orq-rc/src/mcp-server/tools/promptsListVersions.ts +0 -37
  333. package/packages/orq-rc/src/mcp-server/tools/promptsRetrieve.ts +0 -37
  334. package/packages/orq-rc/src/mcp-server/tools/promptsUpdate.ts +0 -35
  335. package/packages/orq-rc/src/mcp-server/tools/remoteconfigsRetrieve.ts +0 -36
  336. package/packages/orq-rc/src/mcp-server/tools/toolsCreate.ts +0 -37
  337. package/packages/orq-rc/src/mcp-server/tools/toolsDelete.ts +0 -35
  338. package/packages/orq-rc/src/mcp-server/tools/toolsList.ts +0 -37
  339. package/packages/orq-rc/src/mcp-server/tools/toolsRetrieve.ts +0 -37
  340. package/packages/orq-rc/src/mcp-server/tools/toolsUpdate.ts +0 -37
  341. package/packages/orq-rc/src/mcp-server/tools.ts +0 -129
  342. package/packages/orq-rc/src/models/components/index.ts +0 -6
  343. package/packages/orq-rc/src/models/components/invokedeploymentrequest.ts +0 -6261
  344. package/packages/orq-rc/src/models/components/security.ts +0 -56
  345. package/packages/orq-rc/src/models/errors/apierror.ts +0 -40
  346. package/packages/orq-rc/src/models/errors/createagent.ts +0 -67
  347. package/packages/orq-rc/src/models/errors/createeval.ts +0 -67
  348. package/packages/orq-rc/src/models/errors/deleteagent.ts +0 -67
  349. package/packages/orq-rc/src/models/errors/deletecontact.ts +0 -78
  350. package/packages/orq-rc/src/models/errors/deleteeval.ts +0 -67
  351. package/packages/orq-rc/src/models/errors/getagent.ts +0 -67
  352. package/packages/orq-rc/src/models/errors/getevals.ts +0 -67
  353. package/packages/orq-rc/src/models/errors/getpromptversion.ts +0 -67
  354. package/packages/orq-rc/src/models/errors/honoapierror.ts +0 -77
  355. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +0 -62
  356. package/packages/orq-rc/src/models/errors/index.ts +0 -27
  357. package/packages/orq-rc/src/models/errors/listagenttasks.ts +0 -67
  358. package/packages/orq-rc/src/models/errors/orqerror.ts +0 -35
  359. package/packages/orq-rc/src/models/errors/responsevalidationerror.ts +0 -50
  360. package/packages/orq-rc/src/models/errors/retrievecontact.ts +0 -78
  361. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +0 -109
  362. package/packages/orq-rc/src/models/errors/streamagent.ts +0 -67
  363. package/packages/orq-rc/src/models/errors/streamrunagent.ts +0 -67
  364. package/packages/orq-rc/src/models/errors/updateagent.ts +0 -67
  365. package/packages/orq-rc/src/models/errors/updatecontact.ts +0 -70
  366. package/packages/orq-rc/src/models/errors/updateeval.ts +0 -67
  367. package/packages/orq-rc/src/models/errors/updateprompt.ts +0 -67
  368. package/packages/orq-rc/src/models/errors/updatetool.ts +0 -78
  369. package/packages/orq-rc/src/models/operations/cleardataset.ts +0 -63
  370. package/packages/orq-rc/src/models/operations/createagent.ts +0 -8057
  371. package/packages/orq-rc/src/models/operations/createagentresponse.ts +0 -1339
  372. package/packages/orq-rc/src/models/operations/createbudget.ts +0 -582
  373. package/packages/orq-rc/src/models/operations/createchunk.ts +0 -341
  374. package/packages/orq-rc/src/models/operations/createcontact.ts +0 -237
  375. package/packages/orq-rc/src/models/operations/createdataset.ts +0 -257
  376. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +0 -5379
  377. package/packages/orq-rc/src/models/operations/createdatasource.ts +0 -694
  378. package/packages/orq-rc/src/models/operations/createeval.ts +0 -6857
  379. package/packages/orq-rc/src/models/operations/createfeedback.ts +0 -226
  380. package/packages/orq-rc/src/models/operations/createknowledge.ts +0 -1489
  381. package/packages/orq-rc/src/models/operations/creatememory.ts +0 -229
  382. package/packages/orq-rc/src/models/operations/creatememorydocument.ts +0 -242
  383. package/packages/orq-rc/src/models/operations/creatememorystore.ts +0 -310
  384. package/packages/orq-rc/src/models/operations/createprompt.ts +0 -6179
  385. package/packages/orq-rc/src/models/operations/createtool.ts +0 -3956
  386. package/packages/orq-rc/src/models/operations/deleteagent.ts +0 -63
  387. package/packages/orq-rc/src/models/operations/deletebudget.ts +0 -54
  388. package/packages/orq-rc/src/models/operations/deletechunk.ts +0 -81
  389. package/packages/orq-rc/src/models/operations/deletechunks.ts +0 -198
  390. package/packages/orq-rc/src/models/operations/deletecontact.ts +0 -54
  391. package/packages/orq-rc/src/models/operations/deletedatapoint.ts +0 -72
  392. package/packages/orq-rc/src/models/operations/deletedataset.ts +0 -63
  393. package/packages/orq-rc/src/models/operations/deletedatasource.ts +0 -72
  394. package/packages/orq-rc/src/models/operations/deleteeval.ts +0 -51
  395. package/packages/orq-rc/src/models/operations/deleteknowledge.ts +0 -63
  396. package/packages/orq-rc/src/models/operations/deletememory.ts +0 -72
  397. package/packages/orq-rc/src/models/operations/deletememorydocument.ts +0 -83
  398. package/packages/orq-rc/src/models/operations/deletememorystore.ts +0 -63
  399. package/packages/orq-rc/src/models/operations/deleteprompt.ts +0 -54
  400. package/packages/orq-rc/src/models/operations/deletetool.ts +0 -60
  401. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +0 -5091
  402. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +0 -8055
  403. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +0 -980
  404. package/packages/orq-rc/src/models/operations/deployments.ts +0 -2054
  405. package/packages/orq-rc/src/models/operations/deploymentstream.ts +0 -8269
  406. package/packages/orq-rc/src/models/operations/filedelete.ts +0 -63
  407. package/packages/orq-rc/src/models/operations/fileget.ts +0 -181
  408. package/packages/orq-rc/src/models/operations/filelist.ts +0 -268
  409. package/packages/orq-rc/src/models/operations/fileupload.ts +0 -258
  410. package/packages/orq-rc/src/models/operations/getagent.ts +0 -3480
  411. package/packages/orq-rc/src/models/operations/getagenttask.ts +0 -2389
  412. package/packages/orq-rc/src/models/operations/getallmemories.ts +0 -261
  413. package/packages/orq-rc/src/models/operations/getallmemorydocuments.ts +0 -280
  414. package/packages/orq-rc/src/models/operations/getallmemorystores.ts +0 -325
  415. package/packages/orq-rc/src/models/operations/getallprompts.ts +0 -2033
  416. package/packages/orq-rc/src/models/operations/getalltools.ts +0 -2292
  417. package/packages/orq-rc/src/models/operations/getbudget.ts +0 -357
  418. package/packages/orq-rc/src/models/operations/getchunkscount.ts +0 -185
  419. package/packages/orq-rc/src/models/operations/getevals.ts +0 -5543
  420. package/packages/orq-rc/src/models/operations/getonechunk.ts +0 -258
  421. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +0 -1070
  422. package/packages/orq-rc/src/models/operations/getoneprompt.ts +0 -1924
  423. package/packages/orq-rc/src/models/operations/getpromptversion.ts +0 -1942
  424. package/packages/orq-rc/src/models/operations/index.ts +0 -102
  425. package/packages/orq-rc/src/models/operations/invokeagent.ts +0 -1930
  426. package/packages/orq-rc/src/models/operations/listactions.ts +0 -427
  427. package/packages/orq-rc/src/models/operations/listagents.ts +0 -3626
  428. package/packages/orq-rc/src/models/operations/listagenttasks.ts +0 -2614
  429. package/packages/orq-rc/src/models/operations/listbudgets.ts +0 -494
  430. package/packages/orq-rc/src/models/operations/listchunks.ts +0 -395
  431. package/packages/orq-rc/src/models/operations/listchunkspaginated.ts +0 -408
  432. package/packages/orq-rc/src/models/operations/listcontacts.ts +0 -413
  433. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +0 -3169
  434. package/packages/orq-rc/src/models/operations/listdatasets.ts +0 -334
  435. package/packages/orq-rc/src/models/operations/listdatasources.ts +0 -363
  436. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +0 -1068
  437. package/packages/orq-rc/src/models/operations/listmodels.ts +0 -207
  438. package/packages/orq-rc/src/models/operations/listpromptversions.ts +0 -2041
  439. package/packages/orq-rc/src/models/operations/parse.ts +0 -1013
  440. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +0 -146
  441. package/packages/orq-rc/src/models/operations/retrieveaction.ts +0 -354
  442. package/packages/orq-rc/src/models/operations/retrievecontact.ts +0 -180
  443. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +0 -2985
  444. package/packages/orq-rc/src/models/operations/retrievedataset.ts +0 -246
  445. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +0 -231
  446. package/packages/orq-rc/src/models/operations/retrievememory.ts +0 -171
  447. package/packages/orq-rc/src/models/operations/retrievememorydocument.ts +0 -189
  448. package/packages/orq-rc/src/models/operations/retrievememorystore.ts +0 -234
  449. package/packages/orq-rc/src/models/operations/retrievetool.ts +0 -2347
  450. package/packages/orq-rc/src/models/operations/runagent.ts +0 -7617
  451. package/packages/orq-rc/src/models/operations/searchknowledge.ts +0 -2775
  452. package/packages/orq-rc/src/models/operations/streamagent.ts +0 -9732
  453. package/packages/orq-rc/src/models/operations/streamrunagent.ts +0 -15831
  454. package/packages/orq-rc/src/models/operations/updateagent.ts +0 -8649
  455. package/packages/orq-rc/src/models/operations/updatebudget.ts +0 -502
  456. package/packages/orq-rc/src/models/operations/updatechunk.ts +0 -361
  457. package/packages/orq-rc/src/models/operations/updatecontact.ts +0 -280
  458. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +0 -5374
  459. package/packages/orq-rc/src/models/operations/updatedataset.ts +0 -326
  460. package/packages/orq-rc/src/models/operations/updatedatasource.ts +0 -288
  461. package/packages/orq-rc/src/models/operations/updateeval.ts +0 -7197
  462. package/packages/orq-rc/src/models/operations/updateknowledge.ts +0 -1925
  463. package/packages/orq-rc/src/models/operations/updatememory.ts +0 -238
  464. package/packages/orq-rc/src/models/operations/updatememorydocument.ts +0 -251
  465. package/packages/orq-rc/src/models/operations/updatememorystore.ts +0 -463
  466. package/packages/orq-rc/src/models/operations/updateprompt.ts +0 -6410
  467. package/packages/orq-rc/src/models/operations/updatetool.ts +0 -4279
  468. package/packages/orq-rc/src/sdk/agents.ts +0 -244
  469. package/packages/orq-rc/src/sdk/budgets.ts +0 -99
  470. package/packages/orq-rc/src/sdk/chunking.ts +0 -27
  471. package/packages/orq-rc/src/sdk/contacts.ts +0 -99
  472. package/packages/orq-rc/src/sdk/datasets.ts +0 -204
  473. package/packages/orq-rc/src/sdk/deployments.ts +0 -89
  474. package/packages/orq-rc/src/sdk/evals.ts +0 -69
  475. package/packages/orq-rc/src/sdk/feedback.ts +0 -27
  476. package/packages/orq-rc/src/sdk/files.ts +0 -78
  477. package/packages/orq-rc/src/sdk/index.ts +0 -5
  478. package/packages/orq-rc/src/sdk/knowledge.ts +0 -309
  479. package/packages/orq-rc/src/sdk/memorystores.ts +0 -286
  480. package/packages/orq-rc/src/sdk/metrics.ts +0 -27
  481. package/packages/orq-rc/src/sdk/models.ts +0 -25
  482. package/packages/orq-rc/src/sdk/prompts.ts +0 -126
  483. package/packages/orq-rc/src/sdk/remoteconfigs.ts +0 -24
  484. package/packages/orq-rc/src/sdk/responses.ts +0 -27
  485. package/packages/orq-rc/src/sdk/sdk.ts +0 -97
  486. package/packages/orq-rc/src/sdk/tools.ts +0 -99
  487. package/packages/orq-rc/src/types/async.ts +0 -68
  488. package/packages/orq-rc/src/types/blobs.ts +0 -32
  489. package/packages/orq-rc/src/types/constdatetime.ts +0 -15
  490. package/packages/orq-rc/src/types/enums.ts +0 -45
  491. package/packages/orq-rc/src/types/fp.ts +0 -50
  492. package/packages/orq-rc/src/types/index.ts +0 -11
  493. package/packages/orq-rc/src/types/operations.ts +0 -105
  494. package/packages/orq-rc/src/types/rfcdate.ts +0 -54
  495. package/packages/orq-rc/src/types/streams.ts +0 -21
  496. package/packages/orq-rc/src/types/unrecognized.ts +0 -27
  497. package/packages/orq-rc/tsconfig.json +0 -41
@@ -1,1013 +0,0 @@
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
- * Number of dimensions for the embedding output. Required for text-embedding-3 models. Supported range: 256-3072 for text-embedding-3-large, 256-1536 for text-embedding-3-small.
138
- */
139
- dimensions?: number | undefined;
140
- /**
141
- * Maximum number of tokens per embedding request. Default is 8191 for text-embedding-3 models.
142
- */
143
- maxTokens?: number | undefined;
144
- /**
145
- * Chunking mode: window-based or sentence-based similarity
146
- */
147
- mode?: Mode | undefined;
148
- /**
149
- * Window size for similarity comparison
150
- */
151
- similarityWindow?: number | undefined;
152
- };
153
-
154
- /**
155
- * Return format: chunks (with metadata) or texts (plain strings)
156
- */
157
- export const ParseChunkingRequestReturnType = {
158
- Chunks: "chunks",
159
- Texts: "texts",
160
- } as const;
161
- /**
162
- * Return format: chunks (with metadata) or texts (plain strings)
163
- */
164
- export type ParseChunkingRequestReturnType = ClosedEnum<
165
- typeof ParseChunkingRequestReturnType
166
- >;
167
-
168
- export const RecursiveChunker = {
169
- Recursive: "recursive",
170
- } as const;
171
- export type RecursiveChunker = ClosedEnum<typeof RecursiveChunker>;
172
-
173
- /**
174
- * Recursively splits text using a hierarchy of separators (paragraphs, sentences, words). Versatile general-purpose chunker that preserves document structure.
175
- */
176
- export type RecursiveChunkerStrategy = {
177
- /**
178
- * The text content to be chunked
179
- */
180
- text: string;
181
- /**
182
- * Whether to include metadata for each chunk
183
- */
184
- metadata?: boolean | undefined;
185
- /**
186
- * Return format: chunks (with metadata) or texts (plain strings)
187
- */
188
- returnType?: ParseChunkingRequestReturnType | undefined;
189
- strategy: RecursiveChunker;
190
- /**
191
- * Maximum tokens per chunk
192
- */
193
- chunkSize?: number | undefined;
194
- /**
195
- * Hierarchy of separators to use for splitting
196
- */
197
- separators?: Array<string> | undefined;
198
- /**
199
- * Minimum characters allowed per chunk
200
- */
201
- minCharactersPerChunk?: number | undefined;
202
- };
203
-
204
- /**
205
- * Return format: chunks (with metadata) or texts (plain strings)
206
- */
207
- export const ChunkingRequestReturnType = {
208
- Chunks: "chunks",
209
- Texts: "texts",
210
- } as const;
211
- /**
212
- * Return format: chunks (with metadata) or texts (plain strings)
213
- */
214
- export type ChunkingRequestReturnType = ClosedEnum<
215
- typeof ChunkingRequestReturnType
216
- >;
217
-
218
- export const SentenceChunker = {
219
- Sentence: "sentence",
220
- } as const;
221
- export type SentenceChunker = ClosedEnum<typeof SentenceChunker>;
222
-
223
- /**
224
- * Splits text at sentence boundaries while respecting token limits. Ideal for maintaining semantic coherence and readability.
225
- */
226
- export type SentenceChunkerStrategy = {
227
- /**
228
- * The text content to be chunked
229
- */
230
- text: string;
231
- /**
232
- * Whether to include metadata for each chunk
233
- */
234
- metadata?: boolean | undefined;
235
- /**
236
- * Return format: chunks (with metadata) or texts (plain strings)
237
- */
238
- returnType?: ChunkingRequestReturnType | undefined;
239
- strategy: SentenceChunker;
240
- /**
241
- * Maximum tokens per chunk
242
- */
243
- chunkSize?: number | undefined;
244
- /**
245
- * Number of overlapping tokens between chunks
246
- */
247
- chunkOverlap?: number | undefined;
248
- /**
249
- * Minimum number of sentences per chunk
250
- */
251
- minSentencesPerChunk?: number | undefined;
252
- };
253
-
254
- /**
255
- * Return format: chunks (with metadata) or texts (plain strings)
256
- */
257
- export const ReturnTypeT = {
258
- Chunks: "chunks",
259
- Texts: "texts",
260
- } as const;
261
- /**
262
- * Return format: chunks (with metadata) or texts (plain strings)
263
- */
264
- export type ReturnTypeT = ClosedEnum<typeof ReturnTypeT>;
265
-
266
- export const TokenChunker = {
267
- Token: "token",
268
- } as const;
269
- export type TokenChunker = ClosedEnum<typeof TokenChunker>;
270
-
271
- /**
272
- * Splits text based on token count. Best for ensuring chunks fit within LLM context windows and maintaining consistent chunk sizes for embedding models.
273
- */
274
- export type TokenChunkerStrategy = {
275
- /**
276
- * The text content to be chunked
277
- */
278
- text: string;
279
- /**
280
- * Whether to include metadata for each chunk
281
- */
282
- metadata?: boolean | undefined;
283
- /**
284
- * Return format: chunks (with metadata) or texts (plain strings)
285
- */
286
- returnType?: ReturnTypeT | undefined;
287
- strategy: TokenChunker;
288
- /**
289
- * Maximum tokens per chunk
290
- */
291
- chunkSize?: number | undefined;
292
- /**
293
- * Number of tokens to overlap between chunks
294
- */
295
- chunkOverlap?: number | undefined;
296
- };
297
-
298
- /**
299
- * Request payload for text chunking with strategy-specific configuration
300
- */
301
- export type ParseChunkingRequest =
302
- | SemanticChunkerStrategy
303
- | AgenticChunkerStrategy
304
- | TokenChunkerStrategy
305
- | SentenceChunkerStrategy
306
- | RecursiveChunkerStrategy;
307
-
308
- export type ParseMetadata = {
309
- startIndex: number | null;
310
- endIndex: number | null;
311
- tokenCount: number | null;
312
- };
313
-
314
- export type Chunks = {
315
- /**
316
- * The text content of the chunk
317
- */
318
- text: string;
319
- /**
320
- * The position index of this chunk in the sequence
321
- */
322
- index: number;
323
- metadata?: ParseMetadata | undefined;
324
- };
325
-
326
- /**
327
- * Text successfully chunked
328
- */
329
- export type ParseResponseBody = {
330
- chunks: Array<Chunks>;
331
- };
332
-
333
- /** @internal */
334
- export const ParseChunkingRequestChunkingRequestReturnType$inboundSchema:
335
- z.ZodNativeEnum<typeof ParseChunkingRequestChunkingRequestReturnType> = z
336
- .nativeEnum(ParseChunkingRequestChunkingRequestReturnType);
337
- /** @internal */
338
- export const ParseChunkingRequestChunkingRequestReturnType$outboundSchema:
339
- z.ZodNativeEnum<typeof ParseChunkingRequestChunkingRequestReturnType> =
340
- ParseChunkingRequestChunkingRequestReturnType$inboundSchema;
341
-
342
- /** @internal */
343
- export const AgenticChunker$inboundSchema: z.ZodNativeEnum<
344
- typeof AgenticChunker
345
- > = z.nativeEnum(AgenticChunker);
346
- /** @internal */
347
- export const AgenticChunker$outboundSchema: z.ZodNativeEnum<
348
- typeof AgenticChunker
349
- > = AgenticChunker$inboundSchema;
350
-
351
- /** @internal */
352
- export const AgenticChunkerStrategy$inboundSchema: z.ZodType<
353
- AgenticChunkerStrategy,
354
- z.ZodTypeDef,
355
- unknown
356
- > = z.object({
357
- text: z.string(),
358
- metadata: z.boolean().default(true),
359
- return_type: ParseChunkingRequestChunkingRequestReturnType$inboundSchema
360
- .default("chunks"),
361
- strategy: AgenticChunker$inboundSchema,
362
- model: z.string(),
363
- chunk_size: z.number().int().default(1024),
364
- candidate_size: z.number().int().default(128),
365
- min_characters_per_chunk: z.number().int().default(24),
366
- }).transform((v) => {
367
- return remap$(v, {
368
- "return_type": "returnType",
369
- "chunk_size": "chunkSize",
370
- "candidate_size": "candidateSize",
371
- "min_characters_per_chunk": "minCharactersPerChunk",
372
- });
373
- });
374
- /** @internal */
375
- export type AgenticChunkerStrategy$Outbound = {
376
- text: string;
377
- metadata: boolean;
378
- return_type: string;
379
- strategy: string;
380
- model: string;
381
- chunk_size: number;
382
- candidate_size: number;
383
- min_characters_per_chunk: number;
384
- };
385
-
386
- /** @internal */
387
- export const AgenticChunkerStrategy$outboundSchema: z.ZodType<
388
- AgenticChunkerStrategy$Outbound,
389
- z.ZodTypeDef,
390
- AgenticChunkerStrategy
391
- > = z.object({
392
- text: z.string(),
393
- metadata: z.boolean().default(true),
394
- returnType: ParseChunkingRequestChunkingRequestReturnType$outboundSchema
395
- .default("chunks"),
396
- strategy: AgenticChunker$outboundSchema,
397
- model: z.string(),
398
- chunkSize: z.number().int().default(1024),
399
- candidateSize: z.number().int().default(128),
400
- minCharactersPerChunk: z.number().int().default(24),
401
- }).transform((v) => {
402
- return remap$(v, {
403
- returnType: "return_type",
404
- chunkSize: "chunk_size",
405
- candidateSize: "candidate_size",
406
- minCharactersPerChunk: "min_characters_per_chunk",
407
- });
408
- });
409
-
410
- export function agenticChunkerStrategyToJSON(
411
- agenticChunkerStrategy: AgenticChunkerStrategy,
412
- ): string {
413
- return JSON.stringify(
414
- AgenticChunkerStrategy$outboundSchema.parse(agenticChunkerStrategy),
415
- );
416
- }
417
- export function agenticChunkerStrategyFromJSON(
418
- jsonString: string,
419
- ): SafeParseResult<AgenticChunkerStrategy, SDKValidationError> {
420
- return safeParse(
421
- jsonString,
422
- (x) => AgenticChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
423
- `Failed to parse 'AgenticChunkerStrategy' from JSON`,
424
- );
425
- }
426
-
427
- /** @internal */
428
- export const ParseChunkingRequestChunkingReturnType$inboundSchema:
429
- z.ZodNativeEnum<typeof ParseChunkingRequestChunkingReturnType> = z.nativeEnum(
430
- ParseChunkingRequestChunkingReturnType,
431
- );
432
- /** @internal */
433
- export const ParseChunkingRequestChunkingReturnType$outboundSchema:
434
- z.ZodNativeEnum<typeof ParseChunkingRequestChunkingReturnType> =
435
- ParseChunkingRequestChunkingReturnType$inboundSchema;
436
-
437
- /** @internal */
438
- export const SemanticChunker$inboundSchema: z.ZodNativeEnum<
439
- typeof SemanticChunker
440
- > = z.nativeEnum(SemanticChunker);
441
- /** @internal */
442
- export const SemanticChunker$outboundSchema: z.ZodNativeEnum<
443
- typeof SemanticChunker
444
- > = SemanticChunker$inboundSchema;
445
-
446
- /** @internal */
447
- export const Threshold2$inboundSchema: z.ZodNativeEnum<typeof Threshold2> = z
448
- .nativeEnum(Threshold2);
449
- /** @internal */
450
- export const Threshold2$outboundSchema: z.ZodNativeEnum<typeof Threshold2> =
451
- Threshold2$inboundSchema;
452
-
453
- /** @internal */
454
- export const Threshold$inboundSchema: z.ZodType<
455
- Threshold,
456
- z.ZodTypeDef,
457
- unknown
458
- > = z.union([z.number(), Threshold2$inboundSchema]);
459
- /** @internal */
460
- export type Threshold$Outbound = number | string;
461
-
462
- /** @internal */
463
- export const Threshold$outboundSchema: z.ZodType<
464
- Threshold$Outbound,
465
- z.ZodTypeDef,
466
- Threshold
467
- > = z.union([z.number(), Threshold2$outboundSchema]);
468
-
469
- export function thresholdToJSON(threshold: Threshold): string {
470
- return JSON.stringify(Threshold$outboundSchema.parse(threshold));
471
- }
472
- export function thresholdFromJSON(
473
- jsonString: string,
474
- ): SafeParseResult<Threshold, SDKValidationError> {
475
- return safeParse(
476
- jsonString,
477
- (x) => Threshold$inboundSchema.parse(JSON.parse(x)),
478
- `Failed to parse 'Threshold' from JSON`,
479
- );
480
- }
481
-
482
- /** @internal */
483
- export const Mode$inboundSchema: z.ZodNativeEnum<typeof Mode> = z.nativeEnum(
484
- Mode,
485
- );
486
- /** @internal */
487
- export const Mode$outboundSchema: z.ZodNativeEnum<typeof Mode> =
488
- Mode$inboundSchema;
489
-
490
- /** @internal */
491
- export const SemanticChunkerStrategy$inboundSchema: z.ZodType<
492
- SemanticChunkerStrategy,
493
- z.ZodTypeDef,
494
- unknown
495
- > = z.object({
496
- text: z.string(),
497
- metadata: z.boolean().default(true),
498
- return_type: ParseChunkingRequestChunkingReturnType$inboundSchema.default(
499
- "chunks",
500
- ),
501
- strategy: SemanticChunker$inboundSchema,
502
- chunk_size: z.number().int().default(512),
503
- threshold: z.union([z.number(), Threshold2$inboundSchema]).optional(),
504
- embedding_model: z.string(),
505
- dimensions: z.number().int().optional(),
506
- max_tokens: z.number().int().optional(),
507
- mode: Mode$inboundSchema.default("window"),
508
- similarity_window: z.number().int().default(1),
509
- }).transform((v) => {
510
- return remap$(v, {
511
- "return_type": "returnType",
512
- "chunk_size": "chunkSize",
513
- "embedding_model": "embeddingModel",
514
- "max_tokens": "maxTokens",
515
- "similarity_window": "similarityWindow",
516
- });
517
- });
518
- /** @internal */
519
- export type SemanticChunkerStrategy$Outbound = {
520
- text: string;
521
- metadata: boolean;
522
- return_type: string;
523
- strategy: string;
524
- chunk_size: number;
525
- threshold?: number | string | undefined;
526
- embedding_model: string;
527
- dimensions?: number | undefined;
528
- max_tokens?: number | undefined;
529
- mode: string;
530
- similarity_window: number;
531
- };
532
-
533
- /** @internal */
534
- export const SemanticChunkerStrategy$outboundSchema: z.ZodType<
535
- SemanticChunkerStrategy$Outbound,
536
- z.ZodTypeDef,
537
- SemanticChunkerStrategy
538
- > = z.object({
539
- text: z.string(),
540
- metadata: z.boolean().default(true),
541
- returnType: ParseChunkingRequestChunkingReturnType$outboundSchema.default(
542
- "chunks",
543
- ),
544
- strategy: SemanticChunker$outboundSchema,
545
- chunkSize: z.number().int().default(512),
546
- threshold: z.union([z.number(), Threshold2$outboundSchema]).optional(),
547
- embeddingModel: z.string(),
548
- dimensions: z.number().int().optional(),
549
- maxTokens: z.number().int().optional(),
550
- mode: Mode$outboundSchema.default("window"),
551
- similarityWindow: z.number().int().default(1),
552
- }).transform((v) => {
553
- return remap$(v, {
554
- returnType: "return_type",
555
- chunkSize: "chunk_size",
556
- embeddingModel: "embedding_model",
557
- maxTokens: "max_tokens",
558
- similarityWindow: "similarity_window",
559
- });
560
- });
561
-
562
- export function semanticChunkerStrategyToJSON(
563
- semanticChunkerStrategy: SemanticChunkerStrategy,
564
- ): string {
565
- return JSON.stringify(
566
- SemanticChunkerStrategy$outboundSchema.parse(semanticChunkerStrategy),
567
- );
568
- }
569
- export function semanticChunkerStrategyFromJSON(
570
- jsonString: string,
571
- ): SafeParseResult<SemanticChunkerStrategy, SDKValidationError> {
572
- return safeParse(
573
- jsonString,
574
- (x) => SemanticChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
575
- `Failed to parse 'SemanticChunkerStrategy' from JSON`,
576
- );
577
- }
578
-
579
- /** @internal */
580
- export const ParseChunkingRequestReturnType$inboundSchema: z.ZodNativeEnum<
581
- typeof ParseChunkingRequestReturnType
582
- > = z.nativeEnum(ParseChunkingRequestReturnType);
583
- /** @internal */
584
- export const ParseChunkingRequestReturnType$outboundSchema: z.ZodNativeEnum<
585
- typeof ParseChunkingRequestReturnType
586
- > = ParseChunkingRequestReturnType$inboundSchema;
587
-
588
- /** @internal */
589
- export const RecursiveChunker$inboundSchema: z.ZodNativeEnum<
590
- typeof RecursiveChunker
591
- > = z.nativeEnum(RecursiveChunker);
592
- /** @internal */
593
- export const RecursiveChunker$outboundSchema: z.ZodNativeEnum<
594
- typeof RecursiveChunker
595
- > = RecursiveChunker$inboundSchema;
596
-
597
- /** @internal */
598
- export const RecursiveChunkerStrategy$inboundSchema: z.ZodType<
599
- RecursiveChunkerStrategy,
600
- z.ZodTypeDef,
601
- unknown
602
- > = z.object({
603
- text: z.string(),
604
- metadata: z.boolean().default(true),
605
- return_type: ParseChunkingRequestReturnType$inboundSchema.default("chunks"),
606
- strategy: RecursiveChunker$inboundSchema,
607
- chunk_size: z.number().int().default(512),
608
- separators: z.array(z.string()).optional(),
609
- min_characters_per_chunk: z.number().int().default(24),
610
- }).transform((v) => {
611
- return remap$(v, {
612
- "return_type": "returnType",
613
- "chunk_size": "chunkSize",
614
- "min_characters_per_chunk": "minCharactersPerChunk",
615
- });
616
- });
617
- /** @internal */
618
- export type RecursiveChunkerStrategy$Outbound = {
619
- text: string;
620
- metadata: boolean;
621
- return_type: string;
622
- strategy: string;
623
- chunk_size: number;
624
- separators?: Array<string> | undefined;
625
- min_characters_per_chunk: number;
626
- };
627
-
628
- /** @internal */
629
- export const RecursiveChunkerStrategy$outboundSchema: z.ZodType<
630
- RecursiveChunkerStrategy$Outbound,
631
- z.ZodTypeDef,
632
- RecursiveChunkerStrategy
633
- > = z.object({
634
- text: z.string(),
635
- metadata: z.boolean().default(true),
636
- returnType: ParseChunkingRequestReturnType$outboundSchema.default("chunks"),
637
- strategy: RecursiveChunker$outboundSchema,
638
- chunkSize: z.number().int().default(512),
639
- separators: z.array(z.string()).optional(),
640
- minCharactersPerChunk: z.number().int().default(24),
641
- }).transform((v) => {
642
- return remap$(v, {
643
- returnType: "return_type",
644
- chunkSize: "chunk_size",
645
- minCharactersPerChunk: "min_characters_per_chunk",
646
- });
647
- });
648
-
649
- export function recursiveChunkerStrategyToJSON(
650
- recursiveChunkerStrategy: RecursiveChunkerStrategy,
651
- ): string {
652
- return JSON.stringify(
653
- RecursiveChunkerStrategy$outboundSchema.parse(recursiveChunkerStrategy),
654
- );
655
- }
656
- export function recursiveChunkerStrategyFromJSON(
657
- jsonString: string,
658
- ): SafeParseResult<RecursiveChunkerStrategy, SDKValidationError> {
659
- return safeParse(
660
- jsonString,
661
- (x) => RecursiveChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
662
- `Failed to parse 'RecursiveChunkerStrategy' from JSON`,
663
- );
664
- }
665
-
666
- /** @internal */
667
- export const ChunkingRequestReturnType$inboundSchema: z.ZodNativeEnum<
668
- typeof ChunkingRequestReturnType
669
- > = z.nativeEnum(ChunkingRequestReturnType);
670
- /** @internal */
671
- export const ChunkingRequestReturnType$outboundSchema: z.ZodNativeEnum<
672
- typeof ChunkingRequestReturnType
673
- > = ChunkingRequestReturnType$inboundSchema;
674
-
675
- /** @internal */
676
- export const SentenceChunker$inboundSchema: z.ZodNativeEnum<
677
- typeof SentenceChunker
678
- > = z.nativeEnum(SentenceChunker);
679
- /** @internal */
680
- export const SentenceChunker$outboundSchema: z.ZodNativeEnum<
681
- typeof SentenceChunker
682
- > = SentenceChunker$inboundSchema;
683
-
684
- /** @internal */
685
- export const SentenceChunkerStrategy$inboundSchema: z.ZodType<
686
- SentenceChunkerStrategy,
687
- z.ZodTypeDef,
688
- unknown
689
- > = z.object({
690
- text: z.string(),
691
- metadata: z.boolean().default(true),
692
- return_type: ChunkingRequestReturnType$inboundSchema.default("chunks"),
693
- strategy: SentenceChunker$inboundSchema,
694
- chunk_size: z.number().int().default(512),
695
- chunk_overlap: z.number().int().default(0),
696
- min_sentences_per_chunk: z.number().int().default(1),
697
- }).transform((v) => {
698
- return remap$(v, {
699
- "return_type": "returnType",
700
- "chunk_size": "chunkSize",
701
- "chunk_overlap": "chunkOverlap",
702
- "min_sentences_per_chunk": "minSentencesPerChunk",
703
- });
704
- });
705
- /** @internal */
706
- export type SentenceChunkerStrategy$Outbound = {
707
- text: string;
708
- metadata: boolean;
709
- return_type: string;
710
- strategy: string;
711
- chunk_size: number;
712
- chunk_overlap: number;
713
- min_sentences_per_chunk: number;
714
- };
715
-
716
- /** @internal */
717
- export const SentenceChunkerStrategy$outboundSchema: z.ZodType<
718
- SentenceChunkerStrategy$Outbound,
719
- z.ZodTypeDef,
720
- SentenceChunkerStrategy
721
- > = z.object({
722
- text: z.string(),
723
- metadata: z.boolean().default(true),
724
- returnType: ChunkingRequestReturnType$outboundSchema.default("chunks"),
725
- strategy: SentenceChunker$outboundSchema,
726
- chunkSize: z.number().int().default(512),
727
- chunkOverlap: z.number().int().default(0),
728
- minSentencesPerChunk: z.number().int().default(1),
729
- }).transform((v) => {
730
- return remap$(v, {
731
- returnType: "return_type",
732
- chunkSize: "chunk_size",
733
- chunkOverlap: "chunk_overlap",
734
- minSentencesPerChunk: "min_sentences_per_chunk",
735
- });
736
- });
737
-
738
- export function sentenceChunkerStrategyToJSON(
739
- sentenceChunkerStrategy: SentenceChunkerStrategy,
740
- ): string {
741
- return JSON.stringify(
742
- SentenceChunkerStrategy$outboundSchema.parse(sentenceChunkerStrategy),
743
- );
744
- }
745
- export function sentenceChunkerStrategyFromJSON(
746
- jsonString: string,
747
- ): SafeParseResult<SentenceChunkerStrategy, SDKValidationError> {
748
- return safeParse(
749
- jsonString,
750
- (x) => SentenceChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
751
- `Failed to parse 'SentenceChunkerStrategy' from JSON`,
752
- );
753
- }
754
-
755
- /** @internal */
756
- export const ReturnTypeT$inboundSchema: z.ZodNativeEnum<typeof ReturnTypeT> = z
757
- .nativeEnum(ReturnTypeT);
758
- /** @internal */
759
- export const ReturnTypeT$outboundSchema: z.ZodNativeEnum<typeof ReturnTypeT> =
760
- ReturnTypeT$inboundSchema;
761
-
762
- /** @internal */
763
- export const TokenChunker$inboundSchema: z.ZodNativeEnum<typeof TokenChunker> =
764
- z.nativeEnum(TokenChunker);
765
- /** @internal */
766
- export const TokenChunker$outboundSchema: z.ZodNativeEnum<typeof TokenChunker> =
767
- TokenChunker$inboundSchema;
768
-
769
- /** @internal */
770
- export const TokenChunkerStrategy$inboundSchema: z.ZodType<
771
- TokenChunkerStrategy,
772
- z.ZodTypeDef,
773
- unknown
774
- > = z.object({
775
- text: z.string(),
776
- metadata: z.boolean().default(true),
777
- return_type: ReturnTypeT$inboundSchema.default("chunks"),
778
- strategy: TokenChunker$inboundSchema,
779
- chunk_size: z.number().int().default(512),
780
- chunk_overlap: z.number().int().default(0),
781
- }).transform((v) => {
782
- return remap$(v, {
783
- "return_type": "returnType",
784
- "chunk_size": "chunkSize",
785
- "chunk_overlap": "chunkOverlap",
786
- });
787
- });
788
- /** @internal */
789
- export type TokenChunkerStrategy$Outbound = {
790
- text: string;
791
- metadata: boolean;
792
- return_type: string;
793
- strategy: string;
794
- chunk_size: number;
795
- chunk_overlap: number;
796
- };
797
-
798
- /** @internal */
799
- export const TokenChunkerStrategy$outboundSchema: z.ZodType<
800
- TokenChunkerStrategy$Outbound,
801
- z.ZodTypeDef,
802
- TokenChunkerStrategy
803
- > = z.object({
804
- text: z.string(),
805
- metadata: z.boolean().default(true),
806
- returnType: ReturnTypeT$outboundSchema.default("chunks"),
807
- strategy: TokenChunker$outboundSchema,
808
- chunkSize: z.number().int().default(512),
809
- chunkOverlap: z.number().int().default(0),
810
- }).transform((v) => {
811
- return remap$(v, {
812
- returnType: "return_type",
813
- chunkSize: "chunk_size",
814
- chunkOverlap: "chunk_overlap",
815
- });
816
- });
817
-
818
- export function tokenChunkerStrategyToJSON(
819
- tokenChunkerStrategy: TokenChunkerStrategy,
820
- ): string {
821
- return JSON.stringify(
822
- TokenChunkerStrategy$outboundSchema.parse(tokenChunkerStrategy),
823
- );
824
- }
825
- export function tokenChunkerStrategyFromJSON(
826
- jsonString: string,
827
- ): SafeParseResult<TokenChunkerStrategy, SDKValidationError> {
828
- return safeParse(
829
- jsonString,
830
- (x) => TokenChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
831
- `Failed to parse 'TokenChunkerStrategy' from JSON`,
832
- );
833
- }
834
-
835
- /** @internal */
836
- export const ParseChunkingRequest$inboundSchema: z.ZodType<
837
- ParseChunkingRequest,
838
- z.ZodTypeDef,
839
- unknown
840
- > = z.union([
841
- z.lazy(() => SemanticChunkerStrategy$inboundSchema),
842
- z.lazy(() => AgenticChunkerStrategy$inboundSchema),
843
- z.lazy(() => TokenChunkerStrategy$inboundSchema),
844
- z.lazy(() => SentenceChunkerStrategy$inboundSchema),
845
- z.lazy(() => RecursiveChunkerStrategy$inboundSchema),
846
- ]);
847
- /** @internal */
848
- export type ParseChunkingRequest$Outbound =
849
- | SemanticChunkerStrategy$Outbound
850
- | AgenticChunkerStrategy$Outbound
851
- | TokenChunkerStrategy$Outbound
852
- | SentenceChunkerStrategy$Outbound
853
- | RecursiveChunkerStrategy$Outbound;
854
-
855
- /** @internal */
856
- export const ParseChunkingRequest$outboundSchema: z.ZodType<
857
- ParseChunkingRequest$Outbound,
858
- z.ZodTypeDef,
859
- ParseChunkingRequest
860
- > = z.union([
861
- z.lazy(() => SemanticChunkerStrategy$outboundSchema),
862
- z.lazy(() => AgenticChunkerStrategy$outboundSchema),
863
- z.lazy(() => TokenChunkerStrategy$outboundSchema),
864
- z.lazy(() => SentenceChunkerStrategy$outboundSchema),
865
- z.lazy(() => RecursiveChunkerStrategy$outboundSchema),
866
- ]);
867
-
868
- export function parseChunkingRequestToJSON(
869
- parseChunkingRequest: ParseChunkingRequest,
870
- ): string {
871
- return JSON.stringify(
872
- ParseChunkingRequest$outboundSchema.parse(parseChunkingRequest),
873
- );
874
- }
875
- export function parseChunkingRequestFromJSON(
876
- jsonString: string,
877
- ): SafeParseResult<ParseChunkingRequest, SDKValidationError> {
878
- return safeParse(
879
- jsonString,
880
- (x) => ParseChunkingRequest$inboundSchema.parse(JSON.parse(x)),
881
- `Failed to parse 'ParseChunkingRequest' from JSON`,
882
- );
883
- }
884
-
885
- /** @internal */
886
- export const ParseMetadata$inboundSchema: z.ZodType<
887
- ParseMetadata,
888
- z.ZodTypeDef,
889
- unknown
890
- > = z.object({
891
- start_index: z.nullable(z.number()),
892
- end_index: z.nullable(z.number()),
893
- token_count: z.nullable(z.number()),
894
- }).transform((v) => {
895
- return remap$(v, {
896
- "start_index": "startIndex",
897
- "end_index": "endIndex",
898
- "token_count": "tokenCount",
899
- });
900
- });
901
- /** @internal */
902
- export type ParseMetadata$Outbound = {
903
- start_index: number | null;
904
- end_index: number | null;
905
- token_count: number | null;
906
- };
907
-
908
- /** @internal */
909
- export const ParseMetadata$outboundSchema: z.ZodType<
910
- ParseMetadata$Outbound,
911
- z.ZodTypeDef,
912
- ParseMetadata
913
- > = z.object({
914
- startIndex: z.nullable(z.number()),
915
- endIndex: z.nullable(z.number()),
916
- tokenCount: z.nullable(z.number()),
917
- }).transform((v) => {
918
- return remap$(v, {
919
- startIndex: "start_index",
920
- endIndex: "end_index",
921
- tokenCount: "token_count",
922
- });
923
- });
924
-
925
- export function parseMetadataToJSON(parseMetadata: ParseMetadata): string {
926
- return JSON.stringify(ParseMetadata$outboundSchema.parse(parseMetadata));
927
- }
928
- export function parseMetadataFromJSON(
929
- jsonString: string,
930
- ): SafeParseResult<ParseMetadata, SDKValidationError> {
931
- return safeParse(
932
- jsonString,
933
- (x) => ParseMetadata$inboundSchema.parse(JSON.parse(x)),
934
- `Failed to parse 'ParseMetadata' from JSON`,
935
- );
936
- }
937
-
938
- /** @internal */
939
- export const Chunks$inboundSchema: z.ZodType<Chunks, z.ZodTypeDef, unknown> = z
940
- .object({
941
- text: z.string(),
942
- index: z.number(),
943
- metadata: z.lazy(() => ParseMetadata$inboundSchema).optional(),
944
- });
945
- /** @internal */
946
- export type Chunks$Outbound = {
947
- text: string;
948
- index: number;
949
- metadata?: ParseMetadata$Outbound | undefined;
950
- };
951
-
952
- /** @internal */
953
- export const Chunks$outboundSchema: z.ZodType<
954
- Chunks$Outbound,
955
- z.ZodTypeDef,
956
- Chunks
957
- > = z.object({
958
- text: z.string(),
959
- index: z.number(),
960
- metadata: z.lazy(() => ParseMetadata$outboundSchema).optional(),
961
- });
962
-
963
- export function chunksToJSON(chunks: Chunks): string {
964
- return JSON.stringify(Chunks$outboundSchema.parse(chunks));
965
- }
966
- export function chunksFromJSON(
967
- jsonString: string,
968
- ): SafeParseResult<Chunks, SDKValidationError> {
969
- return safeParse(
970
- jsonString,
971
- (x) => Chunks$inboundSchema.parse(JSON.parse(x)),
972
- `Failed to parse 'Chunks' from JSON`,
973
- );
974
- }
975
-
976
- /** @internal */
977
- export const ParseResponseBody$inboundSchema: z.ZodType<
978
- ParseResponseBody,
979
- z.ZodTypeDef,
980
- unknown
981
- > = z.object({
982
- chunks: z.array(z.lazy(() => Chunks$inboundSchema)),
983
- });
984
- /** @internal */
985
- export type ParseResponseBody$Outbound = {
986
- chunks: Array<Chunks$Outbound>;
987
- };
988
-
989
- /** @internal */
990
- export const ParseResponseBody$outboundSchema: z.ZodType<
991
- ParseResponseBody$Outbound,
992
- z.ZodTypeDef,
993
- ParseResponseBody
994
- > = z.object({
995
- chunks: z.array(z.lazy(() => Chunks$outboundSchema)),
996
- });
997
-
998
- export function parseResponseBodyToJSON(
999
- parseResponseBody: ParseResponseBody,
1000
- ): string {
1001
- return JSON.stringify(
1002
- ParseResponseBody$outboundSchema.parse(parseResponseBody),
1003
- );
1004
- }
1005
- export function parseResponseBodyFromJSON(
1006
- jsonString: string,
1007
- ): SafeParseResult<ParseResponseBody, SDKValidationError> {
1008
- return safeParse(
1009
- jsonString,
1010
- (x) => ParseResponseBody$inboundSchema.parse(JSON.parse(x)),
1011
- `Failed to parse 'ParseResponseBody' from JSON`,
1012
- );
1013
- }