@orq-ai/node 0.0.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 (468) hide show
  1. package/README.md +556 -0
  2. package/core.d.ts +10 -0
  3. package/core.d.ts.map +1 -0
  4. package/core.js +17 -0
  5. package/core.js.map +1 -0
  6. package/docs/sdks/contacts/README.md +84 -0
  7. package/docs/sdks/deployments/README.md +314 -0
  8. package/docs/sdks/feedback/README.md +92 -0
  9. package/docs/sdks/files/README.md +171 -0
  10. package/docs/sdks/metrics/README.md +86 -0
  11. package/docs/sdks/orq/README.md +10 -0
  12. package/docs/sdks/prompt/README.md +6 -0
  13. package/docs/sdks/prompts/README.md +533 -0
  14. package/docs/sdks/remoteconfig/README.md +80 -0
  15. package/docs/sdks/snippets/README.md +84 -0
  16. package/docs/sdks/templates/README.md +80 -0
  17. package/funcs/contactsCreate.d.ts +15 -0
  18. package/funcs/contactsCreate.d.ts.map +1 -0
  19. package/funcs/contactsCreate.js +105 -0
  20. package/funcs/contactsCreate.js.map +1 -0
  21. package/funcs/deploymentsAll.d.ts +16 -0
  22. package/funcs/deploymentsAll.d.ts.map +1 -0
  23. package/funcs/deploymentsAll.js +113 -0
  24. package/funcs/deploymentsAll.js.map +1 -0
  25. package/funcs/deploymentsGetConfig.d.ts +15 -0
  26. package/funcs/deploymentsGetConfig.d.ts.map +1 -0
  27. package/funcs/deploymentsGetConfig.js +105 -0
  28. package/funcs/deploymentsGetConfig.js.map +1 -0
  29. package/funcs/deploymentsInvalidate.d.ts +15 -0
  30. package/funcs/deploymentsInvalidate.d.ts.map +1 -0
  31. package/funcs/deploymentsInvalidate.js +111 -0
  32. package/funcs/deploymentsInvalidate.js.map +1 -0
  33. package/funcs/deploymentsInvoke.d.ts +22 -0
  34. package/funcs/deploymentsInvoke.d.ts.map +1 -0
  35. package/funcs/deploymentsInvoke.js +115 -0
  36. package/funcs/deploymentsInvoke.js.map +1 -0
  37. package/funcs/deploymentsMetricsCreate.d.ts +15 -0
  38. package/funcs/deploymentsMetricsCreate.d.ts.map +1 -0
  39. package/funcs/deploymentsMetricsCreate.js +111 -0
  40. package/funcs/deploymentsMetricsCreate.js.map +1 -0
  41. package/funcs/feedbackCreate.d.ts +15 -0
  42. package/funcs/feedbackCreate.d.ts.map +1 -0
  43. package/funcs/feedbackCreate.js +105 -0
  44. package/funcs/feedbackCreate.js.map +1 -0
  45. package/funcs/filesBulkUpload.d.ts +15 -0
  46. package/funcs/filesBulkUpload.d.ts.map +1 -0
  47. package/funcs/filesBulkUpload.js +106 -0
  48. package/funcs/filesBulkUpload.js.map +1 -0
  49. package/funcs/filesUpload.d.ts +15 -0
  50. package/funcs/filesUpload.d.ts.map +1 -0
  51. package/funcs/filesUpload.js +122 -0
  52. package/funcs/filesUpload.js.map +1 -0
  53. package/funcs/promptSnippetsFindOne.d.ts +12 -0
  54. package/funcs/promptSnippetsFindOne.d.ts.map +1 -0
  55. package/funcs/promptSnippetsFindOne.js +107 -0
  56. package/funcs/promptSnippetsFindOne.js.map +1 -0
  57. package/funcs/promptTemplatesGetAll.d.ts +12 -0
  58. package/funcs/promptTemplatesGetAll.d.ts.map +1 -0
  59. package/funcs/promptTemplatesGetAll.js +107 -0
  60. package/funcs/promptTemplatesGetAll.js.map +1 -0
  61. package/funcs/promptsCreate.d.ts +12 -0
  62. package/funcs/promptsCreate.d.ts.map +1 -0
  63. package/funcs/promptsCreate.js +104 -0
  64. package/funcs/promptsCreate.js.map +1 -0
  65. package/funcs/promptsCreateVersion.d.ts +12 -0
  66. package/funcs/promptsCreateVersion.d.ts.map +1 -0
  67. package/funcs/promptsCreateVersion.js +108 -0
  68. package/funcs/promptsCreateVersion.js.map +1 -0
  69. package/funcs/promptsDelete.d.ts +12 -0
  70. package/funcs/promptsDelete.d.ts.map +1 -0
  71. package/funcs/promptsDelete.js +108 -0
  72. package/funcs/promptsDelete.js.map +1 -0
  73. package/funcs/promptsDuplicate.d.ts +12 -0
  74. package/funcs/promptsDuplicate.d.ts.map +1 -0
  75. package/funcs/promptsDuplicate.js +108 -0
  76. package/funcs/promptsDuplicate.js.map +1 -0
  77. package/funcs/promptsGetAll.d.ts +12 -0
  78. package/funcs/promptsGetAll.d.ts.map +1 -0
  79. package/funcs/promptsGetAll.js +107 -0
  80. package/funcs/promptsGetAll.js.map +1 -0
  81. package/funcs/promptsGetOne.d.ts +12 -0
  82. package/funcs/promptsGetOne.d.ts.map +1 -0
  83. package/funcs/promptsGetOne.js +108 -0
  84. package/funcs/promptsGetOne.js.map +1 -0
  85. package/funcs/promptsUpdate.d.ts +13 -0
  86. package/funcs/promptsUpdate.d.ts.map +1 -0
  87. package/funcs/promptsUpdate.js +112 -0
  88. package/funcs/promptsUpdate.js.map +1 -0
  89. package/funcs/remoteconfigGetConfig.d.ts +12 -0
  90. package/funcs/remoteconfigGetConfig.d.ts.map +1 -0
  91. package/funcs/remoteconfigGetConfig.js +105 -0
  92. package/funcs/remoteconfigGetConfig.js.map +1 -0
  93. package/hooks/hooks.d.ts +24 -0
  94. package/hooks/hooks.d.ts.map +1 -0
  95. package/hooks/hooks.js +68 -0
  96. package/hooks/hooks.js.map +1 -0
  97. package/hooks/index.d.ts +3 -0
  98. package/hooks/index.d.ts.map +1 -0
  99. package/hooks/index.js +22 -0
  100. package/hooks/index.js.map +1 -0
  101. package/hooks/registration.d.ts +3 -0
  102. package/hooks/registration.d.ts.map +1 -0
  103. package/hooks/registration.js +15 -0
  104. package/hooks/registration.js.map +1 -0
  105. package/hooks/types.d.ts +76 -0
  106. package/hooks/types.d.ts.map +1 -0
  107. package/hooks/types.js +6 -0
  108. package/hooks/types.js.map +1 -0
  109. package/index.d.ts +4 -0
  110. package/index.d.ts.map +1 -0
  111. package/index.js +46 -0
  112. package/index.js.map +1 -0
  113. package/lib/base64.d.ts +10 -0
  114. package/lib/base64.d.ts.map +1 -0
  115. package/lib/base64.js +71 -0
  116. package/lib/base64.js.map +1 -0
  117. package/lib/config.d.ts +34 -0
  118. package/lib/config.d.ts.map +1 -0
  119. package/lib/config.js +36 -0
  120. package/lib/config.js.map +1 -0
  121. package/lib/dlv.d.ts +14 -0
  122. package/lib/dlv.d.ts.map +1 -0
  123. package/lib/dlv.js +49 -0
  124. package/lib/dlv.js.map +1 -0
  125. package/lib/encodings.d.ts +51 -0
  126. package/lib/encodings.d.ts.map +1 -0
  127. package/lib/encodings.js +343 -0
  128. package/lib/encodings.js.map +1 -0
  129. package/lib/env.d.ts +15 -0
  130. package/lib/env.d.ts.map +1 -0
  131. package/lib/env.js +66 -0
  132. package/lib/env.js.map +1 -0
  133. package/lib/event-streams.d.ts +17 -0
  134. package/lib/event-streams.d.ts.map +1 -0
  135. package/lib/event-streams.js +221 -0
  136. package/lib/event-streams.js.map +1 -0
  137. package/lib/files.d.ts +8 -0
  138. package/lib/files.d.ts.map +1 -0
  139. package/lib/files.js +36 -0
  140. package/lib/files.js.map +1 -0
  141. package/lib/http.d.ts +67 -0
  142. package/lib/http.d.ts.map +1 -0
  143. package/lib/http.js +218 -0
  144. package/lib/http.js.map +1 -0
  145. package/lib/is-plain-object.d.ts +2 -0
  146. package/lib/is-plain-object.d.ts.map +1 -0
  147. package/lib/is-plain-object.js +41 -0
  148. package/lib/is-plain-object.js.map +1 -0
  149. package/lib/logger.d.ts +6 -0
  150. package/lib/logger.d.ts.map +1 -0
  151. package/lib/logger.js +6 -0
  152. package/lib/logger.js.map +1 -0
  153. package/lib/matchers.d.ts +64 -0
  154. package/lib/matchers.d.ts.map +1 -0
  155. package/lib/matchers.js +208 -0
  156. package/lib/matchers.js.map +1 -0
  157. package/lib/primitives.d.ts +22 -0
  158. package/lib/primitives.d.ts.map +1 -0
  159. package/lib/primitives.js +94 -0
  160. package/lib/primitives.js.map +1 -0
  161. package/lib/retries.d.ts +38 -0
  162. package/lib/retries.d.ts.map +1 -0
  163. package/lib/retries.js +155 -0
  164. package/lib/retries.js.map +1 -0
  165. package/lib/schemas.d.ts +19 -0
  166. package/lib/schemas.d.ts.map +1 -0
  167. package/lib/schemas.js +59 -0
  168. package/lib/schemas.js.map +1 -0
  169. package/lib/sdks.d.ts +56 -0
  170. package/lib/sdks.d.ts.map +1 -0
  171. package/lib/sdks.js +277 -0
  172. package/lib/sdks.js.map +1 -0
  173. package/lib/security.d.ts +82 -0
  174. package/lib/security.d.ts.map +1 -0
  175. package/lib/security.js +140 -0
  176. package/lib/security.js.map +1 -0
  177. package/lib/url.d.ts +5 -0
  178. package/lib/url.d.ts.map +1 -0
  179. package/lib/url.js +25 -0
  180. package/lib/url.js.map +1 -0
  181. package/models/components/deployments.d.ts +890 -0
  182. package/models/components/deployments.d.ts.map +1 -0
  183. package/models/components/deployments.js +918 -0
  184. package/models/components/deployments.js.map +1 -0
  185. package/models/components/index.d.ts +3 -0
  186. package/models/components/index.d.ts.map +1 -0
  187. package/models/components/index.js +22 -0
  188. package/models/components/index.js.map +1 -0
  189. package/models/components/security.d.ts +29 -0
  190. package/models/components/security.d.ts.map +1 -0
  191. package/models/components/security.js +78 -0
  192. package/models/components/security.js.map +1 -0
  193. package/models/errors/apierror.d.ts +8 -0
  194. package/models/errors/apierror.d.ts.map +1 -0
  195. package/models/errors/apierror.js +21 -0
  196. package/models/errors/apierror.js.map +1 -0
  197. package/models/errors/honoapierror.d.ts +42 -0
  198. package/models/errors/honoapierror.d.ts.map +1 -0
  199. package/models/errors/honoapierror.js +80 -0
  200. package/models/errors/honoapierror.js.map +1 -0
  201. package/models/errors/httpclienterrors.d.ts +44 -0
  202. package/models/errors/httpclienterrors.d.ts.map +1 -0
  203. package/models/errors/httpclienterrors.js +78 -0
  204. package/models/errors/httpclienterrors.js.map +1 -0
  205. package/models/errors/index.d.ts +6 -0
  206. package/models/errors/index.d.ts.map +1 -0
  207. package/models/errors/index.js +25 -0
  208. package/models/errors/index.js.map +1 -0
  209. package/models/errors/sdkvalidationerror.d.ts +20 -0
  210. package/models/errors/sdkvalidationerror.d.ts.map +1 -0
  211. package/models/errors/sdkvalidationerror.js +115 -0
  212. package/models/errors/sdkvalidationerror.js.map +1 -0
  213. package/models/errors/updateprompt.d.ts +36 -0
  214. package/models/errors/updateprompt.d.ts.map +1 -0
  215. package/models/errors/updateprompt.js +79 -0
  216. package/models/errors/updateprompt.js.map +1 -0
  217. package/models/operations/bulkfileupload.d.ts +162 -0
  218. package/models/operations/bulkfileupload.d.ts.map +1 -0
  219. package/models/operations/bulkfileupload.js +204 -0
  220. package/models/operations/bulkfileupload.js.map +1 -0
  221. package/models/operations/createcontact.d.ts +139 -0
  222. package/models/operations/createcontact.d.ts.map +1 -0
  223. package/models/operations/createcontact.js +149 -0
  224. package/models/operations/createcontact.js.map +1 -0
  225. package/models/operations/createfeedback.d.ts +136 -0
  226. package/models/operations/createfeedback.d.ts.map +1 -0
  227. package/models/operations/createfeedback.js +172 -0
  228. package/models/operations/createfeedback.js.map +1 -0
  229. package/models/operations/createprompt.d.ts +2023 -0
  230. package/models/operations/createprompt.d.ts.map +1 -0
  231. package/models/operations/createprompt.js +1849 -0
  232. package/models/operations/createprompt.js.map +1 -0
  233. package/models/operations/createpromptversion.d.ts +1989 -0
  234. package/models/operations/createpromptversion.d.ts.map +1 -0
  235. package/models/operations/createpromptversion.js +1844 -0
  236. package/models/operations/createpromptversion.js.map +1 -0
  237. package/models/operations/deleteprompt.d.ts +32 -0
  238. package/models/operations/deleteprompt.d.ts.map +1 -0
  239. package/models/operations/deleteprompt.js +69 -0
  240. package/models/operations/deleteprompt.js.map +1 -0
  241. package/models/operations/deploymentcreatemetric.d.ts +957 -0
  242. package/models/operations/deploymentcreatemetric.d.ts.map +1 -0
  243. package/models/operations/deploymentcreatemetric.js +954 -0
  244. package/models/operations/deploymentcreatemetric.js.map +1 -0
  245. package/models/operations/deploymentgetconfig.d.ts +1852 -0
  246. package/models/operations/deploymentgetconfig.d.ts.map +1 -0
  247. package/models/operations/deploymentgetconfig.js +1751 -0
  248. package/models/operations/deploymentgetconfig.js.map +1 -0
  249. package/models/operations/deploymentinvoke.d.ts +1344 -0
  250. package/models/operations/deploymentinvoke.d.ts.map +1 -0
  251. package/models/operations/deploymentinvoke.js +1208 -0
  252. package/models/operations/deploymentinvoke.js.map +1 -0
  253. package/models/operations/deployments.d.ts +1223 -0
  254. package/models/operations/deployments.d.ts.map +1 -0
  255. package/models/operations/deployments.js +1101 -0
  256. package/models/operations/deployments.js.map +1 -0
  257. package/models/operations/duplicateprompt.d.ts +32 -0
  258. package/models/operations/duplicateprompt.d.ts.map +1 -0
  259. package/models/operations/duplicateprompt.js +69 -0
  260. package/models/operations/duplicateprompt.js.map +1 -0
  261. package/models/operations/fileupload.d.ts +168 -0
  262. package/models/operations/fileupload.d.ts.map +1 -0
  263. package/models/operations/fileupload.js +206 -0
  264. package/models/operations/fileupload.js.map +1 -0
  265. package/models/operations/findonepromptsnippet.d.ts +6242 -0
  266. package/models/operations/findonepromptsnippet.d.ts.map +1 -0
  267. package/models/operations/findonepromptsnippet.js +5879 -0
  268. package/models/operations/findonepromptsnippet.js.map +1 -0
  269. package/models/operations/getallprompts.d.ts +6577 -0
  270. package/models/operations/getallprompts.d.ts.map +1 -0
  271. package/models/operations/getallprompts.js +6149 -0
  272. package/models/operations/getallprompts.js.map +1 -0
  273. package/models/operations/getallprompttemplates.d.ts +6571 -0
  274. package/models/operations/getallprompttemplates.d.ts.map +1 -0
  275. package/models/operations/getallprompttemplates.js +6213 -0
  276. package/models/operations/getallprompttemplates.js.map +1 -0
  277. package/models/operations/getoneprompt.d.ts +32 -0
  278. package/models/operations/getoneprompt.d.ts.map +1 -0
  279. package/models/operations/getoneprompt.js +69 -0
  280. package/models/operations/getoneprompt.js.map +1 -0
  281. package/models/operations/index.d.ts +20 -0
  282. package/models/operations/index.d.ts.map +1 -0
  283. package/models/operations/index.js +39 -0
  284. package/models/operations/index.js.map +1 -0
  285. package/models/operations/invaliddeployment.d.ts +29 -0
  286. package/models/operations/invaliddeployment.d.ts.map +1 -0
  287. package/models/operations/invaliddeployment.js +78 -0
  288. package/models/operations/invaliddeployment.js.map +1 -0
  289. package/models/operations/remoteconfigsgetconfig.d.ts +121 -0
  290. package/models/operations/remoteconfigsgetconfig.d.ts.map +1 -0
  291. package/models/operations/remoteconfigsgetconfig.js +126 -0
  292. package/models/operations/remoteconfigsgetconfig.js.map +1 -0
  293. package/models/operations/updateprompt.d.ts +7209 -0
  294. package/models/operations/updateprompt.d.ts.map +1 -0
  295. package/models/operations/updateprompt.js +6664 -0
  296. package/models/operations/updateprompt.js.map +1 -0
  297. package/package.json +33 -0
  298. package/sdk/contacts.d.ts +12 -0
  299. package/sdk/contacts.d.ts.map +1 -0
  300. package/sdk/contacts.js +22 -0
  301. package/sdk/contacts.js.map +1 -0
  302. package/sdk/deployments.d.ts +41 -0
  303. package/sdk/deployments.d.ts.map +1 -0
  304. package/sdk/deployments.js +59 -0
  305. package/sdk/deployments.js.map +1 -0
  306. package/sdk/feedback.d.ts +12 -0
  307. package/sdk/feedback.d.ts.map +1 -0
  308. package/sdk/feedback.js +22 -0
  309. package/sdk/feedback.js.map +1 -0
  310. package/sdk/files.d.ts +19 -0
  311. package/sdk/files.d.ts.map +1 -0
  312. package/sdk/files.js +32 -0
  313. package/sdk/files.js.map +1 -0
  314. package/sdk/index.d.ts +2 -0
  315. package/sdk/index.d.ts.map +1 -0
  316. package/sdk/index.js +21 -0
  317. package/sdk/index.js.map +1 -0
  318. package/sdk/metrics.d.ts +12 -0
  319. package/sdk/metrics.d.ts.map +1 -0
  320. package/sdk/metrics.js +22 -0
  321. package/sdk/metrics.js.map +1 -0
  322. package/sdk/prompt.d.ts +10 -0
  323. package/sdk/prompt.d.ts.map +1 -0
  324. package/sdk/prompt.js +21 -0
  325. package/sdk/prompt.js.map +1 -0
  326. package/sdk/prompts.d.ts +33 -0
  327. package/sdk/prompts.d.ts.map +1 -0
  328. package/sdk/prompts.js +61 -0
  329. package/sdk/prompts.js.map +1 -0
  330. package/sdk/remoteconfig.d.ts +9 -0
  331. package/sdk/remoteconfig.d.ts.map +1 -0
  332. package/sdk/remoteconfig.js +19 -0
  333. package/sdk/remoteconfig.js.map +1 -0
  334. package/sdk/sdk.d.ts +25 -0
  335. package/sdk/sdk.d.ts.map +1 -0
  336. package/sdk/sdk.js +46 -0
  337. package/sdk/sdk.js.map +1 -0
  338. package/sdk/snippets.d.ts +9 -0
  339. package/sdk/snippets.d.ts.map +1 -0
  340. package/sdk/snippets.js +19 -0
  341. package/sdk/snippets.js.map +1 -0
  342. package/sdk/templates.d.ts +9 -0
  343. package/sdk/templates.d.ts.map +1 -0
  344. package/sdk/templates.js +19 -0
  345. package/sdk/templates.js.map +1 -0
  346. package/src/core.ts +13 -0
  347. package/src/funcs/contactsCreate.ts +123 -0
  348. package/src/funcs/deploymentsAll.ts +137 -0
  349. package/src/funcs/deploymentsGetConfig.ts +131 -0
  350. package/src/funcs/deploymentsInvalidate.ts +132 -0
  351. package/src/funcs/deploymentsInvoke.ts +134 -0
  352. package/src/funcs/deploymentsMetricsCreate.ts +131 -0
  353. package/src/funcs/feedbackCreate.ts +123 -0
  354. package/src/funcs/filesBulkUpload.ts +125 -0
  355. package/src/funcs/filesUpload.ts +144 -0
  356. package/src/funcs/promptSnippetsFindOne.ts +127 -0
  357. package/src/funcs/promptTemplatesGetAll.ts +129 -0
  358. package/src/funcs/promptsCreate.ts +123 -0
  359. package/src/funcs/promptsCreateVersion.ts +128 -0
  360. package/src/funcs/promptsDelete.ts +127 -0
  361. package/src/funcs/promptsDuplicate.ts +127 -0
  362. package/src/funcs/promptsGetAll.ts +127 -0
  363. package/src/funcs/promptsGetOne.ts +127 -0
  364. package/src/funcs/promptsUpdate.ts +135 -0
  365. package/src/funcs/remoteconfigGetConfig.ts +124 -0
  366. package/src/hooks/hooks.ts +112 -0
  367. package/src/hooks/index.ts +6 -0
  368. package/src/hooks/registration.ts +14 -0
  369. package/src/hooks/types.ts +102 -0
  370. package/src/index.ts +7 -0
  371. package/src/lib/base64.ts +37 -0
  372. package/src/lib/config.ts +60 -0
  373. package/src/lib/dlv.ts +53 -0
  374. package/src/lib/encodings.ts +449 -0
  375. package/src/lib/env.ts +41 -0
  376. package/src/lib/event-streams.ts +264 -0
  377. package/src/lib/files.ts +40 -0
  378. package/src/lib/http.ts +323 -0
  379. package/src/lib/is-plain-object.ts +43 -0
  380. package/src/lib/logger.ts +9 -0
  381. package/src/lib/matchers.ts +325 -0
  382. package/src/lib/primitives.ts +122 -0
  383. package/src/lib/retries.ts +219 -0
  384. package/src/lib/schemas.ts +86 -0
  385. package/src/lib/sdks.ts +392 -0
  386. package/src/lib/security.ts +254 -0
  387. package/src/lib/url.ts +33 -0
  388. package/src/models/components/deployments.ts +1607 -0
  389. package/src/models/components/index.ts +6 -0
  390. package/src/models/components/security.ts +71 -0
  391. package/src/models/errors/apierror.ts +27 -0
  392. package/src/models/errors/honoapierror.ts +82 -0
  393. package/src/models/errors/httpclienterrors.ts +62 -0
  394. package/src/models/errors/index.ts +9 -0
  395. package/src/models/errors/sdkvalidationerror.ts +97 -0
  396. package/src/models/errors/updateprompt.ts +71 -0
  397. package/src/models/operations/bulkfileupload.ts +304 -0
  398. package/src/models/operations/createcontact.ts +256 -0
  399. package/src/models/operations/createfeedback.ts +286 -0
  400. package/src/models/operations/createprompt.ts +3451 -0
  401. package/src/models/operations/createpromptversion.ts +3693 -0
  402. package/src/models/operations/deleteprompt.ts +69 -0
  403. package/src/models/operations/deploymentcreatemetric.ts +1790 -0
  404. package/src/models/operations/deploymentgetconfig.ts +3416 -0
  405. package/src/models/operations/deploymentinvoke.ts +2383 -0
  406. package/src/models/operations/deployments.ts +2084 -0
  407. package/src/models/operations/duplicateprompt.ts +69 -0
  408. package/src/models/operations/fileupload.ts +311 -0
  409. package/src/models/operations/findonepromptsnippet.ts +13617 -0
  410. package/src/models/operations/getallprompts.ts +13378 -0
  411. package/src/models/operations/getallprompttemplates.ts +13678 -0
  412. package/src/models/operations/getoneprompt.ts +69 -0
  413. package/src/models/operations/index.ts +23 -0
  414. package/src/models/operations/invaliddeployment.ts +75 -0
  415. package/src/models/operations/remoteconfigsgetconfig.ts +190 -0
  416. package/src/models/operations/updateprompt.ts +14393 -0
  417. package/src/sdk/contacts.ts +27 -0
  418. package/src/sdk/deployments.ts +93 -0
  419. package/src/sdk/feedback.ts +27 -0
  420. package/src/sdk/files.ts +45 -0
  421. package/src/sdk/index.ts +5 -0
  422. package/src/sdk/metrics.ts +27 -0
  423. package/src/sdk/prompt.ts +19 -0
  424. package/src/sdk/prompts.ts +114 -0
  425. package/src/sdk/remoteconfig.ts +24 -0
  426. package/src/sdk/sdk.ts +49 -0
  427. package/src/sdk/snippets.ts +24 -0
  428. package/src/sdk/templates.ts +24 -0
  429. package/src/types/blobs.ts +31 -0
  430. package/src/types/constdatetime.ts +15 -0
  431. package/src/types/enums.ts +16 -0
  432. package/src/types/fp.ts +50 -0
  433. package/src/types/index.ts +11 -0
  434. package/src/types/operations.ts +105 -0
  435. package/src/types/rfcdate.ts +54 -0
  436. package/src/types/streams.ts +21 -0
  437. package/types/blobs.d.ts +4 -0
  438. package/types/blobs.d.ts.map +1 -0
  439. package/types/blobs.js +62 -0
  440. package/types/blobs.js.map +1 -0
  441. package/types/constdatetime.d.ts +3 -0
  442. package/types/constdatetime.d.ts.map +1 -0
  443. package/types/constdatetime.js +46 -0
  444. package/types/constdatetime.js.map +1 -0
  445. package/types/enums.d.ts +12 -0
  446. package/types/enums.d.ts.map +1 -0
  447. package/types/enums.js +10 -0
  448. package/types/enums.js.map +1 -0
  449. package/types/fp.d.ts +31 -0
  450. package/types/fp.d.ts.map +1 -0
  451. package/types/fp.js +37 -0
  452. package/types/fp.js.map +1 -0
  453. package/types/index.d.ts +8 -0
  454. package/types/index.d.ts.map +1 -0
  455. package/types/index.js +16 -0
  456. package/types/index.js.map +1 -0
  457. package/types/operations.d.ts +27 -0
  458. package/types/operations.d.ts.map +1 -0
  459. package/types/operations.js +83 -0
  460. package/types/operations.js.map +1 -0
  461. package/types/rfcdate.d.ts +21 -0
  462. package/types/rfcdate.d.ts.map +1 -0
  463. package/types/rfcdate.js +46 -0
  464. package/types/rfcdate.js.map +1 -0
  465. package/types/streams.d.ts +2 -0
  466. package/types/streams.d.ts.map +1 -0
  467. package/types/streams.js +18 -0
  468. package/types/streams.js.map +1 -0
@@ -0,0 +1,1607 @@
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 Inputs = string | number | boolean;
13
+
14
+ /**
15
+ * The role of the prompt message
16
+ */
17
+ export const Role = {
18
+ System: "system",
19
+ Assistant: "assistant",
20
+ User: "user",
21
+ Exception: "exception",
22
+ Tool: "tool",
23
+ Prompt: "prompt",
24
+ Correction: "correction",
25
+ ExpectedOutput: "expected_output",
26
+ } as const;
27
+ /**
28
+ * The role of the prompt message
29
+ */
30
+ export type Role = ClosedEnum<typeof Role>;
31
+
32
+ export const TwoType = {
33
+ ImageUrl: "image_url",
34
+ } as const;
35
+ export type TwoType = ClosedEnum<typeof TwoType>;
36
+
37
+ export type ImageUrl = {
38
+ /**
39
+ * Either a URL of the image or the base64 encoded data URI.
40
+ */
41
+ url: string;
42
+ /**
43
+ * Specifies the detail level of the image. Currently only supported with OpenAI models
44
+ */
45
+ detail?: string | undefined;
46
+ };
47
+
48
+ /**
49
+ * The image part of the prompt message. Only supported with vision models.
50
+ */
51
+ export type Two2 = {
52
+ type: TwoType;
53
+ imageUrl: ImageUrl;
54
+ };
55
+
56
+ export const Deployments2Type = {
57
+ Text: "text",
58
+ } as const;
59
+ export type Deployments2Type = ClosedEnum<typeof Deployments2Type>;
60
+
61
+ /**
62
+ * Text content part of a prompt message
63
+ */
64
+ export type One = {
65
+ type: Deployments2Type;
66
+ text: string;
67
+ };
68
+
69
+ export type Two = One | Two2;
70
+
71
+ /**
72
+ * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
73
+ */
74
+ export type Content = string | Array<One | Two2>;
75
+
76
+ export const Type = {
77
+ Function: "function",
78
+ } as const;
79
+ export type Type = ClosedEnum<typeof Type>;
80
+
81
+ export type FunctionT = {
82
+ name: string;
83
+ /**
84
+ * JSON string arguments for the functions
85
+ */
86
+ arguments: string;
87
+ };
88
+
89
+ export type ToolCalls = {
90
+ id?: string | undefined;
91
+ index?: number | undefined;
92
+ type: Type;
93
+ function: FunctionT;
94
+ };
95
+
96
+ export type PrefixMessages = {
97
+ /**
98
+ * The role of the prompt message
99
+ */
100
+ role: Role;
101
+ /**
102
+ * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
103
+ */
104
+ content: string | Array<One | Two2>;
105
+ toolCalls?: Array<ToolCalls> | undefined;
106
+ };
107
+
108
+ /**
109
+ * The role of the prompt message
110
+ */
111
+ export const DeploymentsRole = {
112
+ System: "system",
113
+ Assistant: "assistant",
114
+ User: "user",
115
+ Exception: "exception",
116
+ Tool: "tool",
117
+ Prompt: "prompt",
118
+ Correction: "correction",
119
+ ExpectedOutput: "expected_output",
120
+ } as const;
121
+ /**
122
+ * The role of the prompt message
123
+ */
124
+ export type DeploymentsRole = ClosedEnum<typeof DeploymentsRole>;
125
+
126
+ export const Deployments2MessagesContentType = {
127
+ ImageUrl: "image_url",
128
+ } as const;
129
+ export type Deployments2MessagesContentType = ClosedEnum<
130
+ typeof Deployments2MessagesContentType
131
+ >;
132
+
133
+ export type TwoImageUrl = {
134
+ /**
135
+ * Either a URL of the image or the base64 encoded data URI.
136
+ */
137
+ url: string;
138
+ /**
139
+ * Specifies the detail level of the image. Currently only supported with OpenAI models
140
+ */
141
+ detail?: string | undefined;
142
+ };
143
+
144
+ /**
145
+ * The image part of the prompt message. Only supported with vision models.
146
+ */
147
+ export type Deployments22 = {
148
+ type: Deployments2MessagesContentType;
149
+ imageUrl: TwoImageUrl;
150
+ };
151
+
152
+ export const Deployments2MessagesType = {
153
+ Text: "text",
154
+ } as const;
155
+ export type Deployments2MessagesType = ClosedEnum<
156
+ typeof Deployments2MessagesType
157
+ >;
158
+
159
+ /**
160
+ * Text content part of a prompt message
161
+ */
162
+ export type Two1 = {
163
+ type: Deployments2MessagesType;
164
+ text: string;
165
+ };
166
+
167
+ export type Content2 = Two1 | Deployments22;
168
+
169
+ /**
170
+ * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
171
+ */
172
+ export type DeploymentsContent = string | Array<Two1 | Deployments22>;
173
+
174
+ export const DeploymentsType = {
175
+ Function: "function",
176
+ } as const;
177
+ export type DeploymentsType = ClosedEnum<typeof DeploymentsType>;
178
+
179
+ export type DeploymentsFunction = {
180
+ name: string;
181
+ /**
182
+ * JSON string arguments for the functions
183
+ */
184
+ arguments: string;
185
+ };
186
+
187
+ export type DeploymentsToolCalls = {
188
+ id?: string | undefined;
189
+ index?: number | undefined;
190
+ type: DeploymentsType;
191
+ function: DeploymentsFunction;
192
+ };
193
+
194
+ export type Messages = {
195
+ /**
196
+ * The role of the prompt message
197
+ */
198
+ role: DeploymentsRole;
199
+ /**
200
+ * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
201
+ */
202
+ content: string | Array<Two1 | Deployments22>;
203
+ toolCalls?: Array<DeploymentsToolCalls> | undefined;
204
+ };
205
+
206
+ /**
207
+ * Unique ID that identifies a user. This is useful for tracking the same user across multiple requests
208
+ */
209
+ export type UserId = string | number;
210
+
211
+ export type InvokeOptions = {
212
+ /**
213
+ * Whether to include the retrieved knowledge chunks in the response.
214
+ */
215
+ includeRetrievals?: boolean | undefined;
216
+ };
217
+
218
+ /**
219
+ * The deployment request payload
220
+ */
221
+ export type Deployments = {
222
+ /**
223
+ * The deployment id to invoke
224
+ */
225
+ key: string;
226
+ /**
227
+ * If set, partial message content will be sent. Tokens will be sent as data-only `server-sent events` as they become available, with the stream terminated by a `data: [DONE]` message.
228
+ */
229
+ stream?: boolean | undefined;
230
+ /**
231
+ * Key-value pairs variables to replace in your prompts. If a variable is not provided that is defined in the prompt, the default variables are used.
232
+ */
233
+ inputs?: { [k: string]: string | number | boolean } | undefined;
234
+ /**
235
+ * Key-value pairs that match your data model and fields declared in your configuration matrix. If you send multiple prompt keys, the context will be applied to the evaluation of each key.
236
+ */
237
+ context?: { [k: string]: any } | undefined;
238
+ /**
239
+ * A list of messages to include after the `System` message, but before the `User` and `Assistant` pairs configured in your deployment.
240
+ */
241
+ prefixMessages?: Array<PrefixMessages> | undefined;
242
+ /**
243
+ * A list of messages to send to the deployment.
244
+ */
245
+ messages?: Array<Messages> | undefined;
246
+ /**
247
+ * A list of file IDs that are associated with the deployment request.
248
+ */
249
+ fileIds?: Array<string> | undefined;
250
+ /**
251
+ * Key-value pairs that you want to attach to the log generated by this request.
252
+ */
253
+ metadata?: { [k: string]: any } | undefined;
254
+ /**
255
+ * Unique ID that identifies a chaining operation. This is useful for tracking a chain of completions across multiple
256
+ */
257
+ chainId?: string | undefined;
258
+ /**
259
+ * Unique ID that identifies a chat conversation. This is useful for tracking the same conversation across multiple requests
260
+ */
261
+ conversationId?: string | undefined;
262
+ /**
263
+ * Unique ID that identifies a user. This is useful for tracking the same user across multiple requests
264
+ */
265
+ userId?: string | number | undefined;
266
+ /**
267
+ * Unique ID that identifies a deployment entity.
268
+ */
269
+ deploymentId?: string | undefined;
270
+ /**
271
+ * Unique ID that identifies a specific variant of a deployment.
272
+ */
273
+ deploymentVariantId?: string | undefined;
274
+ /**
275
+ * Utilized for passing additional parameters to the model provider. Exercise caution when using this feature, as the included parameters will overwrite any parameters specified in the deployment prompt configuration.
276
+ */
277
+ extraParams?: { [k: string]: any } | undefined;
278
+ invokeOptions?: InvokeOptions | undefined;
279
+ };
280
+
281
+ /** @internal */
282
+ export const Inputs$inboundSchema: z.ZodType<Inputs, z.ZodTypeDef, unknown> = z
283
+ .union([z.string(), z.number(), z.boolean()]);
284
+
285
+ /** @internal */
286
+ export type Inputs$Outbound = string | number | boolean;
287
+
288
+ /** @internal */
289
+ export const Inputs$outboundSchema: z.ZodType<
290
+ Inputs$Outbound,
291
+ z.ZodTypeDef,
292
+ Inputs
293
+ > = z.union([z.string(), z.number(), z.boolean()]);
294
+
295
+ /**
296
+ * @internal
297
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
298
+ */
299
+ export namespace Inputs$ {
300
+ /** @deprecated use `Inputs$inboundSchema` instead. */
301
+ export const inboundSchema = Inputs$inboundSchema;
302
+ /** @deprecated use `Inputs$outboundSchema` instead. */
303
+ export const outboundSchema = Inputs$outboundSchema;
304
+ /** @deprecated use `Inputs$Outbound` instead. */
305
+ export type Outbound = Inputs$Outbound;
306
+ }
307
+
308
+ export function inputsToJSON(inputs: Inputs): string {
309
+ return JSON.stringify(Inputs$outboundSchema.parse(inputs));
310
+ }
311
+
312
+ export function inputsFromJSON(
313
+ jsonString: string,
314
+ ): SafeParseResult<Inputs, SDKValidationError> {
315
+ return safeParse(
316
+ jsonString,
317
+ (x) => Inputs$inboundSchema.parse(JSON.parse(x)),
318
+ `Failed to parse 'Inputs' from JSON`,
319
+ );
320
+ }
321
+
322
+ /** @internal */
323
+ export const Role$inboundSchema: z.ZodNativeEnum<typeof Role> = z.nativeEnum(
324
+ Role,
325
+ );
326
+
327
+ /** @internal */
328
+ export const Role$outboundSchema: z.ZodNativeEnum<typeof Role> =
329
+ Role$inboundSchema;
330
+
331
+ /**
332
+ * @internal
333
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
334
+ */
335
+ export namespace Role$ {
336
+ /** @deprecated use `Role$inboundSchema` instead. */
337
+ export const inboundSchema = Role$inboundSchema;
338
+ /** @deprecated use `Role$outboundSchema` instead. */
339
+ export const outboundSchema = Role$outboundSchema;
340
+ }
341
+
342
+ /** @internal */
343
+ export const TwoType$inboundSchema: z.ZodNativeEnum<typeof TwoType> = z
344
+ .nativeEnum(TwoType);
345
+
346
+ /** @internal */
347
+ export const TwoType$outboundSchema: z.ZodNativeEnum<typeof TwoType> =
348
+ TwoType$inboundSchema;
349
+
350
+ /**
351
+ * @internal
352
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
353
+ */
354
+ export namespace TwoType$ {
355
+ /** @deprecated use `TwoType$inboundSchema` instead. */
356
+ export const inboundSchema = TwoType$inboundSchema;
357
+ /** @deprecated use `TwoType$outboundSchema` instead. */
358
+ export const outboundSchema = TwoType$outboundSchema;
359
+ }
360
+
361
+ /** @internal */
362
+ export const ImageUrl$inboundSchema: z.ZodType<
363
+ ImageUrl,
364
+ z.ZodTypeDef,
365
+ unknown
366
+ > = z.object({
367
+ url: z.string(),
368
+ detail: z.string().optional(),
369
+ });
370
+
371
+ /** @internal */
372
+ export type ImageUrl$Outbound = {
373
+ url: string;
374
+ detail?: string | undefined;
375
+ };
376
+
377
+ /** @internal */
378
+ export const ImageUrl$outboundSchema: z.ZodType<
379
+ ImageUrl$Outbound,
380
+ z.ZodTypeDef,
381
+ ImageUrl
382
+ > = z.object({
383
+ url: z.string(),
384
+ detail: z.string().optional(),
385
+ });
386
+
387
+ /**
388
+ * @internal
389
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
390
+ */
391
+ export namespace ImageUrl$ {
392
+ /** @deprecated use `ImageUrl$inboundSchema` instead. */
393
+ export const inboundSchema = ImageUrl$inboundSchema;
394
+ /** @deprecated use `ImageUrl$outboundSchema` instead. */
395
+ export const outboundSchema = ImageUrl$outboundSchema;
396
+ /** @deprecated use `ImageUrl$Outbound` instead. */
397
+ export type Outbound = ImageUrl$Outbound;
398
+ }
399
+
400
+ export function imageUrlToJSON(imageUrl: ImageUrl): string {
401
+ return JSON.stringify(ImageUrl$outboundSchema.parse(imageUrl));
402
+ }
403
+
404
+ export function imageUrlFromJSON(
405
+ jsonString: string,
406
+ ): SafeParseResult<ImageUrl, SDKValidationError> {
407
+ return safeParse(
408
+ jsonString,
409
+ (x) => ImageUrl$inboundSchema.parse(JSON.parse(x)),
410
+ `Failed to parse 'ImageUrl' from JSON`,
411
+ );
412
+ }
413
+
414
+ /** @internal */
415
+ export const Two2$inboundSchema: z.ZodType<Two2, z.ZodTypeDef, unknown> = z
416
+ .object({
417
+ type: TwoType$inboundSchema,
418
+ image_url: z.lazy(() => ImageUrl$inboundSchema),
419
+ }).transform((v) => {
420
+ return remap$(v, {
421
+ "image_url": "imageUrl",
422
+ });
423
+ });
424
+
425
+ /** @internal */
426
+ export type Two2$Outbound = {
427
+ type: string;
428
+ image_url: ImageUrl$Outbound;
429
+ };
430
+
431
+ /** @internal */
432
+ export const Two2$outboundSchema: z.ZodType<Two2$Outbound, z.ZodTypeDef, Two2> =
433
+ z.object({
434
+ type: TwoType$outboundSchema,
435
+ imageUrl: z.lazy(() => ImageUrl$outboundSchema),
436
+ }).transform((v) => {
437
+ return remap$(v, {
438
+ imageUrl: "image_url",
439
+ });
440
+ });
441
+
442
+ /**
443
+ * @internal
444
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
445
+ */
446
+ export namespace Two2$ {
447
+ /** @deprecated use `Two2$inboundSchema` instead. */
448
+ export const inboundSchema = Two2$inboundSchema;
449
+ /** @deprecated use `Two2$outboundSchema` instead. */
450
+ export const outboundSchema = Two2$outboundSchema;
451
+ /** @deprecated use `Two2$Outbound` instead. */
452
+ export type Outbound = Two2$Outbound;
453
+ }
454
+
455
+ export function two2ToJSON(two2: Two2): string {
456
+ return JSON.stringify(Two2$outboundSchema.parse(two2));
457
+ }
458
+
459
+ export function two2FromJSON(
460
+ jsonString: string,
461
+ ): SafeParseResult<Two2, SDKValidationError> {
462
+ return safeParse(
463
+ jsonString,
464
+ (x) => Two2$inboundSchema.parse(JSON.parse(x)),
465
+ `Failed to parse 'Two2' from JSON`,
466
+ );
467
+ }
468
+
469
+ /** @internal */
470
+ export const Deployments2Type$inboundSchema: z.ZodNativeEnum<
471
+ typeof Deployments2Type
472
+ > = z.nativeEnum(Deployments2Type);
473
+
474
+ /** @internal */
475
+ export const Deployments2Type$outboundSchema: z.ZodNativeEnum<
476
+ typeof Deployments2Type
477
+ > = Deployments2Type$inboundSchema;
478
+
479
+ /**
480
+ * @internal
481
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
482
+ */
483
+ export namespace Deployments2Type$ {
484
+ /** @deprecated use `Deployments2Type$inboundSchema` instead. */
485
+ export const inboundSchema = Deployments2Type$inboundSchema;
486
+ /** @deprecated use `Deployments2Type$outboundSchema` instead. */
487
+ export const outboundSchema = Deployments2Type$outboundSchema;
488
+ }
489
+
490
+ /** @internal */
491
+ export const One$inboundSchema: z.ZodType<One, z.ZodTypeDef, unknown> = z
492
+ .object({
493
+ type: Deployments2Type$inboundSchema,
494
+ text: z.string(),
495
+ });
496
+
497
+ /** @internal */
498
+ export type One$Outbound = {
499
+ type: string;
500
+ text: string;
501
+ };
502
+
503
+ /** @internal */
504
+ export const One$outboundSchema: z.ZodType<One$Outbound, z.ZodTypeDef, One> = z
505
+ .object({
506
+ type: Deployments2Type$outboundSchema,
507
+ text: z.string(),
508
+ });
509
+
510
+ /**
511
+ * @internal
512
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
513
+ */
514
+ export namespace One$ {
515
+ /** @deprecated use `One$inboundSchema` instead. */
516
+ export const inboundSchema = One$inboundSchema;
517
+ /** @deprecated use `One$outboundSchema` instead. */
518
+ export const outboundSchema = One$outboundSchema;
519
+ /** @deprecated use `One$Outbound` instead. */
520
+ export type Outbound = One$Outbound;
521
+ }
522
+
523
+ export function oneToJSON(one: One): string {
524
+ return JSON.stringify(One$outboundSchema.parse(one));
525
+ }
526
+
527
+ export function oneFromJSON(
528
+ jsonString: string,
529
+ ): SafeParseResult<One, SDKValidationError> {
530
+ return safeParse(
531
+ jsonString,
532
+ (x) => One$inboundSchema.parse(JSON.parse(x)),
533
+ `Failed to parse 'One' from JSON`,
534
+ );
535
+ }
536
+
537
+ /** @internal */
538
+ export const Two$inboundSchema: z.ZodType<Two, z.ZodTypeDef, unknown> = z.union(
539
+ [z.lazy(() => One$inboundSchema), z.lazy(() => Two2$inboundSchema)],
540
+ );
541
+
542
+ /** @internal */
543
+ export type Two$Outbound = One$Outbound | Two2$Outbound;
544
+
545
+ /** @internal */
546
+ export const Two$outboundSchema: z.ZodType<Two$Outbound, z.ZodTypeDef, Two> = z
547
+ .union([z.lazy(() => One$outboundSchema), z.lazy(() => Two2$outboundSchema)]);
548
+
549
+ /**
550
+ * @internal
551
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
552
+ */
553
+ export namespace Two$ {
554
+ /** @deprecated use `Two$inboundSchema` instead. */
555
+ export const inboundSchema = Two$inboundSchema;
556
+ /** @deprecated use `Two$outboundSchema` instead. */
557
+ export const outboundSchema = Two$outboundSchema;
558
+ /** @deprecated use `Two$Outbound` instead. */
559
+ export type Outbound = Two$Outbound;
560
+ }
561
+
562
+ export function twoToJSON(two: Two): string {
563
+ return JSON.stringify(Two$outboundSchema.parse(two));
564
+ }
565
+
566
+ export function twoFromJSON(
567
+ jsonString: string,
568
+ ): SafeParseResult<Two, SDKValidationError> {
569
+ return safeParse(
570
+ jsonString,
571
+ (x) => Two$inboundSchema.parse(JSON.parse(x)),
572
+ `Failed to parse 'Two' from JSON`,
573
+ );
574
+ }
575
+
576
+ /** @internal */
577
+ export const Content$inboundSchema: z.ZodType<Content, z.ZodTypeDef, unknown> =
578
+ z.union([
579
+ z.string(),
580
+ z.array(z.union([
581
+ z.lazy(() => One$inboundSchema),
582
+ z.lazy(() => Two2$inboundSchema),
583
+ ])),
584
+ ]);
585
+
586
+ /** @internal */
587
+ export type Content$Outbound = string | Array<One$Outbound | Two2$Outbound>;
588
+
589
+ /** @internal */
590
+ export const Content$outboundSchema: z.ZodType<
591
+ Content$Outbound,
592
+ z.ZodTypeDef,
593
+ Content
594
+ > = z.union([
595
+ z.string(),
596
+ z.array(z.union([
597
+ z.lazy(() => One$outboundSchema),
598
+ z.lazy(() => Two2$outboundSchema),
599
+ ])),
600
+ ]);
601
+
602
+ /**
603
+ * @internal
604
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
605
+ */
606
+ export namespace Content$ {
607
+ /** @deprecated use `Content$inboundSchema` instead. */
608
+ export const inboundSchema = Content$inboundSchema;
609
+ /** @deprecated use `Content$outboundSchema` instead. */
610
+ export const outboundSchema = Content$outboundSchema;
611
+ /** @deprecated use `Content$Outbound` instead. */
612
+ export type Outbound = Content$Outbound;
613
+ }
614
+
615
+ export function contentToJSON(content: Content): string {
616
+ return JSON.stringify(Content$outboundSchema.parse(content));
617
+ }
618
+
619
+ export function contentFromJSON(
620
+ jsonString: string,
621
+ ): SafeParseResult<Content, SDKValidationError> {
622
+ return safeParse(
623
+ jsonString,
624
+ (x) => Content$inboundSchema.parse(JSON.parse(x)),
625
+ `Failed to parse 'Content' from JSON`,
626
+ );
627
+ }
628
+
629
+ /** @internal */
630
+ export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
631
+ Type,
632
+ );
633
+
634
+ /** @internal */
635
+ export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
636
+ Type$inboundSchema;
637
+
638
+ /**
639
+ * @internal
640
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
641
+ */
642
+ export namespace Type$ {
643
+ /** @deprecated use `Type$inboundSchema` instead. */
644
+ export const inboundSchema = Type$inboundSchema;
645
+ /** @deprecated use `Type$outboundSchema` instead. */
646
+ export const outboundSchema = Type$outboundSchema;
647
+ }
648
+
649
+ /** @internal */
650
+ export const FunctionT$inboundSchema: z.ZodType<
651
+ FunctionT,
652
+ z.ZodTypeDef,
653
+ unknown
654
+ > = z.object({
655
+ name: z.string(),
656
+ arguments: z.string(),
657
+ });
658
+
659
+ /** @internal */
660
+ export type FunctionT$Outbound = {
661
+ name: string;
662
+ arguments: string;
663
+ };
664
+
665
+ /** @internal */
666
+ export const FunctionT$outboundSchema: z.ZodType<
667
+ FunctionT$Outbound,
668
+ z.ZodTypeDef,
669
+ FunctionT
670
+ > = z.object({
671
+ name: z.string(),
672
+ arguments: z.string(),
673
+ });
674
+
675
+ /**
676
+ * @internal
677
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
678
+ */
679
+ export namespace FunctionT$ {
680
+ /** @deprecated use `FunctionT$inboundSchema` instead. */
681
+ export const inboundSchema = FunctionT$inboundSchema;
682
+ /** @deprecated use `FunctionT$outboundSchema` instead. */
683
+ export const outboundSchema = FunctionT$outboundSchema;
684
+ /** @deprecated use `FunctionT$Outbound` instead. */
685
+ export type Outbound = FunctionT$Outbound;
686
+ }
687
+
688
+ export function functionTToJSON(functionT: FunctionT): string {
689
+ return JSON.stringify(FunctionT$outboundSchema.parse(functionT));
690
+ }
691
+
692
+ export function functionTFromJSON(
693
+ jsonString: string,
694
+ ): SafeParseResult<FunctionT, SDKValidationError> {
695
+ return safeParse(
696
+ jsonString,
697
+ (x) => FunctionT$inboundSchema.parse(JSON.parse(x)),
698
+ `Failed to parse 'FunctionT' from JSON`,
699
+ );
700
+ }
701
+
702
+ /** @internal */
703
+ export const ToolCalls$inboundSchema: z.ZodType<
704
+ ToolCalls,
705
+ z.ZodTypeDef,
706
+ unknown
707
+ > = z.object({
708
+ id: z.string().optional(),
709
+ index: z.number().optional(),
710
+ type: Type$inboundSchema,
711
+ function: z.lazy(() => FunctionT$inboundSchema),
712
+ });
713
+
714
+ /** @internal */
715
+ export type ToolCalls$Outbound = {
716
+ id?: string | undefined;
717
+ index?: number | undefined;
718
+ type: string;
719
+ function: FunctionT$Outbound;
720
+ };
721
+
722
+ /** @internal */
723
+ export const ToolCalls$outboundSchema: z.ZodType<
724
+ ToolCalls$Outbound,
725
+ z.ZodTypeDef,
726
+ ToolCalls
727
+ > = z.object({
728
+ id: z.string().optional(),
729
+ index: z.number().optional(),
730
+ type: Type$outboundSchema,
731
+ function: z.lazy(() => FunctionT$outboundSchema),
732
+ });
733
+
734
+ /**
735
+ * @internal
736
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
737
+ */
738
+ export namespace ToolCalls$ {
739
+ /** @deprecated use `ToolCalls$inboundSchema` instead. */
740
+ export const inboundSchema = ToolCalls$inboundSchema;
741
+ /** @deprecated use `ToolCalls$outboundSchema` instead. */
742
+ export const outboundSchema = ToolCalls$outboundSchema;
743
+ /** @deprecated use `ToolCalls$Outbound` instead. */
744
+ export type Outbound = ToolCalls$Outbound;
745
+ }
746
+
747
+ export function toolCallsToJSON(toolCalls: ToolCalls): string {
748
+ return JSON.stringify(ToolCalls$outboundSchema.parse(toolCalls));
749
+ }
750
+
751
+ export function toolCallsFromJSON(
752
+ jsonString: string,
753
+ ): SafeParseResult<ToolCalls, SDKValidationError> {
754
+ return safeParse(
755
+ jsonString,
756
+ (x) => ToolCalls$inboundSchema.parse(JSON.parse(x)),
757
+ `Failed to parse 'ToolCalls' from JSON`,
758
+ );
759
+ }
760
+
761
+ /** @internal */
762
+ export const PrefixMessages$inboundSchema: z.ZodType<
763
+ PrefixMessages,
764
+ z.ZodTypeDef,
765
+ unknown
766
+ > = z.object({
767
+ role: Role$inboundSchema,
768
+ content: z.union([
769
+ z.string(),
770
+ z.array(z.union([
771
+ z.lazy(() => One$inboundSchema),
772
+ z.lazy(() => Two2$inboundSchema),
773
+ ])),
774
+ ]),
775
+ tool_calls: z.array(z.lazy(() => ToolCalls$inboundSchema)).optional(),
776
+ }).transform((v) => {
777
+ return remap$(v, {
778
+ "tool_calls": "toolCalls",
779
+ });
780
+ });
781
+
782
+ /** @internal */
783
+ export type PrefixMessages$Outbound = {
784
+ role: string;
785
+ content: string | Array<One$Outbound | Two2$Outbound>;
786
+ tool_calls?: Array<ToolCalls$Outbound> | undefined;
787
+ };
788
+
789
+ /** @internal */
790
+ export const PrefixMessages$outboundSchema: z.ZodType<
791
+ PrefixMessages$Outbound,
792
+ z.ZodTypeDef,
793
+ PrefixMessages
794
+ > = z.object({
795
+ role: Role$outboundSchema,
796
+ content: z.union([
797
+ z.string(),
798
+ z.array(z.union([
799
+ z.lazy(() => One$outboundSchema),
800
+ z.lazy(() => Two2$outboundSchema),
801
+ ])),
802
+ ]),
803
+ toolCalls: z.array(z.lazy(() => ToolCalls$outboundSchema)).optional(),
804
+ }).transform((v) => {
805
+ return remap$(v, {
806
+ toolCalls: "tool_calls",
807
+ });
808
+ });
809
+
810
+ /**
811
+ * @internal
812
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
813
+ */
814
+ export namespace PrefixMessages$ {
815
+ /** @deprecated use `PrefixMessages$inboundSchema` instead. */
816
+ export const inboundSchema = PrefixMessages$inboundSchema;
817
+ /** @deprecated use `PrefixMessages$outboundSchema` instead. */
818
+ export const outboundSchema = PrefixMessages$outboundSchema;
819
+ /** @deprecated use `PrefixMessages$Outbound` instead. */
820
+ export type Outbound = PrefixMessages$Outbound;
821
+ }
822
+
823
+ export function prefixMessagesToJSON(prefixMessages: PrefixMessages): string {
824
+ return JSON.stringify(PrefixMessages$outboundSchema.parse(prefixMessages));
825
+ }
826
+
827
+ export function prefixMessagesFromJSON(
828
+ jsonString: string,
829
+ ): SafeParseResult<PrefixMessages, SDKValidationError> {
830
+ return safeParse(
831
+ jsonString,
832
+ (x) => PrefixMessages$inboundSchema.parse(JSON.parse(x)),
833
+ `Failed to parse 'PrefixMessages' from JSON`,
834
+ );
835
+ }
836
+
837
+ /** @internal */
838
+ export const DeploymentsRole$inboundSchema: z.ZodNativeEnum<
839
+ typeof DeploymentsRole
840
+ > = z.nativeEnum(DeploymentsRole);
841
+
842
+ /** @internal */
843
+ export const DeploymentsRole$outboundSchema: z.ZodNativeEnum<
844
+ typeof DeploymentsRole
845
+ > = DeploymentsRole$inboundSchema;
846
+
847
+ /**
848
+ * @internal
849
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
850
+ */
851
+ export namespace DeploymentsRole$ {
852
+ /** @deprecated use `DeploymentsRole$inboundSchema` instead. */
853
+ export const inboundSchema = DeploymentsRole$inboundSchema;
854
+ /** @deprecated use `DeploymentsRole$outboundSchema` instead. */
855
+ export const outboundSchema = DeploymentsRole$outboundSchema;
856
+ }
857
+
858
+ /** @internal */
859
+ export const Deployments2MessagesContentType$inboundSchema: z.ZodNativeEnum<
860
+ typeof Deployments2MessagesContentType
861
+ > = z.nativeEnum(Deployments2MessagesContentType);
862
+
863
+ /** @internal */
864
+ export const Deployments2MessagesContentType$outboundSchema: z.ZodNativeEnum<
865
+ typeof Deployments2MessagesContentType
866
+ > = Deployments2MessagesContentType$inboundSchema;
867
+
868
+ /**
869
+ * @internal
870
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
871
+ */
872
+ export namespace Deployments2MessagesContentType$ {
873
+ /** @deprecated use `Deployments2MessagesContentType$inboundSchema` instead. */
874
+ export const inboundSchema = Deployments2MessagesContentType$inboundSchema;
875
+ /** @deprecated use `Deployments2MessagesContentType$outboundSchema` instead. */
876
+ export const outboundSchema = Deployments2MessagesContentType$outboundSchema;
877
+ }
878
+
879
+ /** @internal */
880
+ export const TwoImageUrl$inboundSchema: z.ZodType<
881
+ TwoImageUrl,
882
+ z.ZodTypeDef,
883
+ unknown
884
+ > = z.object({
885
+ url: z.string(),
886
+ detail: z.string().optional(),
887
+ });
888
+
889
+ /** @internal */
890
+ export type TwoImageUrl$Outbound = {
891
+ url: string;
892
+ detail?: string | undefined;
893
+ };
894
+
895
+ /** @internal */
896
+ export const TwoImageUrl$outboundSchema: z.ZodType<
897
+ TwoImageUrl$Outbound,
898
+ z.ZodTypeDef,
899
+ TwoImageUrl
900
+ > = z.object({
901
+ url: z.string(),
902
+ detail: z.string().optional(),
903
+ });
904
+
905
+ /**
906
+ * @internal
907
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
908
+ */
909
+ export namespace TwoImageUrl$ {
910
+ /** @deprecated use `TwoImageUrl$inboundSchema` instead. */
911
+ export const inboundSchema = TwoImageUrl$inboundSchema;
912
+ /** @deprecated use `TwoImageUrl$outboundSchema` instead. */
913
+ export const outboundSchema = TwoImageUrl$outboundSchema;
914
+ /** @deprecated use `TwoImageUrl$Outbound` instead. */
915
+ export type Outbound = TwoImageUrl$Outbound;
916
+ }
917
+
918
+ export function twoImageUrlToJSON(twoImageUrl: TwoImageUrl): string {
919
+ return JSON.stringify(TwoImageUrl$outboundSchema.parse(twoImageUrl));
920
+ }
921
+
922
+ export function twoImageUrlFromJSON(
923
+ jsonString: string,
924
+ ): SafeParseResult<TwoImageUrl, SDKValidationError> {
925
+ return safeParse(
926
+ jsonString,
927
+ (x) => TwoImageUrl$inboundSchema.parse(JSON.parse(x)),
928
+ `Failed to parse 'TwoImageUrl' from JSON`,
929
+ );
930
+ }
931
+
932
+ /** @internal */
933
+ export const Deployments22$inboundSchema: z.ZodType<
934
+ Deployments22,
935
+ z.ZodTypeDef,
936
+ unknown
937
+ > = z.object({
938
+ type: Deployments2MessagesContentType$inboundSchema,
939
+ image_url: z.lazy(() => TwoImageUrl$inboundSchema),
940
+ }).transform((v) => {
941
+ return remap$(v, {
942
+ "image_url": "imageUrl",
943
+ });
944
+ });
945
+
946
+ /** @internal */
947
+ export type Deployments22$Outbound = {
948
+ type: string;
949
+ image_url: TwoImageUrl$Outbound;
950
+ };
951
+
952
+ /** @internal */
953
+ export const Deployments22$outboundSchema: z.ZodType<
954
+ Deployments22$Outbound,
955
+ z.ZodTypeDef,
956
+ Deployments22
957
+ > = z.object({
958
+ type: Deployments2MessagesContentType$outboundSchema,
959
+ imageUrl: z.lazy(() => TwoImageUrl$outboundSchema),
960
+ }).transform((v) => {
961
+ return remap$(v, {
962
+ imageUrl: "image_url",
963
+ });
964
+ });
965
+
966
+ /**
967
+ * @internal
968
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
969
+ */
970
+ export namespace Deployments22$ {
971
+ /** @deprecated use `Deployments22$inboundSchema` instead. */
972
+ export const inboundSchema = Deployments22$inboundSchema;
973
+ /** @deprecated use `Deployments22$outboundSchema` instead. */
974
+ export const outboundSchema = Deployments22$outboundSchema;
975
+ /** @deprecated use `Deployments22$Outbound` instead. */
976
+ export type Outbound = Deployments22$Outbound;
977
+ }
978
+
979
+ export function deployments22ToJSON(deployments22: Deployments22): string {
980
+ return JSON.stringify(Deployments22$outboundSchema.parse(deployments22));
981
+ }
982
+
983
+ export function deployments22FromJSON(
984
+ jsonString: string,
985
+ ): SafeParseResult<Deployments22, SDKValidationError> {
986
+ return safeParse(
987
+ jsonString,
988
+ (x) => Deployments22$inboundSchema.parse(JSON.parse(x)),
989
+ `Failed to parse 'Deployments22' from JSON`,
990
+ );
991
+ }
992
+
993
+ /** @internal */
994
+ export const Deployments2MessagesType$inboundSchema: z.ZodNativeEnum<
995
+ typeof Deployments2MessagesType
996
+ > = z.nativeEnum(Deployments2MessagesType);
997
+
998
+ /** @internal */
999
+ export const Deployments2MessagesType$outboundSchema: z.ZodNativeEnum<
1000
+ typeof Deployments2MessagesType
1001
+ > = Deployments2MessagesType$inboundSchema;
1002
+
1003
+ /**
1004
+ * @internal
1005
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1006
+ */
1007
+ export namespace Deployments2MessagesType$ {
1008
+ /** @deprecated use `Deployments2MessagesType$inboundSchema` instead. */
1009
+ export const inboundSchema = Deployments2MessagesType$inboundSchema;
1010
+ /** @deprecated use `Deployments2MessagesType$outboundSchema` instead. */
1011
+ export const outboundSchema = Deployments2MessagesType$outboundSchema;
1012
+ }
1013
+
1014
+ /** @internal */
1015
+ export const Two1$inboundSchema: z.ZodType<Two1, z.ZodTypeDef, unknown> = z
1016
+ .object({
1017
+ type: Deployments2MessagesType$inboundSchema,
1018
+ text: z.string(),
1019
+ });
1020
+
1021
+ /** @internal */
1022
+ export type Two1$Outbound = {
1023
+ type: string;
1024
+ text: string;
1025
+ };
1026
+
1027
+ /** @internal */
1028
+ export const Two1$outboundSchema: z.ZodType<Two1$Outbound, z.ZodTypeDef, Two1> =
1029
+ z.object({
1030
+ type: Deployments2MessagesType$outboundSchema,
1031
+ text: z.string(),
1032
+ });
1033
+
1034
+ /**
1035
+ * @internal
1036
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1037
+ */
1038
+ export namespace Two1$ {
1039
+ /** @deprecated use `Two1$inboundSchema` instead. */
1040
+ export const inboundSchema = Two1$inboundSchema;
1041
+ /** @deprecated use `Two1$outboundSchema` instead. */
1042
+ export const outboundSchema = Two1$outboundSchema;
1043
+ /** @deprecated use `Two1$Outbound` instead. */
1044
+ export type Outbound = Two1$Outbound;
1045
+ }
1046
+
1047
+ export function two1ToJSON(two1: Two1): string {
1048
+ return JSON.stringify(Two1$outboundSchema.parse(two1));
1049
+ }
1050
+
1051
+ export function two1FromJSON(
1052
+ jsonString: string,
1053
+ ): SafeParseResult<Two1, SDKValidationError> {
1054
+ return safeParse(
1055
+ jsonString,
1056
+ (x) => Two1$inboundSchema.parse(JSON.parse(x)),
1057
+ `Failed to parse 'Two1' from JSON`,
1058
+ );
1059
+ }
1060
+
1061
+ /** @internal */
1062
+ export const Content2$inboundSchema: z.ZodType<
1063
+ Content2,
1064
+ z.ZodTypeDef,
1065
+ unknown
1066
+ > = z.union([
1067
+ z.lazy(() => Two1$inboundSchema),
1068
+ z.lazy(() => Deployments22$inboundSchema),
1069
+ ]);
1070
+
1071
+ /** @internal */
1072
+ export type Content2$Outbound = Two1$Outbound | Deployments22$Outbound;
1073
+
1074
+ /** @internal */
1075
+ export const Content2$outboundSchema: z.ZodType<
1076
+ Content2$Outbound,
1077
+ z.ZodTypeDef,
1078
+ Content2
1079
+ > = z.union([
1080
+ z.lazy(() => Two1$outboundSchema),
1081
+ z.lazy(() => Deployments22$outboundSchema),
1082
+ ]);
1083
+
1084
+ /**
1085
+ * @internal
1086
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1087
+ */
1088
+ export namespace Content2$ {
1089
+ /** @deprecated use `Content2$inboundSchema` instead. */
1090
+ export const inboundSchema = Content2$inboundSchema;
1091
+ /** @deprecated use `Content2$outboundSchema` instead. */
1092
+ export const outboundSchema = Content2$outboundSchema;
1093
+ /** @deprecated use `Content2$Outbound` instead. */
1094
+ export type Outbound = Content2$Outbound;
1095
+ }
1096
+
1097
+ export function content2ToJSON(content2: Content2): string {
1098
+ return JSON.stringify(Content2$outboundSchema.parse(content2));
1099
+ }
1100
+
1101
+ export function content2FromJSON(
1102
+ jsonString: string,
1103
+ ): SafeParseResult<Content2, SDKValidationError> {
1104
+ return safeParse(
1105
+ jsonString,
1106
+ (x) => Content2$inboundSchema.parse(JSON.parse(x)),
1107
+ `Failed to parse 'Content2' from JSON`,
1108
+ );
1109
+ }
1110
+
1111
+ /** @internal */
1112
+ export const DeploymentsContent$inboundSchema: z.ZodType<
1113
+ DeploymentsContent,
1114
+ z.ZodTypeDef,
1115
+ unknown
1116
+ > = z.union([
1117
+ z.string(),
1118
+ z.array(z.union([
1119
+ z.lazy(() => Two1$inboundSchema),
1120
+ z.lazy(() => Deployments22$inboundSchema),
1121
+ ])),
1122
+ ]);
1123
+
1124
+ /** @internal */
1125
+ export type DeploymentsContent$Outbound =
1126
+ | string
1127
+ | Array<Two1$Outbound | Deployments22$Outbound>;
1128
+
1129
+ /** @internal */
1130
+ export const DeploymentsContent$outboundSchema: z.ZodType<
1131
+ DeploymentsContent$Outbound,
1132
+ z.ZodTypeDef,
1133
+ DeploymentsContent
1134
+ > = z.union([
1135
+ z.string(),
1136
+ z.array(z.union([
1137
+ z.lazy(() => Two1$outboundSchema),
1138
+ z.lazy(() => Deployments22$outboundSchema),
1139
+ ])),
1140
+ ]);
1141
+
1142
+ /**
1143
+ * @internal
1144
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1145
+ */
1146
+ export namespace DeploymentsContent$ {
1147
+ /** @deprecated use `DeploymentsContent$inboundSchema` instead. */
1148
+ export const inboundSchema = DeploymentsContent$inboundSchema;
1149
+ /** @deprecated use `DeploymentsContent$outboundSchema` instead. */
1150
+ export const outboundSchema = DeploymentsContent$outboundSchema;
1151
+ /** @deprecated use `DeploymentsContent$Outbound` instead. */
1152
+ export type Outbound = DeploymentsContent$Outbound;
1153
+ }
1154
+
1155
+ export function deploymentsContentToJSON(
1156
+ deploymentsContent: DeploymentsContent,
1157
+ ): string {
1158
+ return JSON.stringify(
1159
+ DeploymentsContent$outboundSchema.parse(deploymentsContent),
1160
+ );
1161
+ }
1162
+
1163
+ export function deploymentsContentFromJSON(
1164
+ jsonString: string,
1165
+ ): SafeParseResult<DeploymentsContent, SDKValidationError> {
1166
+ return safeParse(
1167
+ jsonString,
1168
+ (x) => DeploymentsContent$inboundSchema.parse(JSON.parse(x)),
1169
+ `Failed to parse 'DeploymentsContent' from JSON`,
1170
+ );
1171
+ }
1172
+
1173
+ /** @internal */
1174
+ export const DeploymentsType$inboundSchema: z.ZodNativeEnum<
1175
+ typeof DeploymentsType
1176
+ > = z.nativeEnum(DeploymentsType);
1177
+
1178
+ /** @internal */
1179
+ export const DeploymentsType$outboundSchema: z.ZodNativeEnum<
1180
+ typeof DeploymentsType
1181
+ > = DeploymentsType$inboundSchema;
1182
+
1183
+ /**
1184
+ * @internal
1185
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1186
+ */
1187
+ export namespace DeploymentsType$ {
1188
+ /** @deprecated use `DeploymentsType$inboundSchema` instead. */
1189
+ export const inboundSchema = DeploymentsType$inboundSchema;
1190
+ /** @deprecated use `DeploymentsType$outboundSchema` instead. */
1191
+ export const outboundSchema = DeploymentsType$outboundSchema;
1192
+ }
1193
+
1194
+ /** @internal */
1195
+ export const DeploymentsFunction$inboundSchema: z.ZodType<
1196
+ DeploymentsFunction,
1197
+ z.ZodTypeDef,
1198
+ unknown
1199
+ > = z.object({
1200
+ name: z.string(),
1201
+ arguments: z.string(),
1202
+ });
1203
+
1204
+ /** @internal */
1205
+ export type DeploymentsFunction$Outbound = {
1206
+ name: string;
1207
+ arguments: string;
1208
+ };
1209
+
1210
+ /** @internal */
1211
+ export const DeploymentsFunction$outboundSchema: z.ZodType<
1212
+ DeploymentsFunction$Outbound,
1213
+ z.ZodTypeDef,
1214
+ DeploymentsFunction
1215
+ > = z.object({
1216
+ name: z.string(),
1217
+ arguments: z.string(),
1218
+ });
1219
+
1220
+ /**
1221
+ * @internal
1222
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1223
+ */
1224
+ export namespace DeploymentsFunction$ {
1225
+ /** @deprecated use `DeploymentsFunction$inboundSchema` instead. */
1226
+ export const inboundSchema = DeploymentsFunction$inboundSchema;
1227
+ /** @deprecated use `DeploymentsFunction$outboundSchema` instead. */
1228
+ export const outboundSchema = DeploymentsFunction$outboundSchema;
1229
+ /** @deprecated use `DeploymentsFunction$Outbound` instead. */
1230
+ export type Outbound = DeploymentsFunction$Outbound;
1231
+ }
1232
+
1233
+ export function deploymentsFunctionToJSON(
1234
+ deploymentsFunction: DeploymentsFunction,
1235
+ ): string {
1236
+ return JSON.stringify(
1237
+ DeploymentsFunction$outboundSchema.parse(deploymentsFunction),
1238
+ );
1239
+ }
1240
+
1241
+ export function deploymentsFunctionFromJSON(
1242
+ jsonString: string,
1243
+ ): SafeParseResult<DeploymentsFunction, SDKValidationError> {
1244
+ return safeParse(
1245
+ jsonString,
1246
+ (x) => DeploymentsFunction$inboundSchema.parse(JSON.parse(x)),
1247
+ `Failed to parse 'DeploymentsFunction' from JSON`,
1248
+ );
1249
+ }
1250
+
1251
+ /** @internal */
1252
+ export const DeploymentsToolCalls$inboundSchema: z.ZodType<
1253
+ DeploymentsToolCalls,
1254
+ z.ZodTypeDef,
1255
+ unknown
1256
+ > = z.object({
1257
+ id: z.string().optional(),
1258
+ index: z.number().optional(),
1259
+ type: DeploymentsType$inboundSchema,
1260
+ function: z.lazy(() => DeploymentsFunction$inboundSchema),
1261
+ });
1262
+
1263
+ /** @internal */
1264
+ export type DeploymentsToolCalls$Outbound = {
1265
+ id?: string | undefined;
1266
+ index?: number | undefined;
1267
+ type: string;
1268
+ function: DeploymentsFunction$Outbound;
1269
+ };
1270
+
1271
+ /** @internal */
1272
+ export const DeploymentsToolCalls$outboundSchema: z.ZodType<
1273
+ DeploymentsToolCalls$Outbound,
1274
+ z.ZodTypeDef,
1275
+ DeploymentsToolCalls
1276
+ > = z.object({
1277
+ id: z.string().optional(),
1278
+ index: z.number().optional(),
1279
+ type: DeploymentsType$outboundSchema,
1280
+ function: z.lazy(() => DeploymentsFunction$outboundSchema),
1281
+ });
1282
+
1283
+ /**
1284
+ * @internal
1285
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1286
+ */
1287
+ export namespace DeploymentsToolCalls$ {
1288
+ /** @deprecated use `DeploymentsToolCalls$inboundSchema` instead. */
1289
+ export const inboundSchema = DeploymentsToolCalls$inboundSchema;
1290
+ /** @deprecated use `DeploymentsToolCalls$outboundSchema` instead. */
1291
+ export const outboundSchema = DeploymentsToolCalls$outboundSchema;
1292
+ /** @deprecated use `DeploymentsToolCalls$Outbound` instead. */
1293
+ export type Outbound = DeploymentsToolCalls$Outbound;
1294
+ }
1295
+
1296
+ export function deploymentsToolCallsToJSON(
1297
+ deploymentsToolCalls: DeploymentsToolCalls,
1298
+ ): string {
1299
+ return JSON.stringify(
1300
+ DeploymentsToolCalls$outboundSchema.parse(deploymentsToolCalls),
1301
+ );
1302
+ }
1303
+
1304
+ export function deploymentsToolCallsFromJSON(
1305
+ jsonString: string,
1306
+ ): SafeParseResult<DeploymentsToolCalls, SDKValidationError> {
1307
+ return safeParse(
1308
+ jsonString,
1309
+ (x) => DeploymentsToolCalls$inboundSchema.parse(JSON.parse(x)),
1310
+ `Failed to parse 'DeploymentsToolCalls' from JSON`,
1311
+ );
1312
+ }
1313
+
1314
+ /** @internal */
1315
+ export const Messages$inboundSchema: z.ZodType<
1316
+ Messages,
1317
+ z.ZodTypeDef,
1318
+ unknown
1319
+ > = z.object({
1320
+ role: DeploymentsRole$inboundSchema,
1321
+ content: z.union([
1322
+ z.string(),
1323
+ z.array(z.union([
1324
+ z.lazy(() => Two1$inboundSchema),
1325
+ z.lazy(() => Deployments22$inboundSchema),
1326
+ ])),
1327
+ ]),
1328
+ tool_calls: z.array(z.lazy(() => DeploymentsToolCalls$inboundSchema))
1329
+ .optional(),
1330
+ }).transform((v) => {
1331
+ return remap$(v, {
1332
+ "tool_calls": "toolCalls",
1333
+ });
1334
+ });
1335
+
1336
+ /** @internal */
1337
+ export type Messages$Outbound = {
1338
+ role: string;
1339
+ content: string | Array<Two1$Outbound | Deployments22$Outbound>;
1340
+ tool_calls?: Array<DeploymentsToolCalls$Outbound> | undefined;
1341
+ };
1342
+
1343
+ /** @internal */
1344
+ export const Messages$outboundSchema: z.ZodType<
1345
+ Messages$Outbound,
1346
+ z.ZodTypeDef,
1347
+ Messages
1348
+ > = z.object({
1349
+ role: DeploymentsRole$outboundSchema,
1350
+ content: z.union([
1351
+ z.string(),
1352
+ z.array(z.union([
1353
+ z.lazy(() => Two1$outboundSchema),
1354
+ z.lazy(() => Deployments22$outboundSchema),
1355
+ ])),
1356
+ ]),
1357
+ toolCalls: z.array(z.lazy(() => DeploymentsToolCalls$outboundSchema))
1358
+ .optional(),
1359
+ }).transform((v) => {
1360
+ return remap$(v, {
1361
+ toolCalls: "tool_calls",
1362
+ });
1363
+ });
1364
+
1365
+ /**
1366
+ * @internal
1367
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1368
+ */
1369
+ export namespace Messages$ {
1370
+ /** @deprecated use `Messages$inboundSchema` instead. */
1371
+ export const inboundSchema = Messages$inboundSchema;
1372
+ /** @deprecated use `Messages$outboundSchema` instead. */
1373
+ export const outboundSchema = Messages$outboundSchema;
1374
+ /** @deprecated use `Messages$Outbound` instead. */
1375
+ export type Outbound = Messages$Outbound;
1376
+ }
1377
+
1378
+ export function messagesToJSON(messages: Messages): string {
1379
+ return JSON.stringify(Messages$outboundSchema.parse(messages));
1380
+ }
1381
+
1382
+ export function messagesFromJSON(
1383
+ jsonString: string,
1384
+ ): SafeParseResult<Messages, SDKValidationError> {
1385
+ return safeParse(
1386
+ jsonString,
1387
+ (x) => Messages$inboundSchema.parse(JSON.parse(x)),
1388
+ `Failed to parse 'Messages' from JSON`,
1389
+ );
1390
+ }
1391
+
1392
+ /** @internal */
1393
+ export const UserId$inboundSchema: z.ZodType<UserId, z.ZodTypeDef, unknown> = z
1394
+ .union([z.string(), z.number()]);
1395
+
1396
+ /** @internal */
1397
+ export type UserId$Outbound = string | number;
1398
+
1399
+ /** @internal */
1400
+ export const UserId$outboundSchema: z.ZodType<
1401
+ UserId$Outbound,
1402
+ z.ZodTypeDef,
1403
+ UserId
1404
+ > = z.union([z.string(), z.number()]);
1405
+
1406
+ /**
1407
+ * @internal
1408
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1409
+ */
1410
+ export namespace UserId$ {
1411
+ /** @deprecated use `UserId$inboundSchema` instead. */
1412
+ export const inboundSchema = UserId$inboundSchema;
1413
+ /** @deprecated use `UserId$outboundSchema` instead. */
1414
+ export const outboundSchema = UserId$outboundSchema;
1415
+ /** @deprecated use `UserId$Outbound` instead. */
1416
+ export type Outbound = UserId$Outbound;
1417
+ }
1418
+
1419
+ export function userIdToJSON(userId: UserId): string {
1420
+ return JSON.stringify(UserId$outboundSchema.parse(userId));
1421
+ }
1422
+
1423
+ export function userIdFromJSON(
1424
+ jsonString: string,
1425
+ ): SafeParseResult<UserId, SDKValidationError> {
1426
+ return safeParse(
1427
+ jsonString,
1428
+ (x) => UserId$inboundSchema.parse(JSON.parse(x)),
1429
+ `Failed to parse 'UserId' from JSON`,
1430
+ );
1431
+ }
1432
+
1433
+ /** @internal */
1434
+ export const InvokeOptions$inboundSchema: z.ZodType<
1435
+ InvokeOptions,
1436
+ z.ZodTypeDef,
1437
+ unknown
1438
+ > = z.object({
1439
+ include_retrievals: z.boolean().default(false),
1440
+ }).transform((v) => {
1441
+ return remap$(v, {
1442
+ "include_retrievals": "includeRetrievals",
1443
+ });
1444
+ });
1445
+
1446
+ /** @internal */
1447
+ export type InvokeOptions$Outbound = {
1448
+ include_retrievals: boolean;
1449
+ };
1450
+
1451
+ /** @internal */
1452
+ export const InvokeOptions$outboundSchema: z.ZodType<
1453
+ InvokeOptions$Outbound,
1454
+ z.ZodTypeDef,
1455
+ InvokeOptions
1456
+ > = z.object({
1457
+ includeRetrievals: z.boolean().default(false),
1458
+ }).transform((v) => {
1459
+ return remap$(v, {
1460
+ includeRetrievals: "include_retrievals",
1461
+ });
1462
+ });
1463
+
1464
+ /**
1465
+ * @internal
1466
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1467
+ */
1468
+ export namespace InvokeOptions$ {
1469
+ /** @deprecated use `InvokeOptions$inboundSchema` instead. */
1470
+ export const inboundSchema = InvokeOptions$inboundSchema;
1471
+ /** @deprecated use `InvokeOptions$outboundSchema` instead. */
1472
+ export const outboundSchema = InvokeOptions$outboundSchema;
1473
+ /** @deprecated use `InvokeOptions$Outbound` instead. */
1474
+ export type Outbound = InvokeOptions$Outbound;
1475
+ }
1476
+
1477
+ export function invokeOptionsToJSON(invokeOptions: InvokeOptions): string {
1478
+ return JSON.stringify(InvokeOptions$outboundSchema.parse(invokeOptions));
1479
+ }
1480
+
1481
+ export function invokeOptionsFromJSON(
1482
+ jsonString: string,
1483
+ ): SafeParseResult<InvokeOptions, SDKValidationError> {
1484
+ return safeParse(
1485
+ jsonString,
1486
+ (x) => InvokeOptions$inboundSchema.parse(JSON.parse(x)),
1487
+ `Failed to parse 'InvokeOptions' from JSON`,
1488
+ );
1489
+ }
1490
+
1491
+ /** @internal */
1492
+ export const Deployments$inboundSchema: z.ZodType<
1493
+ Deployments,
1494
+ z.ZodTypeDef,
1495
+ unknown
1496
+ > = z.object({
1497
+ key: z.string(),
1498
+ stream: z.boolean().default(false),
1499
+ inputs: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
1500
+ context: z.record(z.any()).optional(),
1501
+ prefix_messages: z.array(z.lazy(() => PrefixMessages$inboundSchema))
1502
+ .optional(),
1503
+ messages: z.array(z.lazy(() => Messages$inboundSchema)).optional(),
1504
+ file_ids: z.array(z.string()).optional(),
1505
+ metadata: z.record(z.any()).optional(),
1506
+ chain_id: z.string().optional(),
1507
+ conversation_id: z.string().optional(),
1508
+ user_id: z.union([z.string(), z.number()]).optional(),
1509
+ deployment_id: z.string().optional(),
1510
+ deployment_variant_id: z.string().optional(),
1511
+ extra_params: z.record(z.any()).optional(),
1512
+ invoke_options: z.lazy(() => InvokeOptions$inboundSchema).optional(),
1513
+ }).transform((v) => {
1514
+ return remap$(v, {
1515
+ "prefix_messages": "prefixMessages",
1516
+ "file_ids": "fileIds",
1517
+ "chain_id": "chainId",
1518
+ "conversation_id": "conversationId",
1519
+ "user_id": "userId",
1520
+ "deployment_id": "deploymentId",
1521
+ "deployment_variant_id": "deploymentVariantId",
1522
+ "extra_params": "extraParams",
1523
+ "invoke_options": "invokeOptions",
1524
+ });
1525
+ });
1526
+
1527
+ /** @internal */
1528
+ export type Deployments$Outbound = {
1529
+ key: string;
1530
+ stream: boolean;
1531
+ inputs?: { [k: string]: string | number | boolean } | undefined;
1532
+ context?: { [k: string]: any } | undefined;
1533
+ prefix_messages?: Array<PrefixMessages$Outbound> | undefined;
1534
+ messages?: Array<Messages$Outbound> | undefined;
1535
+ file_ids?: Array<string> | undefined;
1536
+ metadata?: { [k: string]: any } | undefined;
1537
+ chain_id?: string | undefined;
1538
+ conversation_id?: string | undefined;
1539
+ user_id?: string | number | undefined;
1540
+ deployment_id?: string | undefined;
1541
+ deployment_variant_id?: string | undefined;
1542
+ extra_params?: { [k: string]: any } | undefined;
1543
+ invoke_options?: InvokeOptions$Outbound | undefined;
1544
+ };
1545
+
1546
+ /** @internal */
1547
+ export const Deployments$outboundSchema: z.ZodType<
1548
+ Deployments$Outbound,
1549
+ z.ZodTypeDef,
1550
+ Deployments
1551
+ > = z.object({
1552
+ key: z.string(),
1553
+ stream: z.boolean().default(false),
1554
+ inputs: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
1555
+ context: z.record(z.any()).optional(),
1556
+ prefixMessages: z.array(z.lazy(() => PrefixMessages$outboundSchema))
1557
+ .optional(),
1558
+ messages: z.array(z.lazy(() => Messages$outboundSchema)).optional(),
1559
+ fileIds: z.array(z.string()).optional(),
1560
+ metadata: z.record(z.any()).optional(),
1561
+ chainId: z.string().optional(),
1562
+ conversationId: z.string().optional(),
1563
+ userId: z.union([z.string(), z.number()]).optional(),
1564
+ deploymentId: z.string().optional(),
1565
+ deploymentVariantId: z.string().optional(),
1566
+ extraParams: z.record(z.any()).optional(),
1567
+ invokeOptions: z.lazy(() => InvokeOptions$outboundSchema).optional(),
1568
+ }).transform((v) => {
1569
+ return remap$(v, {
1570
+ prefixMessages: "prefix_messages",
1571
+ fileIds: "file_ids",
1572
+ chainId: "chain_id",
1573
+ conversationId: "conversation_id",
1574
+ userId: "user_id",
1575
+ deploymentId: "deployment_id",
1576
+ deploymentVariantId: "deployment_variant_id",
1577
+ extraParams: "extra_params",
1578
+ invokeOptions: "invoke_options",
1579
+ });
1580
+ });
1581
+
1582
+ /**
1583
+ * @internal
1584
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1585
+ */
1586
+ export namespace Deployments$ {
1587
+ /** @deprecated use `Deployments$inboundSchema` instead. */
1588
+ export const inboundSchema = Deployments$inboundSchema;
1589
+ /** @deprecated use `Deployments$outboundSchema` instead. */
1590
+ export const outboundSchema = Deployments$outboundSchema;
1591
+ /** @deprecated use `Deployments$Outbound` instead. */
1592
+ export type Outbound = Deployments$Outbound;
1593
+ }
1594
+
1595
+ export function deploymentsToJSON(deployments: Deployments): string {
1596
+ return JSON.stringify(Deployments$outboundSchema.parse(deployments));
1597
+ }
1598
+
1599
+ export function deploymentsFromJSON(
1600
+ jsonString: string,
1601
+ ): SafeParseResult<Deployments, SDKValidationError> {
1602
+ return safeParse(
1603
+ jsonString,
1604
+ (x) => Deployments$inboundSchema.parse(JSON.parse(x)),
1605
+ `Failed to parse 'Deployments' from JSON`,
1606
+ );
1607
+ }