@orq-ai/node 4.5.0-rc.9 → 4.5.2

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 (710) hide show
  1. package/README.md +38 -28
  2. package/funcs/agentsList.d.ts +1 -1
  3. package/funcs/agentsList.d.ts.map +1 -1
  4. package/funcs/agentsList.js +5 -3
  5. package/funcs/agentsList.js.map +1 -1
  6. package/funcs/agentsPostV2AgentsA2a.d.ts +18 -0
  7. package/funcs/agentsPostV2AgentsA2a.d.ts.map +1 -0
  8. package/funcs/agentsPostV2AgentsA2a.js +120 -0
  9. package/funcs/agentsPostV2AgentsA2a.js.map +1 -0
  10. package/funcs/agentsPostV2AgentsKeyCardRefresh.d.ts +18 -0
  11. package/funcs/agentsPostV2AgentsKeyCardRefresh.d.ts.map +1 -0
  12. package/funcs/agentsPostV2AgentsKeyCardRefresh.js +124 -0
  13. package/funcs/agentsPostV2AgentsKeyCardRefresh.js.map +1 -0
  14. package/funcs/agentsResponsesGet.d.ts +19 -0
  15. package/funcs/agentsResponsesGet.d.ts.map +1 -0
  16. package/funcs/agentsResponsesGet.js +128 -0
  17. package/funcs/agentsResponsesGet.js.map +1 -0
  18. package/funcs/agentsStream.js +4 -2
  19. package/funcs/agentsStream.js.map +1 -1
  20. package/funcs/agentsStreamRun.js +4 -2
  21. package/funcs/agentsStreamRun.js.map +1 -1
  22. package/funcs/agentsUpdate.d.ts +1 -1
  23. package/funcs/agentsUpdate.d.ts.map +1 -1
  24. package/funcs/agentsUpdate.js.map +1 -1
  25. package/funcs/deploymentsStream.js +4 -2
  26. package/funcs/deploymentsStream.js.map +1 -1
  27. package/funcs/filesCreate.d.ts +1 -1
  28. package/funcs/filesCreate.js +8 -1
  29. package/funcs/filesCreate.js.map +1 -1
  30. package/funcs/routerAudioTranscriptionsCreate.js +7 -0
  31. package/funcs/routerAudioTranscriptionsCreate.js.map +1 -1
  32. package/funcs/routerAudioTranslationsCreate.js +7 -0
  33. package/funcs/routerAudioTranslationsCreate.js.map +1 -1
  34. package/jsr.json +1 -1
  35. package/lib/config.d.ts +3 -3
  36. package/lib/config.js +3 -3
  37. package/lib/config.js.map +1 -1
  38. package/lib/event-streams.d.ts +5 -0
  39. package/lib/event-streams.d.ts.map +1 -1
  40. package/lib/event-streams.js.map +1 -1
  41. package/lib/matchers.d.ts.map +1 -1
  42. package/lib/matchers.js +0 -1
  43. package/lib/matchers.js.map +1 -1
  44. package/lib/security.d.ts.map +1 -1
  45. package/lib/security.js +1 -2
  46. package/lib/security.js.map +1 -1
  47. package/models/components/createagentresponse.d.ts +5 -0
  48. package/models/components/createagentresponse.d.ts.map +1 -1
  49. package/models/components/createagentresponse.js +2 -0
  50. package/models/components/createagentresponse.js.map +1 -1
  51. package/models/components/extendedmessage.d.ts +71 -0
  52. package/models/components/extendedmessage.d.ts.map +1 -0
  53. package/models/components/extendedmessage.js +98 -0
  54. package/models/components/extendedmessage.js.map +1 -0
  55. package/models/components/getagentresponse.d.ts +157 -0
  56. package/models/components/getagentresponse.d.ts.map +1 -0
  57. package/models/components/getagentresponse.js +175 -0
  58. package/models/components/getagentresponse.js.map +1 -0
  59. package/models/components/index.d.ts +3 -0
  60. package/models/components/index.d.ts.map +1 -1
  61. package/models/components/index.js +3 -0
  62. package/models/components/index.js.map +1 -1
  63. package/models/components/partdoneevent.js +1 -1
  64. package/models/components/reasoningpart.js +1 -1
  65. package/models/components/responsedoneevent.d.ts +5 -0
  66. package/models/components/responsedoneevent.d.ts.map +1 -1
  67. package/models/components/responsedoneevent.js +2 -0
  68. package/models/components/responsedoneevent.js.map +1 -1
  69. package/models/components/responsestartedevent.d.ts +5 -0
  70. package/models/components/responsestartedevent.d.ts.map +1 -1
  71. package/models/components/responsestartedevent.js +2 -0
  72. package/models/components/responsestartedevent.js.map +1 -1
  73. package/models/components/telemetry.d.ts +20 -0
  74. package/models/components/telemetry.d.ts.map +1 -0
  75. package/models/components/telemetry.js +57 -0
  76. package/models/components/telemetry.js.map +1 -0
  77. package/models/errors/index.d.ts +2 -0
  78. package/models/errors/index.d.ts.map +1 -1
  79. package/models/errors/index.js +2 -0
  80. package/models/errors/index.js.map +1 -1
  81. package/models/errors/postv2agentsa2a.d.ts +43 -0
  82. package/models/errors/postv2agentsa2a.d.ts.map +1 -0
  83. package/models/errors/postv2agentsa2a.js +94 -0
  84. package/models/errors/postv2agentsa2a.js.map +1 -0
  85. package/models/errors/postv2agentskeycardrefresh.d.ts +43 -0
  86. package/models/errors/postv2agentskeycardrefresh.d.ts.map +1 -0
  87. package/models/errors/postv2agentskeycardrefresh.js +94 -0
  88. package/models/errors/postv2agentskeycardrefresh.js.map +1 -0
  89. package/models/operations/createagentrequest.d.ts +113 -500
  90. package/models/operations/createagentrequest.d.ts.map +1 -1
  91. package/models/operations/createagentrequest.js +103 -343
  92. package/models/operations/createagentrequest.js.map +1 -1
  93. package/models/operations/createagentresponserequest.d.ts +22 -1
  94. package/models/operations/createagentresponserequest.d.ts.map +1 -1
  95. package/models/operations/createagentresponserequest.js +12 -2
  96. package/models/operations/createagentresponserequest.js.map +1 -1
  97. package/models/operations/createannotation.d.ts +1 -1
  98. package/models/operations/createannotation.d.ts.map +1 -1
  99. package/models/operations/createannotation.js +4 -0
  100. package/models/operations/createannotation.js.map +1 -1
  101. package/models/operations/createchatcompletion.d.ts +15 -2
  102. package/models/operations/createchatcompletion.d.ts.map +1 -1
  103. package/models/operations/createchatcompletion.js +3 -1
  104. package/models/operations/createchatcompletion.js.map +1 -1
  105. package/models/operations/createcompletion.d.ts +6 -2
  106. package/models/operations/createcompletion.d.ts.map +1 -1
  107. package/models/operations/createcompletion.js +2 -1
  108. package/models/operations/createcompletion.js.map +1 -1
  109. package/models/operations/createcontact.js +1 -1
  110. package/models/operations/createdataset.js +1 -1
  111. package/models/operations/createdatasetitem.js +4 -4
  112. package/models/operations/createdatasource.js +1 -1
  113. package/models/operations/createeval.js +16 -16
  114. package/models/operations/createfeedback.d.ts +2 -2
  115. package/models/operations/createidentity.js +1 -1
  116. package/models/operations/createprompt.d.ts +33 -32
  117. package/models/operations/createprompt.d.ts.map +1 -1
  118. package/models/operations/createprompt.js +33 -30
  119. package/models/operations/createprompt.js.map +1 -1
  120. package/models/operations/createresponse.d.ts.map +1 -1
  121. package/models/operations/createresponse.js +2 -1
  122. package/models/operations/createresponse.js.map +1 -1
  123. package/models/operations/createtool.js +6 -6
  124. package/models/operations/deploymentinvoke.d.ts +15 -0
  125. package/models/operations/deploymentinvoke.d.ts.map +1 -1
  126. package/models/operations/deploymentinvoke.js +17 -1
  127. package/models/operations/deploymentinvoke.js.map +1 -1
  128. package/models/operations/deployments.d.ts +1 -0
  129. package/models/operations/deployments.d.ts.map +1 -1
  130. package/models/operations/deployments.js +1 -0
  131. package/models/operations/deployments.js.map +1 -1
  132. package/models/operations/deploymentstream.d.ts +15 -0
  133. package/models/operations/deploymentstream.d.ts.map +1 -1
  134. package/models/operations/deploymentstream.js +17 -1
  135. package/models/operations/deploymentstream.js.map +1 -1
  136. package/models/operations/fileget.js +1 -1
  137. package/models/operations/filelist.js +1 -1
  138. package/models/operations/fileupload.js +1 -1
  139. package/models/operations/getagentresponse.d.ts +20 -0
  140. package/models/operations/getagentresponse.d.ts.map +1 -0
  141. package/models/operations/getagentresponse.js +56 -0
  142. package/models/operations/getagentresponse.js.map +1 -0
  143. package/models/operations/getallprompts.d.ts +1 -0
  144. package/models/operations/getallprompts.d.ts.map +1 -1
  145. package/models/operations/getallprompts.js +1 -0
  146. package/models/operations/getallprompts.js.map +1 -1
  147. package/models/operations/getalltools.js +6 -6
  148. package/models/operations/getevals.js +16 -16
  149. package/models/operations/getoneprompt.d.ts +1 -0
  150. package/models/operations/getoneprompt.d.ts.map +1 -1
  151. package/models/operations/getoneprompt.js +1 -0
  152. package/models/operations/getoneprompt.js.map +1 -1
  153. package/models/operations/getpromptversion.d.ts +1 -0
  154. package/models/operations/getpromptversion.d.ts.map +1 -1
  155. package/models/operations/getpromptversion.js +1 -0
  156. package/models/operations/getpromptversion.js.map +1 -1
  157. package/models/operations/index.d.ts +3 -0
  158. package/models/operations/index.d.ts.map +1 -1
  159. package/models/operations/index.js +3 -0
  160. package/models/operations/index.js.map +1 -1
  161. package/models/operations/invokeagent.d.ts +26 -1
  162. package/models/operations/invokeagent.d.ts.map +1 -1
  163. package/models/operations/invokeagent.js +12 -1
  164. package/models/operations/invokeagent.js.map +1 -1
  165. package/models/operations/listagents.d.ts +114 -241
  166. package/models/operations/listagents.d.ts.map +1 -1
  167. package/models/operations/listagents.js +94 -182
  168. package/models/operations/listagents.js.map +1 -1
  169. package/models/operations/listdatasetdatapoints.js +4 -4
  170. package/models/operations/listdatasets.js +1 -1
  171. package/models/operations/listdatasources.js +1 -1
  172. package/models/operations/listidentities.js +1 -1
  173. package/models/operations/listpromptversions.d.ts +1 -0
  174. package/models/operations/listpromptversions.d.ts.map +1 -1
  175. package/models/operations/listpromptversions.js +1 -0
  176. package/models/operations/listpromptversions.js.map +1 -1
  177. package/models/operations/postv2agentsa2a.d.ts +119 -0
  178. package/models/operations/postv2agentsa2a.d.ts.map +1 -0
  179. package/models/operations/postv2agentsa2a.js +147 -0
  180. package/models/operations/postv2agentsa2a.js.map +1 -0
  181. package/models/operations/postv2agentskeycardrefresh.d.ts +35 -0
  182. package/models/operations/postv2agentskeycardrefresh.d.ts.map +1 -0
  183. package/models/operations/postv2agentskeycardrefresh.js +71 -0
  184. package/models/operations/postv2agentskeycardrefresh.js.map +1 -0
  185. package/models/operations/retrieveagentrequest.d.ts +96 -242
  186. package/models/operations/retrieveagentrequest.d.ts.map +1 -1
  187. package/models/operations/retrieveagentrequest.js +84 -185
  188. package/models/operations/retrieveagentrequest.js.map +1 -1
  189. package/models/operations/retrievedatapoint.js +4 -4
  190. package/models/operations/retrievedataset.js +1 -1
  191. package/models/operations/retrievedatasource.js +1 -1
  192. package/models/operations/retrieveidentity.js +1 -1
  193. package/models/operations/retrievetool.js +6 -6
  194. package/models/operations/runagent.d.ts +27 -265
  195. package/models/operations/runagent.d.ts.map +1 -1
  196. package/models/operations/runagent.js +26 -163
  197. package/models/operations/runagent.js.map +1 -1
  198. package/models/operations/streamagent.d.ts +22 -1
  199. package/models/operations/streamagent.d.ts.map +1 -1
  200. package/models/operations/streamagent.js +11 -1
  201. package/models/operations/streamagent.js.map +1 -1
  202. package/models/operations/streamrunagent.d.ts +13 -255
  203. package/models/operations/streamrunagent.d.ts.map +1 -1
  204. package/models/operations/streamrunagent.js +15 -152
  205. package/models/operations/streamrunagent.js.map +1 -1
  206. package/models/operations/updateagent.d.ts +190 -507
  207. package/models/operations/updateagent.d.ts.map +1 -1
  208. package/models/operations/updateagent.js +144 -348
  209. package/models/operations/updateagent.js.map +1 -1
  210. package/models/operations/updatedatapoint.js +4 -4
  211. package/models/operations/updatedataset.js +1 -1
  212. package/models/operations/updatedatasource.js +1 -1
  213. package/models/operations/updateeval.d.ts +48 -0
  214. package/models/operations/updateeval.d.ts.map +1 -1
  215. package/models/operations/updateeval.js +60 -20
  216. package/models/operations/updateeval.js.map +1 -1
  217. package/models/operations/updateidentity.js +1 -1
  218. package/models/operations/updatememorystore.d.ts +2 -43
  219. package/models/operations/updatememorystore.d.ts.map +1 -1
  220. package/models/operations/updatememorystore.js +2 -45
  221. package/models/operations/updatememorystore.js.map +1 -1
  222. package/models/operations/updateprompt.d.ts +1 -0
  223. package/models/operations/updateprompt.d.ts.map +1 -1
  224. package/models/operations/updateprompt.js +1 -0
  225. package/models/operations/updateprompt.js.map +1 -1
  226. package/models/operations/updatetool.d.ts +60 -0
  227. package/models/operations/updatetool.d.ts.map +1 -1
  228. package/models/operations/updatetool.js +63 -9
  229. package/models/operations/updatetool.js.map +1 -1
  230. package/package.json +3 -4
  231. package/packages/orq-rc/examples/contactsCreate.example.ts +42 -0
  232. package/packages/orq-rc/src/core.ts +13 -0
  233. package/packages/orq-rc/src/funcs/agentsCreate.ts +161 -0
  234. package/packages/orq-rc/src/funcs/agentsDelete.ts +180 -0
  235. package/packages/orq-rc/src/funcs/agentsInvoke.ts +177 -0
  236. package/packages/orq-rc/src/funcs/agentsList.ts +184 -0
  237. package/packages/orq-rc/src/funcs/agentsPostV2AgentsA2a.ts +178 -0
  238. package/packages/orq-rc/src/funcs/agentsPostV2AgentsKeyCardRefresh.ts +187 -0
  239. package/packages/orq-rc/src/funcs/agentsResponsesCreate.ts +183 -0
  240. package/packages/orq-rc/src/funcs/agentsResponsesGet.ts +182 -0
  241. package/packages/orq-rc/src/funcs/agentsRetrieve.ts +180 -0
  242. package/packages/orq-rc/src/funcs/agentsRun.ts +162 -0
  243. package/packages/orq-rc/src/funcs/agentsStream.ts +204 -0
  244. package/packages/orq-rc/src/funcs/agentsStreamRun.ts +189 -0
  245. package/packages/orq-rc/src/funcs/agentsUpdate.ts +184 -0
  246. package/packages/orq-rc/src/funcs/annotationsCreate.ts +171 -0
  247. package/packages/orq-rc/src/funcs/annotationsDelete.ts +171 -0
  248. package/packages/orq-rc/src/funcs/chunkingParse.ts +160 -0
  249. package/packages/orq-rc/src/funcs/contactsCreate.ts +160 -0
  250. package/packages/orq-rc/src/funcs/datasetsClear.ts +167 -0
  251. package/packages/orq-rc/src/funcs/datasetsCreate.ts +165 -0
  252. package/packages/orq-rc/src/funcs/datasetsCreateDatapoint.ts +171 -0
  253. package/packages/orq-rc/src/funcs/datasetsDelete.ts +167 -0
  254. package/packages/orq-rc/src/funcs/datasetsDeleteDatapoint.ts +182 -0
  255. package/packages/orq-rc/src/funcs/datasetsList.ts +167 -0
  256. package/packages/orq-rc/src/funcs/datasetsListDatapoints.ts +174 -0
  257. package/packages/orq-rc/src/funcs/datasetsRetrieve.ts +175 -0
  258. package/packages/orq-rc/src/funcs/datasetsRetrieveDatapoint.ts +181 -0
  259. package/packages/orq-rc/src/funcs/datasetsUpdate.ts +176 -0
  260. package/packages/orq-rc/src/funcs/datasetsUpdateDatapoint.ts +179 -0
  261. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +168 -0
  262. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +176 -0
  263. package/packages/orq-rc/src/funcs/deploymentsList.ts +176 -0
  264. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +168 -0
  265. package/packages/orq-rc/src/funcs/deploymentsStream.ts +186 -0
  266. package/packages/orq-rc/src/funcs/evalsAll.ts +173 -0
  267. package/packages/orq-rc/src/funcs/evalsCreate.ts +169 -0
  268. package/packages/orq-rc/src/funcs/evalsDelete.ts +173 -0
  269. package/packages/orq-rc/src/funcs/evalsInvoke.ts +181 -0
  270. package/packages/orq-rc/src/funcs/evalsUpdate.ts +173 -0
  271. package/packages/orq-rc/src/funcs/evaluatorsGetV2EvaluatorsIdVersions.ts +183 -0
  272. package/packages/orq-rc/src/funcs/feedbackCreate.ts +160 -0
  273. package/packages/orq-rc/src/funcs/filesCreate.ts +198 -0
  274. package/packages/orq-rc/src/funcs/filesDelete.ts +164 -0
  275. package/packages/orq-rc/src/funcs/filesGet.ts +166 -0
  276. package/packages/orq-rc/src/funcs/filesList.ts +167 -0
  277. package/packages/orq-rc/src/funcs/identitiesCreate.ts +165 -0
  278. package/packages/orq-rc/src/funcs/identitiesDelete.ts +176 -0
  279. package/packages/orq-rc/src/funcs/identitiesList.ts +170 -0
  280. package/packages/orq-rc/src/funcs/identitiesRetrieve.ts +175 -0
  281. package/packages/orq-rc/src/funcs/identitiesUpdate.ts +176 -0
  282. package/packages/orq-rc/src/funcs/knowledgeCreate.ts +158 -0
  283. package/packages/orq-rc/src/funcs/knowledgeCreateChunks.ts +171 -0
  284. package/packages/orq-rc/src/funcs/knowledgeCreateDatasource.ts +166 -0
  285. package/packages/orq-rc/src/funcs/knowledgeDelete.ts +167 -0
  286. package/packages/orq-rc/src/funcs/knowledgeDeleteChunk.ts +174 -0
  287. package/packages/orq-rc/src/funcs/knowledgeDeleteChunks.ts +170 -0
  288. package/packages/orq-rc/src/funcs/knowledgeDeleteDatasource.ts +173 -0
  289. package/packages/orq-rc/src/funcs/knowledgeGetChunksCount.ts +170 -0
  290. package/packages/orq-rc/src/funcs/knowledgeList.ts +169 -0
  291. package/packages/orq-rc/src/funcs/knowledgeListChunks.ts +178 -0
  292. package/packages/orq-rc/src/funcs/knowledgeListChunksPaginated.ts +171 -0
  293. package/packages/orq-rc/src/funcs/knowledgeListDatasources.ts +174 -0
  294. package/packages/orq-rc/src/funcs/knowledgeRetrieve.ts +166 -0
  295. package/packages/orq-rc/src/funcs/knowledgeRetrieveChunk.ts +173 -0
  296. package/packages/orq-rc/src/funcs/knowledgeRetrieveDatasource.ts +169 -0
  297. package/packages/orq-rc/src/funcs/knowledgeSearch.ts +167 -0
  298. package/packages/orq-rc/src/funcs/knowledgeUpdate.ts +164 -0
  299. package/packages/orq-rc/src/funcs/knowledgeUpdateChunk.ts +174 -0
  300. package/packages/orq-rc/src/funcs/knowledgeUpdateDatasource.ts +170 -0
  301. package/packages/orq-rc/src/funcs/memoryStoresCreate.ts +162 -0
  302. package/packages/orq-rc/src/funcs/memoryStoresCreateDocument.ts +176 -0
  303. package/packages/orq-rc/src/funcs/memoryStoresCreateMemory.ts +170 -0
  304. package/packages/orq-rc/src/funcs/memoryStoresDelete.ts +168 -0
  305. package/packages/orq-rc/src/funcs/memoryStoresDeleteDocument.ts +185 -0
  306. package/packages/orq-rc/src/funcs/memoryStoresDeleteMemory.ts +180 -0
  307. package/packages/orq-rc/src/funcs/memoryStoresList.ts +178 -0
  308. package/packages/orq-rc/src/funcs/memoryStoresListDocuments.ts +184 -0
  309. package/packages/orq-rc/src/funcs/memoryStoresListMemories.ts +177 -0
  310. package/packages/orq-rc/src/funcs/memoryStoresRetrieve.ts +177 -0
  311. package/packages/orq-rc/src/funcs/memoryStoresRetrieveDocument.ts +179 -0
  312. package/packages/orq-rc/src/funcs/memoryStoresRetrieveMemory.ts +174 -0
  313. package/packages/orq-rc/src/funcs/memoryStoresUpdate.ts +168 -0
  314. package/packages/orq-rc/src/funcs/memoryStoresUpdateDocument.ts +180 -0
  315. package/packages/orq-rc/src/funcs/memoryStoresUpdateMemory.ts +175 -0
  316. package/packages/orq-rc/src/funcs/modelsList.ts +142 -0
  317. package/packages/orq-rc/src/funcs/promptsCreate.ts +160 -0
  318. package/packages/orq-rc/src/funcs/promptsDelete.ts +173 -0
  319. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +181 -0
  320. package/packages/orq-rc/src/funcs/promptsList.ts +167 -0
  321. package/packages/orq-rc/src/funcs/promptsListVersions.ts +173 -0
  322. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +166 -0
  323. package/packages/orq-rc/src/funcs/promptsUpdate.ts +173 -0
  324. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +161 -0
  325. package/packages/orq-rc/src/funcs/routerAudioSpeechCreate.ts +161 -0
  326. package/packages/orq-rc/src/funcs/routerAudioTranscriptionsCreate.ts +273 -0
  327. package/packages/orq-rc/src/funcs/routerAudioTranslationsCreate.ts +263 -0
  328. package/packages/orq-rc/src/funcs/routerChatCompletionsCreate.ts +168 -0
  329. package/packages/orq-rc/src/funcs/routerCompletionsCreate.ts +168 -0
  330. package/packages/orq-rc/src/funcs/routerEmbeddingsCreate.ts +161 -0
  331. package/packages/orq-rc/src/funcs/routerImagesEditsCreate.ts +222 -0
  332. package/packages/orq-rc/src/funcs/routerImagesGenerationsCreate.ts +160 -0
  333. package/packages/orq-rc/src/funcs/routerImagesVariationsCreate.ts +218 -0
  334. package/packages/orq-rc/src/funcs/routerModerationsCreate.ts +167 -0
  335. package/packages/orq-rc/src/funcs/routerOcr.ts +158 -0
  336. package/packages/orq-rc/src/funcs/routerRerankCreate.ts +160 -0
  337. package/packages/orq-rc/src/funcs/routerResponsesCreate.ts +167 -0
  338. package/packages/orq-rc/src/funcs/toolsCreate.ts +163 -0
  339. package/packages/orq-rc/src/funcs/toolsDelete.ts +167 -0
  340. package/packages/orq-rc/src/funcs/toolsGetV2ToolsToolIdVersions.ts +183 -0
  341. package/packages/orq-rc/src/funcs/toolsGetV2ToolsToolIdVersionsVersionId.ts +190 -0
  342. package/packages/orq-rc/src/funcs/toolsList.ts +176 -0
  343. package/packages/orq-rc/src/funcs/toolsRetrieve.ts +166 -0
  344. package/packages/orq-rc/src/funcs/toolsUpdate.ts +176 -0
  345. package/packages/orq-rc/src/hooks/global.ts +44 -0
  346. package/packages/orq-rc/src/hooks/hooks.ts +132 -0
  347. package/packages/orq-rc/src/hooks/index.ts +6 -0
  348. package/packages/orq-rc/src/hooks/registration.ts +15 -0
  349. package/packages/orq-rc/src/hooks/types.ts +112 -0
  350. package/packages/orq-rc/src/index.ts +9 -0
  351. package/packages/orq-rc/src/lib/base64.ts +37 -0
  352. package/packages/orq-rc/src/lib/config.ts +74 -0
  353. package/packages/orq-rc/src/lib/dlv.ts +53 -0
  354. package/packages/orq-rc/src/lib/encodings.ts +497 -0
  355. package/packages/orq-rc/src/lib/env.ts +89 -0
  356. package/packages/orq-rc/src/lib/event-streams.ts +161 -0
  357. package/packages/orq-rc/src/lib/files.ts +82 -0
  358. package/packages/orq-rc/src/lib/http.ts +323 -0
  359. package/packages/orq-rc/src/lib/is-plain-object.ts +43 -0
  360. package/packages/orq-rc/src/lib/logger.ts +9 -0
  361. package/packages/orq-rc/src/lib/matchers.ts +346 -0
  362. package/packages/orq-rc/src/lib/primitives.ts +150 -0
  363. package/packages/orq-rc/src/lib/retries.ts +218 -0
  364. package/packages/orq-rc/src/lib/schemas.ts +91 -0
  365. package/packages/orq-rc/src/lib/sdks.ts +407 -0
  366. package/packages/orq-rc/src/lib/security.ts +263 -0
  367. package/packages/orq-rc/src/lib/url.ts +33 -0
  368. package/packages/orq-rc/src/models/components/actionreviewedstreamingevent.ts +99 -0
  369. package/packages/orq-rc/src/models/components/actionreviewrequestedstreamingevent.ts +185 -0
  370. package/packages/orq-rc/src/models/components/agenterroredstreamingevent.ts +73 -0
  371. package/packages/orq-rc/src/models/components/agentexecutionstartedstreamingevent.ts +91 -0
  372. package/packages/orq-rc/src/models/components/agenthandedoffstreamingevent.ts +71 -0
  373. package/packages/orq-rc/src/models/components/agentinactivestreamingevent.ts +507 -0
  374. package/packages/orq-rc/src/models/components/agentmessagecreatedstreamingevent.ts +165 -0
  375. package/packages/orq-rc/src/models/components/agentresponsemessage.ts +103 -0
  376. package/packages/orq-rc/src/models/components/agentstartedstreamingevent.ts +517 -0
  377. package/packages/orq-rc/src/models/components/agentthoughtstreamingevent.ts +807 -0
  378. package/packages/orq-rc/src/models/components/audiocontentpartschema.ts +136 -0
  379. package/packages/orq-rc/src/models/components/createagentresponse.ts +305 -0
  380. package/packages/orq-rc/src/models/components/datapart.ts +38 -0
  381. package/packages/orq-rc/src/models/components/errorpart.ts +58 -0
  382. package/packages/orq-rc/src/models/components/errorstreamingevent.ts +66 -0
  383. package/packages/orq-rc/src/models/components/executionnamedstreamingevent.ts +71 -0
  384. package/packages/orq-rc/src/models/components/executionreviewedstreamingevent.ts +61 -0
  385. package/packages/orq-rc/src/models/components/executionreviewrequiredstreamingevent.ts +67 -0
  386. package/packages/orq-rc/src/models/components/extendedmessage.ts +146 -0
  387. package/packages/orq-rc/src/models/components/filecontentpartschema.ts +87 -0
  388. package/packages/orq-rc/src/models/components/filepart.ts +218 -0
  389. package/packages/orq-rc/src/models/components/getagentresponse.ts +348 -0
  390. package/packages/orq-rc/src/models/components/imagecontentpartschema.ts +268 -0
  391. package/packages/orq-rc/src/models/components/index.ts +59 -0
  392. package/packages/orq-rc/src/models/components/invokedeploymentrequest.ts +3450 -0
  393. package/packages/orq-rc/src/models/components/partdelta.ts +39 -0
  394. package/packages/orq-rc/src/models/components/partdeltaevent.ts +73 -0
  395. package/packages/orq-rc/src/models/components/partdoneevent.ts +139 -0
  396. package/packages/orq-rc/src/models/components/publiccontact.ts +71 -0
  397. package/packages/orq-rc/src/models/components/publicidentity.ts +69 -0
  398. package/packages/orq-rc/src/models/components/reasoningpart.ts +62 -0
  399. package/packages/orq-rc/src/models/components/reasoningpartschema.ts +71 -0
  400. package/packages/orq-rc/src/models/components/redactedreasoningpartschema.ts +66 -0
  401. package/packages/orq-rc/src/models/components/refusalpartschema.ts +64 -0
  402. package/packages/orq-rc/src/models/components/responsedoneevent.ts +324 -0
  403. package/packages/orq-rc/src/models/components/responsefailedevent.ts +72 -0
  404. package/packages/orq-rc/src/models/components/responsestartedevent.ts +97 -0
  405. package/packages/orq-rc/src/models/components/responsestreamingevent.ts +85 -0
  406. package/packages/orq-rc/src/models/components/reviewoutcome.ts +23 -0
  407. package/packages/orq-rc/src/models/components/security.ts +32 -0
  408. package/packages/orq-rc/src/models/components/telemetry.ts +48 -0
  409. package/packages/orq-rc/src/models/components/textcontentpartschema.ts +207 -0
  410. package/packages/orq-rc/src/models/components/textpart.ts +54 -0
  411. package/packages/orq-rc/src/models/components/thinkingconfigdisabledschema.ts +59 -0
  412. package/packages/orq-rc/src/models/components/thinkingconfigenabledschema.ts +106 -0
  413. package/packages/orq-rc/src/models/components/timeoutstreamingevent.ts +64 -0
  414. package/packages/orq-rc/src/models/components/toolcallpart.ts +51 -0
  415. package/packages/orq-rc/src/models/components/tooldoneevent.ts +77 -0
  416. package/packages/orq-rc/src/models/components/toolexecutionfailedstreamingevent.ts +230 -0
  417. package/packages/orq-rc/src/models/components/toolexecutionfinishedstreamingevent.ts +214 -0
  418. package/packages/orq-rc/src/models/components/toolexecutionstartedstreamingevent.ts +200 -0
  419. package/packages/orq-rc/src/models/components/toolfailedevent.ts +77 -0
  420. package/packages/orq-rc/src/models/components/toolresultpart.ts +71 -0
  421. package/packages/orq-rc/src/models/components/toolreviewdoneevent.ts +78 -0
  422. package/packages/orq-rc/src/models/components/toolreviewrequestedevent.ts +87 -0
  423. package/packages/orq-rc/src/models/components/toolstartedevent.ts +82 -0
  424. package/packages/orq-rc/src/models/errors/apierror.ts +40 -0
  425. package/packages/orq-rc/src/models/errors/createeval.ts +51 -0
  426. package/packages/orq-rc/src/models/errors/createmoderation.ts +84 -0
  427. package/packages/orq-rc/src/models/errors/createtranscription.ts +87 -0
  428. package/packages/orq-rc/src/models/errors/createtranslation.ts +87 -0
  429. package/packages/orq-rc/src/models/errors/deleteagent.ts +51 -0
  430. package/packages/orq-rc/src/models/errors/deleteeval.ts +51 -0
  431. package/packages/orq-rc/src/models/errors/deleteidentity.ts +62 -0
  432. package/packages/orq-rc/src/models/errors/deleteprompt.ts +51 -0
  433. package/packages/orq-rc/src/models/errors/getevals.ts +51 -0
  434. package/packages/orq-rc/src/models/errors/getpromptversion.ts +51 -0
  435. package/packages/orq-rc/src/models/errors/getv2evaluatorsidversions.ts +51 -0
  436. package/packages/orq-rc/src/models/errors/getv2toolstoolidversions.ts +51 -0
  437. package/packages/orq-rc/src/models/errors/getv2toolstoolidversionsversionid.ts +52 -0
  438. package/packages/orq-rc/src/models/errors/honoapierror.ts +59 -0
  439. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +62 -0
  440. package/packages/orq-rc/src/models/errors/index.ts +35 -0
  441. package/packages/orq-rc/src/models/errors/invokeeval.ts +141 -0
  442. package/packages/orq-rc/src/models/errors/orqerror.ts +35 -0
  443. package/packages/orq-rc/src/models/errors/postv2agentsa2a.ts +96 -0
  444. package/packages/orq-rc/src/models/errors/postv2agentskeycardrefresh.ts +97 -0
  445. package/packages/orq-rc/src/models/errors/responsevalidationerror.ts +50 -0
  446. package/packages/orq-rc/src/models/errors/retrieveagentrequest.ts +51 -0
  447. package/packages/orq-rc/src/models/errors/retrieveidentity.ts +62 -0
  448. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +109 -0
  449. package/packages/orq-rc/src/models/errors/streamagent.ts +51 -0
  450. package/packages/orq-rc/src/models/errors/streamrunagent.ts +51 -0
  451. package/packages/orq-rc/src/models/errors/updateagent.ts +51 -0
  452. package/packages/orq-rc/src/models/errors/updateeval.ts +51 -0
  453. package/packages/orq-rc/src/models/errors/updateidentity.ts +54 -0
  454. package/packages/orq-rc/src/models/errors/updateprompt.ts +51 -0
  455. package/packages/orq-rc/src/models/errors/updatetool.ts +62 -0
  456. package/packages/orq-rc/src/models/operations/cleardataset.ts +39 -0
  457. package/packages/orq-rc/src/models/operations/createagentrequest.ts +6393 -0
  458. package/packages/orq-rc/src/models/operations/createagentresponserequest.ts +644 -0
  459. package/packages/orq-rc/src/models/operations/createannotation.ts +166 -0
  460. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +6392 -0
  461. package/packages/orq-rc/src/models/operations/createchunk.ts +222 -0
  462. package/packages/orq-rc/src/models/operations/createcompletion.ts +3418 -0
  463. package/packages/orq-rc/src/models/operations/createcontact.ts +156 -0
  464. package/packages/orq-rc/src/models/operations/createdataset.ts +162 -0
  465. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2551 -0
  466. package/packages/orq-rc/src/models/operations/createdatasource.ts +437 -0
  467. package/packages/orq-rc/src/models/operations/createembedding.ts +947 -0
  468. package/packages/orq-rc/src/models/operations/createeval.ts +4170 -0
  469. package/packages/orq-rc/src/models/operations/createfeedback.ts +144 -0
  470. package/packages/orq-rc/src/models/operations/createidentity.ts +162 -0
  471. package/packages/orq-rc/src/models/operations/createimage.ts +1028 -0
  472. package/packages/orq-rc/src/models/operations/createimageedit.ts +1045 -0
  473. package/packages/orq-rc/src/models/operations/createimagevariation.ts +1067 -0
  474. package/packages/orq-rc/src/models/operations/createknowledge.ts +944 -0
  475. package/packages/orq-rc/src/models/operations/creatememory.ts +142 -0
  476. package/packages/orq-rc/src/models/operations/creatememorydocument.ts +152 -0
  477. package/packages/orq-rc/src/models/operations/creatememorystore.ts +199 -0
  478. package/packages/orq-rc/src/models/operations/createmoderation.ts +664 -0
  479. package/packages/orq-rc/src/models/operations/createprompt.ts +5391 -0
  480. package/packages/orq-rc/src/models/operations/creatererank.ts +890 -0
  481. package/packages/orq-rc/src/models/operations/createresponse.ts +3325 -0
  482. package/packages/orq-rc/src/models/operations/createspeech.ts +700 -0
  483. package/packages/orq-rc/src/models/operations/createtool.ts +2499 -0
  484. package/packages/orq-rc/src/models/operations/createtranscription.ts +955 -0
  485. package/packages/orq-rc/src/models/operations/createtranslation.ts +930 -0
  486. package/packages/orq-rc/src/models/operations/deleteagent.ts +39 -0
  487. package/packages/orq-rc/src/models/operations/deleteannotation.ts +79 -0
  488. package/packages/orq-rc/src/models/operations/deletechunk.ts +53 -0
  489. package/packages/orq-rc/src/models/operations/deletechunks.ts +125 -0
  490. package/packages/orq-rc/src/models/operations/deletedatapoint.ts +46 -0
  491. package/packages/orq-rc/src/models/operations/deletedataset.ts +39 -0
  492. package/packages/orq-rc/src/models/operations/deletedatasource.ts +46 -0
  493. package/packages/orq-rc/src/models/operations/deleteeval.ts +31 -0
  494. package/packages/orq-rc/src/models/operations/deleteidentity.ts +34 -0
  495. package/packages/orq-rc/src/models/operations/deleteknowledge.ts +39 -0
  496. package/packages/orq-rc/src/models/operations/deletememory.ts +46 -0
  497. package/packages/orq-rc/src/models/operations/deletememorydocument.ts +55 -0
  498. package/packages/orq-rc/src/models/operations/deletememorystore.ts +39 -0
  499. package/packages/orq-rc/src/models/operations/deleteprompt.ts +34 -0
  500. package/packages/orq-rc/src/models/operations/deletetool.ts +36 -0
  501. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +2370 -0
  502. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +4525 -0
  503. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +729 -0
  504. package/packages/orq-rc/src/models/operations/deployments.ts +1269 -0
  505. package/packages/orq-rc/src/models/operations/deploymentstream.ts +4653 -0
  506. package/packages/orq-rc/src/models/operations/filedelete.ts +39 -0
  507. package/packages/orq-rc/src/models/operations/fileget.ts +116 -0
  508. package/packages/orq-rc/src/models/operations/filelist.ts +172 -0
  509. package/packages/orq-rc/src/models/operations/fileupload.ts +170 -0
  510. package/packages/orq-rc/src/models/operations/getagentresponse.ts +46 -0
  511. package/packages/orq-rc/src/models/operations/getallmemories.ts +173 -0
  512. package/packages/orq-rc/src/models/operations/getallmemorydocuments.ts +188 -0
  513. package/packages/orq-rc/src/models/operations/getallmemorystores.ts +200 -0
  514. package/packages/orq-rc/src/models/operations/getallprompts.ts +3165 -0
  515. package/packages/orq-rc/src/models/operations/getalltools.ts +1398 -0
  516. package/packages/orq-rc/src/models/operations/getchunkscount.ts +121 -0
  517. package/packages/orq-rc/src/models/operations/getevals.ts +2842 -0
  518. package/packages/orq-rc/src/models/operations/getonechunk.ts +171 -0
  519. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +652 -0
  520. package/packages/orq-rc/src/models/operations/getoneprompt.ts +3090 -0
  521. package/packages/orq-rc/src/models/operations/getpromptversion.ts +3135 -0
  522. package/packages/orq-rc/src/models/operations/getv2evaluatorsidversions.ts +162 -0
  523. package/packages/orq-rc/src/models/operations/getv2toolstoolidversions.ts +163 -0
  524. package/packages/orq-rc/src/models/operations/getv2toolstoolidversionsversionid.ts +110 -0
  525. package/packages/orq-rc/src/models/operations/index.ts +116 -0
  526. package/packages/orq-rc/src/models/operations/invokeagent.ts +777 -0
  527. package/packages/orq-rc/src/models/operations/invokeeval.ts +1253 -0
  528. package/packages/orq-rc/src/models/operations/listagents.ts +2754 -0
  529. package/packages/orq-rc/src/models/operations/listchunks.ts +260 -0
  530. package/packages/orq-rc/src/models/operations/listchunkspaginated.ts +263 -0
  531. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +1498 -0
  532. package/packages/orq-rc/src/models/operations/listdatasets.ts +205 -0
  533. package/packages/orq-rc/src/models/operations/listdatasources.ts +235 -0
  534. package/packages/orq-rc/src/models/operations/listidentities.ts +275 -0
  535. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +642 -0
  536. package/packages/orq-rc/src/models/operations/listmodels.ts +143 -0
  537. package/packages/orq-rc/src/models/operations/listpromptversions.ts +3210 -0
  538. package/packages/orq-rc/src/models/operations/parse.ts +777 -0
  539. package/packages/orq-rc/src/models/operations/postv2agentsa2a.ts +252 -0
  540. package/packages/orq-rc/src/models/operations/postv2agentskeycardrefresh.ts +100 -0
  541. package/packages/orq-rc/src/models/operations/postv2routerocr.ts +478 -0
  542. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +108 -0
  543. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +2814 -0
  544. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +1402 -0
  545. package/packages/orq-rc/src/models/operations/retrievedataset.ts +150 -0
  546. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +152 -0
  547. package/packages/orq-rc/src/models/operations/retrieveidentity.ts +117 -0
  548. package/packages/orq-rc/src/models/operations/retrievememory.ts +112 -0
  549. package/packages/orq-rc/src/models/operations/retrievememorydocument.ts +118 -0
  550. package/packages/orq-rc/src/models/operations/retrievememorystore.ts +144 -0
  551. package/packages/orq-rc/src/models/operations/retrievetool.ts +1379 -0
  552. package/packages/orq-rc/src/models/operations/runagent.ts +4927 -0
  553. package/packages/orq-rc/src/models/operations/searchknowledge.ts +1762 -0
  554. package/packages/orq-rc/src/models/operations/streamagent.ts +668 -0
  555. package/packages/orq-rc/src/models/operations/streamrunagent.ts +5089 -0
  556. package/packages/orq-rc/src/models/operations/updateagent.ts +6824 -0
  557. package/packages/orq-rc/src/models/operations/updatechunk.ts +236 -0
  558. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2555 -0
  559. package/packages/orq-rc/src/models/operations/updatedataset.ts +206 -0
  560. package/packages/orq-rc/src/models/operations/updatedatasource.ts +186 -0
  561. package/packages/orq-rc/src/models/operations/updateeval.ts +4152 -0
  562. package/packages/orq-rc/src/models/operations/updateidentity.ts +189 -0
  563. package/packages/orq-rc/src/models/operations/updateknowledge.ts +1231 -0
  564. package/packages/orq-rc/src/models/operations/updatememory.ts +142 -0
  565. package/packages/orq-rc/src/models/operations/updatememorydocument.ts +159 -0
  566. package/packages/orq-rc/src/models/operations/updatememorystore.ts +188 -0
  567. package/packages/orq-rc/src/models/operations/updateprompt.ts +5473 -0
  568. package/packages/orq-rc/src/models/operations/updatetool.ts +2810 -0
  569. package/packages/orq-rc/src/sdk/agents.ts +234 -0
  570. package/packages/orq-rc/src/sdk/annotations.ts +39 -0
  571. package/packages/orq-rc/src/sdk/audio.ts +25 -0
  572. package/packages/orq-rc/src/sdk/chat.ts +13 -0
  573. package/packages/orq-rc/src/sdk/chunking.ts +27 -0
  574. package/packages/orq-rc/src/sdk/completions.ts +32 -0
  575. package/packages/orq-rc/src/sdk/contacts.ts +27 -0
  576. package/packages/orq-rc/src/sdk/datasets.ts +204 -0
  577. package/packages/orq-rc/src/sdk/deployments.ts +89 -0
  578. package/packages/orq-rc/src/sdk/edits.ts +27 -0
  579. package/packages/orq-rc/src/sdk/embeddings.ts +27 -0
  580. package/packages/orq-rc/src/sdk/evals.ts +84 -0
  581. package/packages/orq-rc/src/sdk/evaluators.ts +27 -0
  582. package/packages/orq-rc/src/sdk/feedback.ts +27 -0
  583. package/packages/orq-rc/src/sdk/files.ts +78 -0
  584. package/packages/orq-rc/src/sdk/generations.ts +27 -0
  585. package/packages/orq-rc/src/sdk/identities.ts +99 -0
  586. package/packages/orq-rc/src/sdk/images.ts +25 -0
  587. package/packages/orq-rc/src/sdk/index.ts +5 -0
  588. package/packages/orq-rc/src/sdk/knowledge.ts +309 -0
  589. package/packages/orq-rc/src/sdk/memorystores.ts +286 -0
  590. package/packages/orq-rc/src/sdk/metrics.ts +27 -0
  591. package/packages/orq-rc/src/sdk/models.ts +25 -0
  592. package/packages/orq-rc/src/sdk/moderations.ts +24 -0
  593. package/packages/orq-rc/src/sdk/orqcompletions.ts +32 -0
  594. package/packages/orq-rc/src/sdk/orqresponses.ts +32 -0
  595. package/packages/orq-rc/src/sdk/prompts.ts +126 -0
  596. package/packages/orq-rc/src/sdk/remoteconfigs.ts +24 -0
  597. package/packages/orq-rc/src/sdk/rerank.ts +27 -0
  598. package/packages/orq-rc/src/sdk/responses.ts +53 -0
  599. package/packages/orq-rc/src/sdk/router.ts +72 -0
  600. package/packages/orq-rc/src/sdk/sdk.ts +115 -0
  601. package/packages/orq-rc/src/sdk/speech.ts +27 -0
  602. package/packages/orq-rc/src/sdk/tools.ts +135 -0
  603. package/packages/orq-rc/src/sdk/transcriptions.ts +24 -0
  604. package/packages/orq-rc/src/sdk/translations.ts +24 -0
  605. package/packages/orq-rc/src/sdk/variations.ts +27 -0
  606. package/packages/orq-rc/src/types/async.ts +68 -0
  607. package/packages/orq-rc/src/types/blobs.ts +32 -0
  608. package/packages/orq-rc/src/types/constdatetime.ts +15 -0
  609. package/packages/orq-rc/src/types/enums.ts +45 -0
  610. package/packages/orq-rc/src/types/fp.ts +50 -0
  611. package/packages/orq-rc/src/types/index.ts +11 -0
  612. package/packages/orq-rc/src/types/operations.ts +105 -0
  613. package/packages/orq-rc/src/types/rfcdate.ts +54 -0
  614. package/packages/orq-rc/src/types/streams.ts +21 -0
  615. package/packages/orq-rc/src/types/unrecognized.ts +35 -0
  616. package/sdk/agents.d.ts +16 -2
  617. package/sdk/agents.d.ts.map +1 -1
  618. package/sdk/agents.js +22 -2
  619. package/sdk/agents.js.map +1 -1
  620. package/sdk/files.d.ts +1 -1
  621. package/sdk/files.js +1 -1
  622. package/sdk/responses.d.ts +8 -0
  623. package/sdk/responses.d.ts.map +1 -1
  624. package/sdk/responses.js +10 -0
  625. package/sdk/responses.js.map +1 -1
  626. package/src/funcs/agentsList.ts +5 -0
  627. package/src/funcs/agentsPostV2AgentsA2a.ts +178 -0
  628. package/src/funcs/agentsPostV2AgentsKeyCardRefresh.ts +187 -0
  629. package/src/funcs/agentsResponsesGet.ts +182 -0
  630. package/src/funcs/agentsStream.ts +4 -1
  631. package/src/funcs/agentsStreamRun.ts +4 -1
  632. package/src/funcs/agentsUpdate.ts +2 -2
  633. package/src/funcs/deploymentsStream.ts +4 -1
  634. package/src/funcs/filesCreate.ts +12 -1
  635. package/src/funcs/routerAudioTranscriptionsCreate.ts +11 -0
  636. package/src/funcs/routerAudioTranslationsCreate.ts +11 -0
  637. package/src/lib/config.ts +3 -3
  638. package/src/lib/event-streams.ts +10 -1
  639. package/src/lib/matchers.ts +3 -2
  640. package/src/lib/security.ts +1 -2
  641. package/src/models/components/createagentresponse.ts +6 -0
  642. package/src/models/components/extendedmessage.ts +146 -0
  643. package/src/models/components/getagentresponse.ts +348 -0
  644. package/src/models/components/index.ts +3 -0
  645. package/src/models/components/partdoneevent.ts +1 -1
  646. package/src/models/components/reasoningpart.ts +1 -1
  647. package/src/models/components/responsedoneevent.ts +6 -0
  648. package/src/models/components/responsestartedevent.ts +6 -0
  649. package/src/models/components/telemetry.ts +48 -0
  650. package/src/models/errors/index.ts +2 -0
  651. package/src/models/errors/postv2agentsa2a.ts +96 -0
  652. package/src/models/errors/postv2agentskeycardrefresh.ts +97 -0
  653. package/src/models/operations/createagentrequest.ts +243 -943
  654. package/src/models/operations/createagentresponserequest.ts +37 -2
  655. package/src/models/operations/createannotation.ts +5 -1
  656. package/src/models/operations/createchatcompletion.ts +14 -3
  657. package/src/models/operations/createcompletion.ts +8 -3
  658. package/src/models/operations/createcontact.ts +1 -1
  659. package/src/models/operations/createdataset.ts +1 -1
  660. package/src/models/operations/createdatasetitem.ts +4 -4
  661. package/src/models/operations/createdatasource.ts +1 -1
  662. package/src/models/operations/createeval.ts +16 -16
  663. package/src/models/operations/createfeedback.ts +2 -2
  664. package/src/models/operations/createidentity.ts +1 -1
  665. package/src/models/operations/createprompt.ts +59 -69
  666. package/src/models/operations/createresponse.ts +2 -1
  667. package/src/models/operations/createtool.ts +6 -6
  668. package/src/models/operations/deploymentinvoke.ts +39 -0
  669. package/src/models/operations/deployments.ts +1 -0
  670. package/src/models/operations/deploymentstream.ts +39 -0
  671. package/src/models/operations/fileget.ts +1 -1
  672. package/src/models/operations/filelist.ts +1 -1
  673. package/src/models/operations/fileupload.ts +1 -1
  674. package/src/models/operations/getagentresponse.ts +46 -0
  675. package/src/models/operations/getallprompts.ts +1 -0
  676. package/src/models/operations/getalltools.ts +6 -6
  677. package/src/models/operations/getevals.ts +16 -16
  678. package/src/models/operations/getoneprompt.ts +1 -0
  679. package/src/models/operations/getpromptversion.ts +1 -0
  680. package/src/models/operations/index.ts +3 -0
  681. package/src/models/operations/invokeagent.ts +45 -1
  682. package/src/models/operations/listagents.ts +218 -482
  683. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  684. package/src/models/operations/listdatasets.ts +1 -1
  685. package/src/models/operations/listdatasources.ts +1 -1
  686. package/src/models/operations/listidentities.ts +1 -1
  687. package/src/models/operations/listpromptversions.ts +1 -0
  688. package/src/models/operations/postv2agentsa2a.ts +252 -0
  689. package/src/models/operations/postv2agentskeycardrefresh.ts +100 -0
  690. package/src/models/operations/retrieveagentrequest.ts +207 -497
  691. package/src/models/operations/retrievedatapoint.ts +4 -4
  692. package/src/models/operations/retrievedataset.ts +1 -1
  693. package/src/models/operations/retrievedatasource.ts +1 -1
  694. package/src/models/operations/retrieveidentity.ts +1 -1
  695. package/src/models/operations/retrievetool.ts +6 -6
  696. package/src/models/operations/runagent.ts +69 -493
  697. package/src/models/operations/streamagent.ts +40 -1
  698. package/src/models/operations/streamrunagent.ts +36 -493
  699. package/src/models/operations/updateagent.ts +380 -1003
  700. package/src/models/operations/updatedatapoint.ts +4 -4
  701. package/src/models/operations/updatedataset.ts +1 -1
  702. package/src/models/operations/updatedatasource.ts +1 -1
  703. package/src/models/operations/updateeval.ts +102 -16
  704. package/src/models/operations/updateidentity.ts +1 -1
  705. package/src/models/operations/updatememorystore.ts +3 -61
  706. package/src/models/operations/updateprompt.ts +1 -0
  707. package/src/models/operations/updatetool.ts +121 -7
  708. package/src/sdk/agents.ts +39 -1
  709. package/src/sdk/files.ts +1 -1
  710. package/src/sdk/responses.ts +19 -0
@@ -0,0 +1,4927 @@
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 RunAgentResponseFormatAgentsJsonSchema = {
14
+ /**
15
+ * A description of what the response format is for, used by the model to determine how to respond in the format.
16
+ */
17
+ description?: string | undefined;
18
+ /**
19
+ * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
20
+ */
21
+ name: string;
22
+ /**
23
+ * The schema for the response format, described as a JSON Schema object.
24
+ */
25
+ schema?: any | undefined;
26
+ /**
27
+ * Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is true.
28
+ */
29
+ strict?: boolean | undefined;
30
+ };
31
+
32
+ /**
33
+ * @remarks
34
+ *
35
+ * JSON Schema response format. Used to generate structured JSON responses
36
+ */
37
+ export type RunAgentResponseFormatJSONSchema = {
38
+ type: "json_schema";
39
+ jsonSchema: RunAgentResponseFormatAgentsJsonSchema;
40
+ };
41
+
42
+ /**
43
+ * @remarks
44
+ *
45
+ * JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
46
+ */
47
+ export type RunAgentResponseFormatJSONObject = {
48
+ type: "json_object";
49
+ };
50
+
51
+ /**
52
+ * @remarks
53
+ *
54
+ * Default response format. Used to generate text responses
55
+ */
56
+ export type RunAgentResponseFormatText = {
57
+ type: "text";
58
+ };
59
+
60
+ /**
61
+ * An object specifying the format that the model must output
62
+ */
63
+ export type RunAgentModelConfigurationResponseFormat =
64
+ | RunAgentResponseFormatText
65
+ | RunAgentResponseFormatJSONObject
66
+ | RunAgentResponseFormatJSONSchema;
67
+
68
+ /**
69
+ * Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
70
+ *
71
+ * @remarks
72
+ *
73
+ * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
74
+ * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
75
+ * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
76
+ * - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
77
+ *
78
+ * Any of "none", "minimal", "low", "medium", "high", "xhigh".
79
+ */
80
+ export const RunAgentModelConfigurationReasoningEffort = {
81
+ None: "none",
82
+ Minimal: "minimal",
83
+ Low: "low",
84
+ Medium: "medium",
85
+ High: "high",
86
+ Xhigh: "xhigh",
87
+ } as const;
88
+ /**
89
+ * Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
90
+ *
91
+ * @remarks
92
+ *
93
+ * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
94
+ * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
95
+ * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
96
+ * - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
97
+ *
98
+ * Any of "none", "minimal", "low", "medium", "high", "xhigh".
99
+ */
100
+ export type RunAgentModelConfigurationReasoningEffort = ClosedEnum<
101
+ typeof RunAgentModelConfigurationReasoningEffort
102
+ >;
103
+
104
+ /**
105
+ * Up to 4 sequences where the API will stop generating further tokens.
106
+ */
107
+ export type RunAgentModelConfigurationStop = string | Array<string>;
108
+
109
+ export type RunAgentModelConfigurationThinking =
110
+ | components.ThinkingConfigDisabledSchema
111
+ | components.ThinkingConfigEnabledSchema;
112
+
113
+ /**
114
+ * The type of the tool. Currently, only function is supported.
115
+ */
116
+ export const RunAgentToolChoiceType = {
117
+ Function: "function",
118
+ } as const;
119
+ /**
120
+ * The type of the tool. Currently, only function is supported.
121
+ */
122
+ export type RunAgentToolChoiceType = ClosedEnum<typeof RunAgentToolChoiceType>;
123
+
124
+ export type RunAgentToolChoiceFunction = {
125
+ /**
126
+ * The name of the function to call.
127
+ */
128
+ name: string;
129
+ };
130
+
131
+ export type RunAgentToolChoice2 = {
132
+ /**
133
+ * The type of the tool. Currently, only function is supported.
134
+ */
135
+ type?: RunAgentToolChoiceType | undefined;
136
+ function: RunAgentToolChoiceFunction;
137
+ };
138
+
139
+ export const RunAgentToolChoice1 = {
140
+ None: "none",
141
+ Auto: "auto",
142
+ Required: "required",
143
+ } as const;
144
+ export type RunAgentToolChoice1 = ClosedEnum<typeof RunAgentToolChoice1>;
145
+
146
+ /**
147
+ * Controls which (if any) tool is called by the model.
148
+ */
149
+ export type RunAgentModelConfigurationToolChoice =
150
+ | RunAgentToolChoice2
151
+ | RunAgentToolChoice1;
152
+
153
+ export const RunAgentModelConfigurationModalities = {
154
+ Text: "text",
155
+ Audio: "audio",
156
+ } as const;
157
+ export type RunAgentModelConfigurationModalities = ClosedEnum<
158
+ typeof RunAgentModelConfigurationModalities
159
+ >;
160
+
161
+ /**
162
+ * The key of the guardrail.
163
+ */
164
+ export const RunAgentId1 = {
165
+ OrqPiiDetection: "orq_pii_detection",
166
+ OrqSexualModeration: "orq_sexual_moderation",
167
+ OrqHarmfulModeration: "orq_harmful_moderation",
168
+ } as const;
169
+ /**
170
+ * The key of the guardrail.
171
+ */
172
+ export type RunAgentId1 = ClosedEnum<typeof RunAgentId1>;
173
+
174
+ export type RunAgentModelConfigurationId = RunAgentId1 | string;
175
+
176
+ /**
177
+ * Determines whether the guardrail runs on the input (user message) or output (model response).
178
+ */
179
+ export const RunAgentModelConfigurationExecuteOn = {
180
+ Input: "input",
181
+ Output: "output",
182
+ } as const;
183
+ /**
184
+ * Determines whether the guardrail runs on the input (user message) or output (model response).
185
+ */
186
+ export type RunAgentModelConfigurationExecuteOn = ClosedEnum<
187
+ typeof RunAgentModelConfigurationExecuteOn
188
+ >;
189
+
190
+ export type RunAgentModelConfigurationGuardrails = {
191
+ id: RunAgentId1 | string;
192
+ /**
193
+ * Determines whether the guardrail runs on the input (user message) or output (model response).
194
+ */
195
+ executeOn: RunAgentModelConfigurationExecuteOn;
196
+ };
197
+
198
+ export type RunAgentModelConfigurationFallbacks = {
199
+ /**
200
+ * Fallback model identifier
201
+ */
202
+ model: string;
203
+ };
204
+
205
+ export const RunAgentModelConfigurationType = {
206
+ ExactMatch: "exact_match",
207
+ } as const;
208
+ export type RunAgentModelConfigurationType = ClosedEnum<
209
+ typeof RunAgentModelConfigurationType
210
+ >;
211
+
212
+ /**
213
+ * Cache configuration for the request.
214
+ */
215
+ export type RunAgentModelConfigurationCache = {
216
+ /**
217
+ * Time to live for cached responses in seconds. Maximum 259200 seconds (3 days).
218
+ */
219
+ ttl?: number | undefined;
220
+ type: RunAgentModelConfigurationType;
221
+ };
222
+
223
+ export const RunAgentLoadBalancerType = {
224
+ WeightBased: "weight_based",
225
+ } as const;
226
+ export type RunAgentLoadBalancerType = ClosedEnum<
227
+ typeof RunAgentLoadBalancerType
228
+ >;
229
+
230
+ export type RunAgentLoadBalancerModels = {
231
+ /**
232
+ * Model identifier for load balancing
233
+ */
234
+ model: string;
235
+ /**
236
+ * Weight assigned to this model for load balancing
237
+ */
238
+ weight?: number | undefined;
239
+ };
240
+
241
+ export type RunAgentLoadBalancer1 = {
242
+ type: RunAgentLoadBalancerType;
243
+ models: Array<RunAgentLoadBalancerModels>;
244
+ };
245
+
246
+ /**
247
+ * Load balancer configuration for the request.
248
+ */
249
+ export type RunAgentModelConfigurationLoadBalancer = RunAgentLoadBalancer1;
250
+
251
+ /**
252
+ * Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured.
253
+ */
254
+ export type RunAgentModelConfigurationTimeout = {
255
+ /**
256
+ * Timeout value in milliseconds
257
+ */
258
+ callTimeout: number;
259
+ };
260
+
261
+ /**
262
+ * Model behavior parameters that control how the model generates responses. Common parameters: `temperature` (0-1, randomness), `max_completion_tokens` (max output length), `top_p` (sampling diversity). Advanced: `frequency_penalty`, `presence_penalty`, `response_format` (JSON/structured), `reasoning_effort`, `seed` (reproducibility). Support varies by model - consult AI Gateway documentation.
263
+ */
264
+ export type RunAgentModelConfigurationParameters = {
265
+ /**
266
+ * The name to display on the trace. If not specified, the default system name will be used.
267
+ */
268
+ name?: string | undefined;
269
+ /**
270
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
271
+ */
272
+ frequencyPenalty?: number | null | undefined;
273
+ /**
274
+ * `[Deprecated]`. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API.
275
+ *
276
+ * @remarks
277
+ *
278
+ * This value is now `deprecated` in favor of `max_completion_tokens`, and is not compatible with o1 series models.
279
+ */
280
+ maxTokens?: number | null | undefined;
281
+ /**
282
+ * An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens
283
+ */
284
+ maxCompletionTokens?: number | null | undefined;
285
+ /**
286
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
287
+ */
288
+ presencePenalty?: number | null | undefined;
289
+ /**
290
+ * An object specifying the format that the model must output
291
+ */
292
+ responseFormat?:
293
+ | RunAgentResponseFormatText
294
+ | RunAgentResponseFormatJSONObject
295
+ | RunAgentResponseFormatJSONSchema
296
+ | undefined;
297
+ /**
298
+ * Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
299
+ *
300
+ * @remarks
301
+ *
302
+ * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
303
+ * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
304
+ * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
305
+ * - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
306
+ *
307
+ * Any of "none", "minimal", "low", "medium", "high", "xhigh".
308
+ */
309
+ reasoningEffort?: RunAgentModelConfigurationReasoningEffort | undefined;
310
+ /**
311
+ * Adjusts response verbosity. Lower levels yield shorter answers.
312
+ */
313
+ verbosity?: string | undefined;
314
+ /**
315
+ * If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
316
+ */
317
+ seed?: number | null | undefined;
318
+ /**
319
+ * Up to 4 sequences where the API will stop generating further tokens.
320
+ */
321
+ stop?: string | Array<string> | null | undefined;
322
+ thinking?:
323
+ | components.ThinkingConfigDisabledSchema
324
+ | components.ThinkingConfigEnabledSchema
325
+ | undefined;
326
+ /**
327
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
328
+ */
329
+ temperature?: number | null | undefined;
330
+ /**
331
+ * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
332
+ */
333
+ topP?: number | null | undefined;
334
+ /**
335
+ * Limits the model to consider only the top k most likely tokens at each step.
336
+ */
337
+ topK?: number | null | undefined;
338
+ /**
339
+ * Controls which (if any) tool is called by the model.
340
+ */
341
+ toolChoice?: RunAgentToolChoice2 | RunAgentToolChoice1 | undefined;
342
+ /**
343
+ * Whether to enable parallel function calling during tool use.
344
+ */
345
+ parallelToolCalls?: boolean | undefined;
346
+ /**
347
+ * Output types that you would like the model to generate. Most models are capable of generating text, which is the default: ["text"]. The gpt-4o-audio-preview model can also be used to generate audio. To request that this model generate both text and audio responses, you can use: ["text", "audio"].
348
+ */
349
+ modalities?: Array<RunAgentModelConfigurationModalities> | null | undefined;
350
+ /**
351
+ * A list of guardrails to apply to the request.
352
+ */
353
+ guardrails?: Array<RunAgentModelConfigurationGuardrails> | undefined;
354
+ /**
355
+ * Array of fallback models to use if primary model fails
356
+ */
357
+ fallbacks?: Array<RunAgentModelConfigurationFallbacks> | undefined;
358
+ /**
359
+ * Cache configuration for the request.
360
+ */
361
+ cache?: RunAgentModelConfigurationCache | undefined;
362
+ /**
363
+ * Load balancer configuration for the request.
364
+ */
365
+ loadBalancer?: RunAgentLoadBalancer1 | undefined;
366
+ /**
367
+ * Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured.
368
+ */
369
+ timeout?: RunAgentModelConfigurationTimeout | undefined;
370
+ };
371
+
372
+ /**
373
+ * Retry configuration for model requests. Retries are triggered for specific HTTP status codes (e.g., 500, 429, 502, 503, 504). Supports configurable retry count (1-5) and custom status codes.
374
+ */
375
+ export type RunAgentModelConfigurationRetry = {
376
+ /**
377
+ * Number of retry attempts (1-5)
378
+ */
379
+ count?: number | undefined;
380
+ /**
381
+ * HTTP status codes that trigger retry logic
382
+ */
383
+ onCodes?: Array<number> | undefined;
384
+ };
385
+
386
+ /**
387
+ * @remarks
388
+ *
389
+ * Model configuration with parameters and retry settings.
390
+ */
391
+ export type RunAgentModelConfiguration2 = {
392
+ /**
393
+ * A model ID string (e.g., `openai/gpt-4o` or `anthropic/claude-haiku-4-5-20251001`). Only models that support tool calling can be used with agents.
394
+ */
395
+ id: string;
396
+ /**
397
+ * Model behavior parameters that control how the model generates responses. Common parameters: `temperature` (0-1, randomness), `max_completion_tokens` (max output length), `top_p` (sampling diversity). Advanced: `frequency_penalty`, `presence_penalty`, `response_format` (JSON/structured), `reasoning_effort`, `seed` (reproducibility). Support varies by model - consult AI Gateway documentation.
398
+ */
399
+ parameters?: RunAgentModelConfigurationParameters | undefined;
400
+ /**
401
+ * Retry configuration for model requests. Retries are triggered for specific HTTP status codes (e.g., 500, 429, 502, 503, 504). Supports configurable retry count (1-5) and custom status codes.
402
+ */
403
+ retry?: RunAgentModelConfigurationRetry | undefined;
404
+ };
405
+
406
+ /**
407
+ * Model configuration for this execution. Can override the agent manifest defaults if the agent already exists.
408
+ */
409
+ export type RunAgentModelConfiguration = RunAgentModelConfiguration2 | string;
410
+
411
+ export type RunAgentResponseFormatAgentsRequestRequestBodyJsonSchema = {
412
+ /**
413
+ * A description of what the response format is for, used by the model to determine how to respond in the format.
414
+ */
415
+ description?: string | undefined;
416
+ /**
417
+ * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
418
+ */
419
+ name: string;
420
+ /**
421
+ * The schema for the response format, described as a JSON Schema object.
422
+ */
423
+ schema?: any | undefined;
424
+ /**
425
+ * Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is true.
426
+ */
427
+ strict?: boolean | undefined;
428
+ };
429
+
430
+ /**
431
+ * @remarks
432
+ *
433
+ * JSON Schema response format. Used to generate structured JSON responses
434
+ */
435
+ export type RunAgentResponseFormatAgentsRequestJSONSchema = {
436
+ type: "json_schema";
437
+ jsonSchema: RunAgentResponseFormatAgentsRequestRequestBodyJsonSchema;
438
+ };
439
+
440
+ /**
441
+ * @remarks
442
+ *
443
+ * JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
444
+ */
445
+ export type RunAgentResponseFormatAgentsJSONObject = {
446
+ type: "json_object";
447
+ };
448
+
449
+ /**
450
+ * @remarks
451
+ *
452
+ * Default response format. Used to generate text responses
453
+ */
454
+ export type RunAgentResponseFormatAgentsText = {
455
+ type: "text";
456
+ };
457
+
458
+ /**
459
+ * An object specifying the format that the model must output
460
+ */
461
+ export type RunAgentFallbackModelConfigurationResponseFormat =
462
+ | RunAgentResponseFormatAgentsText
463
+ | RunAgentResponseFormatAgentsJSONObject
464
+ | RunAgentResponseFormatAgentsRequestJSONSchema;
465
+
466
+ /**
467
+ * Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
468
+ *
469
+ * @remarks
470
+ *
471
+ * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
472
+ * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
473
+ * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
474
+ * - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
475
+ *
476
+ * Any of "none", "minimal", "low", "medium", "high", "xhigh".
477
+ */
478
+ export const RunAgentFallbackModelConfigurationReasoningEffort = {
479
+ None: "none",
480
+ Minimal: "minimal",
481
+ Low: "low",
482
+ Medium: "medium",
483
+ High: "high",
484
+ Xhigh: "xhigh",
485
+ } as const;
486
+ /**
487
+ * Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
488
+ *
489
+ * @remarks
490
+ *
491
+ * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
492
+ * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
493
+ * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
494
+ * - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
495
+ *
496
+ * Any of "none", "minimal", "low", "medium", "high", "xhigh".
497
+ */
498
+ export type RunAgentFallbackModelConfigurationReasoningEffort = ClosedEnum<
499
+ typeof RunAgentFallbackModelConfigurationReasoningEffort
500
+ >;
501
+
502
+ /**
503
+ * Up to 4 sequences where the API will stop generating further tokens.
504
+ */
505
+ export type RunAgentFallbackModelConfigurationStop = string | Array<string>;
506
+
507
+ export type RunAgentFallbackModelConfigurationThinking =
508
+ | components.ThinkingConfigDisabledSchema
509
+ | components.ThinkingConfigEnabledSchema;
510
+
511
+ /**
512
+ * The type of the tool. Currently, only function is supported.
513
+ */
514
+ export const RunAgentToolChoiceAgentsType = {
515
+ Function: "function",
516
+ } as const;
517
+ /**
518
+ * The type of the tool. Currently, only function is supported.
519
+ */
520
+ export type RunAgentToolChoiceAgentsType = ClosedEnum<
521
+ typeof RunAgentToolChoiceAgentsType
522
+ >;
523
+
524
+ export type RunAgentToolChoiceAgentsFunction = {
525
+ /**
526
+ * The name of the function to call.
527
+ */
528
+ name: string;
529
+ };
530
+
531
+ export type RunAgentToolChoiceAgents2 = {
532
+ /**
533
+ * The type of the tool. Currently, only function is supported.
534
+ */
535
+ type?: RunAgentToolChoiceAgentsType | undefined;
536
+ function: RunAgentToolChoiceAgentsFunction;
537
+ };
538
+
539
+ export const RunAgentToolChoiceAgents1 = {
540
+ None: "none",
541
+ Auto: "auto",
542
+ Required: "required",
543
+ } as const;
544
+ export type RunAgentToolChoiceAgents1 = ClosedEnum<
545
+ typeof RunAgentToolChoiceAgents1
546
+ >;
547
+
548
+ /**
549
+ * Controls which (if any) tool is called by the model.
550
+ */
551
+ export type RunAgentFallbackModelConfigurationToolChoice =
552
+ | RunAgentToolChoiceAgents2
553
+ | RunAgentToolChoiceAgents1;
554
+
555
+ export const RunAgentFallbackModelConfigurationModalities = {
556
+ Text: "text",
557
+ Audio: "audio",
558
+ } as const;
559
+ export type RunAgentFallbackModelConfigurationModalities = ClosedEnum<
560
+ typeof RunAgentFallbackModelConfigurationModalities
561
+ >;
562
+
563
+ /**
564
+ * The key of the guardrail.
565
+ */
566
+ export const RunAgentIdAgents1 = {
567
+ OrqPiiDetection: "orq_pii_detection",
568
+ OrqSexualModeration: "orq_sexual_moderation",
569
+ OrqHarmfulModeration: "orq_harmful_moderation",
570
+ } as const;
571
+ /**
572
+ * The key of the guardrail.
573
+ */
574
+ export type RunAgentIdAgents1 = ClosedEnum<typeof RunAgentIdAgents1>;
575
+
576
+ export type RunAgentFallbackModelConfigurationId = RunAgentIdAgents1 | string;
577
+
578
+ /**
579
+ * Determines whether the guardrail runs on the input (user message) or output (model response).
580
+ */
581
+ export const RunAgentFallbackModelConfigurationExecuteOn = {
582
+ Input: "input",
583
+ Output: "output",
584
+ } as const;
585
+ /**
586
+ * Determines whether the guardrail runs on the input (user message) or output (model response).
587
+ */
588
+ export type RunAgentFallbackModelConfigurationExecuteOn = ClosedEnum<
589
+ typeof RunAgentFallbackModelConfigurationExecuteOn
590
+ >;
591
+
592
+ export type RunAgentFallbackModelConfigurationGuardrails = {
593
+ id: RunAgentIdAgents1 | string;
594
+ /**
595
+ * Determines whether the guardrail runs on the input (user message) or output (model response).
596
+ */
597
+ executeOn: RunAgentFallbackModelConfigurationExecuteOn;
598
+ };
599
+
600
+ export type RunAgentFallbackModelConfigurationFallbacks = {
601
+ /**
602
+ * Fallback model identifier
603
+ */
604
+ model: string;
605
+ };
606
+
607
+ export const RunAgentFallbackModelConfigurationType = {
608
+ ExactMatch: "exact_match",
609
+ } as const;
610
+ export type RunAgentFallbackModelConfigurationType = ClosedEnum<
611
+ typeof RunAgentFallbackModelConfigurationType
612
+ >;
613
+
614
+ /**
615
+ * Cache configuration for the request.
616
+ */
617
+ export type RunAgentFallbackModelConfigurationCache = {
618
+ /**
619
+ * Time to live for cached responses in seconds. Maximum 259200 seconds (3 days).
620
+ */
621
+ ttl?: number | undefined;
622
+ type: RunAgentFallbackModelConfigurationType;
623
+ };
624
+
625
+ export const RunAgentLoadBalancerAgentsType = {
626
+ WeightBased: "weight_based",
627
+ } as const;
628
+ export type RunAgentLoadBalancerAgentsType = ClosedEnum<
629
+ typeof RunAgentLoadBalancerAgentsType
630
+ >;
631
+
632
+ export type RunAgentLoadBalancerAgentsModels = {
633
+ /**
634
+ * Model identifier for load balancing
635
+ */
636
+ model: string;
637
+ /**
638
+ * Weight assigned to this model for load balancing
639
+ */
640
+ weight?: number | undefined;
641
+ };
642
+
643
+ export type RunAgentLoadBalancerAgents1 = {
644
+ type: RunAgentLoadBalancerAgentsType;
645
+ models: Array<RunAgentLoadBalancerAgentsModels>;
646
+ };
647
+
648
+ /**
649
+ * Load balancer configuration for the request.
650
+ */
651
+ export type RunAgentFallbackModelConfigurationLoadBalancer =
652
+ RunAgentLoadBalancerAgents1;
653
+
654
+ /**
655
+ * Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured.
656
+ */
657
+ export type RunAgentFallbackModelConfigurationTimeout = {
658
+ /**
659
+ * Timeout value in milliseconds
660
+ */
661
+ callTimeout: number;
662
+ };
663
+
664
+ /**
665
+ * Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used.
666
+ */
667
+ export type RunAgentFallbackModelConfigurationParameters = {
668
+ /**
669
+ * The name to display on the trace. If not specified, the default system name will be used.
670
+ */
671
+ name?: string | undefined;
672
+ /**
673
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
674
+ */
675
+ frequencyPenalty?: number | null | undefined;
676
+ /**
677
+ * `[Deprecated]`. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API.
678
+ *
679
+ * @remarks
680
+ *
681
+ * This value is now `deprecated` in favor of `max_completion_tokens`, and is not compatible with o1 series models.
682
+ */
683
+ maxTokens?: number | null | undefined;
684
+ /**
685
+ * An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens
686
+ */
687
+ maxCompletionTokens?: number | null | undefined;
688
+ /**
689
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
690
+ */
691
+ presencePenalty?: number | null | undefined;
692
+ /**
693
+ * An object specifying the format that the model must output
694
+ */
695
+ responseFormat?:
696
+ | RunAgentResponseFormatAgentsText
697
+ | RunAgentResponseFormatAgentsJSONObject
698
+ | RunAgentResponseFormatAgentsRequestJSONSchema
699
+ | undefined;
700
+ /**
701
+ * Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
702
+ *
703
+ * @remarks
704
+ *
705
+ * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
706
+ * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
707
+ * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
708
+ * - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
709
+ *
710
+ * Any of "none", "minimal", "low", "medium", "high", "xhigh".
711
+ */
712
+ reasoningEffort?:
713
+ | RunAgentFallbackModelConfigurationReasoningEffort
714
+ | undefined;
715
+ /**
716
+ * Adjusts response verbosity. Lower levels yield shorter answers.
717
+ */
718
+ verbosity?: string | undefined;
719
+ /**
720
+ * If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
721
+ */
722
+ seed?: number | null | undefined;
723
+ /**
724
+ * Up to 4 sequences where the API will stop generating further tokens.
725
+ */
726
+ stop?: string | Array<string> | null | undefined;
727
+ thinking?:
728
+ | components.ThinkingConfigDisabledSchema
729
+ | components.ThinkingConfigEnabledSchema
730
+ | undefined;
731
+ /**
732
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
733
+ */
734
+ temperature?: number | null | undefined;
735
+ /**
736
+ * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
737
+ */
738
+ topP?: number | null | undefined;
739
+ /**
740
+ * Limits the model to consider only the top k most likely tokens at each step.
741
+ */
742
+ topK?: number | null | undefined;
743
+ /**
744
+ * Controls which (if any) tool is called by the model.
745
+ */
746
+ toolChoice?:
747
+ | RunAgentToolChoiceAgents2
748
+ | RunAgentToolChoiceAgents1
749
+ | undefined;
750
+ /**
751
+ * Whether to enable parallel function calling during tool use.
752
+ */
753
+ parallelToolCalls?: boolean | undefined;
754
+ /**
755
+ * Output types that you would like the model to generate. Most models are capable of generating text, which is the default: ["text"]. The gpt-4o-audio-preview model can also be used to generate audio. To request that this model generate both text and audio responses, you can use: ["text", "audio"].
756
+ */
757
+ modalities?:
758
+ | Array<RunAgentFallbackModelConfigurationModalities>
759
+ | null
760
+ | undefined;
761
+ /**
762
+ * A list of guardrails to apply to the request.
763
+ */
764
+ guardrails?: Array<RunAgentFallbackModelConfigurationGuardrails> | undefined;
765
+ /**
766
+ * Array of fallback models to use if primary model fails
767
+ */
768
+ fallbacks?: Array<RunAgentFallbackModelConfigurationFallbacks> | undefined;
769
+ /**
770
+ * Cache configuration for the request.
771
+ */
772
+ cache?: RunAgentFallbackModelConfigurationCache | undefined;
773
+ /**
774
+ * Load balancer configuration for the request.
775
+ */
776
+ loadBalancer?: RunAgentLoadBalancerAgents1 | undefined;
777
+ /**
778
+ * Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured.
779
+ */
780
+ timeout?: RunAgentFallbackModelConfigurationTimeout | undefined;
781
+ };
782
+
783
+ /**
784
+ * Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries.
785
+ */
786
+ export type RunAgentFallbackModelConfigurationRetry = {
787
+ /**
788
+ * Number of retry attempts (1-5)
789
+ */
790
+ count?: number | undefined;
791
+ /**
792
+ * HTTP status codes that trigger retry logic
793
+ */
794
+ onCodes?: Array<number> | undefined;
795
+ };
796
+
797
+ /**
798
+ * Fallback model configuration with optional parameters and retry settings.
799
+ */
800
+ export type RunAgentFallbackModelConfiguration2 = {
801
+ /**
802
+ * A fallback model ID string. Must support tool calling.
803
+ */
804
+ id: string;
805
+ /**
806
+ * Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used.
807
+ */
808
+ parameters?: RunAgentFallbackModelConfigurationParameters | undefined;
809
+ /**
810
+ * Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries.
811
+ */
812
+ retry?: RunAgentFallbackModelConfigurationRetry | undefined;
813
+ };
814
+
815
+ /**
816
+ * Fallback model for automatic failover when primary model request fails. Supports optional parameter overrides. Can be a simple model ID string or a configuration object with model-specific parameters. Fallbacks are tried in order.
817
+ */
818
+ export type RunAgentFallbackModelConfiguration =
819
+ | RunAgentFallbackModelConfiguration2
820
+ | string;
821
+
822
+ /**
823
+ * Message containing tool execution results
824
+ */
825
+ export const RunAgentRoleToolMessage = {
826
+ Tool: "tool",
827
+ } as const;
828
+ /**
829
+ * Message containing tool execution results
830
+ */
831
+ export type RunAgentRoleToolMessage = ClosedEnum<
832
+ typeof RunAgentRoleToolMessage
833
+ >;
834
+
835
+ /**
836
+ * Message from the end user
837
+ */
838
+ export const RunAgentRoleUserMessage = {
839
+ User: "user",
840
+ } as const;
841
+ /**
842
+ * Message from the end user
843
+ */
844
+ export type RunAgentRoleUserMessage = ClosedEnum<
845
+ typeof RunAgentRoleUserMessage
846
+ >;
847
+
848
+ /**
849
+ * Message role (user or tool for continuing executions)
850
+ */
851
+ export type RunAgentRole = RunAgentRoleUserMessage | RunAgentRoleToolMessage;
852
+
853
+ /**
854
+ * Message part that can be provided by users. Use "text" for regular messages, "file" for attachments, or "tool_result" when responding to tool call requests.
855
+ */
856
+ export type RunAgentPublicMessagePart =
857
+ | components.TextPart
858
+ | components.FilePart
859
+ | components.ToolResultPart
860
+ | components.ErrorPart;
861
+
862
+ /**
863
+ * The A2A format message containing the task for the agent to perform.
864
+ */
865
+ export type RunAgentA2AMessage = {
866
+ /**
867
+ * Optional A2A message ID in ULID format
868
+ */
869
+ messageId?: string | undefined;
870
+ /**
871
+ * Message role (user or tool for continuing executions)
872
+ */
873
+ role: RunAgentRoleUserMessage | RunAgentRoleToolMessage;
874
+ /**
875
+ * A2A message parts (text, file, or tool_result only). Note: Tool role messages must only contain tool_result parts.
876
+ */
877
+ parts: Array<
878
+ | components.TextPart
879
+ | components.FilePart
880
+ | components.ToolResultPart
881
+ | components.ErrorPart
882
+ >;
883
+ };
884
+
885
+ /**
886
+ * Information about the identity making the request. If the identity does not exist, it will be created automatically.
887
+ */
888
+ export type RunAgentIdentity = {
889
+ /**
890
+ * Unique identifier for the contact
891
+ */
892
+ id: string;
893
+ /**
894
+ * Display name of the contact
895
+ */
896
+ displayName?: string | undefined;
897
+ /**
898
+ * Email address of the contact
899
+ */
900
+ email?: string | undefined;
901
+ /**
902
+ * A hash of key/value pairs containing any other data about the contact
903
+ */
904
+ metadata?: Array<{ [k: string]: any }> | undefined;
905
+ /**
906
+ * URL to the contact's avatar or logo
907
+ */
908
+ logoUrl?: string | undefined;
909
+ /**
910
+ * A list of tags associated with the contact
911
+ */
912
+ tags?: Array<string> | undefined;
913
+ };
914
+
915
+ /**
916
+ * @deprecated Use identity instead. Information about the contact making the request.
917
+ *
918
+ * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible.
919
+ */
920
+ export type RunAgentContact = {
921
+ /**
922
+ * Unique identifier for the contact
923
+ */
924
+ id: string;
925
+ /**
926
+ * Display name of the contact
927
+ */
928
+ displayName?: string | undefined;
929
+ /**
930
+ * Email address of the contact
931
+ */
932
+ email?: string | undefined;
933
+ /**
934
+ * A hash of key/value pairs containing any other data about the contact
935
+ */
936
+ metadata?: Array<{ [k: string]: any }> | undefined;
937
+ /**
938
+ * URL to the contact's avatar or logo
939
+ */
940
+ logoUrl?: string | undefined;
941
+ /**
942
+ * A list of tags associated with the contact
943
+ */
944
+ tags?: Array<string> | undefined;
945
+ };
946
+
947
+ /**
948
+ * Thread information to group related requests
949
+ */
950
+ export type RunAgentThread = {
951
+ /**
952
+ * Unique thread identifier to group related invocations.
953
+ */
954
+ id: string;
955
+ /**
956
+ * Optional tags to differentiate or categorize threads
957
+ */
958
+ tags?: Array<string> | undefined;
959
+ };
960
+
961
+ /**
962
+ * Memory configuration for the agent execution. Used to associate memory stores with specific entities like users or sessions.
963
+ */
964
+ export type RunAgentMemory = {
965
+ /**
966
+ * An entity ID used to link memory stores to a specific user, session, or conversation. This ID is used to isolate and retrieve memories specific to the entity across agent executions.
967
+ */
968
+ entityId: string;
969
+ };
970
+
971
+ export type RunAgentKnowledgeBases = {
972
+ /**
973
+ * Unique identifier of the knowledge base to search
974
+ */
975
+ knowledgeId: string;
976
+ };
977
+
978
+ export type RunAgentTeamOfAgents = {
979
+ /**
980
+ * The unique key of the agent within the workspace
981
+ */
982
+ key: string;
983
+ /**
984
+ * The role of the agent in this context. This is used to give extra information to the leader to help it decide which agent to hand off to.
985
+ */
986
+ role?: string | undefined;
987
+ };
988
+
989
+ export type RunAgentAgentToolInputRunHeaders = {
990
+ value: string;
991
+ encrypted?: boolean | undefined;
992
+ };
993
+
994
+ export const RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType =
995
+ {
996
+ Object: "object",
997
+ } as const;
998
+ export type RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType =
999
+ ClosedEnum<
1000
+ typeof RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType
1001
+ >;
1002
+
1003
+ export type AgentToolInputRunSchema = {
1004
+ type: RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType;
1005
+ properties?: { [k: string]: any } | undefined;
1006
+ required?: Array<string> | undefined;
1007
+ };
1008
+
1009
+ export type Tools = {
1010
+ id?: string | undefined;
1011
+ name: string;
1012
+ description?: string | undefined;
1013
+ schema: AgentToolInputRunSchema;
1014
+ };
1015
+
1016
+ /**
1017
+ * The connection type used by the MCP server
1018
+ */
1019
+ export const ConnectionType = {
1020
+ Http: "http",
1021
+ Sse: "sse",
1022
+ } as const;
1023
+ /**
1024
+ * The connection type used by the MCP server
1025
+ */
1026
+ export type ConnectionType = ClosedEnum<typeof ConnectionType>;
1027
+
1028
+ export type Mcp = {
1029
+ /**
1030
+ * The MCP server URL (cached for execution)
1031
+ */
1032
+ serverUrl: string;
1033
+ /**
1034
+ * HTTP headers for MCP server requests with encryption support
1035
+ */
1036
+ headers?: { [k: string]: RunAgentAgentToolInputRunHeaders } | undefined;
1037
+ /**
1038
+ * Array of tools available from the MCP server
1039
+ */
1040
+ tools: Array<Tools>;
1041
+ /**
1042
+ * The connection type used by the MCP server
1043
+ */
1044
+ connectionType: ConnectionType;
1045
+ };
1046
+
1047
+ /**
1048
+ * MCP tool with inline definition for on-the-fly creation in run endpoint
1049
+ */
1050
+ export type MCPToolRun = {
1051
+ type: "mcp";
1052
+ /**
1053
+ * Unique key of the tool as it will be displayed in the UI
1054
+ */
1055
+ key: string;
1056
+ id?: string | undefined;
1057
+ displayName?: string | undefined;
1058
+ /**
1059
+ * A description of the tool, used by the model to choose when and how to call the tool. We do recommend using the `description` field as accurate as possible to give enough context to the model to make the right decision.
1060
+ */
1061
+ description: string;
1062
+ mcp: Mcp;
1063
+ requiresApproval?: boolean | undefined;
1064
+ };
1065
+
1066
+ /**
1067
+ * The schema for the response format, described as a JSON Schema object. See the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
1068
+ */
1069
+ export type Schema = {
1070
+ /**
1071
+ * The JSON Schema type
1072
+ */
1073
+ type: string;
1074
+ /**
1075
+ * The properties of the JSON Schema object
1076
+ */
1077
+ properties: { [k: string]: any };
1078
+ /**
1079
+ * Array of required property names
1080
+ */
1081
+ required: Array<string>;
1082
+ additionalProperties?: { [k: string]: any } | undefined;
1083
+ };
1084
+
1085
+ export type AgentToolInputRunJsonSchema = {
1086
+ /**
1087
+ * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
1088
+ */
1089
+ name: string;
1090
+ /**
1091
+ * A description of what the response format is for. This will be shown to the user.
1092
+ */
1093
+ description: string;
1094
+ /**
1095
+ * The schema for the response format, described as a JSON Schema object. See the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
1096
+ */
1097
+ schema: Schema;
1098
+ /**
1099
+ * Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. Only compatible with `OpenAI` models.
1100
+ */
1101
+ strict?: boolean | undefined;
1102
+ };
1103
+
1104
+ /**
1105
+ * JSON Schema tool with inline definition for on-the-fly creation in run endpoint
1106
+ */
1107
+ export type JSONSchemaToolRun = {
1108
+ type: "json_schema";
1109
+ /**
1110
+ * Unique key of the tool as it will be displayed in the UI
1111
+ */
1112
+ key: string;
1113
+ id?: string | undefined;
1114
+ displayName?: string | undefined;
1115
+ /**
1116
+ * A description of the tool, used by the model to choose when and how to call the tool. We do recommend using the `description` field as accurate as possible to give enough context to the model to make the right decision.
1117
+ */
1118
+ description: string;
1119
+ jsonSchema: AgentToolInputRunJsonSchema;
1120
+ requiresApproval?: boolean | undefined;
1121
+ };
1122
+
1123
+ /**
1124
+ * The type must be "object"
1125
+ */
1126
+ export const RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType =
1127
+ {
1128
+ Object: "object",
1129
+ } as const;
1130
+ /**
1131
+ * The type must be "object"
1132
+ */
1133
+ export type RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType =
1134
+ ClosedEnum<
1135
+ typeof RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType
1136
+ >;
1137
+
1138
+ /**
1139
+ * The parameters the functions accepts, described as a JSON Schema object. See the `OpenAI` [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
1140
+ */
1141
+ export type RunAgentAgentToolInputRunParameters = {
1142
+ /**
1143
+ * The type must be "object"
1144
+ */
1145
+ type:
1146
+ RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType;
1147
+ /**
1148
+ * The properties of the function parameters
1149
+ */
1150
+ properties: { [k: string]: any };
1151
+ /**
1152
+ * Array of required parameter names
1153
+ */
1154
+ required: Array<string>;
1155
+ additionalProperties?: { [k: string]: any } | undefined;
1156
+ };
1157
+
1158
+ export type AgentToolInputRunFunction = {
1159
+ /**
1160
+ * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
1161
+ */
1162
+ name: string;
1163
+ /**
1164
+ * A description of what the function does, used by the model to choose when and how to call the function.
1165
+ */
1166
+ description?: string | undefined;
1167
+ /**
1168
+ * Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Currently only compatible with `OpenAI` models.
1169
+ */
1170
+ strict?: boolean | undefined;
1171
+ /**
1172
+ * The parameters the functions accepts, described as a JSON Schema object. See the `OpenAI` [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
1173
+ */
1174
+ parameters?: RunAgentAgentToolInputRunParameters | undefined;
1175
+ };
1176
+
1177
+ /**
1178
+ * Function tool with inline definition for on-the-fly creation in run endpoint
1179
+ */
1180
+ export type FunctionToolRun = {
1181
+ type: "function";
1182
+ /**
1183
+ * Unique key of the tool as it will be displayed in the UI
1184
+ */
1185
+ key: string;
1186
+ id?: string | undefined;
1187
+ displayName?: string | undefined;
1188
+ description?: string | undefined;
1189
+ function: AgentToolInputRunFunction;
1190
+ requiresApproval?: boolean | undefined;
1191
+ };
1192
+
1193
+ /**
1194
+ * The type must be "object"
1195
+ */
1196
+ export const RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType =
1197
+ {
1198
+ Object: "object",
1199
+ } as const;
1200
+ /**
1201
+ * The type must be "object"
1202
+ */
1203
+ export type RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType =
1204
+ ClosedEnum<
1205
+ typeof RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType
1206
+ >;
1207
+
1208
+ /**
1209
+ * The parameters the functions accepts, described as a JSON Schema object. See the `OpenAI` [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
1210
+ */
1211
+ export type AgentToolInputRunParameters = {
1212
+ /**
1213
+ * The type must be "object"
1214
+ */
1215
+ type:
1216
+ RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType;
1217
+ /**
1218
+ * The properties of the function parameters
1219
+ */
1220
+ properties: { [k: string]: any };
1221
+ /**
1222
+ * Array of required parameter names
1223
+ */
1224
+ required: Array<string>;
1225
+ additionalProperties?: { [k: string]: any } | undefined;
1226
+ };
1227
+
1228
+ export const Language = {
1229
+ Python: "python",
1230
+ } as const;
1231
+ export type Language = ClosedEnum<typeof Language>;
1232
+
1233
+ export type CodeTool = {
1234
+ /**
1235
+ * The parameters the functions accepts, described as a JSON Schema object. See the `OpenAI` [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
1236
+ */
1237
+ parameters?: AgentToolInputRunParameters | undefined;
1238
+ language: Language;
1239
+ /**
1240
+ * The code to execute.
1241
+ */
1242
+ code: string;
1243
+ };
1244
+
1245
+ /**
1246
+ * Code execution tool with inline definition for on-the-fly creation in run endpoint
1247
+ */
1248
+ export type CodeToolRun = {
1249
+ type: "code";
1250
+ /**
1251
+ * Unique key of the tool as it will be displayed in the UI
1252
+ */
1253
+ key: string;
1254
+ id?: string | undefined;
1255
+ displayName?: string | undefined;
1256
+ /**
1257
+ * A description of the tool, used by the model to choose when and how to call the tool. We do recommend using the `description` field as accurate as possible to give enough context to the model to make the right decision.
1258
+ */
1259
+ description: string;
1260
+ codeTool: CodeTool;
1261
+ requiresApproval?: boolean | undefined;
1262
+ };
1263
+
1264
+ /**
1265
+ * The HTTP method to use.
1266
+ */
1267
+ export const Method = {
1268
+ Get: "GET",
1269
+ Post: "POST",
1270
+ Put: "PUT",
1271
+ Delete: "DELETE",
1272
+ } as const;
1273
+ /**
1274
+ * The HTTP method to use.
1275
+ */
1276
+ export type Method = ClosedEnum<typeof Method>;
1277
+
1278
+ export type Headers2 = {
1279
+ value: string;
1280
+ encrypted?: boolean | undefined;
1281
+ };
1282
+
1283
+ export type AgentToolInputRunHeaders = Headers2 | string;
1284
+
1285
+ /**
1286
+ * The blueprint for the HTTP request. The `arguments` field will be used to replace the placeholders in the `url`, `headers`, `body`, and `arguments` fields.
1287
+ */
1288
+ export type Blueprint = {
1289
+ /**
1290
+ * The URL to send the request to.
1291
+ */
1292
+ url: string;
1293
+ /**
1294
+ * The HTTP method to use.
1295
+ */
1296
+ method: Method;
1297
+ /**
1298
+ * The headers to send with the request. Can be a string value or an object with value and encrypted properties.
1299
+ */
1300
+ headers?: { [k: string]: Headers2 | string } | undefined;
1301
+ /**
1302
+ * The body to send with the request.
1303
+ */
1304
+ body?: { [k: string]: any } | undefined;
1305
+ };
1306
+
1307
+ /**
1308
+ * The type of the argument.
1309
+ */
1310
+ export const RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType =
1311
+ {
1312
+ String: "string",
1313
+ Number: "number",
1314
+ Boolean: "boolean",
1315
+ } as const;
1316
+ /**
1317
+ * The type of the argument.
1318
+ */
1319
+ export type RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType =
1320
+ ClosedEnum<
1321
+ typeof RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType
1322
+ >;
1323
+
1324
+ /**
1325
+ * The default value of the argument.
1326
+ */
1327
+ export type DefaultValue = string | number | boolean;
1328
+
1329
+ export type Arguments = {
1330
+ /**
1331
+ * The type of the argument.
1332
+ */
1333
+ type:
1334
+ RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType;
1335
+ /**
1336
+ * A description of the argument.
1337
+ */
1338
+ description: string;
1339
+ /**
1340
+ * Whether to send the argument to the model. If set to false, the argument will not be sent to the model and needs to be provided by the user or it will be left blank.
1341
+ */
1342
+ sendToModel?: boolean | undefined;
1343
+ /**
1344
+ * The default value of the argument.
1345
+ */
1346
+ defaultValue?: string | number | boolean | undefined;
1347
+ };
1348
+
1349
+ export type Http = {
1350
+ /**
1351
+ * The blueprint for the HTTP request. The `arguments` field will be used to replace the placeholders in the `url`, `headers`, `body`, and `arguments` fields.
1352
+ */
1353
+ blueprint: Blueprint;
1354
+ /**
1355
+ * The arguments to send with the request. The keys will be used to replace the placeholders in the `blueprint` field.
1356
+ */
1357
+ arguments?: { [k: string]: Arguments } | undefined;
1358
+ };
1359
+
1360
+ /**
1361
+ * HTTP tool with inline definition for on-the-fly creation in run endpoint
1362
+ */
1363
+ export type HTTPToolRun = {
1364
+ type: "http";
1365
+ /**
1366
+ * Unique key of the tool as it will be displayed in the UI
1367
+ */
1368
+ key: string;
1369
+ id?: string | undefined;
1370
+ displayName?: string | undefined;
1371
+ /**
1372
+ * A description of the tool, used by the model to choose when and how to call the tool. We do recommend using the `description` field as accurate as possible to give enough context to the model to make the right decision.
1373
+ */
1374
+ description: string;
1375
+ http: Http;
1376
+ requiresApproval?: boolean | undefined;
1377
+ };
1378
+
1379
+ /**
1380
+ * Returns the current date and time
1381
+ */
1382
+ export type AgentToolInputRunCurrentDateTool = {
1383
+ type: "current_date";
1384
+ /**
1385
+ * Whether this tool requires approval before execution
1386
+ */
1387
+ requiresApproval?: boolean | undefined;
1388
+ };
1389
+
1390
+ /**
1391
+ * Queries knowledge bases for information
1392
+ */
1393
+ export type AgentToolInputRunQueryKnowledgeBaseTool = {
1394
+ type: "query_knowledge_base";
1395
+ /**
1396
+ * Whether this tool requires approval before execution
1397
+ */
1398
+ requiresApproval?: boolean | undefined;
1399
+ };
1400
+
1401
+ /**
1402
+ * Lists available knowledge bases
1403
+ */
1404
+ export type AgentToolInputRunRetrieveKnowledgeBasesTool = {
1405
+ type: "retrieve_knowledge_bases";
1406
+ /**
1407
+ * Whether this tool requires approval before execution
1408
+ */
1409
+ requiresApproval?: boolean | undefined;
1410
+ };
1411
+
1412
+ /**
1413
+ * Deletes documents from memory stores
1414
+ */
1415
+ export type AgentToolInputRunDeleteMemoryDocumentTool = {
1416
+ type: "delete_memory_document";
1417
+ /**
1418
+ * Whether this tool requires approval before execution
1419
+ */
1420
+ requiresApproval?: boolean | undefined;
1421
+ };
1422
+
1423
+ /**
1424
+ * Lists available memory stores
1425
+ */
1426
+ export type AgentToolInputRunRetrieveMemoryStoresTool = {
1427
+ type: "retrieve_memory_stores";
1428
+ /**
1429
+ * Whether this tool requires approval before execution
1430
+ */
1431
+ requiresApproval?: boolean | undefined;
1432
+ };
1433
+
1434
+ /**
1435
+ * Writes information to agent memory stores
1436
+ */
1437
+ export type AgentToolInputRunWriteMemoryStoreTool = {
1438
+ type: "write_memory_store";
1439
+ /**
1440
+ * Whether this tool requires approval before execution
1441
+ */
1442
+ requiresApproval?: boolean | undefined;
1443
+ };
1444
+
1445
+ /**
1446
+ * Queries agent memory stores for context
1447
+ */
1448
+ export type AgentToolInputRunQueryMemoryStoreTool = {
1449
+ type: "query_memory_store";
1450
+ /**
1451
+ * Whether this tool requires approval before execution
1452
+ */
1453
+ requiresApproval?: boolean | undefined;
1454
+ };
1455
+
1456
+ /**
1457
+ * Retrieves available agents in the system
1458
+ */
1459
+ export type AgentToolInputRunRetrieveAgentsTool = {
1460
+ type: "retrieve_agents";
1461
+ /**
1462
+ * Whether this tool requires approval before execution
1463
+ */
1464
+ requiresApproval?: boolean | undefined;
1465
+ };
1466
+
1467
+ /**
1468
+ * Delegates tasks to specialized sub-agents
1469
+ */
1470
+ export type AgentToolInputRunCallSubAgentTool = {
1471
+ type: "call_sub_agent";
1472
+ /**
1473
+ * Whether this tool requires approval before execution
1474
+ */
1475
+ requiresApproval?: boolean | undefined;
1476
+ };
1477
+
1478
+ /**
1479
+ * Scrapes and extracts content from web pages
1480
+ */
1481
+ export type AgentToolInputRunWebScraperTool = {
1482
+ type: "web_scraper";
1483
+ /**
1484
+ * Whether this tool requires approval before execution
1485
+ */
1486
+ requiresApproval?: boolean | undefined;
1487
+ };
1488
+
1489
+ /**
1490
+ * Performs Google searches to retrieve web content
1491
+ */
1492
+ export type AgentToolInputRunGoogleSearchTool = {
1493
+ type: "google_search";
1494
+ /**
1495
+ * Whether this tool requires approval before execution
1496
+ */
1497
+ requiresApproval?: boolean | undefined;
1498
+ };
1499
+
1500
+ /**
1501
+ * Tool configuration for agent run operations. Built-in tools only require a type and requires_approval, while custom tools (HTTP, Code, Function, JSON Schema, MCP) support full inline definitions for on-the-fly creation.
1502
+ */
1503
+ export type AgentToolInputRun =
1504
+ | AgentToolInputRunGoogleSearchTool
1505
+ | AgentToolInputRunWebScraperTool
1506
+ | AgentToolInputRunCallSubAgentTool
1507
+ | AgentToolInputRunRetrieveAgentsTool
1508
+ | AgentToolInputRunQueryMemoryStoreTool
1509
+ | AgentToolInputRunWriteMemoryStoreTool
1510
+ | AgentToolInputRunRetrieveMemoryStoresTool
1511
+ | AgentToolInputRunDeleteMemoryDocumentTool
1512
+ | AgentToolInputRunRetrieveKnowledgeBasesTool
1513
+ | AgentToolInputRunQueryKnowledgeBaseTool
1514
+ | AgentToolInputRunCurrentDateTool
1515
+ | HTTPToolRun
1516
+ | CodeToolRun
1517
+ | FunctionToolRun
1518
+ | JSONSchemaToolRun
1519
+ | MCPToolRun;
1520
+
1521
+ /**
1522
+ * If all, the agent will require approval for all tools. If respect_tool, the agent will require approval for tools that have the requires_approval flag set to true. If none, the agent will not require approval for any tools.
1523
+ */
1524
+ export const RunAgentToolApprovalRequired = {
1525
+ All: "all",
1526
+ RespectTool: "respect_tool",
1527
+ None: "none",
1528
+ } as const;
1529
+ /**
1530
+ * If all, the agent will require approval for all tools. If respect_tool, the agent will require approval for tools that have the requires_approval flag set to true. If none, the agent will not require approval for any tools.
1531
+ */
1532
+ export type RunAgentToolApprovalRequired = ClosedEnum<
1533
+ typeof RunAgentToolApprovalRequired
1534
+ >;
1535
+
1536
+ /**
1537
+ * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
1538
+ */
1539
+ export const RunAgentExecuteOn = {
1540
+ Input: "input",
1541
+ Output: "output",
1542
+ } as const;
1543
+ /**
1544
+ * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
1545
+ */
1546
+ export type RunAgentExecuteOn = ClosedEnum<typeof RunAgentExecuteOn>;
1547
+
1548
+ export type RunAgentEvaluators = {
1549
+ /**
1550
+ * Unique key or identifier of the evaluator
1551
+ */
1552
+ id: string;
1553
+ /**
1554
+ * The percentage of executions to evaluate with this evaluator (1-100). For example, a value of 50 means the evaluator will run on approximately half of the executions.
1555
+ */
1556
+ sampleRate?: number | undefined;
1557
+ /**
1558
+ * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
1559
+ */
1560
+ executeOn: RunAgentExecuteOn;
1561
+ };
1562
+
1563
+ /**
1564
+ * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
1565
+ */
1566
+ export const RunAgentAgentsExecuteOn = {
1567
+ Input: "input",
1568
+ Output: "output",
1569
+ } as const;
1570
+ /**
1571
+ * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
1572
+ */
1573
+ export type RunAgentAgentsExecuteOn = ClosedEnum<
1574
+ typeof RunAgentAgentsExecuteOn
1575
+ >;
1576
+
1577
+ export type RunAgentGuardrails = {
1578
+ /**
1579
+ * Unique key or identifier of the evaluator
1580
+ */
1581
+ id: string;
1582
+ /**
1583
+ * The percentage of executions to evaluate with this evaluator (1-100). For example, a value of 50 means the evaluator will run on approximately half of the executions.
1584
+ */
1585
+ sampleRate?: number | undefined;
1586
+ /**
1587
+ * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
1588
+ */
1589
+ executeOn: RunAgentAgentsExecuteOn;
1590
+ };
1591
+
1592
+ export type RunAgentSettings = {
1593
+ /**
1594
+ * Tools available to the agent
1595
+ */
1596
+ tools?:
1597
+ | Array<
1598
+ | AgentToolInputRunGoogleSearchTool
1599
+ | AgentToolInputRunWebScraperTool
1600
+ | AgentToolInputRunCallSubAgentTool
1601
+ | AgentToolInputRunRetrieveAgentsTool
1602
+ | AgentToolInputRunQueryMemoryStoreTool
1603
+ | AgentToolInputRunWriteMemoryStoreTool
1604
+ | AgentToolInputRunRetrieveMemoryStoresTool
1605
+ | AgentToolInputRunDeleteMemoryDocumentTool
1606
+ | AgentToolInputRunRetrieveKnowledgeBasesTool
1607
+ | AgentToolInputRunQueryKnowledgeBaseTool
1608
+ | AgentToolInputRunCurrentDateTool
1609
+ | HTTPToolRun
1610
+ | CodeToolRun
1611
+ | FunctionToolRun
1612
+ | JSONSchemaToolRun
1613
+ | MCPToolRun
1614
+ >
1615
+ | undefined;
1616
+ /**
1617
+ * If all, the agent will require approval for all tools. If respect_tool, the agent will require approval for tools that have the requires_approval flag set to true. If none, the agent will not require approval for any tools.
1618
+ */
1619
+ toolApprovalRequired?: RunAgentToolApprovalRequired | undefined;
1620
+ /**
1621
+ * Maximum iterations(llm calls) before the agent will stop executing.
1622
+ */
1623
+ maxIterations?: number | undefined;
1624
+ /**
1625
+ * Maximum time (in seconds) for the agent thinking process. This does not include the time for tool calls and sub agent calls. It will be loosely enforced, the in progress LLM calls will not be terminated and the last assistant message will be returned.
1626
+ */
1627
+ maxExecutionTime?: number | undefined;
1628
+ /**
1629
+ * Maximum cost in USD for the agent execution. When the accumulated cost exceeds this limit, the agent will stop executing. Set to 0 for unlimited. Only supported in v3 responses
1630
+ */
1631
+ maxCost?: number | undefined;
1632
+ /**
1633
+ * Configuration for an evaluator applied to the agent
1634
+ */
1635
+ evaluators?: Array<RunAgentEvaluators> | undefined;
1636
+ /**
1637
+ * Configuration for a guardrail applied to the agent
1638
+ */
1639
+ guardrails?: Array<RunAgentGuardrails> | undefined;
1640
+ };
1641
+
1642
+ export type RunAgentRequestBody = {
1643
+ /**
1644
+ * A unique identifier for the agent. This key must be unique within the same workspace and cannot be reused. When executing the agent, this key determines if the agent already exists. If the agent version differs, a new version is created at the end of the execution, except for the task. All agent parameters are evaluated to decide if a new version is needed.
1645
+ */
1646
+ key: string;
1647
+ /**
1648
+ * Optional task ID to continue an existing agent execution. When provided, the agent will continue the conversation from the existing task state. The task must be in an inactive state to continue.
1649
+ */
1650
+ taskId?: string | undefined;
1651
+ /**
1652
+ * Model configuration for this execution. Can override the agent manifest defaults if the agent already exists.
1653
+ */
1654
+ model: RunAgentModelConfiguration2 | string;
1655
+ /**
1656
+ * Optional array of fallback models used when the primary model fails. Fallbacks are attempted in order. All models must support tool calling.
1657
+ */
1658
+ fallbackModels?:
1659
+ | Array<RunAgentFallbackModelConfiguration2 | string>
1660
+ | undefined;
1661
+ /**
1662
+ * Specifies the agent's function and area of expertise.
1663
+ */
1664
+ role: string;
1665
+ /**
1666
+ * Provides context and purpose for the agent. Combined with the system prompt template to generate the agent's instructions.
1667
+ */
1668
+ instructions: string;
1669
+ /**
1670
+ * The A2A format message containing the task for the agent to perform.
1671
+ */
1672
+ message: RunAgentA2AMessage;
1673
+ /**
1674
+ * Optional variables for template replacement in system prompt, instructions, and messages
1675
+ */
1676
+ variables?: { [k: string]: any } | undefined;
1677
+ /**
1678
+ * Information about the identity making the request. If the identity does not exist, it will be created automatically.
1679
+ */
1680
+ identity?: RunAgentIdentity | undefined;
1681
+ /**
1682
+ * @deprecated Use identity instead. Information about the contact making the request.
1683
+ *
1684
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
1685
+ */
1686
+ contact?: RunAgentContact | undefined;
1687
+ /**
1688
+ * Thread information to group related requests
1689
+ */
1690
+ thread?: RunAgentThread | undefined;
1691
+ /**
1692
+ * Memory configuration for the agent execution. Used to associate memory stores with specific entities like users or sessions.
1693
+ */
1694
+ memory?: RunAgentMemory | undefined;
1695
+ /**
1696
+ * Entity storage path in the format: `project/folder/subfolder/...`
1697
+ *
1698
+ * @remarks
1699
+ *
1700
+ * The first element identifies the project, followed by nested folders (auto-created as needed).
1701
+ *
1702
+ * With project-based API keys, the first element is treated as a folder name, as the project is predetermined by the API key.
1703
+ */
1704
+ path: string;
1705
+ /**
1706
+ * A brief summary of the agent's purpose.
1707
+ */
1708
+ description?: string | undefined;
1709
+ /**
1710
+ * A custom system prompt template for the agent. If omitted, the default template is used.
1711
+ */
1712
+ systemPrompt?: string | undefined;
1713
+ /**
1714
+ * Array of memory store identifiers that are accessible to the agent. Accepts both memory store IDs and keys.
1715
+ */
1716
+ memoryStores?: Array<string> | undefined;
1717
+ /**
1718
+ * Knowledge base configurations for the agent to access
1719
+ */
1720
+ knowledgeBases?: Array<RunAgentKnowledgeBases> | undefined;
1721
+ /**
1722
+ * The agents that are accessible to this orchestrator. The main agent can hand off to these agents to perform tasks.
1723
+ */
1724
+ teamOfAgents?: Array<RunAgentTeamOfAgents> | undefined;
1725
+ settings: RunAgentSettings;
1726
+ /**
1727
+ * Optional metadata for the agent run as key-value pairs that will be included in traces
1728
+ */
1729
+ metadata?: { [k: string]: any } | undefined;
1730
+ };
1731
+
1732
+ /**
1733
+ * A2A entity type identifier
1734
+ */
1735
+ export const RunAgentKind = {
1736
+ Task: "task",
1737
+ } as const;
1738
+ /**
1739
+ * A2A entity type identifier
1740
+ */
1741
+ export type RunAgentKind = ClosedEnum<typeof RunAgentKind>;
1742
+
1743
+ /**
1744
+ * Current state of the agent task execution. Values: submitted (queued), working (executing), input-required (awaiting user input), completed (finished successfully), failed (error occurred). Note: auth-required, canceled, and rejected statuses are defined for A2A protocol compatibility but are not currently supported in task execution.
1745
+ */
1746
+ export const RunAgentTaskState = {
1747
+ Submitted: "submitted",
1748
+ Working: "working",
1749
+ InputRequired: "input-required",
1750
+ AuthRequired: "auth-required",
1751
+ Completed: "completed",
1752
+ Failed: "failed",
1753
+ Canceled: "canceled",
1754
+ Rejected: "rejected",
1755
+ } as const;
1756
+ /**
1757
+ * Current state of the agent task execution. Values: submitted (queued), working (executing), input-required (awaiting user input), completed (finished successfully), failed (error occurred). Note: auth-required, canceled, and rejected statuses are defined for A2A protocol compatibility but are not currently supported in task execution.
1758
+ */
1759
+ export type RunAgentTaskState = ClosedEnum<typeof RunAgentTaskState>;
1760
+
1761
+ export const RunAgentAgentsKind = {
1762
+ Message: "message",
1763
+ } as const;
1764
+ export type RunAgentAgentsKind = ClosedEnum<typeof RunAgentAgentsKind>;
1765
+
1766
+ /**
1767
+ * Role of the message sender in the A2A protocol. Values: user (end user), agent (AI agent), tool (tool execution result), system (system instructions/prompts).
1768
+ */
1769
+ export const RunAgentExtendedMessageRole = {
1770
+ User: "user",
1771
+ Agent: "agent",
1772
+ Tool: "tool",
1773
+ System: "system",
1774
+ } as const;
1775
+ /**
1776
+ * Role of the message sender in the A2A protocol. Values: user (end user), agent (AI agent), tool (tool execution result), system (system instructions/prompts).
1777
+ */
1778
+ export type RunAgentExtendedMessageRole = ClosedEnum<
1779
+ typeof RunAgentExtendedMessageRole
1780
+ >;
1781
+
1782
+ export type RunAgentParts =
1783
+ | components.TextPart
1784
+ | components.ErrorPart
1785
+ | components.DataPart
1786
+ | components.FilePart
1787
+ | components.ToolCallPart
1788
+ | components.ToolResultPart;
1789
+
1790
+ /**
1791
+ * Optional A2A message providing additional context about the current status
1792
+ */
1793
+ export type RunAgentTaskStatusMessage = {
1794
+ kind: RunAgentAgentsKind;
1795
+ messageId: string;
1796
+ /**
1797
+ * Role of the message sender in the A2A protocol. Values: user (end user), agent (AI agent), tool (tool execution result), system (system instructions/prompts).
1798
+ */
1799
+ role: RunAgentExtendedMessageRole;
1800
+ parts: Array<
1801
+ | components.TextPart
1802
+ | components.ErrorPart
1803
+ | components.DataPart
1804
+ | components.FilePart
1805
+ | components.ToolCallPart
1806
+ | components.ToolResultPart
1807
+ >;
1808
+ };
1809
+
1810
+ /**
1811
+ * Current task status information
1812
+ */
1813
+ export type RunAgentTaskStatus = {
1814
+ /**
1815
+ * Current state of the agent task execution. Values: submitted (queued), working (executing), input-required (awaiting user input), completed (finished successfully), failed (error occurred). Note: auth-required, canceled, and rejected statuses are defined for A2A protocol compatibility but are not currently supported in task execution.
1816
+ */
1817
+ state: RunAgentTaskState;
1818
+ /**
1819
+ * ISO 8601 timestamp of when the status was updated
1820
+ */
1821
+ timestamp?: string | undefined;
1822
+ /**
1823
+ * Optional A2A message providing additional context about the current status
1824
+ */
1825
+ message?: RunAgentTaskStatusMessage | undefined;
1826
+ };
1827
+
1828
+ /**
1829
+ * Response format following the Agent-to-Agent (A2A) protocol. Returned when starting or continuing an agent task execution.
1830
+ */
1831
+ export type RunAgentA2ATaskResponse = {
1832
+ /**
1833
+ * The unique ID of the created agent execution task
1834
+ */
1835
+ id: string;
1836
+ /**
1837
+ * The correlation ID for this execution (used for tracking)
1838
+ */
1839
+ contextId: string;
1840
+ /**
1841
+ * A2A entity type identifier
1842
+ */
1843
+ kind: RunAgentKind;
1844
+ /**
1845
+ * Current task status information
1846
+ */
1847
+ status: RunAgentTaskStatus;
1848
+ /**
1849
+ * Array of messages in the task conversation. Only present when blocking mode is enabled.
1850
+ */
1851
+ messages?: Array<components.ExtendedMessage> | undefined;
1852
+ /**
1853
+ * Task metadata containing workspace_id and trace_id for feedback and tracking
1854
+ */
1855
+ metadata?: { [k: string]: any } | undefined;
1856
+ };
1857
+
1858
+ /** @internal */
1859
+ export type RunAgentResponseFormatAgentsJsonSchema$Outbound = {
1860
+ description?: string | undefined;
1861
+ name: string;
1862
+ schema?: any | undefined;
1863
+ strict: boolean;
1864
+ };
1865
+
1866
+ /** @internal */
1867
+ export const RunAgentResponseFormatAgentsJsonSchema$outboundSchema: z.ZodType<
1868
+ RunAgentResponseFormatAgentsJsonSchema$Outbound,
1869
+ z.ZodTypeDef,
1870
+ RunAgentResponseFormatAgentsJsonSchema
1871
+ > = z.object({
1872
+ description: z.string().optional(),
1873
+ name: z.string(),
1874
+ schema: z.any().optional(),
1875
+ strict: z.boolean().default(false),
1876
+ });
1877
+
1878
+ export function runAgentResponseFormatAgentsJsonSchemaToJSON(
1879
+ runAgentResponseFormatAgentsJsonSchema:
1880
+ RunAgentResponseFormatAgentsJsonSchema,
1881
+ ): string {
1882
+ return JSON.stringify(
1883
+ RunAgentResponseFormatAgentsJsonSchema$outboundSchema.parse(
1884
+ runAgentResponseFormatAgentsJsonSchema,
1885
+ ),
1886
+ );
1887
+ }
1888
+
1889
+ /** @internal */
1890
+ export type RunAgentResponseFormatJSONSchema$Outbound = {
1891
+ type: "json_schema";
1892
+ json_schema: RunAgentResponseFormatAgentsJsonSchema$Outbound;
1893
+ };
1894
+
1895
+ /** @internal */
1896
+ export const RunAgentResponseFormatJSONSchema$outboundSchema: z.ZodType<
1897
+ RunAgentResponseFormatJSONSchema$Outbound,
1898
+ z.ZodTypeDef,
1899
+ RunAgentResponseFormatJSONSchema
1900
+ > = z.object({
1901
+ type: z.literal("json_schema"),
1902
+ jsonSchema: z.lazy(() =>
1903
+ RunAgentResponseFormatAgentsJsonSchema$outboundSchema
1904
+ ),
1905
+ }).transform((v) => {
1906
+ return remap$(v, {
1907
+ jsonSchema: "json_schema",
1908
+ });
1909
+ });
1910
+
1911
+ export function runAgentResponseFormatJSONSchemaToJSON(
1912
+ runAgentResponseFormatJSONSchema: RunAgentResponseFormatJSONSchema,
1913
+ ): string {
1914
+ return JSON.stringify(
1915
+ RunAgentResponseFormatJSONSchema$outboundSchema.parse(
1916
+ runAgentResponseFormatJSONSchema,
1917
+ ),
1918
+ );
1919
+ }
1920
+
1921
+ /** @internal */
1922
+ export type RunAgentResponseFormatJSONObject$Outbound = {
1923
+ type: "json_object";
1924
+ };
1925
+
1926
+ /** @internal */
1927
+ export const RunAgentResponseFormatJSONObject$outboundSchema: z.ZodType<
1928
+ RunAgentResponseFormatJSONObject$Outbound,
1929
+ z.ZodTypeDef,
1930
+ RunAgentResponseFormatJSONObject
1931
+ > = z.object({
1932
+ type: z.literal("json_object"),
1933
+ });
1934
+
1935
+ export function runAgentResponseFormatJSONObjectToJSON(
1936
+ runAgentResponseFormatJSONObject: RunAgentResponseFormatJSONObject,
1937
+ ): string {
1938
+ return JSON.stringify(
1939
+ RunAgentResponseFormatJSONObject$outboundSchema.parse(
1940
+ runAgentResponseFormatJSONObject,
1941
+ ),
1942
+ );
1943
+ }
1944
+
1945
+ /** @internal */
1946
+ export type RunAgentResponseFormatText$Outbound = {
1947
+ type: "text";
1948
+ };
1949
+
1950
+ /** @internal */
1951
+ export const RunAgentResponseFormatText$outboundSchema: z.ZodType<
1952
+ RunAgentResponseFormatText$Outbound,
1953
+ z.ZodTypeDef,
1954
+ RunAgentResponseFormatText
1955
+ > = z.object({
1956
+ type: z.literal("text"),
1957
+ });
1958
+
1959
+ export function runAgentResponseFormatTextToJSON(
1960
+ runAgentResponseFormatText: RunAgentResponseFormatText,
1961
+ ): string {
1962
+ return JSON.stringify(
1963
+ RunAgentResponseFormatText$outboundSchema.parse(runAgentResponseFormatText),
1964
+ );
1965
+ }
1966
+
1967
+ /** @internal */
1968
+ export type RunAgentModelConfigurationResponseFormat$Outbound =
1969
+ | RunAgentResponseFormatText$Outbound
1970
+ | RunAgentResponseFormatJSONObject$Outbound
1971
+ | RunAgentResponseFormatJSONSchema$Outbound;
1972
+
1973
+ /** @internal */
1974
+ export const RunAgentModelConfigurationResponseFormat$outboundSchema: z.ZodType<
1975
+ RunAgentModelConfigurationResponseFormat$Outbound,
1976
+ z.ZodTypeDef,
1977
+ RunAgentModelConfigurationResponseFormat
1978
+ > = z.union([
1979
+ z.lazy(() => RunAgentResponseFormatText$outboundSchema),
1980
+ z.lazy(() => RunAgentResponseFormatJSONObject$outboundSchema),
1981
+ z.lazy(() => RunAgentResponseFormatJSONSchema$outboundSchema),
1982
+ ]);
1983
+
1984
+ export function runAgentModelConfigurationResponseFormatToJSON(
1985
+ runAgentModelConfigurationResponseFormat:
1986
+ RunAgentModelConfigurationResponseFormat,
1987
+ ): string {
1988
+ return JSON.stringify(
1989
+ RunAgentModelConfigurationResponseFormat$outboundSchema.parse(
1990
+ runAgentModelConfigurationResponseFormat,
1991
+ ),
1992
+ );
1993
+ }
1994
+
1995
+ /** @internal */
1996
+ export const RunAgentModelConfigurationReasoningEffort$outboundSchema:
1997
+ z.ZodNativeEnum<typeof RunAgentModelConfigurationReasoningEffort> = z
1998
+ .nativeEnum(RunAgentModelConfigurationReasoningEffort);
1999
+
2000
+ /** @internal */
2001
+ export type RunAgentModelConfigurationStop$Outbound = string | Array<string>;
2002
+
2003
+ /** @internal */
2004
+ export const RunAgentModelConfigurationStop$outboundSchema: z.ZodType<
2005
+ RunAgentModelConfigurationStop$Outbound,
2006
+ z.ZodTypeDef,
2007
+ RunAgentModelConfigurationStop
2008
+ > = z.union([z.string(), z.array(z.string())]);
2009
+
2010
+ export function runAgentModelConfigurationStopToJSON(
2011
+ runAgentModelConfigurationStop: RunAgentModelConfigurationStop,
2012
+ ): string {
2013
+ return JSON.stringify(
2014
+ RunAgentModelConfigurationStop$outboundSchema.parse(
2015
+ runAgentModelConfigurationStop,
2016
+ ),
2017
+ );
2018
+ }
2019
+
2020
+ /** @internal */
2021
+ export type RunAgentModelConfigurationThinking$Outbound =
2022
+ | components.ThinkingConfigDisabledSchema$Outbound
2023
+ | components.ThinkingConfigEnabledSchema$Outbound;
2024
+
2025
+ /** @internal */
2026
+ export const RunAgentModelConfigurationThinking$outboundSchema: z.ZodType<
2027
+ RunAgentModelConfigurationThinking$Outbound,
2028
+ z.ZodTypeDef,
2029
+ RunAgentModelConfigurationThinking
2030
+ > = z.union([
2031
+ components.ThinkingConfigDisabledSchema$outboundSchema,
2032
+ components.ThinkingConfigEnabledSchema$outboundSchema,
2033
+ ]);
2034
+
2035
+ export function runAgentModelConfigurationThinkingToJSON(
2036
+ runAgentModelConfigurationThinking: RunAgentModelConfigurationThinking,
2037
+ ): string {
2038
+ return JSON.stringify(
2039
+ RunAgentModelConfigurationThinking$outboundSchema.parse(
2040
+ runAgentModelConfigurationThinking,
2041
+ ),
2042
+ );
2043
+ }
2044
+
2045
+ /** @internal */
2046
+ export const RunAgentToolChoiceType$outboundSchema: z.ZodNativeEnum<
2047
+ typeof RunAgentToolChoiceType
2048
+ > = z.nativeEnum(RunAgentToolChoiceType);
2049
+
2050
+ /** @internal */
2051
+ export type RunAgentToolChoiceFunction$Outbound = {
2052
+ name: string;
2053
+ };
2054
+
2055
+ /** @internal */
2056
+ export const RunAgentToolChoiceFunction$outboundSchema: z.ZodType<
2057
+ RunAgentToolChoiceFunction$Outbound,
2058
+ z.ZodTypeDef,
2059
+ RunAgentToolChoiceFunction
2060
+ > = z.object({
2061
+ name: z.string(),
2062
+ });
2063
+
2064
+ export function runAgentToolChoiceFunctionToJSON(
2065
+ runAgentToolChoiceFunction: RunAgentToolChoiceFunction,
2066
+ ): string {
2067
+ return JSON.stringify(
2068
+ RunAgentToolChoiceFunction$outboundSchema.parse(runAgentToolChoiceFunction),
2069
+ );
2070
+ }
2071
+
2072
+ /** @internal */
2073
+ export type RunAgentToolChoice2$Outbound = {
2074
+ type?: string | undefined;
2075
+ function: RunAgentToolChoiceFunction$Outbound;
2076
+ };
2077
+
2078
+ /** @internal */
2079
+ export const RunAgentToolChoice2$outboundSchema: z.ZodType<
2080
+ RunAgentToolChoice2$Outbound,
2081
+ z.ZodTypeDef,
2082
+ RunAgentToolChoice2
2083
+ > = z.object({
2084
+ type: RunAgentToolChoiceType$outboundSchema.optional(),
2085
+ function: z.lazy(() => RunAgentToolChoiceFunction$outboundSchema),
2086
+ });
2087
+
2088
+ export function runAgentToolChoice2ToJSON(
2089
+ runAgentToolChoice2: RunAgentToolChoice2,
2090
+ ): string {
2091
+ return JSON.stringify(
2092
+ RunAgentToolChoice2$outboundSchema.parse(runAgentToolChoice2),
2093
+ );
2094
+ }
2095
+
2096
+ /** @internal */
2097
+ export const RunAgentToolChoice1$outboundSchema: z.ZodNativeEnum<
2098
+ typeof RunAgentToolChoice1
2099
+ > = z.nativeEnum(RunAgentToolChoice1);
2100
+
2101
+ /** @internal */
2102
+ export type RunAgentModelConfigurationToolChoice$Outbound =
2103
+ | RunAgentToolChoice2$Outbound
2104
+ | string;
2105
+
2106
+ /** @internal */
2107
+ export const RunAgentModelConfigurationToolChoice$outboundSchema: z.ZodType<
2108
+ RunAgentModelConfigurationToolChoice$Outbound,
2109
+ z.ZodTypeDef,
2110
+ RunAgentModelConfigurationToolChoice
2111
+ > = z.union([
2112
+ z.lazy(() => RunAgentToolChoice2$outboundSchema),
2113
+ RunAgentToolChoice1$outboundSchema,
2114
+ ]);
2115
+
2116
+ export function runAgentModelConfigurationToolChoiceToJSON(
2117
+ runAgentModelConfigurationToolChoice: RunAgentModelConfigurationToolChoice,
2118
+ ): string {
2119
+ return JSON.stringify(
2120
+ RunAgentModelConfigurationToolChoice$outboundSchema.parse(
2121
+ runAgentModelConfigurationToolChoice,
2122
+ ),
2123
+ );
2124
+ }
2125
+
2126
+ /** @internal */
2127
+ export const RunAgentModelConfigurationModalities$outboundSchema:
2128
+ z.ZodNativeEnum<typeof RunAgentModelConfigurationModalities> = z.nativeEnum(
2129
+ RunAgentModelConfigurationModalities,
2130
+ );
2131
+
2132
+ /** @internal */
2133
+ export const RunAgentId1$outboundSchema: z.ZodNativeEnum<typeof RunAgentId1> = z
2134
+ .nativeEnum(RunAgentId1);
2135
+
2136
+ /** @internal */
2137
+ export type RunAgentModelConfigurationId$Outbound = string | string;
2138
+
2139
+ /** @internal */
2140
+ export const RunAgentModelConfigurationId$outboundSchema: z.ZodType<
2141
+ RunAgentModelConfigurationId$Outbound,
2142
+ z.ZodTypeDef,
2143
+ RunAgentModelConfigurationId
2144
+ > = z.union([RunAgentId1$outboundSchema, z.string()]);
2145
+
2146
+ export function runAgentModelConfigurationIdToJSON(
2147
+ runAgentModelConfigurationId: RunAgentModelConfigurationId,
2148
+ ): string {
2149
+ return JSON.stringify(
2150
+ RunAgentModelConfigurationId$outboundSchema.parse(
2151
+ runAgentModelConfigurationId,
2152
+ ),
2153
+ );
2154
+ }
2155
+
2156
+ /** @internal */
2157
+ export const RunAgentModelConfigurationExecuteOn$outboundSchema:
2158
+ z.ZodNativeEnum<typeof RunAgentModelConfigurationExecuteOn> = z.nativeEnum(
2159
+ RunAgentModelConfigurationExecuteOn,
2160
+ );
2161
+
2162
+ /** @internal */
2163
+ export type RunAgentModelConfigurationGuardrails$Outbound = {
2164
+ id: string | string;
2165
+ execute_on: string;
2166
+ };
2167
+
2168
+ /** @internal */
2169
+ export const RunAgentModelConfigurationGuardrails$outboundSchema: z.ZodType<
2170
+ RunAgentModelConfigurationGuardrails$Outbound,
2171
+ z.ZodTypeDef,
2172
+ RunAgentModelConfigurationGuardrails
2173
+ > = z.object({
2174
+ id: z.union([RunAgentId1$outboundSchema, z.string()]),
2175
+ executeOn: RunAgentModelConfigurationExecuteOn$outboundSchema,
2176
+ }).transform((v) => {
2177
+ return remap$(v, {
2178
+ executeOn: "execute_on",
2179
+ });
2180
+ });
2181
+
2182
+ export function runAgentModelConfigurationGuardrailsToJSON(
2183
+ runAgentModelConfigurationGuardrails: RunAgentModelConfigurationGuardrails,
2184
+ ): string {
2185
+ return JSON.stringify(
2186
+ RunAgentModelConfigurationGuardrails$outboundSchema.parse(
2187
+ runAgentModelConfigurationGuardrails,
2188
+ ),
2189
+ );
2190
+ }
2191
+
2192
+ /** @internal */
2193
+ export type RunAgentModelConfigurationFallbacks$Outbound = {
2194
+ model: string;
2195
+ };
2196
+
2197
+ /** @internal */
2198
+ export const RunAgentModelConfigurationFallbacks$outboundSchema: z.ZodType<
2199
+ RunAgentModelConfigurationFallbacks$Outbound,
2200
+ z.ZodTypeDef,
2201
+ RunAgentModelConfigurationFallbacks
2202
+ > = z.object({
2203
+ model: z.string(),
2204
+ });
2205
+
2206
+ export function runAgentModelConfigurationFallbacksToJSON(
2207
+ runAgentModelConfigurationFallbacks: RunAgentModelConfigurationFallbacks,
2208
+ ): string {
2209
+ return JSON.stringify(
2210
+ RunAgentModelConfigurationFallbacks$outboundSchema.parse(
2211
+ runAgentModelConfigurationFallbacks,
2212
+ ),
2213
+ );
2214
+ }
2215
+
2216
+ /** @internal */
2217
+ export const RunAgentModelConfigurationType$outboundSchema: z.ZodNativeEnum<
2218
+ typeof RunAgentModelConfigurationType
2219
+ > = z.nativeEnum(RunAgentModelConfigurationType);
2220
+
2221
+ /** @internal */
2222
+ export type RunAgentModelConfigurationCache$Outbound = {
2223
+ ttl: number;
2224
+ type: string;
2225
+ };
2226
+
2227
+ /** @internal */
2228
+ export const RunAgentModelConfigurationCache$outboundSchema: z.ZodType<
2229
+ RunAgentModelConfigurationCache$Outbound,
2230
+ z.ZodTypeDef,
2231
+ RunAgentModelConfigurationCache
2232
+ > = z.object({
2233
+ ttl: z.number().default(1800),
2234
+ type: RunAgentModelConfigurationType$outboundSchema,
2235
+ });
2236
+
2237
+ export function runAgentModelConfigurationCacheToJSON(
2238
+ runAgentModelConfigurationCache: RunAgentModelConfigurationCache,
2239
+ ): string {
2240
+ return JSON.stringify(
2241
+ RunAgentModelConfigurationCache$outboundSchema.parse(
2242
+ runAgentModelConfigurationCache,
2243
+ ),
2244
+ );
2245
+ }
2246
+
2247
+ /** @internal */
2248
+ export const RunAgentLoadBalancerType$outboundSchema: z.ZodNativeEnum<
2249
+ typeof RunAgentLoadBalancerType
2250
+ > = z.nativeEnum(RunAgentLoadBalancerType);
2251
+
2252
+ /** @internal */
2253
+ export type RunAgentLoadBalancerModels$Outbound = {
2254
+ model: string;
2255
+ weight: number;
2256
+ };
2257
+
2258
+ /** @internal */
2259
+ export const RunAgentLoadBalancerModels$outboundSchema: z.ZodType<
2260
+ RunAgentLoadBalancerModels$Outbound,
2261
+ z.ZodTypeDef,
2262
+ RunAgentLoadBalancerModels
2263
+ > = z.object({
2264
+ model: z.string(),
2265
+ weight: z.number().default(0.5),
2266
+ });
2267
+
2268
+ export function runAgentLoadBalancerModelsToJSON(
2269
+ runAgentLoadBalancerModels: RunAgentLoadBalancerModels,
2270
+ ): string {
2271
+ return JSON.stringify(
2272
+ RunAgentLoadBalancerModels$outboundSchema.parse(runAgentLoadBalancerModels),
2273
+ );
2274
+ }
2275
+
2276
+ /** @internal */
2277
+ export type RunAgentLoadBalancer1$Outbound = {
2278
+ type: string;
2279
+ models: Array<RunAgentLoadBalancerModels$Outbound>;
2280
+ };
2281
+
2282
+ /** @internal */
2283
+ export const RunAgentLoadBalancer1$outboundSchema: z.ZodType<
2284
+ RunAgentLoadBalancer1$Outbound,
2285
+ z.ZodTypeDef,
2286
+ RunAgentLoadBalancer1
2287
+ > = z.object({
2288
+ type: RunAgentLoadBalancerType$outboundSchema,
2289
+ models: z.array(z.lazy(() => RunAgentLoadBalancerModels$outboundSchema)),
2290
+ });
2291
+
2292
+ export function runAgentLoadBalancer1ToJSON(
2293
+ runAgentLoadBalancer1: RunAgentLoadBalancer1,
2294
+ ): string {
2295
+ return JSON.stringify(
2296
+ RunAgentLoadBalancer1$outboundSchema.parse(runAgentLoadBalancer1),
2297
+ );
2298
+ }
2299
+
2300
+ /** @internal */
2301
+ export type RunAgentModelConfigurationLoadBalancer$Outbound =
2302
+ RunAgentLoadBalancer1$Outbound;
2303
+
2304
+ /** @internal */
2305
+ export const RunAgentModelConfigurationLoadBalancer$outboundSchema: z.ZodType<
2306
+ RunAgentModelConfigurationLoadBalancer$Outbound,
2307
+ z.ZodTypeDef,
2308
+ RunAgentModelConfigurationLoadBalancer
2309
+ > = z.lazy(() => RunAgentLoadBalancer1$outboundSchema);
2310
+
2311
+ export function runAgentModelConfigurationLoadBalancerToJSON(
2312
+ runAgentModelConfigurationLoadBalancer:
2313
+ RunAgentModelConfigurationLoadBalancer,
2314
+ ): string {
2315
+ return JSON.stringify(
2316
+ RunAgentModelConfigurationLoadBalancer$outboundSchema.parse(
2317
+ runAgentModelConfigurationLoadBalancer,
2318
+ ),
2319
+ );
2320
+ }
2321
+
2322
+ /** @internal */
2323
+ export type RunAgentModelConfigurationTimeout$Outbound = {
2324
+ call_timeout: number;
2325
+ };
2326
+
2327
+ /** @internal */
2328
+ export const RunAgentModelConfigurationTimeout$outboundSchema: z.ZodType<
2329
+ RunAgentModelConfigurationTimeout$Outbound,
2330
+ z.ZodTypeDef,
2331
+ RunAgentModelConfigurationTimeout
2332
+ > = z.object({
2333
+ callTimeout: z.number(),
2334
+ }).transform((v) => {
2335
+ return remap$(v, {
2336
+ callTimeout: "call_timeout",
2337
+ });
2338
+ });
2339
+
2340
+ export function runAgentModelConfigurationTimeoutToJSON(
2341
+ runAgentModelConfigurationTimeout: RunAgentModelConfigurationTimeout,
2342
+ ): string {
2343
+ return JSON.stringify(
2344
+ RunAgentModelConfigurationTimeout$outboundSchema.parse(
2345
+ runAgentModelConfigurationTimeout,
2346
+ ),
2347
+ );
2348
+ }
2349
+
2350
+ /** @internal */
2351
+ export type RunAgentModelConfigurationParameters$Outbound = {
2352
+ name?: string | undefined;
2353
+ frequency_penalty?: number | null | undefined;
2354
+ max_tokens?: number | null | undefined;
2355
+ max_completion_tokens?: number | null | undefined;
2356
+ presence_penalty?: number | null | undefined;
2357
+ response_format?:
2358
+ | RunAgentResponseFormatText$Outbound
2359
+ | RunAgentResponseFormatJSONObject$Outbound
2360
+ | RunAgentResponseFormatJSONSchema$Outbound
2361
+ | undefined;
2362
+ reasoning_effort?: string | undefined;
2363
+ verbosity?: string | undefined;
2364
+ seed?: number | null | undefined;
2365
+ stop?: string | Array<string> | null | undefined;
2366
+ thinking?:
2367
+ | components.ThinkingConfigDisabledSchema$Outbound
2368
+ | components.ThinkingConfigEnabledSchema$Outbound
2369
+ | undefined;
2370
+ temperature?: number | null | undefined;
2371
+ top_p?: number | null | undefined;
2372
+ top_k?: number | null | undefined;
2373
+ tool_choice?: RunAgentToolChoice2$Outbound | string | undefined;
2374
+ parallel_tool_calls?: boolean | undefined;
2375
+ modalities?: Array<string> | null | undefined;
2376
+ guardrails?: Array<RunAgentModelConfigurationGuardrails$Outbound> | undefined;
2377
+ fallbacks?: Array<RunAgentModelConfigurationFallbacks$Outbound> | undefined;
2378
+ cache?: RunAgentModelConfigurationCache$Outbound | undefined;
2379
+ load_balancer?: RunAgentLoadBalancer1$Outbound | undefined;
2380
+ timeout?: RunAgentModelConfigurationTimeout$Outbound | undefined;
2381
+ };
2382
+
2383
+ /** @internal */
2384
+ export const RunAgentModelConfigurationParameters$outboundSchema: z.ZodType<
2385
+ RunAgentModelConfigurationParameters$Outbound,
2386
+ z.ZodTypeDef,
2387
+ RunAgentModelConfigurationParameters
2388
+ > = z.object({
2389
+ name: z.string().optional(),
2390
+ frequencyPenalty: z.nullable(z.number()).optional(),
2391
+ maxTokens: z.nullable(z.number().int()).optional(),
2392
+ maxCompletionTokens: z.nullable(z.number().int()).optional(),
2393
+ presencePenalty: z.nullable(z.number()).optional(),
2394
+ responseFormat: z.union([
2395
+ z.lazy(() => RunAgentResponseFormatText$outboundSchema),
2396
+ z.lazy(() => RunAgentResponseFormatJSONObject$outboundSchema),
2397
+ z.lazy(() => RunAgentResponseFormatJSONSchema$outboundSchema),
2398
+ ]).optional(),
2399
+ reasoningEffort: RunAgentModelConfigurationReasoningEffort$outboundSchema
2400
+ .optional(),
2401
+ verbosity: z.string().optional(),
2402
+ seed: z.nullable(z.number()).optional(),
2403
+ stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
2404
+ thinking: z.union([
2405
+ components.ThinkingConfigDisabledSchema$outboundSchema,
2406
+ components.ThinkingConfigEnabledSchema$outboundSchema,
2407
+ ]).optional(),
2408
+ temperature: z.nullable(z.number()).optional(),
2409
+ topP: z.nullable(z.number()).optional(),
2410
+ topK: z.nullable(z.number()).optional(),
2411
+ toolChoice: z.union([
2412
+ z.lazy(() => RunAgentToolChoice2$outboundSchema),
2413
+ RunAgentToolChoice1$outboundSchema,
2414
+ ]).optional(),
2415
+ parallelToolCalls: z.boolean().optional(),
2416
+ modalities: z.nullable(
2417
+ z.array(RunAgentModelConfigurationModalities$outboundSchema),
2418
+ ).optional(),
2419
+ guardrails: z.array(
2420
+ z.lazy(() => RunAgentModelConfigurationGuardrails$outboundSchema),
2421
+ ).optional(),
2422
+ fallbacks: z.array(
2423
+ z.lazy(() => RunAgentModelConfigurationFallbacks$outboundSchema),
2424
+ ).optional(),
2425
+ cache: z.lazy(() => RunAgentModelConfigurationCache$outboundSchema)
2426
+ .optional(),
2427
+ loadBalancer: z.lazy(() => RunAgentLoadBalancer1$outboundSchema).optional(),
2428
+ timeout: z.lazy(() => RunAgentModelConfigurationTimeout$outboundSchema)
2429
+ .optional(),
2430
+ }).transform((v) => {
2431
+ return remap$(v, {
2432
+ frequencyPenalty: "frequency_penalty",
2433
+ maxTokens: "max_tokens",
2434
+ maxCompletionTokens: "max_completion_tokens",
2435
+ presencePenalty: "presence_penalty",
2436
+ responseFormat: "response_format",
2437
+ reasoningEffort: "reasoning_effort",
2438
+ topP: "top_p",
2439
+ topK: "top_k",
2440
+ toolChoice: "tool_choice",
2441
+ parallelToolCalls: "parallel_tool_calls",
2442
+ loadBalancer: "load_balancer",
2443
+ });
2444
+ });
2445
+
2446
+ export function runAgentModelConfigurationParametersToJSON(
2447
+ runAgentModelConfigurationParameters: RunAgentModelConfigurationParameters,
2448
+ ): string {
2449
+ return JSON.stringify(
2450
+ RunAgentModelConfigurationParameters$outboundSchema.parse(
2451
+ runAgentModelConfigurationParameters,
2452
+ ),
2453
+ );
2454
+ }
2455
+
2456
+ /** @internal */
2457
+ export type RunAgentModelConfigurationRetry$Outbound = {
2458
+ count: number;
2459
+ on_codes?: Array<number> | undefined;
2460
+ };
2461
+
2462
+ /** @internal */
2463
+ export const RunAgentModelConfigurationRetry$outboundSchema: z.ZodType<
2464
+ RunAgentModelConfigurationRetry$Outbound,
2465
+ z.ZodTypeDef,
2466
+ RunAgentModelConfigurationRetry
2467
+ > = z.object({
2468
+ count: z.number().default(3),
2469
+ onCodes: z.array(z.number()).optional(),
2470
+ }).transform((v) => {
2471
+ return remap$(v, {
2472
+ onCodes: "on_codes",
2473
+ });
2474
+ });
2475
+
2476
+ export function runAgentModelConfigurationRetryToJSON(
2477
+ runAgentModelConfigurationRetry: RunAgentModelConfigurationRetry,
2478
+ ): string {
2479
+ return JSON.stringify(
2480
+ RunAgentModelConfigurationRetry$outboundSchema.parse(
2481
+ runAgentModelConfigurationRetry,
2482
+ ),
2483
+ );
2484
+ }
2485
+
2486
+ /** @internal */
2487
+ export type RunAgentModelConfiguration2$Outbound = {
2488
+ id: string;
2489
+ parameters?: RunAgentModelConfigurationParameters$Outbound | undefined;
2490
+ retry?: RunAgentModelConfigurationRetry$Outbound | undefined;
2491
+ };
2492
+
2493
+ /** @internal */
2494
+ export const RunAgentModelConfiguration2$outboundSchema: z.ZodType<
2495
+ RunAgentModelConfiguration2$Outbound,
2496
+ z.ZodTypeDef,
2497
+ RunAgentModelConfiguration2
2498
+ > = z.object({
2499
+ id: z.string(),
2500
+ parameters: z.lazy(() => RunAgentModelConfigurationParameters$outboundSchema)
2501
+ .optional(),
2502
+ retry: z.lazy(() => RunAgentModelConfigurationRetry$outboundSchema)
2503
+ .optional(),
2504
+ });
2505
+
2506
+ export function runAgentModelConfiguration2ToJSON(
2507
+ runAgentModelConfiguration2: RunAgentModelConfiguration2,
2508
+ ): string {
2509
+ return JSON.stringify(
2510
+ RunAgentModelConfiguration2$outboundSchema.parse(
2511
+ runAgentModelConfiguration2,
2512
+ ),
2513
+ );
2514
+ }
2515
+
2516
+ /** @internal */
2517
+ export type RunAgentModelConfiguration$Outbound =
2518
+ | RunAgentModelConfiguration2$Outbound
2519
+ | string;
2520
+
2521
+ /** @internal */
2522
+ export const RunAgentModelConfiguration$outboundSchema: z.ZodType<
2523
+ RunAgentModelConfiguration$Outbound,
2524
+ z.ZodTypeDef,
2525
+ RunAgentModelConfiguration
2526
+ > = z.union([
2527
+ z.lazy(() => RunAgentModelConfiguration2$outboundSchema),
2528
+ z.string(),
2529
+ ]);
2530
+
2531
+ export function runAgentModelConfigurationToJSON(
2532
+ runAgentModelConfiguration: RunAgentModelConfiguration,
2533
+ ): string {
2534
+ return JSON.stringify(
2535
+ RunAgentModelConfiguration$outboundSchema.parse(runAgentModelConfiguration),
2536
+ );
2537
+ }
2538
+
2539
+ /** @internal */
2540
+ export type RunAgentResponseFormatAgentsRequestRequestBodyJsonSchema$Outbound =
2541
+ {
2542
+ description?: string | undefined;
2543
+ name: string;
2544
+ schema?: any | undefined;
2545
+ strict: boolean;
2546
+ };
2547
+
2548
+ /** @internal */
2549
+ export const RunAgentResponseFormatAgentsRequestRequestBodyJsonSchema$outboundSchema:
2550
+ z.ZodType<
2551
+ RunAgentResponseFormatAgentsRequestRequestBodyJsonSchema$Outbound,
2552
+ z.ZodTypeDef,
2553
+ RunAgentResponseFormatAgentsRequestRequestBodyJsonSchema
2554
+ > = z.object({
2555
+ description: z.string().optional(),
2556
+ name: z.string(),
2557
+ schema: z.any().optional(),
2558
+ strict: z.boolean().default(false),
2559
+ });
2560
+
2561
+ export function runAgentResponseFormatAgentsRequestRequestBodyJsonSchemaToJSON(
2562
+ runAgentResponseFormatAgentsRequestRequestBodyJsonSchema:
2563
+ RunAgentResponseFormatAgentsRequestRequestBodyJsonSchema,
2564
+ ): string {
2565
+ return JSON.stringify(
2566
+ RunAgentResponseFormatAgentsRequestRequestBodyJsonSchema$outboundSchema
2567
+ .parse(runAgentResponseFormatAgentsRequestRequestBodyJsonSchema),
2568
+ );
2569
+ }
2570
+
2571
+ /** @internal */
2572
+ export type RunAgentResponseFormatAgentsRequestJSONSchema$Outbound = {
2573
+ type: "json_schema";
2574
+ json_schema:
2575
+ RunAgentResponseFormatAgentsRequestRequestBodyJsonSchema$Outbound;
2576
+ };
2577
+
2578
+ /** @internal */
2579
+ export const RunAgentResponseFormatAgentsRequestJSONSchema$outboundSchema:
2580
+ z.ZodType<
2581
+ RunAgentResponseFormatAgentsRequestJSONSchema$Outbound,
2582
+ z.ZodTypeDef,
2583
+ RunAgentResponseFormatAgentsRequestJSONSchema
2584
+ > = z.object({
2585
+ type: z.literal("json_schema"),
2586
+ jsonSchema: z.lazy(() =>
2587
+ RunAgentResponseFormatAgentsRequestRequestBodyJsonSchema$outboundSchema
2588
+ ),
2589
+ }).transform((v) => {
2590
+ return remap$(v, {
2591
+ jsonSchema: "json_schema",
2592
+ });
2593
+ });
2594
+
2595
+ export function runAgentResponseFormatAgentsRequestJSONSchemaToJSON(
2596
+ runAgentResponseFormatAgentsRequestJSONSchema:
2597
+ RunAgentResponseFormatAgentsRequestJSONSchema,
2598
+ ): string {
2599
+ return JSON.stringify(
2600
+ RunAgentResponseFormatAgentsRequestJSONSchema$outboundSchema.parse(
2601
+ runAgentResponseFormatAgentsRequestJSONSchema,
2602
+ ),
2603
+ );
2604
+ }
2605
+
2606
+ /** @internal */
2607
+ export type RunAgentResponseFormatAgentsJSONObject$Outbound = {
2608
+ type: "json_object";
2609
+ };
2610
+
2611
+ /** @internal */
2612
+ export const RunAgentResponseFormatAgentsJSONObject$outboundSchema: z.ZodType<
2613
+ RunAgentResponseFormatAgentsJSONObject$Outbound,
2614
+ z.ZodTypeDef,
2615
+ RunAgentResponseFormatAgentsJSONObject
2616
+ > = z.object({
2617
+ type: z.literal("json_object"),
2618
+ });
2619
+
2620
+ export function runAgentResponseFormatAgentsJSONObjectToJSON(
2621
+ runAgentResponseFormatAgentsJSONObject:
2622
+ RunAgentResponseFormatAgentsJSONObject,
2623
+ ): string {
2624
+ return JSON.stringify(
2625
+ RunAgentResponseFormatAgentsJSONObject$outboundSchema.parse(
2626
+ runAgentResponseFormatAgentsJSONObject,
2627
+ ),
2628
+ );
2629
+ }
2630
+
2631
+ /** @internal */
2632
+ export type RunAgentResponseFormatAgentsText$Outbound = {
2633
+ type: "text";
2634
+ };
2635
+
2636
+ /** @internal */
2637
+ export const RunAgentResponseFormatAgentsText$outboundSchema: z.ZodType<
2638
+ RunAgentResponseFormatAgentsText$Outbound,
2639
+ z.ZodTypeDef,
2640
+ RunAgentResponseFormatAgentsText
2641
+ > = z.object({
2642
+ type: z.literal("text"),
2643
+ });
2644
+
2645
+ export function runAgentResponseFormatAgentsTextToJSON(
2646
+ runAgentResponseFormatAgentsText: RunAgentResponseFormatAgentsText,
2647
+ ): string {
2648
+ return JSON.stringify(
2649
+ RunAgentResponseFormatAgentsText$outboundSchema.parse(
2650
+ runAgentResponseFormatAgentsText,
2651
+ ),
2652
+ );
2653
+ }
2654
+
2655
+ /** @internal */
2656
+ export type RunAgentFallbackModelConfigurationResponseFormat$Outbound =
2657
+ | RunAgentResponseFormatAgentsText$Outbound
2658
+ | RunAgentResponseFormatAgentsJSONObject$Outbound
2659
+ | RunAgentResponseFormatAgentsRequestJSONSchema$Outbound;
2660
+
2661
+ /** @internal */
2662
+ export const RunAgentFallbackModelConfigurationResponseFormat$outboundSchema:
2663
+ z.ZodType<
2664
+ RunAgentFallbackModelConfigurationResponseFormat$Outbound,
2665
+ z.ZodTypeDef,
2666
+ RunAgentFallbackModelConfigurationResponseFormat
2667
+ > = z.union([
2668
+ z.lazy(() => RunAgentResponseFormatAgentsText$outboundSchema),
2669
+ z.lazy(() => RunAgentResponseFormatAgentsJSONObject$outboundSchema),
2670
+ z.lazy(() => RunAgentResponseFormatAgentsRequestJSONSchema$outboundSchema),
2671
+ ]);
2672
+
2673
+ export function runAgentFallbackModelConfigurationResponseFormatToJSON(
2674
+ runAgentFallbackModelConfigurationResponseFormat:
2675
+ RunAgentFallbackModelConfigurationResponseFormat,
2676
+ ): string {
2677
+ return JSON.stringify(
2678
+ RunAgentFallbackModelConfigurationResponseFormat$outboundSchema.parse(
2679
+ runAgentFallbackModelConfigurationResponseFormat,
2680
+ ),
2681
+ );
2682
+ }
2683
+
2684
+ /** @internal */
2685
+ export const RunAgentFallbackModelConfigurationReasoningEffort$outboundSchema:
2686
+ z.ZodNativeEnum<typeof RunAgentFallbackModelConfigurationReasoningEffort> = z
2687
+ .nativeEnum(RunAgentFallbackModelConfigurationReasoningEffort);
2688
+
2689
+ /** @internal */
2690
+ export type RunAgentFallbackModelConfigurationStop$Outbound =
2691
+ | string
2692
+ | Array<string>;
2693
+
2694
+ /** @internal */
2695
+ export const RunAgentFallbackModelConfigurationStop$outboundSchema: z.ZodType<
2696
+ RunAgentFallbackModelConfigurationStop$Outbound,
2697
+ z.ZodTypeDef,
2698
+ RunAgentFallbackModelConfigurationStop
2699
+ > = z.union([z.string(), z.array(z.string())]);
2700
+
2701
+ export function runAgentFallbackModelConfigurationStopToJSON(
2702
+ runAgentFallbackModelConfigurationStop:
2703
+ RunAgentFallbackModelConfigurationStop,
2704
+ ): string {
2705
+ return JSON.stringify(
2706
+ RunAgentFallbackModelConfigurationStop$outboundSchema.parse(
2707
+ runAgentFallbackModelConfigurationStop,
2708
+ ),
2709
+ );
2710
+ }
2711
+
2712
+ /** @internal */
2713
+ export type RunAgentFallbackModelConfigurationThinking$Outbound =
2714
+ | components.ThinkingConfigDisabledSchema$Outbound
2715
+ | components.ThinkingConfigEnabledSchema$Outbound;
2716
+
2717
+ /** @internal */
2718
+ export const RunAgentFallbackModelConfigurationThinking$outboundSchema:
2719
+ z.ZodType<
2720
+ RunAgentFallbackModelConfigurationThinking$Outbound,
2721
+ z.ZodTypeDef,
2722
+ RunAgentFallbackModelConfigurationThinking
2723
+ > = z.union([
2724
+ components.ThinkingConfigDisabledSchema$outboundSchema,
2725
+ components.ThinkingConfigEnabledSchema$outboundSchema,
2726
+ ]);
2727
+
2728
+ export function runAgentFallbackModelConfigurationThinkingToJSON(
2729
+ runAgentFallbackModelConfigurationThinking:
2730
+ RunAgentFallbackModelConfigurationThinking,
2731
+ ): string {
2732
+ return JSON.stringify(
2733
+ RunAgentFallbackModelConfigurationThinking$outboundSchema.parse(
2734
+ runAgentFallbackModelConfigurationThinking,
2735
+ ),
2736
+ );
2737
+ }
2738
+
2739
+ /** @internal */
2740
+ export const RunAgentToolChoiceAgentsType$outboundSchema: z.ZodNativeEnum<
2741
+ typeof RunAgentToolChoiceAgentsType
2742
+ > = z.nativeEnum(RunAgentToolChoiceAgentsType);
2743
+
2744
+ /** @internal */
2745
+ export type RunAgentToolChoiceAgentsFunction$Outbound = {
2746
+ name: string;
2747
+ };
2748
+
2749
+ /** @internal */
2750
+ export const RunAgentToolChoiceAgentsFunction$outboundSchema: z.ZodType<
2751
+ RunAgentToolChoiceAgentsFunction$Outbound,
2752
+ z.ZodTypeDef,
2753
+ RunAgentToolChoiceAgentsFunction
2754
+ > = z.object({
2755
+ name: z.string(),
2756
+ });
2757
+
2758
+ export function runAgentToolChoiceAgentsFunctionToJSON(
2759
+ runAgentToolChoiceAgentsFunction: RunAgentToolChoiceAgentsFunction,
2760
+ ): string {
2761
+ return JSON.stringify(
2762
+ RunAgentToolChoiceAgentsFunction$outboundSchema.parse(
2763
+ runAgentToolChoiceAgentsFunction,
2764
+ ),
2765
+ );
2766
+ }
2767
+
2768
+ /** @internal */
2769
+ export type RunAgentToolChoiceAgents2$Outbound = {
2770
+ type?: string | undefined;
2771
+ function: RunAgentToolChoiceAgentsFunction$Outbound;
2772
+ };
2773
+
2774
+ /** @internal */
2775
+ export const RunAgentToolChoiceAgents2$outboundSchema: z.ZodType<
2776
+ RunAgentToolChoiceAgents2$Outbound,
2777
+ z.ZodTypeDef,
2778
+ RunAgentToolChoiceAgents2
2779
+ > = z.object({
2780
+ type: RunAgentToolChoiceAgentsType$outboundSchema.optional(),
2781
+ function: z.lazy(() => RunAgentToolChoiceAgentsFunction$outboundSchema),
2782
+ });
2783
+
2784
+ export function runAgentToolChoiceAgents2ToJSON(
2785
+ runAgentToolChoiceAgents2: RunAgentToolChoiceAgents2,
2786
+ ): string {
2787
+ return JSON.stringify(
2788
+ RunAgentToolChoiceAgents2$outboundSchema.parse(runAgentToolChoiceAgents2),
2789
+ );
2790
+ }
2791
+
2792
+ /** @internal */
2793
+ export const RunAgentToolChoiceAgents1$outboundSchema: z.ZodNativeEnum<
2794
+ typeof RunAgentToolChoiceAgents1
2795
+ > = z.nativeEnum(RunAgentToolChoiceAgents1);
2796
+
2797
+ /** @internal */
2798
+ export type RunAgentFallbackModelConfigurationToolChoice$Outbound =
2799
+ | RunAgentToolChoiceAgents2$Outbound
2800
+ | string;
2801
+
2802
+ /** @internal */
2803
+ export const RunAgentFallbackModelConfigurationToolChoice$outboundSchema:
2804
+ z.ZodType<
2805
+ RunAgentFallbackModelConfigurationToolChoice$Outbound,
2806
+ z.ZodTypeDef,
2807
+ RunAgentFallbackModelConfigurationToolChoice
2808
+ > = z.union([
2809
+ z.lazy(() => RunAgentToolChoiceAgents2$outboundSchema),
2810
+ RunAgentToolChoiceAgents1$outboundSchema,
2811
+ ]);
2812
+
2813
+ export function runAgentFallbackModelConfigurationToolChoiceToJSON(
2814
+ runAgentFallbackModelConfigurationToolChoice:
2815
+ RunAgentFallbackModelConfigurationToolChoice,
2816
+ ): string {
2817
+ return JSON.stringify(
2818
+ RunAgentFallbackModelConfigurationToolChoice$outboundSchema.parse(
2819
+ runAgentFallbackModelConfigurationToolChoice,
2820
+ ),
2821
+ );
2822
+ }
2823
+
2824
+ /** @internal */
2825
+ export const RunAgentFallbackModelConfigurationModalities$outboundSchema:
2826
+ z.ZodNativeEnum<typeof RunAgentFallbackModelConfigurationModalities> = z
2827
+ .nativeEnum(RunAgentFallbackModelConfigurationModalities);
2828
+
2829
+ /** @internal */
2830
+ export const RunAgentIdAgents1$outboundSchema: z.ZodNativeEnum<
2831
+ typeof RunAgentIdAgents1
2832
+ > = z.nativeEnum(RunAgentIdAgents1);
2833
+
2834
+ /** @internal */
2835
+ export type RunAgentFallbackModelConfigurationId$Outbound = string | string;
2836
+
2837
+ /** @internal */
2838
+ export const RunAgentFallbackModelConfigurationId$outboundSchema: z.ZodType<
2839
+ RunAgentFallbackModelConfigurationId$Outbound,
2840
+ z.ZodTypeDef,
2841
+ RunAgentFallbackModelConfigurationId
2842
+ > = z.union([RunAgentIdAgents1$outboundSchema, z.string()]);
2843
+
2844
+ export function runAgentFallbackModelConfigurationIdToJSON(
2845
+ runAgentFallbackModelConfigurationId: RunAgentFallbackModelConfigurationId,
2846
+ ): string {
2847
+ return JSON.stringify(
2848
+ RunAgentFallbackModelConfigurationId$outboundSchema.parse(
2849
+ runAgentFallbackModelConfigurationId,
2850
+ ),
2851
+ );
2852
+ }
2853
+
2854
+ /** @internal */
2855
+ export const RunAgentFallbackModelConfigurationExecuteOn$outboundSchema:
2856
+ z.ZodNativeEnum<typeof RunAgentFallbackModelConfigurationExecuteOn> = z
2857
+ .nativeEnum(RunAgentFallbackModelConfigurationExecuteOn);
2858
+
2859
+ /** @internal */
2860
+ export type RunAgentFallbackModelConfigurationGuardrails$Outbound = {
2861
+ id: string | string;
2862
+ execute_on: string;
2863
+ };
2864
+
2865
+ /** @internal */
2866
+ export const RunAgentFallbackModelConfigurationGuardrails$outboundSchema:
2867
+ z.ZodType<
2868
+ RunAgentFallbackModelConfigurationGuardrails$Outbound,
2869
+ z.ZodTypeDef,
2870
+ RunAgentFallbackModelConfigurationGuardrails
2871
+ > = z.object({
2872
+ id: z.union([RunAgentIdAgents1$outboundSchema, z.string()]),
2873
+ executeOn: RunAgentFallbackModelConfigurationExecuteOn$outboundSchema,
2874
+ }).transform((v) => {
2875
+ return remap$(v, {
2876
+ executeOn: "execute_on",
2877
+ });
2878
+ });
2879
+
2880
+ export function runAgentFallbackModelConfigurationGuardrailsToJSON(
2881
+ runAgentFallbackModelConfigurationGuardrails:
2882
+ RunAgentFallbackModelConfigurationGuardrails,
2883
+ ): string {
2884
+ return JSON.stringify(
2885
+ RunAgentFallbackModelConfigurationGuardrails$outboundSchema.parse(
2886
+ runAgentFallbackModelConfigurationGuardrails,
2887
+ ),
2888
+ );
2889
+ }
2890
+
2891
+ /** @internal */
2892
+ export type RunAgentFallbackModelConfigurationFallbacks$Outbound = {
2893
+ model: string;
2894
+ };
2895
+
2896
+ /** @internal */
2897
+ export const RunAgentFallbackModelConfigurationFallbacks$outboundSchema:
2898
+ z.ZodType<
2899
+ RunAgentFallbackModelConfigurationFallbacks$Outbound,
2900
+ z.ZodTypeDef,
2901
+ RunAgentFallbackModelConfigurationFallbacks
2902
+ > = z.object({
2903
+ model: z.string(),
2904
+ });
2905
+
2906
+ export function runAgentFallbackModelConfigurationFallbacksToJSON(
2907
+ runAgentFallbackModelConfigurationFallbacks:
2908
+ RunAgentFallbackModelConfigurationFallbacks,
2909
+ ): string {
2910
+ return JSON.stringify(
2911
+ RunAgentFallbackModelConfigurationFallbacks$outboundSchema.parse(
2912
+ runAgentFallbackModelConfigurationFallbacks,
2913
+ ),
2914
+ );
2915
+ }
2916
+
2917
+ /** @internal */
2918
+ export const RunAgentFallbackModelConfigurationType$outboundSchema:
2919
+ z.ZodNativeEnum<typeof RunAgentFallbackModelConfigurationType> = z.nativeEnum(
2920
+ RunAgentFallbackModelConfigurationType,
2921
+ );
2922
+
2923
+ /** @internal */
2924
+ export type RunAgentFallbackModelConfigurationCache$Outbound = {
2925
+ ttl: number;
2926
+ type: string;
2927
+ };
2928
+
2929
+ /** @internal */
2930
+ export const RunAgentFallbackModelConfigurationCache$outboundSchema: z.ZodType<
2931
+ RunAgentFallbackModelConfigurationCache$Outbound,
2932
+ z.ZodTypeDef,
2933
+ RunAgentFallbackModelConfigurationCache
2934
+ > = z.object({
2935
+ ttl: z.number().default(1800),
2936
+ type: RunAgentFallbackModelConfigurationType$outboundSchema,
2937
+ });
2938
+
2939
+ export function runAgentFallbackModelConfigurationCacheToJSON(
2940
+ runAgentFallbackModelConfigurationCache:
2941
+ RunAgentFallbackModelConfigurationCache,
2942
+ ): string {
2943
+ return JSON.stringify(
2944
+ RunAgentFallbackModelConfigurationCache$outboundSchema.parse(
2945
+ runAgentFallbackModelConfigurationCache,
2946
+ ),
2947
+ );
2948
+ }
2949
+
2950
+ /** @internal */
2951
+ export const RunAgentLoadBalancerAgentsType$outboundSchema: z.ZodNativeEnum<
2952
+ typeof RunAgentLoadBalancerAgentsType
2953
+ > = z.nativeEnum(RunAgentLoadBalancerAgentsType);
2954
+
2955
+ /** @internal */
2956
+ export type RunAgentLoadBalancerAgentsModels$Outbound = {
2957
+ model: string;
2958
+ weight: number;
2959
+ };
2960
+
2961
+ /** @internal */
2962
+ export const RunAgentLoadBalancerAgentsModels$outboundSchema: z.ZodType<
2963
+ RunAgentLoadBalancerAgentsModels$Outbound,
2964
+ z.ZodTypeDef,
2965
+ RunAgentLoadBalancerAgentsModels
2966
+ > = z.object({
2967
+ model: z.string(),
2968
+ weight: z.number().default(0.5),
2969
+ });
2970
+
2971
+ export function runAgentLoadBalancerAgentsModelsToJSON(
2972
+ runAgentLoadBalancerAgentsModels: RunAgentLoadBalancerAgentsModels,
2973
+ ): string {
2974
+ return JSON.stringify(
2975
+ RunAgentLoadBalancerAgentsModels$outboundSchema.parse(
2976
+ runAgentLoadBalancerAgentsModels,
2977
+ ),
2978
+ );
2979
+ }
2980
+
2981
+ /** @internal */
2982
+ export type RunAgentLoadBalancerAgents1$Outbound = {
2983
+ type: string;
2984
+ models: Array<RunAgentLoadBalancerAgentsModels$Outbound>;
2985
+ };
2986
+
2987
+ /** @internal */
2988
+ export const RunAgentLoadBalancerAgents1$outboundSchema: z.ZodType<
2989
+ RunAgentLoadBalancerAgents1$Outbound,
2990
+ z.ZodTypeDef,
2991
+ RunAgentLoadBalancerAgents1
2992
+ > = z.object({
2993
+ type: RunAgentLoadBalancerAgentsType$outboundSchema,
2994
+ models: z.array(
2995
+ z.lazy(() => RunAgentLoadBalancerAgentsModels$outboundSchema),
2996
+ ),
2997
+ });
2998
+
2999
+ export function runAgentLoadBalancerAgents1ToJSON(
3000
+ runAgentLoadBalancerAgents1: RunAgentLoadBalancerAgents1,
3001
+ ): string {
3002
+ return JSON.stringify(
3003
+ RunAgentLoadBalancerAgents1$outboundSchema.parse(
3004
+ runAgentLoadBalancerAgents1,
3005
+ ),
3006
+ );
3007
+ }
3008
+
3009
+ /** @internal */
3010
+ export type RunAgentFallbackModelConfigurationLoadBalancer$Outbound =
3011
+ RunAgentLoadBalancerAgents1$Outbound;
3012
+
3013
+ /** @internal */
3014
+ export const RunAgentFallbackModelConfigurationLoadBalancer$outboundSchema:
3015
+ z.ZodType<
3016
+ RunAgentFallbackModelConfigurationLoadBalancer$Outbound,
3017
+ z.ZodTypeDef,
3018
+ RunAgentFallbackModelConfigurationLoadBalancer
3019
+ > = z.lazy(() => RunAgentLoadBalancerAgents1$outboundSchema);
3020
+
3021
+ export function runAgentFallbackModelConfigurationLoadBalancerToJSON(
3022
+ runAgentFallbackModelConfigurationLoadBalancer:
3023
+ RunAgentFallbackModelConfigurationLoadBalancer,
3024
+ ): string {
3025
+ return JSON.stringify(
3026
+ RunAgentFallbackModelConfigurationLoadBalancer$outboundSchema.parse(
3027
+ runAgentFallbackModelConfigurationLoadBalancer,
3028
+ ),
3029
+ );
3030
+ }
3031
+
3032
+ /** @internal */
3033
+ export type RunAgentFallbackModelConfigurationTimeout$Outbound = {
3034
+ call_timeout: number;
3035
+ };
3036
+
3037
+ /** @internal */
3038
+ export const RunAgentFallbackModelConfigurationTimeout$outboundSchema:
3039
+ z.ZodType<
3040
+ RunAgentFallbackModelConfigurationTimeout$Outbound,
3041
+ z.ZodTypeDef,
3042
+ RunAgentFallbackModelConfigurationTimeout
3043
+ > = z.object({
3044
+ callTimeout: z.number(),
3045
+ }).transform((v) => {
3046
+ return remap$(v, {
3047
+ callTimeout: "call_timeout",
3048
+ });
3049
+ });
3050
+
3051
+ export function runAgentFallbackModelConfigurationTimeoutToJSON(
3052
+ runAgentFallbackModelConfigurationTimeout:
3053
+ RunAgentFallbackModelConfigurationTimeout,
3054
+ ): string {
3055
+ return JSON.stringify(
3056
+ RunAgentFallbackModelConfigurationTimeout$outboundSchema.parse(
3057
+ runAgentFallbackModelConfigurationTimeout,
3058
+ ),
3059
+ );
3060
+ }
3061
+
3062
+ /** @internal */
3063
+ export type RunAgentFallbackModelConfigurationParameters$Outbound = {
3064
+ name?: string | undefined;
3065
+ frequency_penalty?: number | null | undefined;
3066
+ max_tokens?: number | null | undefined;
3067
+ max_completion_tokens?: number | null | undefined;
3068
+ presence_penalty?: number | null | undefined;
3069
+ response_format?:
3070
+ | RunAgentResponseFormatAgentsText$Outbound
3071
+ | RunAgentResponseFormatAgentsJSONObject$Outbound
3072
+ | RunAgentResponseFormatAgentsRequestJSONSchema$Outbound
3073
+ | undefined;
3074
+ reasoning_effort?: string | undefined;
3075
+ verbosity?: string | undefined;
3076
+ seed?: number | null | undefined;
3077
+ stop?: string | Array<string> | null | undefined;
3078
+ thinking?:
3079
+ | components.ThinkingConfigDisabledSchema$Outbound
3080
+ | components.ThinkingConfigEnabledSchema$Outbound
3081
+ | undefined;
3082
+ temperature?: number | null | undefined;
3083
+ top_p?: number | null | undefined;
3084
+ top_k?: number | null | undefined;
3085
+ tool_choice?: RunAgentToolChoiceAgents2$Outbound | string | undefined;
3086
+ parallel_tool_calls?: boolean | undefined;
3087
+ modalities?: Array<string> | null | undefined;
3088
+ guardrails?:
3089
+ | Array<RunAgentFallbackModelConfigurationGuardrails$Outbound>
3090
+ | undefined;
3091
+ fallbacks?:
3092
+ | Array<RunAgentFallbackModelConfigurationFallbacks$Outbound>
3093
+ | undefined;
3094
+ cache?: RunAgentFallbackModelConfigurationCache$Outbound | undefined;
3095
+ load_balancer?: RunAgentLoadBalancerAgents1$Outbound | undefined;
3096
+ timeout?: RunAgentFallbackModelConfigurationTimeout$Outbound | undefined;
3097
+ };
3098
+
3099
+ /** @internal */
3100
+ export const RunAgentFallbackModelConfigurationParameters$outboundSchema:
3101
+ z.ZodType<
3102
+ RunAgentFallbackModelConfigurationParameters$Outbound,
3103
+ z.ZodTypeDef,
3104
+ RunAgentFallbackModelConfigurationParameters
3105
+ > = z.object({
3106
+ name: z.string().optional(),
3107
+ frequencyPenalty: z.nullable(z.number()).optional(),
3108
+ maxTokens: z.nullable(z.number().int()).optional(),
3109
+ maxCompletionTokens: z.nullable(z.number().int()).optional(),
3110
+ presencePenalty: z.nullable(z.number()).optional(),
3111
+ responseFormat: z.union([
3112
+ z.lazy(() => RunAgentResponseFormatAgentsText$outboundSchema),
3113
+ z.lazy(() => RunAgentResponseFormatAgentsJSONObject$outboundSchema),
3114
+ z.lazy(() =>
3115
+ RunAgentResponseFormatAgentsRequestJSONSchema$outboundSchema
3116
+ ),
3117
+ ]).optional(),
3118
+ reasoningEffort:
3119
+ RunAgentFallbackModelConfigurationReasoningEffort$outboundSchema
3120
+ .optional(),
3121
+ verbosity: z.string().optional(),
3122
+ seed: z.nullable(z.number()).optional(),
3123
+ stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
3124
+ thinking: z.union([
3125
+ components.ThinkingConfigDisabledSchema$outboundSchema,
3126
+ components.ThinkingConfigEnabledSchema$outboundSchema,
3127
+ ]).optional(),
3128
+ temperature: z.nullable(z.number()).optional(),
3129
+ topP: z.nullable(z.number()).optional(),
3130
+ topK: z.nullable(z.number()).optional(),
3131
+ toolChoice: z.union([
3132
+ z.lazy(() => RunAgentToolChoiceAgents2$outboundSchema),
3133
+ RunAgentToolChoiceAgents1$outboundSchema,
3134
+ ]).optional(),
3135
+ parallelToolCalls: z.boolean().optional(),
3136
+ modalities: z.nullable(
3137
+ z.array(RunAgentFallbackModelConfigurationModalities$outboundSchema),
3138
+ ).optional(),
3139
+ guardrails: z.array(
3140
+ z.lazy(() => RunAgentFallbackModelConfigurationGuardrails$outboundSchema),
3141
+ ).optional(),
3142
+ fallbacks: z.array(
3143
+ z.lazy(() => RunAgentFallbackModelConfigurationFallbacks$outboundSchema),
3144
+ ).optional(),
3145
+ cache: z.lazy(() => RunAgentFallbackModelConfigurationCache$outboundSchema)
3146
+ .optional(),
3147
+ loadBalancer: z.lazy(() => RunAgentLoadBalancerAgents1$outboundSchema)
3148
+ .optional(),
3149
+ timeout: z.lazy(() =>
3150
+ RunAgentFallbackModelConfigurationTimeout$outboundSchema
3151
+ ).optional(),
3152
+ }).transform((v) => {
3153
+ return remap$(v, {
3154
+ frequencyPenalty: "frequency_penalty",
3155
+ maxTokens: "max_tokens",
3156
+ maxCompletionTokens: "max_completion_tokens",
3157
+ presencePenalty: "presence_penalty",
3158
+ responseFormat: "response_format",
3159
+ reasoningEffort: "reasoning_effort",
3160
+ topP: "top_p",
3161
+ topK: "top_k",
3162
+ toolChoice: "tool_choice",
3163
+ parallelToolCalls: "parallel_tool_calls",
3164
+ loadBalancer: "load_balancer",
3165
+ });
3166
+ });
3167
+
3168
+ export function runAgentFallbackModelConfigurationParametersToJSON(
3169
+ runAgentFallbackModelConfigurationParameters:
3170
+ RunAgentFallbackModelConfigurationParameters,
3171
+ ): string {
3172
+ return JSON.stringify(
3173
+ RunAgentFallbackModelConfigurationParameters$outboundSchema.parse(
3174
+ runAgentFallbackModelConfigurationParameters,
3175
+ ),
3176
+ );
3177
+ }
3178
+
3179
+ /** @internal */
3180
+ export type RunAgentFallbackModelConfigurationRetry$Outbound = {
3181
+ count: number;
3182
+ on_codes?: Array<number> | undefined;
3183
+ };
3184
+
3185
+ /** @internal */
3186
+ export const RunAgentFallbackModelConfigurationRetry$outboundSchema: z.ZodType<
3187
+ RunAgentFallbackModelConfigurationRetry$Outbound,
3188
+ z.ZodTypeDef,
3189
+ RunAgentFallbackModelConfigurationRetry
3190
+ > = z.object({
3191
+ count: z.number().default(3),
3192
+ onCodes: z.array(z.number()).optional(),
3193
+ }).transform((v) => {
3194
+ return remap$(v, {
3195
+ onCodes: "on_codes",
3196
+ });
3197
+ });
3198
+
3199
+ export function runAgentFallbackModelConfigurationRetryToJSON(
3200
+ runAgentFallbackModelConfigurationRetry:
3201
+ RunAgentFallbackModelConfigurationRetry,
3202
+ ): string {
3203
+ return JSON.stringify(
3204
+ RunAgentFallbackModelConfigurationRetry$outboundSchema.parse(
3205
+ runAgentFallbackModelConfigurationRetry,
3206
+ ),
3207
+ );
3208
+ }
3209
+
3210
+ /** @internal */
3211
+ export type RunAgentFallbackModelConfiguration2$Outbound = {
3212
+ id: string;
3213
+ parameters?:
3214
+ | RunAgentFallbackModelConfigurationParameters$Outbound
3215
+ | undefined;
3216
+ retry?: RunAgentFallbackModelConfigurationRetry$Outbound | undefined;
3217
+ };
3218
+
3219
+ /** @internal */
3220
+ export const RunAgentFallbackModelConfiguration2$outboundSchema: z.ZodType<
3221
+ RunAgentFallbackModelConfiguration2$Outbound,
3222
+ z.ZodTypeDef,
3223
+ RunAgentFallbackModelConfiguration2
3224
+ > = z.object({
3225
+ id: z.string(),
3226
+ parameters: z.lazy(() =>
3227
+ RunAgentFallbackModelConfigurationParameters$outboundSchema
3228
+ ).optional(),
3229
+ retry: z.lazy(() => RunAgentFallbackModelConfigurationRetry$outboundSchema)
3230
+ .optional(),
3231
+ });
3232
+
3233
+ export function runAgentFallbackModelConfiguration2ToJSON(
3234
+ runAgentFallbackModelConfiguration2: RunAgentFallbackModelConfiguration2,
3235
+ ): string {
3236
+ return JSON.stringify(
3237
+ RunAgentFallbackModelConfiguration2$outboundSchema.parse(
3238
+ runAgentFallbackModelConfiguration2,
3239
+ ),
3240
+ );
3241
+ }
3242
+
3243
+ /** @internal */
3244
+ export type RunAgentFallbackModelConfiguration$Outbound =
3245
+ | RunAgentFallbackModelConfiguration2$Outbound
3246
+ | string;
3247
+
3248
+ /** @internal */
3249
+ export const RunAgentFallbackModelConfiguration$outboundSchema: z.ZodType<
3250
+ RunAgentFallbackModelConfiguration$Outbound,
3251
+ z.ZodTypeDef,
3252
+ RunAgentFallbackModelConfiguration
3253
+ > = z.union([
3254
+ z.lazy(() => RunAgentFallbackModelConfiguration2$outboundSchema),
3255
+ z.string(),
3256
+ ]);
3257
+
3258
+ export function runAgentFallbackModelConfigurationToJSON(
3259
+ runAgentFallbackModelConfiguration: RunAgentFallbackModelConfiguration,
3260
+ ): string {
3261
+ return JSON.stringify(
3262
+ RunAgentFallbackModelConfiguration$outboundSchema.parse(
3263
+ runAgentFallbackModelConfiguration,
3264
+ ),
3265
+ );
3266
+ }
3267
+
3268
+ /** @internal */
3269
+ export const RunAgentRoleToolMessage$outboundSchema: z.ZodNativeEnum<
3270
+ typeof RunAgentRoleToolMessage
3271
+ > = z.nativeEnum(RunAgentRoleToolMessage);
3272
+
3273
+ /** @internal */
3274
+ export const RunAgentRoleUserMessage$outboundSchema: z.ZodNativeEnum<
3275
+ typeof RunAgentRoleUserMessage
3276
+ > = z.nativeEnum(RunAgentRoleUserMessage);
3277
+
3278
+ /** @internal */
3279
+ export type RunAgentRole$Outbound = string | string;
3280
+
3281
+ /** @internal */
3282
+ export const RunAgentRole$outboundSchema: z.ZodType<
3283
+ RunAgentRole$Outbound,
3284
+ z.ZodTypeDef,
3285
+ RunAgentRole
3286
+ > = z.union([
3287
+ RunAgentRoleUserMessage$outboundSchema,
3288
+ RunAgentRoleToolMessage$outboundSchema,
3289
+ ]);
3290
+
3291
+ export function runAgentRoleToJSON(runAgentRole: RunAgentRole): string {
3292
+ return JSON.stringify(RunAgentRole$outboundSchema.parse(runAgentRole));
3293
+ }
3294
+
3295
+ /** @internal */
3296
+ export type RunAgentPublicMessagePart$Outbound =
3297
+ | components.TextPart$Outbound
3298
+ | components.FilePart$Outbound
3299
+ | components.ToolResultPart$Outbound
3300
+ | components.ErrorPart$Outbound;
3301
+
3302
+ /** @internal */
3303
+ export const RunAgentPublicMessagePart$outboundSchema: z.ZodType<
3304
+ RunAgentPublicMessagePart$Outbound,
3305
+ z.ZodTypeDef,
3306
+ RunAgentPublicMessagePart
3307
+ > = z.union([
3308
+ components.TextPart$outboundSchema,
3309
+ components.FilePart$outboundSchema,
3310
+ components.ToolResultPart$outboundSchema,
3311
+ components.ErrorPart$outboundSchema,
3312
+ ]);
3313
+
3314
+ export function runAgentPublicMessagePartToJSON(
3315
+ runAgentPublicMessagePart: RunAgentPublicMessagePart,
3316
+ ): string {
3317
+ return JSON.stringify(
3318
+ RunAgentPublicMessagePart$outboundSchema.parse(runAgentPublicMessagePart),
3319
+ );
3320
+ }
3321
+
3322
+ /** @internal */
3323
+ export type RunAgentA2AMessage$Outbound = {
3324
+ messageId?: string | undefined;
3325
+ role: string | string;
3326
+ parts: Array<
3327
+ | components.TextPart$Outbound
3328
+ | components.FilePart$Outbound
3329
+ | components.ToolResultPart$Outbound
3330
+ | components.ErrorPart$Outbound
3331
+ >;
3332
+ };
3333
+
3334
+ /** @internal */
3335
+ export const RunAgentA2AMessage$outboundSchema: z.ZodType<
3336
+ RunAgentA2AMessage$Outbound,
3337
+ z.ZodTypeDef,
3338
+ RunAgentA2AMessage
3339
+ > = z.object({
3340
+ messageId: z.string().optional(),
3341
+ role: z.union([
3342
+ RunAgentRoleUserMessage$outboundSchema,
3343
+ RunAgentRoleToolMessage$outboundSchema,
3344
+ ]),
3345
+ parts: z.array(
3346
+ z.union([
3347
+ components.TextPart$outboundSchema,
3348
+ components.FilePart$outboundSchema,
3349
+ components.ToolResultPart$outboundSchema,
3350
+ components.ErrorPart$outboundSchema,
3351
+ ]),
3352
+ ),
3353
+ });
3354
+
3355
+ export function runAgentA2AMessageToJSON(
3356
+ runAgentA2AMessage: RunAgentA2AMessage,
3357
+ ): string {
3358
+ return JSON.stringify(
3359
+ RunAgentA2AMessage$outboundSchema.parse(runAgentA2AMessage),
3360
+ );
3361
+ }
3362
+
3363
+ /** @internal */
3364
+ export type RunAgentIdentity$Outbound = {
3365
+ id: string;
3366
+ display_name?: string | undefined;
3367
+ email?: string | undefined;
3368
+ metadata?: Array<{ [k: string]: any }> | undefined;
3369
+ logo_url?: string | undefined;
3370
+ tags?: Array<string> | undefined;
3371
+ };
3372
+
3373
+ /** @internal */
3374
+ export const RunAgentIdentity$outboundSchema: z.ZodType<
3375
+ RunAgentIdentity$Outbound,
3376
+ z.ZodTypeDef,
3377
+ RunAgentIdentity
3378
+ > = z.object({
3379
+ id: z.string(),
3380
+ displayName: z.string().optional(),
3381
+ email: z.string().optional(),
3382
+ metadata: z.array(z.record(z.any())).optional(),
3383
+ logoUrl: z.string().optional(),
3384
+ tags: z.array(z.string()).optional(),
3385
+ }).transform((v) => {
3386
+ return remap$(v, {
3387
+ displayName: "display_name",
3388
+ logoUrl: "logo_url",
3389
+ });
3390
+ });
3391
+
3392
+ export function runAgentIdentityToJSON(
3393
+ runAgentIdentity: RunAgentIdentity,
3394
+ ): string {
3395
+ return JSON.stringify(
3396
+ RunAgentIdentity$outboundSchema.parse(runAgentIdentity),
3397
+ );
3398
+ }
3399
+
3400
+ /** @internal */
3401
+ export type RunAgentContact$Outbound = {
3402
+ id: string;
3403
+ display_name?: string | undefined;
3404
+ email?: string | undefined;
3405
+ metadata?: Array<{ [k: string]: any }> | undefined;
3406
+ logo_url?: string | undefined;
3407
+ tags?: Array<string> | undefined;
3408
+ };
3409
+
3410
+ /** @internal */
3411
+ export const RunAgentContact$outboundSchema: z.ZodType<
3412
+ RunAgentContact$Outbound,
3413
+ z.ZodTypeDef,
3414
+ RunAgentContact
3415
+ > = z.object({
3416
+ id: z.string(),
3417
+ displayName: z.string().optional(),
3418
+ email: z.string().optional(),
3419
+ metadata: z.array(z.record(z.any())).optional(),
3420
+ logoUrl: z.string().optional(),
3421
+ tags: z.array(z.string()).optional(),
3422
+ }).transform((v) => {
3423
+ return remap$(v, {
3424
+ displayName: "display_name",
3425
+ logoUrl: "logo_url",
3426
+ });
3427
+ });
3428
+
3429
+ export function runAgentContactToJSON(
3430
+ runAgentContact: RunAgentContact,
3431
+ ): string {
3432
+ return JSON.stringify(RunAgentContact$outboundSchema.parse(runAgentContact));
3433
+ }
3434
+
3435
+ /** @internal */
3436
+ export type RunAgentThread$Outbound = {
3437
+ id: string;
3438
+ tags?: Array<string> | undefined;
3439
+ };
3440
+
3441
+ /** @internal */
3442
+ export const RunAgentThread$outboundSchema: z.ZodType<
3443
+ RunAgentThread$Outbound,
3444
+ z.ZodTypeDef,
3445
+ RunAgentThread
3446
+ > = z.object({
3447
+ id: z.string(),
3448
+ tags: z.array(z.string()).optional(),
3449
+ });
3450
+
3451
+ export function runAgentThreadToJSON(runAgentThread: RunAgentThread): string {
3452
+ return JSON.stringify(RunAgentThread$outboundSchema.parse(runAgentThread));
3453
+ }
3454
+
3455
+ /** @internal */
3456
+ export type RunAgentMemory$Outbound = {
3457
+ entity_id: string;
3458
+ };
3459
+
3460
+ /** @internal */
3461
+ export const RunAgentMemory$outboundSchema: z.ZodType<
3462
+ RunAgentMemory$Outbound,
3463
+ z.ZodTypeDef,
3464
+ RunAgentMemory
3465
+ > = z.object({
3466
+ entityId: z.string(),
3467
+ }).transform((v) => {
3468
+ return remap$(v, {
3469
+ entityId: "entity_id",
3470
+ });
3471
+ });
3472
+
3473
+ export function runAgentMemoryToJSON(runAgentMemory: RunAgentMemory): string {
3474
+ return JSON.stringify(RunAgentMemory$outboundSchema.parse(runAgentMemory));
3475
+ }
3476
+
3477
+ /** @internal */
3478
+ export type RunAgentKnowledgeBases$Outbound = {
3479
+ knowledge_id: string;
3480
+ };
3481
+
3482
+ /** @internal */
3483
+ export const RunAgentKnowledgeBases$outboundSchema: z.ZodType<
3484
+ RunAgentKnowledgeBases$Outbound,
3485
+ z.ZodTypeDef,
3486
+ RunAgentKnowledgeBases
3487
+ > = z.object({
3488
+ knowledgeId: z.string(),
3489
+ }).transform((v) => {
3490
+ return remap$(v, {
3491
+ knowledgeId: "knowledge_id",
3492
+ });
3493
+ });
3494
+
3495
+ export function runAgentKnowledgeBasesToJSON(
3496
+ runAgentKnowledgeBases: RunAgentKnowledgeBases,
3497
+ ): string {
3498
+ return JSON.stringify(
3499
+ RunAgentKnowledgeBases$outboundSchema.parse(runAgentKnowledgeBases),
3500
+ );
3501
+ }
3502
+
3503
+ /** @internal */
3504
+ export type RunAgentTeamOfAgents$Outbound = {
3505
+ key: string;
3506
+ role?: string | undefined;
3507
+ };
3508
+
3509
+ /** @internal */
3510
+ export const RunAgentTeamOfAgents$outboundSchema: z.ZodType<
3511
+ RunAgentTeamOfAgents$Outbound,
3512
+ z.ZodTypeDef,
3513
+ RunAgentTeamOfAgents
3514
+ > = z.object({
3515
+ key: z.string(),
3516
+ role: z.string().optional(),
3517
+ });
3518
+
3519
+ export function runAgentTeamOfAgentsToJSON(
3520
+ runAgentTeamOfAgents: RunAgentTeamOfAgents,
3521
+ ): string {
3522
+ return JSON.stringify(
3523
+ RunAgentTeamOfAgents$outboundSchema.parse(runAgentTeamOfAgents),
3524
+ );
3525
+ }
3526
+
3527
+ /** @internal */
3528
+ export type RunAgentAgentToolInputRunHeaders$Outbound = {
3529
+ value: string;
3530
+ encrypted: boolean;
3531
+ };
3532
+
3533
+ /** @internal */
3534
+ export const RunAgentAgentToolInputRunHeaders$outboundSchema: z.ZodType<
3535
+ RunAgentAgentToolInputRunHeaders$Outbound,
3536
+ z.ZodTypeDef,
3537
+ RunAgentAgentToolInputRunHeaders
3538
+ > = z.object({
3539
+ value: z.string(),
3540
+ encrypted: z.boolean().default(false),
3541
+ });
3542
+
3543
+ export function runAgentAgentToolInputRunHeadersToJSON(
3544
+ runAgentAgentToolInputRunHeaders: RunAgentAgentToolInputRunHeaders,
3545
+ ): string {
3546
+ return JSON.stringify(
3547
+ RunAgentAgentToolInputRunHeaders$outboundSchema.parse(
3548
+ runAgentAgentToolInputRunHeaders,
3549
+ ),
3550
+ );
3551
+ }
3552
+
3553
+ /** @internal */
3554
+ export const RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType$outboundSchema:
3555
+ z.ZodNativeEnum<
3556
+ typeof RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType
3557
+ > = z.nativeEnum(
3558
+ RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType,
3559
+ );
3560
+
3561
+ /** @internal */
3562
+ export type AgentToolInputRunSchema$Outbound = {
3563
+ type: string;
3564
+ properties?: { [k: string]: any } | undefined;
3565
+ required?: Array<string> | undefined;
3566
+ };
3567
+
3568
+ /** @internal */
3569
+ export const AgentToolInputRunSchema$outboundSchema: z.ZodType<
3570
+ AgentToolInputRunSchema$Outbound,
3571
+ z.ZodTypeDef,
3572
+ AgentToolInputRunSchema
3573
+ > = z.object({
3574
+ type:
3575
+ RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType$outboundSchema,
3576
+ properties: z.record(z.any()).optional(),
3577
+ required: z.array(z.string()).optional(),
3578
+ });
3579
+
3580
+ export function agentToolInputRunSchemaToJSON(
3581
+ agentToolInputRunSchema: AgentToolInputRunSchema,
3582
+ ): string {
3583
+ return JSON.stringify(
3584
+ AgentToolInputRunSchema$outboundSchema.parse(agentToolInputRunSchema),
3585
+ );
3586
+ }
3587
+
3588
+ /** @internal */
3589
+ export type Tools$Outbound = {
3590
+ id: string;
3591
+ name: string;
3592
+ description?: string | undefined;
3593
+ schema: AgentToolInputRunSchema$Outbound;
3594
+ };
3595
+
3596
+ /** @internal */
3597
+ export const Tools$outboundSchema: z.ZodType<
3598
+ Tools$Outbound,
3599
+ z.ZodTypeDef,
3600
+ Tools
3601
+ > = z.object({
3602
+ id: z.string().default("01KKCE2S6CZE3YW5MFETEJBQAH"),
3603
+ name: z.string(),
3604
+ description: z.string().optional(),
3605
+ schema: z.lazy(() => AgentToolInputRunSchema$outboundSchema),
3606
+ });
3607
+
3608
+ export function toolsToJSON(tools: Tools): string {
3609
+ return JSON.stringify(Tools$outboundSchema.parse(tools));
3610
+ }
3611
+
3612
+ /** @internal */
3613
+ export const ConnectionType$outboundSchema: z.ZodNativeEnum<
3614
+ typeof ConnectionType
3615
+ > = z.nativeEnum(ConnectionType);
3616
+
3617
+ /** @internal */
3618
+ export type Mcp$Outbound = {
3619
+ server_url: string;
3620
+ headers?:
3621
+ | { [k: string]: RunAgentAgentToolInputRunHeaders$Outbound }
3622
+ | undefined;
3623
+ tools: Array<Tools$Outbound>;
3624
+ connection_type: string;
3625
+ };
3626
+
3627
+ /** @internal */
3628
+ export const Mcp$outboundSchema: z.ZodType<Mcp$Outbound, z.ZodTypeDef, Mcp> = z
3629
+ .object({
3630
+ serverUrl: z.string(),
3631
+ headers: z.record(
3632
+ z.lazy(() => RunAgentAgentToolInputRunHeaders$outboundSchema),
3633
+ ).optional(),
3634
+ tools: z.array(z.lazy(() => Tools$outboundSchema)),
3635
+ connectionType: ConnectionType$outboundSchema,
3636
+ }).transform((v) => {
3637
+ return remap$(v, {
3638
+ serverUrl: "server_url",
3639
+ connectionType: "connection_type",
3640
+ });
3641
+ });
3642
+
3643
+ export function mcpToJSON(mcp: Mcp): string {
3644
+ return JSON.stringify(Mcp$outboundSchema.parse(mcp));
3645
+ }
3646
+
3647
+ /** @internal */
3648
+ export type MCPToolRun$Outbound = {
3649
+ type: "mcp";
3650
+ key: string;
3651
+ _id?: string | undefined;
3652
+ display_name?: string | undefined;
3653
+ description: string;
3654
+ mcp: Mcp$Outbound;
3655
+ requires_approval: boolean;
3656
+ };
3657
+
3658
+ /** @internal */
3659
+ export const MCPToolRun$outboundSchema: z.ZodType<
3660
+ MCPToolRun$Outbound,
3661
+ z.ZodTypeDef,
3662
+ MCPToolRun
3663
+ > = z.object({
3664
+ type: z.literal("mcp"),
3665
+ key: z.string(),
3666
+ id: z.string().optional(),
3667
+ displayName: z.string().optional(),
3668
+ description: z.string(),
3669
+ mcp: z.lazy(() => Mcp$outboundSchema),
3670
+ requiresApproval: z.boolean().default(false),
3671
+ }).transform((v) => {
3672
+ return remap$(v, {
3673
+ id: "_id",
3674
+ displayName: "display_name",
3675
+ requiresApproval: "requires_approval",
3676
+ });
3677
+ });
3678
+
3679
+ export function mcpToolRunToJSON(mcpToolRun: MCPToolRun): string {
3680
+ return JSON.stringify(MCPToolRun$outboundSchema.parse(mcpToolRun));
3681
+ }
3682
+
3683
+ /** @internal */
3684
+ export type Schema$Outbound = {
3685
+ type: string;
3686
+ properties: { [k: string]: any };
3687
+ required: Array<string>;
3688
+ [additionalProperties: string]: unknown;
3689
+ };
3690
+
3691
+ /** @internal */
3692
+ export const Schema$outboundSchema: z.ZodType<
3693
+ Schema$Outbound,
3694
+ z.ZodTypeDef,
3695
+ Schema
3696
+ > = z.object({
3697
+ type: z.string(),
3698
+ properties: z.record(z.any()),
3699
+ required: z.array(z.string()),
3700
+ additionalProperties: z.record(z.any()).optional(),
3701
+ }).transform((v) => {
3702
+ return {
3703
+ ...v.additionalProperties,
3704
+ ...remap$(v, {
3705
+ additionalProperties: null,
3706
+ }),
3707
+ };
3708
+ });
3709
+
3710
+ export function schemaToJSON(schema: Schema): string {
3711
+ return JSON.stringify(Schema$outboundSchema.parse(schema));
3712
+ }
3713
+
3714
+ /** @internal */
3715
+ export type AgentToolInputRunJsonSchema$Outbound = {
3716
+ name: string;
3717
+ description: string;
3718
+ schema: Schema$Outbound;
3719
+ strict?: boolean | undefined;
3720
+ };
3721
+
3722
+ /** @internal */
3723
+ export const AgentToolInputRunJsonSchema$outboundSchema: z.ZodType<
3724
+ AgentToolInputRunJsonSchema$Outbound,
3725
+ z.ZodTypeDef,
3726
+ AgentToolInputRunJsonSchema
3727
+ > = z.object({
3728
+ name: z.string(),
3729
+ description: z.string(),
3730
+ schema: z.lazy(() => Schema$outboundSchema),
3731
+ strict: z.boolean().optional(),
3732
+ });
3733
+
3734
+ export function agentToolInputRunJsonSchemaToJSON(
3735
+ agentToolInputRunJsonSchema: AgentToolInputRunJsonSchema,
3736
+ ): string {
3737
+ return JSON.stringify(
3738
+ AgentToolInputRunJsonSchema$outboundSchema.parse(
3739
+ agentToolInputRunJsonSchema,
3740
+ ),
3741
+ );
3742
+ }
3743
+
3744
+ /** @internal */
3745
+ export type JSONSchemaToolRun$Outbound = {
3746
+ type: "json_schema";
3747
+ key: string;
3748
+ _id?: string | undefined;
3749
+ display_name?: string | undefined;
3750
+ description: string;
3751
+ json_schema: AgentToolInputRunJsonSchema$Outbound;
3752
+ requires_approval: boolean;
3753
+ };
3754
+
3755
+ /** @internal */
3756
+ export const JSONSchemaToolRun$outboundSchema: z.ZodType<
3757
+ JSONSchemaToolRun$Outbound,
3758
+ z.ZodTypeDef,
3759
+ JSONSchemaToolRun
3760
+ > = z.object({
3761
+ type: z.literal("json_schema"),
3762
+ key: z.string(),
3763
+ id: z.string().optional(),
3764
+ displayName: z.string().optional(),
3765
+ description: z.string(),
3766
+ jsonSchema: z.lazy(() => AgentToolInputRunJsonSchema$outboundSchema),
3767
+ requiresApproval: z.boolean().default(false),
3768
+ }).transform((v) => {
3769
+ return remap$(v, {
3770
+ id: "_id",
3771
+ displayName: "display_name",
3772
+ jsonSchema: "json_schema",
3773
+ requiresApproval: "requires_approval",
3774
+ });
3775
+ });
3776
+
3777
+ export function jsonSchemaToolRunToJSON(
3778
+ jsonSchemaToolRun: JSONSchemaToolRun,
3779
+ ): string {
3780
+ return JSON.stringify(
3781
+ JSONSchemaToolRun$outboundSchema.parse(jsonSchemaToolRun),
3782
+ );
3783
+ }
3784
+
3785
+ /** @internal */
3786
+ export const RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType$outboundSchema:
3787
+ z.ZodNativeEnum<
3788
+ typeof RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType
3789
+ > = z.nativeEnum(
3790
+ RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType,
3791
+ );
3792
+
3793
+ /** @internal */
3794
+ export type RunAgentAgentToolInputRunParameters$Outbound = {
3795
+ type: string;
3796
+ properties: { [k: string]: any };
3797
+ required: Array<string>;
3798
+ [additionalProperties: string]: unknown;
3799
+ };
3800
+
3801
+ /** @internal */
3802
+ export const RunAgentAgentToolInputRunParameters$outboundSchema: z.ZodType<
3803
+ RunAgentAgentToolInputRunParameters$Outbound,
3804
+ z.ZodTypeDef,
3805
+ RunAgentAgentToolInputRunParameters
3806
+ > = z.object({
3807
+ type:
3808
+ RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType$outboundSchema,
3809
+ properties: z.record(z.any()),
3810
+ required: z.array(z.string()),
3811
+ additionalProperties: z.record(z.any()).optional(),
3812
+ }).transform((v) => {
3813
+ return {
3814
+ ...v.additionalProperties,
3815
+ ...remap$(v, {
3816
+ additionalProperties: null,
3817
+ }),
3818
+ };
3819
+ });
3820
+
3821
+ export function runAgentAgentToolInputRunParametersToJSON(
3822
+ runAgentAgentToolInputRunParameters: RunAgentAgentToolInputRunParameters,
3823
+ ): string {
3824
+ return JSON.stringify(
3825
+ RunAgentAgentToolInputRunParameters$outboundSchema.parse(
3826
+ runAgentAgentToolInputRunParameters,
3827
+ ),
3828
+ );
3829
+ }
3830
+
3831
+ /** @internal */
3832
+ export type AgentToolInputRunFunction$Outbound = {
3833
+ name: string;
3834
+ description?: string | undefined;
3835
+ strict?: boolean | undefined;
3836
+ parameters?: RunAgentAgentToolInputRunParameters$Outbound | undefined;
3837
+ };
3838
+
3839
+ /** @internal */
3840
+ export const AgentToolInputRunFunction$outboundSchema: z.ZodType<
3841
+ AgentToolInputRunFunction$Outbound,
3842
+ z.ZodTypeDef,
3843
+ AgentToolInputRunFunction
3844
+ > = z.object({
3845
+ name: z.string(),
3846
+ description: z.string().optional(),
3847
+ strict: z.boolean().optional(),
3848
+ parameters: z.lazy(() => RunAgentAgentToolInputRunParameters$outboundSchema)
3849
+ .optional(),
3850
+ });
3851
+
3852
+ export function agentToolInputRunFunctionToJSON(
3853
+ agentToolInputRunFunction: AgentToolInputRunFunction,
3854
+ ): string {
3855
+ return JSON.stringify(
3856
+ AgentToolInputRunFunction$outboundSchema.parse(agentToolInputRunFunction),
3857
+ );
3858
+ }
3859
+
3860
+ /** @internal */
3861
+ export type FunctionToolRun$Outbound = {
3862
+ type: "function";
3863
+ key: string;
3864
+ _id?: string | undefined;
3865
+ display_name?: string | undefined;
3866
+ description?: string | undefined;
3867
+ function: AgentToolInputRunFunction$Outbound;
3868
+ requires_approval: boolean;
3869
+ };
3870
+
3871
+ /** @internal */
3872
+ export const FunctionToolRun$outboundSchema: z.ZodType<
3873
+ FunctionToolRun$Outbound,
3874
+ z.ZodTypeDef,
3875
+ FunctionToolRun
3876
+ > = z.object({
3877
+ type: z.literal("function"),
3878
+ key: z.string(),
3879
+ id: z.string().optional(),
3880
+ displayName: z.string().optional(),
3881
+ description: z.string().optional(),
3882
+ function: z.lazy(() => AgentToolInputRunFunction$outboundSchema),
3883
+ requiresApproval: z.boolean().default(false),
3884
+ }).transform((v) => {
3885
+ return remap$(v, {
3886
+ id: "_id",
3887
+ displayName: "display_name",
3888
+ requiresApproval: "requires_approval",
3889
+ });
3890
+ });
3891
+
3892
+ export function functionToolRunToJSON(
3893
+ functionToolRun: FunctionToolRun,
3894
+ ): string {
3895
+ return JSON.stringify(FunctionToolRun$outboundSchema.parse(functionToolRun));
3896
+ }
3897
+
3898
+ /** @internal */
3899
+ export const RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType$outboundSchema:
3900
+ z.ZodNativeEnum<
3901
+ typeof RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType
3902
+ > = z.nativeEnum(
3903
+ RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType,
3904
+ );
3905
+
3906
+ /** @internal */
3907
+ export type AgentToolInputRunParameters$Outbound = {
3908
+ type: string;
3909
+ properties: { [k: string]: any };
3910
+ required: Array<string>;
3911
+ [additionalProperties: string]: unknown;
3912
+ };
3913
+
3914
+ /** @internal */
3915
+ export const AgentToolInputRunParameters$outboundSchema: z.ZodType<
3916
+ AgentToolInputRunParameters$Outbound,
3917
+ z.ZodTypeDef,
3918
+ AgentToolInputRunParameters
3919
+ > = z.object({
3920
+ type:
3921
+ RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType$outboundSchema,
3922
+ properties: z.record(z.any()),
3923
+ required: z.array(z.string()),
3924
+ additionalProperties: z.record(z.any()).optional(),
3925
+ }).transform((v) => {
3926
+ return {
3927
+ ...v.additionalProperties,
3928
+ ...remap$(v, {
3929
+ additionalProperties: null,
3930
+ }),
3931
+ };
3932
+ });
3933
+
3934
+ export function agentToolInputRunParametersToJSON(
3935
+ agentToolInputRunParameters: AgentToolInputRunParameters,
3936
+ ): string {
3937
+ return JSON.stringify(
3938
+ AgentToolInputRunParameters$outboundSchema.parse(
3939
+ agentToolInputRunParameters,
3940
+ ),
3941
+ );
3942
+ }
3943
+
3944
+ /** @internal */
3945
+ export const Language$outboundSchema: z.ZodNativeEnum<typeof Language> = z
3946
+ .nativeEnum(Language);
3947
+
3948
+ /** @internal */
3949
+ export type CodeTool$Outbound = {
3950
+ parameters?: AgentToolInputRunParameters$Outbound | undefined;
3951
+ language: string;
3952
+ code: string;
3953
+ };
3954
+
3955
+ /** @internal */
3956
+ export const CodeTool$outboundSchema: z.ZodType<
3957
+ CodeTool$Outbound,
3958
+ z.ZodTypeDef,
3959
+ CodeTool
3960
+ > = z.object({
3961
+ parameters: z.lazy(() => AgentToolInputRunParameters$outboundSchema)
3962
+ .optional(),
3963
+ language: Language$outboundSchema,
3964
+ code: z.string(),
3965
+ });
3966
+
3967
+ export function codeToolToJSON(codeTool: CodeTool): string {
3968
+ return JSON.stringify(CodeTool$outboundSchema.parse(codeTool));
3969
+ }
3970
+
3971
+ /** @internal */
3972
+ export type CodeToolRun$Outbound = {
3973
+ type: "code";
3974
+ key: string;
3975
+ _id?: string | undefined;
3976
+ display_name?: string | undefined;
3977
+ description: string;
3978
+ code_tool: CodeTool$Outbound;
3979
+ requires_approval: boolean;
3980
+ };
3981
+
3982
+ /** @internal */
3983
+ export const CodeToolRun$outboundSchema: z.ZodType<
3984
+ CodeToolRun$Outbound,
3985
+ z.ZodTypeDef,
3986
+ CodeToolRun
3987
+ > = z.object({
3988
+ type: z.literal("code"),
3989
+ key: z.string(),
3990
+ id: z.string().optional(),
3991
+ displayName: z.string().optional(),
3992
+ description: z.string(),
3993
+ codeTool: z.lazy(() => CodeTool$outboundSchema),
3994
+ requiresApproval: z.boolean().default(false),
3995
+ }).transform((v) => {
3996
+ return remap$(v, {
3997
+ id: "_id",
3998
+ displayName: "display_name",
3999
+ codeTool: "code_tool",
4000
+ requiresApproval: "requires_approval",
4001
+ });
4002
+ });
4003
+
4004
+ export function codeToolRunToJSON(codeToolRun: CodeToolRun): string {
4005
+ return JSON.stringify(CodeToolRun$outboundSchema.parse(codeToolRun));
4006
+ }
4007
+
4008
+ /** @internal */
4009
+ export const Method$outboundSchema: z.ZodNativeEnum<typeof Method> = z
4010
+ .nativeEnum(Method);
4011
+
4012
+ /** @internal */
4013
+ export type Headers2$Outbound = {
4014
+ value: string;
4015
+ encrypted: boolean;
4016
+ };
4017
+
4018
+ /** @internal */
4019
+ export const Headers2$outboundSchema: z.ZodType<
4020
+ Headers2$Outbound,
4021
+ z.ZodTypeDef,
4022
+ Headers2
4023
+ > = z.object({
4024
+ value: z.string(),
4025
+ encrypted: z.boolean().default(false),
4026
+ });
4027
+
4028
+ export function headers2ToJSON(headers2: Headers2): string {
4029
+ return JSON.stringify(Headers2$outboundSchema.parse(headers2));
4030
+ }
4031
+
4032
+ /** @internal */
4033
+ export type AgentToolInputRunHeaders$Outbound = Headers2$Outbound | string;
4034
+
4035
+ /** @internal */
4036
+ export const AgentToolInputRunHeaders$outboundSchema: z.ZodType<
4037
+ AgentToolInputRunHeaders$Outbound,
4038
+ z.ZodTypeDef,
4039
+ AgentToolInputRunHeaders
4040
+ > = z.union([z.lazy(() => Headers2$outboundSchema), z.string()]);
4041
+
4042
+ export function agentToolInputRunHeadersToJSON(
4043
+ agentToolInputRunHeaders: AgentToolInputRunHeaders,
4044
+ ): string {
4045
+ return JSON.stringify(
4046
+ AgentToolInputRunHeaders$outboundSchema.parse(agentToolInputRunHeaders),
4047
+ );
4048
+ }
4049
+
4050
+ /** @internal */
4051
+ export type Blueprint$Outbound = {
4052
+ url: string;
4053
+ method: string;
4054
+ headers?: { [k: string]: Headers2$Outbound | string } | undefined;
4055
+ body?: { [k: string]: any } | undefined;
4056
+ };
4057
+
4058
+ /** @internal */
4059
+ export const Blueprint$outboundSchema: z.ZodType<
4060
+ Blueprint$Outbound,
4061
+ z.ZodTypeDef,
4062
+ Blueprint
4063
+ > = z.object({
4064
+ url: z.string(),
4065
+ method: Method$outboundSchema,
4066
+ headers: z.record(
4067
+ z.union([z.lazy(() => Headers2$outboundSchema), z.string()]),
4068
+ ).optional(),
4069
+ body: z.record(z.any()).optional(),
4070
+ });
4071
+
4072
+ export function blueprintToJSON(blueprint: Blueprint): string {
4073
+ return JSON.stringify(Blueprint$outboundSchema.parse(blueprint));
4074
+ }
4075
+
4076
+ /** @internal */
4077
+ export const RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType$outboundSchema:
4078
+ z.ZodNativeEnum<
4079
+ typeof RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType
4080
+ > = z.nativeEnum(
4081
+ RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType,
4082
+ );
4083
+
4084
+ /** @internal */
4085
+ export type DefaultValue$Outbound = string | number | boolean;
4086
+
4087
+ /** @internal */
4088
+ export const DefaultValue$outboundSchema: z.ZodType<
4089
+ DefaultValue$Outbound,
4090
+ z.ZodTypeDef,
4091
+ DefaultValue
4092
+ > = z.union([z.string(), z.number(), z.boolean()]);
4093
+
4094
+ export function defaultValueToJSON(defaultValue: DefaultValue): string {
4095
+ return JSON.stringify(DefaultValue$outboundSchema.parse(defaultValue));
4096
+ }
4097
+
4098
+ /** @internal */
4099
+ export type Arguments$Outbound = {
4100
+ type: string;
4101
+ description: string;
4102
+ send_to_model: boolean;
4103
+ default_value?: string | number | boolean | undefined;
4104
+ };
4105
+
4106
+ /** @internal */
4107
+ export const Arguments$outboundSchema: z.ZodType<
4108
+ Arguments$Outbound,
4109
+ z.ZodTypeDef,
4110
+ Arguments
4111
+ > = z.object({
4112
+ type:
4113
+ RunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType$outboundSchema,
4114
+ description: z.string(),
4115
+ sendToModel: z.boolean().default(true),
4116
+ defaultValue: z.union([z.string(), z.number(), z.boolean()]).optional(),
4117
+ }).transform((v) => {
4118
+ return remap$(v, {
4119
+ sendToModel: "send_to_model",
4120
+ defaultValue: "default_value",
4121
+ });
4122
+ });
4123
+
4124
+ export function argumentsToJSON(value: Arguments): string {
4125
+ return JSON.stringify(Arguments$outboundSchema.parse(value));
4126
+ }
4127
+
4128
+ /** @internal */
4129
+ export type Http$Outbound = {
4130
+ blueprint: Blueprint$Outbound;
4131
+ arguments?: { [k: string]: Arguments$Outbound } | undefined;
4132
+ };
4133
+
4134
+ /** @internal */
4135
+ export const Http$outboundSchema: z.ZodType<Http$Outbound, z.ZodTypeDef, Http> =
4136
+ z.object({
4137
+ blueprint: z.lazy(() => Blueprint$outboundSchema),
4138
+ arguments: z.record(z.lazy(() => Arguments$outboundSchema)).optional(),
4139
+ });
4140
+
4141
+ export function httpToJSON(http: Http): string {
4142
+ return JSON.stringify(Http$outboundSchema.parse(http));
4143
+ }
4144
+
4145
+ /** @internal */
4146
+ export type HTTPToolRun$Outbound = {
4147
+ type: "http";
4148
+ key: string;
4149
+ _id?: string | undefined;
4150
+ display_name?: string | undefined;
4151
+ description: string;
4152
+ http: Http$Outbound;
4153
+ requires_approval: boolean;
4154
+ };
4155
+
4156
+ /** @internal */
4157
+ export const HTTPToolRun$outboundSchema: z.ZodType<
4158
+ HTTPToolRun$Outbound,
4159
+ z.ZodTypeDef,
4160
+ HTTPToolRun
4161
+ > = z.object({
4162
+ type: z.literal("http"),
4163
+ key: z.string(),
4164
+ id: z.string().optional(),
4165
+ displayName: z.string().optional(),
4166
+ description: z.string(),
4167
+ http: z.lazy(() => Http$outboundSchema),
4168
+ requiresApproval: z.boolean().default(false),
4169
+ }).transform((v) => {
4170
+ return remap$(v, {
4171
+ id: "_id",
4172
+ displayName: "display_name",
4173
+ requiresApproval: "requires_approval",
4174
+ });
4175
+ });
4176
+
4177
+ export function httpToolRunToJSON(httpToolRun: HTTPToolRun): string {
4178
+ return JSON.stringify(HTTPToolRun$outboundSchema.parse(httpToolRun));
4179
+ }
4180
+
4181
+ /** @internal */
4182
+ export type AgentToolInputRunCurrentDateTool$Outbound = {
4183
+ type: "current_date";
4184
+ requires_approval?: boolean | undefined;
4185
+ };
4186
+
4187
+ /** @internal */
4188
+ export const AgentToolInputRunCurrentDateTool$outboundSchema: z.ZodType<
4189
+ AgentToolInputRunCurrentDateTool$Outbound,
4190
+ z.ZodTypeDef,
4191
+ AgentToolInputRunCurrentDateTool
4192
+ > = z.object({
4193
+ type: z.literal("current_date"),
4194
+ requiresApproval: z.boolean().optional(),
4195
+ }).transform((v) => {
4196
+ return remap$(v, {
4197
+ requiresApproval: "requires_approval",
4198
+ });
4199
+ });
4200
+
4201
+ export function agentToolInputRunCurrentDateToolToJSON(
4202
+ agentToolInputRunCurrentDateTool: AgentToolInputRunCurrentDateTool,
4203
+ ): string {
4204
+ return JSON.stringify(
4205
+ AgentToolInputRunCurrentDateTool$outboundSchema.parse(
4206
+ agentToolInputRunCurrentDateTool,
4207
+ ),
4208
+ );
4209
+ }
4210
+
4211
+ /** @internal */
4212
+ export type AgentToolInputRunQueryKnowledgeBaseTool$Outbound = {
4213
+ type: "query_knowledge_base";
4214
+ requires_approval?: boolean | undefined;
4215
+ };
4216
+
4217
+ /** @internal */
4218
+ export const AgentToolInputRunQueryKnowledgeBaseTool$outboundSchema: z.ZodType<
4219
+ AgentToolInputRunQueryKnowledgeBaseTool$Outbound,
4220
+ z.ZodTypeDef,
4221
+ AgentToolInputRunQueryKnowledgeBaseTool
4222
+ > = z.object({
4223
+ type: z.literal("query_knowledge_base"),
4224
+ requiresApproval: z.boolean().optional(),
4225
+ }).transform((v) => {
4226
+ return remap$(v, {
4227
+ requiresApproval: "requires_approval",
4228
+ });
4229
+ });
4230
+
4231
+ export function agentToolInputRunQueryKnowledgeBaseToolToJSON(
4232
+ agentToolInputRunQueryKnowledgeBaseTool:
4233
+ AgentToolInputRunQueryKnowledgeBaseTool,
4234
+ ): string {
4235
+ return JSON.stringify(
4236
+ AgentToolInputRunQueryKnowledgeBaseTool$outboundSchema.parse(
4237
+ agentToolInputRunQueryKnowledgeBaseTool,
4238
+ ),
4239
+ );
4240
+ }
4241
+
4242
+ /** @internal */
4243
+ export type AgentToolInputRunRetrieveKnowledgeBasesTool$Outbound = {
4244
+ type: "retrieve_knowledge_bases";
4245
+ requires_approval?: boolean | undefined;
4246
+ };
4247
+
4248
+ /** @internal */
4249
+ export const AgentToolInputRunRetrieveKnowledgeBasesTool$outboundSchema:
4250
+ z.ZodType<
4251
+ AgentToolInputRunRetrieveKnowledgeBasesTool$Outbound,
4252
+ z.ZodTypeDef,
4253
+ AgentToolInputRunRetrieveKnowledgeBasesTool
4254
+ > = z.object({
4255
+ type: z.literal("retrieve_knowledge_bases"),
4256
+ requiresApproval: z.boolean().optional(),
4257
+ }).transform((v) => {
4258
+ return remap$(v, {
4259
+ requiresApproval: "requires_approval",
4260
+ });
4261
+ });
4262
+
4263
+ export function agentToolInputRunRetrieveKnowledgeBasesToolToJSON(
4264
+ agentToolInputRunRetrieveKnowledgeBasesTool:
4265
+ AgentToolInputRunRetrieveKnowledgeBasesTool,
4266
+ ): string {
4267
+ return JSON.stringify(
4268
+ AgentToolInputRunRetrieveKnowledgeBasesTool$outboundSchema.parse(
4269
+ agentToolInputRunRetrieveKnowledgeBasesTool,
4270
+ ),
4271
+ );
4272
+ }
4273
+
4274
+ /** @internal */
4275
+ export type AgentToolInputRunDeleteMemoryDocumentTool$Outbound = {
4276
+ type: "delete_memory_document";
4277
+ requires_approval?: boolean | undefined;
4278
+ };
4279
+
4280
+ /** @internal */
4281
+ export const AgentToolInputRunDeleteMemoryDocumentTool$outboundSchema:
4282
+ z.ZodType<
4283
+ AgentToolInputRunDeleteMemoryDocumentTool$Outbound,
4284
+ z.ZodTypeDef,
4285
+ AgentToolInputRunDeleteMemoryDocumentTool
4286
+ > = z.object({
4287
+ type: z.literal("delete_memory_document"),
4288
+ requiresApproval: z.boolean().optional(),
4289
+ }).transform((v) => {
4290
+ return remap$(v, {
4291
+ requiresApproval: "requires_approval",
4292
+ });
4293
+ });
4294
+
4295
+ export function agentToolInputRunDeleteMemoryDocumentToolToJSON(
4296
+ agentToolInputRunDeleteMemoryDocumentTool:
4297
+ AgentToolInputRunDeleteMemoryDocumentTool,
4298
+ ): string {
4299
+ return JSON.stringify(
4300
+ AgentToolInputRunDeleteMemoryDocumentTool$outboundSchema.parse(
4301
+ agentToolInputRunDeleteMemoryDocumentTool,
4302
+ ),
4303
+ );
4304
+ }
4305
+
4306
+ /** @internal */
4307
+ export type AgentToolInputRunRetrieveMemoryStoresTool$Outbound = {
4308
+ type: "retrieve_memory_stores";
4309
+ requires_approval?: boolean | undefined;
4310
+ };
4311
+
4312
+ /** @internal */
4313
+ export const AgentToolInputRunRetrieveMemoryStoresTool$outboundSchema:
4314
+ z.ZodType<
4315
+ AgentToolInputRunRetrieveMemoryStoresTool$Outbound,
4316
+ z.ZodTypeDef,
4317
+ AgentToolInputRunRetrieveMemoryStoresTool
4318
+ > = z.object({
4319
+ type: z.literal("retrieve_memory_stores"),
4320
+ requiresApproval: z.boolean().optional(),
4321
+ }).transform((v) => {
4322
+ return remap$(v, {
4323
+ requiresApproval: "requires_approval",
4324
+ });
4325
+ });
4326
+
4327
+ export function agentToolInputRunRetrieveMemoryStoresToolToJSON(
4328
+ agentToolInputRunRetrieveMemoryStoresTool:
4329
+ AgentToolInputRunRetrieveMemoryStoresTool,
4330
+ ): string {
4331
+ return JSON.stringify(
4332
+ AgentToolInputRunRetrieveMemoryStoresTool$outboundSchema.parse(
4333
+ agentToolInputRunRetrieveMemoryStoresTool,
4334
+ ),
4335
+ );
4336
+ }
4337
+
4338
+ /** @internal */
4339
+ export type AgentToolInputRunWriteMemoryStoreTool$Outbound = {
4340
+ type: "write_memory_store";
4341
+ requires_approval?: boolean | undefined;
4342
+ };
4343
+
4344
+ /** @internal */
4345
+ export const AgentToolInputRunWriteMemoryStoreTool$outboundSchema: z.ZodType<
4346
+ AgentToolInputRunWriteMemoryStoreTool$Outbound,
4347
+ z.ZodTypeDef,
4348
+ AgentToolInputRunWriteMemoryStoreTool
4349
+ > = z.object({
4350
+ type: z.literal("write_memory_store"),
4351
+ requiresApproval: z.boolean().optional(),
4352
+ }).transform((v) => {
4353
+ return remap$(v, {
4354
+ requiresApproval: "requires_approval",
4355
+ });
4356
+ });
4357
+
4358
+ export function agentToolInputRunWriteMemoryStoreToolToJSON(
4359
+ agentToolInputRunWriteMemoryStoreTool: AgentToolInputRunWriteMemoryStoreTool,
4360
+ ): string {
4361
+ return JSON.stringify(
4362
+ AgentToolInputRunWriteMemoryStoreTool$outboundSchema.parse(
4363
+ agentToolInputRunWriteMemoryStoreTool,
4364
+ ),
4365
+ );
4366
+ }
4367
+
4368
+ /** @internal */
4369
+ export type AgentToolInputRunQueryMemoryStoreTool$Outbound = {
4370
+ type: "query_memory_store";
4371
+ requires_approval?: boolean | undefined;
4372
+ };
4373
+
4374
+ /** @internal */
4375
+ export const AgentToolInputRunQueryMemoryStoreTool$outboundSchema: z.ZodType<
4376
+ AgentToolInputRunQueryMemoryStoreTool$Outbound,
4377
+ z.ZodTypeDef,
4378
+ AgentToolInputRunQueryMemoryStoreTool
4379
+ > = z.object({
4380
+ type: z.literal("query_memory_store"),
4381
+ requiresApproval: z.boolean().optional(),
4382
+ }).transform((v) => {
4383
+ return remap$(v, {
4384
+ requiresApproval: "requires_approval",
4385
+ });
4386
+ });
4387
+
4388
+ export function agentToolInputRunQueryMemoryStoreToolToJSON(
4389
+ agentToolInputRunQueryMemoryStoreTool: AgentToolInputRunQueryMemoryStoreTool,
4390
+ ): string {
4391
+ return JSON.stringify(
4392
+ AgentToolInputRunQueryMemoryStoreTool$outboundSchema.parse(
4393
+ agentToolInputRunQueryMemoryStoreTool,
4394
+ ),
4395
+ );
4396
+ }
4397
+
4398
+ /** @internal */
4399
+ export type AgentToolInputRunRetrieveAgentsTool$Outbound = {
4400
+ type: "retrieve_agents";
4401
+ requires_approval?: boolean | undefined;
4402
+ };
4403
+
4404
+ /** @internal */
4405
+ export const AgentToolInputRunRetrieveAgentsTool$outboundSchema: z.ZodType<
4406
+ AgentToolInputRunRetrieveAgentsTool$Outbound,
4407
+ z.ZodTypeDef,
4408
+ AgentToolInputRunRetrieveAgentsTool
4409
+ > = z.object({
4410
+ type: z.literal("retrieve_agents"),
4411
+ requiresApproval: z.boolean().optional(),
4412
+ }).transform((v) => {
4413
+ return remap$(v, {
4414
+ requiresApproval: "requires_approval",
4415
+ });
4416
+ });
4417
+
4418
+ export function agentToolInputRunRetrieveAgentsToolToJSON(
4419
+ agentToolInputRunRetrieveAgentsTool: AgentToolInputRunRetrieveAgentsTool,
4420
+ ): string {
4421
+ return JSON.stringify(
4422
+ AgentToolInputRunRetrieveAgentsTool$outboundSchema.parse(
4423
+ agentToolInputRunRetrieveAgentsTool,
4424
+ ),
4425
+ );
4426
+ }
4427
+
4428
+ /** @internal */
4429
+ export type AgentToolInputRunCallSubAgentTool$Outbound = {
4430
+ type: "call_sub_agent";
4431
+ requires_approval?: boolean | undefined;
4432
+ };
4433
+
4434
+ /** @internal */
4435
+ export const AgentToolInputRunCallSubAgentTool$outboundSchema: z.ZodType<
4436
+ AgentToolInputRunCallSubAgentTool$Outbound,
4437
+ z.ZodTypeDef,
4438
+ AgentToolInputRunCallSubAgentTool
4439
+ > = z.object({
4440
+ type: z.literal("call_sub_agent"),
4441
+ requiresApproval: z.boolean().optional(),
4442
+ }).transform((v) => {
4443
+ return remap$(v, {
4444
+ requiresApproval: "requires_approval",
4445
+ });
4446
+ });
4447
+
4448
+ export function agentToolInputRunCallSubAgentToolToJSON(
4449
+ agentToolInputRunCallSubAgentTool: AgentToolInputRunCallSubAgentTool,
4450
+ ): string {
4451
+ return JSON.stringify(
4452
+ AgentToolInputRunCallSubAgentTool$outboundSchema.parse(
4453
+ agentToolInputRunCallSubAgentTool,
4454
+ ),
4455
+ );
4456
+ }
4457
+
4458
+ /** @internal */
4459
+ export type AgentToolInputRunWebScraperTool$Outbound = {
4460
+ type: "web_scraper";
4461
+ requires_approval?: boolean | undefined;
4462
+ };
4463
+
4464
+ /** @internal */
4465
+ export const AgentToolInputRunWebScraperTool$outboundSchema: z.ZodType<
4466
+ AgentToolInputRunWebScraperTool$Outbound,
4467
+ z.ZodTypeDef,
4468
+ AgentToolInputRunWebScraperTool
4469
+ > = z.object({
4470
+ type: z.literal("web_scraper"),
4471
+ requiresApproval: z.boolean().optional(),
4472
+ }).transform((v) => {
4473
+ return remap$(v, {
4474
+ requiresApproval: "requires_approval",
4475
+ });
4476
+ });
4477
+
4478
+ export function agentToolInputRunWebScraperToolToJSON(
4479
+ agentToolInputRunWebScraperTool: AgentToolInputRunWebScraperTool,
4480
+ ): string {
4481
+ return JSON.stringify(
4482
+ AgentToolInputRunWebScraperTool$outboundSchema.parse(
4483
+ agentToolInputRunWebScraperTool,
4484
+ ),
4485
+ );
4486
+ }
4487
+
4488
+ /** @internal */
4489
+ export type AgentToolInputRunGoogleSearchTool$Outbound = {
4490
+ type: "google_search";
4491
+ requires_approval?: boolean | undefined;
4492
+ };
4493
+
4494
+ /** @internal */
4495
+ export const AgentToolInputRunGoogleSearchTool$outboundSchema: z.ZodType<
4496
+ AgentToolInputRunGoogleSearchTool$Outbound,
4497
+ z.ZodTypeDef,
4498
+ AgentToolInputRunGoogleSearchTool
4499
+ > = z.object({
4500
+ type: z.literal("google_search"),
4501
+ requiresApproval: z.boolean().optional(),
4502
+ }).transform((v) => {
4503
+ return remap$(v, {
4504
+ requiresApproval: "requires_approval",
4505
+ });
4506
+ });
4507
+
4508
+ export function agentToolInputRunGoogleSearchToolToJSON(
4509
+ agentToolInputRunGoogleSearchTool: AgentToolInputRunGoogleSearchTool,
4510
+ ): string {
4511
+ return JSON.stringify(
4512
+ AgentToolInputRunGoogleSearchTool$outboundSchema.parse(
4513
+ agentToolInputRunGoogleSearchTool,
4514
+ ),
4515
+ );
4516
+ }
4517
+
4518
+ /** @internal */
4519
+ export type AgentToolInputRun$Outbound =
4520
+ | AgentToolInputRunGoogleSearchTool$Outbound
4521
+ | AgentToolInputRunWebScraperTool$Outbound
4522
+ | AgentToolInputRunCallSubAgentTool$Outbound
4523
+ | AgentToolInputRunRetrieveAgentsTool$Outbound
4524
+ | AgentToolInputRunQueryMemoryStoreTool$Outbound
4525
+ | AgentToolInputRunWriteMemoryStoreTool$Outbound
4526
+ | AgentToolInputRunRetrieveMemoryStoresTool$Outbound
4527
+ | AgentToolInputRunDeleteMemoryDocumentTool$Outbound
4528
+ | AgentToolInputRunRetrieveKnowledgeBasesTool$Outbound
4529
+ | AgentToolInputRunQueryKnowledgeBaseTool$Outbound
4530
+ | AgentToolInputRunCurrentDateTool$Outbound
4531
+ | HTTPToolRun$Outbound
4532
+ | CodeToolRun$Outbound
4533
+ | FunctionToolRun$Outbound
4534
+ | JSONSchemaToolRun$Outbound
4535
+ | MCPToolRun$Outbound;
4536
+
4537
+ /** @internal */
4538
+ export const AgentToolInputRun$outboundSchema: z.ZodType<
4539
+ AgentToolInputRun$Outbound,
4540
+ z.ZodTypeDef,
4541
+ AgentToolInputRun
4542
+ > = z.union([
4543
+ z.lazy(() => AgentToolInputRunGoogleSearchTool$outboundSchema),
4544
+ z.lazy(() => AgentToolInputRunWebScraperTool$outboundSchema),
4545
+ z.lazy(() => AgentToolInputRunCallSubAgentTool$outboundSchema),
4546
+ z.lazy(() => AgentToolInputRunRetrieveAgentsTool$outboundSchema),
4547
+ z.lazy(() => AgentToolInputRunQueryMemoryStoreTool$outboundSchema),
4548
+ z.lazy(() => AgentToolInputRunWriteMemoryStoreTool$outboundSchema),
4549
+ z.lazy(() => AgentToolInputRunRetrieveMemoryStoresTool$outboundSchema),
4550
+ z.lazy(() => AgentToolInputRunDeleteMemoryDocumentTool$outboundSchema),
4551
+ z.lazy(() => AgentToolInputRunRetrieveKnowledgeBasesTool$outboundSchema),
4552
+ z.lazy(() => AgentToolInputRunQueryKnowledgeBaseTool$outboundSchema),
4553
+ z.lazy(() => AgentToolInputRunCurrentDateTool$outboundSchema),
4554
+ z.lazy(() => HTTPToolRun$outboundSchema),
4555
+ z.lazy(() => CodeToolRun$outboundSchema),
4556
+ z.lazy(() => FunctionToolRun$outboundSchema),
4557
+ z.lazy(() => JSONSchemaToolRun$outboundSchema),
4558
+ z.lazy(() => MCPToolRun$outboundSchema),
4559
+ ]);
4560
+
4561
+ export function agentToolInputRunToJSON(
4562
+ agentToolInputRun: AgentToolInputRun,
4563
+ ): string {
4564
+ return JSON.stringify(
4565
+ AgentToolInputRun$outboundSchema.parse(agentToolInputRun),
4566
+ );
4567
+ }
4568
+
4569
+ /** @internal */
4570
+ export const RunAgentToolApprovalRequired$outboundSchema: z.ZodNativeEnum<
4571
+ typeof RunAgentToolApprovalRequired
4572
+ > = z.nativeEnum(RunAgentToolApprovalRequired);
4573
+
4574
+ /** @internal */
4575
+ export const RunAgentExecuteOn$outboundSchema: z.ZodNativeEnum<
4576
+ typeof RunAgentExecuteOn
4577
+ > = z.nativeEnum(RunAgentExecuteOn);
4578
+
4579
+ /** @internal */
4580
+ export type RunAgentEvaluators$Outbound = {
4581
+ id: string;
4582
+ sample_rate: number;
4583
+ execute_on: string;
4584
+ };
4585
+
4586
+ /** @internal */
4587
+ export const RunAgentEvaluators$outboundSchema: z.ZodType<
4588
+ RunAgentEvaluators$Outbound,
4589
+ z.ZodTypeDef,
4590
+ RunAgentEvaluators
4591
+ > = z.object({
4592
+ id: z.string(),
4593
+ sampleRate: z.number().default(50),
4594
+ executeOn: RunAgentExecuteOn$outboundSchema,
4595
+ }).transform((v) => {
4596
+ return remap$(v, {
4597
+ sampleRate: "sample_rate",
4598
+ executeOn: "execute_on",
4599
+ });
4600
+ });
4601
+
4602
+ export function runAgentEvaluatorsToJSON(
4603
+ runAgentEvaluators: RunAgentEvaluators,
4604
+ ): string {
4605
+ return JSON.stringify(
4606
+ RunAgentEvaluators$outboundSchema.parse(runAgentEvaluators),
4607
+ );
4608
+ }
4609
+
4610
+ /** @internal */
4611
+ export const RunAgentAgentsExecuteOn$outboundSchema: z.ZodNativeEnum<
4612
+ typeof RunAgentAgentsExecuteOn
4613
+ > = z.nativeEnum(RunAgentAgentsExecuteOn);
4614
+
4615
+ /** @internal */
4616
+ export type RunAgentGuardrails$Outbound = {
4617
+ id: string;
4618
+ sample_rate: number;
4619
+ execute_on: string;
4620
+ };
4621
+
4622
+ /** @internal */
4623
+ export const RunAgentGuardrails$outboundSchema: z.ZodType<
4624
+ RunAgentGuardrails$Outbound,
4625
+ z.ZodTypeDef,
4626
+ RunAgentGuardrails
4627
+ > = z.object({
4628
+ id: z.string(),
4629
+ sampleRate: z.number().default(50),
4630
+ executeOn: RunAgentAgentsExecuteOn$outboundSchema,
4631
+ }).transform((v) => {
4632
+ return remap$(v, {
4633
+ sampleRate: "sample_rate",
4634
+ executeOn: "execute_on",
4635
+ });
4636
+ });
4637
+
4638
+ export function runAgentGuardrailsToJSON(
4639
+ runAgentGuardrails: RunAgentGuardrails,
4640
+ ): string {
4641
+ return JSON.stringify(
4642
+ RunAgentGuardrails$outboundSchema.parse(runAgentGuardrails),
4643
+ );
4644
+ }
4645
+
4646
+ /** @internal */
4647
+ export type RunAgentSettings$Outbound = {
4648
+ tools?:
4649
+ | Array<
4650
+ | AgentToolInputRunGoogleSearchTool$Outbound
4651
+ | AgentToolInputRunWebScraperTool$Outbound
4652
+ | AgentToolInputRunCallSubAgentTool$Outbound
4653
+ | AgentToolInputRunRetrieveAgentsTool$Outbound
4654
+ | AgentToolInputRunQueryMemoryStoreTool$Outbound
4655
+ | AgentToolInputRunWriteMemoryStoreTool$Outbound
4656
+ | AgentToolInputRunRetrieveMemoryStoresTool$Outbound
4657
+ | AgentToolInputRunDeleteMemoryDocumentTool$Outbound
4658
+ | AgentToolInputRunRetrieveKnowledgeBasesTool$Outbound
4659
+ | AgentToolInputRunQueryKnowledgeBaseTool$Outbound
4660
+ | AgentToolInputRunCurrentDateTool$Outbound
4661
+ | HTTPToolRun$Outbound
4662
+ | CodeToolRun$Outbound
4663
+ | FunctionToolRun$Outbound
4664
+ | JSONSchemaToolRun$Outbound
4665
+ | MCPToolRun$Outbound
4666
+ >
4667
+ | undefined;
4668
+ tool_approval_required: string;
4669
+ max_iterations: number;
4670
+ max_execution_time: number;
4671
+ max_cost: number;
4672
+ evaluators?: Array<RunAgentEvaluators$Outbound> | undefined;
4673
+ guardrails?: Array<RunAgentGuardrails$Outbound> | undefined;
4674
+ };
4675
+
4676
+ /** @internal */
4677
+ export const RunAgentSettings$outboundSchema: z.ZodType<
4678
+ RunAgentSettings$Outbound,
4679
+ z.ZodTypeDef,
4680
+ RunAgentSettings
4681
+ > = z.object({
4682
+ tools: z.array(
4683
+ z.union([
4684
+ z.lazy(() => AgentToolInputRunGoogleSearchTool$outboundSchema),
4685
+ z.lazy(() => AgentToolInputRunWebScraperTool$outboundSchema),
4686
+ z.lazy(() => AgentToolInputRunCallSubAgentTool$outboundSchema),
4687
+ z.lazy(() => AgentToolInputRunRetrieveAgentsTool$outboundSchema),
4688
+ z.lazy(() => AgentToolInputRunQueryMemoryStoreTool$outboundSchema),
4689
+ z.lazy(() => AgentToolInputRunWriteMemoryStoreTool$outboundSchema),
4690
+ z.lazy(() => AgentToolInputRunRetrieveMemoryStoresTool$outboundSchema),
4691
+ z.lazy(() => AgentToolInputRunDeleteMemoryDocumentTool$outboundSchema),
4692
+ z.lazy(() => AgentToolInputRunRetrieveKnowledgeBasesTool$outboundSchema),
4693
+ z.lazy(() => AgentToolInputRunQueryKnowledgeBaseTool$outboundSchema),
4694
+ z.lazy(() => AgentToolInputRunCurrentDateTool$outboundSchema),
4695
+ z.lazy(() => HTTPToolRun$outboundSchema),
4696
+ z.lazy(() => CodeToolRun$outboundSchema),
4697
+ z.lazy(() => FunctionToolRun$outboundSchema),
4698
+ z.lazy(() => JSONSchemaToolRun$outboundSchema),
4699
+ z.lazy(() => MCPToolRun$outboundSchema),
4700
+ ]),
4701
+ ).optional(),
4702
+ toolApprovalRequired: RunAgentToolApprovalRequired$outboundSchema.default(
4703
+ "none",
4704
+ ),
4705
+ maxIterations: z.number().int().default(100),
4706
+ maxExecutionTime: z.number().int().default(600),
4707
+ maxCost: z.number().default(0),
4708
+ evaluators: z.array(z.lazy(() => RunAgentEvaluators$outboundSchema))
4709
+ .optional(),
4710
+ guardrails: z.array(z.lazy(() => RunAgentGuardrails$outboundSchema))
4711
+ .optional(),
4712
+ }).transform((v) => {
4713
+ return remap$(v, {
4714
+ toolApprovalRequired: "tool_approval_required",
4715
+ maxIterations: "max_iterations",
4716
+ maxExecutionTime: "max_execution_time",
4717
+ maxCost: "max_cost",
4718
+ });
4719
+ });
4720
+
4721
+ export function runAgentSettingsToJSON(
4722
+ runAgentSettings: RunAgentSettings,
4723
+ ): string {
4724
+ return JSON.stringify(
4725
+ RunAgentSettings$outboundSchema.parse(runAgentSettings),
4726
+ );
4727
+ }
4728
+
4729
+ /** @internal */
4730
+ export type RunAgentRequestBody$Outbound = {
4731
+ key: string;
4732
+ task_id?: string | undefined;
4733
+ model: RunAgentModelConfiguration2$Outbound | string;
4734
+ fallback_models?:
4735
+ | Array<RunAgentFallbackModelConfiguration2$Outbound | string>
4736
+ | undefined;
4737
+ role: string;
4738
+ instructions: string;
4739
+ message: RunAgentA2AMessage$Outbound;
4740
+ variables?: { [k: string]: any } | undefined;
4741
+ identity?: RunAgentIdentity$Outbound | undefined;
4742
+ contact?: RunAgentContact$Outbound | undefined;
4743
+ thread?: RunAgentThread$Outbound | undefined;
4744
+ memory?: RunAgentMemory$Outbound | undefined;
4745
+ path: string;
4746
+ description?: string | undefined;
4747
+ system_prompt?: string | undefined;
4748
+ memory_stores?: Array<string> | undefined;
4749
+ knowledge_bases?: Array<RunAgentKnowledgeBases$Outbound> | undefined;
4750
+ team_of_agents?: Array<RunAgentTeamOfAgents$Outbound> | undefined;
4751
+ settings: RunAgentSettings$Outbound;
4752
+ metadata?: { [k: string]: any } | undefined;
4753
+ };
4754
+
4755
+ /** @internal */
4756
+ export const RunAgentRequestBody$outboundSchema: z.ZodType<
4757
+ RunAgentRequestBody$Outbound,
4758
+ z.ZodTypeDef,
4759
+ RunAgentRequestBody
4760
+ > = z.object({
4761
+ key: z.string(),
4762
+ taskId: z.string().optional(),
4763
+ model: z.union([
4764
+ z.lazy(() => RunAgentModelConfiguration2$outboundSchema),
4765
+ z.string(),
4766
+ ]),
4767
+ fallbackModels: z.array(
4768
+ z.union([
4769
+ z.lazy(() => RunAgentFallbackModelConfiguration2$outboundSchema),
4770
+ z.string(),
4771
+ ]),
4772
+ ).optional(),
4773
+ role: z.string(),
4774
+ instructions: z.string(),
4775
+ message: z.lazy(() => RunAgentA2AMessage$outboundSchema),
4776
+ variables: z.record(z.any()).optional(),
4777
+ identity: z.lazy(() => RunAgentIdentity$outboundSchema).optional(),
4778
+ contact: z.lazy(() => RunAgentContact$outboundSchema).optional(),
4779
+ thread: z.lazy(() => RunAgentThread$outboundSchema).optional(),
4780
+ memory: z.lazy(() => RunAgentMemory$outboundSchema).optional(),
4781
+ path: z.string(),
4782
+ description: z.string().optional(),
4783
+ systemPrompt: z.string().optional(),
4784
+ memoryStores: z.array(z.string()).optional(),
4785
+ knowledgeBases: z.array(z.lazy(() => RunAgentKnowledgeBases$outboundSchema))
4786
+ .optional(),
4787
+ teamOfAgents: z.array(z.lazy(() => RunAgentTeamOfAgents$outboundSchema))
4788
+ .optional(),
4789
+ settings: z.lazy(() => RunAgentSettings$outboundSchema),
4790
+ metadata: z.record(z.any()).optional(),
4791
+ }).transform((v) => {
4792
+ return remap$(v, {
4793
+ taskId: "task_id",
4794
+ fallbackModels: "fallback_models",
4795
+ systemPrompt: "system_prompt",
4796
+ memoryStores: "memory_stores",
4797
+ knowledgeBases: "knowledge_bases",
4798
+ teamOfAgents: "team_of_agents",
4799
+ });
4800
+ });
4801
+
4802
+ export function runAgentRequestBodyToJSON(
4803
+ runAgentRequestBody: RunAgentRequestBody,
4804
+ ): string {
4805
+ return JSON.stringify(
4806
+ RunAgentRequestBody$outboundSchema.parse(runAgentRequestBody),
4807
+ );
4808
+ }
4809
+
4810
+ /** @internal */
4811
+ export const RunAgentKind$inboundSchema: z.ZodNativeEnum<typeof RunAgentKind> =
4812
+ z.nativeEnum(RunAgentKind);
4813
+
4814
+ /** @internal */
4815
+ export const RunAgentTaskState$inboundSchema: z.ZodNativeEnum<
4816
+ typeof RunAgentTaskState
4817
+ > = z.nativeEnum(RunAgentTaskState);
4818
+
4819
+ /** @internal */
4820
+ export const RunAgentAgentsKind$inboundSchema: z.ZodNativeEnum<
4821
+ typeof RunAgentAgentsKind
4822
+ > = z.nativeEnum(RunAgentAgentsKind);
4823
+
4824
+ /** @internal */
4825
+ export const RunAgentExtendedMessageRole$inboundSchema: z.ZodNativeEnum<
4826
+ typeof RunAgentExtendedMessageRole
4827
+ > = z.nativeEnum(RunAgentExtendedMessageRole);
4828
+
4829
+ /** @internal */
4830
+ export const RunAgentParts$inboundSchema: z.ZodType<
4831
+ RunAgentParts,
4832
+ z.ZodTypeDef,
4833
+ unknown
4834
+ > = z.union([
4835
+ components.TextPart$inboundSchema,
4836
+ components.ErrorPart$inboundSchema,
4837
+ components.DataPart$inboundSchema,
4838
+ components.FilePart$inboundSchema,
4839
+ components.ToolCallPart$inboundSchema,
4840
+ components.ToolResultPart$inboundSchema,
4841
+ ]);
4842
+
4843
+ export function runAgentPartsFromJSON(
4844
+ jsonString: string,
4845
+ ): SafeParseResult<RunAgentParts, SDKValidationError> {
4846
+ return safeParse(
4847
+ jsonString,
4848
+ (x) => RunAgentParts$inboundSchema.parse(JSON.parse(x)),
4849
+ `Failed to parse 'RunAgentParts' from JSON`,
4850
+ );
4851
+ }
4852
+
4853
+ /** @internal */
4854
+ export const RunAgentTaskStatusMessage$inboundSchema: z.ZodType<
4855
+ RunAgentTaskStatusMessage,
4856
+ z.ZodTypeDef,
4857
+ unknown
4858
+ > = z.object({
4859
+ kind: RunAgentAgentsKind$inboundSchema,
4860
+ messageId: z.string(),
4861
+ role: RunAgentExtendedMessageRole$inboundSchema,
4862
+ parts: z.array(
4863
+ z.union([
4864
+ components.TextPart$inboundSchema,
4865
+ components.ErrorPart$inboundSchema,
4866
+ components.DataPart$inboundSchema,
4867
+ components.FilePart$inboundSchema,
4868
+ components.ToolCallPart$inboundSchema,
4869
+ components.ToolResultPart$inboundSchema,
4870
+ ]),
4871
+ ),
4872
+ });
4873
+
4874
+ export function runAgentTaskStatusMessageFromJSON(
4875
+ jsonString: string,
4876
+ ): SafeParseResult<RunAgentTaskStatusMessage, SDKValidationError> {
4877
+ return safeParse(
4878
+ jsonString,
4879
+ (x) => RunAgentTaskStatusMessage$inboundSchema.parse(JSON.parse(x)),
4880
+ `Failed to parse 'RunAgentTaskStatusMessage' from JSON`,
4881
+ );
4882
+ }
4883
+
4884
+ /** @internal */
4885
+ export const RunAgentTaskStatus$inboundSchema: z.ZodType<
4886
+ RunAgentTaskStatus,
4887
+ z.ZodTypeDef,
4888
+ unknown
4889
+ > = z.object({
4890
+ state: RunAgentTaskState$inboundSchema,
4891
+ timestamp: z.string().optional(),
4892
+ message: z.lazy(() => RunAgentTaskStatusMessage$inboundSchema).optional(),
4893
+ });
4894
+
4895
+ export function runAgentTaskStatusFromJSON(
4896
+ jsonString: string,
4897
+ ): SafeParseResult<RunAgentTaskStatus, SDKValidationError> {
4898
+ return safeParse(
4899
+ jsonString,
4900
+ (x) => RunAgentTaskStatus$inboundSchema.parse(JSON.parse(x)),
4901
+ `Failed to parse 'RunAgentTaskStatus' from JSON`,
4902
+ );
4903
+ }
4904
+
4905
+ /** @internal */
4906
+ export const RunAgentA2ATaskResponse$inboundSchema: z.ZodType<
4907
+ RunAgentA2ATaskResponse,
4908
+ z.ZodTypeDef,
4909
+ unknown
4910
+ > = z.object({
4911
+ id: z.string(),
4912
+ contextId: z.string(),
4913
+ kind: RunAgentKind$inboundSchema,
4914
+ status: z.lazy(() => RunAgentTaskStatus$inboundSchema),
4915
+ messages: z.array(components.ExtendedMessage$inboundSchema).optional(),
4916
+ metadata: z.record(z.any()).optional(),
4917
+ });
4918
+
4919
+ export function runAgentA2ATaskResponseFromJSON(
4920
+ jsonString: string,
4921
+ ): SafeParseResult<RunAgentA2ATaskResponse, SDKValidationError> {
4922
+ return safeParse(
4923
+ jsonString,
4924
+ (x) => RunAgentA2ATaskResponse$inboundSchema.parse(JSON.parse(x)),
4925
+ `Failed to parse 'RunAgentA2ATaskResponse' from JSON`,
4926
+ );
4927
+ }