@orq-ai/node 4.7.0-rc.57 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (502) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +2 -2
  3. package/lib/config.js +2 -2
  4. package/lib/config.js.map +1 -1
  5. package/models/components/reasoningpart.js +1 -1
  6. package/models/operations/createcontact.js +1 -1
  7. package/models/operations/createdataset.js +1 -1
  8. package/models/operations/createdatasetitem.js +4 -4
  9. package/models/operations/createdatasource.js +1 -1
  10. package/models/operations/createeval.js +16 -16
  11. package/models/operations/createidentity.js +1 -1
  12. package/models/operations/createtool.js +6 -6
  13. package/models/operations/getalltools.js +6 -6
  14. package/models/operations/getevals.js +16 -16
  15. package/models/operations/getv2humanevals.js +6 -6
  16. package/models/operations/getv2humanevalsets.js +2 -2
  17. package/models/operations/getv2humanevalsetsid.js +2 -2
  18. package/models/operations/getv2humanevalsid.js +6 -6
  19. package/models/operations/listdatasetdatapoints.js +4 -4
  20. package/models/operations/listdatasets.js +1 -1
  21. package/models/operations/listdatasources.js +1 -1
  22. package/models/operations/listidentities.js +1 -1
  23. package/models/operations/patchv2humanevalsetsid.js +2 -2
  24. package/models/operations/patchv2humanevalsid.js +12 -12
  25. package/models/operations/postv2feedbackevaluation.js +3 -3
  26. package/models/operations/postv2humanevals.js +12 -12
  27. package/models/operations/postv2humanevalsets.js +2 -2
  28. package/models/operations/retrievedatapoint.js +4 -4
  29. package/models/operations/retrievedataset.js +1 -1
  30. package/models/operations/retrievedatasource.js +1 -1
  31. package/models/operations/retrieveidentity.js +1 -1
  32. package/models/operations/retrievetool.js +6 -6
  33. package/models/operations/runagent.js +1 -1
  34. package/models/operations/streamrunagent.js +1 -1
  35. package/models/operations/updatedatapoint.js +4 -4
  36. package/models/operations/updatedataset.js +1 -1
  37. package/models/operations/updatedatasource.js +1 -1
  38. package/models/operations/updateeval.js +16 -16
  39. package/models/operations/updateidentity.js +1 -1
  40. package/models/operations/updatetool.js +7 -7
  41. package/package.json +3 -4
  42. package/packages/orq-rc/examples/postV2Feedback.example.ts +26 -0
  43. package/packages/orq-rc/src/core.ts +13 -0
  44. package/packages/orq-rc/src/funcs/agentsCreate.ts +161 -0
  45. package/packages/orq-rc/src/funcs/agentsDelete.ts +179 -0
  46. package/packages/orq-rc/src/funcs/agentsInvoke.ts +176 -0
  47. package/packages/orq-rc/src/funcs/agentsList.ts +184 -0
  48. package/packages/orq-rc/src/funcs/agentsPostV2AgentsA2a.ts +178 -0
  49. package/packages/orq-rc/src/funcs/agentsPostV2AgentsKeyCardRefresh.ts +186 -0
  50. package/packages/orq-rc/src/funcs/agentsResponsesCreate.ts +182 -0
  51. package/packages/orq-rc/src/funcs/agentsResponsesGet.ts +181 -0
  52. package/packages/orq-rc/src/funcs/agentsRetrieve.ts +179 -0
  53. package/packages/orq-rc/src/funcs/agentsRun.ts +162 -0
  54. package/packages/orq-rc/src/funcs/agentsStream.ts +203 -0
  55. package/packages/orq-rc/src/funcs/agentsStreamRun.ts +189 -0
  56. package/packages/orq-rc/src/funcs/agentsUpdate.ts +183 -0
  57. package/packages/orq-rc/src/funcs/annotationsCreate.ts +170 -0
  58. package/packages/orq-rc/src/funcs/annotationsDelete.ts +170 -0
  59. package/packages/orq-rc/src/funcs/chunkingParse.ts +160 -0
  60. package/packages/orq-rc/src/funcs/contactsCreate.ts +160 -0
  61. package/packages/orq-rc/src/funcs/datasetsClear.ts +166 -0
  62. package/packages/orq-rc/src/funcs/datasetsCreate.ts +165 -0
  63. package/packages/orq-rc/src/funcs/datasetsCreateDatapoint.ts +170 -0
  64. package/packages/orq-rc/src/funcs/datasetsDelete.ts +166 -0
  65. package/packages/orq-rc/src/funcs/datasetsDeleteDatapoint.ts +181 -0
  66. package/packages/orq-rc/src/funcs/datasetsList.ts +167 -0
  67. package/packages/orq-rc/src/funcs/datasetsListDatapoints.ts +173 -0
  68. package/packages/orq-rc/src/funcs/datasetsRetrieve.ts +174 -0
  69. package/packages/orq-rc/src/funcs/datasetsRetrieveDatapoint.ts +180 -0
  70. package/packages/orq-rc/src/funcs/datasetsUpdate.ts +175 -0
  71. package/packages/orq-rc/src/funcs/datasetsUpdateDatapoint.ts +178 -0
  72. package/packages/orq-rc/src/funcs/deleteV2HumanEvalsId.ts +169 -0
  73. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +168 -0
  74. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +176 -0
  75. package/packages/orq-rc/src/funcs/deploymentsList.ts +176 -0
  76. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +169 -0
  77. package/packages/orq-rc/src/funcs/deploymentsStream.ts +186 -0
  78. package/packages/orq-rc/src/funcs/evalsAll.ts +173 -0
  79. package/packages/orq-rc/src/funcs/evalsCreate.ts +169 -0
  80. package/packages/orq-rc/src/funcs/evalsDelete.ts +172 -0
  81. package/packages/orq-rc/src/funcs/evalsInvoke.ts +180 -0
  82. package/packages/orq-rc/src/funcs/evalsUpdate.ts +172 -0
  83. package/packages/orq-rc/src/funcs/evaluatorsGetV2EvaluatorsIdVersions.ts +182 -0
  84. package/packages/orq-rc/src/funcs/filesCreate.ts +194 -0
  85. package/packages/orq-rc/src/funcs/filesDelete.ts +163 -0
  86. package/packages/orq-rc/src/funcs/filesGet.ts +165 -0
  87. package/packages/orq-rc/src/funcs/filesGetContent.ts +166 -0
  88. package/packages/orq-rc/src/funcs/filesList.ts +167 -0
  89. package/packages/orq-rc/src/funcs/filesUpdate.ts +166 -0
  90. package/packages/orq-rc/src/funcs/getV2HumanEvals.ts +169 -0
  91. package/packages/orq-rc/src/funcs/getV2HumanEvalsId.ts +168 -0
  92. package/packages/orq-rc/src/funcs/humanReviewSetsDeleteV2HumanEvalSetsId.ts +164 -0
  93. package/packages/orq-rc/src/funcs/humanReviewSetsGetV2HumanEvalSets.ts +168 -0
  94. package/packages/orq-rc/src/funcs/humanReviewSetsGetV2HumanEvalSetsId.ts +163 -0
  95. package/packages/orq-rc/src/funcs/humanReviewSetsPatchV2HumanEvalSetsId.ts +164 -0
  96. package/packages/orq-rc/src/funcs/humanReviewSetsPostV2HumanEvalSets.ts +162 -0
  97. package/packages/orq-rc/src/funcs/identitiesCreate.ts +165 -0
  98. package/packages/orq-rc/src/funcs/identitiesDelete.ts +175 -0
  99. package/packages/orq-rc/src/funcs/identitiesList.ts +170 -0
  100. package/packages/orq-rc/src/funcs/identitiesRetrieve.ts +183 -0
  101. package/packages/orq-rc/src/funcs/identitiesUpdate.ts +175 -0
  102. package/packages/orq-rc/src/funcs/knowledgeCreate.ts +158 -0
  103. package/packages/orq-rc/src/funcs/knowledgeCreateChunks.ts +170 -0
  104. package/packages/orq-rc/src/funcs/knowledgeCreateDatasource.ts +165 -0
  105. package/packages/orq-rc/src/funcs/knowledgeDelete.ts +166 -0
  106. package/packages/orq-rc/src/funcs/knowledgeDeleteChunk.ts +173 -0
  107. package/packages/orq-rc/src/funcs/knowledgeDeleteChunks.ts +169 -0
  108. package/packages/orq-rc/src/funcs/knowledgeDeleteDatasource.ts +172 -0
  109. package/packages/orq-rc/src/funcs/knowledgeGetChunksCount.ts +169 -0
  110. package/packages/orq-rc/src/funcs/knowledgeList.ts +169 -0
  111. package/packages/orq-rc/src/funcs/knowledgeListChunks.ts +177 -0
  112. package/packages/orq-rc/src/funcs/knowledgeListChunksPaginated.ts +170 -0
  113. package/packages/orq-rc/src/funcs/knowledgeListDatasources.ts +173 -0
  114. package/packages/orq-rc/src/funcs/knowledgeRetrieve.ts +165 -0
  115. package/packages/orq-rc/src/funcs/knowledgeRetrieveChunk.ts +172 -0
  116. package/packages/orq-rc/src/funcs/knowledgeRetrieveDatasource.ts +168 -0
  117. package/packages/orq-rc/src/funcs/knowledgeSearch.ts +166 -0
  118. package/packages/orq-rc/src/funcs/knowledgeUpdate.ts +163 -0
  119. package/packages/orq-rc/src/funcs/knowledgeUpdateChunk.ts +173 -0
  120. package/packages/orq-rc/src/funcs/knowledgeUpdateDatasource.ts +169 -0
  121. package/packages/orq-rc/src/funcs/memoryStoresCreate.ts +162 -0
  122. package/packages/orq-rc/src/funcs/memoryStoresCreateDocument.ts +175 -0
  123. package/packages/orq-rc/src/funcs/memoryStoresCreateMemory.ts +169 -0
  124. package/packages/orq-rc/src/funcs/memoryStoresDelete.ts +167 -0
  125. package/packages/orq-rc/src/funcs/memoryStoresDeleteDocument.ts +184 -0
  126. package/packages/orq-rc/src/funcs/memoryStoresDeleteMemory.ts +179 -0
  127. package/packages/orq-rc/src/funcs/memoryStoresList.ts +178 -0
  128. package/packages/orq-rc/src/funcs/memoryStoresListDocuments.ts +183 -0
  129. package/packages/orq-rc/src/funcs/memoryStoresListMemories.ts +176 -0
  130. package/packages/orq-rc/src/funcs/memoryStoresRetrieve.ts +176 -0
  131. package/packages/orq-rc/src/funcs/memoryStoresRetrieveDocument.ts +178 -0
  132. package/packages/orq-rc/src/funcs/memoryStoresRetrieveMemory.ts +173 -0
  133. package/packages/orq-rc/src/funcs/memoryStoresUpdate.ts +167 -0
  134. package/packages/orq-rc/src/funcs/memoryStoresUpdateDocument.ts +179 -0
  135. package/packages/orq-rc/src/funcs/memoryStoresUpdateMemory.ts +174 -0
  136. package/packages/orq-rc/src/funcs/modelsList.ts +165 -0
  137. package/packages/orq-rc/src/funcs/patchV2HumanEvalsId.ts +170 -0
  138. package/packages/orq-rc/src/funcs/postV2Feedback.ts +172 -0
  139. package/packages/orq-rc/src/funcs/postV2FeedbackEvaluation.ts +159 -0
  140. package/packages/orq-rc/src/funcs/postV2FeedbackEvaluationRemove.ts +159 -0
  141. package/packages/orq-rc/src/funcs/postV2FeedbackRemove.ts +167 -0
  142. package/packages/orq-rc/src/funcs/postV2HumanEvals.ts +168 -0
  143. package/packages/orq-rc/src/funcs/promptsCreate.ts +160 -0
  144. package/packages/orq-rc/src/funcs/promptsDelete.ts +172 -0
  145. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +180 -0
  146. package/packages/orq-rc/src/funcs/promptsList.ts +167 -0
  147. package/packages/orq-rc/src/funcs/promptsListVersions.ts +172 -0
  148. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +165 -0
  149. package/packages/orq-rc/src/funcs/promptsUpdate.ts +172 -0
  150. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +161 -0
  151. package/packages/orq-rc/src/funcs/routerAudioSpeechCreate.ts +161 -0
  152. package/packages/orq-rc/src/funcs/routerAudioTranscriptionsCreate.ts +269 -0
  153. package/packages/orq-rc/src/funcs/routerAudioTranslationsCreate.ts +259 -0
  154. package/packages/orq-rc/src/funcs/routerChatCompletionsCreate.ts +168 -0
  155. package/packages/orq-rc/src/funcs/routerCompletionsCreate.ts +168 -0
  156. package/packages/orq-rc/src/funcs/routerEmbeddingsCreate.ts +161 -0
  157. package/packages/orq-rc/src/funcs/routerImagesEditsCreate.ts +222 -0
  158. package/packages/orq-rc/src/funcs/routerImagesGenerationsCreate.ts +160 -0
  159. package/packages/orq-rc/src/funcs/routerImagesVariationsCreate.ts +218 -0
  160. package/packages/orq-rc/src/funcs/routerModerationsCreate.ts +167 -0
  161. package/packages/orq-rc/src/funcs/routerOcr.ts +158 -0
  162. package/packages/orq-rc/src/funcs/routerRerankCreate.ts +160 -0
  163. package/packages/orq-rc/src/funcs/routerResponsesCreate.ts +167 -0
  164. package/packages/orq-rc/src/funcs/toolsCreate.ts +163 -0
  165. package/packages/orq-rc/src/funcs/toolsDelete.ts +166 -0
  166. package/packages/orq-rc/src/funcs/toolsGetV2ToolsToolIdVersions.ts +182 -0
  167. package/packages/orq-rc/src/funcs/toolsGetV2ToolsToolIdVersionsVersionId.ts +189 -0
  168. package/packages/orq-rc/src/funcs/toolsList.ts +176 -0
  169. package/packages/orq-rc/src/funcs/toolsRetrieve.ts +165 -0
  170. package/packages/orq-rc/src/funcs/toolsUpdate.ts +175 -0
  171. package/packages/orq-rc/src/hooks/global.ts +44 -0
  172. package/packages/orq-rc/src/hooks/hooks.ts +132 -0
  173. package/packages/orq-rc/src/hooks/index.ts +6 -0
  174. package/packages/orq-rc/src/hooks/registration.ts +15 -0
  175. package/packages/orq-rc/src/hooks/types.ts +112 -0
  176. package/packages/orq-rc/src/index.ts +9 -0
  177. package/packages/orq-rc/src/lib/base64.ts +37 -0
  178. package/packages/orq-rc/src/lib/config.ts +74 -0
  179. package/packages/orq-rc/src/lib/dlv.ts +53 -0
  180. package/packages/orq-rc/src/lib/encodings.ts +516 -0
  181. package/packages/orq-rc/src/lib/env.ts +89 -0
  182. package/packages/orq-rc/src/lib/event-streams.ts +165 -0
  183. package/packages/orq-rc/src/lib/files.ts +104 -0
  184. package/packages/orq-rc/src/lib/http.ts +323 -0
  185. package/packages/orq-rc/src/lib/is-plain-object.ts +43 -0
  186. package/packages/orq-rc/src/lib/logger.ts +9 -0
  187. package/packages/orq-rc/src/lib/matchers.ts +346 -0
  188. package/packages/orq-rc/src/lib/primitives.ts +150 -0
  189. package/packages/orq-rc/src/lib/retries.ts +218 -0
  190. package/packages/orq-rc/src/lib/schemas.ts +91 -0
  191. package/packages/orq-rc/src/lib/sdks.ts +409 -0
  192. package/packages/orq-rc/src/lib/security.ts +275 -0
  193. package/packages/orq-rc/src/lib/url.ts +35 -0
  194. package/packages/orq-rc/src/models/components/actionreviewedstreamingevent.ts +99 -0
  195. package/packages/orq-rc/src/models/components/actionreviewrequestedstreamingevent.ts +185 -0
  196. package/packages/orq-rc/src/models/components/agenterroredstreamingevent.ts +73 -0
  197. package/packages/orq-rc/src/models/components/agentexecutionstartedstreamingevent.ts +91 -0
  198. package/packages/orq-rc/src/models/components/agenthandedoffstreamingevent.ts +71 -0
  199. package/packages/orq-rc/src/models/components/agentinactivestreamingevent.ts +507 -0
  200. package/packages/orq-rc/src/models/components/agentmessagecreatedstreamingevent.ts +165 -0
  201. package/packages/orq-rc/src/models/components/agentresponsemessage.ts +103 -0
  202. package/packages/orq-rc/src/models/components/agentstartedstreamingevent.ts +517 -0
  203. package/packages/orq-rc/src/models/components/agentthoughtstreamingevent.ts +807 -0
  204. package/packages/orq-rc/src/models/components/audiocontentpartschema.ts +136 -0
  205. package/packages/orq-rc/src/models/components/createagentresponse.ts +305 -0
  206. package/packages/orq-rc/src/models/components/datapart.ts +38 -0
  207. package/packages/orq-rc/src/models/components/errorpart.ts +58 -0
  208. package/packages/orq-rc/src/models/components/errorstreamingevent.ts +66 -0
  209. package/packages/orq-rc/src/models/components/executionnamedstreamingevent.ts +71 -0
  210. package/packages/orq-rc/src/models/components/executionreviewedstreamingevent.ts +61 -0
  211. package/packages/orq-rc/src/models/components/executionreviewrequiredstreamingevent.ts +67 -0
  212. package/packages/orq-rc/src/models/components/extendedmessage.ts +146 -0
  213. package/packages/orq-rc/src/models/components/filecontentpartschema.ts +87 -0
  214. package/packages/orq-rc/src/models/components/filedocument.ts +48 -0
  215. package/packages/orq-rc/src/models/components/filepart.ts +218 -0
  216. package/packages/orq-rc/src/models/components/getagentresponse.ts +348 -0
  217. package/packages/orq-rc/src/models/components/imagecontentpartschema.ts +268 -0
  218. package/packages/orq-rc/src/models/components/index.ts +61 -0
  219. package/packages/orq-rc/src/models/components/invokedeploymentrequest.ts +3450 -0
  220. package/packages/orq-rc/src/models/components/partdelta.ts +39 -0
  221. package/packages/orq-rc/src/models/components/partdeltaevent.ts +73 -0
  222. package/packages/orq-rc/src/models/components/partdoneevent.ts +70 -0
  223. package/packages/orq-rc/src/models/components/publiccontact.ts +71 -0
  224. package/packages/orq-rc/src/models/components/publicidentity.ts +69 -0
  225. package/packages/orq-rc/src/models/components/reasoningpart.ts +62 -0
  226. package/packages/orq-rc/src/models/components/reasoningpartschema.ts +71 -0
  227. package/packages/orq-rc/src/models/components/redactedreasoningpartschema.ts +66 -0
  228. package/packages/orq-rc/src/models/components/refusalpartschema.ts +64 -0
  229. package/packages/orq-rc/src/models/components/responsedoneevent.ts +324 -0
  230. package/packages/orq-rc/src/models/components/responsefailedevent.ts +72 -0
  231. package/packages/orq-rc/src/models/components/responsestartedevent.ts +97 -0
  232. package/packages/orq-rc/src/models/components/responsestreamingevent.ts +85 -0
  233. package/packages/orq-rc/src/models/components/reviewoutcome.ts +23 -0
  234. package/packages/orq-rc/src/models/components/security.ts +32 -0
  235. package/packages/orq-rc/src/models/components/telemetry.ts +48 -0
  236. package/packages/orq-rc/src/models/components/textcontentpartschema.ts +207 -0
  237. package/packages/orq-rc/src/models/components/textpart.ts +54 -0
  238. package/packages/orq-rc/src/models/components/thinkingconfigadaptiveschema.ts +59 -0
  239. package/packages/orq-rc/src/models/components/thinkingconfigdisabledschema.ts +59 -0
  240. package/packages/orq-rc/src/models/components/thinkingconfigenabledschema.ts +106 -0
  241. package/packages/orq-rc/src/models/components/timeoutstreamingevent.ts +64 -0
  242. package/packages/orq-rc/src/models/components/toolcallpart.ts +51 -0
  243. package/packages/orq-rc/src/models/components/tooldoneevent.ts +77 -0
  244. package/packages/orq-rc/src/models/components/toolexecutionfailedstreamingevent.ts +235 -0
  245. package/packages/orq-rc/src/models/components/toolexecutionfinishedstreamingevent.ts +219 -0
  246. package/packages/orq-rc/src/models/components/toolexecutionstartedstreamingevent.ts +205 -0
  247. package/packages/orq-rc/src/models/components/toolfailedevent.ts +77 -0
  248. package/packages/orq-rc/src/models/components/toolresultpart.ts +71 -0
  249. package/packages/orq-rc/src/models/components/toolreviewdoneevent.ts +78 -0
  250. package/packages/orq-rc/src/models/components/toolreviewrequestedevent.ts +87 -0
  251. package/packages/orq-rc/src/models/components/toolstartedevent.ts +82 -0
  252. package/packages/orq-rc/src/models/errors/apierror.ts +40 -0
  253. package/packages/orq-rc/src/models/errors/createeval.ts +51 -0
  254. package/packages/orq-rc/src/models/errors/createmoderation.ts +84 -0
  255. package/packages/orq-rc/src/models/errors/createtranscription.ts +87 -0
  256. package/packages/orq-rc/src/models/errors/createtranslation.ts +87 -0
  257. package/packages/orq-rc/src/models/errors/deleteagent.ts +51 -0
  258. package/packages/orq-rc/src/models/errors/deleteeval.ts +51 -0
  259. package/packages/orq-rc/src/models/errors/deleteidentity.ts +62 -0
  260. package/packages/orq-rc/src/models/errors/deleteprompt.ts +51 -0
  261. package/packages/orq-rc/src/models/errors/deletev2humanevalsid.ts +51 -0
  262. package/packages/orq-rc/src/models/errors/getevals.ts +51 -0
  263. package/packages/orq-rc/src/models/errors/getpromptversion.ts +51 -0
  264. package/packages/orq-rc/src/models/errors/getv2evaluatorsidversions.ts +51 -0
  265. package/packages/orq-rc/src/models/errors/getv2humanevals.ts +51 -0
  266. package/packages/orq-rc/src/models/errors/getv2humanevalsid.ts +51 -0
  267. package/packages/orq-rc/src/models/errors/getv2toolstoolidversions.ts +51 -0
  268. package/packages/orq-rc/src/models/errors/getv2toolstoolidversionsversionid.ts +52 -0
  269. package/packages/orq-rc/src/models/errors/honoapierror.ts +59 -0
  270. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +62 -0
  271. package/packages/orq-rc/src/models/errors/index.ts +42 -0
  272. package/packages/orq-rc/src/models/errors/invokeeval.ts +141 -0
  273. package/packages/orq-rc/src/models/errors/orqerror.ts +35 -0
  274. package/packages/orq-rc/src/models/errors/patchv2humanevalsid.ts +51 -0
  275. package/packages/orq-rc/src/models/errors/postv2agentsa2a.ts +96 -0
  276. package/packages/orq-rc/src/models/errors/postv2agentskeycardrefresh.ts +97 -0
  277. package/packages/orq-rc/src/models/errors/postv2feedback.ts +96 -0
  278. package/packages/orq-rc/src/models/errors/postv2feedbackremove.ts +51 -0
  279. package/packages/orq-rc/src/models/errors/postv2humanevals.ts +51 -0
  280. package/packages/orq-rc/src/models/errors/responsevalidationerror.ts +50 -0
  281. package/packages/orq-rc/src/models/errors/retrieveagentrequest.ts +51 -0
  282. package/packages/orq-rc/src/models/errors/retrieveidentity.ts +118 -0
  283. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +109 -0
  284. package/packages/orq-rc/src/models/errors/streamagent.ts +51 -0
  285. package/packages/orq-rc/src/models/errors/streamrunagent.ts +51 -0
  286. package/packages/orq-rc/src/models/errors/updateagent.ts +51 -0
  287. package/packages/orq-rc/src/models/errors/updateeval.ts +51 -0
  288. package/packages/orq-rc/src/models/errors/updateidentity.ts +54 -0
  289. package/packages/orq-rc/src/models/errors/updateprompt.ts +51 -0
  290. package/packages/orq-rc/src/models/errors/updatetool.ts +62 -0
  291. package/packages/orq-rc/src/models/operations/cleardataset.ts +39 -0
  292. package/packages/orq-rc/src/models/operations/createagentrequest.ts +6459 -0
  293. package/packages/orq-rc/src/models/operations/createagentresponserequest.ts +670 -0
  294. package/packages/orq-rc/src/models/operations/createannotation.ts +166 -0
  295. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +6398 -0
  296. package/packages/orq-rc/src/models/operations/createchunk.ts +222 -0
  297. package/packages/orq-rc/src/models/operations/createcompletion.ts +3473 -0
  298. package/packages/orq-rc/src/models/operations/createcontact.ts +156 -0
  299. package/packages/orq-rc/src/models/operations/createdataset.ts +162 -0
  300. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2554 -0
  301. package/packages/orq-rc/src/models/operations/createdatasource.ts +437 -0
  302. package/packages/orq-rc/src/models/operations/createembedding.ts +947 -0
  303. package/packages/orq-rc/src/models/operations/createeval.ts +4229 -0
  304. package/packages/orq-rc/src/models/operations/createidentity.ts +162 -0
  305. package/packages/orq-rc/src/models/operations/createimage.ts +1034 -0
  306. package/packages/orq-rc/src/models/operations/createimageedit.ts +1045 -0
  307. package/packages/orq-rc/src/models/operations/createimagevariation.ts +1067 -0
  308. package/packages/orq-rc/src/models/operations/createknowledge.ts +960 -0
  309. package/packages/orq-rc/src/models/operations/creatememory.ts +142 -0
  310. package/packages/orq-rc/src/models/operations/creatememorydocument.ts +152 -0
  311. package/packages/orq-rc/src/models/operations/creatememorystore.ts +199 -0
  312. package/packages/orq-rc/src/models/operations/createmoderation.ts +664 -0
  313. package/packages/orq-rc/src/models/operations/createprompt.ts +5405 -0
  314. package/packages/orq-rc/src/models/operations/creatererank.ts +890 -0
  315. package/packages/orq-rc/src/models/operations/createresponse.ts +3864 -0
  316. package/packages/orq-rc/src/models/operations/createspeech.ts +700 -0
  317. package/packages/orq-rc/src/models/operations/createtool.ts +2509 -0
  318. package/packages/orq-rc/src/models/operations/createtranscription.ts +955 -0
  319. package/packages/orq-rc/src/models/operations/createtranslation.ts +930 -0
  320. package/packages/orq-rc/src/models/operations/deleteagent.ts +39 -0
  321. package/packages/orq-rc/src/models/operations/deleteannotation.ts +82 -0
  322. package/packages/orq-rc/src/models/operations/deletechunk.ts +53 -0
  323. package/packages/orq-rc/src/models/operations/deletechunks.ts +125 -0
  324. package/packages/orq-rc/src/models/operations/deletedatapoint.ts +46 -0
  325. package/packages/orq-rc/src/models/operations/deletedataset.ts +39 -0
  326. package/packages/orq-rc/src/models/operations/deletedatasource.ts +46 -0
  327. package/packages/orq-rc/src/models/operations/deleteeval.ts +31 -0
  328. package/packages/orq-rc/src/models/operations/deleteidentity.ts +34 -0
  329. package/packages/orq-rc/src/models/operations/deleteknowledge.ts +39 -0
  330. package/packages/orq-rc/src/models/operations/deletememory.ts +46 -0
  331. package/packages/orq-rc/src/models/operations/deletememorydocument.ts +55 -0
  332. package/packages/orq-rc/src/models/operations/deletememorystore.ts +39 -0
  333. package/packages/orq-rc/src/models/operations/deleteprompt.ts +34 -0
  334. package/packages/orq-rc/src/models/operations/deletetool.ts +36 -0
  335. package/packages/orq-rc/src/models/operations/deletev2humanevalsetsid.ts +36 -0
  336. package/packages/orq-rc/src/models/operations/deletev2humanevalsid.ts +67 -0
  337. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +2370 -0
  338. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +4526 -0
  339. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +735 -0
  340. package/packages/orq-rc/src/models/operations/deployments.ts +1273 -0
  341. package/packages/orq-rc/src/models/operations/deploymentstream.ts +4659 -0
  342. package/packages/orq-rc/src/models/operations/filecontent.ts +39 -0
  343. package/packages/orq-rc/src/models/operations/filedelete.ts +39 -0
  344. package/packages/orq-rc/src/models/operations/fileget.ts +80 -0
  345. package/packages/orq-rc/src/models/operations/filelist.ts +85 -0
  346. package/packages/orq-rc/src/models/operations/fileupdate.ts +118 -0
  347. package/packages/orq-rc/src/models/operations/fileupload.ts +135 -0
  348. package/packages/orq-rc/src/models/operations/getagentresponse.ts +46 -0
  349. package/packages/orq-rc/src/models/operations/getallmemories.ts +173 -0
  350. package/packages/orq-rc/src/models/operations/getallmemorydocuments.ts +188 -0
  351. package/packages/orq-rc/src/models/operations/getallmemorystores.ts +200 -0
  352. package/packages/orq-rc/src/models/operations/getallprompts.ts +3173 -0
  353. package/packages/orq-rc/src/models/operations/getalltools.ts +1404 -0
  354. package/packages/orq-rc/src/models/operations/getchunkscount.ts +121 -0
  355. package/packages/orq-rc/src/models/operations/getevals.ts +2868 -0
  356. package/packages/orq-rc/src/models/operations/getonechunk.ts +171 -0
  357. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +652 -0
  358. package/packages/orq-rc/src/models/operations/getoneprompt.ts +3098 -0
  359. package/packages/orq-rc/src/models/operations/getpromptversion.ts +3143 -0
  360. package/packages/orq-rc/src/models/operations/getv2evaluatorsidversions.ts +162 -0
  361. package/packages/orq-rc/src/models/operations/getv2humanevals.ts +696 -0
  362. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +234 -0
  363. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +235 -0
  364. package/packages/orq-rc/src/models/operations/getv2humanevalsid.ts +707 -0
  365. package/packages/orq-rc/src/models/operations/getv2toolstoolidversions.ts +163 -0
  366. package/packages/orq-rc/src/models/operations/getv2toolstoolidversionsversionid.ts +110 -0
  367. package/packages/orq-rc/src/models/operations/index.ts +131 -0
  368. package/packages/orq-rc/src/models/operations/invokeagent.ts +801 -0
  369. package/packages/orq-rc/src/models/operations/invokeeval.ts +1254 -0
  370. package/packages/orq-rc/src/models/operations/listagents.ts +2781 -0
  371. package/packages/orq-rc/src/models/operations/listchunks.ts +260 -0
  372. package/packages/orq-rc/src/models/operations/listchunkspaginated.ts +263 -0
  373. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +1498 -0
  374. package/packages/orq-rc/src/models/operations/listdatasets.ts +205 -0
  375. package/packages/orq-rc/src/models/operations/listdatasources.ts +235 -0
  376. package/packages/orq-rc/src/models/operations/listidentities.ts +275 -0
  377. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +642 -0
  378. package/packages/orq-rc/src/models/operations/listmodels.ts +169 -0
  379. package/packages/orq-rc/src/models/operations/listpromptversions.ts +3218 -0
  380. package/packages/orq-rc/src/models/operations/parse.ts +784 -0
  381. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +415 -0
  382. package/packages/orq-rc/src/models/operations/patchv2humanevalsid.ts +1362 -0
  383. package/packages/orq-rc/src/models/operations/postv2agentsa2a.ts +255 -0
  384. package/packages/orq-rc/src/models/operations/postv2agentskeycardrefresh.ts +100 -0
  385. package/packages/orq-rc/src/models/operations/postv2feedback.ts +207 -0
  386. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +321 -0
  387. package/packages/orq-rc/src/models/operations/postv2feedbackevaluationremove.ts +43 -0
  388. package/packages/orq-rc/src/models/operations/postv2feedbackremove.ts +138 -0
  389. package/packages/orq-rc/src/models/operations/postv2humanevals.ts +1193 -0
  390. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +365 -0
  391. package/packages/orq-rc/src/models/operations/postv2routerocr.ts +478 -0
  392. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +108 -0
  393. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +2843 -0
  394. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +1402 -0
  395. package/packages/orq-rc/src/models/operations/retrievedataset.ts +150 -0
  396. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +152 -0
  397. package/packages/orq-rc/src/models/operations/retrieveidentity.ts +174 -0
  398. package/packages/orq-rc/src/models/operations/retrievememory.ts +112 -0
  399. package/packages/orq-rc/src/models/operations/retrievememorydocument.ts +118 -0
  400. package/packages/orq-rc/src/models/operations/retrievememorystore.ts +144 -0
  401. package/packages/orq-rc/src/models/operations/retrievetool.ts +1385 -0
  402. package/packages/orq-rc/src/models/operations/runagent.ts +4963 -0
  403. package/packages/orq-rc/src/models/operations/searchknowledge.ts +1762 -0
  404. package/packages/orq-rc/src/models/operations/streamagent.ts +692 -0
  405. package/packages/orq-rc/src/models/operations/streamrunagent.ts +5125 -0
  406. package/packages/orq-rc/src/models/operations/updateagent.ts +6889 -0
  407. package/packages/orq-rc/src/models/operations/updatechunk.ts +236 -0
  408. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2555 -0
  409. package/packages/orq-rc/src/models/operations/updatedataset.ts +206 -0
  410. package/packages/orq-rc/src/models/operations/updatedatasource.ts +186 -0
  411. package/packages/orq-rc/src/models/operations/updateeval.ts +3160 -0
  412. package/packages/orq-rc/src/models/operations/updateidentity.ts +189 -0
  413. package/packages/orq-rc/src/models/operations/updateknowledge.ts +1231 -0
  414. package/packages/orq-rc/src/models/operations/updatememory.ts +142 -0
  415. package/packages/orq-rc/src/models/operations/updatememorydocument.ts +159 -0
  416. package/packages/orq-rc/src/models/operations/updatememorystore.ts +188 -0
  417. package/packages/orq-rc/src/models/operations/updateprompt.ts +5487 -0
  418. package/packages/orq-rc/src/models/operations/updatetool.ts +2816 -0
  419. package/packages/orq-rc/src/sdk/agents.ts +234 -0
  420. package/packages/orq-rc/src/sdk/annotations.ts +39 -0
  421. package/packages/orq-rc/src/sdk/audio.ts +25 -0
  422. package/packages/orq-rc/src/sdk/chat.ts +13 -0
  423. package/packages/orq-rc/src/sdk/chunking.ts +27 -0
  424. package/packages/orq-rc/src/sdk/completions.ts +32 -0
  425. package/packages/orq-rc/src/sdk/contacts.ts +27 -0
  426. package/packages/orq-rc/src/sdk/datasets.ts +204 -0
  427. package/packages/orq-rc/src/sdk/deployments.ts +89 -0
  428. package/packages/orq-rc/src/sdk/edits.ts +27 -0
  429. package/packages/orq-rc/src/sdk/embeddings.ts +27 -0
  430. package/packages/orq-rc/src/sdk/evals.ts +84 -0
  431. package/packages/orq-rc/src/sdk/evaluators.ts +27 -0
  432. package/packages/orq-rc/src/sdk/files.ts +114 -0
  433. package/packages/orq-rc/src/sdk/generations.ts +27 -0
  434. package/packages/orq-rc/src/sdk/humanreviewsets.ts +84 -0
  435. package/packages/orq-rc/src/sdk/identities.ts +99 -0
  436. package/packages/orq-rc/src/sdk/images.ts +25 -0
  437. package/packages/orq-rc/src/sdk/index.ts +5 -0
  438. package/packages/orq-rc/src/sdk/knowledge.ts +309 -0
  439. package/packages/orq-rc/src/sdk/memorystores.ts +286 -0
  440. package/packages/orq-rc/src/sdk/metrics.ts +29 -0
  441. package/packages/orq-rc/src/sdk/models.ts +27 -0
  442. package/packages/orq-rc/src/sdk/moderations.ts +24 -0
  443. package/packages/orq-rc/src/sdk/orqcompletions.ts +32 -0
  444. package/packages/orq-rc/src/sdk/orqresponses.ts +32 -0
  445. package/packages/orq-rc/src/sdk/prompts.ts +126 -0
  446. package/packages/orq-rc/src/sdk/remoteconfigs.ts +24 -0
  447. package/packages/orq-rc/src/sdk/rerank.ts +27 -0
  448. package/packages/orq-rc/src/sdk/responses.ts +53 -0
  449. package/packages/orq-rc/src/sdk/router.ts +72 -0
  450. package/packages/orq-rc/src/sdk/sdk.ts +225 -0
  451. package/packages/orq-rc/src/sdk/speech.ts +27 -0
  452. package/packages/orq-rc/src/sdk/tools.ts +135 -0
  453. package/packages/orq-rc/src/sdk/transcriptions.ts +24 -0
  454. package/packages/orq-rc/src/sdk/translations.ts +24 -0
  455. package/packages/orq-rc/src/sdk/variations.ts +27 -0
  456. package/packages/orq-rc/src/types/async.ts +68 -0
  457. package/packages/orq-rc/src/types/blobs.ts +32 -0
  458. package/packages/orq-rc/src/types/constdatetime.ts +15 -0
  459. package/packages/orq-rc/src/types/enums.ts +45 -0
  460. package/packages/orq-rc/src/types/fp.ts +50 -0
  461. package/packages/orq-rc/src/types/index.ts +11 -0
  462. package/packages/orq-rc/src/types/operations.ts +105 -0
  463. package/packages/orq-rc/src/types/rfcdate.ts +54 -0
  464. package/packages/orq-rc/src/types/streams.ts +21 -0
  465. package/packages/orq-rc/src/types/unrecognized.ts +35 -0
  466. package/src/lib/config.ts +2 -2
  467. package/src/models/components/reasoningpart.ts +1 -1
  468. package/src/models/operations/createcontact.ts +1 -1
  469. package/src/models/operations/createdataset.ts +1 -1
  470. package/src/models/operations/createdatasetitem.ts +4 -4
  471. package/src/models/operations/createdatasource.ts +1 -1
  472. package/src/models/operations/createeval.ts +16 -16
  473. package/src/models/operations/createidentity.ts +1 -1
  474. package/src/models/operations/createtool.ts +6 -6
  475. package/src/models/operations/getalltools.ts +6 -6
  476. package/src/models/operations/getevals.ts +16 -16
  477. package/src/models/operations/getv2humanevals.ts +6 -6
  478. package/src/models/operations/getv2humanevalsets.ts +2 -2
  479. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  480. package/src/models/operations/getv2humanevalsid.ts +6 -6
  481. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  482. package/src/models/operations/listdatasets.ts +1 -1
  483. package/src/models/operations/listdatasources.ts +1 -1
  484. package/src/models/operations/listidentities.ts +1 -1
  485. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  486. package/src/models/operations/patchv2humanevalsid.ts +12 -12
  487. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  488. package/src/models/operations/postv2humanevals.ts +12 -12
  489. package/src/models/operations/postv2humanevalsets.ts +2 -2
  490. package/src/models/operations/retrievedatapoint.ts +4 -4
  491. package/src/models/operations/retrievedataset.ts +1 -1
  492. package/src/models/operations/retrievedatasource.ts +1 -1
  493. package/src/models/operations/retrieveidentity.ts +1 -1
  494. package/src/models/operations/retrievetool.ts +6 -6
  495. package/src/models/operations/runagent.ts +1 -1
  496. package/src/models/operations/streamrunagent.ts +1 -1
  497. package/src/models/operations/updatedatapoint.ts +4 -4
  498. package/src/models/operations/updatedataset.ts +1 -1
  499. package/src/models/operations/updatedatasource.ts +1 -1
  500. package/src/models/operations/updateeval.ts +16 -16
  501. package/src/models/operations/updateidentity.ts +1 -1
  502. package/src/models/operations/updatetool.ts +7 -7
@@ -0,0 +1,4659 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import * as components from "../components/index.js";
11
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
+
13
+ export type DeploymentStreamGlobals = {
14
+ environment?: string | undefined;
15
+ contactId?: string | undefined;
16
+ };
17
+
18
+ export type DeploymentStreamContentDeploymentsRequest2 =
19
+ components.TextContentPartSchema;
20
+
21
+ /**
22
+ * The contents of the tool message.
23
+ */
24
+ export type DeploymentStreamPrefixMessagesDeploymentsRequestRequestBody5Content =
25
+ | string
26
+ | Array<components.TextContentPartSchema>;
27
+
28
+ /**
29
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
30
+ */
31
+ export const DeploymentStreamPrefixMessagesDeploymentsType = {
32
+ Ephemeral: "ephemeral",
33
+ } as const;
34
+ /**
35
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
36
+ */
37
+ export type DeploymentStreamPrefixMessagesDeploymentsType = ClosedEnum<
38
+ typeof DeploymentStreamPrefixMessagesDeploymentsType
39
+ >;
40
+
41
+ /**
42
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
43
+ *
44
+ * @remarks
45
+ *
46
+ * - `5m`: 5 minutes
47
+ * - `1h`: 1 hour
48
+ *
49
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
50
+ */
51
+ export const DeploymentStreamPrefixMessagesTtl = {
52
+ Fivem: "5m",
53
+ Oneh: "1h",
54
+ } as const;
55
+ /**
56
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
57
+ *
58
+ * @remarks
59
+ *
60
+ * - `5m`: 5 minutes
61
+ * - `1h`: 1 hour
62
+ *
63
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
64
+ */
65
+ export type DeploymentStreamPrefixMessagesTtl = ClosedEnum<
66
+ typeof DeploymentStreamPrefixMessagesTtl
67
+ >;
68
+
69
+ export type DeploymentStreamPrefixMessagesCacheControl = {
70
+ /**
71
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
72
+ */
73
+ type: DeploymentStreamPrefixMessagesDeploymentsType;
74
+ /**
75
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
76
+ *
77
+ * @remarks
78
+ *
79
+ * - `5m`: 5 minutes
80
+ * - `1h`: 1 hour
81
+ *
82
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
83
+ */
84
+ ttl?: DeploymentStreamPrefixMessagesTtl | undefined;
85
+ };
86
+
87
+ export type PrefixMessagesToolMessage = {
88
+ /**
89
+ * The role of the messages author, in this case tool.
90
+ */
91
+ role: "tool";
92
+ /**
93
+ * The contents of the tool message.
94
+ */
95
+ content: string | Array<components.TextContentPartSchema>;
96
+ /**
97
+ * Tool call that this message is responding to.
98
+ */
99
+ toolCallId: string | null;
100
+ cacheControl?: DeploymentStreamPrefixMessagesCacheControl | undefined;
101
+ };
102
+
103
+ export type DeploymentStreamContentDeployments2 =
104
+ | (components.TextContentPartSchema & { type: "text" })
105
+ | components.RefusalPartSchema
106
+ | components.ReasoningPartSchema
107
+ | components.RedactedReasoningPartSchema;
108
+
109
+ /**
110
+ * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
111
+ */
112
+ export type DeploymentStreamPrefixMessagesDeploymentsRequestRequestBodyContent =
113
+ | string
114
+ | Array<
115
+ | (components.TextContentPartSchema & { type: "text" })
116
+ | components.RefusalPartSchema
117
+ | components.ReasoningPartSchema
118
+ | components.RedactedReasoningPartSchema
119
+ >;
120
+
121
+ /**
122
+ * Data about a previous audio response from the model.
123
+ */
124
+ export type PrefixMessagesAudio = {
125
+ /**
126
+ * Unique identifier for a previous audio response from the model.
127
+ */
128
+ id: string;
129
+ };
130
+
131
+ /**
132
+ * The type of the tool. Currently, only `function` is supported.
133
+ */
134
+ export const DeploymentStreamPrefixMessagesType = {
135
+ Function: "function",
136
+ } as const;
137
+ /**
138
+ * The type of the tool. Currently, only `function` is supported.
139
+ */
140
+ export type DeploymentStreamPrefixMessagesType = ClosedEnum<
141
+ typeof DeploymentStreamPrefixMessagesType
142
+ >;
143
+
144
+ export type DeploymentStreamPrefixMessagesFunction = {
145
+ /**
146
+ * The name of the function to call.
147
+ */
148
+ name?: string | undefined;
149
+ /**
150
+ * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
151
+ */
152
+ arguments?: string | undefined;
153
+ };
154
+
155
+ export type DeploymentStreamPrefixMessagesToolCalls = {
156
+ /**
157
+ * The ID of the tool call.
158
+ */
159
+ id: string;
160
+ /**
161
+ * The type of the tool. Currently, only `function` is supported.
162
+ */
163
+ type: DeploymentStreamPrefixMessagesType;
164
+ function: DeploymentStreamPrefixMessagesFunction;
165
+ /**
166
+ * Encrypted representation of the model internal reasoning state during function calling. Required by Gemini 3 models when continuing a conversation after a tool call.
167
+ */
168
+ thoughtSignature?: string | undefined;
169
+ };
170
+
171
+ export type PrefixMessagesAssistantMessage = {
172
+ /**
173
+ * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
174
+ */
175
+ content?:
176
+ | string
177
+ | Array<
178
+ | (components.TextContentPartSchema & { type: "text" })
179
+ | components.RefusalPartSchema
180
+ | components.ReasoningPartSchema
181
+ | components.RedactedReasoningPartSchema
182
+ >
183
+ | null
184
+ | undefined;
185
+ /**
186
+ * The refusal message by the assistant.
187
+ */
188
+ refusal?: string | null | undefined;
189
+ /**
190
+ * The role of the messages author, in this case `assistant`.
191
+ */
192
+ role: "assistant";
193
+ /**
194
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
195
+ */
196
+ name?: string | undefined;
197
+ /**
198
+ * Data about a previous audio response from the model.
199
+ */
200
+ audio?: PrefixMessagesAudio | null | undefined;
201
+ /**
202
+ * The tool calls generated by the model, such as function calls.
203
+ */
204
+ toolCalls?: Array<DeploymentStreamPrefixMessagesToolCalls> | undefined;
205
+ };
206
+
207
+ /**
208
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
209
+ */
210
+ export const DeploymentStream2DeploymentsType = {
211
+ Ephemeral: "ephemeral",
212
+ } as const;
213
+ /**
214
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
215
+ */
216
+ export type DeploymentStream2DeploymentsType = ClosedEnum<
217
+ typeof DeploymentStream2DeploymentsType
218
+ >;
219
+
220
+ /**
221
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
222
+ *
223
+ * @remarks
224
+ *
225
+ * - `5m`: 5 minutes
226
+ * - `1h`: 1 hour
227
+ *
228
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
229
+ */
230
+ export const DeploymentStream2Ttl = {
231
+ Fivem: "5m",
232
+ Oneh: "1h",
233
+ } as const;
234
+ /**
235
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
236
+ *
237
+ * @remarks
238
+ *
239
+ * - `5m`: 5 minutes
240
+ * - `1h`: 1 hour
241
+ *
242
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
243
+ */
244
+ export type DeploymentStream2Ttl = ClosedEnum<typeof DeploymentStream2Ttl>;
245
+
246
+ export type DeploymentStream2CacheControl = {
247
+ /**
248
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
249
+ */
250
+ type: DeploymentStream2DeploymentsType;
251
+ /**
252
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
253
+ *
254
+ * @remarks
255
+ *
256
+ * - `5m`: 5 minutes
257
+ * - `1h`: 1 hour
258
+ *
259
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
260
+ */
261
+ ttl?: DeploymentStream2Ttl | undefined;
262
+ };
263
+
264
+ export type DeploymentStream24 = {
265
+ /**
266
+ * The type of the content part. Always `file`.
267
+ */
268
+ type: "file";
269
+ cacheControl?: DeploymentStream2CacheControl | undefined;
270
+ /**
271
+ * File data for the content part. Must contain either file_data or uri, but not both.
272
+ */
273
+ file: components.FileContentPartSchema;
274
+ };
275
+
276
+ export type DeploymentStreamContent2 =
277
+ | (components.TextContentPartSchema & { type: "text" })
278
+ | components.ImageContentPartSchema
279
+ | components.AudioContentPartSchema
280
+ | DeploymentStream24;
281
+
282
+ /**
283
+ * The contents of the user message.
284
+ */
285
+ export type DeploymentStreamPrefixMessagesDeploymentsRequestContent =
286
+ | string
287
+ | Array<
288
+ | (components.TextContentPartSchema & { type: "text" })
289
+ | components.ImageContentPartSchema
290
+ | components.AudioContentPartSchema
291
+ | DeploymentStream24
292
+ >;
293
+
294
+ export type PrefixMessagesUserMessage = {
295
+ /**
296
+ * The role of the messages author, in this case `user`.
297
+ */
298
+ role: "user";
299
+ /**
300
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
301
+ */
302
+ name?: string | undefined;
303
+ /**
304
+ * The contents of the user message.
305
+ */
306
+ content:
307
+ | string
308
+ | Array<
309
+ | (components.TextContentPartSchema & { type: "text" })
310
+ | components.ImageContentPartSchema
311
+ | components.AudioContentPartSchema
312
+ | DeploymentStream24
313
+ >;
314
+ };
315
+
316
+ /**
317
+ * The contents of the developer message.
318
+ */
319
+ export type DeploymentStreamPrefixMessagesDeploymentsContent =
320
+ | string
321
+ | Array<components.TextContentPartSchema>;
322
+
323
+ export type PrefixMessagesDeveloperMessage = {
324
+ /**
325
+ * The role of the messages author, in this case `developer`.
326
+ */
327
+ role: "developer";
328
+ /**
329
+ * The contents of the developer message.
330
+ */
331
+ content: string | Array<components.TextContentPartSchema>;
332
+ /**
333
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
334
+ */
335
+ name?: string | undefined;
336
+ };
337
+
338
+ /**
339
+ * The contents of the system message.
340
+ */
341
+ export type DeploymentStreamPrefixMessagesContent =
342
+ | string
343
+ | Array<components.TextContentPartSchema>;
344
+
345
+ /**
346
+ * Developer-provided instructions that the model should follow, regardless of messages sent by the user.
347
+ */
348
+ export type PrefixMessagesSystemMessage = {
349
+ /**
350
+ * The role of the messages author, in this case `system`.
351
+ */
352
+ role: "system";
353
+ /**
354
+ * The contents of the system message.
355
+ */
356
+ content: string | Array<components.TextContentPartSchema>;
357
+ /**
358
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
359
+ */
360
+ name?: string | undefined;
361
+ };
362
+
363
+ export type DeploymentStreamPrefixMessages =
364
+ | PrefixMessagesSystemMessage
365
+ | PrefixMessagesDeveloperMessage
366
+ | PrefixMessagesUserMessage
367
+ | PrefixMessagesAssistantMessage
368
+ | PrefixMessagesToolMessage;
369
+
370
+ export type DeploymentStreamContentDeploymentsRequestRequestBodyMessages52 =
371
+ components.TextContentPartSchema;
372
+
373
+ /**
374
+ * The contents of the tool message.
375
+ */
376
+ export type DeploymentStreamMessagesDeploymentsRequestRequestBody5Content =
377
+ | string
378
+ | Array<components.TextContentPartSchema>;
379
+
380
+ /**
381
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
382
+ */
383
+ export const DeploymentStreamMessagesDeploymentsType = {
384
+ Ephemeral: "ephemeral",
385
+ } as const;
386
+ /**
387
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
388
+ */
389
+ export type DeploymentStreamMessagesDeploymentsType = ClosedEnum<
390
+ typeof DeploymentStreamMessagesDeploymentsType
391
+ >;
392
+
393
+ /**
394
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
395
+ *
396
+ * @remarks
397
+ *
398
+ * - `5m`: 5 minutes
399
+ * - `1h`: 1 hour
400
+ *
401
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
402
+ */
403
+ export const DeploymentStreamMessagesTtl = {
404
+ Fivem: "5m",
405
+ Oneh: "1h",
406
+ } as const;
407
+ /**
408
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
409
+ *
410
+ * @remarks
411
+ *
412
+ * - `5m`: 5 minutes
413
+ * - `1h`: 1 hour
414
+ *
415
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
416
+ */
417
+ export type DeploymentStreamMessagesTtl = ClosedEnum<
418
+ typeof DeploymentStreamMessagesTtl
419
+ >;
420
+
421
+ export type DeploymentStreamMessagesCacheControl = {
422
+ /**
423
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
424
+ */
425
+ type: DeploymentStreamMessagesDeploymentsType;
426
+ /**
427
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
428
+ *
429
+ * @remarks
430
+ *
431
+ * - `5m`: 5 minutes
432
+ * - `1h`: 1 hour
433
+ *
434
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
435
+ */
436
+ ttl?: DeploymentStreamMessagesTtl | undefined;
437
+ };
438
+
439
+ export type DeploymentStreamMessagesToolMessage = {
440
+ /**
441
+ * The role of the messages author, in this case tool.
442
+ */
443
+ role: "tool";
444
+ /**
445
+ * The contents of the tool message.
446
+ */
447
+ content: string | Array<components.TextContentPartSchema>;
448
+ /**
449
+ * Tool call that this message is responding to.
450
+ */
451
+ toolCallId: string | null;
452
+ cacheControl?: DeploymentStreamMessagesCacheControl | undefined;
453
+ };
454
+
455
+ export type DeploymentStreamContentDeploymentsRequestRequestBodyMessages2 =
456
+ | (components.TextContentPartSchema & { type: "text" })
457
+ | components.RefusalPartSchema
458
+ | components.ReasoningPartSchema
459
+ | components.RedactedReasoningPartSchema;
460
+
461
+ /**
462
+ * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
463
+ */
464
+ export type DeploymentStreamMessagesDeploymentsRequestRequestBodyContent =
465
+ | string
466
+ | Array<
467
+ | (components.TextContentPartSchema & { type: "text" })
468
+ | components.RefusalPartSchema
469
+ | components.ReasoningPartSchema
470
+ | components.RedactedReasoningPartSchema
471
+ >;
472
+
473
+ /**
474
+ * Data about a previous audio response from the model.
475
+ */
476
+ export type DeploymentStreamMessagesAudio = {
477
+ /**
478
+ * Unique identifier for a previous audio response from the model.
479
+ */
480
+ id: string;
481
+ };
482
+
483
+ /**
484
+ * The type of the tool. Currently, only `function` is supported.
485
+ */
486
+ export const DeploymentStreamMessagesType = {
487
+ Function: "function",
488
+ } as const;
489
+ /**
490
+ * The type of the tool. Currently, only `function` is supported.
491
+ */
492
+ export type DeploymentStreamMessagesType = ClosedEnum<
493
+ typeof DeploymentStreamMessagesType
494
+ >;
495
+
496
+ export type DeploymentStreamMessagesFunction = {
497
+ /**
498
+ * The name of the function to call.
499
+ */
500
+ name?: string | undefined;
501
+ /**
502
+ * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
503
+ */
504
+ arguments?: string | undefined;
505
+ };
506
+
507
+ export type DeploymentStreamMessagesToolCalls = {
508
+ /**
509
+ * The ID of the tool call.
510
+ */
511
+ id: string;
512
+ /**
513
+ * The type of the tool. Currently, only `function` is supported.
514
+ */
515
+ type: DeploymentStreamMessagesType;
516
+ function: DeploymentStreamMessagesFunction;
517
+ /**
518
+ * Encrypted representation of the model internal reasoning state during function calling. Required by Gemini 3 models when continuing a conversation after a tool call.
519
+ */
520
+ thoughtSignature?: string | undefined;
521
+ };
522
+
523
+ export type DeploymentStreamMessagesAssistantMessage = {
524
+ /**
525
+ * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
526
+ */
527
+ content?:
528
+ | string
529
+ | Array<
530
+ | (components.TextContentPartSchema & { type: "text" })
531
+ | components.RefusalPartSchema
532
+ | components.ReasoningPartSchema
533
+ | components.RedactedReasoningPartSchema
534
+ >
535
+ | null
536
+ | undefined;
537
+ /**
538
+ * The refusal message by the assistant.
539
+ */
540
+ refusal?: string | null | undefined;
541
+ /**
542
+ * The role of the messages author, in this case `assistant`.
543
+ */
544
+ role: "assistant";
545
+ /**
546
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
547
+ */
548
+ name?: string | undefined;
549
+ /**
550
+ * Data about a previous audio response from the model.
551
+ */
552
+ audio?: DeploymentStreamMessagesAudio | null | undefined;
553
+ /**
554
+ * The tool calls generated by the model, such as function calls.
555
+ */
556
+ toolCalls?: Array<DeploymentStreamMessagesToolCalls> | undefined;
557
+ };
558
+
559
+ /**
560
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
561
+ */
562
+ export const DeploymentStream2DeploymentsRequestRequestBodyType = {
563
+ Ephemeral: "ephemeral",
564
+ } as const;
565
+ /**
566
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
567
+ */
568
+ export type DeploymentStream2DeploymentsRequestRequestBodyType = ClosedEnum<
569
+ typeof DeploymentStream2DeploymentsRequestRequestBodyType
570
+ >;
571
+
572
+ /**
573
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
574
+ *
575
+ * @remarks
576
+ *
577
+ * - `5m`: 5 minutes
578
+ * - `1h`: 1 hour
579
+ *
580
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
581
+ */
582
+ export const DeploymentStream2DeploymentsTtl = {
583
+ Fivem: "5m",
584
+ Oneh: "1h",
585
+ } as const;
586
+ /**
587
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
588
+ *
589
+ * @remarks
590
+ *
591
+ * - `5m`: 5 minutes
592
+ * - `1h`: 1 hour
593
+ *
594
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
595
+ */
596
+ export type DeploymentStream2DeploymentsTtl = ClosedEnum<
597
+ typeof DeploymentStream2DeploymentsTtl
598
+ >;
599
+
600
+ export type DeploymentStream2DeploymentsCacheControl = {
601
+ /**
602
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
603
+ */
604
+ type: DeploymentStream2DeploymentsRequestRequestBodyType;
605
+ /**
606
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
607
+ *
608
+ * @remarks
609
+ *
610
+ * - `5m`: 5 minutes
611
+ * - `1h`: 1 hour
612
+ *
613
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
614
+ */
615
+ ttl?: DeploymentStream2DeploymentsTtl | undefined;
616
+ };
617
+
618
+ export type DeploymentStream2Deployments4 = {
619
+ /**
620
+ * The type of the content part. Always `file`.
621
+ */
622
+ type: "file";
623
+ cacheControl?: DeploymentStream2DeploymentsCacheControl | undefined;
624
+ /**
625
+ * File data for the content part. Must contain either file_data or uri, but not both.
626
+ */
627
+ file: components.FileContentPartSchema;
628
+ };
629
+
630
+ export type DeploymentStreamContentDeploymentsRequestRequestBody2 =
631
+ | (components.TextContentPartSchema & { type: "text" })
632
+ | components.ImageContentPartSchema
633
+ | components.AudioContentPartSchema
634
+ | DeploymentStream2Deployments4;
635
+
636
+ /**
637
+ * The contents of the user message.
638
+ */
639
+ export type DeploymentStreamMessagesDeploymentsRequestContent =
640
+ | string
641
+ | Array<
642
+ | (components.TextContentPartSchema & { type: "text" })
643
+ | components.ImageContentPartSchema
644
+ | components.AudioContentPartSchema
645
+ | DeploymentStream2Deployments4
646
+ >;
647
+
648
+ export type DeploymentStreamMessagesUserMessage = {
649
+ /**
650
+ * The role of the messages author, in this case `user`.
651
+ */
652
+ role: "user";
653
+ /**
654
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
655
+ */
656
+ name?: string | undefined;
657
+ /**
658
+ * The contents of the user message.
659
+ */
660
+ content:
661
+ | string
662
+ | Array<
663
+ | (components.TextContentPartSchema & { type: "text" })
664
+ | components.ImageContentPartSchema
665
+ | components.AudioContentPartSchema
666
+ | DeploymentStream2Deployments4
667
+ >;
668
+ };
669
+
670
+ /**
671
+ * The contents of the developer message.
672
+ */
673
+ export type DeploymentStreamMessagesDeploymentsContent =
674
+ | string
675
+ | Array<components.TextContentPartSchema>;
676
+
677
+ export type DeploymentStreamMessagesDeveloperMessage = {
678
+ /**
679
+ * The role of the messages author, in this case `developer`.
680
+ */
681
+ role: "developer";
682
+ /**
683
+ * The contents of the developer message.
684
+ */
685
+ content: string | Array<components.TextContentPartSchema>;
686
+ /**
687
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
688
+ */
689
+ name?: string | undefined;
690
+ };
691
+
692
+ /**
693
+ * The contents of the system message.
694
+ */
695
+ export type DeploymentStreamMessagesContent =
696
+ | string
697
+ | Array<components.TextContentPartSchema>;
698
+
699
+ /**
700
+ * Developer-provided instructions that the model should follow, regardless of messages sent by the user.
701
+ */
702
+ export type DeploymentStreamMessagesSystemMessage = {
703
+ /**
704
+ * The role of the messages author, in this case `system`.
705
+ */
706
+ role: "system";
707
+ /**
708
+ * The contents of the system message.
709
+ */
710
+ content: string | Array<components.TextContentPartSchema>;
711
+ /**
712
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
713
+ */
714
+ name?: string | undefined;
715
+ };
716
+
717
+ export type DeploymentStreamMessages =
718
+ | DeploymentStreamMessagesSystemMessage
719
+ | DeploymentStreamMessagesDeveloperMessage
720
+ | DeploymentStreamMessagesUserMessage
721
+ | DeploymentStreamMessagesAssistantMessage
722
+ | DeploymentStreamMessagesToolMessage;
723
+
724
+ /**
725
+ * Metadata about the document
726
+ */
727
+ export type DeploymentStreamMetadata = {
728
+ /**
729
+ * Name of the file the text is from.
730
+ */
731
+ fileName?: string | undefined;
732
+ /**
733
+ * Content type of the file the text is from.
734
+ */
735
+ fileType?: string | undefined;
736
+ /**
737
+ * The page number the text is from.
738
+ */
739
+ pageNumber?: number | undefined;
740
+ };
741
+
742
+ export type DeploymentStreamDocuments = {
743
+ /**
744
+ * The text content of the document
745
+ */
746
+ text: string;
747
+ /**
748
+ * Metadata about the document
749
+ */
750
+ metadata?: DeploymentStreamMetadata | undefined;
751
+ };
752
+
753
+ export type DeploymentStreamInvokeOptions = {
754
+ /**
755
+ * Whether to include the retrieved knowledge chunks in the response.
756
+ */
757
+ includeRetrievals?: boolean | undefined;
758
+ /**
759
+ * Whether to include the usage metrics in the response.
760
+ */
761
+ includeUsage?: boolean | undefined;
762
+ /**
763
+ * A mock response to use instead of calling the LLM API. This is useful for testing purposes. When provided, the system will return a response object with this content as the completion, without making an actual API call to the LLM provider. This works for both streaming and non-streaming requests. Mock responses will not generate logs, traces or be counted for your plan usage.
764
+ */
765
+ mockResponse?: string | undefined;
766
+ };
767
+
768
+ export type DeploymentStreamThread = {
769
+ /**
770
+ * Unique thread identifier to group related invocations.
771
+ */
772
+ id: string;
773
+ /**
774
+ * Optional tags to differentiate or categorize threads
775
+ */
776
+ tags?: Array<string> | undefined;
777
+ };
778
+
779
+ /**
780
+ * Exists
781
+ */
782
+ export type DeploymentStreamOrExists = {
783
+ exists: boolean;
784
+ };
785
+
786
+ export type DeploymentStreamOrDeploymentsNin = string | number | boolean;
787
+
788
+ /**
789
+ * Not in
790
+ */
791
+ export type DeploymentStreamOrNin = {
792
+ nin: Array<string | number | boolean>;
793
+ };
794
+
795
+ export type DeploymentStreamOrDeploymentsIn = string | number | boolean;
796
+
797
+ /**
798
+ * In
799
+ */
800
+ export type DeploymentStreamOrIn = {
801
+ in: Array<string | number | boolean>;
802
+ };
803
+
804
+ /**
805
+ * Less than or equal to
806
+ */
807
+ export type DeploymentStreamOrLte = {
808
+ lte: number;
809
+ };
810
+
811
+ /**
812
+ * Less than
813
+ */
814
+ export type DeploymentStreamOrLt = {
815
+ lt: number;
816
+ };
817
+
818
+ /**
819
+ * Greater than or equal to
820
+ */
821
+ export type DeploymentStreamOrGte = {
822
+ gte: number;
823
+ };
824
+
825
+ /**
826
+ * Greater than
827
+ */
828
+ export type DeploymentStreamOrGt = {
829
+ gt: number;
830
+ };
831
+
832
+ export type DeploymentStreamOrDeploymentsNe = string | number | boolean;
833
+
834
+ /**
835
+ * Not equal to
836
+ */
837
+ export type DeploymentStreamOrNe = {
838
+ ne: string | number | boolean;
839
+ };
840
+
841
+ export type DeploymentStreamOrDeploymentsEq = string | number | boolean;
842
+
843
+ /**
844
+ * Equal to
845
+ */
846
+ export type DeploymentStreamOrEq = {
847
+ eq: string | number | boolean;
848
+ };
849
+
850
+ export type DeploymentStreamKnowledgeFilterDeploymentsOr =
851
+ | DeploymentStreamOrEq
852
+ | DeploymentStreamOrNe
853
+ | DeploymentStreamOrGt
854
+ | DeploymentStreamOrGte
855
+ | DeploymentStreamOrLt
856
+ | DeploymentStreamOrLte
857
+ | DeploymentStreamOrIn
858
+ | DeploymentStreamOrNin
859
+ | DeploymentStreamOrExists;
860
+
861
+ /**
862
+ * Or
863
+ */
864
+ export type DeploymentStreamKnowledgeFilterOr = {
865
+ or: Array<
866
+ {
867
+ [k: string]:
868
+ | DeploymentStreamOrEq
869
+ | DeploymentStreamOrNe
870
+ | DeploymentStreamOrGt
871
+ | DeploymentStreamOrGte
872
+ | DeploymentStreamOrLt
873
+ | DeploymentStreamOrLte
874
+ | DeploymentStreamOrIn
875
+ | DeploymentStreamOrNin
876
+ | DeploymentStreamOrExists;
877
+ }
878
+ >;
879
+ };
880
+
881
+ /**
882
+ * Exists
883
+ */
884
+ export type DeploymentStreamAndExists = {
885
+ exists: boolean;
886
+ };
887
+
888
+ export type DeploymentStreamAndDeploymentsNin = string | number | boolean;
889
+
890
+ /**
891
+ * Not in
892
+ */
893
+ export type DeploymentStreamAndNin = {
894
+ nin: Array<string | number | boolean>;
895
+ };
896
+
897
+ export type DeploymentStreamAndDeploymentsIn = string | number | boolean;
898
+
899
+ /**
900
+ * In
901
+ */
902
+ export type DeploymentStreamAndIn = {
903
+ in: Array<string | number | boolean>;
904
+ };
905
+
906
+ /**
907
+ * Less than or equal to
908
+ */
909
+ export type DeploymentStreamAndLte = {
910
+ lte: number;
911
+ };
912
+
913
+ /**
914
+ * Less than
915
+ */
916
+ export type DeploymentStreamAndLt = {
917
+ lt: number;
918
+ };
919
+
920
+ /**
921
+ * Greater than or equal to
922
+ */
923
+ export type DeploymentStreamAndGte = {
924
+ gte: number;
925
+ };
926
+
927
+ /**
928
+ * Greater than
929
+ */
930
+ export type DeploymentStreamAndGt = {
931
+ gt: number;
932
+ };
933
+
934
+ export type DeploymentStreamAndDeploymentsNe = string | number | boolean;
935
+
936
+ /**
937
+ * Not equal to
938
+ */
939
+ export type DeploymentStreamAndNe = {
940
+ ne: string | number | boolean;
941
+ };
942
+
943
+ export type DeploymentStreamAndDeploymentsEq = string | number | boolean;
944
+
945
+ /**
946
+ * Equal to
947
+ */
948
+ export type DeploymentStreamAndEq = {
949
+ eq: string | number | boolean;
950
+ };
951
+
952
+ export type DeploymentStreamKnowledgeFilterDeploymentsAnd =
953
+ | DeploymentStreamAndEq
954
+ | DeploymentStreamAndNe
955
+ | DeploymentStreamAndGt
956
+ | DeploymentStreamAndGte
957
+ | DeploymentStreamAndLt
958
+ | DeploymentStreamAndLte
959
+ | DeploymentStreamAndIn
960
+ | DeploymentStreamAndNin
961
+ | DeploymentStreamAndExists;
962
+
963
+ /**
964
+ * And
965
+ */
966
+ export type DeploymentStreamKnowledgeFilterAnd = {
967
+ and: Array<
968
+ {
969
+ [k: string]:
970
+ | DeploymentStreamAndEq
971
+ | DeploymentStreamAndNe
972
+ | DeploymentStreamAndGt
973
+ | DeploymentStreamAndGte
974
+ | DeploymentStreamAndLt
975
+ | DeploymentStreamAndLte
976
+ | DeploymentStreamAndIn
977
+ | DeploymentStreamAndNin
978
+ | DeploymentStreamAndExists;
979
+ }
980
+ >;
981
+ };
982
+
983
+ /**
984
+ * Exists
985
+ */
986
+ export type OneExists = {
987
+ exists: boolean;
988
+ };
989
+
990
+ export type DeploymentStream1DeploymentsNin = string | number | boolean;
991
+
992
+ /**
993
+ * Not in
994
+ */
995
+ export type DeploymentStream1Nin = {
996
+ nin: Array<string | number | boolean>;
997
+ };
998
+
999
+ export type DeploymentStream1DeploymentsIn = string | number | boolean;
1000
+
1001
+ /**
1002
+ * In
1003
+ */
1004
+ export type DeploymentStream1In = {
1005
+ in: Array<string | number | boolean>;
1006
+ };
1007
+
1008
+ /**
1009
+ * Less than or equal to
1010
+ */
1011
+ export type OneLte = {
1012
+ lte: number;
1013
+ };
1014
+
1015
+ /**
1016
+ * Less than
1017
+ */
1018
+ export type OneLt = {
1019
+ lt: number;
1020
+ };
1021
+
1022
+ /**
1023
+ * Greater than or equal to
1024
+ */
1025
+ export type OneGte = {
1026
+ gte: number;
1027
+ };
1028
+
1029
+ /**
1030
+ * Greater than
1031
+ */
1032
+ export type OneGt = {
1033
+ gt: number;
1034
+ };
1035
+
1036
+ export type DeploymentStream1DeploymentsNe = string | number | boolean;
1037
+
1038
+ /**
1039
+ * Not equal to
1040
+ */
1041
+ export type DeploymentStream1Ne = {
1042
+ ne: string | number | boolean;
1043
+ };
1044
+
1045
+ export type DeploymentStream1DeploymentsEq = string | number | boolean;
1046
+
1047
+ /**
1048
+ * Equal to
1049
+ */
1050
+ export type DeploymentStream1Eq = {
1051
+ eq: string | number | boolean;
1052
+ };
1053
+
1054
+ export type DeploymentStreamKnowledgeFilter1 =
1055
+ | DeploymentStream1Eq
1056
+ | DeploymentStream1Ne
1057
+ | OneGt
1058
+ | OneGte
1059
+ | OneLt
1060
+ | OneLte
1061
+ | DeploymentStream1In
1062
+ | DeploymentStream1Nin
1063
+ | OneExists;
1064
+
1065
+ /**
1066
+ * A filter to apply to the knowledge base chunk metadata when using knowledge bases in the deployment.
1067
+ */
1068
+ export type DeploymentStreamKnowledgeFilter =
1069
+ | DeploymentStreamKnowledgeFilterAnd
1070
+ | DeploymentStreamKnowledgeFilterOr
1071
+ | {
1072
+ [k: string]:
1073
+ | DeploymentStream1Eq
1074
+ | DeploymentStream1Ne
1075
+ | OneGt
1076
+ | OneGte
1077
+ | OneLt
1078
+ | OneLte
1079
+ | DeploymentStream1In
1080
+ | DeploymentStream1Nin
1081
+ | OneExists;
1082
+ };
1083
+
1084
+ export type DeploymentStreamRequestBody = {
1085
+ /**
1086
+ * The deployment key to invoke
1087
+ */
1088
+ key: string;
1089
+ /**
1090
+ * 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.
1091
+ */
1092
+ inputs?: { [k: string]: any } | undefined;
1093
+ /**
1094
+ * Key-value pairs that match your data model and fields declared in your deployment routing configuration
1095
+ */
1096
+ context?: { [k: string]: any } | undefined;
1097
+ /**
1098
+ * A list of messages to include after the `System` message, but before the `User` and `Assistant` pairs configured in your deployment.
1099
+ */
1100
+ prefixMessages?:
1101
+ | Array<
1102
+ | PrefixMessagesSystemMessage
1103
+ | PrefixMessagesDeveloperMessage
1104
+ | PrefixMessagesUserMessage
1105
+ | PrefixMessagesAssistantMessage
1106
+ | PrefixMessagesToolMessage
1107
+ >
1108
+ | undefined;
1109
+ /**
1110
+ * A list of messages to send to the deployment.
1111
+ */
1112
+ messages?:
1113
+ | Array<
1114
+ | DeploymentStreamMessagesSystemMessage
1115
+ | DeploymentStreamMessagesDeveloperMessage
1116
+ | DeploymentStreamMessagesUserMessage
1117
+ | DeploymentStreamMessagesAssistantMessage
1118
+ | DeploymentStreamMessagesToolMessage
1119
+ >
1120
+ | undefined;
1121
+ /**
1122
+ * Information about the identity making the request. If the identity does not exist, it will be created automatically.
1123
+ */
1124
+ identity?: components.PublicIdentity | undefined;
1125
+ /**
1126
+ * A list of file IDs that are associated with the deployment request.
1127
+ */
1128
+ fileIds?: Array<string> | undefined;
1129
+ /**
1130
+ * Key-value pairs that you want to attach to the log generated by this request.
1131
+ */
1132
+ metadata?: { [k: string]: any } | undefined;
1133
+ /**
1134
+ * 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.
1135
+ */
1136
+ extraParams?: { [k: string]: any } | undefined;
1137
+ /**
1138
+ * A list of documents from your external knowledge base (e.g., chunks retrieved from your own vector database or RAG pipeline) that provide context for the model response. These documents can be used by evaluators and guardrails to assess the relevance and accuracy of the model output against the provided context.
1139
+ */
1140
+ documents?: Array<DeploymentStreamDocuments> | undefined;
1141
+ invokeOptions?: DeploymentStreamInvokeOptions | undefined;
1142
+ thread?: DeploymentStreamThread | undefined;
1143
+ /**
1144
+ * A filter to apply to the knowledge base chunk metadata when using knowledge bases in the deployment.
1145
+ */
1146
+ knowledgeFilter?:
1147
+ | DeploymentStreamKnowledgeFilterAnd
1148
+ | DeploymentStreamKnowledgeFilterOr
1149
+ | {
1150
+ [k: string]:
1151
+ | DeploymentStream1Eq
1152
+ | DeploymentStream1Ne
1153
+ | OneGt
1154
+ | OneGte
1155
+ | OneLt
1156
+ | OneLte
1157
+ | DeploymentStream1In
1158
+ | DeploymentStream1Nin
1159
+ | OneExists;
1160
+ }
1161
+ | undefined;
1162
+ };
1163
+
1164
+ /**
1165
+ * Indicates the type of model used to generate the response
1166
+ */
1167
+ export const DeploymentStreamObject = {
1168
+ Chat: "chat",
1169
+ Completion: "completion",
1170
+ Image: "image",
1171
+ } as const;
1172
+ /**
1173
+ * Indicates the type of model used to generate the response
1174
+ */
1175
+ export type DeploymentStreamObject = ClosedEnum<typeof DeploymentStreamObject>;
1176
+
1177
+ /**
1178
+ * The provider used to generate the response
1179
+ */
1180
+ export const DeploymentStreamProvider = {
1181
+ Openai: "openai",
1182
+ Groq: "groq",
1183
+ Cohere: "cohere",
1184
+ Azure: "azure",
1185
+ Aws: "aws",
1186
+ Google: "google",
1187
+ GoogleAi: "google-ai",
1188
+ Huggingface: "huggingface",
1189
+ Togetherai: "togetherai",
1190
+ Perplexity: "perplexity",
1191
+ Anthropic: "anthropic",
1192
+ Leonardoai: "leonardoai",
1193
+ Fal: "fal",
1194
+ Nvidia: "nvidia",
1195
+ Jina: "jina",
1196
+ Elevenlabs: "elevenlabs",
1197
+ Litellm: "litellm",
1198
+ Cerebras: "cerebras",
1199
+ Openailike: "openailike",
1200
+ Bytedance: "bytedance",
1201
+ Mistral: "mistral",
1202
+ Deepseek: "deepseek",
1203
+ Contextualai: "contextualai",
1204
+ Moonshotai: "moonshotai",
1205
+ Zai: "zai",
1206
+ Minimax: "minimax",
1207
+ Xai: "xai",
1208
+ Alibaba: "alibaba",
1209
+ Tensorix: "tensorix",
1210
+ Hcompany: "hcompany",
1211
+ Slack: "slack",
1212
+ Orq: "orq",
1213
+ } as const;
1214
+ /**
1215
+ * The provider used to generate the response
1216
+ */
1217
+ export type DeploymentStreamProvider = ClosedEnum<
1218
+ typeof DeploymentStreamProvider
1219
+ >;
1220
+
1221
+ export type DeploymentStreamTelemetry = {
1222
+ /**
1223
+ * The trace id for the request that generated this response
1224
+ */
1225
+ traceId: string;
1226
+ /**
1227
+ * The span id for the request that generated this response
1228
+ */
1229
+ spanId: string;
1230
+ };
1231
+
1232
+ /**
1233
+ * Metadata of the retrieved chunk from the knowledge base
1234
+ */
1235
+ export type DeploymentStreamDeploymentsMetadata = {
1236
+ /**
1237
+ * Name of the file
1238
+ */
1239
+ fileName: string;
1240
+ /**
1241
+ * Page number of the chunk
1242
+ */
1243
+ pageNumber: number | null;
1244
+ /**
1245
+ * Type of the file
1246
+ */
1247
+ fileType: string;
1248
+ /**
1249
+ * 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
1250
+ */
1251
+ rerankScore?: number | undefined;
1252
+ /**
1253
+ * 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.
1254
+ */
1255
+ searchScore: number;
1256
+ };
1257
+
1258
+ export type DeploymentStreamRetrievals = {
1259
+ /**
1260
+ * Content of the retrieved chunk from the knowledge base
1261
+ */
1262
+ document: string;
1263
+ /**
1264
+ * Metadata of the retrieved chunk from the knowledge base
1265
+ */
1266
+ metadata: DeploymentStreamDeploymentsMetadata;
1267
+ };
1268
+
1269
+ export type DeploymentStreamPromptTokensDetails = {
1270
+ cachedTokens?: number | null | undefined;
1271
+ };
1272
+
1273
+ export type DeploymentStreamCompletionTokensDetails = {
1274
+ reasoningTokens?: number | null | undefined;
1275
+ };
1276
+
1277
+ /**
1278
+ * Usage metrics for the response
1279
+ */
1280
+ export type DeploymentStreamUsage = {
1281
+ totalTokens?: number | undefined;
1282
+ promptTokens?: number | undefined;
1283
+ completionTokens?: number | undefined;
1284
+ promptTokensDetails?: DeploymentStreamPromptTokensDetails | undefined;
1285
+ completionTokensDetails?:
1286
+ | DeploymentStreamCompletionTokensDetails
1287
+ | null
1288
+ | undefined;
1289
+ };
1290
+
1291
+ /**
1292
+ * The role of the prompt message
1293
+ */
1294
+ export const DeploymentStreamMessageDeploymentsResponseRole = {
1295
+ System: "system",
1296
+ Developer: "developer",
1297
+ Assistant: "assistant",
1298
+ User: "user",
1299
+ Exception: "exception",
1300
+ Tool: "tool",
1301
+ Prompt: "prompt",
1302
+ Correction: "correction",
1303
+ ExpectedOutput: "expected_output",
1304
+ } as const;
1305
+ /**
1306
+ * The role of the prompt message
1307
+ */
1308
+ export type DeploymentStreamMessageDeploymentsResponseRole = ClosedEnum<
1309
+ typeof DeploymentStreamMessageDeploymentsResponseRole
1310
+ >;
1311
+
1312
+ export type DeploymentStreamMessage3 = {
1313
+ type: "image";
1314
+ /**
1315
+ * The role of the prompt message
1316
+ */
1317
+ role: DeploymentStreamMessageDeploymentsResponseRole;
1318
+ url: string;
1319
+ };
1320
+
1321
+ /**
1322
+ * The role of the prompt message
1323
+ */
1324
+ export const DeploymentStreamMessageDeploymentsRole = {
1325
+ System: "system",
1326
+ Developer: "developer",
1327
+ Assistant: "assistant",
1328
+ User: "user",
1329
+ Exception: "exception",
1330
+ Tool: "tool",
1331
+ Prompt: "prompt",
1332
+ Correction: "correction",
1333
+ ExpectedOutput: "expected_output",
1334
+ } as const;
1335
+ /**
1336
+ * The role of the prompt message
1337
+ */
1338
+ export type DeploymentStreamMessageDeploymentsRole = ClosedEnum<
1339
+ typeof DeploymentStreamMessageDeploymentsRole
1340
+ >;
1341
+
1342
+ export type DeploymentStreamMessage2 = {
1343
+ type: "content";
1344
+ /**
1345
+ * The role of the prompt message
1346
+ */
1347
+ role: DeploymentStreamMessageDeploymentsRole;
1348
+ content: string | null;
1349
+ /**
1350
+ * Internal thought process of the model
1351
+ */
1352
+ reasoning?: string | undefined;
1353
+ /**
1354
+ * 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`.
1355
+ */
1356
+ reasoningSignature?: string | undefined;
1357
+ /**
1358
+ * 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.
1359
+ */
1360
+ redactedReasoning?: string | undefined;
1361
+ };
1362
+
1363
+ /**
1364
+ * The role of the prompt message
1365
+ */
1366
+ export const DeploymentStreamMessageRole = {
1367
+ System: "system",
1368
+ Developer: "developer",
1369
+ Assistant: "assistant",
1370
+ User: "user",
1371
+ Exception: "exception",
1372
+ Tool: "tool",
1373
+ Prompt: "prompt",
1374
+ Correction: "correction",
1375
+ ExpectedOutput: "expected_output",
1376
+ } as const;
1377
+ /**
1378
+ * The role of the prompt message
1379
+ */
1380
+ export type DeploymentStreamMessageRole = ClosedEnum<
1381
+ typeof DeploymentStreamMessageRole
1382
+ >;
1383
+
1384
+ export const DeploymentStreamMessageDeploymentsResponse200Type = {
1385
+ Function: "function",
1386
+ } as const;
1387
+ export type DeploymentStreamMessageDeploymentsResponse200Type = ClosedEnum<
1388
+ typeof DeploymentStreamMessageDeploymentsResponse200Type
1389
+ >;
1390
+
1391
+ export type DeploymentStreamMessageFunction = {
1392
+ name: string;
1393
+ /**
1394
+ * JSON string arguments for the functions
1395
+ */
1396
+ arguments: string;
1397
+ };
1398
+
1399
+ export type DeploymentStreamMessageToolCalls = {
1400
+ id?: string | undefined;
1401
+ index?: number | undefined;
1402
+ type: DeploymentStreamMessageDeploymentsResponse200Type;
1403
+ function: DeploymentStreamMessageFunction;
1404
+ };
1405
+
1406
+ export type DeploymentStreamMessage1 = {
1407
+ type: "tool_calls";
1408
+ /**
1409
+ * The role of the prompt message
1410
+ */
1411
+ role: DeploymentStreamMessageRole;
1412
+ content?: string | null | undefined;
1413
+ toolCalls: Array<DeploymentStreamMessageToolCalls>;
1414
+ /**
1415
+ * Internal thought process of the model
1416
+ */
1417
+ reasoning?: string | undefined;
1418
+ /**
1419
+ * 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`.
1420
+ */
1421
+ reasoningSignature?: string | undefined;
1422
+ /**
1423
+ * 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.
1424
+ */
1425
+ redactedReasoning?: string | undefined;
1426
+ };
1427
+
1428
+ export type DeploymentStreamMessage =
1429
+ | DeploymentStreamMessage1
1430
+ | DeploymentStreamMessage2
1431
+ | DeploymentStreamMessage3;
1432
+
1433
+ export type DeploymentStreamChoices = {
1434
+ index: number;
1435
+ message:
1436
+ | DeploymentStreamMessage1
1437
+ | DeploymentStreamMessage2
1438
+ | DeploymentStreamMessage3;
1439
+ finishReason?: string | null | undefined;
1440
+ };
1441
+
1442
+ export type DeploymentStreamData = {
1443
+ /**
1444
+ * A unique identifier for the response. Can be used to add metrics to the transaction.
1445
+ */
1446
+ id: string;
1447
+ /**
1448
+ * A timestamp indicating when the object was created. Usually in a standardized format like ISO 8601
1449
+ */
1450
+ created: Date;
1451
+ /**
1452
+ * Indicates the type of model used to generate the response
1453
+ */
1454
+ object: DeploymentStreamObject;
1455
+ /**
1456
+ * The model used to generate the response
1457
+ */
1458
+ model: string;
1459
+ /**
1460
+ * The provider used to generate the response
1461
+ */
1462
+ provider: DeploymentStreamProvider;
1463
+ /**
1464
+ * Indicates if the response is the final response
1465
+ */
1466
+ isFinal: boolean;
1467
+ /**
1468
+ * Indicates integration id used to generate the response
1469
+ */
1470
+ integrationId?: string | undefined;
1471
+ telemetry: DeploymentStreamTelemetry;
1472
+ /**
1473
+ * A timestamp indicating when the object was finalized. Usually in a standardized format like ISO 8601
1474
+ */
1475
+ finalized?: Date | undefined;
1476
+ /**
1477
+ * Provider backed system fingerprint.
1478
+ */
1479
+ systemFingerprint?: string | null | undefined;
1480
+ /**
1481
+ * 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`.
1482
+ */
1483
+ retrievals?: Array<DeploymentStreamRetrievals> | undefined;
1484
+ /**
1485
+ * 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`.
1486
+ */
1487
+ providerResponse?: any | undefined;
1488
+ /**
1489
+ * Usage metrics for the response
1490
+ */
1491
+ usage?: DeploymentStreamUsage | null | undefined;
1492
+ /**
1493
+ * A list of choices generated by the model
1494
+ */
1495
+ choices: Array<DeploymentStreamChoices>;
1496
+ };
1497
+
1498
+ /**
1499
+ * Successful operation
1500
+ */
1501
+ export type DeploymentStreamResponseBody = {
1502
+ data?: DeploymentStreamData | undefined;
1503
+ };
1504
+
1505
+ /** @internal */
1506
+ export type DeploymentStreamContentDeploymentsRequest2$Outbound =
1507
+ components.TextContentPartSchema$Outbound;
1508
+
1509
+ /** @internal */
1510
+ export const DeploymentStreamContentDeploymentsRequest2$outboundSchema:
1511
+ z.ZodType<
1512
+ DeploymentStreamContentDeploymentsRequest2$Outbound,
1513
+ z.ZodTypeDef,
1514
+ DeploymentStreamContentDeploymentsRequest2
1515
+ > = components.TextContentPartSchema$outboundSchema;
1516
+
1517
+ export function deploymentStreamContentDeploymentsRequest2ToJSON(
1518
+ deploymentStreamContentDeploymentsRequest2:
1519
+ DeploymentStreamContentDeploymentsRequest2,
1520
+ ): string {
1521
+ return JSON.stringify(
1522
+ DeploymentStreamContentDeploymentsRequest2$outboundSchema.parse(
1523
+ deploymentStreamContentDeploymentsRequest2,
1524
+ ),
1525
+ );
1526
+ }
1527
+
1528
+ /** @internal */
1529
+ export type DeploymentStreamPrefixMessagesDeploymentsRequestRequestBody5Content$Outbound =
1530
+ | string
1531
+ | Array<components.TextContentPartSchema$Outbound>;
1532
+
1533
+ /** @internal */
1534
+ export const DeploymentStreamPrefixMessagesDeploymentsRequestRequestBody5Content$outboundSchema:
1535
+ z.ZodType<
1536
+ DeploymentStreamPrefixMessagesDeploymentsRequestRequestBody5Content$Outbound,
1537
+ z.ZodTypeDef,
1538
+ DeploymentStreamPrefixMessagesDeploymentsRequestRequestBody5Content
1539
+ > = z.union([
1540
+ z.string(),
1541
+ z.array(components.TextContentPartSchema$outboundSchema),
1542
+ ]);
1543
+
1544
+ export function deploymentStreamPrefixMessagesDeploymentsRequestRequestBody5ContentToJSON(
1545
+ deploymentStreamPrefixMessagesDeploymentsRequestRequestBody5Content:
1546
+ DeploymentStreamPrefixMessagesDeploymentsRequestRequestBody5Content,
1547
+ ): string {
1548
+ return JSON.stringify(
1549
+ DeploymentStreamPrefixMessagesDeploymentsRequestRequestBody5Content$outboundSchema
1550
+ .parse(
1551
+ deploymentStreamPrefixMessagesDeploymentsRequestRequestBody5Content,
1552
+ ),
1553
+ );
1554
+ }
1555
+
1556
+ /** @internal */
1557
+ export const DeploymentStreamPrefixMessagesDeploymentsType$outboundSchema:
1558
+ z.ZodNativeEnum<typeof DeploymentStreamPrefixMessagesDeploymentsType> = z
1559
+ .nativeEnum(DeploymentStreamPrefixMessagesDeploymentsType);
1560
+
1561
+ /** @internal */
1562
+ export const DeploymentStreamPrefixMessagesTtl$outboundSchema: z.ZodNativeEnum<
1563
+ typeof DeploymentStreamPrefixMessagesTtl
1564
+ > = z.nativeEnum(DeploymentStreamPrefixMessagesTtl);
1565
+
1566
+ /** @internal */
1567
+ export type DeploymentStreamPrefixMessagesCacheControl$Outbound = {
1568
+ type: string;
1569
+ ttl: string;
1570
+ };
1571
+
1572
+ /** @internal */
1573
+ export const DeploymentStreamPrefixMessagesCacheControl$outboundSchema:
1574
+ z.ZodType<
1575
+ DeploymentStreamPrefixMessagesCacheControl$Outbound,
1576
+ z.ZodTypeDef,
1577
+ DeploymentStreamPrefixMessagesCacheControl
1578
+ > = z.object({
1579
+ type: DeploymentStreamPrefixMessagesDeploymentsType$outboundSchema,
1580
+ ttl: DeploymentStreamPrefixMessagesTtl$outboundSchema.default("5m"),
1581
+ });
1582
+
1583
+ export function deploymentStreamPrefixMessagesCacheControlToJSON(
1584
+ deploymentStreamPrefixMessagesCacheControl:
1585
+ DeploymentStreamPrefixMessagesCacheControl,
1586
+ ): string {
1587
+ return JSON.stringify(
1588
+ DeploymentStreamPrefixMessagesCacheControl$outboundSchema.parse(
1589
+ deploymentStreamPrefixMessagesCacheControl,
1590
+ ),
1591
+ );
1592
+ }
1593
+
1594
+ /** @internal */
1595
+ export type PrefixMessagesToolMessage$Outbound = {
1596
+ role: "tool";
1597
+ content: string | Array<components.TextContentPartSchema$Outbound>;
1598
+ tool_call_id: string | null;
1599
+ cache_control?:
1600
+ | DeploymentStreamPrefixMessagesCacheControl$Outbound
1601
+ | undefined;
1602
+ };
1603
+
1604
+ /** @internal */
1605
+ export const PrefixMessagesToolMessage$outboundSchema: z.ZodType<
1606
+ PrefixMessagesToolMessage$Outbound,
1607
+ z.ZodTypeDef,
1608
+ PrefixMessagesToolMessage
1609
+ > = z.object({
1610
+ role: z.literal("tool"),
1611
+ content: z.union([
1612
+ z.string(),
1613
+ z.array(components.TextContentPartSchema$outboundSchema),
1614
+ ]),
1615
+ toolCallId: z.nullable(z.string()),
1616
+ cacheControl: z.lazy(() =>
1617
+ DeploymentStreamPrefixMessagesCacheControl$outboundSchema
1618
+ ).optional(),
1619
+ }).transform((v) => {
1620
+ return remap$(v, {
1621
+ toolCallId: "tool_call_id",
1622
+ cacheControl: "cache_control",
1623
+ });
1624
+ });
1625
+
1626
+ export function prefixMessagesToolMessageToJSON(
1627
+ prefixMessagesToolMessage: PrefixMessagesToolMessage,
1628
+ ): string {
1629
+ return JSON.stringify(
1630
+ PrefixMessagesToolMessage$outboundSchema.parse(prefixMessagesToolMessage),
1631
+ );
1632
+ }
1633
+
1634
+ /** @internal */
1635
+ export type DeploymentStreamContentDeployments2$Outbound =
1636
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
1637
+ | components.RefusalPartSchema$Outbound
1638
+ | components.ReasoningPartSchema$Outbound
1639
+ | components.RedactedReasoningPartSchema$Outbound;
1640
+
1641
+ /** @internal */
1642
+ export const DeploymentStreamContentDeployments2$outboundSchema: z.ZodType<
1643
+ DeploymentStreamContentDeployments2$Outbound,
1644
+ z.ZodTypeDef,
1645
+ DeploymentStreamContentDeployments2
1646
+ > = z.union([
1647
+ components.TextContentPartSchema$outboundSchema.and(
1648
+ z.object({ type: z.literal("text") }),
1649
+ ),
1650
+ components.RefusalPartSchema$outboundSchema,
1651
+ components.ReasoningPartSchema$outboundSchema,
1652
+ components.RedactedReasoningPartSchema$outboundSchema,
1653
+ ]);
1654
+
1655
+ export function deploymentStreamContentDeployments2ToJSON(
1656
+ deploymentStreamContentDeployments2: DeploymentStreamContentDeployments2,
1657
+ ): string {
1658
+ return JSON.stringify(
1659
+ DeploymentStreamContentDeployments2$outboundSchema.parse(
1660
+ deploymentStreamContentDeployments2,
1661
+ ),
1662
+ );
1663
+ }
1664
+
1665
+ /** @internal */
1666
+ export type DeploymentStreamPrefixMessagesDeploymentsRequestRequestBodyContent$Outbound =
1667
+ | string
1668
+ | Array<
1669
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
1670
+ | components.RefusalPartSchema$Outbound
1671
+ | components.ReasoningPartSchema$Outbound
1672
+ | components.RedactedReasoningPartSchema$Outbound
1673
+ >;
1674
+
1675
+ /** @internal */
1676
+ export const DeploymentStreamPrefixMessagesDeploymentsRequestRequestBodyContent$outboundSchema:
1677
+ z.ZodType<
1678
+ DeploymentStreamPrefixMessagesDeploymentsRequestRequestBodyContent$Outbound,
1679
+ z.ZodTypeDef,
1680
+ DeploymentStreamPrefixMessagesDeploymentsRequestRequestBodyContent
1681
+ > = z.union([
1682
+ z.string(),
1683
+ z.array(
1684
+ z.union([
1685
+ components.TextContentPartSchema$outboundSchema.and(
1686
+ z.object({ type: z.literal("text") }),
1687
+ ),
1688
+ components.RefusalPartSchema$outboundSchema,
1689
+ components.ReasoningPartSchema$outboundSchema,
1690
+ components.RedactedReasoningPartSchema$outboundSchema,
1691
+ ]),
1692
+ ),
1693
+ ]);
1694
+
1695
+ export function deploymentStreamPrefixMessagesDeploymentsRequestRequestBodyContentToJSON(
1696
+ deploymentStreamPrefixMessagesDeploymentsRequestRequestBodyContent:
1697
+ DeploymentStreamPrefixMessagesDeploymentsRequestRequestBodyContent,
1698
+ ): string {
1699
+ return JSON.stringify(
1700
+ DeploymentStreamPrefixMessagesDeploymentsRequestRequestBodyContent$outboundSchema
1701
+ .parse(
1702
+ deploymentStreamPrefixMessagesDeploymentsRequestRequestBodyContent,
1703
+ ),
1704
+ );
1705
+ }
1706
+
1707
+ /** @internal */
1708
+ export type PrefixMessagesAudio$Outbound = {
1709
+ id: string;
1710
+ };
1711
+
1712
+ /** @internal */
1713
+ export const PrefixMessagesAudio$outboundSchema: z.ZodType<
1714
+ PrefixMessagesAudio$Outbound,
1715
+ z.ZodTypeDef,
1716
+ PrefixMessagesAudio
1717
+ > = z.object({
1718
+ id: z.string(),
1719
+ });
1720
+
1721
+ export function prefixMessagesAudioToJSON(
1722
+ prefixMessagesAudio: PrefixMessagesAudio,
1723
+ ): string {
1724
+ return JSON.stringify(
1725
+ PrefixMessagesAudio$outboundSchema.parse(prefixMessagesAudio),
1726
+ );
1727
+ }
1728
+
1729
+ /** @internal */
1730
+ export const DeploymentStreamPrefixMessagesType$outboundSchema: z.ZodNativeEnum<
1731
+ typeof DeploymentStreamPrefixMessagesType
1732
+ > = z.nativeEnum(DeploymentStreamPrefixMessagesType);
1733
+
1734
+ /** @internal */
1735
+ export type DeploymentStreamPrefixMessagesFunction$Outbound = {
1736
+ name?: string | undefined;
1737
+ arguments?: string | undefined;
1738
+ };
1739
+
1740
+ /** @internal */
1741
+ export const DeploymentStreamPrefixMessagesFunction$outboundSchema: z.ZodType<
1742
+ DeploymentStreamPrefixMessagesFunction$Outbound,
1743
+ z.ZodTypeDef,
1744
+ DeploymentStreamPrefixMessagesFunction
1745
+ > = z.object({
1746
+ name: z.string().optional(),
1747
+ arguments: z.string().optional(),
1748
+ });
1749
+
1750
+ export function deploymentStreamPrefixMessagesFunctionToJSON(
1751
+ deploymentStreamPrefixMessagesFunction:
1752
+ DeploymentStreamPrefixMessagesFunction,
1753
+ ): string {
1754
+ return JSON.stringify(
1755
+ DeploymentStreamPrefixMessagesFunction$outboundSchema.parse(
1756
+ deploymentStreamPrefixMessagesFunction,
1757
+ ),
1758
+ );
1759
+ }
1760
+
1761
+ /** @internal */
1762
+ export type DeploymentStreamPrefixMessagesToolCalls$Outbound = {
1763
+ id: string;
1764
+ type: string;
1765
+ function: DeploymentStreamPrefixMessagesFunction$Outbound;
1766
+ thought_signature?: string | undefined;
1767
+ };
1768
+
1769
+ /** @internal */
1770
+ export const DeploymentStreamPrefixMessagesToolCalls$outboundSchema: z.ZodType<
1771
+ DeploymentStreamPrefixMessagesToolCalls$Outbound,
1772
+ z.ZodTypeDef,
1773
+ DeploymentStreamPrefixMessagesToolCalls
1774
+ > = z.object({
1775
+ id: z.string(),
1776
+ type: DeploymentStreamPrefixMessagesType$outboundSchema,
1777
+ function: z.lazy(() => DeploymentStreamPrefixMessagesFunction$outboundSchema),
1778
+ thoughtSignature: z.string().optional(),
1779
+ }).transform((v) => {
1780
+ return remap$(v, {
1781
+ thoughtSignature: "thought_signature",
1782
+ });
1783
+ });
1784
+
1785
+ export function deploymentStreamPrefixMessagesToolCallsToJSON(
1786
+ deploymentStreamPrefixMessagesToolCalls:
1787
+ DeploymentStreamPrefixMessagesToolCalls,
1788
+ ): string {
1789
+ return JSON.stringify(
1790
+ DeploymentStreamPrefixMessagesToolCalls$outboundSchema.parse(
1791
+ deploymentStreamPrefixMessagesToolCalls,
1792
+ ),
1793
+ );
1794
+ }
1795
+
1796
+ /** @internal */
1797
+ export type PrefixMessagesAssistantMessage$Outbound = {
1798
+ content?:
1799
+ | string
1800
+ | Array<
1801
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
1802
+ | components.RefusalPartSchema$Outbound
1803
+ | components.ReasoningPartSchema$Outbound
1804
+ | components.RedactedReasoningPartSchema$Outbound
1805
+ >
1806
+ | null
1807
+ | undefined;
1808
+ refusal?: string | null | undefined;
1809
+ role: "assistant";
1810
+ name?: string | undefined;
1811
+ audio?: PrefixMessagesAudio$Outbound | null | undefined;
1812
+ tool_calls?:
1813
+ | Array<DeploymentStreamPrefixMessagesToolCalls$Outbound>
1814
+ | undefined;
1815
+ };
1816
+
1817
+ /** @internal */
1818
+ export const PrefixMessagesAssistantMessage$outboundSchema: z.ZodType<
1819
+ PrefixMessagesAssistantMessage$Outbound,
1820
+ z.ZodTypeDef,
1821
+ PrefixMessagesAssistantMessage
1822
+ > = z.object({
1823
+ content: z.nullable(
1824
+ z.union([
1825
+ z.string(),
1826
+ z.array(
1827
+ z.union([
1828
+ components.TextContentPartSchema$outboundSchema.and(
1829
+ z.object({ type: z.literal("text") }),
1830
+ ),
1831
+ components.RefusalPartSchema$outboundSchema,
1832
+ components.ReasoningPartSchema$outboundSchema,
1833
+ components.RedactedReasoningPartSchema$outboundSchema,
1834
+ ]),
1835
+ ),
1836
+ ]),
1837
+ ).optional(),
1838
+ refusal: z.nullable(z.string()).optional(),
1839
+ role: z.literal("assistant"),
1840
+ name: z.string().optional(),
1841
+ audio: z.nullable(z.lazy(() => PrefixMessagesAudio$outboundSchema))
1842
+ .optional(),
1843
+ toolCalls: z.array(
1844
+ z.lazy(() => DeploymentStreamPrefixMessagesToolCalls$outboundSchema),
1845
+ ).optional(),
1846
+ }).transform((v) => {
1847
+ return remap$(v, {
1848
+ toolCalls: "tool_calls",
1849
+ });
1850
+ });
1851
+
1852
+ export function prefixMessagesAssistantMessageToJSON(
1853
+ prefixMessagesAssistantMessage: PrefixMessagesAssistantMessage,
1854
+ ): string {
1855
+ return JSON.stringify(
1856
+ PrefixMessagesAssistantMessage$outboundSchema.parse(
1857
+ prefixMessagesAssistantMessage,
1858
+ ),
1859
+ );
1860
+ }
1861
+
1862
+ /** @internal */
1863
+ export const DeploymentStream2DeploymentsType$outboundSchema: z.ZodNativeEnum<
1864
+ typeof DeploymentStream2DeploymentsType
1865
+ > = z.nativeEnum(DeploymentStream2DeploymentsType);
1866
+
1867
+ /** @internal */
1868
+ export const DeploymentStream2Ttl$outboundSchema: z.ZodNativeEnum<
1869
+ typeof DeploymentStream2Ttl
1870
+ > = z.nativeEnum(DeploymentStream2Ttl);
1871
+
1872
+ /** @internal */
1873
+ export type DeploymentStream2CacheControl$Outbound = {
1874
+ type: string;
1875
+ ttl: string;
1876
+ };
1877
+
1878
+ /** @internal */
1879
+ export const DeploymentStream2CacheControl$outboundSchema: z.ZodType<
1880
+ DeploymentStream2CacheControl$Outbound,
1881
+ z.ZodTypeDef,
1882
+ DeploymentStream2CacheControl
1883
+ > = z.object({
1884
+ type: DeploymentStream2DeploymentsType$outboundSchema,
1885
+ ttl: DeploymentStream2Ttl$outboundSchema.default("5m"),
1886
+ });
1887
+
1888
+ export function deploymentStream2CacheControlToJSON(
1889
+ deploymentStream2CacheControl: DeploymentStream2CacheControl,
1890
+ ): string {
1891
+ return JSON.stringify(
1892
+ DeploymentStream2CacheControl$outboundSchema.parse(
1893
+ deploymentStream2CacheControl,
1894
+ ),
1895
+ );
1896
+ }
1897
+
1898
+ /** @internal */
1899
+ export type DeploymentStream24$Outbound = {
1900
+ type: "file";
1901
+ cache_control?: DeploymentStream2CacheControl$Outbound | undefined;
1902
+ file: components.FileContentPartSchema$Outbound;
1903
+ };
1904
+
1905
+ /** @internal */
1906
+ export const DeploymentStream24$outboundSchema: z.ZodType<
1907
+ DeploymentStream24$Outbound,
1908
+ z.ZodTypeDef,
1909
+ DeploymentStream24
1910
+ > = z.object({
1911
+ type: z.literal("file"),
1912
+ cacheControl: z.lazy(() => DeploymentStream2CacheControl$outboundSchema)
1913
+ .optional(),
1914
+ file: components.FileContentPartSchema$outboundSchema,
1915
+ }).transform((v) => {
1916
+ return remap$(v, {
1917
+ cacheControl: "cache_control",
1918
+ });
1919
+ });
1920
+
1921
+ export function deploymentStream24ToJSON(
1922
+ deploymentStream24: DeploymentStream24,
1923
+ ): string {
1924
+ return JSON.stringify(
1925
+ DeploymentStream24$outboundSchema.parse(deploymentStream24),
1926
+ );
1927
+ }
1928
+
1929
+ /** @internal */
1930
+ export type DeploymentStreamContent2$Outbound =
1931
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
1932
+ | components.ImageContentPartSchema$Outbound
1933
+ | components.AudioContentPartSchema$Outbound
1934
+ | DeploymentStream24$Outbound;
1935
+
1936
+ /** @internal */
1937
+ export const DeploymentStreamContent2$outboundSchema: z.ZodType<
1938
+ DeploymentStreamContent2$Outbound,
1939
+ z.ZodTypeDef,
1940
+ DeploymentStreamContent2
1941
+ > = z.union([
1942
+ components.TextContentPartSchema$outboundSchema.and(
1943
+ z.object({ type: z.literal("text") }),
1944
+ ),
1945
+ components.ImageContentPartSchema$outboundSchema,
1946
+ components.AudioContentPartSchema$outboundSchema,
1947
+ z.lazy(() => DeploymentStream24$outboundSchema),
1948
+ ]);
1949
+
1950
+ export function deploymentStreamContent2ToJSON(
1951
+ deploymentStreamContent2: DeploymentStreamContent2,
1952
+ ): string {
1953
+ return JSON.stringify(
1954
+ DeploymentStreamContent2$outboundSchema.parse(deploymentStreamContent2),
1955
+ );
1956
+ }
1957
+
1958
+ /** @internal */
1959
+ export type DeploymentStreamPrefixMessagesDeploymentsRequestContent$Outbound =
1960
+ | string
1961
+ | Array<
1962
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
1963
+ | components.ImageContentPartSchema$Outbound
1964
+ | components.AudioContentPartSchema$Outbound
1965
+ | DeploymentStream24$Outbound
1966
+ >;
1967
+
1968
+ /** @internal */
1969
+ export const DeploymentStreamPrefixMessagesDeploymentsRequestContent$outboundSchema:
1970
+ z.ZodType<
1971
+ DeploymentStreamPrefixMessagesDeploymentsRequestContent$Outbound,
1972
+ z.ZodTypeDef,
1973
+ DeploymentStreamPrefixMessagesDeploymentsRequestContent
1974
+ > = z.union([
1975
+ z.string(),
1976
+ z.array(
1977
+ z.union([
1978
+ components.TextContentPartSchema$outboundSchema.and(
1979
+ z.object({ type: z.literal("text") }),
1980
+ ),
1981
+ components.ImageContentPartSchema$outboundSchema,
1982
+ components.AudioContentPartSchema$outboundSchema,
1983
+ z.lazy(() => DeploymentStream24$outboundSchema),
1984
+ ]),
1985
+ ),
1986
+ ]);
1987
+
1988
+ export function deploymentStreamPrefixMessagesDeploymentsRequestContentToJSON(
1989
+ deploymentStreamPrefixMessagesDeploymentsRequestContent:
1990
+ DeploymentStreamPrefixMessagesDeploymentsRequestContent,
1991
+ ): string {
1992
+ return JSON.stringify(
1993
+ DeploymentStreamPrefixMessagesDeploymentsRequestContent$outboundSchema
1994
+ .parse(deploymentStreamPrefixMessagesDeploymentsRequestContent),
1995
+ );
1996
+ }
1997
+
1998
+ /** @internal */
1999
+ export type PrefixMessagesUserMessage$Outbound = {
2000
+ role: "user";
2001
+ name?: string | undefined;
2002
+ content:
2003
+ | string
2004
+ | Array<
2005
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
2006
+ | components.ImageContentPartSchema$Outbound
2007
+ | components.AudioContentPartSchema$Outbound
2008
+ | DeploymentStream24$Outbound
2009
+ >;
2010
+ };
2011
+
2012
+ /** @internal */
2013
+ export const PrefixMessagesUserMessage$outboundSchema: z.ZodType<
2014
+ PrefixMessagesUserMessage$Outbound,
2015
+ z.ZodTypeDef,
2016
+ PrefixMessagesUserMessage
2017
+ > = z.object({
2018
+ role: z.literal("user"),
2019
+ name: z.string().optional(),
2020
+ content: z.union([
2021
+ z.string(),
2022
+ z.array(
2023
+ z.union([
2024
+ components.TextContentPartSchema$outboundSchema.and(
2025
+ z.object({ type: z.literal("text") }),
2026
+ ),
2027
+ components.ImageContentPartSchema$outboundSchema,
2028
+ components.AudioContentPartSchema$outboundSchema,
2029
+ z.lazy(() => DeploymentStream24$outboundSchema),
2030
+ ]),
2031
+ ),
2032
+ ]),
2033
+ });
2034
+
2035
+ export function prefixMessagesUserMessageToJSON(
2036
+ prefixMessagesUserMessage: PrefixMessagesUserMessage,
2037
+ ): string {
2038
+ return JSON.stringify(
2039
+ PrefixMessagesUserMessage$outboundSchema.parse(prefixMessagesUserMessage),
2040
+ );
2041
+ }
2042
+
2043
+ /** @internal */
2044
+ export type DeploymentStreamPrefixMessagesDeploymentsContent$Outbound =
2045
+ | string
2046
+ | Array<components.TextContentPartSchema$Outbound>;
2047
+
2048
+ /** @internal */
2049
+ export const DeploymentStreamPrefixMessagesDeploymentsContent$outboundSchema:
2050
+ z.ZodType<
2051
+ DeploymentStreamPrefixMessagesDeploymentsContent$Outbound,
2052
+ z.ZodTypeDef,
2053
+ DeploymentStreamPrefixMessagesDeploymentsContent
2054
+ > = z.union([
2055
+ z.string(),
2056
+ z.array(components.TextContentPartSchema$outboundSchema),
2057
+ ]);
2058
+
2059
+ export function deploymentStreamPrefixMessagesDeploymentsContentToJSON(
2060
+ deploymentStreamPrefixMessagesDeploymentsContent:
2061
+ DeploymentStreamPrefixMessagesDeploymentsContent,
2062
+ ): string {
2063
+ return JSON.stringify(
2064
+ DeploymentStreamPrefixMessagesDeploymentsContent$outboundSchema.parse(
2065
+ deploymentStreamPrefixMessagesDeploymentsContent,
2066
+ ),
2067
+ );
2068
+ }
2069
+
2070
+ /** @internal */
2071
+ export type PrefixMessagesDeveloperMessage$Outbound = {
2072
+ role: "developer";
2073
+ content: string | Array<components.TextContentPartSchema$Outbound>;
2074
+ name?: string | undefined;
2075
+ };
2076
+
2077
+ /** @internal */
2078
+ export const PrefixMessagesDeveloperMessage$outboundSchema: z.ZodType<
2079
+ PrefixMessagesDeveloperMessage$Outbound,
2080
+ z.ZodTypeDef,
2081
+ PrefixMessagesDeveloperMessage
2082
+ > = z.object({
2083
+ role: z.literal("developer"),
2084
+ content: z.union([
2085
+ z.string(),
2086
+ z.array(components.TextContentPartSchema$outboundSchema),
2087
+ ]),
2088
+ name: z.string().optional(),
2089
+ });
2090
+
2091
+ export function prefixMessagesDeveloperMessageToJSON(
2092
+ prefixMessagesDeveloperMessage: PrefixMessagesDeveloperMessage,
2093
+ ): string {
2094
+ return JSON.stringify(
2095
+ PrefixMessagesDeveloperMessage$outboundSchema.parse(
2096
+ prefixMessagesDeveloperMessage,
2097
+ ),
2098
+ );
2099
+ }
2100
+
2101
+ /** @internal */
2102
+ export type DeploymentStreamPrefixMessagesContent$Outbound =
2103
+ | string
2104
+ | Array<components.TextContentPartSchema$Outbound>;
2105
+
2106
+ /** @internal */
2107
+ export const DeploymentStreamPrefixMessagesContent$outboundSchema: z.ZodType<
2108
+ DeploymentStreamPrefixMessagesContent$Outbound,
2109
+ z.ZodTypeDef,
2110
+ DeploymentStreamPrefixMessagesContent
2111
+ > = z.union([
2112
+ z.string(),
2113
+ z.array(components.TextContentPartSchema$outboundSchema),
2114
+ ]);
2115
+
2116
+ export function deploymentStreamPrefixMessagesContentToJSON(
2117
+ deploymentStreamPrefixMessagesContent: DeploymentStreamPrefixMessagesContent,
2118
+ ): string {
2119
+ return JSON.stringify(
2120
+ DeploymentStreamPrefixMessagesContent$outboundSchema.parse(
2121
+ deploymentStreamPrefixMessagesContent,
2122
+ ),
2123
+ );
2124
+ }
2125
+
2126
+ /** @internal */
2127
+ export type PrefixMessagesSystemMessage$Outbound = {
2128
+ role: "system";
2129
+ content: string | Array<components.TextContentPartSchema$Outbound>;
2130
+ name?: string | undefined;
2131
+ };
2132
+
2133
+ /** @internal */
2134
+ export const PrefixMessagesSystemMessage$outboundSchema: z.ZodType<
2135
+ PrefixMessagesSystemMessage$Outbound,
2136
+ z.ZodTypeDef,
2137
+ PrefixMessagesSystemMessage
2138
+ > = z.object({
2139
+ role: z.literal("system"),
2140
+ content: z.union([
2141
+ z.string(),
2142
+ z.array(components.TextContentPartSchema$outboundSchema),
2143
+ ]),
2144
+ name: z.string().optional(),
2145
+ });
2146
+
2147
+ export function prefixMessagesSystemMessageToJSON(
2148
+ prefixMessagesSystemMessage: PrefixMessagesSystemMessage,
2149
+ ): string {
2150
+ return JSON.stringify(
2151
+ PrefixMessagesSystemMessage$outboundSchema.parse(
2152
+ prefixMessagesSystemMessage,
2153
+ ),
2154
+ );
2155
+ }
2156
+
2157
+ /** @internal */
2158
+ export type DeploymentStreamPrefixMessages$Outbound =
2159
+ | PrefixMessagesSystemMessage$Outbound
2160
+ | PrefixMessagesDeveloperMessage$Outbound
2161
+ | PrefixMessagesUserMessage$Outbound
2162
+ | PrefixMessagesAssistantMessage$Outbound
2163
+ | PrefixMessagesToolMessage$Outbound;
2164
+
2165
+ /** @internal */
2166
+ export const DeploymentStreamPrefixMessages$outboundSchema: z.ZodType<
2167
+ DeploymentStreamPrefixMessages$Outbound,
2168
+ z.ZodTypeDef,
2169
+ DeploymentStreamPrefixMessages
2170
+ > = z.union([
2171
+ z.lazy(() => PrefixMessagesSystemMessage$outboundSchema),
2172
+ z.lazy(() => PrefixMessagesDeveloperMessage$outboundSchema),
2173
+ z.lazy(() => PrefixMessagesUserMessage$outboundSchema),
2174
+ z.lazy(() => PrefixMessagesAssistantMessage$outboundSchema),
2175
+ z.lazy(() => PrefixMessagesToolMessage$outboundSchema),
2176
+ ]);
2177
+
2178
+ export function deploymentStreamPrefixMessagesToJSON(
2179
+ deploymentStreamPrefixMessages: DeploymentStreamPrefixMessages,
2180
+ ): string {
2181
+ return JSON.stringify(
2182
+ DeploymentStreamPrefixMessages$outboundSchema.parse(
2183
+ deploymentStreamPrefixMessages,
2184
+ ),
2185
+ );
2186
+ }
2187
+
2188
+ /** @internal */
2189
+ export type DeploymentStreamContentDeploymentsRequestRequestBodyMessages52$Outbound =
2190
+ components.TextContentPartSchema$Outbound;
2191
+
2192
+ /** @internal */
2193
+ export const DeploymentStreamContentDeploymentsRequestRequestBodyMessages52$outboundSchema:
2194
+ z.ZodType<
2195
+ DeploymentStreamContentDeploymentsRequestRequestBodyMessages52$Outbound,
2196
+ z.ZodTypeDef,
2197
+ DeploymentStreamContentDeploymentsRequestRequestBodyMessages52
2198
+ > = components.TextContentPartSchema$outboundSchema;
2199
+
2200
+ export function deploymentStreamContentDeploymentsRequestRequestBodyMessages52ToJSON(
2201
+ deploymentStreamContentDeploymentsRequestRequestBodyMessages52:
2202
+ DeploymentStreamContentDeploymentsRequestRequestBodyMessages52,
2203
+ ): string {
2204
+ return JSON.stringify(
2205
+ DeploymentStreamContentDeploymentsRequestRequestBodyMessages52$outboundSchema
2206
+ .parse(deploymentStreamContentDeploymentsRequestRequestBodyMessages52),
2207
+ );
2208
+ }
2209
+
2210
+ /** @internal */
2211
+ export type DeploymentStreamMessagesDeploymentsRequestRequestBody5Content$Outbound =
2212
+ | string
2213
+ | Array<components.TextContentPartSchema$Outbound>;
2214
+
2215
+ /** @internal */
2216
+ export const DeploymentStreamMessagesDeploymentsRequestRequestBody5Content$outboundSchema:
2217
+ z.ZodType<
2218
+ DeploymentStreamMessagesDeploymentsRequestRequestBody5Content$Outbound,
2219
+ z.ZodTypeDef,
2220
+ DeploymentStreamMessagesDeploymentsRequestRequestBody5Content
2221
+ > = z.union([
2222
+ z.string(),
2223
+ z.array(components.TextContentPartSchema$outboundSchema),
2224
+ ]);
2225
+
2226
+ export function deploymentStreamMessagesDeploymentsRequestRequestBody5ContentToJSON(
2227
+ deploymentStreamMessagesDeploymentsRequestRequestBody5Content:
2228
+ DeploymentStreamMessagesDeploymentsRequestRequestBody5Content,
2229
+ ): string {
2230
+ return JSON.stringify(
2231
+ DeploymentStreamMessagesDeploymentsRequestRequestBody5Content$outboundSchema
2232
+ .parse(deploymentStreamMessagesDeploymentsRequestRequestBody5Content),
2233
+ );
2234
+ }
2235
+
2236
+ /** @internal */
2237
+ export const DeploymentStreamMessagesDeploymentsType$outboundSchema:
2238
+ z.ZodNativeEnum<typeof DeploymentStreamMessagesDeploymentsType> = z
2239
+ .nativeEnum(DeploymentStreamMessagesDeploymentsType);
2240
+
2241
+ /** @internal */
2242
+ export const DeploymentStreamMessagesTtl$outboundSchema: z.ZodNativeEnum<
2243
+ typeof DeploymentStreamMessagesTtl
2244
+ > = z.nativeEnum(DeploymentStreamMessagesTtl);
2245
+
2246
+ /** @internal */
2247
+ export type DeploymentStreamMessagesCacheControl$Outbound = {
2248
+ type: string;
2249
+ ttl: string;
2250
+ };
2251
+
2252
+ /** @internal */
2253
+ export const DeploymentStreamMessagesCacheControl$outboundSchema: z.ZodType<
2254
+ DeploymentStreamMessagesCacheControl$Outbound,
2255
+ z.ZodTypeDef,
2256
+ DeploymentStreamMessagesCacheControl
2257
+ > = z.object({
2258
+ type: DeploymentStreamMessagesDeploymentsType$outboundSchema,
2259
+ ttl: DeploymentStreamMessagesTtl$outboundSchema.default("5m"),
2260
+ });
2261
+
2262
+ export function deploymentStreamMessagesCacheControlToJSON(
2263
+ deploymentStreamMessagesCacheControl: DeploymentStreamMessagesCacheControl,
2264
+ ): string {
2265
+ return JSON.stringify(
2266
+ DeploymentStreamMessagesCacheControl$outboundSchema.parse(
2267
+ deploymentStreamMessagesCacheControl,
2268
+ ),
2269
+ );
2270
+ }
2271
+
2272
+ /** @internal */
2273
+ export type DeploymentStreamMessagesToolMessage$Outbound = {
2274
+ role: "tool";
2275
+ content: string | Array<components.TextContentPartSchema$Outbound>;
2276
+ tool_call_id: string | null;
2277
+ cache_control?: DeploymentStreamMessagesCacheControl$Outbound | undefined;
2278
+ };
2279
+
2280
+ /** @internal */
2281
+ export const DeploymentStreamMessagesToolMessage$outboundSchema: z.ZodType<
2282
+ DeploymentStreamMessagesToolMessage$Outbound,
2283
+ z.ZodTypeDef,
2284
+ DeploymentStreamMessagesToolMessage
2285
+ > = z.object({
2286
+ role: z.literal("tool"),
2287
+ content: z.union([
2288
+ z.string(),
2289
+ z.array(components.TextContentPartSchema$outboundSchema),
2290
+ ]),
2291
+ toolCallId: z.nullable(z.string()),
2292
+ cacheControl: z.lazy(() =>
2293
+ DeploymentStreamMessagesCacheControl$outboundSchema
2294
+ ).optional(),
2295
+ }).transform((v) => {
2296
+ return remap$(v, {
2297
+ toolCallId: "tool_call_id",
2298
+ cacheControl: "cache_control",
2299
+ });
2300
+ });
2301
+
2302
+ export function deploymentStreamMessagesToolMessageToJSON(
2303
+ deploymentStreamMessagesToolMessage: DeploymentStreamMessagesToolMessage,
2304
+ ): string {
2305
+ return JSON.stringify(
2306
+ DeploymentStreamMessagesToolMessage$outboundSchema.parse(
2307
+ deploymentStreamMessagesToolMessage,
2308
+ ),
2309
+ );
2310
+ }
2311
+
2312
+ /** @internal */
2313
+ export type DeploymentStreamContentDeploymentsRequestRequestBodyMessages2$Outbound =
2314
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
2315
+ | components.RefusalPartSchema$Outbound
2316
+ | components.ReasoningPartSchema$Outbound
2317
+ | components.RedactedReasoningPartSchema$Outbound;
2318
+
2319
+ /** @internal */
2320
+ export const DeploymentStreamContentDeploymentsRequestRequestBodyMessages2$outboundSchema:
2321
+ z.ZodType<
2322
+ DeploymentStreamContentDeploymentsRequestRequestBodyMessages2$Outbound,
2323
+ z.ZodTypeDef,
2324
+ DeploymentStreamContentDeploymentsRequestRequestBodyMessages2
2325
+ > = z.union([
2326
+ components.TextContentPartSchema$outboundSchema.and(
2327
+ z.object({ type: z.literal("text") }),
2328
+ ),
2329
+ components.RefusalPartSchema$outboundSchema,
2330
+ components.ReasoningPartSchema$outboundSchema,
2331
+ components.RedactedReasoningPartSchema$outboundSchema,
2332
+ ]);
2333
+
2334
+ export function deploymentStreamContentDeploymentsRequestRequestBodyMessages2ToJSON(
2335
+ deploymentStreamContentDeploymentsRequestRequestBodyMessages2:
2336
+ DeploymentStreamContentDeploymentsRequestRequestBodyMessages2,
2337
+ ): string {
2338
+ return JSON.stringify(
2339
+ DeploymentStreamContentDeploymentsRequestRequestBodyMessages2$outboundSchema
2340
+ .parse(deploymentStreamContentDeploymentsRequestRequestBodyMessages2),
2341
+ );
2342
+ }
2343
+
2344
+ /** @internal */
2345
+ export type DeploymentStreamMessagesDeploymentsRequestRequestBodyContent$Outbound =
2346
+ | string
2347
+ | Array<
2348
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
2349
+ | components.RefusalPartSchema$Outbound
2350
+ | components.ReasoningPartSchema$Outbound
2351
+ | components.RedactedReasoningPartSchema$Outbound
2352
+ >;
2353
+
2354
+ /** @internal */
2355
+ export const DeploymentStreamMessagesDeploymentsRequestRequestBodyContent$outboundSchema:
2356
+ z.ZodType<
2357
+ DeploymentStreamMessagesDeploymentsRequestRequestBodyContent$Outbound,
2358
+ z.ZodTypeDef,
2359
+ DeploymentStreamMessagesDeploymentsRequestRequestBodyContent
2360
+ > = z.union([
2361
+ z.string(),
2362
+ z.array(
2363
+ z.union([
2364
+ components.TextContentPartSchema$outboundSchema.and(
2365
+ z.object({ type: z.literal("text") }),
2366
+ ),
2367
+ components.RefusalPartSchema$outboundSchema,
2368
+ components.ReasoningPartSchema$outboundSchema,
2369
+ components.RedactedReasoningPartSchema$outboundSchema,
2370
+ ]),
2371
+ ),
2372
+ ]);
2373
+
2374
+ export function deploymentStreamMessagesDeploymentsRequestRequestBodyContentToJSON(
2375
+ deploymentStreamMessagesDeploymentsRequestRequestBodyContent:
2376
+ DeploymentStreamMessagesDeploymentsRequestRequestBodyContent,
2377
+ ): string {
2378
+ return JSON.stringify(
2379
+ DeploymentStreamMessagesDeploymentsRequestRequestBodyContent$outboundSchema
2380
+ .parse(deploymentStreamMessagesDeploymentsRequestRequestBodyContent),
2381
+ );
2382
+ }
2383
+
2384
+ /** @internal */
2385
+ export type DeploymentStreamMessagesAudio$Outbound = {
2386
+ id: string;
2387
+ };
2388
+
2389
+ /** @internal */
2390
+ export const DeploymentStreamMessagesAudio$outboundSchema: z.ZodType<
2391
+ DeploymentStreamMessagesAudio$Outbound,
2392
+ z.ZodTypeDef,
2393
+ DeploymentStreamMessagesAudio
2394
+ > = z.object({
2395
+ id: z.string(),
2396
+ });
2397
+
2398
+ export function deploymentStreamMessagesAudioToJSON(
2399
+ deploymentStreamMessagesAudio: DeploymentStreamMessagesAudio,
2400
+ ): string {
2401
+ return JSON.stringify(
2402
+ DeploymentStreamMessagesAudio$outboundSchema.parse(
2403
+ deploymentStreamMessagesAudio,
2404
+ ),
2405
+ );
2406
+ }
2407
+
2408
+ /** @internal */
2409
+ export const DeploymentStreamMessagesType$outboundSchema: z.ZodNativeEnum<
2410
+ typeof DeploymentStreamMessagesType
2411
+ > = z.nativeEnum(DeploymentStreamMessagesType);
2412
+
2413
+ /** @internal */
2414
+ export type DeploymentStreamMessagesFunction$Outbound = {
2415
+ name?: string | undefined;
2416
+ arguments?: string | undefined;
2417
+ };
2418
+
2419
+ /** @internal */
2420
+ export const DeploymentStreamMessagesFunction$outboundSchema: z.ZodType<
2421
+ DeploymentStreamMessagesFunction$Outbound,
2422
+ z.ZodTypeDef,
2423
+ DeploymentStreamMessagesFunction
2424
+ > = z.object({
2425
+ name: z.string().optional(),
2426
+ arguments: z.string().optional(),
2427
+ });
2428
+
2429
+ export function deploymentStreamMessagesFunctionToJSON(
2430
+ deploymentStreamMessagesFunction: DeploymentStreamMessagesFunction,
2431
+ ): string {
2432
+ return JSON.stringify(
2433
+ DeploymentStreamMessagesFunction$outboundSchema.parse(
2434
+ deploymentStreamMessagesFunction,
2435
+ ),
2436
+ );
2437
+ }
2438
+
2439
+ /** @internal */
2440
+ export type DeploymentStreamMessagesToolCalls$Outbound = {
2441
+ id: string;
2442
+ type: string;
2443
+ function: DeploymentStreamMessagesFunction$Outbound;
2444
+ thought_signature?: string | undefined;
2445
+ };
2446
+
2447
+ /** @internal */
2448
+ export const DeploymentStreamMessagesToolCalls$outboundSchema: z.ZodType<
2449
+ DeploymentStreamMessagesToolCalls$Outbound,
2450
+ z.ZodTypeDef,
2451
+ DeploymentStreamMessagesToolCalls
2452
+ > = z.object({
2453
+ id: z.string(),
2454
+ type: DeploymentStreamMessagesType$outboundSchema,
2455
+ function: z.lazy(() => DeploymentStreamMessagesFunction$outboundSchema),
2456
+ thoughtSignature: z.string().optional(),
2457
+ }).transform((v) => {
2458
+ return remap$(v, {
2459
+ thoughtSignature: "thought_signature",
2460
+ });
2461
+ });
2462
+
2463
+ export function deploymentStreamMessagesToolCallsToJSON(
2464
+ deploymentStreamMessagesToolCalls: DeploymentStreamMessagesToolCalls,
2465
+ ): string {
2466
+ return JSON.stringify(
2467
+ DeploymentStreamMessagesToolCalls$outboundSchema.parse(
2468
+ deploymentStreamMessagesToolCalls,
2469
+ ),
2470
+ );
2471
+ }
2472
+
2473
+ /** @internal */
2474
+ export type DeploymentStreamMessagesAssistantMessage$Outbound = {
2475
+ content?:
2476
+ | string
2477
+ | Array<
2478
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
2479
+ | components.RefusalPartSchema$Outbound
2480
+ | components.ReasoningPartSchema$Outbound
2481
+ | components.RedactedReasoningPartSchema$Outbound
2482
+ >
2483
+ | null
2484
+ | undefined;
2485
+ refusal?: string | null | undefined;
2486
+ role: "assistant";
2487
+ name?: string | undefined;
2488
+ audio?: DeploymentStreamMessagesAudio$Outbound | null | undefined;
2489
+ tool_calls?: Array<DeploymentStreamMessagesToolCalls$Outbound> | undefined;
2490
+ };
2491
+
2492
+ /** @internal */
2493
+ export const DeploymentStreamMessagesAssistantMessage$outboundSchema: z.ZodType<
2494
+ DeploymentStreamMessagesAssistantMessage$Outbound,
2495
+ z.ZodTypeDef,
2496
+ DeploymentStreamMessagesAssistantMessage
2497
+ > = z.object({
2498
+ content: z.nullable(
2499
+ z.union([
2500
+ z.string(),
2501
+ z.array(
2502
+ z.union([
2503
+ components.TextContentPartSchema$outboundSchema.and(
2504
+ z.object({ type: z.literal("text") }),
2505
+ ),
2506
+ components.RefusalPartSchema$outboundSchema,
2507
+ components.ReasoningPartSchema$outboundSchema,
2508
+ components.RedactedReasoningPartSchema$outboundSchema,
2509
+ ]),
2510
+ ),
2511
+ ]),
2512
+ ).optional(),
2513
+ refusal: z.nullable(z.string()).optional(),
2514
+ role: z.literal("assistant"),
2515
+ name: z.string().optional(),
2516
+ audio: z.nullable(z.lazy(() => DeploymentStreamMessagesAudio$outboundSchema))
2517
+ .optional(),
2518
+ toolCalls: z.array(
2519
+ z.lazy(() => DeploymentStreamMessagesToolCalls$outboundSchema),
2520
+ ).optional(),
2521
+ }).transform((v) => {
2522
+ return remap$(v, {
2523
+ toolCalls: "tool_calls",
2524
+ });
2525
+ });
2526
+
2527
+ export function deploymentStreamMessagesAssistantMessageToJSON(
2528
+ deploymentStreamMessagesAssistantMessage:
2529
+ DeploymentStreamMessagesAssistantMessage,
2530
+ ): string {
2531
+ return JSON.stringify(
2532
+ DeploymentStreamMessagesAssistantMessage$outboundSchema.parse(
2533
+ deploymentStreamMessagesAssistantMessage,
2534
+ ),
2535
+ );
2536
+ }
2537
+
2538
+ /** @internal */
2539
+ export const DeploymentStream2DeploymentsRequestRequestBodyType$outboundSchema:
2540
+ z.ZodNativeEnum<typeof DeploymentStream2DeploymentsRequestRequestBodyType> = z
2541
+ .nativeEnum(DeploymentStream2DeploymentsRequestRequestBodyType);
2542
+
2543
+ /** @internal */
2544
+ export const DeploymentStream2DeploymentsTtl$outboundSchema: z.ZodNativeEnum<
2545
+ typeof DeploymentStream2DeploymentsTtl
2546
+ > = z.nativeEnum(DeploymentStream2DeploymentsTtl);
2547
+
2548
+ /** @internal */
2549
+ export type DeploymentStream2DeploymentsCacheControl$Outbound = {
2550
+ type: string;
2551
+ ttl: string;
2552
+ };
2553
+
2554
+ /** @internal */
2555
+ export const DeploymentStream2DeploymentsCacheControl$outboundSchema: z.ZodType<
2556
+ DeploymentStream2DeploymentsCacheControl$Outbound,
2557
+ z.ZodTypeDef,
2558
+ DeploymentStream2DeploymentsCacheControl
2559
+ > = z.object({
2560
+ type: DeploymentStream2DeploymentsRequestRequestBodyType$outboundSchema,
2561
+ ttl: DeploymentStream2DeploymentsTtl$outboundSchema.default("5m"),
2562
+ });
2563
+
2564
+ export function deploymentStream2DeploymentsCacheControlToJSON(
2565
+ deploymentStream2DeploymentsCacheControl:
2566
+ DeploymentStream2DeploymentsCacheControl,
2567
+ ): string {
2568
+ return JSON.stringify(
2569
+ DeploymentStream2DeploymentsCacheControl$outboundSchema.parse(
2570
+ deploymentStream2DeploymentsCacheControl,
2571
+ ),
2572
+ );
2573
+ }
2574
+
2575
+ /** @internal */
2576
+ export type DeploymentStream2Deployments4$Outbound = {
2577
+ type: "file";
2578
+ cache_control?: DeploymentStream2DeploymentsCacheControl$Outbound | undefined;
2579
+ file: components.FileContentPartSchema$Outbound;
2580
+ };
2581
+
2582
+ /** @internal */
2583
+ export const DeploymentStream2Deployments4$outboundSchema: z.ZodType<
2584
+ DeploymentStream2Deployments4$Outbound,
2585
+ z.ZodTypeDef,
2586
+ DeploymentStream2Deployments4
2587
+ > = z.object({
2588
+ type: z.literal("file"),
2589
+ cacheControl: z.lazy(() =>
2590
+ DeploymentStream2DeploymentsCacheControl$outboundSchema
2591
+ ).optional(),
2592
+ file: components.FileContentPartSchema$outboundSchema,
2593
+ }).transform((v) => {
2594
+ return remap$(v, {
2595
+ cacheControl: "cache_control",
2596
+ });
2597
+ });
2598
+
2599
+ export function deploymentStream2Deployments4ToJSON(
2600
+ deploymentStream2Deployments4: DeploymentStream2Deployments4,
2601
+ ): string {
2602
+ return JSON.stringify(
2603
+ DeploymentStream2Deployments4$outboundSchema.parse(
2604
+ deploymentStream2Deployments4,
2605
+ ),
2606
+ );
2607
+ }
2608
+
2609
+ /** @internal */
2610
+ export type DeploymentStreamContentDeploymentsRequestRequestBody2$Outbound =
2611
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
2612
+ | components.ImageContentPartSchema$Outbound
2613
+ | components.AudioContentPartSchema$Outbound
2614
+ | DeploymentStream2Deployments4$Outbound;
2615
+
2616
+ /** @internal */
2617
+ export const DeploymentStreamContentDeploymentsRequestRequestBody2$outboundSchema:
2618
+ z.ZodType<
2619
+ DeploymentStreamContentDeploymentsRequestRequestBody2$Outbound,
2620
+ z.ZodTypeDef,
2621
+ DeploymentStreamContentDeploymentsRequestRequestBody2
2622
+ > = z.union([
2623
+ components.TextContentPartSchema$outboundSchema.and(
2624
+ z.object({ type: z.literal("text") }),
2625
+ ),
2626
+ components.ImageContentPartSchema$outboundSchema,
2627
+ components.AudioContentPartSchema$outboundSchema,
2628
+ z.lazy(() => DeploymentStream2Deployments4$outboundSchema),
2629
+ ]);
2630
+
2631
+ export function deploymentStreamContentDeploymentsRequestRequestBody2ToJSON(
2632
+ deploymentStreamContentDeploymentsRequestRequestBody2:
2633
+ DeploymentStreamContentDeploymentsRequestRequestBody2,
2634
+ ): string {
2635
+ return JSON.stringify(
2636
+ DeploymentStreamContentDeploymentsRequestRequestBody2$outboundSchema.parse(
2637
+ deploymentStreamContentDeploymentsRequestRequestBody2,
2638
+ ),
2639
+ );
2640
+ }
2641
+
2642
+ /** @internal */
2643
+ export type DeploymentStreamMessagesDeploymentsRequestContent$Outbound =
2644
+ | string
2645
+ | Array<
2646
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
2647
+ | components.ImageContentPartSchema$Outbound
2648
+ | components.AudioContentPartSchema$Outbound
2649
+ | DeploymentStream2Deployments4$Outbound
2650
+ >;
2651
+
2652
+ /** @internal */
2653
+ export const DeploymentStreamMessagesDeploymentsRequestContent$outboundSchema:
2654
+ z.ZodType<
2655
+ DeploymentStreamMessagesDeploymentsRequestContent$Outbound,
2656
+ z.ZodTypeDef,
2657
+ DeploymentStreamMessagesDeploymentsRequestContent
2658
+ > = z.union([
2659
+ z.string(),
2660
+ z.array(
2661
+ z.union([
2662
+ components.TextContentPartSchema$outboundSchema.and(
2663
+ z.object({ type: z.literal("text") }),
2664
+ ),
2665
+ components.ImageContentPartSchema$outboundSchema,
2666
+ components.AudioContentPartSchema$outboundSchema,
2667
+ z.lazy(() => DeploymentStream2Deployments4$outboundSchema),
2668
+ ]),
2669
+ ),
2670
+ ]);
2671
+
2672
+ export function deploymentStreamMessagesDeploymentsRequestContentToJSON(
2673
+ deploymentStreamMessagesDeploymentsRequestContent:
2674
+ DeploymentStreamMessagesDeploymentsRequestContent,
2675
+ ): string {
2676
+ return JSON.stringify(
2677
+ DeploymentStreamMessagesDeploymentsRequestContent$outboundSchema.parse(
2678
+ deploymentStreamMessagesDeploymentsRequestContent,
2679
+ ),
2680
+ );
2681
+ }
2682
+
2683
+ /** @internal */
2684
+ export type DeploymentStreamMessagesUserMessage$Outbound = {
2685
+ role: "user";
2686
+ name?: string | undefined;
2687
+ content:
2688
+ | string
2689
+ | Array<
2690
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
2691
+ | components.ImageContentPartSchema$Outbound
2692
+ | components.AudioContentPartSchema$Outbound
2693
+ | DeploymentStream2Deployments4$Outbound
2694
+ >;
2695
+ };
2696
+
2697
+ /** @internal */
2698
+ export const DeploymentStreamMessagesUserMessage$outboundSchema: z.ZodType<
2699
+ DeploymentStreamMessagesUserMessage$Outbound,
2700
+ z.ZodTypeDef,
2701
+ DeploymentStreamMessagesUserMessage
2702
+ > = z.object({
2703
+ role: z.literal("user"),
2704
+ name: z.string().optional(),
2705
+ content: z.union([
2706
+ z.string(),
2707
+ z.array(
2708
+ z.union([
2709
+ components.TextContentPartSchema$outboundSchema.and(
2710
+ z.object({ type: z.literal("text") }),
2711
+ ),
2712
+ components.ImageContentPartSchema$outboundSchema,
2713
+ components.AudioContentPartSchema$outboundSchema,
2714
+ z.lazy(() => DeploymentStream2Deployments4$outboundSchema),
2715
+ ]),
2716
+ ),
2717
+ ]),
2718
+ });
2719
+
2720
+ export function deploymentStreamMessagesUserMessageToJSON(
2721
+ deploymentStreamMessagesUserMessage: DeploymentStreamMessagesUserMessage,
2722
+ ): string {
2723
+ return JSON.stringify(
2724
+ DeploymentStreamMessagesUserMessage$outboundSchema.parse(
2725
+ deploymentStreamMessagesUserMessage,
2726
+ ),
2727
+ );
2728
+ }
2729
+
2730
+ /** @internal */
2731
+ export type DeploymentStreamMessagesDeploymentsContent$Outbound =
2732
+ | string
2733
+ | Array<components.TextContentPartSchema$Outbound>;
2734
+
2735
+ /** @internal */
2736
+ export const DeploymentStreamMessagesDeploymentsContent$outboundSchema:
2737
+ z.ZodType<
2738
+ DeploymentStreamMessagesDeploymentsContent$Outbound,
2739
+ z.ZodTypeDef,
2740
+ DeploymentStreamMessagesDeploymentsContent
2741
+ > = z.union([
2742
+ z.string(),
2743
+ z.array(components.TextContentPartSchema$outboundSchema),
2744
+ ]);
2745
+
2746
+ export function deploymentStreamMessagesDeploymentsContentToJSON(
2747
+ deploymentStreamMessagesDeploymentsContent:
2748
+ DeploymentStreamMessagesDeploymentsContent,
2749
+ ): string {
2750
+ return JSON.stringify(
2751
+ DeploymentStreamMessagesDeploymentsContent$outboundSchema.parse(
2752
+ deploymentStreamMessagesDeploymentsContent,
2753
+ ),
2754
+ );
2755
+ }
2756
+
2757
+ /** @internal */
2758
+ export type DeploymentStreamMessagesDeveloperMessage$Outbound = {
2759
+ role: "developer";
2760
+ content: string | Array<components.TextContentPartSchema$Outbound>;
2761
+ name?: string | undefined;
2762
+ };
2763
+
2764
+ /** @internal */
2765
+ export const DeploymentStreamMessagesDeveloperMessage$outboundSchema: z.ZodType<
2766
+ DeploymentStreamMessagesDeveloperMessage$Outbound,
2767
+ z.ZodTypeDef,
2768
+ DeploymentStreamMessagesDeveloperMessage
2769
+ > = z.object({
2770
+ role: z.literal("developer"),
2771
+ content: z.union([
2772
+ z.string(),
2773
+ z.array(components.TextContentPartSchema$outboundSchema),
2774
+ ]),
2775
+ name: z.string().optional(),
2776
+ });
2777
+
2778
+ export function deploymentStreamMessagesDeveloperMessageToJSON(
2779
+ deploymentStreamMessagesDeveloperMessage:
2780
+ DeploymentStreamMessagesDeveloperMessage,
2781
+ ): string {
2782
+ return JSON.stringify(
2783
+ DeploymentStreamMessagesDeveloperMessage$outboundSchema.parse(
2784
+ deploymentStreamMessagesDeveloperMessage,
2785
+ ),
2786
+ );
2787
+ }
2788
+
2789
+ /** @internal */
2790
+ export type DeploymentStreamMessagesContent$Outbound =
2791
+ | string
2792
+ | Array<components.TextContentPartSchema$Outbound>;
2793
+
2794
+ /** @internal */
2795
+ export const DeploymentStreamMessagesContent$outboundSchema: z.ZodType<
2796
+ DeploymentStreamMessagesContent$Outbound,
2797
+ z.ZodTypeDef,
2798
+ DeploymentStreamMessagesContent
2799
+ > = z.union([
2800
+ z.string(),
2801
+ z.array(components.TextContentPartSchema$outboundSchema),
2802
+ ]);
2803
+
2804
+ export function deploymentStreamMessagesContentToJSON(
2805
+ deploymentStreamMessagesContent: DeploymentStreamMessagesContent,
2806
+ ): string {
2807
+ return JSON.stringify(
2808
+ DeploymentStreamMessagesContent$outboundSchema.parse(
2809
+ deploymentStreamMessagesContent,
2810
+ ),
2811
+ );
2812
+ }
2813
+
2814
+ /** @internal */
2815
+ export type DeploymentStreamMessagesSystemMessage$Outbound = {
2816
+ role: "system";
2817
+ content: string | Array<components.TextContentPartSchema$Outbound>;
2818
+ name?: string | undefined;
2819
+ };
2820
+
2821
+ /** @internal */
2822
+ export const DeploymentStreamMessagesSystemMessage$outboundSchema: z.ZodType<
2823
+ DeploymentStreamMessagesSystemMessage$Outbound,
2824
+ z.ZodTypeDef,
2825
+ DeploymentStreamMessagesSystemMessage
2826
+ > = z.object({
2827
+ role: z.literal("system"),
2828
+ content: z.union([
2829
+ z.string(),
2830
+ z.array(components.TextContentPartSchema$outboundSchema),
2831
+ ]),
2832
+ name: z.string().optional(),
2833
+ });
2834
+
2835
+ export function deploymentStreamMessagesSystemMessageToJSON(
2836
+ deploymentStreamMessagesSystemMessage: DeploymentStreamMessagesSystemMessage,
2837
+ ): string {
2838
+ return JSON.stringify(
2839
+ DeploymentStreamMessagesSystemMessage$outboundSchema.parse(
2840
+ deploymentStreamMessagesSystemMessage,
2841
+ ),
2842
+ );
2843
+ }
2844
+
2845
+ /** @internal */
2846
+ export type DeploymentStreamMessages$Outbound =
2847
+ | DeploymentStreamMessagesSystemMessage$Outbound
2848
+ | DeploymentStreamMessagesDeveloperMessage$Outbound
2849
+ | DeploymentStreamMessagesUserMessage$Outbound
2850
+ | DeploymentStreamMessagesAssistantMessage$Outbound
2851
+ | DeploymentStreamMessagesToolMessage$Outbound;
2852
+
2853
+ /** @internal */
2854
+ export const DeploymentStreamMessages$outboundSchema: z.ZodType<
2855
+ DeploymentStreamMessages$Outbound,
2856
+ z.ZodTypeDef,
2857
+ DeploymentStreamMessages
2858
+ > = z.union([
2859
+ z.lazy(() => DeploymentStreamMessagesSystemMessage$outboundSchema),
2860
+ z.lazy(() => DeploymentStreamMessagesDeveloperMessage$outboundSchema),
2861
+ z.lazy(() => DeploymentStreamMessagesUserMessage$outboundSchema),
2862
+ z.lazy(() => DeploymentStreamMessagesAssistantMessage$outboundSchema),
2863
+ z.lazy(() => DeploymentStreamMessagesToolMessage$outboundSchema),
2864
+ ]);
2865
+
2866
+ export function deploymentStreamMessagesToJSON(
2867
+ deploymentStreamMessages: DeploymentStreamMessages,
2868
+ ): string {
2869
+ return JSON.stringify(
2870
+ DeploymentStreamMessages$outboundSchema.parse(deploymentStreamMessages),
2871
+ );
2872
+ }
2873
+
2874
+ /** @internal */
2875
+ export type DeploymentStreamMetadata$Outbound = {
2876
+ file_name?: string | undefined;
2877
+ file_type?: string | undefined;
2878
+ page_number?: number | undefined;
2879
+ };
2880
+
2881
+ /** @internal */
2882
+ export const DeploymentStreamMetadata$outboundSchema: z.ZodType<
2883
+ DeploymentStreamMetadata$Outbound,
2884
+ z.ZodTypeDef,
2885
+ DeploymentStreamMetadata
2886
+ > = z.object({
2887
+ fileName: z.string().optional(),
2888
+ fileType: z.string().optional(),
2889
+ pageNumber: z.number().optional(),
2890
+ }).transform((v) => {
2891
+ return remap$(v, {
2892
+ fileName: "file_name",
2893
+ fileType: "file_type",
2894
+ pageNumber: "page_number",
2895
+ });
2896
+ });
2897
+
2898
+ export function deploymentStreamMetadataToJSON(
2899
+ deploymentStreamMetadata: DeploymentStreamMetadata,
2900
+ ): string {
2901
+ return JSON.stringify(
2902
+ DeploymentStreamMetadata$outboundSchema.parse(deploymentStreamMetadata),
2903
+ );
2904
+ }
2905
+
2906
+ /** @internal */
2907
+ export type DeploymentStreamDocuments$Outbound = {
2908
+ text: string;
2909
+ metadata?: DeploymentStreamMetadata$Outbound | undefined;
2910
+ };
2911
+
2912
+ /** @internal */
2913
+ export const DeploymentStreamDocuments$outboundSchema: z.ZodType<
2914
+ DeploymentStreamDocuments$Outbound,
2915
+ z.ZodTypeDef,
2916
+ DeploymentStreamDocuments
2917
+ > = z.object({
2918
+ text: z.string(),
2919
+ metadata: z.lazy(() => DeploymentStreamMetadata$outboundSchema).optional(),
2920
+ });
2921
+
2922
+ export function deploymentStreamDocumentsToJSON(
2923
+ deploymentStreamDocuments: DeploymentStreamDocuments,
2924
+ ): string {
2925
+ return JSON.stringify(
2926
+ DeploymentStreamDocuments$outboundSchema.parse(deploymentStreamDocuments),
2927
+ );
2928
+ }
2929
+
2930
+ /** @internal */
2931
+ export type DeploymentStreamInvokeOptions$Outbound = {
2932
+ include_retrievals: boolean;
2933
+ include_usage: boolean;
2934
+ mock_response?: string | undefined;
2935
+ };
2936
+
2937
+ /** @internal */
2938
+ export const DeploymentStreamInvokeOptions$outboundSchema: z.ZodType<
2939
+ DeploymentStreamInvokeOptions$Outbound,
2940
+ z.ZodTypeDef,
2941
+ DeploymentStreamInvokeOptions
2942
+ > = z.object({
2943
+ includeRetrievals: z.boolean().default(false),
2944
+ includeUsage: z.boolean().default(false),
2945
+ mockResponse: z.string().optional(),
2946
+ }).transform((v) => {
2947
+ return remap$(v, {
2948
+ includeRetrievals: "include_retrievals",
2949
+ includeUsage: "include_usage",
2950
+ mockResponse: "mock_response",
2951
+ });
2952
+ });
2953
+
2954
+ export function deploymentStreamInvokeOptionsToJSON(
2955
+ deploymentStreamInvokeOptions: DeploymentStreamInvokeOptions,
2956
+ ): string {
2957
+ return JSON.stringify(
2958
+ DeploymentStreamInvokeOptions$outboundSchema.parse(
2959
+ deploymentStreamInvokeOptions,
2960
+ ),
2961
+ );
2962
+ }
2963
+
2964
+ /** @internal */
2965
+ export type DeploymentStreamThread$Outbound = {
2966
+ id: string;
2967
+ tags?: Array<string> | undefined;
2968
+ };
2969
+
2970
+ /** @internal */
2971
+ export const DeploymentStreamThread$outboundSchema: z.ZodType<
2972
+ DeploymentStreamThread$Outbound,
2973
+ z.ZodTypeDef,
2974
+ DeploymentStreamThread
2975
+ > = z.object({
2976
+ id: z.string(),
2977
+ tags: z.array(z.string()).optional(),
2978
+ });
2979
+
2980
+ export function deploymentStreamThreadToJSON(
2981
+ deploymentStreamThread: DeploymentStreamThread,
2982
+ ): string {
2983
+ return JSON.stringify(
2984
+ DeploymentStreamThread$outboundSchema.parse(deploymentStreamThread),
2985
+ );
2986
+ }
2987
+
2988
+ /** @internal */
2989
+ export type DeploymentStreamOrExists$Outbound = {
2990
+ exists: boolean;
2991
+ };
2992
+
2993
+ /** @internal */
2994
+ export const DeploymentStreamOrExists$outboundSchema: z.ZodType<
2995
+ DeploymentStreamOrExists$Outbound,
2996
+ z.ZodTypeDef,
2997
+ DeploymentStreamOrExists
2998
+ > = z.object({
2999
+ exists: z.boolean(),
3000
+ });
3001
+
3002
+ export function deploymentStreamOrExistsToJSON(
3003
+ deploymentStreamOrExists: DeploymentStreamOrExists,
3004
+ ): string {
3005
+ return JSON.stringify(
3006
+ DeploymentStreamOrExists$outboundSchema.parse(deploymentStreamOrExists),
3007
+ );
3008
+ }
3009
+
3010
+ /** @internal */
3011
+ export type DeploymentStreamOrDeploymentsNin$Outbound =
3012
+ | string
3013
+ | number
3014
+ | boolean;
3015
+
3016
+ /** @internal */
3017
+ export const DeploymentStreamOrDeploymentsNin$outboundSchema: z.ZodType<
3018
+ DeploymentStreamOrDeploymentsNin$Outbound,
3019
+ z.ZodTypeDef,
3020
+ DeploymentStreamOrDeploymentsNin
3021
+ > = z.union([z.string(), z.number(), z.boolean()]);
3022
+
3023
+ export function deploymentStreamOrDeploymentsNinToJSON(
3024
+ deploymentStreamOrDeploymentsNin: DeploymentStreamOrDeploymentsNin,
3025
+ ): string {
3026
+ return JSON.stringify(
3027
+ DeploymentStreamOrDeploymentsNin$outboundSchema.parse(
3028
+ deploymentStreamOrDeploymentsNin,
3029
+ ),
3030
+ );
3031
+ }
3032
+
3033
+ /** @internal */
3034
+ export type DeploymentStreamOrNin$Outbound = {
3035
+ nin: Array<string | number | boolean>;
3036
+ };
3037
+
3038
+ /** @internal */
3039
+ export const DeploymentStreamOrNin$outboundSchema: z.ZodType<
3040
+ DeploymentStreamOrNin$Outbound,
3041
+ z.ZodTypeDef,
3042
+ DeploymentStreamOrNin
3043
+ > = z.object({
3044
+ nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
3045
+ });
3046
+
3047
+ export function deploymentStreamOrNinToJSON(
3048
+ deploymentStreamOrNin: DeploymentStreamOrNin,
3049
+ ): string {
3050
+ return JSON.stringify(
3051
+ DeploymentStreamOrNin$outboundSchema.parse(deploymentStreamOrNin),
3052
+ );
3053
+ }
3054
+
3055
+ /** @internal */
3056
+ export type DeploymentStreamOrDeploymentsIn$Outbound =
3057
+ | string
3058
+ | number
3059
+ | boolean;
3060
+
3061
+ /** @internal */
3062
+ export const DeploymentStreamOrDeploymentsIn$outboundSchema: z.ZodType<
3063
+ DeploymentStreamOrDeploymentsIn$Outbound,
3064
+ z.ZodTypeDef,
3065
+ DeploymentStreamOrDeploymentsIn
3066
+ > = z.union([z.string(), z.number(), z.boolean()]);
3067
+
3068
+ export function deploymentStreamOrDeploymentsInToJSON(
3069
+ deploymentStreamOrDeploymentsIn: DeploymentStreamOrDeploymentsIn,
3070
+ ): string {
3071
+ return JSON.stringify(
3072
+ DeploymentStreamOrDeploymentsIn$outboundSchema.parse(
3073
+ deploymentStreamOrDeploymentsIn,
3074
+ ),
3075
+ );
3076
+ }
3077
+
3078
+ /** @internal */
3079
+ export type DeploymentStreamOrIn$Outbound = {
3080
+ in: Array<string | number | boolean>;
3081
+ };
3082
+
3083
+ /** @internal */
3084
+ export const DeploymentStreamOrIn$outboundSchema: z.ZodType<
3085
+ DeploymentStreamOrIn$Outbound,
3086
+ z.ZodTypeDef,
3087
+ DeploymentStreamOrIn
3088
+ > = z.object({
3089
+ in: z.array(z.union([z.string(), z.number(), z.boolean()])),
3090
+ });
3091
+
3092
+ export function deploymentStreamOrInToJSON(
3093
+ deploymentStreamOrIn: DeploymentStreamOrIn,
3094
+ ): string {
3095
+ return JSON.stringify(
3096
+ DeploymentStreamOrIn$outboundSchema.parse(deploymentStreamOrIn),
3097
+ );
3098
+ }
3099
+
3100
+ /** @internal */
3101
+ export type DeploymentStreamOrLte$Outbound = {
3102
+ lte: number;
3103
+ };
3104
+
3105
+ /** @internal */
3106
+ export const DeploymentStreamOrLte$outboundSchema: z.ZodType<
3107
+ DeploymentStreamOrLte$Outbound,
3108
+ z.ZodTypeDef,
3109
+ DeploymentStreamOrLte
3110
+ > = z.object({
3111
+ lte: z.number(),
3112
+ });
3113
+
3114
+ export function deploymentStreamOrLteToJSON(
3115
+ deploymentStreamOrLte: DeploymentStreamOrLte,
3116
+ ): string {
3117
+ return JSON.stringify(
3118
+ DeploymentStreamOrLte$outboundSchema.parse(deploymentStreamOrLte),
3119
+ );
3120
+ }
3121
+
3122
+ /** @internal */
3123
+ export type DeploymentStreamOrLt$Outbound = {
3124
+ lt: number;
3125
+ };
3126
+
3127
+ /** @internal */
3128
+ export const DeploymentStreamOrLt$outboundSchema: z.ZodType<
3129
+ DeploymentStreamOrLt$Outbound,
3130
+ z.ZodTypeDef,
3131
+ DeploymentStreamOrLt
3132
+ > = z.object({
3133
+ lt: z.number(),
3134
+ });
3135
+
3136
+ export function deploymentStreamOrLtToJSON(
3137
+ deploymentStreamOrLt: DeploymentStreamOrLt,
3138
+ ): string {
3139
+ return JSON.stringify(
3140
+ DeploymentStreamOrLt$outboundSchema.parse(deploymentStreamOrLt),
3141
+ );
3142
+ }
3143
+
3144
+ /** @internal */
3145
+ export type DeploymentStreamOrGte$Outbound = {
3146
+ gte: number;
3147
+ };
3148
+
3149
+ /** @internal */
3150
+ export const DeploymentStreamOrGte$outboundSchema: z.ZodType<
3151
+ DeploymentStreamOrGte$Outbound,
3152
+ z.ZodTypeDef,
3153
+ DeploymentStreamOrGte
3154
+ > = z.object({
3155
+ gte: z.number(),
3156
+ });
3157
+
3158
+ export function deploymentStreamOrGteToJSON(
3159
+ deploymentStreamOrGte: DeploymentStreamOrGte,
3160
+ ): string {
3161
+ return JSON.stringify(
3162
+ DeploymentStreamOrGte$outboundSchema.parse(deploymentStreamOrGte),
3163
+ );
3164
+ }
3165
+
3166
+ /** @internal */
3167
+ export type DeploymentStreamOrGt$Outbound = {
3168
+ gt: number;
3169
+ };
3170
+
3171
+ /** @internal */
3172
+ export const DeploymentStreamOrGt$outboundSchema: z.ZodType<
3173
+ DeploymentStreamOrGt$Outbound,
3174
+ z.ZodTypeDef,
3175
+ DeploymentStreamOrGt
3176
+ > = z.object({
3177
+ gt: z.number(),
3178
+ });
3179
+
3180
+ export function deploymentStreamOrGtToJSON(
3181
+ deploymentStreamOrGt: DeploymentStreamOrGt,
3182
+ ): string {
3183
+ return JSON.stringify(
3184
+ DeploymentStreamOrGt$outboundSchema.parse(deploymentStreamOrGt),
3185
+ );
3186
+ }
3187
+
3188
+ /** @internal */
3189
+ export type DeploymentStreamOrDeploymentsNe$Outbound =
3190
+ | string
3191
+ | number
3192
+ | boolean;
3193
+
3194
+ /** @internal */
3195
+ export const DeploymentStreamOrDeploymentsNe$outboundSchema: z.ZodType<
3196
+ DeploymentStreamOrDeploymentsNe$Outbound,
3197
+ z.ZodTypeDef,
3198
+ DeploymentStreamOrDeploymentsNe
3199
+ > = z.union([z.string(), z.number(), z.boolean()]);
3200
+
3201
+ export function deploymentStreamOrDeploymentsNeToJSON(
3202
+ deploymentStreamOrDeploymentsNe: DeploymentStreamOrDeploymentsNe,
3203
+ ): string {
3204
+ return JSON.stringify(
3205
+ DeploymentStreamOrDeploymentsNe$outboundSchema.parse(
3206
+ deploymentStreamOrDeploymentsNe,
3207
+ ),
3208
+ );
3209
+ }
3210
+
3211
+ /** @internal */
3212
+ export type DeploymentStreamOrNe$Outbound = {
3213
+ ne: string | number | boolean;
3214
+ };
3215
+
3216
+ /** @internal */
3217
+ export const DeploymentStreamOrNe$outboundSchema: z.ZodType<
3218
+ DeploymentStreamOrNe$Outbound,
3219
+ z.ZodTypeDef,
3220
+ DeploymentStreamOrNe
3221
+ > = z.object({
3222
+ ne: z.union([z.string(), z.number(), z.boolean()]),
3223
+ });
3224
+
3225
+ export function deploymentStreamOrNeToJSON(
3226
+ deploymentStreamOrNe: DeploymentStreamOrNe,
3227
+ ): string {
3228
+ return JSON.stringify(
3229
+ DeploymentStreamOrNe$outboundSchema.parse(deploymentStreamOrNe),
3230
+ );
3231
+ }
3232
+
3233
+ /** @internal */
3234
+ export type DeploymentStreamOrDeploymentsEq$Outbound =
3235
+ | string
3236
+ | number
3237
+ | boolean;
3238
+
3239
+ /** @internal */
3240
+ export const DeploymentStreamOrDeploymentsEq$outboundSchema: z.ZodType<
3241
+ DeploymentStreamOrDeploymentsEq$Outbound,
3242
+ z.ZodTypeDef,
3243
+ DeploymentStreamOrDeploymentsEq
3244
+ > = z.union([z.string(), z.number(), z.boolean()]);
3245
+
3246
+ export function deploymentStreamOrDeploymentsEqToJSON(
3247
+ deploymentStreamOrDeploymentsEq: DeploymentStreamOrDeploymentsEq,
3248
+ ): string {
3249
+ return JSON.stringify(
3250
+ DeploymentStreamOrDeploymentsEq$outboundSchema.parse(
3251
+ deploymentStreamOrDeploymentsEq,
3252
+ ),
3253
+ );
3254
+ }
3255
+
3256
+ /** @internal */
3257
+ export type DeploymentStreamOrEq$Outbound = {
3258
+ eq: string | number | boolean;
3259
+ };
3260
+
3261
+ /** @internal */
3262
+ export const DeploymentStreamOrEq$outboundSchema: z.ZodType<
3263
+ DeploymentStreamOrEq$Outbound,
3264
+ z.ZodTypeDef,
3265
+ DeploymentStreamOrEq
3266
+ > = z.object({
3267
+ eq: z.union([z.string(), z.number(), z.boolean()]),
3268
+ });
3269
+
3270
+ export function deploymentStreamOrEqToJSON(
3271
+ deploymentStreamOrEq: DeploymentStreamOrEq,
3272
+ ): string {
3273
+ return JSON.stringify(
3274
+ DeploymentStreamOrEq$outboundSchema.parse(deploymentStreamOrEq),
3275
+ );
3276
+ }
3277
+
3278
+ /** @internal */
3279
+ export type DeploymentStreamKnowledgeFilterDeploymentsOr$Outbound =
3280
+ | DeploymentStreamOrEq$Outbound
3281
+ | DeploymentStreamOrNe$Outbound
3282
+ | DeploymentStreamOrGt$Outbound
3283
+ | DeploymentStreamOrGte$Outbound
3284
+ | DeploymentStreamOrLt$Outbound
3285
+ | DeploymentStreamOrLte$Outbound
3286
+ | DeploymentStreamOrIn$Outbound
3287
+ | DeploymentStreamOrNin$Outbound
3288
+ | DeploymentStreamOrExists$Outbound;
3289
+
3290
+ /** @internal */
3291
+ export const DeploymentStreamKnowledgeFilterDeploymentsOr$outboundSchema:
3292
+ z.ZodType<
3293
+ DeploymentStreamKnowledgeFilterDeploymentsOr$Outbound,
3294
+ z.ZodTypeDef,
3295
+ DeploymentStreamKnowledgeFilterDeploymentsOr
3296
+ > = z.union([
3297
+ z.lazy(() => DeploymentStreamOrEq$outboundSchema),
3298
+ z.lazy(() => DeploymentStreamOrNe$outboundSchema),
3299
+ z.lazy(() => DeploymentStreamOrGt$outboundSchema),
3300
+ z.lazy(() => DeploymentStreamOrGte$outboundSchema),
3301
+ z.lazy(() => DeploymentStreamOrLt$outboundSchema),
3302
+ z.lazy(() => DeploymentStreamOrLte$outboundSchema),
3303
+ z.lazy(() => DeploymentStreamOrIn$outboundSchema),
3304
+ z.lazy(() => DeploymentStreamOrNin$outboundSchema),
3305
+ z.lazy(() => DeploymentStreamOrExists$outboundSchema),
3306
+ ]);
3307
+
3308
+ export function deploymentStreamKnowledgeFilterDeploymentsOrToJSON(
3309
+ deploymentStreamKnowledgeFilterDeploymentsOr:
3310
+ DeploymentStreamKnowledgeFilterDeploymentsOr,
3311
+ ): string {
3312
+ return JSON.stringify(
3313
+ DeploymentStreamKnowledgeFilterDeploymentsOr$outboundSchema.parse(
3314
+ deploymentStreamKnowledgeFilterDeploymentsOr,
3315
+ ),
3316
+ );
3317
+ }
3318
+
3319
+ /** @internal */
3320
+ export type DeploymentStreamKnowledgeFilterOr$Outbound = {
3321
+ or: Array<
3322
+ {
3323
+ [k: string]:
3324
+ | DeploymentStreamOrEq$Outbound
3325
+ | DeploymentStreamOrNe$Outbound
3326
+ | DeploymentStreamOrGt$Outbound
3327
+ | DeploymentStreamOrGte$Outbound
3328
+ | DeploymentStreamOrLt$Outbound
3329
+ | DeploymentStreamOrLte$Outbound
3330
+ | DeploymentStreamOrIn$Outbound
3331
+ | DeploymentStreamOrNin$Outbound
3332
+ | DeploymentStreamOrExists$Outbound;
3333
+ }
3334
+ >;
3335
+ };
3336
+
3337
+ /** @internal */
3338
+ export const DeploymentStreamKnowledgeFilterOr$outboundSchema: z.ZodType<
3339
+ DeploymentStreamKnowledgeFilterOr$Outbound,
3340
+ z.ZodTypeDef,
3341
+ DeploymentStreamKnowledgeFilterOr
3342
+ > = z.object({
3343
+ or: z.array(
3344
+ z.record(z.union([
3345
+ z.lazy(() => DeploymentStreamOrEq$outboundSchema),
3346
+ z.lazy(() =>
3347
+ DeploymentStreamOrNe$outboundSchema
3348
+ ),
3349
+ z.lazy(() => DeploymentStreamOrGt$outboundSchema),
3350
+ z.lazy(() => DeploymentStreamOrGte$outboundSchema),
3351
+ z.lazy(() => DeploymentStreamOrLt$outboundSchema),
3352
+ z.lazy(() => DeploymentStreamOrLte$outboundSchema),
3353
+ z.lazy(() => DeploymentStreamOrIn$outboundSchema),
3354
+ z.lazy(() => DeploymentStreamOrNin$outboundSchema),
3355
+ z.lazy(() => DeploymentStreamOrExists$outboundSchema),
3356
+ ])),
3357
+ ),
3358
+ });
3359
+
3360
+ export function deploymentStreamKnowledgeFilterOrToJSON(
3361
+ deploymentStreamKnowledgeFilterOr: DeploymentStreamKnowledgeFilterOr,
3362
+ ): string {
3363
+ return JSON.stringify(
3364
+ DeploymentStreamKnowledgeFilterOr$outboundSchema.parse(
3365
+ deploymentStreamKnowledgeFilterOr,
3366
+ ),
3367
+ );
3368
+ }
3369
+
3370
+ /** @internal */
3371
+ export type DeploymentStreamAndExists$Outbound = {
3372
+ exists: boolean;
3373
+ };
3374
+
3375
+ /** @internal */
3376
+ export const DeploymentStreamAndExists$outboundSchema: z.ZodType<
3377
+ DeploymentStreamAndExists$Outbound,
3378
+ z.ZodTypeDef,
3379
+ DeploymentStreamAndExists
3380
+ > = z.object({
3381
+ exists: z.boolean(),
3382
+ });
3383
+
3384
+ export function deploymentStreamAndExistsToJSON(
3385
+ deploymentStreamAndExists: DeploymentStreamAndExists,
3386
+ ): string {
3387
+ return JSON.stringify(
3388
+ DeploymentStreamAndExists$outboundSchema.parse(deploymentStreamAndExists),
3389
+ );
3390
+ }
3391
+
3392
+ /** @internal */
3393
+ export type DeploymentStreamAndDeploymentsNin$Outbound =
3394
+ | string
3395
+ | number
3396
+ | boolean;
3397
+
3398
+ /** @internal */
3399
+ export const DeploymentStreamAndDeploymentsNin$outboundSchema: z.ZodType<
3400
+ DeploymentStreamAndDeploymentsNin$Outbound,
3401
+ z.ZodTypeDef,
3402
+ DeploymentStreamAndDeploymentsNin
3403
+ > = z.union([z.string(), z.number(), z.boolean()]);
3404
+
3405
+ export function deploymentStreamAndDeploymentsNinToJSON(
3406
+ deploymentStreamAndDeploymentsNin: DeploymentStreamAndDeploymentsNin,
3407
+ ): string {
3408
+ return JSON.stringify(
3409
+ DeploymentStreamAndDeploymentsNin$outboundSchema.parse(
3410
+ deploymentStreamAndDeploymentsNin,
3411
+ ),
3412
+ );
3413
+ }
3414
+
3415
+ /** @internal */
3416
+ export type DeploymentStreamAndNin$Outbound = {
3417
+ nin: Array<string | number | boolean>;
3418
+ };
3419
+
3420
+ /** @internal */
3421
+ export const DeploymentStreamAndNin$outboundSchema: z.ZodType<
3422
+ DeploymentStreamAndNin$Outbound,
3423
+ z.ZodTypeDef,
3424
+ DeploymentStreamAndNin
3425
+ > = z.object({
3426
+ nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
3427
+ });
3428
+
3429
+ export function deploymentStreamAndNinToJSON(
3430
+ deploymentStreamAndNin: DeploymentStreamAndNin,
3431
+ ): string {
3432
+ return JSON.stringify(
3433
+ DeploymentStreamAndNin$outboundSchema.parse(deploymentStreamAndNin),
3434
+ );
3435
+ }
3436
+
3437
+ /** @internal */
3438
+ export type DeploymentStreamAndDeploymentsIn$Outbound =
3439
+ | string
3440
+ | number
3441
+ | boolean;
3442
+
3443
+ /** @internal */
3444
+ export const DeploymentStreamAndDeploymentsIn$outboundSchema: z.ZodType<
3445
+ DeploymentStreamAndDeploymentsIn$Outbound,
3446
+ z.ZodTypeDef,
3447
+ DeploymentStreamAndDeploymentsIn
3448
+ > = z.union([z.string(), z.number(), z.boolean()]);
3449
+
3450
+ export function deploymentStreamAndDeploymentsInToJSON(
3451
+ deploymentStreamAndDeploymentsIn: DeploymentStreamAndDeploymentsIn,
3452
+ ): string {
3453
+ return JSON.stringify(
3454
+ DeploymentStreamAndDeploymentsIn$outboundSchema.parse(
3455
+ deploymentStreamAndDeploymentsIn,
3456
+ ),
3457
+ );
3458
+ }
3459
+
3460
+ /** @internal */
3461
+ export type DeploymentStreamAndIn$Outbound = {
3462
+ in: Array<string | number | boolean>;
3463
+ };
3464
+
3465
+ /** @internal */
3466
+ export const DeploymentStreamAndIn$outboundSchema: z.ZodType<
3467
+ DeploymentStreamAndIn$Outbound,
3468
+ z.ZodTypeDef,
3469
+ DeploymentStreamAndIn
3470
+ > = z.object({
3471
+ in: z.array(z.union([z.string(), z.number(), z.boolean()])),
3472
+ });
3473
+
3474
+ export function deploymentStreamAndInToJSON(
3475
+ deploymentStreamAndIn: DeploymentStreamAndIn,
3476
+ ): string {
3477
+ return JSON.stringify(
3478
+ DeploymentStreamAndIn$outboundSchema.parse(deploymentStreamAndIn),
3479
+ );
3480
+ }
3481
+
3482
+ /** @internal */
3483
+ export type DeploymentStreamAndLte$Outbound = {
3484
+ lte: number;
3485
+ };
3486
+
3487
+ /** @internal */
3488
+ export const DeploymentStreamAndLte$outboundSchema: z.ZodType<
3489
+ DeploymentStreamAndLte$Outbound,
3490
+ z.ZodTypeDef,
3491
+ DeploymentStreamAndLte
3492
+ > = z.object({
3493
+ lte: z.number(),
3494
+ });
3495
+
3496
+ export function deploymentStreamAndLteToJSON(
3497
+ deploymentStreamAndLte: DeploymentStreamAndLte,
3498
+ ): string {
3499
+ return JSON.stringify(
3500
+ DeploymentStreamAndLte$outboundSchema.parse(deploymentStreamAndLte),
3501
+ );
3502
+ }
3503
+
3504
+ /** @internal */
3505
+ export type DeploymentStreamAndLt$Outbound = {
3506
+ lt: number;
3507
+ };
3508
+
3509
+ /** @internal */
3510
+ export const DeploymentStreamAndLt$outboundSchema: z.ZodType<
3511
+ DeploymentStreamAndLt$Outbound,
3512
+ z.ZodTypeDef,
3513
+ DeploymentStreamAndLt
3514
+ > = z.object({
3515
+ lt: z.number(),
3516
+ });
3517
+
3518
+ export function deploymentStreamAndLtToJSON(
3519
+ deploymentStreamAndLt: DeploymentStreamAndLt,
3520
+ ): string {
3521
+ return JSON.stringify(
3522
+ DeploymentStreamAndLt$outboundSchema.parse(deploymentStreamAndLt),
3523
+ );
3524
+ }
3525
+
3526
+ /** @internal */
3527
+ export type DeploymentStreamAndGte$Outbound = {
3528
+ gte: number;
3529
+ };
3530
+
3531
+ /** @internal */
3532
+ export const DeploymentStreamAndGte$outboundSchema: z.ZodType<
3533
+ DeploymentStreamAndGte$Outbound,
3534
+ z.ZodTypeDef,
3535
+ DeploymentStreamAndGte
3536
+ > = z.object({
3537
+ gte: z.number(),
3538
+ });
3539
+
3540
+ export function deploymentStreamAndGteToJSON(
3541
+ deploymentStreamAndGte: DeploymentStreamAndGte,
3542
+ ): string {
3543
+ return JSON.stringify(
3544
+ DeploymentStreamAndGte$outboundSchema.parse(deploymentStreamAndGte),
3545
+ );
3546
+ }
3547
+
3548
+ /** @internal */
3549
+ export type DeploymentStreamAndGt$Outbound = {
3550
+ gt: number;
3551
+ };
3552
+
3553
+ /** @internal */
3554
+ export const DeploymentStreamAndGt$outboundSchema: z.ZodType<
3555
+ DeploymentStreamAndGt$Outbound,
3556
+ z.ZodTypeDef,
3557
+ DeploymentStreamAndGt
3558
+ > = z.object({
3559
+ gt: z.number(),
3560
+ });
3561
+
3562
+ export function deploymentStreamAndGtToJSON(
3563
+ deploymentStreamAndGt: DeploymentStreamAndGt,
3564
+ ): string {
3565
+ return JSON.stringify(
3566
+ DeploymentStreamAndGt$outboundSchema.parse(deploymentStreamAndGt),
3567
+ );
3568
+ }
3569
+
3570
+ /** @internal */
3571
+ export type DeploymentStreamAndDeploymentsNe$Outbound =
3572
+ | string
3573
+ | number
3574
+ | boolean;
3575
+
3576
+ /** @internal */
3577
+ export const DeploymentStreamAndDeploymentsNe$outboundSchema: z.ZodType<
3578
+ DeploymentStreamAndDeploymentsNe$Outbound,
3579
+ z.ZodTypeDef,
3580
+ DeploymentStreamAndDeploymentsNe
3581
+ > = z.union([z.string(), z.number(), z.boolean()]);
3582
+
3583
+ export function deploymentStreamAndDeploymentsNeToJSON(
3584
+ deploymentStreamAndDeploymentsNe: DeploymentStreamAndDeploymentsNe,
3585
+ ): string {
3586
+ return JSON.stringify(
3587
+ DeploymentStreamAndDeploymentsNe$outboundSchema.parse(
3588
+ deploymentStreamAndDeploymentsNe,
3589
+ ),
3590
+ );
3591
+ }
3592
+
3593
+ /** @internal */
3594
+ export type DeploymentStreamAndNe$Outbound = {
3595
+ ne: string | number | boolean;
3596
+ };
3597
+
3598
+ /** @internal */
3599
+ export const DeploymentStreamAndNe$outboundSchema: z.ZodType<
3600
+ DeploymentStreamAndNe$Outbound,
3601
+ z.ZodTypeDef,
3602
+ DeploymentStreamAndNe
3603
+ > = z.object({
3604
+ ne: z.union([z.string(), z.number(), z.boolean()]),
3605
+ });
3606
+
3607
+ export function deploymentStreamAndNeToJSON(
3608
+ deploymentStreamAndNe: DeploymentStreamAndNe,
3609
+ ): string {
3610
+ return JSON.stringify(
3611
+ DeploymentStreamAndNe$outboundSchema.parse(deploymentStreamAndNe),
3612
+ );
3613
+ }
3614
+
3615
+ /** @internal */
3616
+ export type DeploymentStreamAndDeploymentsEq$Outbound =
3617
+ | string
3618
+ | number
3619
+ | boolean;
3620
+
3621
+ /** @internal */
3622
+ export const DeploymentStreamAndDeploymentsEq$outboundSchema: z.ZodType<
3623
+ DeploymentStreamAndDeploymentsEq$Outbound,
3624
+ z.ZodTypeDef,
3625
+ DeploymentStreamAndDeploymentsEq
3626
+ > = z.union([z.string(), z.number(), z.boolean()]);
3627
+
3628
+ export function deploymentStreamAndDeploymentsEqToJSON(
3629
+ deploymentStreamAndDeploymentsEq: DeploymentStreamAndDeploymentsEq,
3630
+ ): string {
3631
+ return JSON.stringify(
3632
+ DeploymentStreamAndDeploymentsEq$outboundSchema.parse(
3633
+ deploymentStreamAndDeploymentsEq,
3634
+ ),
3635
+ );
3636
+ }
3637
+
3638
+ /** @internal */
3639
+ export type DeploymentStreamAndEq$Outbound = {
3640
+ eq: string | number | boolean;
3641
+ };
3642
+
3643
+ /** @internal */
3644
+ export const DeploymentStreamAndEq$outboundSchema: z.ZodType<
3645
+ DeploymentStreamAndEq$Outbound,
3646
+ z.ZodTypeDef,
3647
+ DeploymentStreamAndEq
3648
+ > = z.object({
3649
+ eq: z.union([z.string(), z.number(), z.boolean()]),
3650
+ });
3651
+
3652
+ export function deploymentStreamAndEqToJSON(
3653
+ deploymentStreamAndEq: DeploymentStreamAndEq,
3654
+ ): string {
3655
+ return JSON.stringify(
3656
+ DeploymentStreamAndEq$outboundSchema.parse(deploymentStreamAndEq),
3657
+ );
3658
+ }
3659
+
3660
+ /** @internal */
3661
+ export type DeploymentStreamKnowledgeFilterDeploymentsAnd$Outbound =
3662
+ | DeploymentStreamAndEq$Outbound
3663
+ | DeploymentStreamAndNe$Outbound
3664
+ | DeploymentStreamAndGt$Outbound
3665
+ | DeploymentStreamAndGte$Outbound
3666
+ | DeploymentStreamAndLt$Outbound
3667
+ | DeploymentStreamAndLte$Outbound
3668
+ | DeploymentStreamAndIn$Outbound
3669
+ | DeploymentStreamAndNin$Outbound
3670
+ | DeploymentStreamAndExists$Outbound;
3671
+
3672
+ /** @internal */
3673
+ export const DeploymentStreamKnowledgeFilterDeploymentsAnd$outboundSchema:
3674
+ z.ZodType<
3675
+ DeploymentStreamKnowledgeFilterDeploymentsAnd$Outbound,
3676
+ z.ZodTypeDef,
3677
+ DeploymentStreamKnowledgeFilterDeploymentsAnd
3678
+ > = z.union([
3679
+ z.lazy(() => DeploymentStreamAndEq$outboundSchema),
3680
+ z.lazy(() => DeploymentStreamAndNe$outboundSchema),
3681
+ z.lazy(() => DeploymentStreamAndGt$outboundSchema),
3682
+ z.lazy(() => DeploymentStreamAndGte$outboundSchema),
3683
+ z.lazy(() => DeploymentStreamAndLt$outboundSchema),
3684
+ z.lazy(() => DeploymentStreamAndLte$outboundSchema),
3685
+ z.lazy(() => DeploymentStreamAndIn$outboundSchema),
3686
+ z.lazy(() => DeploymentStreamAndNin$outboundSchema),
3687
+ z.lazy(() => DeploymentStreamAndExists$outboundSchema),
3688
+ ]);
3689
+
3690
+ export function deploymentStreamKnowledgeFilterDeploymentsAndToJSON(
3691
+ deploymentStreamKnowledgeFilterDeploymentsAnd:
3692
+ DeploymentStreamKnowledgeFilterDeploymentsAnd,
3693
+ ): string {
3694
+ return JSON.stringify(
3695
+ DeploymentStreamKnowledgeFilterDeploymentsAnd$outboundSchema.parse(
3696
+ deploymentStreamKnowledgeFilterDeploymentsAnd,
3697
+ ),
3698
+ );
3699
+ }
3700
+
3701
+ /** @internal */
3702
+ export type DeploymentStreamKnowledgeFilterAnd$Outbound = {
3703
+ and: Array<
3704
+ {
3705
+ [k: string]:
3706
+ | DeploymentStreamAndEq$Outbound
3707
+ | DeploymentStreamAndNe$Outbound
3708
+ | DeploymentStreamAndGt$Outbound
3709
+ | DeploymentStreamAndGte$Outbound
3710
+ | DeploymentStreamAndLt$Outbound
3711
+ | DeploymentStreamAndLte$Outbound
3712
+ | DeploymentStreamAndIn$Outbound
3713
+ | DeploymentStreamAndNin$Outbound
3714
+ | DeploymentStreamAndExists$Outbound;
3715
+ }
3716
+ >;
3717
+ };
3718
+
3719
+ /** @internal */
3720
+ export const DeploymentStreamKnowledgeFilterAnd$outboundSchema: z.ZodType<
3721
+ DeploymentStreamKnowledgeFilterAnd$Outbound,
3722
+ z.ZodTypeDef,
3723
+ DeploymentStreamKnowledgeFilterAnd
3724
+ > = z.object({
3725
+ and: z.array(
3726
+ z.record(z.union([
3727
+ z.lazy(() => DeploymentStreamAndEq$outboundSchema),
3728
+ z.lazy(() =>
3729
+ DeploymentStreamAndNe$outboundSchema
3730
+ ),
3731
+ z.lazy(() => DeploymentStreamAndGt$outboundSchema),
3732
+ z.lazy(() => DeploymentStreamAndGte$outboundSchema),
3733
+ z.lazy(() => DeploymentStreamAndLt$outboundSchema),
3734
+ z.lazy(() => DeploymentStreamAndLte$outboundSchema),
3735
+ z.lazy(() => DeploymentStreamAndIn$outboundSchema),
3736
+ z.lazy(() => DeploymentStreamAndNin$outboundSchema),
3737
+ z.lazy(() => DeploymentStreamAndExists$outboundSchema),
3738
+ ])),
3739
+ ),
3740
+ });
3741
+
3742
+ export function deploymentStreamKnowledgeFilterAndToJSON(
3743
+ deploymentStreamKnowledgeFilterAnd: DeploymentStreamKnowledgeFilterAnd,
3744
+ ): string {
3745
+ return JSON.stringify(
3746
+ DeploymentStreamKnowledgeFilterAnd$outboundSchema.parse(
3747
+ deploymentStreamKnowledgeFilterAnd,
3748
+ ),
3749
+ );
3750
+ }
3751
+
3752
+ /** @internal */
3753
+ export type OneExists$Outbound = {
3754
+ exists: boolean;
3755
+ };
3756
+
3757
+ /** @internal */
3758
+ export const OneExists$outboundSchema: z.ZodType<
3759
+ OneExists$Outbound,
3760
+ z.ZodTypeDef,
3761
+ OneExists
3762
+ > = z.object({
3763
+ exists: z.boolean(),
3764
+ });
3765
+
3766
+ export function oneExistsToJSON(oneExists: OneExists): string {
3767
+ return JSON.stringify(OneExists$outboundSchema.parse(oneExists));
3768
+ }
3769
+
3770
+ /** @internal */
3771
+ export type DeploymentStream1DeploymentsNin$Outbound =
3772
+ | string
3773
+ | number
3774
+ | boolean;
3775
+
3776
+ /** @internal */
3777
+ export const DeploymentStream1DeploymentsNin$outboundSchema: z.ZodType<
3778
+ DeploymentStream1DeploymentsNin$Outbound,
3779
+ z.ZodTypeDef,
3780
+ DeploymentStream1DeploymentsNin
3781
+ > = z.union([z.string(), z.number(), z.boolean()]);
3782
+
3783
+ export function deploymentStream1DeploymentsNinToJSON(
3784
+ deploymentStream1DeploymentsNin: DeploymentStream1DeploymentsNin,
3785
+ ): string {
3786
+ return JSON.stringify(
3787
+ DeploymentStream1DeploymentsNin$outboundSchema.parse(
3788
+ deploymentStream1DeploymentsNin,
3789
+ ),
3790
+ );
3791
+ }
3792
+
3793
+ /** @internal */
3794
+ export type DeploymentStream1Nin$Outbound = {
3795
+ nin: Array<string | number | boolean>;
3796
+ };
3797
+
3798
+ /** @internal */
3799
+ export const DeploymentStream1Nin$outboundSchema: z.ZodType<
3800
+ DeploymentStream1Nin$Outbound,
3801
+ z.ZodTypeDef,
3802
+ DeploymentStream1Nin
3803
+ > = z.object({
3804
+ nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
3805
+ });
3806
+
3807
+ export function deploymentStream1NinToJSON(
3808
+ deploymentStream1Nin: DeploymentStream1Nin,
3809
+ ): string {
3810
+ return JSON.stringify(
3811
+ DeploymentStream1Nin$outboundSchema.parse(deploymentStream1Nin),
3812
+ );
3813
+ }
3814
+
3815
+ /** @internal */
3816
+ export type DeploymentStream1DeploymentsIn$Outbound = string | number | boolean;
3817
+
3818
+ /** @internal */
3819
+ export const DeploymentStream1DeploymentsIn$outboundSchema: z.ZodType<
3820
+ DeploymentStream1DeploymentsIn$Outbound,
3821
+ z.ZodTypeDef,
3822
+ DeploymentStream1DeploymentsIn
3823
+ > = z.union([z.string(), z.number(), z.boolean()]);
3824
+
3825
+ export function deploymentStream1DeploymentsInToJSON(
3826
+ deploymentStream1DeploymentsIn: DeploymentStream1DeploymentsIn,
3827
+ ): string {
3828
+ return JSON.stringify(
3829
+ DeploymentStream1DeploymentsIn$outboundSchema.parse(
3830
+ deploymentStream1DeploymentsIn,
3831
+ ),
3832
+ );
3833
+ }
3834
+
3835
+ /** @internal */
3836
+ export type DeploymentStream1In$Outbound = {
3837
+ in: Array<string | number | boolean>;
3838
+ };
3839
+
3840
+ /** @internal */
3841
+ export const DeploymentStream1In$outboundSchema: z.ZodType<
3842
+ DeploymentStream1In$Outbound,
3843
+ z.ZodTypeDef,
3844
+ DeploymentStream1In
3845
+ > = z.object({
3846
+ in: z.array(z.union([z.string(), z.number(), z.boolean()])),
3847
+ });
3848
+
3849
+ export function deploymentStream1InToJSON(
3850
+ deploymentStream1In: DeploymentStream1In,
3851
+ ): string {
3852
+ return JSON.stringify(
3853
+ DeploymentStream1In$outboundSchema.parse(deploymentStream1In),
3854
+ );
3855
+ }
3856
+
3857
+ /** @internal */
3858
+ export type OneLte$Outbound = {
3859
+ lte: number;
3860
+ };
3861
+
3862
+ /** @internal */
3863
+ export const OneLte$outboundSchema: z.ZodType<
3864
+ OneLte$Outbound,
3865
+ z.ZodTypeDef,
3866
+ OneLte
3867
+ > = z.object({
3868
+ lte: z.number(),
3869
+ });
3870
+
3871
+ export function oneLteToJSON(oneLte: OneLte): string {
3872
+ return JSON.stringify(OneLte$outboundSchema.parse(oneLte));
3873
+ }
3874
+
3875
+ /** @internal */
3876
+ export type OneLt$Outbound = {
3877
+ lt: number;
3878
+ };
3879
+
3880
+ /** @internal */
3881
+ export const OneLt$outboundSchema: z.ZodType<
3882
+ OneLt$Outbound,
3883
+ z.ZodTypeDef,
3884
+ OneLt
3885
+ > = z.object({
3886
+ lt: z.number(),
3887
+ });
3888
+
3889
+ export function oneLtToJSON(oneLt: OneLt): string {
3890
+ return JSON.stringify(OneLt$outboundSchema.parse(oneLt));
3891
+ }
3892
+
3893
+ /** @internal */
3894
+ export type OneGte$Outbound = {
3895
+ gte: number;
3896
+ };
3897
+
3898
+ /** @internal */
3899
+ export const OneGte$outboundSchema: z.ZodType<
3900
+ OneGte$Outbound,
3901
+ z.ZodTypeDef,
3902
+ OneGte
3903
+ > = z.object({
3904
+ gte: z.number(),
3905
+ });
3906
+
3907
+ export function oneGteToJSON(oneGte: OneGte): string {
3908
+ return JSON.stringify(OneGte$outboundSchema.parse(oneGte));
3909
+ }
3910
+
3911
+ /** @internal */
3912
+ export type OneGt$Outbound = {
3913
+ gt: number;
3914
+ };
3915
+
3916
+ /** @internal */
3917
+ export const OneGt$outboundSchema: z.ZodType<
3918
+ OneGt$Outbound,
3919
+ z.ZodTypeDef,
3920
+ OneGt
3921
+ > = z.object({
3922
+ gt: z.number(),
3923
+ });
3924
+
3925
+ export function oneGtToJSON(oneGt: OneGt): string {
3926
+ return JSON.stringify(OneGt$outboundSchema.parse(oneGt));
3927
+ }
3928
+
3929
+ /** @internal */
3930
+ export type DeploymentStream1DeploymentsNe$Outbound = string | number | boolean;
3931
+
3932
+ /** @internal */
3933
+ export const DeploymentStream1DeploymentsNe$outboundSchema: z.ZodType<
3934
+ DeploymentStream1DeploymentsNe$Outbound,
3935
+ z.ZodTypeDef,
3936
+ DeploymentStream1DeploymentsNe
3937
+ > = z.union([z.string(), z.number(), z.boolean()]);
3938
+
3939
+ export function deploymentStream1DeploymentsNeToJSON(
3940
+ deploymentStream1DeploymentsNe: DeploymentStream1DeploymentsNe,
3941
+ ): string {
3942
+ return JSON.stringify(
3943
+ DeploymentStream1DeploymentsNe$outboundSchema.parse(
3944
+ deploymentStream1DeploymentsNe,
3945
+ ),
3946
+ );
3947
+ }
3948
+
3949
+ /** @internal */
3950
+ export type DeploymentStream1Ne$Outbound = {
3951
+ ne: string | number | boolean;
3952
+ };
3953
+
3954
+ /** @internal */
3955
+ export const DeploymentStream1Ne$outboundSchema: z.ZodType<
3956
+ DeploymentStream1Ne$Outbound,
3957
+ z.ZodTypeDef,
3958
+ DeploymentStream1Ne
3959
+ > = z.object({
3960
+ ne: z.union([z.string(), z.number(), z.boolean()]),
3961
+ });
3962
+
3963
+ export function deploymentStream1NeToJSON(
3964
+ deploymentStream1Ne: DeploymentStream1Ne,
3965
+ ): string {
3966
+ return JSON.stringify(
3967
+ DeploymentStream1Ne$outboundSchema.parse(deploymentStream1Ne),
3968
+ );
3969
+ }
3970
+
3971
+ /** @internal */
3972
+ export type DeploymentStream1DeploymentsEq$Outbound = string | number | boolean;
3973
+
3974
+ /** @internal */
3975
+ export const DeploymentStream1DeploymentsEq$outboundSchema: z.ZodType<
3976
+ DeploymentStream1DeploymentsEq$Outbound,
3977
+ z.ZodTypeDef,
3978
+ DeploymentStream1DeploymentsEq
3979
+ > = z.union([z.string(), z.number(), z.boolean()]);
3980
+
3981
+ export function deploymentStream1DeploymentsEqToJSON(
3982
+ deploymentStream1DeploymentsEq: DeploymentStream1DeploymentsEq,
3983
+ ): string {
3984
+ return JSON.stringify(
3985
+ DeploymentStream1DeploymentsEq$outboundSchema.parse(
3986
+ deploymentStream1DeploymentsEq,
3987
+ ),
3988
+ );
3989
+ }
3990
+
3991
+ /** @internal */
3992
+ export type DeploymentStream1Eq$Outbound = {
3993
+ eq: string | number | boolean;
3994
+ };
3995
+
3996
+ /** @internal */
3997
+ export const DeploymentStream1Eq$outboundSchema: z.ZodType<
3998
+ DeploymentStream1Eq$Outbound,
3999
+ z.ZodTypeDef,
4000
+ DeploymentStream1Eq
4001
+ > = z.object({
4002
+ eq: z.union([z.string(), z.number(), z.boolean()]),
4003
+ });
4004
+
4005
+ export function deploymentStream1EqToJSON(
4006
+ deploymentStream1Eq: DeploymentStream1Eq,
4007
+ ): string {
4008
+ return JSON.stringify(
4009
+ DeploymentStream1Eq$outboundSchema.parse(deploymentStream1Eq),
4010
+ );
4011
+ }
4012
+
4013
+ /** @internal */
4014
+ export type DeploymentStreamKnowledgeFilter1$Outbound =
4015
+ | DeploymentStream1Eq$Outbound
4016
+ | DeploymentStream1Ne$Outbound
4017
+ | OneGt$Outbound
4018
+ | OneGte$Outbound
4019
+ | OneLt$Outbound
4020
+ | OneLte$Outbound
4021
+ | DeploymentStream1In$Outbound
4022
+ | DeploymentStream1Nin$Outbound
4023
+ | OneExists$Outbound;
4024
+
4025
+ /** @internal */
4026
+ export const DeploymentStreamKnowledgeFilter1$outboundSchema: z.ZodType<
4027
+ DeploymentStreamKnowledgeFilter1$Outbound,
4028
+ z.ZodTypeDef,
4029
+ DeploymentStreamKnowledgeFilter1
4030
+ > = z.union([
4031
+ z.lazy(() => DeploymentStream1Eq$outboundSchema),
4032
+ z.lazy(() => DeploymentStream1Ne$outboundSchema),
4033
+ z.lazy(() => OneGt$outboundSchema),
4034
+ z.lazy(() => OneGte$outboundSchema),
4035
+ z.lazy(() => OneLt$outboundSchema),
4036
+ z.lazy(() => OneLte$outboundSchema),
4037
+ z.lazy(() => DeploymentStream1In$outboundSchema),
4038
+ z.lazy(() => DeploymentStream1Nin$outboundSchema),
4039
+ z.lazy(() => OneExists$outboundSchema),
4040
+ ]);
4041
+
4042
+ export function deploymentStreamKnowledgeFilter1ToJSON(
4043
+ deploymentStreamKnowledgeFilter1: DeploymentStreamKnowledgeFilter1,
4044
+ ): string {
4045
+ return JSON.stringify(
4046
+ DeploymentStreamKnowledgeFilter1$outboundSchema.parse(
4047
+ deploymentStreamKnowledgeFilter1,
4048
+ ),
4049
+ );
4050
+ }
4051
+
4052
+ /** @internal */
4053
+ export type DeploymentStreamKnowledgeFilter$Outbound =
4054
+ | DeploymentStreamKnowledgeFilterAnd$Outbound
4055
+ | DeploymentStreamKnowledgeFilterOr$Outbound
4056
+ | {
4057
+ [k: string]:
4058
+ | DeploymentStream1Eq$Outbound
4059
+ | DeploymentStream1Ne$Outbound
4060
+ | OneGt$Outbound
4061
+ | OneGte$Outbound
4062
+ | OneLt$Outbound
4063
+ | OneLte$Outbound
4064
+ | DeploymentStream1In$Outbound
4065
+ | DeploymentStream1Nin$Outbound
4066
+ | OneExists$Outbound;
4067
+ };
4068
+
4069
+ /** @internal */
4070
+ export const DeploymentStreamKnowledgeFilter$outboundSchema: z.ZodType<
4071
+ DeploymentStreamKnowledgeFilter$Outbound,
4072
+ z.ZodTypeDef,
4073
+ DeploymentStreamKnowledgeFilter
4074
+ > = z.union([
4075
+ z.lazy(() => DeploymentStreamKnowledgeFilterAnd$outboundSchema),
4076
+ z.lazy(() => DeploymentStreamKnowledgeFilterOr$outboundSchema),
4077
+ z.record(z.union([
4078
+ z.lazy(() => DeploymentStream1Eq$outboundSchema),
4079
+ z.lazy(() => DeploymentStream1Ne$outboundSchema),
4080
+ z.lazy(() => OneGt$outboundSchema),
4081
+ z.lazy(() => OneGte$outboundSchema),
4082
+ z.lazy(() => OneLt$outboundSchema),
4083
+ z.lazy(() => OneLte$outboundSchema),
4084
+ z.lazy(() => DeploymentStream1In$outboundSchema),
4085
+ z.lazy(() => DeploymentStream1Nin$outboundSchema),
4086
+ z.lazy(() => OneExists$outboundSchema),
4087
+ ])),
4088
+ ]);
4089
+
4090
+ export function deploymentStreamKnowledgeFilterToJSON(
4091
+ deploymentStreamKnowledgeFilter: DeploymentStreamKnowledgeFilter,
4092
+ ): string {
4093
+ return JSON.stringify(
4094
+ DeploymentStreamKnowledgeFilter$outboundSchema.parse(
4095
+ deploymentStreamKnowledgeFilter,
4096
+ ),
4097
+ );
4098
+ }
4099
+
4100
+ /** @internal */
4101
+ export type DeploymentStreamRequestBody$Outbound = {
4102
+ key: string;
4103
+ inputs?: { [k: string]: any } | undefined;
4104
+ context?: { [k: string]: any } | undefined;
4105
+ prefix_messages?:
4106
+ | Array<
4107
+ | PrefixMessagesSystemMessage$Outbound
4108
+ | PrefixMessagesDeveloperMessage$Outbound
4109
+ | PrefixMessagesUserMessage$Outbound
4110
+ | PrefixMessagesAssistantMessage$Outbound
4111
+ | PrefixMessagesToolMessage$Outbound
4112
+ >
4113
+ | undefined;
4114
+ messages?:
4115
+ | Array<
4116
+ | DeploymentStreamMessagesSystemMessage$Outbound
4117
+ | DeploymentStreamMessagesDeveloperMessage$Outbound
4118
+ | DeploymentStreamMessagesUserMessage$Outbound
4119
+ | DeploymentStreamMessagesAssistantMessage$Outbound
4120
+ | DeploymentStreamMessagesToolMessage$Outbound
4121
+ >
4122
+ | undefined;
4123
+ identity?: components.PublicIdentity$Outbound | undefined;
4124
+ file_ids?: Array<string> | undefined;
4125
+ metadata?: { [k: string]: any } | undefined;
4126
+ extra_params?: { [k: string]: any } | undefined;
4127
+ documents?: Array<DeploymentStreamDocuments$Outbound> | undefined;
4128
+ invoke_options?: DeploymentStreamInvokeOptions$Outbound | undefined;
4129
+ thread?: DeploymentStreamThread$Outbound | undefined;
4130
+ knowledge_filter?:
4131
+ | DeploymentStreamKnowledgeFilterAnd$Outbound
4132
+ | DeploymentStreamKnowledgeFilterOr$Outbound
4133
+ | {
4134
+ [k: string]:
4135
+ | DeploymentStream1Eq$Outbound
4136
+ | DeploymentStream1Ne$Outbound
4137
+ | OneGt$Outbound
4138
+ | OneGte$Outbound
4139
+ | OneLt$Outbound
4140
+ | OneLte$Outbound
4141
+ | DeploymentStream1In$Outbound
4142
+ | DeploymentStream1Nin$Outbound
4143
+ | OneExists$Outbound;
4144
+ }
4145
+ | undefined;
4146
+ };
4147
+
4148
+ /** @internal */
4149
+ export const DeploymentStreamRequestBody$outboundSchema: z.ZodType<
4150
+ DeploymentStreamRequestBody$Outbound,
4151
+ z.ZodTypeDef,
4152
+ DeploymentStreamRequestBody
4153
+ > = z.object({
4154
+ key: z.string(),
4155
+ inputs: z.record(z.any()).optional(),
4156
+ context: z.record(z.any()).optional(),
4157
+ prefixMessages: z.array(
4158
+ z.union([
4159
+ z.lazy(() => PrefixMessagesSystemMessage$outboundSchema),
4160
+ z.lazy(() => PrefixMessagesDeveloperMessage$outboundSchema),
4161
+ z.lazy(() => PrefixMessagesUserMessage$outboundSchema),
4162
+ z.lazy(() => PrefixMessagesAssistantMessage$outboundSchema),
4163
+ z.lazy(() => PrefixMessagesToolMessage$outboundSchema),
4164
+ ]),
4165
+ ).optional(),
4166
+ messages: z.array(
4167
+ z.union([
4168
+ z.lazy(() => DeploymentStreamMessagesSystemMessage$outboundSchema),
4169
+ z.lazy(() => DeploymentStreamMessagesDeveloperMessage$outboundSchema),
4170
+ z.lazy(() => DeploymentStreamMessagesUserMessage$outboundSchema),
4171
+ z.lazy(() => DeploymentStreamMessagesAssistantMessage$outboundSchema),
4172
+ z.lazy(() => DeploymentStreamMessagesToolMessage$outboundSchema),
4173
+ ]),
4174
+ ).optional(),
4175
+ identity: components.PublicIdentity$outboundSchema.optional(),
4176
+ fileIds: z.array(z.string()).optional(),
4177
+ metadata: z.record(z.any()).optional(),
4178
+ extraParams: z.record(z.any()).optional(),
4179
+ documents: z.array(z.lazy(() => DeploymentStreamDocuments$outboundSchema))
4180
+ .optional(),
4181
+ invokeOptions: z.lazy(() => DeploymentStreamInvokeOptions$outboundSchema)
4182
+ .optional(),
4183
+ thread: z.lazy(() => DeploymentStreamThread$outboundSchema).optional(),
4184
+ knowledgeFilter: z.union([
4185
+ z.lazy(() => DeploymentStreamKnowledgeFilterAnd$outboundSchema),
4186
+ z.lazy(() => DeploymentStreamKnowledgeFilterOr$outboundSchema),
4187
+ z.record(
4188
+ z.union([
4189
+ z.lazy(() => DeploymentStream1Eq$outboundSchema),
4190
+ z.lazy(() => DeploymentStream1Ne$outboundSchema),
4191
+ z.lazy(() => OneGt$outboundSchema),
4192
+ z.lazy(() => OneGte$outboundSchema),
4193
+ z.lazy(() => OneLt$outboundSchema),
4194
+ z.lazy(() => OneLte$outboundSchema),
4195
+ z.lazy(() => DeploymentStream1In$outboundSchema),
4196
+ z.lazy(() => DeploymentStream1Nin$outboundSchema),
4197
+ z.lazy(() => OneExists$outboundSchema),
4198
+ ]),
4199
+ ),
4200
+ ]).optional(),
4201
+ }).transform((v) => {
4202
+ return remap$(v, {
4203
+ prefixMessages: "prefix_messages",
4204
+ fileIds: "file_ids",
4205
+ extraParams: "extra_params",
4206
+ invokeOptions: "invoke_options",
4207
+ knowledgeFilter: "knowledge_filter",
4208
+ });
4209
+ });
4210
+
4211
+ export function deploymentStreamRequestBodyToJSON(
4212
+ deploymentStreamRequestBody: DeploymentStreamRequestBody,
4213
+ ): string {
4214
+ return JSON.stringify(
4215
+ DeploymentStreamRequestBody$outboundSchema.parse(
4216
+ deploymentStreamRequestBody,
4217
+ ),
4218
+ );
4219
+ }
4220
+
4221
+ /** @internal */
4222
+ export const DeploymentStreamObject$inboundSchema: z.ZodNativeEnum<
4223
+ typeof DeploymentStreamObject
4224
+ > = z.nativeEnum(DeploymentStreamObject);
4225
+
4226
+ /** @internal */
4227
+ export const DeploymentStreamProvider$inboundSchema: z.ZodNativeEnum<
4228
+ typeof DeploymentStreamProvider
4229
+ > = z.nativeEnum(DeploymentStreamProvider);
4230
+
4231
+ /** @internal */
4232
+ export const DeploymentStreamTelemetry$inboundSchema: z.ZodType<
4233
+ DeploymentStreamTelemetry,
4234
+ z.ZodTypeDef,
4235
+ unknown
4236
+ > = z.object({
4237
+ trace_id: z.string(),
4238
+ span_id: z.string(),
4239
+ }).transform((v) => {
4240
+ return remap$(v, {
4241
+ "trace_id": "traceId",
4242
+ "span_id": "spanId",
4243
+ });
4244
+ });
4245
+
4246
+ export function deploymentStreamTelemetryFromJSON(
4247
+ jsonString: string,
4248
+ ): SafeParseResult<DeploymentStreamTelemetry, SDKValidationError> {
4249
+ return safeParse(
4250
+ jsonString,
4251
+ (x) => DeploymentStreamTelemetry$inboundSchema.parse(JSON.parse(x)),
4252
+ `Failed to parse 'DeploymentStreamTelemetry' from JSON`,
4253
+ );
4254
+ }
4255
+
4256
+ /** @internal */
4257
+ export const DeploymentStreamDeploymentsMetadata$inboundSchema: z.ZodType<
4258
+ DeploymentStreamDeploymentsMetadata,
4259
+ z.ZodTypeDef,
4260
+ unknown
4261
+ > = z.object({
4262
+ file_name: z.string(),
4263
+ page_number: z.nullable(z.number()),
4264
+ file_type: z.string(),
4265
+ rerank_score: z.number().optional(),
4266
+ search_score: z.number(),
4267
+ }).transform((v) => {
4268
+ return remap$(v, {
4269
+ "file_name": "fileName",
4270
+ "page_number": "pageNumber",
4271
+ "file_type": "fileType",
4272
+ "rerank_score": "rerankScore",
4273
+ "search_score": "searchScore",
4274
+ });
4275
+ });
4276
+
4277
+ export function deploymentStreamDeploymentsMetadataFromJSON(
4278
+ jsonString: string,
4279
+ ): SafeParseResult<DeploymentStreamDeploymentsMetadata, SDKValidationError> {
4280
+ return safeParse(
4281
+ jsonString,
4282
+ (x) =>
4283
+ DeploymentStreamDeploymentsMetadata$inboundSchema.parse(JSON.parse(x)),
4284
+ `Failed to parse 'DeploymentStreamDeploymentsMetadata' from JSON`,
4285
+ );
4286
+ }
4287
+
4288
+ /** @internal */
4289
+ export const DeploymentStreamRetrievals$inboundSchema: z.ZodType<
4290
+ DeploymentStreamRetrievals,
4291
+ z.ZodTypeDef,
4292
+ unknown
4293
+ > = z.object({
4294
+ document: z.string(),
4295
+ metadata: z.lazy(() => DeploymentStreamDeploymentsMetadata$inboundSchema),
4296
+ });
4297
+
4298
+ export function deploymentStreamRetrievalsFromJSON(
4299
+ jsonString: string,
4300
+ ): SafeParseResult<DeploymentStreamRetrievals, SDKValidationError> {
4301
+ return safeParse(
4302
+ jsonString,
4303
+ (x) => DeploymentStreamRetrievals$inboundSchema.parse(JSON.parse(x)),
4304
+ `Failed to parse 'DeploymentStreamRetrievals' from JSON`,
4305
+ );
4306
+ }
4307
+
4308
+ /** @internal */
4309
+ export const DeploymentStreamPromptTokensDetails$inboundSchema: z.ZodType<
4310
+ DeploymentStreamPromptTokensDetails,
4311
+ z.ZodTypeDef,
4312
+ unknown
4313
+ > = z.object({
4314
+ cached_tokens: z.nullable(z.number()).optional(),
4315
+ }).transform((v) => {
4316
+ return remap$(v, {
4317
+ "cached_tokens": "cachedTokens",
4318
+ });
4319
+ });
4320
+
4321
+ export function deploymentStreamPromptTokensDetailsFromJSON(
4322
+ jsonString: string,
4323
+ ): SafeParseResult<DeploymentStreamPromptTokensDetails, SDKValidationError> {
4324
+ return safeParse(
4325
+ jsonString,
4326
+ (x) =>
4327
+ DeploymentStreamPromptTokensDetails$inboundSchema.parse(JSON.parse(x)),
4328
+ `Failed to parse 'DeploymentStreamPromptTokensDetails' from JSON`,
4329
+ );
4330
+ }
4331
+
4332
+ /** @internal */
4333
+ export const DeploymentStreamCompletionTokensDetails$inboundSchema: z.ZodType<
4334
+ DeploymentStreamCompletionTokensDetails,
4335
+ z.ZodTypeDef,
4336
+ unknown
4337
+ > = z.object({
4338
+ reasoning_tokens: z.nullable(z.number()).optional(),
4339
+ }).transform((v) => {
4340
+ return remap$(v, {
4341
+ "reasoning_tokens": "reasoningTokens",
4342
+ });
4343
+ });
4344
+
4345
+ export function deploymentStreamCompletionTokensDetailsFromJSON(
4346
+ jsonString: string,
4347
+ ): SafeParseResult<
4348
+ DeploymentStreamCompletionTokensDetails,
4349
+ SDKValidationError
4350
+ > {
4351
+ return safeParse(
4352
+ jsonString,
4353
+ (x) =>
4354
+ DeploymentStreamCompletionTokensDetails$inboundSchema.parse(
4355
+ JSON.parse(x),
4356
+ ),
4357
+ `Failed to parse 'DeploymentStreamCompletionTokensDetails' from JSON`,
4358
+ );
4359
+ }
4360
+
4361
+ /** @internal */
4362
+ export const DeploymentStreamUsage$inboundSchema: z.ZodType<
4363
+ DeploymentStreamUsage,
4364
+ z.ZodTypeDef,
4365
+ unknown
4366
+ > = z.object({
4367
+ total_tokens: z.number().optional(),
4368
+ prompt_tokens: z.number().optional(),
4369
+ completion_tokens: z.number().optional(),
4370
+ prompt_tokens_details: z.lazy(() =>
4371
+ DeploymentStreamPromptTokensDetails$inboundSchema
4372
+ ).optional(),
4373
+ completion_tokens_details: z.nullable(
4374
+ z.lazy(() => DeploymentStreamCompletionTokensDetails$inboundSchema),
4375
+ ).optional(),
4376
+ }).transform((v) => {
4377
+ return remap$(v, {
4378
+ "total_tokens": "totalTokens",
4379
+ "prompt_tokens": "promptTokens",
4380
+ "completion_tokens": "completionTokens",
4381
+ "prompt_tokens_details": "promptTokensDetails",
4382
+ "completion_tokens_details": "completionTokensDetails",
4383
+ });
4384
+ });
4385
+
4386
+ export function deploymentStreamUsageFromJSON(
4387
+ jsonString: string,
4388
+ ): SafeParseResult<DeploymentStreamUsage, SDKValidationError> {
4389
+ return safeParse(
4390
+ jsonString,
4391
+ (x) => DeploymentStreamUsage$inboundSchema.parse(JSON.parse(x)),
4392
+ `Failed to parse 'DeploymentStreamUsage' from JSON`,
4393
+ );
4394
+ }
4395
+
4396
+ /** @internal */
4397
+ export const DeploymentStreamMessageDeploymentsResponseRole$inboundSchema:
4398
+ z.ZodNativeEnum<typeof DeploymentStreamMessageDeploymentsResponseRole> = z
4399
+ .nativeEnum(DeploymentStreamMessageDeploymentsResponseRole);
4400
+
4401
+ /** @internal */
4402
+ export const DeploymentStreamMessage3$inboundSchema: z.ZodType<
4403
+ DeploymentStreamMessage3,
4404
+ z.ZodTypeDef,
4405
+ unknown
4406
+ > = z.object({
4407
+ type: z.literal("image"),
4408
+ role: DeploymentStreamMessageDeploymentsResponseRole$inboundSchema,
4409
+ url: z.string(),
4410
+ });
4411
+
4412
+ export function deploymentStreamMessage3FromJSON(
4413
+ jsonString: string,
4414
+ ): SafeParseResult<DeploymentStreamMessage3, SDKValidationError> {
4415
+ return safeParse(
4416
+ jsonString,
4417
+ (x) => DeploymentStreamMessage3$inboundSchema.parse(JSON.parse(x)),
4418
+ `Failed to parse 'DeploymentStreamMessage3' from JSON`,
4419
+ );
4420
+ }
4421
+
4422
+ /** @internal */
4423
+ export const DeploymentStreamMessageDeploymentsRole$inboundSchema:
4424
+ z.ZodNativeEnum<typeof DeploymentStreamMessageDeploymentsRole> = z.nativeEnum(
4425
+ DeploymentStreamMessageDeploymentsRole,
4426
+ );
4427
+
4428
+ /** @internal */
4429
+ export const DeploymentStreamMessage2$inboundSchema: z.ZodType<
4430
+ DeploymentStreamMessage2,
4431
+ z.ZodTypeDef,
4432
+ unknown
4433
+ > = z.object({
4434
+ type: z.literal("content"),
4435
+ role: DeploymentStreamMessageDeploymentsRole$inboundSchema,
4436
+ content: z.nullable(z.string()),
4437
+ reasoning: z.string().optional(),
4438
+ reasoning_signature: z.string().optional(),
4439
+ redacted_reasoning: z.string().optional(),
4440
+ }).transform((v) => {
4441
+ return remap$(v, {
4442
+ "reasoning_signature": "reasoningSignature",
4443
+ "redacted_reasoning": "redactedReasoning",
4444
+ });
4445
+ });
4446
+
4447
+ export function deploymentStreamMessage2FromJSON(
4448
+ jsonString: string,
4449
+ ): SafeParseResult<DeploymentStreamMessage2, SDKValidationError> {
4450
+ return safeParse(
4451
+ jsonString,
4452
+ (x) => DeploymentStreamMessage2$inboundSchema.parse(JSON.parse(x)),
4453
+ `Failed to parse 'DeploymentStreamMessage2' from JSON`,
4454
+ );
4455
+ }
4456
+
4457
+ /** @internal */
4458
+ export const DeploymentStreamMessageRole$inboundSchema: z.ZodNativeEnum<
4459
+ typeof DeploymentStreamMessageRole
4460
+ > = z.nativeEnum(DeploymentStreamMessageRole);
4461
+
4462
+ /** @internal */
4463
+ export const DeploymentStreamMessageDeploymentsResponse200Type$inboundSchema:
4464
+ z.ZodNativeEnum<typeof DeploymentStreamMessageDeploymentsResponse200Type> = z
4465
+ .nativeEnum(DeploymentStreamMessageDeploymentsResponse200Type);
4466
+
4467
+ /** @internal */
4468
+ export const DeploymentStreamMessageFunction$inboundSchema: z.ZodType<
4469
+ DeploymentStreamMessageFunction,
4470
+ z.ZodTypeDef,
4471
+ unknown
4472
+ > = z.object({
4473
+ name: z.string(),
4474
+ arguments: z.string(),
4475
+ });
4476
+
4477
+ export function deploymentStreamMessageFunctionFromJSON(
4478
+ jsonString: string,
4479
+ ): SafeParseResult<DeploymentStreamMessageFunction, SDKValidationError> {
4480
+ return safeParse(
4481
+ jsonString,
4482
+ (x) => DeploymentStreamMessageFunction$inboundSchema.parse(JSON.parse(x)),
4483
+ `Failed to parse 'DeploymentStreamMessageFunction' from JSON`,
4484
+ );
4485
+ }
4486
+
4487
+ /** @internal */
4488
+ export const DeploymentStreamMessageToolCalls$inboundSchema: z.ZodType<
4489
+ DeploymentStreamMessageToolCalls,
4490
+ z.ZodTypeDef,
4491
+ unknown
4492
+ > = z.object({
4493
+ id: z.string().optional(),
4494
+ index: z.number().optional(),
4495
+ type: DeploymentStreamMessageDeploymentsResponse200Type$inboundSchema,
4496
+ function: z.lazy(() => DeploymentStreamMessageFunction$inboundSchema),
4497
+ });
4498
+
4499
+ export function deploymentStreamMessageToolCallsFromJSON(
4500
+ jsonString: string,
4501
+ ): SafeParseResult<DeploymentStreamMessageToolCalls, SDKValidationError> {
4502
+ return safeParse(
4503
+ jsonString,
4504
+ (x) => DeploymentStreamMessageToolCalls$inboundSchema.parse(JSON.parse(x)),
4505
+ `Failed to parse 'DeploymentStreamMessageToolCalls' from JSON`,
4506
+ );
4507
+ }
4508
+
4509
+ /** @internal */
4510
+ export const DeploymentStreamMessage1$inboundSchema: z.ZodType<
4511
+ DeploymentStreamMessage1,
4512
+ z.ZodTypeDef,
4513
+ unknown
4514
+ > = z.object({
4515
+ type: z.literal("tool_calls"),
4516
+ role: DeploymentStreamMessageRole$inboundSchema,
4517
+ content: z.nullable(z.string()).optional(),
4518
+ tool_calls: z.array(
4519
+ z.lazy(() => DeploymentStreamMessageToolCalls$inboundSchema),
4520
+ ),
4521
+ reasoning: z.string().optional(),
4522
+ reasoning_signature: z.string().optional(),
4523
+ redacted_reasoning: z.string().optional(),
4524
+ }).transform((v) => {
4525
+ return remap$(v, {
4526
+ "tool_calls": "toolCalls",
4527
+ "reasoning_signature": "reasoningSignature",
4528
+ "redacted_reasoning": "redactedReasoning",
4529
+ });
4530
+ });
4531
+
4532
+ export function deploymentStreamMessage1FromJSON(
4533
+ jsonString: string,
4534
+ ): SafeParseResult<DeploymentStreamMessage1, SDKValidationError> {
4535
+ return safeParse(
4536
+ jsonString,
4537
+ (x) => DeploymentStreamMessage1$inboundSchema.parse(JSON.parse(x)),
4538
+ `Failed to parse 'DeploymentStreamMessage1' from JSON`,
4539
+ );
4540
+ }
4541
+
4542
+ /** @internal */
4543
+ export const DeploymentStreamMessage$inboundSchema: z.ZodType<
4544
+ DeploymentStreamMessage,
4545
+ z.ZodTypeDef,
4546
+ unknown
4547
+ > = z.union([
4548
+ z.lazy(() => DeploymentStreamMessage1$inboundSchema),
4549
+ z.lazy(() => DeploymentStreamMessage2$inboundSchema),
4550
+ z.lazy(() => DeploymentStreamMessage3$inboundSchema),
4551
+ ]);
4552
+
4553
+ export function deploymentStreamMessageFromJSON(
4554
+ jsonString: string,
4555
+ ): SafeParseResult<DeploymentStreamMessage, SDKValidationError> {
4556
+ return safeParse(
4557
+ jsonString,
4558
+ (x) => DeploymentStreamMessage$inboundSchema.parse(JSON.parse(x)),
4559
+ `Failed to parse 'DeploymentStreamMessage' from JSON`,
4560
+ );
4561
+ }
4562
+
4563
+ /** @internal */
4564
+ export const DeploymentStreamChoices$inboundSchema: z.ZodType<
4565
+ DeploymentStreamChoices,
4566
+ z.ZodTypeDef,
4567
+ unknown
4568
+ > = z.object({
4569
+ index: z.number(),
4570
+ message: z.union([
4571
+ z.lazy(() => DeploymentStreamMessage1$inboundSchema),
4572
+ z.lazy(() => DeploymentStreamMessage2$inboundSchema),
4573
+ z.lazy(() => DeploymentStreamMessage3$inboundSchema),
4574
+ ]),
4575
+ finish_reason: z.nullable(z.string()).optional(),
4576
+ }).transform((v) => {
4577
+ return remap$(v, {
4578
+ "finish_reason": "finishReason",
4579
+ });
4580
+ });
4581
+
4582
+ export function deploymentStreamChoicesFromJSON(
4583
+ jsonString: string,
4584
+ ): SafeParseResult<DeploymentStreamChoices, SDKValidationError> {
4585
+ return safeParse(
4586
+ jsonString,
4587
+ (x) => DeploymentStreamChoices$inboundSchema.parse(JSON.parse(x)),
4588
+ `Failed to parse 'DeploymentStreamChoices' from JSON`,
4589
+ );
4590
+ }
4591
+
4592
+ /** @internal */
4593
+ export const DeploymentStreamData$inboundSchema: z.ZodType<
4594
+ DeploymentStreamData,
4595
+ z.ZodTypeDef,
4596
+ unknown
4597
+ > = z.object({
4598
+ id: z.string(),
4599
+ created: z.string().datetime({ offset: true }).transform(v => new Date(v)),
4600
+ object: DeploymentStreamObject$inboundSchema,
4601
+ model: z.string(),
4602
+ provider: DeploymentStreamProvider$inboundSchema,
4603
+ is_final: z.boolean(),
4604
+ integration_id: z.string().optional(),
4605
+ telemetry: z.lazy(() => DeploymentStreamTelemetry$inboundSchema),
4606
+ finalized: z.string().datetime({ offset: true }).transform(v => new Date(v))
4607
+ .optional(),
4608
+ system_fingerprint: z.nullable(z.string()).optional(),
4609
+ retrievals: z.array(z.lazy(() => DeploymentStreamRetrievals$inboundSchema))
4610
+ .optional(),
4611
+ provider_response: z.any().optional(),
4612
+ usage: z.nullable(z.lazy(() => DeploymentStreamUsage$inboundSchema))
4613
+ .optional(),
4614
+ choices: z.array(z.lazy(() => DeploymentStreamChoices$inboundSchema)),
4615
+ }).transform((v) => {
4616
+ return remap$(v, {
4617
+ "is_final": "isFinal",
4618
+ "integration_id": "integrationId",
4619
+ "system_fingerprint": "systemFingerprint",
4620
+ "provider_response": "providerResponse",
4621
+ });
4622
+ });
4623
+
4624
+ export function deploymentStreamDataFromJSON(
4625
+ jsonString: string,
4626
+ ): SafeParseResult<DeploymentStreamData, SDKValidationError> {
4627
+ return safeParse(
4628
+ jsonString,
4629
+ (x) => DeploymentStreamData$inboundSchema.parse(JSON.parse(x)),
4630
+ `Failed to parse 'DeploymentStreamData' from JSON`,
4631
+ );
4632
+ }
4633
+
4634
+ /** @internal */
4635
+ export const DeploymentStreamResponseBody$inboundSchema: z.ZodType<
4636
+ DeploymentStreamResponseBody,
4637
+ z.ZodTypeDef,
4638
+ unknown
4639
+ > = z.object({
4640
+ data: z.string().optional().transform((v, ctx) => {
4641
+ if (v === undefined) return undefined;
4642
+ try {
4643
+ return JSON.parse(v);
4644
+ } catch (err) {
4645
+ ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
4646
+ return z.NEVER;
4647
+ }
4648
+ }).pipe(z.lazy(() => DeploymentStreamData$inboundSchema).optional()),
4649
+ });
4650
+
4651
+ export function deploymentStreamResponseBodyFromJSON(
4652
+ jsonString: string,
4653
+ ): SafeParseResult<DeploymentStreamResponseBody, SDKValidationError> {
4654
+ return safeParse(
4655
+ jsonString,
4656
+ (x) => DeploymentStreamResponseBody$inboundSchema.parse(JSON.parse(x)),
4657
+ `Failed to parse 'DeploymentStreamResponseBody' from JSON`,
4658
+ );
4659
+ }