@orq-ai/node 3.6.0 → 3.7.0-rc.1

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 (284) hide show
  1. package/bin/mcp-server.js +40 -43
  2. package/bin/mcp-server.js.map +24 -24
  3. package/jsr.json +1 -1
  4. package/lib/config.d.ts +2 -2
  5. package/lib/config.js +2 -2
  6. package/lib/config.js.map +1 -1
  7. package/mcp-server/mcp-server.js +1 -1
  8. package/mcp-server/mcp-server.js.map +1 -1
  9. package/mcp-server/server.js +1 -1
  10. package/mcp-server/server.js.map +1 -1
  11. package/models/operations/bulkcreatedatapoints.js +2 -2
  12. package/models/operations/createcontact.js +2 -2
  13. package/models/operations/createdataset.js +2 -2
  14. package/models/operations/createdatasetitem.js +2 -2
  15. package/models/operations/createdatasource.js +2 -2
  16. package/models/operations/fileget.js +2 -2
  17. package/models/operations/filelist.js +2 -2
  18. package/models/operations/fileupload.js +2 -2
  19. package/models/operations/listdatasetdatapoints.js +2 -2
  20. package/models/operations/listdatasets.js +2 -2
  21. package/models/operations/listdatasources.js +2 -2
  22. package/models/operations/retrievedatapoint.js +2 -2
  23. package/models/operations/retrievedataset.js +2 -2
  24. package/models/operations/retrievedatasource.js +2 -2
  25. package/models/operations/updatedatapoint.js +2 -2
  26. package/models/operations/updatedataset.js +2 -2
  27. package/models/operations/updatedatasource.js +2 -2
  28. package/package.json +3 -2
  29. package/src/lib/config.ts +2 -2
  30. package/src/mcp-server/mcp-server.ts +1 -1
  31. package/src/mcp-server/server.ts +1 -1
  32. package/src/models/operations/bulkcreatedatapoints.ts +2 -2
  33. package/src/models/operations/createcontact.ts +2 -2
  34. package/src/models/operations/createdataset.ts +2 -2
  35. package/src/models/operations/createdatasetitem.ts +2 -2
  36. package/src/models/operations/createdatasource.ts +2 -2
  37. package/src/models/operations/fileget.ts +2 -2
  38. package/src/models/operations/filelist.ts +2 -2
  39. package/src/models/operations/fileupload.ts +2 -2
  40. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  41. package/src/models/operations/listdatasets.ts +2 -2
  42. package/src/models/operations/listdatasources.ts +2 -2
  43. package/src/models/operations/retrievedatapoint.ts +2 -2
  44. package/src/models/operations/retrievedataset.ts +2 -2
  45. package/src/models/operations/retrievedatasource.ts +2 -2
  46. package/src/models/operations/updatedatapoint.ts +2 -2
  47. package/src/models/operations/updatedataset.ts +2 -2
  48. package/src/models/operations/updatedatasource.ts +2 -2
  49. package/packages/orq-rc/FUNCTIONS.md +0 -106
  50. package/packages/orq-rc/README.md +0 -707
  51. package/packages/orq-rc/RUNTIMES.md +0 -48
  52. package/packages/orq-rc/docs/sdks/contacts/README.md +0 -84
  53. package/packages/orq-rc/docs/sdks/datasets/README.md +0 -1027
  54. package/packages/orq-rc/docs/sdks/deployments/README.md +0 -405
  55. package/packages/orq-rc/docs/sdks/feedback/README.md +0 -92
  56. package/packages/orq-rc/docs/sdks/files/README.md +0 -311
  57. package/packages/orq-rc/docs/sdks/knowledge/README.md +0 -1285
  58. package/packages/orq-rc/docs/sdks/metrics/README.md +0 -86
  59. package/packages/orq-rc/docs/sdks/models/README.md +0 -79
  60. package/packages/orq-rc/docs/sdks/orq/README.md +0 -10
  61. package/packages/orq-rc/docs/sdks/prompts/README.md +0 -576
  62. package/packages/orq-rc/docs/sdks/remoteconfigs/README.md +0 -80
  63. package/packages/orq-rc/jsr.json +0 -28
  64. package/packages/orq-rc/package-lock.json +0 -3217
  65. package/packages/orq-rc/package.json +0 -45
  66. package/packages/orq-rc/src/core.ts +0 -13
  67. package/packages/orq-rc/src/funcs/contactsCreate.ts +0 -154
  68. package/packages/orq-rc/src/funcs/datasetsClear.ts +0 -161
  69. package/packages/orq-rc/src/funcs/datasetsCreate.ts +0 -159
  70. package/packages/orq-rc/src/funcs/datasetsCreateDatapoint.ts +0 -161
  71. package/packages/orq-rc/src/funcs/datasetsCreateDatapoints.ts +0 -165
  72. package/packages/orq-rc/src/funcs/datasetsCreateExperiment.ts +0 -162
  73. package/packages/orq-rc/src/funcs/datasetsDelete.ts +0 -161
  74. package/packages/orq-rc/src/funcs/datasetsDeleteDatapoint.ts +0 -176
  75. package/packages/orq-rc/src/funcs/datasetsList.ts +0 -161
  76. package/packages/orq-rc/src/funcs/datasetsListDatapoints.ts +0 -168
  77. package/packages/orq-rc/src/funcs/datasetsRetrieve.ts +0 -169
  78. package/packages/orq-rc/src/funcs/datasetsRetrieveDatapoint.ts +0 -175
  79. package/packages/orq-rc/src/funcs/datasetsUpdate.ts +0 -170
  80. package/packages/orq-rc/src/funcs/datasetsUpdateDatapoint.ts +0 -173
  81. package/packages/orq-rc/src/funcs/deploymentsCreateExperiment.ts +0 -167
  82. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +0 -162
  83. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +0 -170
  84. package/packages/orq-rc/src/funcs/deploymentsList.ts +0 -170
  85. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +0 -162
  86. package/packages/orq-rc/src/funcs/deploymentsStream.ts +0 -178
  87. package/packages/orq-rc/src/funcs/feedbackCreate.ts +0 -154
  88. package/packages/orq-rc/src/funcs/filesCreate.ts +0 -174
  89. package/packages/orq-rc/src/funcs/filesDelete.ts +0 -158
  90. package/packages/orq-rc/src/funcs/filesGet.ts +0 -160
  91. package/packages/orq-rc/src/funcs/filesList.ts +0 -161
  92. package/packages/orq-rc/src/funcs/knowledgeCreate.ts +0 -152
  93. package/packages/orq-rc/src/funcs/knowledgeCreateChunks.ts +0 -165
  94. package/packages/orq-rc/src/funcs/knowledgeCreateDatasource.ts +0 -160
  95. package/packages/orq-rc/src/funcs/knowledgeDelete.ts +0 -161
  96. package/packages/orq-rc/src/funcs/knowledgeDeleteChunk.ts +0 -168
  97. package/packages/orq-rc/src/funcs/knowledgeDeleteDatasource.ts +0 -167
  98. package/packages/orq-rc/src/funcs/knowledgeList.ts +0 -163
  99. package/packages/orq-rc/src/funcs/knowledgeListChunks.ts +0 -172
  100. package/packages/orq-rc/src/funcs/knowledgeListDatasources.ts +0 -168
  101. package/packages/orq-rc/src/funcs/knowledgeRetrieve.ts +0 -160
  102. package/packages/orq-rc/src/funcs/knowledgeRetrieveChunk.ts +0 -167
  103. package/packages/orq-rc/src/funcs/knowledgeRetrieveDatasource.ts +0 -163
  104. package/packages/orq-rc/src/funcs/knowledgeSearch.ts +0 -161
  105. package/packages/orq-rc/src/funcs/knowledgeUpdate.ts +0 -158
  106. package/packages/orq-rc/src/funcs/knowledgeUpdateChunk.ts +0 -168
  107. package/packages/orq-rc/src/funcs/knowledgeUpdateDatasource.ts +0 -164
  108. package/packages/orq-rc/src/funcs/modelsList.ts +0 -136
  109. package/packages/orq-rc/src/funcs/promptsCreate.ts +0 -154
  110. package/packages/orq-rc/src/funcs/promptsDelete.ts +0 -158
  111. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +0 -175
  112. package/packages/orq-rc/src/funcs/promptsList.ts +0 -161
  113. package/packages/orq-rc/src/funcs/promptsListVersions.ts +0 -167
  114. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +0 -160
  115. package/packages/orq-rc/src/funcs/promptsUpdate.ts +0 -167
  116. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +0 -155
  117. package/packages/orq-rc/src/hooks/global.ts +0 -44
  118. package/packages/orq-rc/src/hooks/hooks.ts +0 -132
  119. package/packages/orq-rc/src/hooks/index.ts +0 -6
  120. package/packages/orq-rc/src/hooks/registration.ts +0 -15
  121. package/packages/orq-rc/src/hooks/types.ts +0 -110
  122. package/packages/orq-rc/src/index.ts +0 -7
  123. package/packages/orq-rc/src/lib/base64.ts +0 -37
  124. package/packages/orq-rc/src/lib/config.ts +0 -70
  125. package/packages/orq-rc/src/lib/dlv.ts +0 -53
  126. package/packages/orq-rc/src/lib/encodings.ts +0 -483
  127. package/packages/orq-rc/src/lib/env.ts +0 -73
  128. package/packages/orq-rc/src/lib/event-streams.ts +0 -264
  129. package/packages/orq-rc/src/lib/files.ts +0 -40
  130. package/packages/orq-rc/src/lib/http.ts +0 -323
  131. package/packages/orq-rc/src/lib/is-plain-object.ts +0 -43
  132. package/packages/orq-rc/src/lib/logger.ts +0 -9
  133. package/packages/orq-rc/src/lib/matchers.ts +0 -345
  134. package/packages/orq-rc/src/lib/primitives.ts +0 -150
  135. package/packages/orq-rc/src/lib/retries.ts +0 -218
  136. package/packages/orq-rc/src/lib/schemas.ts +0 -91
  137. package/packages/orq-rc/src/lib/sdks.ts +0 -401
  138. package/packages/orq-rc/src/lib/security.ts +0 -261
  139. package/packages/orq-rc/src/lib/url.ts +0 -33
  140. package/packages/orq-rc/src/mcp-server/cli/start/command.ts +0 -125
  141. package/packages/orq-rc/src/mcp-server/cli/start/impl.ts +0 -140
  142. package/packages/orq-rc/src/mcp-server/cli.ts +0 -13
  143. package/packages/orq-rc/src/mcp-server/console-logger.ts +0 -71
  144. package/packages/orq-rc/src/mcp-server/extensions.ts +0 -17
  145. package/packages/orq-rc/src/mcp-server/mcp-server.ts +0 -26
  146. package/packages/orq-rc/src/mcp-server/prompts.ts +0 -117
  147. package/packages/orq-rc/src/mcp-server/resources.ts +0 -172
  148. package/packages/orq-rc/src/mcp-server/scopes.ts +0 -7
  149. package/packages/orq-rc/src/mcp-server/server.ts +0 -163
  150. package/packages/orq-rc/src/mcp-server/shared.ts +0 -75
  151. package/packages/orq-rc/src/mcp-server/tools/contactsCreate.ts +0 -37
  152. package/packages/orq-rc/src/mcp-server/tools/datasetsClear.ts +0 -35
  153. package/packages/orq-rc/src/mcp-server/tools/datasetsCreate.ts +0 -37
  154. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateDatapoint.ts +0 -37
  155. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateDatapoints.ts +0 -37
  156. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateExperiment.ts +0 -37
  157. package/packages/orq-rc/src/mcp-server/tools/datasetsDelete.ts +0 -35
  158. package/packages/orq-rc/src/mcp-server/tools/datasetsDeleteDatapoint.ts +0 -35
  159. package/packages/orq-rc/src/mcp-server/tools/datasetsList.ts +0 -37
  160. package/packages/orq-rc/src/mcp-server/tools/datasetsListDatapoints.ts +0 -37
  161. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieve.ts +0 -37
  162. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieveDatapoint.ts +0 -37
  163. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdate.ts +0 -37
  164. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdateDatapoint.ts +0 -35
  165. package/packages/orq-rc/src/mcp-server/tools/deploymentsCreateExperiment.ts +0 -37
  166. package/packages/orq-rc/src/mcp-server/tools/deploymentsGetConfig.ts +0 -37
  167. package/packages/orq-rc/src/mcp-server/tools/deploymentsInvoke.ts +0 -37
  168. package/packages/orq-rc/src/mcp-server/tools/deploymentsList.ts +0 -37
  169. package/packages/orq-rc/src/mcp-server/tools/deploymentsMetricsCreate.ts +0 -37
  170. package/packages/orq-rc/src/mcp-server/tools/deploymentsStream.ts +0 -37
  171. package/packages/orq-rc/src/mcp-server/tools/feedbackCreate.ts +0 -37
  172. package/packages/orq-rc/src/mcp-server/tools/filesCreate.ts +0 -37
  173. package/packages/orq-rc/src/mcp-server/tools/filesDelete.ts +0 -33
  174. package/packages/orq-rc/src/mcp-server/tools/filesGet.ts +0 -37
  175. package/packages/orq-rc/src/mcp-server/tools/filesList.ts +0 -37
  176. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreate.ts +0 -35
  177. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateChunks.ts +0 -35
  178. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateDatasource.ts +0 -35
  179. package/packages/orq-rc/src/mcp-server/tools/knowledgeDelete.ts +0 -35
  180. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteChunk.ts +0 -33
  181. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteDatasource.ts +0 -35
  182. package/packages/orq-rc/src/mcp-server/tools/knowledgeList.ts +0 -37
  183. package/packages/orq-rc/src/mcp-server/tools/knowledgeListChunks.ts +0 -35
  184. package/packages/orq-rc/src/mcp-server/tools/knowledgeListDatasources.ts +0 -35
  185. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieve.ts +0 -37
  186. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveChunk.ts +0 -35
  187. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveDatasource.ts +0 -35
  188. package/packages/orq-rc/src/mcp-server/tools/knowledgeSearch.ts +0 -37
  189. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdate.ts +0 -35
  190. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateChunk.ts +0 -35
  191. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateDatasource.ts +0 -35
  192. package/packages/orq-rc/src/mcp-server/tools/modelsList.ts +0 -30
  193. package/packages/orq-rc/src/mcp-server/tools/promptsCreate.ts +0 -35
  194. package/packages/orq-rc/src/mcp-server/tools/promptsDelete.ts +0 -33
  195. package/packages/orq-rc/src/mcp-server/tools/promptsGetVersion.ts +0 -37
  196. package/packages/orq-rc/src/mcp-server/tools/promptsList.ts +0 -37
  197. package/packages/orq-rc/src/mcp-server/tools/promptsListVersions.ts +0 -37
  198. package/packages/orq-rc/src/mcp-server/tools/promptsRetrieve.ts +0 -37
  199. package/packages/orq-rc/src/mcp-server/tools/promptsUpdate.ts +0 -35
  200. package/packages/orq-rc/src/mcp-server/tools/remoteconfigsRetrieve.ts +0 -36
  201. package/packages/orq-rc/src/mcp-server/tools.ts +0 -129
  202. package/packages/orq-rc/src/models/components/deployments.ts +0 -7289
  203. package/packages/orq-rc/src/models/components/index.ts +0 -6
  204. package/packages/orq-rc/src/models/components/security.ts +0 -71
  205. package/packages/orq-rc/src/models/errors/apierror.ts +0 -27
  206. package/packages/orq-rc/src/models/errors/getpromptversion.ts +0 -71
  207. package/packages/orq-rc/src/models/errors/honoapierror.ts +0 -82
  208. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +0 -62
  209. package/packages/orq-rc/src/models/errors/index.ts +0 -10
  210. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +0 -97
  211. package/packages/orq-rc/src/models/errors/updateprompt.ts +0 -71
  212. package/packages/orq-rc/src/models/operations/bulkcreatedatapoints.ts +0 -2232
  213. package/packages/orq-rc/src/models/operations/cleardataset.ts +0 -75
  214. package/packages/orq-rc/src/models/operations/createchunk.ts +0 -432
  215. package/packages/orq-rc/src/models/operations/createcontact.ts +0 -256
  216. package/packages/orq-rc/src/models/operations/createdataset.ts +0 -296
  217. package/packages/orq-rc/src/models/operations/createdatasetexperiment.ts +0 -307
  218. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +0 -2149
  219. package/packages/orq-rc/src/models/operations/createdatasource.ts +0 -852
  220. package/packages/orq-rc/src/models/operations/createdeploymentexperiment.ts +0 -321
  221. package/packages/orq-rc/src/models/operations/createfeedback.ts +0 -286
  222. package/packages/orq-rc/src/models/operations/createknowledge.ts +0 -846
  223. package/packages/orq-rc/src/models/operations/createprompt.ts +0 -4079
  224. package/packages/orq-rc/src/models/operations/deletechunk.ts +0 -96
  225. package/packages/orq-rc/src/models/operations/deletedatapoint.ts +0 -81
  226. package/packages/orq-rc/src/models/operations/deletedataset.ts +0 -75
  227. package/packages/orq-rc/src/models/operations/deletedatasource.ts +0 -87
  228. package/packages/orq-rc/src/models/operations/deleteknowledge.ts +0 -78
  229. package/packages/orq-rc/src/models/operations/deleteprompt.ts +0 -69
  230. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +0 -5435
  231. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +0 -9378
  232. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +0 -1255
  233. package/packages/orq-rc/src/models/operations/deployments.ts +0 -2316
  234. package/packages/orq-rc/src/models/operations/deploymentstream.ts +0 -9499
  235. package/packages/orq-rc/src/models/operations/filedelete.ts +0 -78
  236. package/packages/orq-rc/src/models/operations/fileget.ts +0 -223
  237. package/packages/orq-rc/src/models/operations/filelist.ts +0 -337
  238. package/packages/orq-rc/src/models/operations/fileupload.ts +0 -327
  239. package/packages/orq-rc/src/models/operations/getallprompts.ts +0 -2294
  240. package/packages/orq-rc/src/models/operations/getonechunk.ts +0 -315
  241. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +0 -537
  242. package/packages/orq-rc/src/models/operations/getoneprompt.ts +0 -2155
  243. package/packages/orq-rc/src/models/operations/getpromptversion.ts +0 -2160
  244. package/packages/orq-rc/src/models/operations/index.ts +0 -54
  245. package/packages/orq-rc/src/models/operations/listchunks.ts +0 -494
  246. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +0 -1276
  247. package/packages/orq-rc/src/models/operations/listdatasets.ts +0 -406
  248. package/packages/orq-rc/src/models/operations/listdatasources.ts +0 -447
  249. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +0 -663
  250. package/packages/orq-rc/src/models/operations/listmodels.ts +0 -273
  251. package/packages/orq-rc/src/models/operations/listpromptversions.ts +0 -2292
  252. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +0 -190
  253. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +0 -1126
  254. package/packages/orq-rc/src/models/operations/retrievedataset.ts +0 -288
  255. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +0 -273
  256. package/packages/orq-rc/src/models/operations/searchknowledge.ts +0 -3367
  257. package/packages/orq-rc/src/models/operations/updatechunk.ts +0 -448
  258. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +0 -2139
  259. package/packages/orq-rc/src/models/operations/updatedataset.ts +0 -393
  260. package/packages/orq-rc/src/models/operations/updatedatasource.ts +0 -345
  261. package/packages/orq-rc/src/models/operations/updateknowledge.ts +0 -980
  262. package/packages/orq-rc/src/models/operations/updateprompt.ts +0 -4261
  263. package/packages/orq-rc/src/sdk/contacts.ts +0 -27
  264. package/packages/orq-rc/src/sdk/datasets.ts +0 -240
  265. package/packages/orq-rc/src/sdk/deployments.ts +0 -107
  266. package/packages/orq-rc/src/sdk/feedback.ts +0 -27
  267. package/packages/orq-rc/src/sdk/files.ts +0 -78
  268. package/packages/orq-rc/src/sdk/index.ts +0 -5
  269. package/packages/orq-rc/src/sdk/knowledge.ts +0 -264
  270. package/packages/orq-rc/src/sdk/metrics.ts +0 -27
  271. package/packages/orq-rc/src/sdk/models.ts +0 -25
  272. package/packages/orq-rc/src/sdk/prompts.ts +0 -126
  273. package/packages/orq-rc/src/sdk/remoteconfigs.ts +0 -24
  274. package/packages/orq-rc/src/sdk/sdk.ts +0 -61
  275. package/packages/orq-rc/src/types/async.ts +0 -68
  276. package/packages/orq-rc/src/types/blobs.ts +0 -31
  277. package/packages/orq-rc/src/types/constdatetime.ts +0 -15
  278. package/packages/orq-rc/src/types/enums.ts +0 -16
  279. package/packages/orq-rc/src/types/fp.ts +0 -50
  280. package/packages/orq-rc/src/types/index.ts +0 -11
  281. package/packages/orq-rc/src/types/operations.ts +0 -105
  282. package/packages/orq-rc/src/types/rfcdate.ts +0 -54
  283. package/packages/orq-rc/src/types/streams.ts +0 -21
  284. package/packages/orq-rc/tsconfig.json +0 -41
@@ -1,1255 +0,0 @@
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
- }