@orq-ai/node 3.6.0-rc.9 → 3.7.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 (403) hide show
  1. package/README.md +2 -0
  2. package/bin/mcp-server.js +4598 -1269
  3. package/bin/mcp-server.js.map +55 -43
  4. package/docs/sdks/knowledge/README.md +93 -4
  5. package/funcs/knowledgeCreateDatasource.js +2 -2
  6. package/funcs/knowledgeCreateDatasource.js.map +1 -1
  7. package/funcs/knowledgeSearch.d.ts +16 -0
  8. package/funcs/knowledgeSearch.d.ts.map +1 -0
  9. package/funcs/knowledgeSearch.js +118 -0
  10. package/funcs/knowledgeSearch.js.map +1 -0
  11. package/jsr.json +1 -1
  12. package/lib/config.d.ts +3 -3
  13. package/lib/config.js +3 -3
  14. package/lib/config.js.map +1 -1
  15. package/mcp-server/cli/start/impl.js +2 -2
  16. package/mcp-server/cli/start/impl.js.map +1 -1
  17. package/mcp-server/mcp-server.js +1 -1
  18. package/mcp-server/mcp-server.js.map +1 -1
  19. package/mcp-server/server.d.ts.map +1 -1
  20. package/mcp-server/server.js +3 -1
  21. package/mcp-server/server.js.map +1 -1
  22. package/mcp-server/tools/knowledgeSearch.d.ts +8 -0
  23. package/mcp-server/tools/knowledgeSearch.d.ts.map +1 -0
  24. package/mcp-server/tools/knowledgeSearch.js +64 -0
  25. package/mcp-server/tools/knowledgeSearch.js.map +1 -0
  26. package/models/components/deployments.d.ts +1216 -53
  27. package/models/components/deployments.d.ts.map +1 -1
  28. package/models/components/deployments.js +1461 -103
  29. package/models/components/deployments.js.map +1 -1
  30. package/models/operations/bulkcreatedatapoints.d.ts +194 -12
  31. package/models/operations/bulkcreatedatapoints.d.ts.map +1 -1
  32. package/models/operations/bulkcreatedatapoints.js +192 -4
  33. package/models/operations/bulkcreatedatapoints.js.map +1 -1
  34. package/models/operations/createchunk.d.ts +32 -17
  35. package/models/operations/createchunk.d.ts.map +1 -1
  36. package/models/operations/createchunk.js +30 -19
  37. package/models/operations/createchunk.js.map +1 -1
  38. package/models/operations/createcontact.js +2 -2
  39. package/models/operations/createdataset.js +2 -2
  40. package/models/operations/createdatasetitem.d.ts +194 -12
  41. package/models/operations/createdatasetitem.d.ts.map +1 -1
  42. package/models/operations/createdatasetitem.js +191 -4
  43. package/models/operations/createdatasetitem.js.map +1 -1
  44. package/models/operations/createdatasource.js +2 -2
  45. package/models/operations/createprompt.d.ts +194 -12
  46. package/models/operations/createprompt.d.ts.map +1 -1
  47. package/models/operations/createprompt.js +192 -5
  48. package/models/operations/createprompt.js.map +1 -1
  49. package/models/operations/deploymentgetconfig.d.ts +1343 -89
  50. package/models/operations/deploymentgetconfig.d.ts.map +1 -1
  51. package/models/operations/deploymentgetconfig.js +1451 -8
  52. package/models/operations/deploymentgetconfig.js.map +1 -1
  53. package/models/operations/deployments.d.ts +105 -14
  54. package/models/operations/deployments.d.ts.map +1 -1
  55. package/models/operations/deployments.js +108 -15
  56. package/models/operations/deployments.js.map +1 -1
  57. package/models/operations/deploymentstream.d.ts +1163 -0
  58. package/models/operations/deploymentstream.d.ts.map +1 -1
  59. package/models/operations/deploymentstream.js +1319 -2
  60. package/models/operations/deploymentstream.js.map +1 -1
  61. package/models/operations/fileget.js +2 -2
  62. package/models/operations/filelist.js +2 -2
  63. package/models/operations/fileupload.js +2 -2
  64. package/models/operations/getallprompts.d.ts +97 -6
  65. package/models/operations/getallprompts.d.ts.map +1 -1
  66. package/models/operations/getallprompts.js +96 -3
  67. package/models/operations/getallprompts.js.map +1 -1
  68. package/models/operations/getonechunk.d.ts +24 -3
  69. package/models/operations/getonechunk.d.ts.map +1 -1
  70. package/models/operations/getonechunk.js +26 -3
  71. package/models/operations/getonechunk.js.map +1 -1
  72. package/models/operations/getoneprompt.d.ts +97 -6
  73. package/models/operations/getoneprompt.d.ts.map +1 -1
  74. package/models/operations/getoneprompt.js +96 -3
  75. package/models/operations/getoneprompt.js.map +1 -1
  76. package/models/operations/getpromptversion.d.ts +97 -6
  77. package/models/operations/getpromptversion.d.ts.map +1 -1
  78. package/models/operations/getpromptversion.js +96 -3
  79. package/models/operations/getpromptversion.js.map +1 -1
  80. package/models/operations/index.d.ts +1 -0
  81. package/models/operations/index.d.ts.map +1 -1
  82. package/models/operations/index.js +1 -0
  83. package/models/operations/index.js.map +1 -1
  84. package/models/operations/listchunks.d.ts +24 -3
  85. package/models/operations/listchunks.d.ts.map +1 -1
  86. package/models/operations/listchunks.js +26 -3
  87. package/models/operations/listchunks.js.map +1 -1
  88. package/models/operations/listdatasetdatapoints.d.ts +97 -6
  89. package/models/operations/listdatasetdatapoints.d.ts.map +1 -1
  90. package/models/operations/listdatasetdatapoints.js +98 -4
  91. package/models/operations/listdatasetdatapoints.js.map +1 -1
  92. package/models/operations/listdatasets.js +2 -2
  93. package/models/operations/listdatasources.js +2 -2
  94. package/models/operations/listpromptversions.d.ts +97 -6
  95. package/models/operations/listpromptversions.d.ts.map +1 -1
  96. package/models/operations/listpromptversions.js +96 -3
  97. package/models/operations/listpromptversions.js.map +1 -1
  98. package/models/operations/retrievedatapoint.d.ts +97 -6
  99. package/models/operations/retrievedatapoint.d.ts.map +1 -1
  100. package/models/operations/retrievedatapoint.js +97 -3
  101. package/models/operations/retrievedatapoint.js.map +1 -1
  102. package/models/operations/retrievedataset.js +2 -2
  103. package/models/operations/retrievedatasource.js +2 -2
  104. package/models/operations/searchknowledge.d.ts +1379 -0
  105. package/models/operations/searchknowledge.d.ts.map +1 -0
  106. package/models/operations/searchknowledge.js +1586 -0
  107. package/models/operations/searchknowledge.js.map +1 -0
  108. package/models/operations/updatechunk.d.ts +32 -17
  109. package/models/operations/updatechunk.d.ts.map +1 -1
  110. package/models/operations/updatechunk.js +30 -19
  111. package/models/operations/updatechunk.js.map +1 -1
  112. package/models/operations/updatedatapoint.d.ts +194 -12
  113. package/models/operations/updatedatapoint.d.ts.map +1 -1
  114. package/models/operations/updatedatapoint.js +191 -4
  115. package/models/operations/updatedatapoint.js.map +1 -1
  116. package/models/operations/updatedataset.js +2 -2
  117. package/models/operations/updatedatasource.js +2 -2
  118. package/models/operations/updateprompt.d.ts +194 -12
  119. package/models/operations/updateprompt.d.ts.map +1 -1
  120. package/models/operations/updateprompt.js +192 -5
  121. package/models/operations/updateprompt.js.map +1 -1
  122. package/package.json +3 -4
  123. package/packages/orq-rc/FUNCTIONS.md +106 -0
  124. package/packages/orq-rc/README.md +707 -0
  125. package/packages/orq-rc/RUNTIMES.md +48 -0
  126. package/packages/orq-rc/docs/sdks/contacts/README.md +84 -0
  127. package/packages/orq-rc/docs/sdks/datasets/README.md +1027 -0
  128. package/packages/orq-rc/docs/sdks/deployments/README.md +405 -0
  129. package/packages/orq-rc/docs/sdks/feedback/README.md +92 -0
  130. package/packages/orq-rc/docs/sdks/files/README.md +311 -0
  131. package/packages/orq-rc/docs/sdks/knowledge/README.md +1285 -0
  132. package/packages/orq-rc/docs/sdks/metrics/README.md +86 -0
  133. package/packages/orq-rc/docs/sdks/models/README.md +79 -0
  134. package/packages/orq-rc/docs/sdks/orq/README.md +10 -0
  135. package/packages/orq-rc/docs/sdks/prompts/README.md +576 -0
  136. package/packages/orq-rc/docs/sdks/remoteconfigs/README.md +80 -0
  137. package/packages/orq-rc/jsr.json +28 -0
  138. package/packages/orq-rc/package-lock.json +3217 -0
  139. package/packages/orq-rc/package.json +45 -0
  140. package/packages/orq-rc/src/core.ts +13 -0
  141. package/packages/orq-rc/src/funcs/contactsCreate.ts +154 -0
  142. package/packages/orq-rc/src/funcs/datasetsClear.ts +161 -0
  143. package/packages/orq-rc/src/funcs/datasetsCreate.ts +159 -0
  144. package/packages/orq-rc/src/funcs/datasetsCreateDatapoint.ts +161 -0
  145. package/packages/orq-rc/src/funcs/datasetsCreateDatapoints.ts +165 -0
  146. package/packages/orq-rc/src/funcs/datasetsCreateExperiment.ts +162 -0
  147. package/packages/orq-rc/src/funcs/datasetsDelete.ts +161 -0
  148. package/packages/orq-rc/src/funcs/datasetsDeleteDatapoint.ts +176 -0
  149. package/packages/orq-rc/src/funcs/datasetsList.ts +161 -0
  150. package/packages/orq-rc/src/funcs/datasetsListDatapoints.ts +168 -0
  151. package/packages/orq-rc/src/funcs/datasetsRetrieve.ts +169 -0
  152. package/packages/orq-rc/src/funcs/datasetsRetrieveDatapoint.ts +175 -0
  153. package/packages/orq-rc/src/funcs/datasetsUpdate.ts +170 -0
  154. package/packages/orq-rc/src/funcs/datasetsUpdateDatapoint.ts +173 -0
  155. package/packages/orq-rc/src/funcs/deploymentsCreateExperiment.ts +167 -0
  156. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +162 -0
  157. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +170 -0
  158. package/packages/orq-rc/src/funcs/deploymentsList.ts +170 -0
  159. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +162 -0
  160. package/packages/orq-rc/src/funcs/deploymentsStream.ts +178 -0
  161. package/packages/orq-rc/src/funcs/feedbackCreate.ts +154 -0
  162. package/packages/orq-rc/src/funcs/filesCreate.ts +174 -0
  163. package/packages/orq-rc/src/funcs/filesDelete.ts +158 -0
  164. package/packages/orq-rc/src/funcs/filesGet.ts +160 -0
  165. package/packages/orq-rc/src/funcs/filesList.ts +161 -0
  166. package/packages/orq-rc/src/funcs/knowledgeCreate.ts +152 -0
  167. package/packages/orq-rc/src/funcs/knowledgeCreateChunks.ts +165 -0
  168. package/packages/orq-rc/src/funcs/knowledgeCreateDatasource.ts +160 -0
  169. package/packages/orq-rc/src/funcs/knowledgeDelete.ts +161 -0
  170. package/packages/orq-rc/src/funcs/knowledgeDeleteChunk.ts +168 -0
  171. package/packages/orq-rc/src/funcs/knowledgeDeleteDatasource.ts +167 -0
  172. package/packages/orq-rc/src/funcs/knowledgeList.ts +163 -0
  173. package/packages/orq-rc/src/funcs/knowledgeListChunks.ts +172 -0
  174. package/packages/orq-rc/src/funcs/knowledgeListDatasources.ts +168 -0
  175. package/packages/orq-rc/src/funcs/knowledgeRetrieve.ts +160 -0
  176. package/packages/orq-rc/src/funcs/knowledgeRetrieveChunk.ts +167 -0
  177. package/packages/orq-rc/src/funcs/knowledgeRetrieveDatasource.ts +163 -0
  178. package/packages/orq-rc/src/funcs/knowledgeSearch.ts +161 -0
  179. package/packages/orq-rc/src/funcs/knowledgeUpdate.ts +158 -0
  180. package/packages/orq-rc/src/funcs/knowledgeUpdateChunk.ts +168 -0
  181. package/packages/orq-rc/src/funcs/knowledgeUpdateDatasource.ts +164 -0
  182. package/packages/orq-rc/src/funcs/modelsList.ts +136 -0
  183. package/packages/orq-rc/src/funcs/promptsCreate.ts +154 -0
  184. package/packages/orq-rc/src/funcs/promptsDelete.ts +158 -0
  185. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +175 -0
  186. package/packages/orq-rc/src/funcs/promptsList.ts +161 -0
  187. package/packages/orq-rc/src/funcs/promptsListVersions.ts +167 -0
  188. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +160 -0
  189. package/packages/orq-rc/src/funcs/promptsUpdate.ts +167 -0
  190. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +155 -0
  191. package/packages/orq-rc/src/hooks/global.ts +44 -0
  192. package/packages/orq-rc/src/hooks/hooks.ts +132 -0
  193. package/packages/orq-rc/src/hooks/index.ts +6 -0
  194. package/packages/orq-rc/src/hooks/registration.ts +15 -0
  195. package/packages/orq-rc/src/hooks/types.ts +110 -0
  196. package/packages/orq-rc/src/index.ts +7 -0
  197. package/packages/orq-rc/src/lib/base64.ts +37 -0
  198. package/packages/orq-rc/src/lib/config.ts +70 -0
  199. package/packages/orq-rc/src/lib/dlv.ts +53 -0
  200. package/packages/orq-rc/src/lib/encodings.ts +483 -0
  201. package/packages/orq-rc/src/lib/env.ts +73 -0
  202. package/packages/orq-rc/src/lib/event-streams.ts +264 -0
  203. package/packages/orq-rc/src/lib/files.ts +40 -0
  204. package/packages/orq-rc/src/lib/http.ts +323 -0
  205. package/packages/orq-rc/src/lib/is-plain-object.ts +43 -0
  206. package/packages/orq-rc/src/lib/logger.ts +9 -0
  207. package/packages/orq-rc/src/lib/matchers.ts +345 -0
  208. package/packages/orq-rc/src/lib/primitives.ts +150 -0
  209. package/packages/orq-rc/src/lib/retries.ts +218 -0
  210. package/packages/orq-rc/src/lib/schemas.ts +91 -0
  211. package/packages/orq-rc/src/lib/sdks.ts +401 -0
  212. package/packages/orq-rc/src/lib/security.ts +261 -0
  213. package/packages/orq-rc/src/lib/url.ts +33 -0
  214. package/packages/orq-rc/src/mcp-server/cli/start/command.ts +125 -0
  215. package/packages/orq-rc/src/mcp-server/cli/start/impl.ts +140 -0
  216. package/packages/orq-rc/src/mcp-server/cli.ts +13 -0
  217. package/packages/orq-rc/src/mcp-server/console-logger.ts +71 -0
  218. package/packages/orq-rc/src/mcp-server/extensions.ts +17 -0
  219. package/packages/orq-rc/src/mcp-server/mcp-server.ts +26 -0
  220. package/packages/orq-rc/src/mcp-server/prompts.ts +117 -0
  221. package/packages/orq-rc/src/mcp-server/resources.ts +172 -0
  222. package/packages/orq-rc/src/mcp-server/scopes.ts +7 -0
  223. package/packages/orq-rc/src/mcp-server/server.ts +163 -0
  224. package/packages/orq-rc/src/mcp-server/shared.ts +75 -0
  225. package/packages/orq-rc/src/mcp-server/tools/contactsCreate.ts +37 -0
  226. package/packages/orq-rc/src/mcp-server/tools/datasetsClear.ts +35 -0
  227. package/packages/orq-rc/src/mcp-server/tools/datasetsCreate.ts +37 -0
  228. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateDatapoint.ts +37 -0
  229. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateDatapoints.ts +37 -0
  230. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateExperiment.ts +37 -0
  231. package/packages/orq-rc/src/mcp-server/tools/datasetsDelete.ts +35 -0
  232. package/packages/orq-rc/src/mcp-server/tools/datasetsDeleteDatapoint.ts +35 -0
  233. package/packages/orq-rc/src/mcp-server/tools/datasetsList.ts +37 -0
  234. package/packages/orq-rc/src/mcp-server/tools/datasetsListDatapoints.ts +37 -0
  235. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieve.ts +37 -0
  236. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieveDatapoint.ts +37 -0
  237. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdate.ts +37 -0
  238. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdateDatapoint.ts +35 -0
  239. package/packages/orq-rc/src/mcp-server/tools/deploymentsCreateExperiment.ts +37 -0
  240. package/packages/orq-rc/src/mcp-server/tools/deploymentsGetConfig.ts +37 -0
  241. package/packages/orq-rc/src/mcp-server/tools/deploymentsInvoke.ts +37 -0
  242. package/packages/orq-rc/src/mcp-server/tools/deploymentsList.ts +37 -0
  243. package/packages/orq-rc/src/mcp-server/tools/deploymentsMetricsCreate.ts +37 -0
  244. package/packages/orq-rc/src/mcp-server/tools/deploymentsStream.ts +37 -0
  245. package/packages/orq-rc/src/mcp-server/tools/feedbackCreate.ts +37 -0
  246. package/packages/orq-rc/src/mcp-server/tools/filesCreate.ts +37 -0
  247. package/packages/orq-rc/src/mcp-server/tools/filesDelete.ts +33 -0
  248. package/packages/orq-rc/src/mcp-server/tools/filesGet.ts +37 -0
  249. package/packages/orq-rc/src/mcp-server/tools/filesList.ts +37 -0
  250. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreate.ts +35 -0
  251. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateChunks.ts +35 -0
  252. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateDatasource.ts +35 -0
  253. package/packages/orq-rc/src/mcp-server/tools/knowledgeDelete.ts +35 -0
  254. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteChunk.ts +33 -0
  255. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteDatasource.ts +35 -0
  256. package/packages/orq-rc/src/mcp-server/tools/knowledgeList.ts +37 -0
  257. package/packages/orq-rc/src/mcp-server/tools/knowledgeListChunks.ts +35 -0
  258. package/packages/orq-rc/src/mcp-server/tools/knowledgeListDatasources.ts +35 -0
  259. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieve.ts +37 -0
  260. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveChunk.ts +35 -0
  261. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveDatasource.ts +35 -0
  262. package/packages/orq-rc/src/mcp-server/tools/knowledgeSearch.ts +37 -0
  263. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdate.ts +35 -0
  264. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateChunk.ts +35 -0
  265. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateDatasource.ts +35 -0
  266. package/packages/orq-rc/src/mcp-server/tools/modelsList.ts +30 -0
  267. package/packages/orq-rc/src/mcp-server/tools/promptsCreate.ts +35 -0
  268. package/packages/orq-rc/src/mcp-server/tools/promptsDelete.ts +33 -0
  269. package/packages/orq-rc/src/mcp-server/tools/promptsGetVersion.ts +37 -0
  270. package/packages/orq-rc/src/mcp-server/tools/promptsList.ts +37 -0
  271. package/packages/orq-rc/src/mcp-server/tools/promptsListVersions.ts +37 -0
  272. package/packages/orq-rc/src/mcp-server/tools/promptsRetrieve.ts +37 -0
  273. package/packages/orq-rc/src/mcp-server/tools/promptsUpdate.ts +35 -0
  274. package/packages/orq-rc/src/mcp-server/tools/remoteconfigsRetrieve.ts +36 -0
  275. package/packages/orq-rc/src/mcp-server/tools.ts +129 -0
  276. package/packages/orq-rc/src/models/components/deployments.ts +7289 -0
  277. package/packages/orq-rc/src/models/components/index.ts +6 -0
  278. package/packages/orq-rc/src/models/components/security.ts +71 -0
  279. package/packages/orq-rc/src/models/errors/apierror.ts +27 -0
  280. package/packages/orq-rc/src/models/errors/getpromptversion.ts +71 -0
  281. package/packages/orq-rc/src/models/errors/honoapierror.ts +82 -0
  282. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +62 -0
  283. package/packages/orq-rc/src/models/errors/index.ts +10 -0
  284. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +97 -0
  285. package/packages/orq-rc/src/models/errors/updateprompt.ts +71 -0
  286. package/packages/orq-rc/src/models/operations/bulkcreatedatapoints.ts +2232 -0
  287. package/packages/orq-rc/src/models/operations/cleardataset.ts +75 -0
  288. package/packages/orq-rc/src/models/operations/createchunk.ts +432 -0
  289. package/packages/orq-rc/src/models/operations/createcontact.ts +256 -0
  290. package/packages/orq-rc/src/models/operations/createdataset.ts +296 -0
  291. package/packages/orq-rc/src/models/operations/createdatasetexperiment.ts +307 -0
  292. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2149 -0
  293. package/packages/orq-rc/src/models/operations/createdatasource.ts +852 -0
  294. package/packages/orq-rc/src/models/operations/createdeploymentexperiment.ts +321 -0
  295. package/packages/orq-rc/src/models/operations/createfeedback.ts +286 -0
  296. package/packages/orq-rc/src/models/operations/createknowledge.ts +846 -0
  297. package/packages/orq-rc/src/models/operations/createprompt.ts +4079 -0
  298. package/packages/orq-rc/src/models/operations/deletechunk.ts +96 -0
  299. package/packages/orq-rc/src/models/operations/deletedatapoint.ts +81 -0
  300. package/packages/orq-rc/src/models/operations/deletedataset.ts +75 -0
  301. package/packages/orq-rc/src/models/operations/deletedatasource.ts +87 -0
  302. package/packages/orq-rc/src/models/operations/deleteknowledge.ts +78 -0
  303. package/packages/orq-rc/src/models/operations/deleteprompt.ts +69 -0
  304. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +5435 -0
  305. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +9378 -0
  306. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +1255 -0
  307. package/packages/orq-rc/src/models/operations/deployments.ts +2316 -0
  308. package/packages/orq-rc/src/models/operations/deploymentstream.ts +9499 -0
  309. package/packages/orq-rc/src/models/operations/filedelete.ts +78 -0
  310. package/packages/orq-rc/src/models/operations/fileget.ts +223 -0
  311. package/packages/orq-rc/src/models/operations/filelist.ts +337 -0
  312. package/packages/orq-rc/src/models/operations/fileupload.ts +327 -0
  313. package/packages/orq-rc/src/models/operations/getallprompts.ts +2294 -0
  314. package/packages/orq-rc/src/models/operations/getonechunk.ts +315 -0
  315. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +537 -0
  316. package/packages/orq-rc/src/models/operations/getoneprompt.ts +2155 -0
  317. package/packages/orq-rc/src/models/operations/getpromptversion.ts +2160 -0
  318. package/packages/orq-rc/src/models/operations/index.ts +54 -0
  319. package/packages/orq-rc/src/models/operations/listchunks.ts +494 -0
  320. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +1276 -0
  321. package/packages/orq-rc/src/models/operations/listdatasets.ts +406 -0
  322. package/packages/orq-rc/src/models/operations/listdatasources.ts +447 -0
  323. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +663 -0
  324. package/packages/orq-rc/src/models/operations/listmodels.ts +273 -0
  325. package/packages/orq-rc/src/models/operations/listpromptversions.ts +2292 -0
  326. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +190 -0
  327. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +1126 -0
  328. package/packages/orq-rc/src/models/operations/retrievedataset.ts +288 -0
  329. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +273 -0
  330. package/packages/orq-rc/src/models/operations/searchknowledge.ts +3367 -0
  331. package/packages/orq-rc/src/models/operations/updatechunk.ts +448 -0
  332. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2139 -0
  333. package/packages/orq-rc/src/models/operations/updatedataset.ts +393 -0
  334. package/packages/orq-rc/src/models/operations/updatedatasource.ts +345 -0
  335. package/packages/orq-rc/src/models/operations/updateknowledge.ts +980 -0
  336. package/packages/orq-rc/src/models/operations/updateprompt.ts +4261 -0
  337. package/packages/orq-rc/src/sdk/contacts.ts +27 -0
  338. package/packages/orq-rc/src/sdk/datasets.ts +240 -0
  339. package/packages/orq-rc/src/sdk/deployments.ts +107 -0
  340. package/packages/orq-rc/src/sdk/feedback.ts +27 -0
  341. package/packages/orq-rc/src/sdk/files.ts +78 -0
  342. package/packages/orq-rc/src/sdk/index.ts +5 -0
  343. package/packages/orq-rc/src/sdk/knowledge.ts +264 -0
  344. package/packages/orq-rc/src/sdk/metrics.ts +27 -0
  345. package/packages/orq-rc/src/sdk/models.ts +25 -0
  346. package/packages/orq-rc/src/sdk/prompts.ts +126 -0
  347. package/packages/orq-rc/src/sdk/remoteconfigs.ts +24 -0
  348. package/packages/orq-rc/src/sdk/sdk.ts +61 -0
  349. package/packages/orq-rc/src/types/async.ts +68 -0
  350. package/packages/orq-rc/src/types/blobs.ts +31 -0
  351. package/packages/orq-rc/src/types/constdatetime.ts +15 -0
  352. package/packages/orq-rc/src/types/enums.ts +16 -0
  353. package/packages/orq-rc/src/types/fp.ts +50 -0
  354. package/packages/orq-rc/src/types/index.ts +11 -0
  355. package/packages/orq-rc/src/types/operations.ts +105 -0
  356. package/packages/orq-rc/src/types/rfcdate.ts +54 -0
  357. package/packages/orq-rc/src/types/streams.ts +21 -0
  358. package/packages/orq-rc/tsconfig.json +41 -0
  359. package/sdk/knowledge.d.ts +7 -0
  360. package/sdk/knowledge.d.ts.map +1 -1
  361. package/sdk/knowledge.js +10 -0
  362. package/sdk/knowledge.js.map +1 -1
  363. package/src/funcs/knowledgeCreateDatasource.ts +2 -2
  364. package/src/funcs/knowledgeSearch.ts +161 -0
  365. package/src/lib/config.ts +3 -3
  366. package/src/mcp-server/cli/start/impl.ts +2 -2
  367. package/src/mcp-server/mcp-server.ts +1 -1
  368. package/src/mcp-server/server.ts +3 -1
  369. package/src/mcp-server/tools/knowledgeSearch.ts +37 -0
  370. package/src/models/components/deployments.ts +2762 -127
  371. package/src/models/operations/bulkcreatedatapoints.ts +416 -12
  372. package/src/models/operations/createchunk.ts +65 -35
  373. package/src/models/operations/createcontact.ts +2 -2
  374. package/src/models/operations/createdataset.ts +2 -2
  375. package/src/models/operations/createdatasetitem.ts +410 -13
  376. package/src/models/operations/createdatasource.ts +2 -2
  377. package/src/models/operations/createprompt.ts +400 -12
  378. package/src/models/operations/deploymentgetconfig.ts +2906 -105
  379. package/src/models/operations/deployments.ts +211 -23
  380. package/src/models/operations/deploymentstream.ts +3074 -98
  381. package/src/models/operations/fileget.ts +2 -2
  382. package/src/models/operations/filelist.ts +2 -2
  383. package/src/models/operations/fileupload.ts +2 -2
  384. package/src/models/operations/getallprompts.ts +200 -6
  385. package/src/models/operations/getonechunk.ts +55 -5
  386. package/src/models/operations/getoneprompt.ts +195 -6
  387. package/src/models/operations/getpromptversion.ts +204 -6
  388. package/src/models/operations/index.ts +1 -0
  389. package/src/models/operations/listchunks.ts +55 -5
  390. package/src/models/operations/listdatasetdatapoints.ts +207 -8
  391. package/src/models/operations/listdatasets.ts +2 -2
  392. package/src/models/operations/listdatasources.ts +2 -2
  393. package/src/models/operations/listpromptversions.ts +202 -6
  394. package/src/models/operations/retrievedatapoint.ts +204 -8
  395. package/src/models/operations/retrievedataset.ts +2 -2
  396. package/src/models/operations/retrievedatasource.ts +2 -2
  397. package/src/models/operations/searchknowledge.ts +3367 -0
  398. package/src/models/operations/updatechunk.ts +65 -35
  399. package/src/models/operations/updatedatapoint.ts +412 -14
  400. package/src/models/operations/updatedataset.ts +2 -2
  401. package/src/models/operations/updatedatasource.ts +2 -2
  402. package/src/models/operations/updateprompt.ts +400 -12
  403. package/src/sdk/knowledge.ts +18 -0
@@ -0,0 +1,1255 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
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
+ export type DeploymentInvokeGlobals = {
13
+ environment?: string | undefined;
14
+ contactId?: string | undefined;
15
+ };
16
+
17
+ /**
18
+ * Indicates the type of model used to generate the response
19
+ */
20
+ export const DeploymentInvokeObject = {
21
+ Chat: "chat",
22
+ Completion: "completion",
23
+ Image: "image",
24
+ Vision: "vision",
25
+ } as const;
26
+ /**
27
+ * Indicates the type of model used to generate the response
28
+ */
29
+ export type DeploymentInvokeObject = ClosedEnum<typeof DeploymentInvokeObject>;
30
+
31
+ /**
32
+ * The provider used to generate the response
33
+ */
34
+ export const DeploymentInvokeProvider = {
35
+ Cohere: "cohere",
36
+ Openai: "openai",
37
+ Anthropic: "anthropic",
38
+ Huggingface: "huggingface",
39
+ Replicate: "replicate",
40
+ Google: "google",
41
+ GoogleAi: "google-ai",
42
+ Azure: "azure",
43
+ Aws: "aws",
44
+ Anyscale: "anyscale",
45
+ Perplexity: "perplexity",
46
+ Groq: "groq",
47
+ Fal: "fal",
48
+ Leonardoai: "leonardoai",
49
+ Nvidia: "nvidia",
50
+ Jina: "jina",
51
+ Togetherai: "togetherai",
52
+ Elevenlabs: "elevenlabs",
53
+ } as const;
54
+ /**
55
+ * The provider used to generate the response
56
+ */
57
+ export type DeploymentInvokeProvider = ClosedEnum<
58
+ typeof DeploymentInvokeProvider
59
+ >;
60
+
61
+ /**
62
+ * Metadata of the retrieved chunk from the knowledge base
63
+ */
64
+ export type DeploymentInvokeMetadata = {
65
+ /**
66
+ * Name of the file
67
+ */
68
+ fileName: string;
69
+ /**
70
+ * Page number of the chunk
71
+ */
72
+ pageNumber: number | null;
73
+ /**
74
+ * Type of the file
75
+ */
76
+ fileType: string;
77
+ /**
78
+ * Rerank scores are normalized to be in the range [0, 1]. Scores close to 1 indicate a high relevance to the query, and scores closer to 0 indicate low relevance. It is not accurate to assume a score of 0.9 means the document is 2x more relevant than a document with a score of 0.45
79
+ */
80
+ rerankScore?: number | undefined;
81
+ /**
82
+ * Search scores are normalized to be in the range [0, 1]. Search score is calculated based on `[Cosine Similarity](https://en.wikipedia.org/wiki/Cosine_similarity)` algorithm. Scores close to 1 indicate the document is closer to the query, and scores closer to 0 indicate the document is farther from the query.
83
+ */
84
+ searchScore: number;
85
+ };
86
+
87
+ export type Retrievals = {
88
+ /**
89
+ * Content of the retrieved chunk from the knowledge base
90
+ */
91
+ document: string;
92
+ /**
93
+ * Metadata of the retrieved chunk from the knowledge base
94
+ */
95
+ metadata: DeploymentInvokeMetadata;
96
+ };
97
+
98
+ export const DeploymentInvokeMessageDeploymentsType = {
99
+ Image: "image",
100
+ } as const;
101
+ export type DeploymentInvokeMessageDeploymentsType = ClosedEnum<
102
+ typeof DeploymentInvokeMessageDeploymentsType
103
+ >;
104
+
105
+ /**
106
+ * The role of the prompt message
107
+ */
108
+ export const DeploymentInvokeMessageDeploymentsRole = {
109
+ System: "system",
110
+ Assistant: "assistant",
111
+ User: "user",
112
+ Exception: "exception",
113
+ Tool: "tool",
114
+ Prompt: "prompt",
115
+ Correction: "correction",
116
+ ExpectedOutput: "expected_output",
117
+ } as const;
118
+ /**
119
+ * The role of the prompt message
120
+ */
121
+ export type DeploymentInvokeMessageDeploymentsRole = ClosedEnum<
122
+ typeof DeploymentInvokeMessageDeploymentsRole
123
+ >;
124
+
125
+ export type Message3 = {
126
+ type: DeploymentInvokeMessageDeploymentsType;
127
+ /**
128
+ * The role of the prompt message
129
+ */
130
+ role: DeploymentInvokeMessageDeploymentsRole;
131
+ url: string;
132
+ };
133
+
134
+ export const DeploymentInvokeMessageType = {
135
+ Content: "content",
136
+ } as const;
137
+ export type DeploymentInvokeMessageType = ClosedEnum<
138
+ typeof DeploymentInvokeMessageType
139
+ >;
140
+
141
+ /**
142
+ * The role of the prompt message
143
+ */
144
+ export const DeploymentInvokeMessageRole = {
145
+ System: "system",
146
+ Assistant: "assistant",
147
+ User: "user",
148
+ Exception: "exception",
149
+ Tool: "tool",
150
+ Prompt: "prompt",
151
+ Correction: "correction",
152
+ ExpectedOutput: "expected_output",
153
+ } as const;
154
+ /**
155
+ * The role of the prompt message
156
+ */
157
+ export type DeploymentInvokeMessageRole = ClosedEnum<
158
+ typeof DeploymentInvokeMessageRole
159
+ >;
160
+
161
+ export type Message2 = {
162
+ type: DeploymentInvokeMessageType;
163
+ /**
164
+ * The role of the prompt message
165
+ */
166
+ role: DeploymentInvokeMessageRole;
167
+ content: string | null;
168
+ /**
169
+ * Internal thought process of the model
170
+ */
171
+ reasoning?: string | undefined;
172
+ /**
173
+ * The signature holds a cryptographic token which verifies that the thinking block was generated by the model, and is verified when thinking is part of a multiturn conversation. This value should not be modified and should always be sent to the API when the reasoning is redacted. Currently only supported by `Anthropic`.
174
+ */
175
+ reasoningSignature?: string | undefined;
176
+ /**
177
+ * Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context.
178
+ */
179
+ redactedReasoning?: string | undefined;
180
+ };
181
+
182
+ export const MessageType = {
183
+ ToolCalls: "tool_calls",
184
+ } as const;
185
+ export type MessageType = ClosedEnum<typeof MessageType>;
186
+
187
+ /**
188
+ * The role of the prompt message
189
+ */
190
+ export const MessageRole = {
191
+ System: "system",
192
+ Assistant: "assistant",
193
+ User: "user",
194
+ Exception: "exception",
195
+ Tool: "tool",
196
+ Prompt: "prompt",
197
+ Correction: "correction",
198
+ ExpectedOutput: "expected_output",
199
+ } as const;
200
+ /**
201
+ * The role of the prompt message
202
+ */
203
+ export type MessageRole = ClosedEnum<typeof MessageRole>;
204
+
205
+ export const DeploymentInvokeMessageDeploymentsResponseType = {
206
+ Function: "function",
207
+ } as const;
208
+ export type DeploymentInvokeMessageDeploymentsResponseType = ClosedEnum<
209
+ typeof DeploymentInvokeMessageDeploymentsResponseType
210
+ >;
211
+
212
+ export type MessageFunction = {
213
+ name: string;
214
+ /**
215
+ * JSON string arguments for the functions
216
+ */
217
+ arguments: string;
218
+ };
219
+
220
+ export type MessageToolCalls = {
221
+ id?: string | undefined;
222
+ index?: number | undefined;
223
+ type: DeploymentInvokeMessageDeploymentsResponseType;
224
+ function: MessageFunction;
225
+ };
226
+
227
+ export type Message1 = {
228
+ type: MessageType;
229
+ /**
230
+ * The role of the prompt message
231
+ */
232
+ role: MessageRole;
233
+ content?: string | null | undefined;
234
+ toolCalls: Array<MessageToolCalls>;
235
+ /**
236
+ * Internal thought process of the model
237
+ */
238
+ reasoning?: string | undefined;
239
+ /**
240
+ * The signature holds a cryptographic token which verifies that the thinking block was generated by the model, and is verified when thinking is part of a multiturn conversation. This value should not be modified and should always be sent to the API when the reasoning is redacted. Currently only supported by `Anthropic`.
241
+ */
242
+ reasoningSignature?: string | undefined;
243
+ /**
244
+ * Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context.
245
+ */
246
+ redactedReasoning?: string | undefined;
247
+ };
248
+
249
+ export type Message = Message3 | Message2 | Message1;
250
+
251
+ export type DeploymentInvokeChoices = {
252
+ index: number;
253
+ message: Message3 | Message2 | Message1;
254
+ finishReason?: string | null | undefined;
255
+ };
256
+
257
+ /**
258
+ * Successful operation
259
+ */
260
+ export type DeploymentInvokeResponseBody = {
261
+ /**
262
+ * A unique identifier for the response. Can be used to add metrics to the transaction.
263
+ */
264
+ id: string;
265
+ /**
266
+ * A timestamp indicating when the object was created. Usually in a standardized format like ISO 8601
267
+ */
268
+ created: Date;
269
+ /**
270
+ * Indicates the type of model used to generate the response
271
+ */
272
+ object: DeploymentInvokeObject;
273
+ /**
274
+ * The model used to generate the response
275
+ */
276
+ model: string;
277
+ /**
278
+ * The provider used to generate the response
279
+ */
280
+ provider: DeploymentInvokeProvider;
281
+ /**
282
+ * Indicates if the response is the final response
283
+ */
284
+ isFinal: boolean;
285
+ /**
286
+ * Indicates integration id used to generate the response
287
+ */
288
+ integrationId?: string | undefined;
289
+ /**
290
+ * A timestamp indicating when the object was finalized. Usually in a standardized format like ISO 8601
291
+ */
292
+ finalized?: Date | undefined;
293
+ /**
294
+ * Provider backed system fingerprint.
295
+ */
296
+ systemFingerprint?: string | null | undefined;
297
+ /**
298
+ * List of documents retrieved from the knowledge base. This property is only available when the `include_retrievals` flag is set to `true` in the invoke settings. When stream is set to true, the `retrievals` property will be returned in the last streamed chunk where the property `is_final` is set to `true`.
299
+ */
300
+ retrievals?: Array<Retrievals> | undefined;
301
+ /**
302
+ * Response returned by the model provider. This functionality is only supported when streaming is not used. If streaming is used, the `provider_response` property will be set to `null`.
303
+ */
304
+ providerResponse?: any | undefined;
305
+ /**
306
+ * A list of choices generated by the model
307
+ */
308
+ choices: Array<DeploymentInvokeChoices>;
309
+ };
310
+
311
+ /** @internal */
312
+ export const DeploymentInvokeGlobals$inboundSchema: z.ZodType<
313
+ DeploymentInvokeGlobals,
314
+ z.ZodTypeDef,
315
+ unknown
316
+ > = z.object({
317
+ environment: z.string().optional(),
318
+ contactId: z.string().optional(),
319
+ });
320
+
321
+ /** @internal */
322
+ export type DeploymentInvokeGlobals$Outbound = {
323
+ environment?: string | undefined;
324
+ contactId?: string | undefined;
325
+ };
326
+
327
+ /** @internal */
328
+ export const DeploymentInvokeGlobals$outboundSchema: z.ZodType<
329
+ DeploymentInvokeGlobals$Outbound,
330
+ z.ZodTypeDef,
331
+ DeploymentInvokeGlobals
332
+ > = z.object({
333
+ environment: z.string().optional(),
334
+ contactId: z.string().optional(),
335
+ });
336
+
337
+ /**
338
+ * @internal
339
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
340
+ */
341
+ export namespace DeploymentInvokeGlobals$ {
342
+ /** @deprecated use `DeploymentInvokeGlobals$inboundSchema` instead. */
343
+ export const inboundSchema = DeploymentInvokeGlobals$inboundSchema;
344
+ /** @deprecated use `DeploymentInvokeGlobals$outboundSchema` instead. */
345
+ export const outboundSchema = DeploymentInvokeGlobals$outboundSchema;
346
+ /** @deprecated use `DeploymentInvokeGlobals$Outbound` instead. */
347
+ export type Outbound = DeploymentInvokeGlobals$Outbound;
348
+ }
349
+
350
+ export function deploymentInvokeGlobalsToJSON(
351
+ deploymentInvokeGlobals: DeploymentInvokeGlobals,
352
+ ): string {
353
+ return JSON.stringify(
354
+ DeploymentInvokeGlobals$outboundSchema.parse(deploymentInvokeGlobals),
355
+ );
356
+ }
357
+
358
+ export function deploymentInvokeGlobalsFromJSON(
359
+ jsonString: string,
360
+ ): SafeParseResult<DeploymentInvokeGlobals, SDKValidationError> {
361
+ return safeParse(
362
+ jsonString,
363
+ (x) => DeploymentInvokeGlobals$inboundSchema.parse(JSON.parse(x)),
364
+ `Failed to parse 'DeploymentInvokeGlobals' from JSON`,
365
+ );
366
+ }
367
+
368
+ /** @internal */
369
+ export const DeploymentInvokeObject$inboundSchema: z.ZodNativeEnum<
370
+ typeof DeploymentInvokeObject
371
+ > = z.nativeEnum(DeploymentInvokeObject);
372
+
373
+ /** @internal */
374
+ export const DeploymentInvokeObject$outboundSchema: z.ZodNativeEnum<
375
+ typeof DeploymentInvokeObject
376
+ > = DeploymentInvokeObject$inboundSchema;
377
+
378
+ /**
379
+ * @internal
380
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
381
+ */
382
+ export namespace DeploymentInvokeObject$ {
383
+ /** @deprecated use `DeploymentInvokeObject$inboundSchema` instead. */
384
+ export const inboundSchema = DeploymentInvokeObject$inboundSchema;
385
+ /** @deprecated use `DeploymentInvokeObject$outboundSchema` instead. */
386
+ export const outboundSchema = DeploymentInvokeObject$outboundSchema;
387
+ }
388
+
389
+ /** @internal */
390
+ export const DeploymentInvokeProvider$inboundSchema: z.ZodNativeEnum<
391
+ typeof DeploymentInvokeProvider
392
+ > = z.nativeEnum(DeploymentInvokeProvider);
393
+
394
+ /** @internal */
395
+ export const DeploymentInvokeProvider$outboundSchema: z.ZodNativeEnum<
396
+ typeof DeploymentInvokeProvider
397
+ > = DeploymentInvokeProvider$inboundSchema;
398
+
399
+ /**
400
+ * @internal
401
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
402
+ */
403
+ export namespace DeploymentInvokeProvider$ {
404
+ /** @deprecated use `DeploymentInvokeProvider$inboundSchema` instead. */
405
+ export const inboundSchema = DeploymentInvokeProvider$inboundSchema;
406
+ /** @deprecated use `DeploymentInvokeProvider$outboundSchema` instead. */
407
+ export const outboundSchema = DeploymentInvokeProvider$outboundSchema;
408
+ }
409
+
410
+ /** @internal */
411
+ export const DeploymentInvokeMetadata$inboundSchema: z.ZodType<
412
+ DeploymentInvokeMetadata,
413
+ z.ZodTypeDef,
414
+ unknown
415
+ > = z.object({
416
+ file_name: z.string(),
417
+ page_number: z.nullable(z.number()),
418
+ file_type: z.string(),
419
+ rerank_score: z.number().optional(),
420
+ search_score: z.number(),
421
+ }).transform((v) => {
422
+ return remap$(v, {
423
+ "file_name": "fileName",
424
+ "page_number": "pageNumber",
425
+ "file_type": "fileType",
426
+ "rerank_score": "rerankScore",
427
+ "search_score": "searchScore",
428
+ });
429
+ });
430
+
431
+ /** @internal */
432
+ export type DeploymentInvokeMetadata$Outbound = {
433
+ file_name: string;
434
+ page_number: number | null;
435
+ file_type: string;
436
+ rerank_score?: number | undefined;
437
+ search_score: number;
438
+ };
439
+
440
+ /** @internal */
441
+ export const DeploymentInvokeMetadata$outboundSchema: z.ZodType<
442
+ DeploymentInvokeMetadata$Outbound,
443
+ z.ZodTypeDef,
444
+ DeploymentInvokeMetadata
445
+ > = z.object({
446
+ fileName: z.string(),
447
+ pageNumber: z.nullable(z.number()),
448
+ fileType: z.string(),
449
+ rerankScore: z.number().optional(),
450
+ searchScore: z.number(),
451
+ }).transform((v) => {
452
+ return remap$(v, {
453
+ fileName: "file_name",
454
+ pageNumber: "page_number",
455
+ fileType: "file_type",
456
+ rerankScore: "rerank_score",
457
+ searchScore: "search_score",
458
+ });
459
+ });
460
+
461
+ /**
462
+ * @internal
463
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
464
+ */
465
+ export namespace DeploymentInvokeMetadata$ {
466
+ /** @deprecated use `DeploymentInvokeMetadata$inboundSchema` instead. */
467
+ export const inboundSchema = DeploymentInvokeMetadata$inboundSchema;
468
+ /** @deprecated use `DeploymentInvokeMetadata$outboundSchema` instead. */
469
+ export const outboundSchema = DeploymentInvokeMetadata$outboundSchema;
470
+ /** @deprecated use `DeploymentInvokeMetadata$Outbound` instead. */
471
+ export type Outbound = DeploymentInvokeMetadata$Outbound;
472
+ }
473
+
474
+ export function deploymentInvokeMetadataToJSON(
475
+ deploymentInvokeMetadata: DeploymentInvokeMetadata,
476
+ ): string {
477
+ return JSON.stringify(
478
+ DeploymentInvokeMetadata$outboundSchema.parse(deploymentInvokeMetadata),
479
+ );
480
+ }
481
+
482
+ export function deploymentInvokeMetadataFromJSON(
483
+ jsonString: string,
484
+ ): SafeParseResult<DeploymentInvokeMetadata, SDKValidationError> {
485
+ return safeParse(
486
+ jsonString,
487
+ (x) => DeploymentInvokeMetadata$inboundSchema.parse(JSON.parse(x)),
488
+ `Failed to parse 'DeploymentInvokeMetadata' from JSON`,
489
+ );
490
+ }
491
+
492
+ /** @internal */
493
+ export const Retrievals$inboundSchema: z.ZodType<
494
+ Retrievals,
495
+ z.ZodTypeDef,
496
+ unknown
497
+ > = z.object({
498
+ document: z.string(),
499
+ metadata: z.lazy(() => DeploymentInvokeMetadata$inboundSchema),
500
+ });
501
+
502
+ /** @internal */
503
+ export type Retrievals$Outbound = {
504
+ document: string;
505
+ metadata: DeploymentInvokeMetadata$Outbound;
506
+ };
507
+
508
+ /** @internal */
509
+ export const Retrievals$outboundSchema: z.ZodType<
510
+ Retrievals$Outbound,
511
+ z.ZodTypeDef,
512
+ Retrievals
513
+ > = z.object({
514
+ document: z.string(),
515
+ metadata: z.lazy(() => DeploymentInvokeMetadata$outboundSchema),
516
+ });
517
+
518
+ /**
519
+ * @internal
520
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
521
+ */
522
+ export namespace Retrievals$ {
523
+ /** @deprecated use `Retrievals$inboundSchema` instead. */
524
+ export const inboundSchema = Retrievals$inboundSchema;
525
+ /** @deprecated use `Retrievals$outboundSchema` instead. */
526
+ export const outboundSchema = Retrievals$outboundSchema;
527
+ /** @deprecated use `Retrievals$Outbound` instead. */
528
+ export type Outbound = Retrievals$Outbound;
529
+ }
530
+
531
+ export function retrievalsToJSON(retrievals: Retrievals): string {
532
+ return JSON.stringify(Retrievals$outboundSchema.parse(retrievals));
533
+ }
534
+
535
+ export function retrievalsFromJSON(
536
+ jsonString: string,
537
+ ): SafeParseResult<Retrievals, SDKValidationError> {
538
+ return safeParse(
539
+ jsonString,
540
+ (x) => Retrievals$inboundSchema.parse(JSON.parse(x)),
541
+ `Failed to parse 'Retrievals' from JSON`,
542
+ );
543
+ }
544
+
545
+ /** @internal */
546
+ export const DeploymentInvokeMessageDeploymentsType$inboundSchema:
547
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsType> = z.nativeEnum(
548
+ DeploymentInvokeMessageDeploymentsType,
549
+ );
550
+
551
+ /** @internal */
552
+ export const DeploymentInvokeMessageDeploymentsType$outboundSchema:
553
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsType> =
554
+ DeploymentInvokeMessageDeploymentsType$inboundSchema;
555
+
556
+ /**
557
+ * @internal
558
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
559
+ */
560
+ export namespace DeploymentInvokeMessageDeploymentsType$ {
561
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsType$inboundSchema` instead. */
562
+ export const inboundSchema =
563
+ DeploymentInvokeMessageDeploymentsType$inboundSchema;
564
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsType$outboundSchema` instead. */
565
+ export const outboundSchema =
566
+ DeploymentInvokeMessageDeploymentsType$outboundSchema;
567
+ }
568
+
569
+ /** @internal */
570
+ export const DeploymentInvokeMessageDeploymentsRole$inboundSchema:
571
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsRole> = z.nativeEnum(
572
+ DeploymentInvokeMessageDeploymentsRole,
573
+ );
574
+
575
+ /** @internal */
576
+ export const DeploymentInvokeMessageDeploymentsRole$outboundSchema:
577
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsRole> =
578
+ DeploymentInvokeMessageDeploymentsRole$inboundSchema;
579
+
580
+ /**
581
+ * @internal
582
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
583
+ */
584
+ export namespace DeploymentInvokeMessageDeploymentsRole$ {
585
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsRole$inboundSchema` instead. */
586
+ export const inboundSchema =
587
+ DeploymentInvokeMessageDeploymentsRole$inboundSchema;
588
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsRole$outboundSchema` instead. */
589
+ export const outboundSchema =
590
+ DeploymentInvokeMessageDeploymentsRole$outboundSchema;
591
+ }
592
+
593
+ /** @internal */
594
+ export const Message3$inboundSchema: z.ZodType<
595
+ Message3,
596
+ z.ZodTypeDef,
597
+ unknown
598
+ > = z.object({
599
+ type: DeploymentInvokeMessageDeploymentsType$inboundSchema,
600
+ role: DeploymentInvokeMessageDeploymentsRole$inboundSchema,
601
+ url: z.string(),
602
+ });
603
+
604
+ /** @internal */
605
+ export type Message3$Outbound = {
606
+ type: string;
607
+ role: string;
608
+ url: string;
609
+ };
610
+
611
+ /** @internal */
612
+ export const Message3$outboundSchema: z.ZodType<
613
+ Message3$Outbound,
614
+ z.ZodTypeDef,
615
+ Message3
616
+ > = z.object({
617
+ type: DeploymentInvokeMessageDeploymentsType$outboundSchema,
618
+ role: DeploymentInvokeMessageDeploymentsRole$outboundSchema,
619
+ url: z.string(),
620
+ });
621
+
622
+ /**
623
+ * @internal
624
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
625
+ */
626
+ export namespace Message3$ {
627
+ /** @deprecated use `Message3$inboundSchema` instead. */
628
+ export const inboundSchema = Message3$inboundSchema;
629
+ /** @deprecated use `Message3$outboundSchema` instead. */
630
+ export const outboundSchema = Message3$outboundSchema;
631
+ /** @deprecated use `Message3$Outbound` instead. */
632
+ export type Outbound = Message3$Outbound;
633
+ }
634
+
635
+ export function message3ToJSON(message3: Message3): string {
636
+ return JSON.stringify(Message3$outboundSchema.parse(message3));
637
+ }
638
+
639
+ export function message3FromJSON(
640
+ jsonString: string,
641
+ ): SafeParseResult<Message3, SDKValidationError> {
642
+ return safeParse(
643
+ jsonString,
644
+ (x) => Message3$inboundSchema.parse(JSON.parse(x)),
645
+ `Failed to parse 'Message3' from JSON`,
646
+ );
647
+ }
648
+
649
+ /** @internal */
650
+ export const DeploymentInvokeMessageType$inboundSchema: z.ZodNativeEnum<
651
+ typeof DeploymentInvokeMessageType
652
+ > = z.nativeEnum(DeploymentInvokeMessageType);
653
+
654
+ /** @internal */
655
+ export const DeploymentInvokeMessageType$outboundSchema: z.ZodNativeEnum<
656
+ typeof DeploymentInvokeMessageType
657
+ > = DeploymentInvokeMessageType$inboundSchema;
658
+
659
+ /**
660
+ * @internal
661
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
662
+ */
663
+ export namespace DeploymentInvokeMessageType$ {
664
+ /** @deprecated use `DeploymentInvokeMessageType$inboundSchema` instead. */
665
+ export const inboundSchema = DeploymentInvokeMessageType$inboundSchema;
666
+ /** @deprecated use `DeploymentInvokeMessageType$outboundSchema` instead. */
667
+ export const outboundSchema = DeploymentInvokeMessageType$outboundSchema;
668
+ }
669
+
670
+ /** @internal */
671
+ export const DeploymentInvokeMessageRole$inboundSchema: z.ZodNativeEnum<
672
+ typeof DeploymentInvokeMessageRole
673
+ > = z.nativeEnum(DeploymentInvokeMessageRole);
674
+
675
+ /** @internal */
676
+ export const DeploymentInvokeMessageRole$outboundSchema: z.ZodNativeEnum<
677
+ typeof DeploymentInvokeMessageRole
678
+ > = DeploymentInvokeMessageRole$inboundSchema;
679
+
680
+ /**
681
+ * @internal
682
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
683
+ */
684
+ export namespace DeploymentInvokeMessageRole$ {
685
+ /** @deprecated use `DeploymentInvokeMessageRole$inboundSchema` instead. */
686
+ export const inboundSchema = DeploymentInvokeMessageRole$inboundSchema;
687
+ /** @deprecated use `DeploymentInvokeMessageRole$outboundSchema` instead. */
688
+ export const outboundSchema = DeploymentInvokeMessageRole$outboundSchema;
689
+ }
690
+
691
+ /** @internal */
692
+ export const Message2$inboundSchema: z.ZodType<
693
+ Message2,
694
+ z.ZodTypeDef,
695
+ unknown
696
+ > = z.object({
697
+ type: DeploymentInvokeMessageType$inboundSchema,
698
+ role: DeploymentInvokeMessageRole$inboundSchema,
699
+ content: z.nullable(z.string()),
700
+ reasoning: z.string().optional(),
701
+ reasoning_signature: z.string().optional(),
702
+ redacted_reasoning: z.string().optional(),
703
+ }).transform((v) => {
704
+ return remap$(v, {
705
+ "reasoning_signature": "reasoningSignature",
706
+ "redacted_reasoning": "redactedReasoning",
707
+ });
708
+ });
709
+
710
+ /** @internal */
711
+ export type Message2$Outbound = {
712
+ type: string;
713
+ role: string;
714
+ content: string | null;
715
+ reasoning?: string | undefined;
716
+ reasoning_signature?: string | undefined;
717
+ redacted_reasoning?: string | undefined;
718
+ };
719
+
720
+ /** @internal */
721
+ export const Message2$outboundSchema: z.ZodType<
722
+ Message2$Outbound,
723
+ z.ZodTypeDef,
724
+ Message2
725
+ > = z.object({
726
+ type: DeploymentInvokeMessageType$outboundSchema,
727
+ role: DeploymentInvokeMessageRole$outboundSchema,
728
+ content: z.nullable(z.string()),
729
+ reasoning: z.string().optional(),
730
+ reasoningSignature: z.string().optional(),
731
+ redactedReasoning: z.string().optional(),
732
+ }).transform((v) => {
733
+ return remap$(v, {
734
+ reasoningSignature: "reasoning_signature",
735
+ redactedReasoning: "redacted_reasoning",
736
+ });
737
+ });
738
+
739
+ /**
740
+ * @internal
741
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
742
+ */
743
+ export namespace Message2$ {
744
+ /** @deprecated use `Message2$inboundSchema` instead. */
745
+ export const inboundSchema = Message2$inboundSchema;
746
+ /** @deprecated use `Message2$outboundSchema` instead. */
747
+ export const outboundSchema = Message2$outboundSchema;
748
+ /** @deprecated use `Message2$Outbound` instead. */
749
+ export type Outbound = Message2$Outbound;
750
+ }
751
+
752
+ export function message2ToJSON(message2: Message2): string {
753
+ return JSON.stringify(Message2$outboundSchema.parse(message2));
754
+ }
755
+
756
+ export function message2FromJSON(
757
+ jsonString: string,
758
+ ): SafeParseResult<Message2, SDKValidationError> {
759
+ return safeParse(
760
+ jsonString,
761
+ (x) => Message2$inboundSchema.parse(JSON.parse(x)),
762
+ `Failed to parse 'Message2' from JSON`,
763
+ );
764
+ }
765
+
766
+ /** @internal */
767
+ export const MessageType$inboundSchema: z.ZodNativeEnum<typeof MessageType> = z
768
+ .nativeEnum(MessageType);
769
+
770
+ /** @internal */
771
+ export const MessageType$outboundSchema: z.ZodNativeEnum<typeof MessageType> =
772
+ MessageType$inboundSchema;
773
+
774
+ /**
775
+ * @internal
776
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
777
+ */
778
+ export namespace MessageType$ {
779
+ /** @deprecated use `MessageType$inboundSchema` instead. */
780
+ export const inboundSchema = MessageType$inboundSchema;
781
+ /** @deprecated use `MessageType$outboundSchema` instead. */
782
+ export const outboundSchema = MessageType$outboundSchema;
783
+ }
784
+
785
+ /** @internal */
786
+ export const MessageRole$inboundSchema: z.ZodNativeEnum<typeof MessageRole> = z
787
+ .nativeEnum(MessageRole);
788
+
789
+ /** @internal */
790
+ export const MessageRole$outboundSchema: z.ZodNativeEnum<typeof MessageRole> =
791
+ MessageRole$inboundSchema;
792
+
793
+ /**
794
+ * @internal
795
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
796
+ */
797
+ export namespace MessageRole$ {
798
+ /** @deprecated use `MessageRole$inboundSchema` instead. */
799
+ export const inboundSchema = MessageRole$inboundSchema;
800
+ /** @deprecated use `MessageRole$outboundSchema` instead. */
801
+ export const outboundSchema = MessageRole$outboundSchema;
802
+ }
803
+
804
+ /** @internal */
805
+ export const DeploymentInvokeMessageDeploymentsResponseType$inboundSchema:
806
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsResponseType> = z
807
+ .nativeEnum(DeploymentInvokeMessageDeploymentsResponseType);
808
+
809
+ /** @internal */
810
+ export const DeploymentInvokeMessageDeploymentsResponseType$outboundSchema:
811
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsResponseType> =
812
+ DeploymentInvokeMessageDeploymentsResponseType$inboundSchema;
813
+
814
+ /**
815
+ * @internal
816
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
817
+ */
818
+ export namespace DeploymentInvokeMessageDeploymentsResponseType$ {
819
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsResponseType$inboundSchema` instead. */
820
+ export const inboundSchema =
821
+ DeploymentInvokeMessageDeploymentsResponseType$inboundSchema;
822
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsResponseType$outboundSchema` instead. */
823
+ export const outboundSchema =
824
+ DeploymentInvokeMessageDeploymentsResponseType$outboundSchema;
825
+ }
826
+
827
+ /** @internal */
828
+ export const MessageFunction$inboundSchema: z.ZodType<
829
+ MessageFunction,
830
+ z.ZodTypeDef,
831
+ unknown
832
+ > = z.object({
833
+ name: z.string(),
834
+ arguments: z.string(),
835
+ });
836
+
837
+ /** @internal */
838
+ export type MessageFunction$Outbound = {
839
+ name: string;
840
+ arguments: string;
841
+ };
842
+
843
+ /** @internal */
844
+ export const MessageFunction$outboundSchema: z.ZodType<
845
+ MessageFunction$Outbound,
846
+ z.ZodTypeDef,
847
+ MessageFunction
848
+ > = z.object({
849
+ name: z.string(),
850
+ arguments: z.string(),
851
+ });
852
+
853
+ /**
854
+ * @internal
855
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
856
+ */
857
+ export namespace MessageFunction$ {
858
+ /** @deprecated use `MessageFunction$inboundSchema` instead. */
859
+ export const inboundSchema = MessageFunction$inboundSchema;
860
+ /** @deprecated use `MessageFunction$outboundSchema` instead. */
861
+ export const outboundSchema = MessageFunction$outboundSchema;
862
+ /** @deprecated use `MessageFunction$Outbound` instead. */
863
+ export type Outbound = MessageFunction$Outbound;
864
+ }
865
+
866
+ export function messageFunctionToJSON(
867
+ messageFunction: MessageFunction,
868
+ ): string {
869
+ return JSON.stringify(MessageFunction$outboundSchema.parse(messageFunction));
870
+ }
871
+
872
+ export function messageFunctionFromJSON(
873
+ jsonString: string,
874
+ ): SafeParseResult<MessageFunction, SDKValidationError> {
875
+ return safeParse(
876
+ jsonString,
877
+ (x) => MessageFunction$inboundSchema.parse(JSON.parse(x)),
878
+ `Failed to parse 'MessageFunction' from JSON`,
879
+ );
880
+ }
881
+
882
+ /** @internal */
883
+ export const MessageToolCalls$inboundSchema: z.ZodType<
884
+ MessageToolCalls,
885
+ z.ZodTypeDef,
886
+ unknown
887
+ > = z.object({
888
+ id: z.string().optional(),
889
+ index: z.number().optional(),
890
+ type: DeploymentInvokeMessageDeploymentsResponseType$inboundSchema,
891
+ function: z.lazy(() => MessageFunction$inboundSchema),
892
+ });
893
+
894
+ /** @internal */
895
+ export type MessageToolCalls$Outbound = {
896
+ id?: string | undefined;
897
+ index?: number | undefined;
898
+ type: string;
899
+ function: MessageFunction$Outbound;
900
+ };
901
+
902
+ /** @internal */
903
+ export const MessageToolCalls$outboundSchema: z.ZodType<
904
+ MessageToolCalls$Outbound,
905
+ z.ZodTypeDef,
906
+ MessageToolCalls
907
+ > = z.object({
908
+ id: z.string().optional(),
909
+ index: z.number().optional(),
910
+ type: DeploymentInvokeMessageDeploymentsResponseType$outboundSchema,
911
+ function: z.lazy(() => MessageFunction$outboundSchema),
912
+ });
913
+
914
+ /**
915
+ * @internal
916
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
917
+ */
918
+ export namespace MessageToolCalls$ {
919
+ /** @deprecated use `MessageToolCalls$inboundSchema` instead. */
920
+ export const inboundSchema = MessageToolCalls$inboundSchema;
921
+ /** @deprecated use `MessageToolCalls$outboundSchema` instead. */
922
+ export const outboundSchema = MessageToolCalls$outboundSchema;
923
+ /** @deprecated use `MessageToolCalls$Outbound` instead. */
924
+ export type Outbound = MessageToolCalls$Outbound;
925
+ }
926
+
927
+ export function messageToolCallsToJSON(
928
+ messageToolCalls: MessageToolCalls,
929
+ ): string {
930
+ return JSON.stringify(
931
+ MessageToolCalls$outboundSchema.parse(messageToolCalls),
932
+ );
933
+ }
934
+
935
+ export function messageToolCallsFromJSON(
936
+ jsonString: string,
937
+ ): SafeParseResult<MessageToolCalls, SDKValidationError> {
938
+ return safeParse(
939
+ jsonString,
940
+ (x) => MessageToolCalls$inboundSchema.parse(JSON.parse(x)),
941
+ `Failed to parse 'MessageToolCalls' from JSON`,
942
+ );
943
+ }
944
+
945
+ /** @internal */
946
+ export const Message1$inboundSchema: z.ZodType<
947
+ Message1,
948
+ z.ZodTypeDef,
949
+ unknown
950
+ > = z.object({
951
+ type: MessageType$inboundSchema,
952
+ role: MessageRole$inboundSchema,
953
+ content: z.nullable(z.string()).optional(),
954
+ tool_calls: z.array(z.lazy(() => MessageToolCalls$inboundSchema)),
955
+ reasoning: z.string().optional(),
956
+ reasoning_signature: z.string().optional(),
957
+ redacted_reasoning: z.string().optional(),
958
+ }).transform((v) => {
959
+ return remap$(v, {
960
+ "tool_calls": "toolCalls",
961
+ "reasoning_signature": "reasoningSignature",
962
+ "redacted_reasoning": "redactedReasoning",
963
+ });
964
+ });
965
+
966
+ /** @internal */
967
+ export type Message1$Outbound = {
968
+ type: string;
969
+ role: string;
970
+ content?: string | null | undefined;
971
+ tool_calls: Array<MessageToolCalls$Outbound>;
972
+ reasoning?: string | undefined;
973
+ reasoning_signature?: string | undefined;
974
+ redacted_reasoning?: string | undefined;
975
+ };
976
+
977
+ /** @internal */
978
+ export const Message1$outboundSchema: z.ZodType<
979
+ Message1$Outbound,
980
+ z.ZodTypeDef,
981
+ Message1
982
+ > = z.object({
983
+ type: MessageType$outboundSchema,
984
+ role: MessageRole$outboundSchema,
985
+ content: z.nullable(z.string()).optional(),
986
+ toolCalls: z.array(z.lazy(() => MessageToolCalls$outboundSchema)),
987
+ reasoning: z.string().optional(),
988
+ reasoningSignature: z.string().optional(),
989
+ redactedReasoning: z.string().optional(),
990
+ }).transform((v) => {
991
+ return remap$(v, {
992
+ toolCalls: "tool_calls",
993
+ reasoningSignature: "reasoning_signature",
994
+ redactedReasoning: "redacted_reasoning",
995
+ });
996
+ });
997
+
998
+ /**
999
+ * @internal
1000
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1001
+ */
1002
+ export namespace Message1$ {
1003
+ /** @deprecated use `Message1$inboundSchema` instead. */
1004
+ export const inboundSchema = Message1$inboundSchema;
1005
+ /** @deprecated use `Message1$outboundSchema` instead. */
1006
+ export const outboundSchema = Message1$outboundSchema;
1007
+ /** @deprecated use `Message1$Outbound` instead. */
1008
+ export type Outbound = Message1$Outbound;
1009
+ }
1010
+
1011
+ export function message1ToJSON(message1: Message1): string {
1012
+ return JSON.stringify(Message1$outboundSchema.parse(message1));
1013
+ }
1014
+
1015
+ export function message1FromJSON(
1016
+ jsonString: string,
1017
+ ): SafeParseResult<Message1, SDKValidationError> {
1018
+ return safeParse(
1019
+ jsonString,
1020
+ (x) => Message1$inboundSchema.parse(JSON.parse(x)),
1021
+ `Failed to parse 'Message1' from JSON`,
1022
+ );
1023
+ }
1024
+
1025
+ /** @internal */
1026
+ export const Message$inboundSchema: z.ZodType<Message, z.ZodTypeDef, unknown> =
1027
+ z.union([
1028
+ z.lazy(() => Message3$inboundSchema),
1029
+ z.lazy(() => Message2$inboundSchema),
1030
+ z.lazy(() => Message1$inboundSchema),
1031
+ ]);
1032
+
1033
+ /** @internal */
1034
+ export type Message$Outbound =
1035
+ | Message3$Outbound
1036
+ | Message2$Outbound
1037
+ | Message1$Outbound;
1038
+
1039
+ /** @internal */
1040
+ export const Message$outboundSchema: z.ZodType<
1041
+ Message$Outbound,
1042
+ z.ZodTypeDef,
1043
+ Message
1044
+ > = z.union([
1045
+ z.lazy(() => Message3$outboundSchema),
1046
+ z.lazy(() => Message2$outboundSchema),
1047
+ z.lazy(() => Message1$outboundSchema),
1048
+ ]);
1049
+
1050
+ /**
1051
+ * @internal
1052
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1053
+ */
1054
+ export namespace Message$ {
1055
+ /** @deprecated use `Message$inboundSchema` instead. */
1056
+ export const inboundSchema = Message$inboundSchema;
1057
+ /** @deprecated use `Message$outboundSchema` instead. */
1058
+ export const outboundSchema = Message$outboundSchema;
1059
+ /** @deprecated use `Message$Outbound` instead. */
1060
+ export type Outbound = Message$Outbound;
1061
+ }
1062
+
1063
+ export function messageToJSON(message: Message): string {
1064
+ return JSON.stringify(Message$outboundSchema.parse(message));
1065
+ }
1066
+
1067
+ export function messageFromJSON(
1068
+ jsonString: string,
1069
+ ): SafeParseResult<Message, SDKValidationError> {
1070
+ return safeParse(
1071
+ jsonString,
1072
+ (x) => Message$inboundSchema.parse(JSON.parse(x)),
1073
+ `Failed to parse 'Message' from JSON`,
1074
+ );
1075
+ }
1076
+
1077
+ /** @internal */
1078
+ export const DeploymentInvokeChoices$inboundSchema: z.ZodType<
1079
+ DeploymentInvokeChoices,
1080
+ z.ZodTypeDef,
1081
+ unknown
1082
+ > = z.object({
1083
+ index: z.number(),
1084
+ message: z.union([
1085
+ z.lazy(() => Message3$inboundSchema),
1086
+ z.lazy(() => Message2$inboundSchema),
1087
+ z.lazy(() => Message1$inboundSchema),
1088
+ ]),
1089
+ finish_reason: z.nullable(z.string()).optional(),
1090
+ }).transform((v) => {
1091
+ return remap$(v, {
1092
+ "finish_reason": "finishReason",
1093
+ });
1094
+ });
1095
+
1096
+ /** @internal */
1097
+ export type DeploymentInvokeChoices$Outbound = {
1098
+ index: number;
1099
+ message: Message3$Outbound | Message2$Outbound | Message1$Outbound;
1100
+ finish_reason?: string | null | undefined;
1101
+ };
1102
+
1103
+ /** @internal */
1104
+ export const DeploymentInvokeChoices$outboundSchema: z.ZodType<
1105
+ DeploymentInvokeChoices$Outbound,
1106
+ z.ZodTypeDef,
1107
+ DeploymentInvokeChoices
1108
+ > = z.object({
1109
+ index: z.number(),
1110
+ message: z.union([
1111
+ z.lazy(() => Message3$outboundSchema),
1112
+ z.lazy(() => Message2$outboundSchema),
1113
+ z.lazy(() => Message1$outboundSchema),
1114
+ ]),
1115
+ finishReason: z.nullable(z.string()).optional(),
1116
+ }).transform((v) => {
1117
+ return remap$(v, {
1118
+ finishReason: "finish_reason",
1119
+ });
1120
+ });
1121
+
1122
+ /**
1123
+ * @internal
1124
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1125
+ */
1126
+ export namespace DeploymentInvokeChoices$ {
1127
+ /** @deprecated use `DeploymentInvokeChoices$inboundSchema` instead. */
1128
+ export const inboundSchema = DeploymentInvokeChoices$inboundSchema;
1129
+ /** @deprecated use `DeploymentInvokeChoices$outboundSchema` instead. */
1130
+ export const outboundSchema = DeploymentInvokeChoices$outboundSchema;
1131
+ /** @deprecated use `DeploymentInvokeChoices$Outbound` instead. */
1132
+ export type Outbound = DeploymentInvokeChoices$Outbound;
1133
+ }
1134
+
1135
+ export function deploymentInvokeChoicesToJSON(
1136
+ deploymentInvokeChoices: DeploymentInvokeChoices,
1137
+ ): string {
1138
+ return JSON.stringify(
1139
+ DeploymentInvokeChoices$outboundSchema.parse(deploymentInvokeChoices),
1140
+ );
1141
+ }
1142
+
1143
+ export function deploymentInvokeChoicesFromJSON(
1144
+ jsonString: string,
1145
+ ): SafeParseResult<DeploymentInvokeChoices, SDKValidationError> {
1146
+ return safeParse(
1147
+ jsonString,
1148
+ (x) => DeploymentInvokeChoices$inboundSchema.parse(JSON.parse(x)),
1149
+ `Failed to parse 'DeploymentInvokeChoices' from JSON`,
1150
+ );
1151
+ }
1152
+
1153
+ /** @internal */
1154
+ export const DeploymentInvokeResponseBody$inboundSchema: z.ZodType<
1155
+ DeploymentInvokeResponseBody,
1156
+ z.ZodTypeDef,
1157
+ unknown
1158
+ > = z.object({
1159
+ id: z.string(),
1160
+ created: z.string().datetime({ offset: true }).transform(v => new Date(v)),
1161
+ object: DeploymentInvokeObject$inboundSchema,
1162
+ model: z.string(),
1163
+ provider: DeploymentInvokeProvider$inboundSchema,
1164
+ is_final: z.boolean(),
1165
+ integration_id: z.string().optional(),
1166
+ finalized: z.string().datetime({ offset: true }).transform(v => new Date(v))
1167
+ .optional(),
1168
+ system_fingerprint: z.nullable(z.string()).optional(),
1169
+ retrievals: z.array(z.lazy(() => Retrievals$inboundSchema)).optional(),
1170
+ provider_response: z.any().optional(),
1171
+ choices: z.array(z.lazy(() => DeploymentInvokeChoices$inboundSchema)),
1172
+ }).transform((v) => {
1173
+ return remap$(v, {
1174
+ "is_final": "isFinal",
1175
+ "integration_id": "integrationId",
1176
+ "system_fingerprint": "systemFingerprint",
1177
+ "provider_response": "providerResponse",
1178
+ });
1179
+ });
1180
+
1181
+ /** @internal */
1182
+ export type DeploymentInvokeResponseBody$Outbound = {
1183
+ id: string;
1184
+ created: string;
1185
+ object: string;
1186
+ model: string;
1187
+ provider: string;
1188
+ is_final: boolean;
1189
+ integration_id?: string | undefined;
1190
+ finalized?: string | undefined;
1191
+ system_fingerprint?: string | null | undefined;
1192
+ retrievals?: Array<Retrievals$Outbound> | undefined;
1193
+ provider_response?: any | undefined;
1194
+ choices: Array<DeploymentInvokeChoices$Outbound>;
1195
+ };
1196
+
1197
+ /** @internal */
1198
+ export const DeploymentInvokeResponseBody$outboundSchema: z.ZodType<
1199
+ DeploymentInvokeResponseBody$Outbound,
1200
+ z.ZodTypeDef,
1201
+ DeploymentInvokeResponseBody
1202
+ > = z.object({
1203
+ id: z.string(),
1204
+ created: z.date().transform(v => v.toISOString()),
1205
+ object: DeploymentInvokeObject$outboundSchema,
1206
+ model: z.string(),
1207
+ provider: DeploymentInvokeProvider$outboundSchema,
1208
+ isFinal: z.boolean(),
1209
+ integrationId: z.string().optional(),
1210
+ finalized: z.date().transform(v => v.toISOString()).optional(),
1211
+ systemFingerprint: z.nullable(z.string()).optional(),
1212
+ retrievals: z.array(z.lazy(() => Retrievals$outboundSchema)).optional(),
1213
+ providerResponse: z.any().optional(),
1214
+ choices: z.array(z.lazy(() => DeploymentInvokeChoices$outboundSchema)),
1215
+ }).transform((v) => {
1216
+ return remap$(v, {
1217
+ isFinal: "is_final",
1218
+ integrationId: "integration_id",
1219
+ systemFingerprint: "system_fingerprint",
1220
+ providerResponse: "provider_response",
1221
+ });
1222
+ });
1223
+
1224
+ /**
1225
+ * @internal
1226
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1227
+ */
1228
+ export namespace DeploymentInvokeResponseBody$ {
1229
+ /** @deprecated use `DeploymentInvokeResponseBody$inboundSchema` instead. */
1230
+ export const inboundSchema = DeploymentInvokeResponseBody$inboundSchema;
1231
+ /** @deprecated use `DeploymentInvokeResponseBody$outboundSchema` instead. */
1232
+ export const outboundSchema = DeploymentInvokeResponseBody$outboundSchema;
1233
+ /** @deprecated use `DeploymentInvokeResponseBody$Outbound` instead. */
1234
+ export type Outbound = DeploymentInvokeResponseBody$Outbound;
1235
+ }
1236
+
1237
+ export function deploymentInvokeResponseBodyToJSON(
1238
+ deploymentInvokeResponseBody: DeploymentInvokeResponseBody,
1239
+ ): string {
1240
+ return JSON.stringify(
1241
+ DeploymentInvokeResponseBody$outboundSchema.parse(
1242
+ deploymentInvokeResponseBody,
1243
+ ),
1244
+ );
1245
+ }
1246
+
1247
+ export function deploymentInvokeResponseBodyFromJSON(
1248
+ jsonString: string,
1249
+ ): SafeParseResult<DeploymentInvokeResponseBody, SDKValidationError> {
1250
+ return safeParse(
1251
+ jsonString,
1252
+ (x) => DeploymentInvokeResponseBody$inboundSchema.parse(JSON.parse(x)),
1253
+ `Failed to parse 'DeploymentInvokeResponseBody' from JSON`,
1254
+ );
1255
+ }