@orq-ai/node 4.4.0 → 4.5.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (451) hide show
  1. package/examples/package-lock.json +4 -7
  2. package/jsr.json +1 -1
  3. package/lib/config.d.ts +2 -2
  4. package/lib/config.js +2 -2
  5. package/lib/config.js.map +1 -1
  6. package/models/components/partdoneevent.js +1 -1
  7. package/models/components/reasoningpart.js +1 -1
  8. package/models/operations/createcontact.js +1 -1
  9. package/models/operations/createdataset.js +1 -1
  10. package/models/operations/createdatasetitem.js +4 -4
  11. package/models/operations/createdatasource.js +1 -1
  12. package/models/operations/createeval.js +16 -16
  13. package/models/operations/createidentity.js +1 -1
  14. package/models/operations/createtool.js +6 -6
  15. package/models/operations/fileget.js +1 -1
  16. package/models/operations/filelist.js +1 -1
  17. package/models/operations/fileupload.js +1 -1
  18. package/models/operations/getalltools.js +6 -6
  19. package/models/operations/getevals.js +16 -16
  20. package/models/operations/listdatasetdatapoints.js +4 -4
  21. package/models/operations/listdatasets.js +1 -1
  22. package/models/operations/listdatasources.js +1 -1
  23. package/models/operations/listidentities.js +1 -1
  24. package/models/operations/retrievedatapoint.js +4 -4
  25. package/models/operations/retrievedataset.js +1 -1
  26. package/models/operations/retrievedatasource.js +1 -1
  27. package/models/operations/retrieveidentity.js +1 -1
  28. package/models/operations/retrievetool.js +6 -6
  29. package/models/operations/runagent.js +1 -1
  30. package/models/operations/streamrunagent.js +1 -1
  31. package/models/operations/updatedatapoint.js +4 -4
  32. package/models/operations/updatedataset.js +1 -1
  33. package/models/operations/updatedatasource.js +1 -1
  34. package/models/operations/updateeval.js +16 -16
  35. package/models/operations/updateidentity.js +1 -1
  36. package/models/operations/updatetool.js +7 -7
  37. package/package.json +4 -3
  38. package/src/lib/config.ts +2 -2
  39. package/src/models/components/partdoneevent.ts +1 -1
  40. package/src/models/components/reasoningpart.ts +1 -1
  41. package/src/models/operations/createcontact.ts +1 -1
  42. package/src/models/operations/createdataset.ts +1 -1
  43. package/src/models/operations/createdatasetitem.ts +4 -4
  44. package/src/models/operations/createdatasource.ts +1 -1
  45. package/src/models/operations/createeval.ts +16 -16
  46. package/src/models/operations/createidentity.ts +1 -1
  47. package/src/models/operations/createtool.ts +6 -6
  48. package/src/models/operations/fileget.ts +1 -1
  49. package/src/models/operations/filelist.ts +1 -1
  50. package/src/models/operations/fileupload.ts +1 -1
  51. package/src/models/operations/getalltools.ts +6 -6
  52. package/src/models/operations/getevals.ts +16 -16
  53. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  54. package/src/models/operations/listdatasets.ts +1 -1
  55. package/src/models/operations/listdatasources.ts +1 -1
  56. package/src/models/operations/listidentities.ts +1 -1
  57. package/src/models/operations/retrievedatapoint.ts +4 -4
  58. package/src/models/operations/retrievedataset.ts +1 -1
  59. package/src/models/operations/retrievedatasource.ts +1 -1
  60. package/src/models/operations/retrieveidentity.ts +1 -1
  61. package/src/models/operations/retrievetool.ts +6 -6
  62. package/src/models/operations/runagent.ts +1 -1
  63. package/src/models/operations/streamrunagent.ts +1 -1
  64. package/src/models/operations/updatedatapoint.ts +4 -4
  65. package/src/models/operations/updatedataset.ts +1 -1
  66. package/src/models/operations/updatedatasource.ts +1 -1
  67. package/src/models/operations/updateeval.ts +16 -16
  68. package/src/models/operations/updateidentity.ts +1 -1
  69. package/src/models/operations/updatetool.ts +7 -7
  70. package/_speakeasy/.github/action-inputs-config.json +0 -53
  71. package/_speakeasy/.github/action-security-config.json +0 -88
  72. package/packages/orq-rc/examples/contactsCreate.example.ts +0 -42
  73. package/packages/orq-rc/examples/package-lock.json +0 -610
  74. package/packages/orq-rc/examples/package.json +0 -18
  75. package/packages/orq-rc/jsr.json +0 -28
  76. package/packages/orq-rc/package-lock.json +0 -1740
  77. package/packages/orq-rc/package.json +0 -30
  78. package/packages/orq-rc/src/core.ts +0 -13
  79. package/packages/orq-rc/src/funcs/agentsCreate.ts +0 -161
  80. package/packages/orq-rc/src/funcs/agentsDelete.ts +0 -180
  81. package/packages/orq-rc/src/funcs/agentsInvoke.ts +0 -177
  82. package/packages/orq-rc/src/funcs/agentsList.ts +0 -179
  83. package/packages/orq-rc/src/funcs/agentsResponsesCreate.ts +0 -183
  84. package/packages/orq-rc/src/funcs/agentsRetrieve.ts +0 -180
  85. package/packages/orq-rc/src/funcs/agentsRun.ts +0 -162
  86. package/packages/orq-rc/src/funcs/agentsStream.ts +0 -201
  87. package/packages/orq-rc/src/funcs/agentsStreamRun.ts +0 -186
  88. package/packages/orq-rc/src/funcs/agentsUpdate.ts +0 -184
  89. package/packages/orq-rc/src/funcs/annotationsCreate.ts +0 -171
  90. package/packages/orq-rc/src/funcs/annotationsDelete.ts +0 -171
  91. package/packages/orq-rc/src/funcs/chunkingParse.ts +0 -160
  92. package/packages/orq-rc/src/funcs/contactsCreate.ts +0 -160
  93. package/packages/orq-rc/src/funcs/datasetsClear.ts +0 -167
  94. package/packages/orq-rc/src/funcs/datasetsCreate.ts +0 -165
  95. package/packages/orq-rc/src/funcs/datasetsCreateDatapoint.ts +0 -171
  96. package/packages/orq-rc/src/funcs/datasetsDelete.ts +0 -167
  97. package/packages/orq-rc/src/funcs/datasetsDeleteDatapoint.ts +0 -182
  98. package/packages/orq-rc/src/funcs/datasetsList.ts +0 -167
  99. package/packages/orq-rc/src/funcs/datasetsListDatapoints.ts +0 -174
  100. package/packages/orq-rc/src/funcs/datasetsRetrieve.ts +0 -175
  101. package/packages/orq-rc/src/funcs/datasetsRetrieveDatapoint.ts +0 -181
  102. package/packages/orq-rc/src/funcs/datasetsUpdate.ts +0 -176
  103. package/packages/orq-rc/src/funcs/datasetsUpdateDatapoint.ts +0 -179
  104. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +0 -168
  105. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +0 -176
  106. package/packages/orq-rc/src/funcs/deploymentsList.ts +0 -176
  107. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +0 -168
  108. package/packages/orq-rc/src/funcs/deploymentsStream.ts +0 -183
  109. package/packages/orq-rc/src/funcs/evalsAll.ts +0 -173
  110. package/packages/orq-rc/src/funcs/evalsCreate.ts +0 -169
  111. package/packages/orq-rc/src/funcs/evalsDelete.ts +0 -173
  112. package/packages/orq-rc/src/funcs/evalsInvoke.ts +0 -181
  113. package/packages/orq-rc/src/funcs/evalsUpdate.ts +0 -173
  114. package/packages/orq-rc/src/funcs/evaluatorsGetV2EvaluatorsIdVersions.ts +0 -183
  115. package/packages/orq-rc/src/funcs/feedbackCreate.ts +0 -160
  116. package/packages/orq-rc/src/funcs/filesCreate.ts +0 -187
  117. package/packages/orq-rc/src/funcs/filesDelete.ts +0 -164
  118. package/packages/orq-rc/src/funcs/filesGet.ts +0 -166
  119. package/packages/orq-rc/src/funcs/filesList.ts +0 -167
  120. package/packages/orq-rc/src/funcs/identitiesCreate.ts +0 -165
  121. package/packages/orq-rc/src/funcs/identitiesDelete.ts +0 -176
  122. package/packages/orq-rc/src/funcs/identitiesList.ts +0 -170
  123. package/packages/orq-rc/src/funcs/identitiesRetrieve.ts +0 -175
  124. package/packages/orq-rc/src/funcs/identitiesUpdate.ts +0 -176
  125. package/packages/orq-rc/src/funcs/knowledgeCreate.ts +0 -158
  126. package/packages/orq-rc/src/funcs/knowledgeCreateChunks.ts +0 -171
  127. package/packages/orq-rc/src/funcs/knowledgeCreateDatasource.ts +0 -166
  128. package/packages/orq-rc/src/funcs/knowledgeDelete.ts +0 -167
  129. package/packages/orq-rc/src/funcs/knowledgeDeleteChunk.ts +0 -174
  130. package/packages/orq-rc/src/funcs/knowledgeDeleteChunks.ts +0 -170
  131. package/packages/orq-rc/src/funcs/knowledgeDeleteDatasource.ts +0 -173
  132. package/packages/orq-rc/src/funcs/knowledgeGetChunksCount.ts +0 -170
  133. package/packages/orq-rc/src/funcs/knowledgeList.ts +0 -169
  134. package/packages/orq-rc/src/funcs/knowledgeListChunks.ts +0 -178
  135. package/packages/orq-rc/src/funcs/knowledgeListChunksPaginated.ts +0 -171
  136. package/packages/orq-rc/src/funcs/knowledgeListDatasources.ts +0 -174
  137. package/packages/orq-rc/src/funcs/knowledgeRetrieve.ts +0 -166
  138. package/packages/orq-rc/src/funcs/knowledgeRetrieveChunk.ts +0 -173
  139. package/packages/orq-rc/src/funcs/knowledgeRetrieveDatasource.ts +0 -169
  140. package/packages/orq-rc/src/funcs/knowledgeSearch.ts +0 -167
  141. package/packages/orq-rc/src/funcs/knowledgeUpdate.ts +0 -164
  142. package/packages/orq-rc/src/funcs/knowledgeUpdateChunk.ts +0 -174
  143. package/packages/orq-rc/src/funcs/knowledgeUpdateDatasource.ts +0 -170
  144. package/packages/orq-rc/src/funcs/memoryStoresCreate.ts +0 -162
  145. package/packages/orq-rc/src/funcs/memoryStoresCreateDocument.ts +0 -176
  146. package/packages/orq-rc/src/funcs/memoryStoresCreateMemory.ts +0 -170
  147. package/packages/orq-rc/src/funcs/memoryStoresDelete.ts +0 -168
  148. package/packages/orq-rc/src/funcs/memoryStoresDeleteDocument.ts +0 -185
  149. package/packages/orq-rc/src/funcs/memoryStoresDeleteMemory.ts +0 -180
  150. package/packages/orq-rc/src/funcs/memoryStoresList.ts +0 -178
  151. package/packages/orq-rc/src/funcs/memoryStoresListDocuments.ts +0 -184
  152. package/packages/orq-rc/src/funcs/memoryStoresListMemories.ts +0 -177
  153. package/packages/orq-rc/src/funcs/memoryStoresRetrieve.ts +0 -177
  154. package/packages/orq-rc/src/funcs/memoryStoresRetrieveDocument.ts +0 -179
  155. package/packages/orq-rc/src/funcs/memoryStoresRetrieveMemory.ts +0 -174
  156. package/packages/orq-rc/src/funcs/memoryStoresUpdate.ts +0 -168
  157. package/packages/orq-rc/src/funcs/memoryStoresUpdateDocument.ts +0 -180
  158. package/packages/orq-rc/src/funcs/memoryStoresUpdateMemory.ts +0 -175
  159. package/packages/orq-rc/src/funcs/modelsList.ts +0 -142
  160. package/packages/orq-rc/src/funcs/promptsCreate.ts +0 -160
  161. package/packages/orq-rc/src/funcs/promptsDelete.ts +0 -173
  162. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +0 -181
  163. package/packages/orq-rc/src/funcs/promptsList.ts +0 -167
  164. package/packages/orq-rc/src/funcs/promptsListVersions.ts +0 -173
  165. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +0 -166
  166. package/packages/orq-rc/src/funcs/promptsUpdate.ts +0 -173
  167. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +0 -161
  168. package/packages/orq-rc/src/funcs/routerAudioSpeechCreate.ts +0 -161
  169. package/packages/orq-rc/src/funcs/routerAudioTranscriptionsCreate.ts +0 -262
  170. package/packages/orq-rc/src/funcs/routerAudioTranslationsCreate.ts +0 -252
  171. package/packages/orq-rc/src/funcs/routerChatCompletionsCreate.ts +0 -168
  172. package/packages/orq-rc/src/funcs/routerCompletionsCreate.ts +0 -168
  173. package/packages/orq-rc/src/funcs/routerEmbeddingsCreate.ts +0 -161
  174. package/packages/orq-rc/src/funcs/routerImagesEditsCreate.ts +0 -222
  175. package/packages/orq-rc/src/funcs/routerImagesGenerationsCreate.ts +0 -160
  176. package/packages/orq-rc/src/funcs/routerImagesVariationsCreate.ts +0 -218
  177. package/packages/orq-rc/src/funcs/routerModerationsCreate.ts +0 -167
  178. package/packages/orq-rc/src/funcs/routerOcr.ts +0 -158
  179. package/packages/orq-rc/src/funcs/routerRerankCreate.ts +0 -160
  180. package/packages/orq-rc/src/funcs/routerResponsesCreate.ts +0 -167
  181. package/packages/orq-rc/src/funcs/toolsCreate.ts +0 -163
  182. package/packages/orq-rc/src/funcs/toolsDelete.ts +0 -167
  183. package/packages/orq-rc/src/funcs/toolsGetV2ToolsToolIdVersions.ts +0 -183
  184. package/packages/orq-rc/src/funcs/toolsGetV2ToolsToolIdVersionsVersionId.ts +0 -190
  185. package/packages/orq-rc/src/funcs/toolsList.ts +0 -176
  186. package/packages/orq-rc/src/funcs/toolsRetrieve.ts +0 -166
  187. package/packages/orq-rc/src/funcs/toolsUpdate.ts +0 -176
  188. package/packages/orq-rc/src/hooks/global.ts +0 -44
  189. package/packages/orq-rc/src/hooks/hooks.ts +0 -132
  190. package/packages/orq-rc/src/hooks/index.ts +0 -6
  191. package/packages/orq-rc/src/hooks/registration.ts +0 -15
  192. package/packages/orq-rc/src/hooks/types.ts +0 -112
  193. package/packages/orq-rc/src/index.ts +0 -9
  194. package/packages/orq-rc/src/lib/base64.ts +0 -37
  195. package/packages/orq-rc/src/lib/config.ts +0 -74
  196. package/packages/orq-rc/src/lib/dlv.ts +0 -53
  197. package/packages/orq-rc/src/lib/encodings.ts +0 -497
  198. package/packages/orq-rc/src/lib/env.ts +0 -89
  199. package/packages/orq-rc/src/lib/event-streams.ts +0 -152
  200. package/packages/orq-rc/src/lib/files.ts +0 -82
  201. package/packages/orq-rc/src/lib/http.ts +0 -323
  202. package/packages/orq-rc/src/lib/is-plain-object.ts +0 -43
  203. package/packages/orq-rc/src/lib/logger.ts +0 -9
  204. package/packages/orq-rc/src/lib/matchers.ts +0 -345
  205. package/packages/orq-rc/src/lib/primitives.ts +0 -150
  206. package/packages/orq-rc/src/lib/retries.ts +0 -218
  207. package/packages/orq-rc/src/lib/schemas.ts +0 -91
  208. package/packages/orq-rc/src/lib/sdks.ts +0 -407
  209. package/packages/orq-rc/src/lib/security.ts +0 -264
  210. package/packages/orq-rc/src/lib/url.ts +0 -33
  211. package/packages/orq-rc/src/models/components/actionreviewedstreamingevent.ts +0 -99
  212. package/packages/orq-rc/src/models/components/actionreviewrequestedstreamingevent.ts +0 -185
  213. package/packages/orq-rc/src/models/components/agenterroredstreamingevent.ts +0 -73
  214. package/packages/orq-rc/src/models/components/agentexecutionstartedstreamingevent.ts +0 -91
  215. package/packages/orq-rc/src/models/components/agenthandedoffstreamingevent.ts +0 -71
  216. package/packages/orq-rc/src/models/components/agentinactivestreamingevent.ts +0 -507
  217. package/packages/orq-rc/src/models/components/agentmessagecreatedstreamingevent.ts +0 -165
  218. package/packages/orq-rc/src/models/components/agentresponsemessage.ts +0 -103
  219. package/packages/orq-rc/src/models/components/agentstartedstreamingevent.ts +0 -517
  220. package/packages/orq-rc/src/models/components/agentthoughtstreamingevent.ts +0 -807
  221. package/packages/orq-rc/src/models/components/audiocontentpartschema.ts +0 -136
  222. package/packages/orq-rc/src/models/components/createagentresponse.ts +0 -299
  223. package/packages/orq-rc/src/models/components/datapart.ts +0 -38
  224. package/packages/orq-rc/src/models/components/errorpart.ts +0 -58
  225. package/packages/orq-rc/src/models/components/errorstreamingevent.ts +0 -66
  226. package/packages/orq-rc/src/models/components/executionnamedstreamingevent.ts +0 -71
  227. package/packages/orq-rc/src/models/components/executionreviewedstreamingevent.ts +0 -61
  228. package/packages/orq-rc/src/models/components/executionreviewrequiredstreamingevent.ts +0 -67
  229. package/packages/orq-rc/src/models/components/filecontentpartschema.ts +0 -87
  230. package/packages/orq-rc/src/models/components/filepart.ts +0 -218
  231. package/packages/orq-rc/src/models/components/imagecontentpartschema.ts +0 -268
  232. package/packages/orq-rc/src/models/components/index.ts +0 -56
  233. package/packages/orq-rc/src/models/components/invokedeploymentrequest.ts +0 -3450
  234. package/packages/orq-rc/src/models/components/partdelta.ts +0 -39
  235. package/packages/orq-rc/src/models/components/partdeltaevent.ts +0 -73
  236. package/packages/orq-rc/src/models/components/partdoneevent.ts +0 -139
  237. package/packages/orq-rc/src/models/components/publiccontact.ts +0 -71
  238. package/packages/orq-rc/src/models/components/publicidentity.ts +0 -69
  239. package/packages/orq-rc/src/models/components/reasoningpart.ts +0 -62
  240. package/packages/orq-rc/src/models/components/reasoningpartschema.ts +0 -71
  241. package/packages/orq-rc/src/models/components/redactedreasoningpartschema.ts +0 -66
  242. package/packages/orq-rc/src/models/components/refusalpartschema.ts +0 -64
  243. package/packages/orq-rc/src/models/components/responsedoneevent.ts +0 -318
  244. package/packages/orq-rc/src/models/components/responsefailedevent.ts +0 -72
  245. package/packages/orq-rc/src/models/components/responsestartedevent.ts +0 -91
  246. package/packages/orq-rc/src/models/components/responsestreamingevent.ts +0 -85
  247. package/packages/orq-rc/src/models/components/reviewoutcome.ts +0 -23
  248. package/packages/orq-rc/src/models/components/security.ts +0 -32
  249. package/packages/orq-rc/src/models/components/textcontentpartschema.ts +0 -207
  250. package/packages/orq-rc/src/models/components/textpart.ts +0 -54
  251. package/packages/orq-rc/src/models/components/thinkingconfigdisabledschema.ts +0 -59
  252. package/packages/orq-rc/src/models/components/thinkingconfigenabledschema.ts +0 -106
  253. package/packages/orq-rc/src/models/components/timeoutstreamingevent.ts +0 -64
  254. package/packages/orq-rc/src/models/components/toolcallpart.ts +0 -51
  255. package/packages/orq-rc/src/models/components/tooldoneevent.ts +0 -77
  256. package/packages/orq-rc/src/models/components/toolexecutionfailedstreamingevent.ts +0 -230
  257. package/packages/orq-rc/src/models/components/toolexecutionfinishedstreamingevent.ts +0 -214
  258. package/packages/orq-rc/src/models/components/toolexecutionstartedstreamingevent.ts +0 -200
  259. package/packages/orq-rc/src/models/components/toolfailedevent.ts +0 -77
  260. package/packages/orq-rc/src/models/components/toolresultpart.ts +0 -71
  261. package/packages/orq-rc/src/models/components/toolreviewdoneevent.ts +0 -78
  262. package/packages/orq-rc/src/models/components/toolreviewrequestedevent.ts +0 -87
  263. package/packages/orq-rc/src/models/components/toolstartedevent.ts +0 -82
  264. package/packages/orq-rc/src/models/errors/apierror.ts +0 -40
  265. package/packages/orq-rc/src/models/errors/createeval.ts +0 -51
  266. package/packages/orq-rc/src/models/errors/createmoderation.ts +0 -84
  267. package/packages/orq-rc/src/models/errors/createtranscription.ts +0 -87
  268. package/packages/orq-rc/src/models/errors/createtranslation.ts +0 -87
  269. package/packages/orq-rc/src/models/errors/deleteagent.ts +0 -51
  270. package/packages/orq-rc/src/models/errors/deleteeval.ts +0 -51
  271. package/packages/orq-rc/src/models/errors/deleteidentity.ts +0 -62
  272. package/packages/orq-rc/src/models/errors/deleteprompt.ts +0 -51
  273. package/packages/orq-rc/src/models/errors/getevals.ts +0 -51
  274. package/packages/orq-rc/src/models/errors/getpromptversion.ts +0 -51
  275. package/packages/orq-rc/src/models/errors/getv2evaluatorsidversions.ts +0 -51
  276. package/packages/orq-rc/src/models/errors/getv2toolstoolidversions.ts +0 -51
  277. package/packages/orq-rc/src/models/errors/getv2toolstoolidversionsversionid.ts +0 -52
  278. package/packages/orq-rc/src/models/errors/honoapierror.ts +0 -59
  279. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +0 -62
  280. package/packages/orq-rc/src/models/errors/index.ts +0 -33
  281. package/packages/orq-rc/src/models/errors/invokeeval.ts +0 -141
  282. package/packages/orq-rc/src/models/errors/orqerror.ts +0 -35
  283. package/packages/orq-rc/src/models/errors/responsevalidationerror.ts +0 -50
  284. package/packages/orq-rc/src/models/errors/retrieveagentrequest.ts +0 -51
  285. package/packages/orq-rc/src/models/errors/retrieveidentity.ts +0 -62
  286. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +0 -109
  287. package/packages/orq-rc/src/models/errors/streamagent.ts +0 -51
  288. package/packages/orq-rc/src/models/errors/streamrunagent.ts +0 -51
  289. package/packages/orq-rc/src/models/errors/updateagent.ts +0 -51
  290. package/packages/orq-rc/src/models/errors/updateeval.ts +0 -51
  291. package/packages/orq-rc/src/models/errors/updateidentity.ts +0 -54
  292. package/packages/orq-rc/src/models/errors/updateprompt.ts +0 -51
  293. package/packages/orq-rc/src/models/errors/updatetool.ts +0 -62
  294. package/packages/orq-rc/src/models/operations/cleardataset.ts +0 -39
  295. package/packages/orq-rc/src/models/operations/createagentrequest.ts +0 -7093
  296. package/packages/orq-rc/src/models/operations/createagentresponserequest.ts +0 -609
  297. package/packages/orq-rc/src/models/operations/createannotation.ts +0 -162
  298. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +0 -6381
  299. package/packages/orq-rc/src/models/operations/createchunk.ts +0 -222
  300. package/packages/orq-rc/src/models/operations/createcompletion.ts +0 -3413
  301. package/packages/orq-rc/src/models/operations/createcontact.ts +0 -156
  302. package/packages/orq-rc/src/models/operations/createdataset.ts +0 -162
  303. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +0 -2551
  304. package/packages/orq-rc/src/models/operations/createdatasource.ts +0 -437
  305. package/packages/orq-rc/src/models/operations/createembedding.ts +0 -947
  306. package/packages/orq-rc/src/models/operations/createeval.ts +0 -4170
  307. package/packages/orq-rc/src/models/operations/createfeedback.ts +0 -144
  308. package/packages/orq-rc/src/models/operations/createidentity.ts +0 -162
  309. package/packages/orq-rc/src/models/operations/createimage.ts +0 -1028
  310. package/packages/orq-rc/src/models/operations/createimageedit.ts +0 -1045
  311. package/packages/orq-rc/src/models/operations/createimagevariation.ts +0 -1067
  312. package/packages/orq-rc/src/models/operations/createknowledge.ts +0 -944
  313. package/packages/orq-rc/src/models/operations/creatememory.ts +0 -142
  314. package/packages/orq-rc/src/models/operations/creatememorydocument.ts +0 -152
  315. package/packages/orq-rc/src/models/operations/creatememorystore.ts +0 -199
  316. package/packages/orq-rc/src/models/operations/createmoderation.ts +0 -664
  317. package/packages/orq-rc/src/models/operations/createprompt.ts +0 -5401
  318. package/packages/orq-rc/src/models/operations/creatererank.ts +0 -890
  319. package/packages/orq-rc/src/models/operations/createresponse.ts +0 -3324
  320. package/packages/orq-rc/src/models/operations/createspeech.ts +0 -700
  321. package/packages/orq-rc/src/models/operations/createtool.ts +0 -2499
  322. package/packages/orq-rc/src/models/operations/createtranscription.ts +0 -955
  323. package/packages/orq-rc/src/models/operations/createtranslation.ts +0 -930
  324. package/packages/orq-rc/src/models/operations/deleteagent.ts +0 -39
  325. package/packages/orq-rc/src/models/operations/deleteannotation.ts +0 -79
  326. package/packages/orq-rc/src/models/operations/deletechunk.ts +0 -53
  327. package/packages/orq-rc/src/models/operations/deletechunks.ts +0 -125
  328. package/packages/orq-rc/src/models/operations/deletedatapoint.ts +0 -46
  329. package/packages/orq-rc/src/models/operations/deletedataset.ts +0 -39
  330. package/packages/orq-rc/src/models/operations/deletedatasource.ts +0 -46
  331. package/packages/orq-rc/src/models/operations/deleteeval.ts +0 -31
  332. package/packages/orq-rc/src/models/operations/deleteidentity.ts +0 -34
  333. package/packages/orq-rc/src/models/operations/deleteknowledge.ts +0 -39
  334. package/packages/orq-rc/src/models/operations/deletememory.ts +0 -46
  335. package/packages/orq-rc/src/models/operations/deletememorydocument.ts +0 -55
  336. package/packages/orq-rc/src/models/operations/deletememorystore.ts +0 -39
  337. package/packages/orq-rc/src/models/operations/deleteprompt.ts +0 -34
  338. package/packages/orq-rc/src/models/operations/deletetool.ts +0 -36
  339. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +0 -2370
  340. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +0 -4525
  341. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +0 -690
  342. package/packages/orq-rc/src/models/operations/deployments.ts +0 -1268
  343. package/packages/orq-rc/src/models/operations/deploymentstream.ts +0 -4614
  344. package/packages/orq-rc/src/models/operations/filedelete.ts +0 -39
  345. package/packages/orq-rc/src/models/operations/fileget.ts +0 -116
  346. package/packages/orq-rc/src/models/operations/filelist.ts +0 -172
  347. package/packages/orq-rc/src/models/operations/fileupload.ts +0 -170
  348. package/packages/orq-rc/src/models/operations/getallmemories.ts +0 -173
  349. package/packages/orq-rc/src/models/operations/getallmemorydocuments.ts +0 -188
  350. package/packages/orq-rc/src/models/operations/getallmemorystores.ts +0 -200
  351. package/packages/orq-rc/src/models/operations/getallprompts.ts +0 -3164
  352. package/packages/orq-rc/src/models/operations/getalltools.ts +0 -1398
  353. package/packages/orq-rc/src/models/operations/getchunkscount.ts +0 -121
  354. package/packages/orq-rc/src/models/operations/getevals.ts +0 -2842
  355. package/packages/orq-rc/src/models/operations/getonechunk.ts +0 -171
  356. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +0 -652
  357. package/packages/orq-rc/src/models/operations/getoneprompt.ts +0 -3089
  358. package/packages/orq-rc/src/models/operations/getpromptversion.ts +0 -3134
  359. package/packages/orq-rc/src/models/operations/getv2evaluatorsidversions.ts +0 -162
  360. package/packages/orq-rc/src/models/operations/getv2toolstoolidversions.ts +0 -163
  361. package/packages/orq-rc/src/models/operations/getv2toolstoolidversionsversionid.ts +0 -110
  362. package/packages/orq-rc/src/models/operations/index.ts +0 -113
  363. package/packages/orq-rc/src/models/operations/invokeagent.ts +0 -733
  364. package/packages/orq-rc/src/models/operations/invokeeval.ts +0 -1253
  365. package/packages/orq-rc/src/models/operations/listagents.ts +0 -3018
  366. package/packages/orq-rc/src/models/operations/listchunks.ts +0 -260
  367. package/packages/orq-rc/src/models/operations/listchunkspaginated.ts +0 -263
  368. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +0 -1498
  369. package/packages/orq-rc/src/models/operations/listdatasets.ts +0 -205
  370. package/packages/orq-rc/src/models/operations/listdatasources.ts +0 -235
  371. package/packages/orq-rc/src/models/operations/listidentities.ts +0 -275
  372. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +0 -642
  373. package/packages/orq-rc/src/models/operations/listmodels.ts +0 -143
  374. package/packages/orq-rc/src/models/operations/listpromptversions.ts +0 -3209
  375. package/packages/orq-rc/src/models/operations/parse.ts +0 -777
  376. package/packages/orq-rc/src/models/operations/postv2routerocr.ts +0 -478
  377. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +0 -108
  378. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +0 -3104
  379. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +0 -1402
  380. package/packages/orq-rc/src/models/operations/retrievedataset.ts +0 -150
  381. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +0 -152
  382. package/packages/orq-rc/src/models/operations/retrieveidentity.ts +0 -117
  383. package/packages/orq-rc/src/models/operations/retrievememory.ts +0 -112
  384. package/packages/orq-rc/src/models/operations/retrievememorydocument.ts +0 -118
  385. package/packages/orq-rc/src/models/operations/retrievememorystore.ts +0 -144
  386. package/packages/orq-rc/src/models/operations/retrievetool.ts +0 -1379
  387. package/packages/orq-rc/src/models/operations/runagent.ts +0 -5351
  388. package/packages/orq-rc/src/models/operations/searchknowledge.ts +0 -1762
  389. package/packages/orq-rc/src/models/operations/streamagent.ts +0 -629
  390. package/packages/orq-rc/src/models/operations/streamrunagent.ts +0 -5546
  391. package/packages/orq-rc/src/models/operations/updateagent.ts +0 -7447
  392. package/packages/orq-rc/src/models/operations/updatechunk.ts +0 -236
  393. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +0 -2555
  394. package/packages/orq-rc/src/models/operations/updatedataset.ts +0 -206
  395. package/packages/orq-rc/src/models/operations/updatedatasource.ts +0 -186
  396. package/packages/orq-rc/src/models/operations/updateeval.ts +0 -4066
  397. package/packages/orq-rc/src/models/operations/updateidentity.ts +0 -189
  398. package/packages/orq-rc/src/models/operations/updateknowledge.ts +0 -1231
  399. package/packages/orq-rc/src/models/operations/updatememory.ts +0 -142
  400. package/packages/orq-rc/src/models/operations/updatememorydocument.ts +0 -159
  401. package/packages/orq-rc/src/models/operations/updatememorystore.ts +0 -246
  402. package/packages/orq-rc/src/models/operations/updateprompt.ts +0 -5472
  403. package/packages/orq-rc/src/models/operations/updatetool.ts +0 -2696
  404. package/packages/orq-rc/src/sdk/agents.ts +0 -196
  405. package/packages/orq-rc/src/sdk/annotations.ts +0 -39
  406. package/packages/orq-rc/src/sdk/audio.ts +0 -25
  407. package/packages/orq-rc/src/sdk/chat.ts +0 -13
  408. package/packages/orq-rc/src/sdk/chunking.ts +0 -27
  409. package/packages/orq-rc/src/sdk/completions.ts +0 -32
  410. package/packages/orq-rc/src/sdk/contacts.ts +0 -27
  411. package/packages/orq-rc/src/sdk/datasets.ts +0 -204
  412. package/packages/orq-rc/src/sdk/deployments.ts +0 -89
  413. package/packages/orq-rc/src/sdk/edits.ts +0 -27
  414. package/packages/orq-rc/src/sdk/embeddings.ts +0 -27
  415. package/packages/orq-rc/src/sdk/evals.ts +0 -84
  416. package/packages/orq-rc/src/sdk/evaluators.ts +0 -27
  417. package/packages/orq-rc/src/sdk/feedback.ts +0 -27
  418. package/packages/orq-rc/src/sdk/files.ts +0 -78
  419. package/packages/orq-rc/src/sdk/generations.ts +0 -27
  420. package/packages/orq-rc/src/sdk/identities.ts +0 -99
  421. package/packages/orq-rc/src/sdk/images.ts +0 -25
  422. package/packages/orq-rc/src/sdk/index.ts +0 -5
  423. package/packages/orq-rc/src/sdk/knowledge.ts +0 -309
  424. package/packages/orq-rc/src/sdk/memorystores.ts +0 -286
  425. package/packages/orq-rc/src/sdk/metrics.ts +0 -27
  426. package/packages/orq-rc/src/sdk/models.ts +0 -25
  427. package/packages/orq-rc/src/sdk/moderations.ts +0 -24
  428. package/packages/orq-rc/src/sdk/orqcompletions.ts +0 -32
  429. package/packages/orq-rc/src/sdk/orqresponses.ts +0 -32
  430. package/packages/orq-rc/src/sdk/prompts.ts +0 -126
  431. package/packages/orq-rc/src/sdk/remoteconfigs.ts +0 -24
  432. package/packages/orq-rc/src/sdk/rerank.ts +0 -27
  433. package/packages/orq-rc/src/sdk/responses.ts +0 -34
  434. package/packages/orq-rc/src/sdk/router.ts +0 -72
  435. package/packages/orq-rc/src/sdk/sdk.ts +0 -115
  436. package/packages/orq-rc/src/sdk/speech.ts +0 -27
  437. package/packages/orq-rc/src/sdk/tools.ts +0 -135
  438. package/packages/orq-rc/src/sdk/transcriptions.ts +0 -24
  439. package/packages/orq-rc/src/sdk/translations.ts +0 -24
  440. package/packages/orq-rc/src/sdk/variations.ts +0 -27
  441. package/packages/orq-rc/src/types/async.ts +0 -68
  442. package/packages/orq-rc/src/types/blobs.ts +0 -32
  443. package/packages/orq-rc/src/types/constdatetime.ts +0 -15
  444. package/packages/orq-rc/src/types/enums.ts +0 -45
  445. package/packages/orq-rc/src/types/fp.ts +0 -50
  446. package/packages/orq-rc/src/types/index.ts +0 -11
  447. package/packages/orq-rc/src/types/operations.ts +0 -105
  448. package/packages/orq-rc/src/types/rfcdate.ts +0 -54
  449. package/packages/orq-rc/src/types/streams.ts +0 -21
  450. package/packages/orq-rc/src/types/unrecognized.ts +0 -35
  451. package/packages/orq-rc/tsconfig.json +0 -40
@@ -1,3324 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { EventStream } from "../../lib/event-streams.js";
7
- import { remap as remap$ } from "../../lib/primitives.js";
8
- import {
9
- collectExtraKeys as collectExtraKeys$,
10
- safeParse,
11
- } from "../../lib/schemas.js";
12
- import { ClosedEnum } from "../../types/enums.js";
13
- import { Result as SafeParseResult } from "../../types/fp.js";
14
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
15
-
16
- /**
17
- * The effort level for reasoning (o3-mini model only)
18
- */
19
- export const Effort = {
20
- Low: "low",
21
- Medium: "medium",
22
- High: "high",
23
- } as const;
24
- /**
25
- * The effort level for reasoning (o3-mini model only)
26
- */
27
- export type Effort = ClosedEnum<typeof Effort>;
28
-
29
- /**
30
- * Configuration for reasoning models
31
- */
32
- export type Reasoning = {
33
- /**
34
- * The effort level for reasoning (o3-mini model only)
35
- */
36
- effort?: Effort | undefined;
37
- };
38
-
39
- export type Format3 = {
40
- /**
41
- * Ensures the response matches a supplied JSON schema
42
- */
43
- type: "json_schema";
44
- /**
45
- * 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.
46
- */
47
- name: string;
48
- /**
49
- * A description of what the response format is for, used by the model to determine how to respond in the format.
50
- */
51
- description?: string | undefined;
52
- /**
53
- * The JSON schema to validate the response against
54
- */
55
- schema: { [k: string]: any };
56
- /**
57
- * 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`
58
- */
59
- strict?: boolean | undefined;
60
- };
61
-
62
- export type Format2 = {
63
- /**
64
- * Ensures the response is a valid JSON object
65
- */
66
- type: "json_object";
67
- };
68
-
69
- export type Format1 = {
70
- /**
71
- * Plain text response format
72
- */
73
- type: "text";
74
- };
75
-
76
- export type CreateResponseFormat = Format1 | Format2 | Format3;
77
-
78
- export type CreateResponseText = {
79
- format: Format1 | Format2 | Format3;
80
- };
81
-
82
- /**
83
- * The type of input item
84
- */
85
- export const CreateResponse2RouterResponsesRequestRequestBodyInputType = {
86
- FunctionCall: "function_call",
87
- } as const;
88
- /**
89
- * The type of input item
90
- */
91
- export type CreateResponse2RouterResponsesRequestRequestBodyInputType =
92
- ClosedEnum<typeof CreateResponse2RouterResponsesRequestRequestBodyInputType>;
93
-
94
- /**
95
- * Represents a function tool call, provided as input to the model.
96
- */
97
- export type CreateResponse23 = {
98
- /**
99
- * The type of input item
100
- */
101
- type: CreateResponse2RouterResponsesRequestRequestBodyInputType;
102
- /**
103
- * The ID of the function call
104
- */
105
- callId: string;
106
- /**
107
- * The unique identifier for this function call
108
- */
109
- id: string;
110
- /**
111
- * The name of the function being called
112
- */
113
- name: string;
114
- /**
115
- * The arguments to the function as a JSON string
116
- */
117
- arguments: string;
118
- /**
119
- * The status of the function call
120
- */
121
- status: string;
122
- };
123
-
124
- /**
125
- * The type of input item
126
- */
127
- export const CreateResponse2RouterResponsesRequestRequestBodyType = {
128
- FunctionCallOutput: "function_call_output",
129
- } as const;
130
- /**
131
- * The type of input item
132
- */
133
- export type CreateResponse2RouterResponsesRequestRequestBodyType = ClosedEnum<
134
- typeof CreateResponse2RouterResponsesRequestRequestBodyType
135
- >;
136
-
137
- /**
138
- * Represents the output of a function tool call, provided as input to the model.
139
- */
140
- export type CreateResponse2RouterResponses2 = {
141
- /**
142
- * The type of input item
143
- */
144
- type: CreateResponse2RouterResponsesRequestRequestBodyType;
145
- /**
146
- * The ID of the function call this output is for
147
- */
148
- callId: string;
149
- /**
150
- * The output from the function call
151
- */
152
- output: string;
153
- };
154
-
155
- /**
156
- * The role of the message author
157
- */
158
- export const TwoRole = {
159
- User: "user",
160
- Assistant: "assistant",
161
- System: "system",
162
- Developer: "developer",
163
- } as const;
164
- /**
165
- * The role of the message author
166
- */
167
- export type TwoRole = ClosedEnum<typeof TwoRole>;
168
-
169
- /**
170
- * A file input content part.
171
- */
172
- export type Two3 = {
173
- /**
174
- * The type of input content part
175
- */
176
- type: "input_file";
177
- /**
178
- * Base64 encoded file data
179
- */
180
- fileData?: string | undefined;
181
- /**
182
- * File ID from the Files API
183
- */
184
- fileId?: string | undefined;
185
- /**
186
- * Name of the file
187
- */
188
- filename?: string | undefined;
189
- /**
190
- * URL of the file to fetch
191
- */
192
- fileUrl?: string | undefined;
193
- };
194
-
195
- /**
196
- * Level of detail for image analysis
197
- */
198
- export const Detail = {
199
- High: "high",
200
- Low: "low",
201
- Auto: "auto",
202
- } as const;
203
- /**
204
- * Level of detail for image analysis
205
- */
206
- export type Detail = ClosedEnum<typeof Detail>;
207
-
208
- /**
209
- * An image input content part.
210
- */
211
- export type CreateResponse22 = {
212
- /**
213
- * The type of input content part
214
- */
215
- type: "input_image";
216
- /**
217
- * Level of detail for image analysis
218
- */
219
- detail?: Detail | undefined;
220
- /**
221
- * File ID for the image
222
- */
223
- fileId?: string | null | undefined;
224
- /**
225
- * URL of the image (can be http URL or data URL)
226
- */
227
- imageUrl?: string | null | undefined;
228
- };
229
-
230
- /**
231
- * A text input content part
232
- */
233
- export type CreateResponse21 = {
234
- /**
235
- * The type of input content
236
- */
237
- type: "input_text";
238
- /**
239
- * The text content
240
- */
241
- text: string;
242
- };
243
-
244
- export type CreateResponseContent2 = CreateResponse21 | CreateResponse22 | Two3;
245
-
246
- /**
247
- * The content of the message, either a string or an array of content parts
248
- */
249
- export type TwoContent =
250
- | string
251
- | Array<CreateResponse21 | CreateResponse22 | Two3>;
252
-
253
- /**
254
- * Represents a message in the conversation, with a role and content (string or rich content parts).
255
- */
256
- export type Two1 = {
257
- /**
258
- * The role of the message author
259
- */
260
- role: TwoRole;
261
- /**
262
- * The content of the message, either a string or an array of content parts
263
- */
264
- content: string | Array<CreateResponse21 | CreateResponse22 | Two3>;
265
- };
266
-
267
- export type Input2 = CreateResponse23 | CreateResponse2RouterResponses2 | Two1;
268
-
269
- /**
270
- * The actual user input(s) for the model. Can be a simple string, or an array of structured input items (messages, tool outputs) representing a conversation history or complex input.
271
- */
272
- export type CreateResponseInput =
273
- | string
274
- | Array<CreateResponse23 | CreateResponse2RouterResponses2 | Two1>;
275
-
276
- export const Include = {
277
- CodeInterpreterCallOutputs: "code_interpreter_call.outputs",
278
- ComputerCallOutputOutputImageUrl: "computer_call_output.output.image_url",
279
- FileSearchCallResults: "file_search_call.results",
280
- MessageInputImageImageUrl: "message.input_image.image_url",
281
- MessageOutputTextLogprobs: "message.output_text.logprobs",
282
- ReasoningEncryptedContent: "reasoning.encrypted_content",
283
- } as const;
284
- export type Include = ClosedEnum<typeof Include>;
285
-
286
- /**
287
- * Specifies the latency tier to use for processing the request. Defaults to "auto".
288
- */
289
- export const ServiceTier = {
290
- Auto: "auto",
291
- Default: "default",
292
- Flex: "flex",
293
- Priority: "priority",
294
- } as const;
295
- /**
296
- * Specifies the latency tier to use for processing the request. Defaults to "auto".
297
- */
298
- export type ServiceTier = ClosedEnum<typeof ServiceTier>;
299
-
300
- /**
301
- * The ranking algorithm
302
- */
303
- export const Ranker = {
304
- Auto: "auto",
305
- Default20240821: "default_2024_08_21",
306
- } as const;
307
- /**
308
- * The ranking algorithm
309
- */
310
- export type Ranker = ClosedEnum<typeof Ranker>;
311
-
312
- /**
313
- * Options for ranking search results
314
- */
315
- export type RankingOptions = {
316
- /**
317
- * The ranking algorithm
318
- */
319
- ranker?: Ranker | undefined;
320
- /**
321
- * Minimum relevance score
322
- */
323
- scoreThreshold?: number | undefined;
324
- };
325
-
326
- /**
327
- * Configuration for file search tool
328
- */
329
- export type Tools3 = {
330
- /**
331
- * The type of tool
332
- */
333
- type: "file_search";
334
- /**
335
- * The vector stores to search
336
- */
337
- vectorStoreIds?: Array<string> | undefined;
338
- /**
339
- * Maximum number of results to return
340
- */
341
- maxNumResults?: number | undefined;
342
- /**
343
- * Filters to apply to the search
344
- */
345
- filters?: any | undefined;
346
- /**
347
- * Options for ranking search results
348
- */
349
- rankingOptions?: RankingOptions | undefined;
350
- };
351
-
352
- /**
353
- * Amount of context to retrieve for each search result
354
- */
355
- export const SearchContextSize = {
356
- Small: "small",
357
- Medium: "medium",
358
- Large: "large",
359
- } as const;
360
- /**
361
- * Amount of context to retrieve for each search result
362
- */
363
- export type SearchContextSize = ClosedEnum<typeof SearchContextSize>;
364
-
365
- /**
366
- * The type of location
367
- */
368
- export const CreateResponseToolsRouterResponsesRequestType = {
369
- Approximate: "approximate",
370
- Exact: "exact",
371
- } as const;
372
- /**
373
- * The type of location
374
- */
375
- export type CreateResponseToolsRouterResponsesRequestType = ClosedEnum<
376
- typeof CreateResponseToolsRouterResponsesRequestType
377
- >;
378
-
379
- /**
380
- * User location for search localization
381
- */
382
- export type UserLocation = {
383
- /**
384
- * The type of location
385
- */
386
- type?: CreateResponseToolsRouterResponsesRequestType | undefined;
387
- /**
388
- * The city name
389
- */
390
- city?: string | null | undefined;
391
- /**
392
- * The country code
393
- */
394
- country?: string | undefined;
395
- /**
396
- * The region/state
397
- */
398
- region?: string | null | undefined;
399
- /**
400
- * The timezone
401
- */
402
- timezone?: string | null | undefined;
403
- };
404
-
405
- /**
406
- * Configuration for web search tool
407
- */
408
- export type Tools2 = {
409
- /**
410
- * The type of tool
411
- */
412
- type: "web_search_preview";
413
- /**
414
- * List of domains to restrict search to
415
- */
416
- domains?: Array<string> | undefined;
417
- /**
418
- * Amount of context to retrieve for each search result
419
- */
420
- searchContextSize?: SearchContextSize | undefined;
421
- /**
422
- * User location for search localization
423
- */
424
- userLocation?: UserLocation | undefined;
425
- };
426
-
427
- /**
428
- * The type of the parameters object
429
- */
430
- export const CreateResponseToolsType = {
431
- Object: "object",
432
- } as const;
433
- /**
434
- * The type of the parameters object
435
- */
436
- export type CreateResponseToolsType = ClosedEnum<
437
- typeof CreateResponseToolsType
438
- >;
439
-
440
- export type Properties = {
441
- type: string;
442
- description?: string | undefined;
443
- enum?: Array<string> | undefined;
444
- additionalProperties?: { [k: string]: any } | undefined;
445
- };
446
-
447
- /**
448
- * The parameters the function accepts
449
- */
450
- export type ToolsParameters = {
451
- /**
452
- * The type of the parameters object
453
- */
454
- type: CreateResponseToolsType;
455
- /**
456
- * The parameters the function accepts, described as a JSON Schema object
457
- */
458
- properties: { [k: string]: Properties };
459
- /**
460
- * List of required parameter names
461
- */
462
- required?: Array<string> | undefined;
463
- /**
464
- * Whether to allow properties not defined in the schema
465
- */
466
- additionalProperties?: boolean | undefined;
467
- };
468
-
469
- /**
470
- * A function tool definition
471
- */
472
- export type Tools1 = {
473
- /**
474
- * The type of tool
475
- */
476
- type: "function";
477
- /**
478
- * The name of the function to be called
479
- */
480
- name: string;
481
- /**
482
- * A description of what the function does
483
- */
484
- description?: string | null | undefined;
485
- /**
486
- * The parameters the function accepts
487
- */
488
- parameters: ToolsParameters;
489
- /**
490
- * Whether to enable strict schema adherence when generating function calls
491
- */
492
- strict?: boolean | undefined;
493
- };
494
-
495
- export type CreateResponseTools = Tools1 | Tools2 | Tools3;
496
-
497
- export const CreateResponseToolChoiceRouterResponsesRequestType = {
498
- Mcp: "mcp",
499
- } as const;
500
- export type CreateResponseToolChoiceRouterResponsesRequestType = ClosedEnum<
501
- typeof CreateResponseToolChoiceRouterResponsesRequestType
502
- >;
503
-
504
- export type ToolChoice4 = {
505
- type: CreateResponseToolChoiceRouterResponsesRequestType;
506
- serverLabel: string;
507
- name?: string | null | undefined;
508
- };
509
-
510
- export const CreateResponseToolChoiceRouterResponsesType = {
511
- Function: "function",
512
- } as const;
513
- export type CreateResponseToolChoiceRouterResponsesType = ClosedEnum<
514
- typeof CreateResponseToolChoiceRouterResponsesType
515
- >;
516
-
517
- export type ToolChoice3 = {
518
- type: CreateResponseToolChoiceRouterResponsesType;
519
- name: string;
520
- };
521
-
522
- export const CreateResponseToolChoiceType = {
523
- FileSearch: "file_search",
524
- WebSearchPreview: "web_search_preview",
525
- ComputerUsePreview: "computer_use_preview",
526
- CodeInterpreter: "code_interpreter",
527
- ImageGeneration: "image_generation",
528
- } as const;
529
- export type CreateResponseToolChoiceType = ClosedEnum<
530
- typeof CreateResponseToolChoiceType
531
- >;
532
-
533
- export type CreateResponseToolChoice2 = {
534
- type: CreateResponseToolChoiceType;
535
- };
536
-
537
- /**
538
- * Controls which (if any) tool is called by the model. `none` means the model will not call any tool. `auto` means the model can pick between generating a message or calling a tool. `required` means the model must call a tool.
539
- */
540
- export const CreateResponseToolChoice1 = {
541
- None: "none",
542
- Auto: "auto",
543
- Required: "required",
544
- } as const;
545
- /**
546
- * Controls which (if any) tool is called by the model. `none` means the model will not call any tool. `auto` means the model can pick between generating a message or calling a tool. `required` means the model must call a tool.
547
- */
548
- export type CreateResponseToolChoice1 = ClosedEnum<
549
- typeof CreateResponseToolChoice1
550
- >;
551
-
552
- /**
553
- * How the model should select which tool (or tools) to use when generating a response. Can be a string (`none`, `auto`, `required`) or an object to force a specific tool.
554
- */
555
- export type CreateResponseToolChoice =
556
- | ToolChoice3
557
- | ToolChoice4
558
- | CreateResponseToolChoice2
559
- | CreateResponseToolChoice1;
560
-
561
- export type CreateResponseRequestBody = {
562
- /**
563
- * ID of the model to use. You can use the List models API to see all of your available models.
564
- */
565
- model: string;
566
- /**
567
- * Developer-defined key-value pairs that will be included in response objects
568
- */
569
- metadata?: { [k: string]: string } | undefined;
570
- /**
571
- * 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.
572
- */
573
- temperature?: number | null | undefined;
574
- /**
575
- * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
576
- */
577
- topP?: number | null | undefined;
578
- /**
579
- * The ID of a previous response to continue the conversation from. The model will have access to the previous response context.
580
- */
581
- previousResponseId?: string | null | undefined;
582
- /**
583
- * Developer-provided instructions that the model should follow. Overwrites the default system message.
584
- */
585
- instructions?: string | null | undefined;
586
- /**
587
- * Configuration for reasoning models
588
- */
589
- reasoning?: Reasoning | null | undefined;
590
- /**
591
- * The maximum number of tokens that can be generated in the response
592
- */
593
- maxOutputTokens?: number | null | undefined;
594
- text?: CreateResponseText | null | undefined;
595
- /**
596
- * The actual user input(s) for the model. Can be a simple string, or an array of structured input items (messages, tool outputs) representing a conversation history or complex input.
597
- */
598
- input:
599
- | string
600
- | Array<CreateResponse23 | CreateResponse2RouterResponses2 | Two1>;
601
- /**
602
- * Specifies which (potentially large) fields to include in the response. By default, the results of Code Interpreter and file searches are excluded. Available options:
603
- *
604
- * @remarks
605
- * - code_interpreter_call.outputs: Include the outputs of Code Interpreter tool calls
606
- * - computer_call_output.output.image_url: Include the image URLs from computer use tool calls
607
- * - file_search_call.results: Include the results of file search tool calls
608
- * - message.input_image.image_url: Include URLs of input images
609
- * - message.output_text.logprobs: Include log probabilities for output text (when logprobs is enabled)
610
- * - reasoning.encrypted_content: Include encrypted reasoning content for reasoning models
611
- */
612
- include?: Array<Include> | null | undefined;
613
- /**
614
- * Whether to enable parallel function calling during tool use.
615
- */
616
- parallelToolCalls?: boolean | null | undefined;
617
- /**
618
- * Whether to store this response for use in distillations or evals.
619
- */
620
- store?: boolean | null | undefined;
621
- /**
622
- * Specifies the latency tier to use for processing the request. Defaults to "auto".
623
- */
624
- serviceTier?: ServiceTier | null | undefined;
625
- /**
626
- * A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.
627
- */
628
- tools?: Array<Tools1 | Tools2 | Tools3> | undefined;
629
- /**
630
- * How the model should select which tool (or tools) to use when generating a response. Can be a string (`none`, `auto`, `required`) or an object to force a specific tool.
631
- */
632
- toolChoice?:
633
- | ToolChoice3
634
- | ToolChoice4
635
- | CreateResponseToolChoice2
636
- | CreateResponseToolChoice1
637
- | undefined;
638
- stream?: boolean | undefined;
639
- };
640
-
641
- /**
642
- * One server-sent event emitted while the response streams
643
- */
644
- export type CreateResponseData = {
645
- /**
646
- * The type of streaming event
647
- */
648
- type: string;
649
- additionalProperties?: { [k: string]: any } | undefined;
650
- };
651
-
652
- /**
653
- * One server-sent event emitted while the response streams
654
- */
655
- export type CreateResponseRouterResponsesResponseBody = {
656
- /**
657
- * One server-sent event emitted while the response streams
658
- */
659
- data?: CreateResponseData | undefined;
660
- };
661
-
662
- /**
663
- * The object type, which is always "response"
664
- */
665
- export const CreateResponseObject = {
666
- Response: "response",
667
- } as const;
668
- /**
669
- * The object type, which is always "response"
670
- */
671
- export type CreateResponseObject = ClosedEnum<typeof CreateResponseObject>;
672
-
673
- /**
674
- * The status of the response
675
- */
676
- export const CreateResponseStatus = {
677
- Completed: "completed",
678
- Failed: "failed",
679
- InProgress: "in_progress",
680
- Incomplete: "incomplete",
681
- } as const;
682
- /**
683
- * The status of the response
684
- */
685
- export type CreateResponseStatus = ClosedEnum<typeof CreateResponseStatus>;
686
-
687
- /**
688
- * The error that occurred, if any
689
- */
690
- export type ErrorT = {
691
- /**
692
- * The error code
693
- */
694
- code: string;
695
- /**
696
- * The error message
697
- */
698
- message: string;
699
- };
700
-
701
- /**
702
- * The reason the response is incomplete
703
- */
704
- export const Reason = {
705
- MaxOutputTokens: "max_output_tokens",
706
- ContentFilter: "content_filter",
707
- } as const;
708
- /**
709
- * The reason the response is incomplete
710
- */
711
- export type Reason = ClosedEnum<typeof Reason>;
712
-
713
- /**
714
- * Details about why the response is incomplete
715
- */
716
- export type IncompleteDetails = {
717
- /**
718
- * The reason the response is incomplete
719
- */
720
- reason: Reason;
721
- };
722
-
723
- /**
724
- * The status of the function call
725
- */
726
- export const CreateResponseOutputRouterResponsesResponseStatus = {
727
- InProgress: "in_progress",
728
- Completed: "completed",
729
- Incomplete: "incomplete",
730
- Failed: "failed",
731
- } as const;
732
- /**
733
- * The status of the function call
734
- */
735
- export type CreateResponseOutputRouterResponsesResponseStatus = ClosedEnum<
736
- typeof CreateResponseOutputRouterResponsesResponseStatus
737
- >;
738
-
739
- /**
740
- * A function tool call output
741
- */
742
- export type Output4 = {
743
- /**
744
- * The unique identifier for this output item
745
- */
746
- id: string;
747
- /**
748
- * The type of output item
749
- */
750
- type: "function_call";
751
- /**
752
- * The ID of the function call
753
- */
754
- callId: string;
755
- /**
756
- * The name of the function being called
757
- */
758
- name: string;
759
- /**
760
- * The arguments to the function as a JSON string
761
- */
762
- arguments: string;
763
- /**
764
- * The status of the function call
765
- */
766
- status: CreateResponseOutputRouterResponsesResponseStatus;
767
- };
768
-
769
- /**
770
- * The status of the file search
771
- */
772
- export const CreateResponseOutputRouterResponsesStatus = {
773
- InProgress: "in_progress",
774
- Completed: "completed",
775
- Incomplete: "incomplete",
776
- Failed: "failed",
777
- } as const;
778
- /**
779
- * The status of the file search
780
- */
781
- export type CreateResponseOutputRouterResponsesStatus = ClosedEnum<
782
- typeof CreateResponseOutputRouterResponsesStatus
783
- >;
784
-
785
- /**
786
- * A file search tool call output
787
- */
788
- export type Output3 = {
789
- /**
790
- * The unique identifier for this output item
791
- */
792
- id: string;
793
- /**
794
- * The type of output item
795
- */
796
- type: "file_search_call";
797
- /**
798
- * The status of the file search
799
- */
800
- status: CreateResponseOutputRouterResponsesStatus;
801
- /**
802
- * The search queries used
803
- */
804
- queries?: Array<string> | undefined;
805
- /**
806
- * The file search results
807
- */
808
- results?: any | undefined;
809
- };
810
-
811
- /**
812
- * The status of the web search
813
- */
814
- export const CreateResponseOutputStatus = {
815
- InProgress: "in_progress",
816
- Completed: "completed",
817
- Incomplete: "incomplete",
818
- Failed: "failed",
819
- } as const;
820
- /**
821
- * The status of the web search
822
- */
823
- export type CreateResponseOutputStatus = ClosedEnum<
824
- typeof CreateResponseOutputStatus
825
- >;
826
-
827
- /**
828
- * A web search tool call output
829
- */
830
- export type Output2 = {
831
- /**
832
- * The unique identifier for this output item
833
- */
834
- id: string;
835
- /**
836
- * The type of output item
837
- */
838
- type: "web_search_call";
839
- /**
840
- * The status of the web search
841
- */
842
- status: CreateResponseOutputStatus;
843
- };
844
-
845
- /**
846
- * The role of the message author
847
- */
848
- export const OutputRole = {
849
- Assistant: "assistant",
850
- } as const;
851
- /**
852
- * The role of the message author
853
- */
854
- export type OutputRole = ClosedEnum<typeof OutputRole>;
855
-
856
- /**
857
- * The status of the message
858
- */
859
- export const OutputStatus = {
860
- InProgress: "in_progress",
861
- Completed: "completed",
862
- Incomplete: "incomplete",
863
- Failed: "failed",
864
- } as const;
865
- /**
866
- * The status of the message
867
- */
868
- export type OutputStatus = ClosedEnum<typeof OutputStatus>;
869
-
870
- /**
871
- * The type of content part
872
- */
873
- export const ContentType = {
874
- OutputText: "output_text",
875
- } as const;
876
- /**
877
- * The type of content part
878
- */
879
- export type ContentType = ClosedEnum<typeof ContentType>;
880
-
881
- /**
882
- * A citation to a file
883
- */
884
- export type Annotations2 = {
885
- type: "file_citation";
886
- /**
887
- * The index in the text where the citation appears
888
- */
889
- index: number;
890
- /**
891
- * The ID of the file being cited
892
- */
893
- fileId: string;
894
- /**
895
- * The name of the file being cited
896
- */
897
- filename: string;
898
- };
899
-
900
- /**
901
- * A citation to a URL
902
- */
903
- export type Annotations1 = {
904
- type: "url_citation";
905
- /**
906
- * The start index of the citation in the text
907
- */
908
- startIndex: number;
909
- /**
910
- * The end index of the citation in the text
911
- */
912
- endIndex: number;
913
- /**
914
- * The URL being cited
915
- */
916
- url: string;
917
- /**
918
- * The title of the cited resource
919
- */
920
- title: string;
921
- };
922
-
923
- /**
924
- * An annotation in the output text
925
- */
926
- export type ContentAnnotations = Annotations1 | Annotations2;
927
-
928
- /**
929
- * Text output from the model
930
- */
931
- export type Content1 = {
932
- /**
933
- * The type of content part
934
- */
935
- type: ContentType;
936
- /**
937
- * The text content
938
- */
939
- text: string;
940
- /**
941
- * Annotations in the text such as citations
942
- */
943
- annotations?: Array<Annotations1 | Annotations2> | undefined;
944
- /**
945
- * Log probabilities of the output tokens if requested
946
- */
947
- logprobs?: Array<any> | undefined;
948
- };
949
-
950
- export type OutputContent = Content1;
951
-
952
- /**
953
- * An assistant message output
954
- */
955
- export type Output1 = {
956
- /**
957
- * The unique identifier for this message
958
- */
959
- id: string;
960
- /**
961
- * The type of output item
962
- */
963
- type: "message";
964
- /**
965
- * The role of the message author
966
- */
967
- role: OutputRole;
968
- /**
969
- * The status of the message
970
- */
971
- status: OutputStatus;
972
- /**
973
- * The content parts of the message
974
- */
975
- content?: Array<Content1> | undefined;
976
- };
977
-
978
- export type Output = Output1 | Output2 | Output3 | Output4;
979
-
980
- /**
981
- * Breakdown of input token usage
982
- */
983
- export type CreateResponseInputTokensDetails = {
984
- /**
985
- * Number of tokens from cache
986
- */
987
- cachedTokens?: number | undefined;
988
- };
989
-
990
- /**
991
- * Breakdown of output token usage
992
- */
993
- export type OutputTokensDetails = {
994
- /**
995
- * Number of tokens used for reasoning (o3 models)
996
- */
997
- reasoningTokens?: number | undefined;
998
- /**
999
- * Number of tokens generated by automatic prediction that were accepted
1000
- */
1001
- acceptedPredictionTokens?: number | undefined;
1002
- /**
1003
- * Number of tokens generated by automatic prediction that were rejected
1004
- */
1005
- rejectedPredictionTokens?: number | undefined;
1006
- };
1007
-
1008
- /**
1009
- * Usage statistics for the response
1010
- */
1011
- export type CreateResponseUsage = {
1012
- /**
1013
- * Number of tokens in the input
1014
- */
1015
- inputTokens?: number | undefined;
1016
- /**
1017
- * Number of tokens in the generated output
1018
- */
1019
- outputTokens?: number | undefined;
1020
- /**
1021
- * Total number of tokens used in the request (input + output)
1022
- */
1023
- totalTokens?: number | undefined;
1024
- /**
1025
- * Breakdown of input token usage
1026
- */
1027
- inputTokensDetails?: CreateResponseInputTokensDetails | undefined;
1028
- /**
1029
- * Breakdown of output token usage
1030
- */
1031
- outputTokensDetails?: OutputTokensDetails | undefined;
1032
- };
1033
-
1034
- export const CreateResponseToolChoiceRouterResponsesResponseType = {
1035
- Function: "function",
1036
- } as const;
1037
- export type CreateResponseToolChoiceRouterResponsesResponseType = ClosedEnum<
1038
- typeof CreateResponseToolChoiceRouterResponsesResponseType
1039
- >;
1040
-
1041
- export type CreateResponseToolChoiceFunction = {
1042
- name: string;
1043
- };
1044
-
1045
- export type CreateResponseToolChoiceRouterResponses2 = {
1046
- type: CreateResponseToolChoiceRouterResponsesResponseType;
1047
- function: CreateResponseToolChoiceFunction;
1048
- };
1049
-
1050
- export const CreateResponseToolChoiceRouterResponses1 = {
1051
- None: "none",
1052
- Auto: "auto",
1053
- Required: "required",
1054
- } as const;
1055
- export type CreateResponseToolChoiceRouterResponses1 = ClosedEnum<
1056
- typeof CreateResponseToolChoiceRouterResponses1
1057
- >;
1058
-
1059
- /**
1060
- * Controls which (if any) tool is called by the model
1061
- */
1062
- export type CreateResponseRouterResponsesToolChoice =
1063
- | CreateResponseToolChoiceRouterResponses2
1064
- | CreateResponseToolChoiceRouterResponses1;
1065
-
1066
- /**
1067
- * The ranking algorithm
1068
- */
1069
- export const ToolsRanker = {
1070
- Auto: "auto",
1071
- Default20240821: "default_2024_08_21",
1072
- } as const;
1073
- /**
1074
- * The ranking algorithm
1075
- */
1076
- export type ToolsRanker = ClosedEnum<typeof ToolsRanker>;
1077
-
1078
- /**
1079
- * Options for ranking search results
1080
- */
1081
- export type ToolsRankingOptions = {
1082
- /**
1083
- * The ranking algorithm
1084
- */
1085
- ranker: ToolsRanker;
1086
- /**
1087
- * Minimum relevance score
1088
- */
1089
- scoreThreshold: number;
1090
- };
1091
-
1092
- /**
1093
- * Configuration for file search tool
1094
- */
1095
- export type CreateResponseTools3 = {
1096
- /**
1097
- * The type of tool
1098
- */
1099
- type: "file_search";
1100
- /**
1101
- * The vector stores to search
1102
- */
1103
- vectorStoreIds?: Array<string> | undefined;
1104
- /**
1105
- * Maximum number of results to return
1106
- */
1107
- maxNumResults: number;
1108
- /**
1109
- * Filters to apply to the search
1110
- */
1111
- filters?: any | undefined;
1112
- /**
1113
- * Options for ranking search results
1114
- */
1115
- rankingOptions?: ToolsRankingOptions | undefined;
1116
- };
1117
-
1118
- /**
1119
- * Amount of context to retrieve for each search result
1120
- */
1121
- export const ToolsSearchContextSize = {
1122
- Small: "small",
1123
- Medium: "medium",
1124
- Large: "large",
1125
- } as const;
1126
- /**
1127
- * Amount of context to retrieve for each search result
1128
- */
1129
- export type ToolsSearchContextSize = ClosedEnum<typeof ToolsSearchContextSize>;
1130
-
1131
- /**
1132
- * The type of location
1133
- */
1134
- export const CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBodyType =
1135
- {
1136
- Approximate: "approximate",
1137
- Exact: "exact",
1138
- } as const;
1139
- /**
1140
- * The type of location
1141
- */
1142
- export type CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBodyType =
1143
- ClosedEnum<
1144
- typeof CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBodyType
1145
- >;
1146
-
1147
- /**
1148
- * User location for search localization
1149
- */
1150
- export type ToolsUserLocation = {
1151
- /**
1152
- * The type of location
1153
- */
1154
- type?:
1155
- | CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBodyType
1156
- | undefined;
1157
- /**
1158
- * The city name
1159
- */
1160
- city?: string | null | undefined;
1161
- /**
1162
- * The country code
1163
- */
1164
- country?: string | undefined;
1165
- /**
1166
- * The region/state
1167
- */
1168
- region?: string | null | undefined;
1169
- /**
1170
- * The timezone
1171
- */
1172
- timezone?: string | null | undefined;
1173
- };
1174
-
1175
- /**
1176
- * Configuration for web search tool
1177
- */
1178
- export type CreateResponseTools2 = {
1179
- /**
1180
- * The type of tool
1181
- */
1182
- type: "web_search_preview";
1183
- /**
1184
- * List of domains to restrict search to
1185
- */
1186
- domains?: Array<string> | undefined;
1187
- /**
1188
- * Amount of context to retrieve for each search result
1189
- */
1190
- searchContextSize: ToolsSearchContextSize;
1191
- /**
1192
- * User location for search localization
1193
- */
1194
- userLocation?: ToolsUserLocation | undefined;
1195
- };
1196
-
1197
- /**
1198
- * The type of the parameters object
1199
- */
1200
- export const CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBody1Type =
1201
- {
1202
- Object: "object",
1203
- } as const;
1204
- /**
1205
- * The type of the parameters object
1206
- */
1207
- export type CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBody1Type =
1208
- ClosedEnum<
1209
- typeof CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBody1Type
1210
- >;
1211
-
1212
- export type ToolsProperties = {
1213
- type: string;
1214
- description?: string | undefined;
1215
- enum?: Array<string> | undefined;
1216
- additionalProperties?: { [k: string]: any } | undefined;
1217
- };
1218
-
1219
- /**
1220
- * The parameters the function accepts
1221
- */
1222
- export type CreateResponseToolsParameters = {
1223
- /**
1224
- * The type of the parameters object
1225
- */
1226
- type:
1227
- CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBody1Type;
1228
- /**
1229
- * The parameters the function accepts, described as a JSON Schema object
1230
- */
1231
- properties: { [k: string]: ToolsProperties };
1232
- /**
1233
- * List of required parameter names
1234
- */
1235
- required?: Array<string> | undefined;
1236
- /**
1237
- * Whether to allow properties not defined in the schema
1238
- */
1239
- additionalProperties?: boolean | undefined;
1240
- };
1241
-
1242
- /**
1243
- * A function tool definition
1244
- */
1245
- export type CreateResponseTools1 = {
1246
- /**
1247
- * The type of tool
1248
- */
1249
- type: "function";
1250
- /**
1251
- * The name of the function to be called
1252
- */
1253
- name: string;
1254
- /**
1255
- * A description of what the function does
1256
- */
1257
- description?: string | null | undefined;
1258
- /**
1259
- * The parameters the function accepts
1260
- */
1261
- parameters: CreateResponseToolsParameters;
1262
- /**
1263
- * Whether to enable strict schema adherence when generating function calls
1264
- */
1265
- strict: boolean;
1266
- };
1267
-
1268
- export type CreateResponseRouterResponsesTools =
1269
- | CreateResponseTools1
1270
- | CreateResponseTools2
1271
- | CreateResponseTools3;
1272
-
1273
- export type CreateResponseReasoning = {
1274
- effort?: string | null | undefined;
1275
- summary?: string | null | undefined;
1276
- };
1277
-
1278
- export type CreateResponseFormat3 = {
1279
- /**
1280
- * Ensures the response matches a supplied JSON schema
1281
- */
1282
- type: "json_schema";
1283
- /**
1284
- * 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.
1285
- */
1286
- name: string;
1287
- /**
1288
- * A description of what the response format is for, used by the model to determine how to respond in the format.
1289
- */
1290
- description?: string | undefined;
1291
- /**
1292
- * The JSON schema to validate the response against
1293
- */
1294
- schema: { [k: string]: any };
1295
- /**
1296
- * 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`
1297
- */
1298
- strict: boolean;
1299
- };
1300
-
1301
- export type CreateResponseFormat2 = {
1302
- /**
1303
- * Ensures the response is a valid JSON object
1304
- */
1305
- type: "json_object";
1306
- };
1307
-
1308
- export type CreateResponseFormat1 = {
1309
- /**
1310
- * Plain text response format
1311
- */
1312
- type: "text";
1313
- };
1314
-
1315
- export type CreateResponseRouterResponsesFormat =
1316
- | CreateResponseFormat1
1317
- | CreateResponseFormat2
1318
- | CreateResponseFormat3;
1319
-
1320
- export type CreateResponseRouterResponsesText = {
1321
- format: CreateResponseFormat1 | CreateResponseFormat2 | CreateResponseFormat3;
1322
- };
1323
-
1324
- /**
1325
- * Controls how the model handles inputs longer than the maximum token length
1326
- */
1327
- export const Truncation = {
1328
- Auto: "auto",
1329
- Disabled: "disabled",
1330
- } as const;
1331
- /**
1332
- * Controls how the model handles inputs longer than the maximum token length
1333
- */
1334
- export type Truncation = ClosedEnum<typeof Truncation>;
1335
-
1336
- /**
1337
- * The service tier used for processing the request
1338
- */
1339
- export const CreateResponseServiceTier = {
1340
- Auto: "auto",
1341
- Default: "default",
1342
- Flex: "flex",
1343
- Priority: "priority",
1344
- } as const;
1345
- /**
1346
- * The service tier used for processing the request
1347
- */
1348
- export type CreateResponseServiceTier = ClosedEnum<
1349
- typeof CreateResponseServiceTier
1350
- >;
1351
-
1352
- /**
1353
- * Represents the completed model response returned when `stream` is false
1354
- */
1355
- export type CreateResponseResponseBody = {
1356
- /**
1357
- * The unique identifier for the response
1358
- */
1359
- id: string;
1360
- /**
1361
- * The object type, which is always "response"
1362
- */
1363
- object: CreateResponseObject;
1364
- /**
1365
- * The Unix timestamp (in seconds) of when the response was created
1366
- */
1367
- createdAt: number;
1368
- /**
1369
- * The status of the response
1370
- */
1371
- status: CreateResponseStatus;
1372
- /**
1373
- * The error that occurred, if any
1374
- */
1375
- error: ErrorT | null;
1376
- /**
1377
- * Details about why the response is incomplete
1378
- */
1379
- incompleteDetails: IncompleteDetails | null;
1380
- /**
1381
- * The model used to generate the response
1382
- */
1383
- model: string;
1384
- /**
1385
- * The instructions provided for the response
1386
- */
1387
- instructions?: string | null | undefined;
1388
- /**
1389
- * The list of output items generated by the model
1390
- */
1391
- output: Array<Output1 | Output2 | Output3 | Output4>;
1392
- /**
1393
- * A convenience field with the concatenated text from all text content parts
1394
- */
1395
- outputText?: string | null | undefined;
1396
- /**
1397
- * Usage statistics for the response
1398
- */
1399
- usage?: CreateResponseUsage | undefined;
1400
- temperature?: number | null | undefined;
1401
- topP?: number | null | undefined;
1402
- maxOutputTokens?: number | null | undefined;
1403
- parallelToolCalls: boolean;
1404
- previousResponseId?: string | null | undefined;
1405
- metadata?: { [k: string]: string } | undefined;
1406
- /**
1407
- * Controls which (if any) tool is called by the model
1408
- */
1409
- toolChoice?:
1410
- | CreateResponseToolChoiceRouterResponses2
1411
- | CreateResponseToolChoiceRouterResponses1
1412
- | undefined;
1413
- tools?:
1414
- | Array<CreateResponseTools1 | CreateResponseTools2 | CreateResponseTools3>
1415
- | undefined;
1416
- reasoning?: CreateResponseReasoning | null | undefined;
1417
- store?: boolean | undefined;
1418
- text?: CreateResponseRouterResponsesText | undefined;
1419
- /**
1420
- * Controls how the model handles inputs longer than the maximum token length
1421
- */
1422
- truncation: Truncation | null;
1423
- /**
1424
- * A unique identifier representing your end-user
1425
- */
1426
- user?: string | null | undefined;
1427
- /**
1428
- * The service tier used for processing the request
1429
- */
1430
- serviceTier?: CreateResponseServiceTier | null | undefined;
1431
- /**
1432
- * Whether the response was processed in the background
1433
- */
1434
- background?: boolean | null | undefined;
1435
- /**
1436
- * The number of top log probabilities to return for each output token
1437
- */
1438
- topLogprobs?: number | null | undefined;
1439
- /**
1440
- * Whether to return log probabilities of the output tokens
1441
- */
1442
- logprobs?: boolean | null | undefined;
1443
- };
1444
-
1445
- export type CreateResponseResponse =
1446
- | CreateResponseResponseBody
1447
- | EventStream<CreateResponseRouterResponsesResponseBody>;
1448
-
1449
- /** @internal */
1450
- export const Effort$outboundSchema: z.ZodNativeEnum<typeof Effort> = z
1451
- .nativeEnum(Effort);
1452
-
1453
- /** @internal */
1454
- export type Reasoning$Outbound = {
1455
- effort?: string | undefined;
1456
- };
1457
-
1458
- /** @internal */
1459
- export const Reasoning$outboundSchema: z.ZodType<
1460
- Reasoning$Outbound,
1461
- z.ZodTypeDef,
1462
- Reasoning
1463
- > = z.object({
1464
- effort: Effort$outboundSchema.optional(),
1465
- });
1466
-
1467
- export function reasoningToJSON(reasoning: Reasoning): string {
1468
- return JSON.stringify(Reasoning$outboundSchema.parse(reasoning));
1469
- }
1470
-
1471
- /** @internal */
1472
- export type Format3$Outbound = {
1473
- type: "json_schema";
1474
- name: string;
1475
- description?: string | undefined;
1476
- schema: { [k: string]: any };
1477
- strict: boolean;
1478
- };
1479
-
1480
- /** @internal */
1481
- export const Format3$outboundSchema: z.ZodType<
1482
- Format3$Outbound,
1483
- z.ZodTypeDef,
1484
- Format3
1485
- > = z.object({
1486
- type: z.literal("json_schema"),
1487
- name: z.string(),
1488
- description: z.string().optional(),
1489
- schema: z.record(z.any()),
1490
- strict: z.boolean().default(true),
1491
- });
1492
-
1493
- export function format3ToJSON(format3: Format3): string {
1494
- return JSON.stringify(Format3$outboundSchema.parse(format3));
1495
- }
1496
-
1497
- /** @internal */
1498
- export type Format2$Outbound = {
1499
- type: "json_object";
1500
- };
1501
-
1502
- /** @internal */
1503
- export const Format2$outboundSchema: z.ZodType<
1504
- Format2$Outbound,
1505
- z.ZodTypeDef,
1506
- Format2
1507
- > = z.object({
1508
- type: z.literal("json_object"),
1509
- });
1510
-
1511
- export function format2ToJSON(format2: Format2): string {
1512
- return JSON.stringify(Format2$outboundSchema.parse(format2));
1513
- }
1514
-
1515
- /** @internal */
1516
- export type Format1$Outbound = {
1517
- type: "text";
1518
- };
1519
-
1520
- /** @internal */
1521
- export const Format1$outboundSchema: z.ZodType<
1522
- Format1$Outbound,
1523
- z.ZodTypeDef,
1524
- Format1
1525
- > = z.object({
1526
- type: z.literal("text"),
1527
- });
1528
-
1529
- export function format1ToJSON(format1: Format1): string {
1530
- return JSON.stringify(Format1$outboundSchema.parse(format1));
1531
- }
1532
-
1533
- /** @internal */
1534
- export type CreateResponseFormat$Outbound =
1535
- | Format1$Outbound
1536
- | Format2$Outbound
1537
- | Format3$Outbound;
1538
-
1539
- /** @internal */
1540
- export const CreateResponseFormat$outboundSchema: z.ZodType<
1541
- CreateResponseFormat$Outbound,
1542
- z.ZodTypeDef,
1543
- CreateResponseFormat
1544
- > = z.union([
1545
- z.lazy(() => Format1$outboundSchema),
1546
- z.lazy(() => Format2$outboundSchema),
1547
- z.lazy(() => Format3$outboundSchema),
1548
- ]);
1549
-
1550
- export function createResponseFormatToJSON(
1551
- createResponseFormat: CreateResponseFormat,
1552
- ): string {
1553
- return JSON.stringify(
1554
- CreateResponseFormat$outboundSchema.parse(createResponseFormat),
1555
- );
1556
- }
1557
-
1558
- /** @internal */
1559
- export type CreateResponseText$Outbound = {
1560
- format: Format1$Outbound | Format2$Outbound | Format3$Outbound;
1561
- };
1562
-
1563
- /** @internal */
1564
- export const CreateResponseText$outboundSchema: z.ZodType<
1565
- CreateResponseText$Outbound,
1566
- z.ZodTypeDef,
1567
- CreateResponseText
1568
- > = z.object({
1569
- format: z.union([
1570
- z.lazy(() => Format1$outboundSchema),
1571
- z.lazy(() => Format2$outboundSchema),
1572
- z.lazy(() => Format3$outboundSchema),
1573
- ]),
1574
- });
1575
-
1576
- export function createResponseTextToJSON(
1577
- createResponseText: CreateResponseText,
1578
- ): string {
1579
- return JSON.stringify(
1580
- CreateResponseText$outboundSchema.parse(createResponseText),
1581
- );
1582
- }
1583
-
1584
- /** @internal */
1585
- export const CreateResponse2RouterResponsesRequestRequestBodyInputType$outboundSchema:
1586
- z.ZodNativeEnum<
1587
- typeof CreateResponse2RouterResponsesRequestRequestBodyInputType
1588
- > = z.nativeEnum(CreateResponse2RouterResponsesRequestRequestBodyInputType);
1589
-
1590
- /** @internal */
1591
- export type CreateResponse23$Outbound = {
1592
- type: string;
1593
- call_id: string;
1594
- id: string;
1595
- name: string;
1596
- arguments: string;
1597
- status: string;
1598
- };
1599
-
1600
- /** @internal */
1601
- export const CreateResponse23$outboundSchema: z.ZodType<
1602
- CreateResponse23$Outbound,
1603
- z.ZodTypeDef,
1604
- CreateResponse23
1605
- > = z.object({
1606
- type:
1607
- CreateResponse2RouterResponsesRequestRequestBodyInputType$outboundSchema,
1608
- callId: z.string(),
1609
- id: z.string(),
1610
- name: z.string(),
1611
- arguments: z.string(),
1612
- status: z.string(),
1613
- }).transform((v) => {
1614
- return remap$(v, {
1615
- callId: "call_id",
1616
- });
1617
- });
1618
-
1619
- export function createResponse23ToJSON(
1620
- createResponse23: CreateResponse23,
1621
- ): string {
1622
- return JSON.stringify(
1623
- CreateResponse23$outboundSchema.parse(createResponse23),
1624
- );
1625
- }
1626
-
1627
- /** @internal */
1628
- export const CreateResponse2RouterResponsesRequestRequestBodyType$outboundSchema:
1629
- z.ZodNativeEnum<typeof CreateResponse2RouterResponsesRequestRequestBodyType> =
1630
- z.nativeEnum(CreateResponse2RouterResponsesRequestRequestBodyType);
1631
-
1632
- /** @internal */
1633
- export type CreateResponse2RouterResponses2$Outbound = {
1634
- type: string;
1635
- call_id: string;
1636
- output: string;
1637
- };
1638
-
1639
- /** @internal */
1640
- export const CreateResponse2RouterResponses2$outboundSchema: z.ZodType<
1641
- CreateResponse2RouterResponses2$Outbound,
1642
- z.ZodTypeDef,
1643
- CreateResponse2RouterResponses2
1644
- > = z.object({
1645
- type: CreateResponse2RouterResponsesRequestRequestBodyType$outboundSchema,
1646
- callId: z.string(),
1647
- output: z.string(),
1648
- }).transform((v) => {
1649
- return remap$(v, {
1650
- callId: "call_id",
1651
- });
1652
- });
1653
-
1654
- export function createResponse2RouterResponses2ToJSON(
1655
- createResponse2RouterResponses2: CreateResponse2RouterResponses2,
1656
- ): string {
1657
- return JSON.stringify(
1658
- CreateResponse2RouterResponses2$outboundSchema.parse(
1659
- createResponse2RouterResponses2,
1660
- ),
1661
- );
1662
- }
1663
-
1664
- /** @internal */
1665
- export const TwoRole$outboundSchema: z.ZodNativeEnum<typeof TwoRole> = z
1666
- .nativeEnum(TwoRole);
1667
-
1668
- /** @internal */
1669
- export type Two3$Outbound = {
1670
- type: "input_file";
1671
- file_data?: string | undefined;
1672
- file_id?: string | undefined;
1673
- filename?: string | undefined;
1674
- file_url?: string | undefined;
1675
- };
1676
-
1677
- /** @internal */
1678
- export const Two3$outboundSchema: z.ZodType<Two3$Outbound, z.ZodTypeDef, Two3> =
1679
- z.object({
1680
- type: z.literal("input_file"),
1681
- fileData: z.string().optional(),
1682
- fileId: z.string().optional(),
1683
- filename: z.string().optional(),
1684
- fileUrl: z.string().optional(),
1685
- }).transform((v) => {
1686
- return remap$(v, {
1687
- fileData: "file_data",
1688
- fileId: "file_id",
1689
- fileUrl: "file_url",
1690
- });
1691
- });
1692
-
1693
- export function two3ToJSON(two3: Two3): string {
1694
- return JSON.stringify(Two3$outboundSchema.parse(two3));
1695
- }
1696
-
1697
- /** @internal */
1698
- export const Detail$outboundSchema: z.ZodNativeEnum<typeof Detail> = z
1699
- .nativeEnum(Detail);
1700
-
1701
- /** @internal */
1702
- export type CreateResponse22$Outbound = {
1703
- type: "input_image";
1704
- detail: string;
1705
- file_id?: string | null | undefined;
1706
- image_url?: string | null | undefined;
1707
- };
1708
-
1709
- /** @internal */
1710
- export const CreateResponse22$outboundSchema: z.ZodType<
1711
- CreateResponse22$Outbound,
1712
- z.ZodTypeDef,
1713
- CreateResponse22
1714
- > = z.object({
1715
- type: z.literal("input_image"),
1716
- detail: Detail$outboundSchema.default("auto"),
1717
- fileId: z.nullable(z.string()).optional(),
1718
- imageUrl: z.nullable(z.string()).optional(),
1719
- }).transform((v) => {
1720
- return remap$(v, {
1721
- fileId: "file_id",
1722
- imageUrl: "image_url",
1723
- });
1724
- });
1725
-
1726
- export function createResponse22ToJSON(
1727
- createResponse22: CreateResponse22,
1728
- ): string {
1729
- return JSON.stringify(
1730
- CreateResponse22$outboundSchema.parse(createResponse22),
1731
- );
1732
- }
1733
-
1734
- /** @internal */
1735
- export type CreateResponse21$Outbound = {
1736
- type: "input_text";
1737
- text: string;
1738
- };
1739
-
1740
- /** @internal */
1741
- export const CreateResponse21$outboundSchema: z.ZodType<
1742
- CreateResponse21$Outbound,
1743
- z.ZodTypeDef,
1744
- CreateResponse21
1745
- > = z.object({
1746
- type: z.literal("input_text"),
1747
- text: z.string(),
1748
- });
1749
-
1750
- export function createResponse21ToJSON(
1751
- createResponse21: CreateResponse21,
1752
- ): string {
1753
- return JSON.stringify(
1754
- CreateResponse21$outboundSchema.parse(createResponse21),
1755
- );
1756
- }
1757
-
1758
- /** @internal */
1759
- export type CreateResponseContent2$Outbound =
1760
- | CreateResponse21$Outbound
1761
- | CreateResponse22$Outbound
1762
- | Two3$Outbound;
1763
-
1764
- /** @internal */
1765
- export const CreateResponseContent2$outboundSchema: z.ZodType<
1766
- CreateResponseContent2$Outbound,
1767
- z.ZodTypeDef,
1768
- CreateResponseContent2
1769
- > = z.union([
1770
- z.lazy(() => CreateResponse21$outboundSchema),
1771
- z.lazy(() => CreateResponse22$outboundSchema),
1772
- z.lazy(() => Two3$outboundSchema),
1773
- ]);
1774
-
1775
- export function createResponseContent2ToJSON(
1776
- createResponseContent2: CreateResponseContent2,
1777
- ): string {
1778
- return JSON.stringify(
1779
- CreateResponseContent2$outboundSchema.parse(createResponseContent2),
1780
- );
1781
- }
1782
-
1783
- /** @internal */
1784
- export type TwoContent$Outbound =
1785
- | string
1786
- | Array<
1787
- CreateResponse21$Outbound | CreateResponse22$Outbound | Two3$Outbound
1788
- >;
1789
-
1790
- /** @internal */
1791
- export const TwoContent$outboundSchema: z.ZodType<
1792
- TwoContent$Outbound,
1793
- z.ZodTypeDef,
1794
- TwoContent
1795
- > = z.union([
1796
- z.string(),
1797
- z.array(z.union([
1798
- z.lazy(() => CreateResponse21$outboundSchema),
1799
- z.lazy(() => CreateResponse22$outboundSchema),
1800
- z.lazy(() => Two3$outboundSchema),
1801
- ])),
1802
- ]);
1803
-
1804
- export function twoContentToJSON(twoContent: TwoContent): string {
1805
- return JSON.stringify(TwoContent$outboundSchema.parse(twoContent));
1806
- }
1807
-
1808
- /** @internal */
1809
- export type Two1$Outbound = {
1810
- role: string;
1811
- content:
1812
- | string
1813
- | Array<
1814
- CreateResponse21$Outbound | CreateResponse22$Outbound | Two3$Outbound
1815
- >;
1816
- };
1817
-
1818
- /** @internal */
1819
- export const Two1$outboundSchema: z.ZodType<Two1$Outbound, z.ZodTypeDef, Two1> =
1820
- z.object({
1821
- role: TwoRole$outboundSchema,
1822
- content: z.union([
1823
- z.string(),
1824
- z.array(z.union([
1825
- z.lazy(() => CreateResponse21$outboundSchema),
1826
- z.lazy(() => CreateResponse22$outboundSchema),
1827
- z.lazy(() => Two3$outboundSchema),
1828
- ])),
1829
- ]),
1830
- });
1831
-
1832
- export function two1ToJSON(two1: Two1): string {
1833
- return JSON.stringify(Two1$outboundSchema.parse(two1));
1834
- }
1835
-
1836
- /** @internal */
1837
- export type Input2$Outbound =
1838
- | CreateResponse23$Outbound
1839
- | CreateResponse2RouterResponses2$Outbound
1840
- | Two1$Outbound;
1841
-
1842
- /** @internal */
1843
- export const Input2$outboundSchema: z.ZodType<
1844
- Input2$Outbound,
1845
- z.ZodTypeDef,
1846
- Input2
1847
- > = z.union([
1848
- z.lazy(() => CreateResponse23$outboundSchema),
1849
- z.lazy(() => CreateResponse2RouterResponses2$outboundSchema),
1850
- z.lazy(() => Two1$outboundSchema),
1851
- ]);
1852
-
1853
- export function input2ToJSON(input2: Input2): string {
1854
- return JSON.stringify(Input2$outboundSchema.parse(input2));
1855
- }
1856
-
1857
- /** @internal */
1858
- export type CreateResponseInput$Outbound =
1859
- | string
1860
- | Array<
1861
- | CreateResponse23$Outbound
1862
- | CreateResponse2RouterResponses2$Outbound
1863
- | Two1$Outbound
1864
- >;
1865
-
1866
- /** @internal */
1867
- export const CreateResponseInput$outboundSchema: z.ZodType<
1868
- CreateResponseInput$Outbound,
1869
- z.ZodTypeDef,
1870
- CreateResponseInput
1871
- > = z.union([
1872
- z.string(),
1873
- z.array(z.union([
1874
- z.lazy(() => CreateResponse23$outboundSchema),
1875
- z.lazy(() => CreateResponse2RouterResponses2$outboundSchema),
1876
- z.lazy(() => Two1$outboundSchema),
1877
- ])),
1878
- ]);
1879
-
1880
- export function createResponseInputToJSON(
1881
- createResponseInput: CreateResponseInput,
1882
- ): string {
1883
- return JSON.stringify(
1884
- CreateResponseInput$outboundSchema.parse(createResponseInput),
1885
- );
1886
- }
1887
-
1888
- /** @internal */
1889
- export const Include$outboundSchema: z.ZodNativeEnum<typeof Include> = z
1890
- .nativeEnum(Include);
1891
-
1892
- /** @internal */
1893
- export const ServiceTier$outboundSchema: z.ZodNativeEnum<typeof ServiceTier> = z
1894
- .nativeEnum(ServiceTier);
1895
-
1896
- /** @internal */
1897
- export const Ranker$outboundSchema: z.ZodNativeEnum<typeof Ranker> = z
1898
- .nativeEnum(Ranker);
1899
-
1900
- /** @internal */
1901
- export type RankingOptions$Outbound = {
1902
- ranker: string;
1903
- score_threshold: number;
1904
- };
1905
-
1906
- /** @internal */
1907
- export const RankingOptions$outboundSchema: z.ZodType<
1908
- RankingOptions$Outbound,
1909
- z.ZodTypeDef,
1910
- RankingOptions
1911
- > = z.object({
1912
- ranker: Ranker$outboundSchema.default("auto"),
1913
- scoreThreshold: z.number().default(0),
1914
- }).transform((v) => {
1915
- return remap$(v, {
1916
- scoreThreshold: "score_threshold",
1917
- });
1918
- });
1919
-
1920
- export function rankingOptionsToJSON(rankingOptions: RankingOptions): string {
1921
- return JSON.stringify(RankingOptions$outboundSchema.parse(rankingOptions));
1922
- }
1923
-
1924
- /** @internal */
1925
- export type Tools3$Outbound = {
1926
- type: "file_search";
1927
- vector_store_ids?: Array<string> | undefined;
1928
- max_num_results: number;
1929
- filters?: any | undefined;
1930
- ranking_options?: RankingOptions$Outbound | undefined;
1931
- };
1932
-
1933
- /** @internal */
1934
- export const Tools3$outboundSchema: z.ZodType<
1935
- Tools3$Outbound,
1936
- z.ZodTypeDef,
1937
- Tools3
1938
- > = z.object({
1939
- type: z.literal("file_search"),
1940
- vectorStoreIds: z.array(z.string()).optional(),
1941
- maxNumResults: z.number().int().default(20),
1942
- filters: z.any().optional(),
1943
- rankingOptions: z.lazy(() => RankingOptions$outboundSchema).optional(),
1944
- }).transform((v) => {
1945
- return remap$(v, {
1946
- vectorStoreIds: "vector_store_ids",
1947
- maxNumResults: "max_num_results",
1948
- rankingOptions: "ranking_options",
1949
- });
1950
- });
1951
-
1952
- export function tools3ToJSON(tools3: Tools3): string {
1953
- return JSON.stringify(Tools3$outboundSchema.parse(tools3));
1954
- }
1955
-
1956
- /** @internal */
1957
- export const SearchContextSize$outboundSchema: z.ZodNativeEnum<
1958
- typeof SearchContextSize
1959
- > = z.nativeEnum(SearchContextSize);
1960
-
1961
- /** @internal */
1962
- export const CreateResponseToolsRouterResponsesRequestType$outboundSchema:
1963
- z.ZodNativeEnum<typeof CreateResponseToolsRouterResponsesRequestType> = z
1964
- .nativeEnum(CreateResponseToolsRouterResponsesRequestType);
1965
-
1966
- /** @internal */
1967
- export type UserLocation$Outbound = {
1968
- type?: string | undefined;
1969
- city?: string | null | undefined;
1970
- country?: string | undefined;
1971
- region?: string | null | undefined;
1972
- timezone?: string | null | undefined;
1973
- };
1974
-
1975
- /** @internal */
1976
- export const UserLocation$outboundSchema: z.ZodType<
1977
- UserLocation$Outbound,
1978
- z.ZodTypeDef,
1979
- UserLocation
1980
- > = z.object({
1981
- type: CreateResponseToolsRouterResponsesRequestType$outboundSchema.optional(),
1982
- city: z.nullable(z.string()).optional(),
1983
- country: z.string().optional(),
1984
- region: z.nullable(z.string()).optional(),
1985
- timezone: z.nullable(z.string()).optional(),
1986
- });
1987
-
1988
- export function userLocationToJSON(userLocation: UserLocation): string {
1989
- return JSON.stringify(UserLocation$outboundSchema.parse(userLocation));
1990
- }
1991
-
1992
- /** @internal */
1993
- export type Tools2$Outbound = {
1994
- type: "web_search_preview";
1995
- domains?: Array<string> | undefined;
1996
- search_context_size: string;
1997
- user_location?: UserLocation$Outbound | undefined;
1998
- };
1999
-
2000
- /** @internal */
2001
- export const Tools2$outboundSchema: z.ZodType<
2002
- Tools2$Outbound,
2003
- z.ZodTypeDef,
2004
- Tools2
2005
- > = z.object({
2006
- type: z.literal("web_search_preview"),
2007
- domains: z.array(z.string()).optional(),
2008
- searchContextSize: SearchContextSize$outboundSchema.default("medium"),
2009
- userLocation: z.lazy(() => UserLocation$outboundSchema).optional(),
2010
- }).transform((v) => {
2011
- return remap$(v, {
2012
- searchContextSize: "search_context_size",
2013
- userLocation: "user_location",
2014
- });
2015
- });
2016
-
2017
- export function tools2ToJSON(tools2: Tools2): string {
2018
- return JSON.stringify(Tools2$outboundSchema.parse(tools2));
2019
- }
2020
-
2021
- /** @internal */
2022
- export const CreateResponseToolsType$outboundSchema: z.ZodNativeEnum<
2023
- typeof CreateResponseToolsType
2024
- > = z.nativeEnum(CreateResponseToolsType);
2025
-
2026
- /** @internal */
2027
- export type Properties$Outbound = {
2028
- type: string;
2029
- description?: string | undefined;
2030
- enum?: Array<string> | undefined;
2031
- [additionalProperties: string]: unknown;
2032
- };
2033
-
2034
- /** @internal */
2035
- export const Properties$outboundSchema: z.ZodType<
2036
- Properties$Outbound,
2037
- z.ZodTypeDef,
2038
- Properties
2039
- > = z.object({
2040
- type: z.string(),
2041
- description: z.string().optional(),
2042
- enum: z.array(z.string()).optional(),
2043
- additionalProperties: z.record(z.any()).optional(),
2044
- }).transform((v) => {
2045
- return {
2046
- ...v.additionalProperties,
2047
- ...remap$(v, {
2048
- additionalProperties: null,
2049
- }),
2050
- };
2051
- });
2052
-
2053
- export function propertiesToJSON(properties: Properties): string {
2054
- return JSON.stringify(Properties$outboundSchema.parse(properties));
2055
- }
2056
-
2057
- /** @internal */
2058
- export type ToolsParameters$Outbound = {
2059
- type: string;
2060
- properties: { [k: string]: Properties$Outbound };
2061
- required?: Array<string> | undefined;
2062
- additionalProperties?: boolean | undefined;
2063
- };
2064
-
2065
- /** @internal */
2066
- export const ToolsParameters$outboundSchema: z.ZodType<
2067
- ToolsParameters$Outbound,
2068
- z.ZodTypeDef,
2069
- ToolsParameters
2070
- > = z.object({
2071
- type: CreateResponseToolsType$outboundSchema,
2072
- properties: z.record(z.lazy(() => Properties$outboundSchema)),
2073
- required: z.array(z.string()).optional(),
2074
- additionalProperties: z.boolean().optional(),
2075
- });
2076
-
2077
- export function toolsParametersToJSON(
2078
- toolsParameters: ToolsParameters,
2079
- ): string {
2080
- return JSON.stringify(ToolsParameters$outboundSchema.parse(toolsParameters));
2081
- }
2082
-
2083
- /** @internal */
2084
- export type Tools1$Outbound = {
2085
- type: "function";
2086
- name: string;
2087
- description?: string | null | undefined;
2088
- parameters: ToolsParameters$Outbound;
2089
- strict: boolean;
2090
- };
2091
-
2092
- /** @internal */
2093
- export const Tools1$outboundSchema: z.ZodType<
2094
- Tools1$Outbound,
2095
- z.ZodTypeDef,
2096
- Tools1
2097
- > = z.object({
2098
- type: z.literal("function"),
2099
- name: z.string(),
2100
- description: z.nullable(z.string()).optional(),
2101
- parameters: z.lazy(() => ToolsParameters$outboundSchema),
2102
- strict: z.boolean().default(true),
2103
- });
2104
-
2105
- export function tools1ToJSON(tools1: Tools1): string {
2106
- return JSON.stringify(Tools1$outboundSchema.parse(tools1));
2107
- }
2108
-
2109
- /** @internal */
2110
- export type CreateResponseTools$Outbound =
2111
- | Tools1$Outbound
2112
- | Tools2$Outbound
2113
- | Tools3$Outbound;
2114
-
2115
- /** @internal */
2116
- export const CreateResponseTools$outboundSchema: z.ZodType<
2117
- CreateResponseTools$Outbound,
2118
- z.ZodTypeDef,
2119
- CreateResponseTools
2120
- > = z.union([
2121
- z.lazy(() => Tools1$outboundSchema),
2122
- z.lazy(() => Tools2$outboundSchema),
2123
- z.lazy(() => Tools3$outboundSchema),
2124
- ]);
2125
-
2126
- export function createResponseToolsToJSON(
2127
- createResponseTools: CreateResponseTools,
2128
- ): string {
2129
- return JSON.stringify(
2130
- CreateResponseTools$outboundSchema.parse(createResponseTools),
2131
- );
2132
- }
2133
-
2134
- /** @internal */
2135
- export const CreateResponseToolChoiceRouterResponsesRequestType$outboundSchema:
2136
- z.ZodNativeEnum<typeof CreateResponseToolChoiceRouterResponsesRequestType> = z
2137
- .nativeEnum(CreateResponseToolChoiceRouterResponsesRequestType);
2138
-
2139
- /** @internal */
2140
- export type ToolChoice4$Outbound = {
2141
- type: string;
2142
- server_label: string;
2143
- name?: string | null | undefined;
2144
- };
2145
-
2146
- /** @internal */
2147
- export const ToolChoice4$outboundSchema: z.ZodType<
2148
- ToolChoice4$Outbound,
2149
- z.ZodTypeDef,
2150
- ToolChoice4
2151
- > = z.object({
2152
- type: CreateResponseToolChoiceRouterResponsesRequestType$outboundSchema,
2153
- serverLabel: z.string(),
2154
- name: z.nullable(z.string()).optional(),
2155
- }).transform((v) => {
2156
- return remap$(v, {
2157
- serverLabel: "server_label",
2158
- });
2159
- });
2160
-
2161
- export function toolChoice4ToJSON(toolChoice4: ToolChoice4): string {
2162
- return JSON.stringify(ToolChoice4$outboundSchema.parse(toolChoice4));
2163
- }
2164
-
2165
- /** @internal */
2166
- export const CreateResponseToolChoiceRouterResponsesType$outboundSchema:
2167
- z.ZodNativeEnum<typeof CreateResponseToolChoiceRouterResponsesType> = z
2168
- .nativeEnum(CreateResponseToolChoiceRouterResponsesType);
2169
-
2170
- /** @internal */
2171
- export type ToolChoice3$Outbound = {
2172
- type: string;
2173
- name: string;
2174
- };
2175
-
2176
- /** @internal */
2177
- export const ToolChoice3$outboundSchema: z.ZodType<
2178
- ToolChoice3$Outbound,
2179
- z.ZodTypeDef,
2180
- ToolChoice3
2181
- > = z.object({
2182
- type: CreateResponseToolChoiceRouterResponsesType$outboundSchema,
2183
- name: z.string(),
2184
- });
2185
-
2186
- export function toolChoice3ToJSON(toolChoice3: ToolChoice3): string {
2187
- return JSON.stringify(ToolChoice3$outboundSchema.parse(toolChoice3));
2188
- }
2189
-
2190
- /** @internal */
2191
- export const CreateResponseToolChoiceType$outboundSchema: z.ZodNativeEnum<
2192
- typeof CreateResponseToolChoiceType
2193
- > = z.nativeEnum(CreateResponseToolChoiceType);
2194
-
2195
- /** @internal */
2196
- export type CreateResponseToolChoice2$Outbound = {
2197
- type: string;
2198
- };
2199
-
2200
- /** @internal */
2201
- export const CreateResponseToolChoice2$outboundSchema: z.ZodType<
2202
- CreateResponseToolChoice2$Outbound,
2203
- z.ZodTypeDef,
2204
- CreateResponseToolChoice2
2205
- > = z.object({
2206
- type: CreateResponseToolChoiceType$outboundSchema,
2207
- });
2208
-
2209
- export function createResponseToolChoice2ToJSON(
2210
- createResponseToolChoice2: CreateResponseToolChoice2,
2211
- ): string {
2212
- return JSON.stringify(
2213
- CreateResponseToolChoice2$outboundSchema.parse(createResponseToolChoice2),
2214
- );
2215
- }
2216
-
2217
- /** @internal */
2218
- export const CreateResponseToolChoice1$outboundSchema: z.ZodNativeEnum<
2219
- typeof CreateResponseToolChoice1
2220
- > = z.nativeEnum(CreateResponseToolChoice1);
2221
-
2222
- /** @internal */
2223
- export type CreateResponseToolChoice$Outbound =
2224
- | ToolChoice3$Outbound
2225
- | ToolChoice4$Outbound
2226
- | CreateResponseToolChoice2$Outbound
2227
- | string;
2228
-
2229
- /** @internal */
2230
- export const CreateResponseToolChoice$outboundSchema: z.ZodType<
2231
- CreateResponseToolChoice$Outbound,
2232
- z.ZodTypeDef,
2233
- CreateResponseToolChoice
2234
- > = z.union([
2235
- z.lazy(() => ToolChoice3$outboundSchema),
2236
- z.lazy(() => ToolChoice4$outboundSchema),
2237
- z.lazy(() => CreateResponseToolChoice2$outboundSchema),
2238
- CreateResponseToolChoice1$outboundSchema,
2239
- ]);
2240
-
2241
- export function createResponseToolChoiceToJSON(
2242
- createResponseToolChoice: CreateResponseToolChoice,
2243
- ): string {
2244
- return JSON.stringify(
2245
- CreateResponseToolChoice$outboundSchema.parse(createResponseToolChoice),
2246
- );
2247
- }
2248
-
2249
- /** @internal */
2250
- export type CreateResponseRequestBody$Outbound = {
2251
- model: string;
2252
- metadata?: { [k: string]: string } | undefined;
2253
- temperature?: number | null | undefined;
2254
- top_p?: number | null | undefined;
2255
- previous_response_id?: string | null | undefined;
2256
- instructions?: string | null | undefined;
2257
- reasoning?: Reasoning$Outbound | null | undefined;
2258
- max_output_tokens?: number | null | undefined;
2259
- text?: CreateResponseText$Outbound | null | undefined;
2260
- input:
2261
- | string
2262
- | Array<
2263
- | CreateResponse23$Outbound
2264
- | CreateResponse2RouterResponses2$Outbound
2265
- | Two1$Outbound
2266
- >;
2267
- include?: Array<string> | null | undefined;
2268
- parallel_tool_calls?: boolean | null | undefined;
2269
- store: boolean | null;
2270
- service_tier?: string | null | undefined;
2271
- tools?:
2272
- | Array<Tools1$Outbound | Tools2$Outbound | Tools3$Outbound>
2273
- | undefined;
2274
- tool_choice?:
2275
- | ToolChoice3$Outbound
2276
- | ToolChoice4$Outbound
2277
- | CreateResponseToolChoice2$Outbound
2278
- | string
2279
- | undefined;
2280
- stream: boolean;
2281
- };
2282
-
2283
- /** @internal */
2284
- export const CreateResponseRequestBody$outboundSchema: z.ZodType<
2285
- CreateResponseRequestBody$Outbound,
2286
- z.ZodTypeDef,
2287
- CreateResponseRequestBody
2288
- > = z.object({
2289
- model: z.string(),
2290
- metadata: z.record(z.string()).optional(),
2291
- temperature: z.nullable(z.number()).optional(),
2292
- topP: z.nullable(z.number()).optional(),
2293
- previousResponseId: z.nullable(z.string()).optional(),
2294
- instructions: z.nullable(z.string()).optional(),
2295
- reasoning: z.nullable(z.lazy(() => Reasoning$outboundSchema)).optional(),
2296
- maxOutputTokens: z.nullable(z.number().int()).optional(),
2297
- text: z.nullable(z.lazy(() => CreateResponseText$outboundSchema)).optional(),
2298
- input: z.union([
2299
- z.string(),
2300
- z.array(z.union([
2301
- z.lazy(() => CreateResponse23$outboundSchema),
2302
- z.lazy(() => CreateResponse2RouterResponses2$outboundSchema),
2303
- z.lazy(() => Two1$outboundSchema),
2304
- ])),
2305
- ]),
2306
- include: z.nullable(z.array(Include$outboundSchema)).optional(),
2307
- parallelToolCalls: z.nullable(z.boolean()).optional(),
2308
- store: z.nullable(z.boolean().default(true)),
2309
- serviceTier: z.nullable(ServiceTier$outboundSchema).optional(),
2310
- tools: z.array(
2311
- z.union([
2312
- z.lazy(() => Tools1$outboundSchema),
2313
- z.lazy(() => Tools2$outboundSchema),
2314
- z.lazy(() => Tools3$outboundSchema),
2315
- ]),
2316
- ).optional(),
2317
- toolChoice: z.union([
2318
- z.lazy(() => ToolChoice3$outboundSchema),
2319
- z.lazy(() => ToolChoice4$outboundSchema),
2320
- z.lazy(() => CreateResponseToolChoice2$outboundSchema),
2321
- CreateResponseToolChoice1$outboundSchema,
2322
- ]).optional(),
2323
- stream: z.boolean().default(false),
2324
- }).transform((v) => {
2325
- return remap$(v, {
2326
- topP: "top_p",
2327
- previousResponseId: "previous_response_id",
2328
- maxOutputTokens: "max_output_tokens",
2329
- parallelToolCalls: "parallel_tool_calls",
2330
- serviceTier: "service_tier",
2331
- toolChoice: "tool_choice",
2332
- });
2333
- });
2334
-
2335
- export function createResponseRequestBodyToJSON(
2336
- createResponseRequestBody: CreateResponseRequestBody,
2337
- ): string {
2338
- return JSON.stringify(
2339
- CreateResponseRequestBody$outboundSchema.parse(createResponseRequestBody),
2340
- );
2341
- }
2342
-
2343
- /** @internal */
2344
- export const CreateResponseData$inboundSchema: z.ZodType<
2345
- CreateResponseData,
2346
- z.ZodTypeDef,
2347
- unknown
2348
- > = collectExtraKeys$(
2349
- z.object({
2350
- type: z.string(),
2351
- }).catchall(z.any()),
2352
- "additionalProperties",
2353
- true,
2354
- );
2355
-
2356
- export function createResponseDataFromJSON(
2357
- jsonString: string,
2358
- ): SafeParseResult<CreateResponseData, SDKValidationError> {
2359
- return safeParse(
2360
- jsonString,
2361
- (x) => CreateResponseData$inboundSchema.parse(JSON.parse(x)),
2362
- `Failed to parse 'CreateResponseData' from JSON`,
2363
- );
2364
- }
2365
-
2366
- /** @internal */
2367
- export const CreateResponseRouterResponsesResponseBody$inboundSchema: z.ZodType<
2368
- CreateResponseRouterResponsesResponseBody,
2369
- z.ZodTypeDef,
2370
- unknown
2371
- > = z.object({
2372
- data: z.string().optional().transform((v, ctx) => {
2373
- if (v === undefined) return undefined;
2374
- try {
2375
- return JSON.parse(v);
2376
- } catch (err) {
2377
- ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
2378
- return z.NEVER;
2379
- }
2380
- }).pipe(z.lazy(() => CreateResponseData$inboundSchema).optional()),
2381
- });
2382
-
2383
- export function createResponseRouterResponsesResponseBodyFromJSON(
2384
- jsonString: string,
2385
- ): SafeParseResult<
2386
- CreateResponseRouterResponsesResponseBody,
2387
- SDKValidationError
2388
- > {
2389
- return safeParse(
2390
- jsonString,
2391
- (x) =>
2392
- CreateResponseRouterResponsesResponseBody$inboundSchema.parse(
2393
- JSON.parse(x),
2394
- ),
2395
- `Failed to parse 'CreateResponseRouterResponsesResponseBody' from JSON`,
2396
- );
2397
- }
2398
-
2399
- /** @internal */
2400
- export const CreateResponseObject$inboundSchema: z.ZodNativeEnum<
2401
- typeof CreateResponseObject
2402
- > = z.nativeEnum(CreateResponseObject);
2403
-
2404
- /** @internal */
2405
- export const CreateResponseStatus$inboundSchema: z.ZodNativeEnum<
2406
- typeof CreateResponseStatus
2407
- > = z.nativeEnum(CreateResponseStatus);
2408
-
2409
- /** @internal */
2410
- export const ErrorT$inboundSchema: z.ZodType<ErrorT, z.ZodTypeDef, unknown> = z
2411
- .object({
2412
- code: z.string(),
2413
- message: z.string(),
2414
- });
2415
-
2416
- export function errorFromJSON(
2417
- jsonString: string,
2418
- ): SafeParseResult<ErrorT, SDKValidationError> {
2419
- return safeParse(
2420
- jsonString,
2421
- (x) => ErrorT$inboundSchema.parse(JSON.parse(x)),
2422
- `Failed to parse 'ErrorT' from JSON`,
2423
- );
2424
- }
2425
-
2426
- /** @internal */
2427
- export const Reason$inboundSchema: z.ZodNativeEnum<typeof Reason> = z
2428
- .nativeEnum(Reason);
2429
-
2430
- /** @internal */
2431
- export const IncompleteDetails$inboundSchema: z.ZodType<
2432
- IncompleteDetails,
2433
- z.ZodTypeDef,
2434
- unknown
2435
- > = z.object({
2436
- reason: Reason$inboundSchema,
2437
- });
2438
-
2439
- export function incompleteDetailsFromJSON(
2440
- jsonString: string,
2441
- ): SafeParseResult<IncompleteDetails, SDKValidationError> {
2442
- return safeParse(
2443
- jsonString,
2444
- (x) => IncompleteDetails$inboundSchema.parse(JSON.parse(x)),
2445
- `Failed to parse 'IncompleteDetails' from JSON`,
2446
- );
2447
- }
2448
-
2449
- /** @internal */
2450
- export const CreateResponseOutputRouterResponsesResponseStatus$inboundSchema:
2451
- z.ZodNativeEnum<typeof CreateResponseOutputRouterResponsesResponseStatus> = z
2452
- .nativeEnum(CreateResponseOutputRouterResponsesResponseStatus);
2453
-
2454
- /** @internal */
2455
- export const Output4$inboundSchema: z.ZodType<Output4, z.ZodTypeDef, unknown> =
2456
- z.object({
2457
- id: z.string(),
2458
- type: z.literal("function_call"),
2459
- call_id: z.string(),
2460
- name: z.string(),
2461
- arguments: z.string(),
2462
- status: CreateResponseOutputRouterResponsesResponseStatus$inboundSchema,
2463
- }).transform((v) => {
2464
- return remap$(v, {
2465
- "call_id": "callId",
2466
- });
2467
- });
2468
-
2469
- export function output4FromJSON(
2470
- jsonString: string,
2471
- ): SafeParseResult<Output4, SDKValidationError> {
2472
- return safeParse(
2473
- jsonString,
2474
- (x) => Output4$inboundSchema.parse(JSON.parse(x)),
2475
- `Failed to parse 'Output4' from JSON`,
2476
- );
2477
- }
2478
-
2479
- /** @internal */
2480
- export const CreateResponseOutputRouterResponsesStatus$inboundSchema:
2481
- z.ZodNativeEnum<typeof CreateResponseOutputRouterResponsesStatus> = z
2482
- .nativeEnum(CreateResponseOutputRouterResponsesStatus);
2483
-
2484
- /** @internal */
2485
- export const Output3$inboundSchema: z.ZodType<Output3, z.ZodTypeDef, unknown> =
2486
- z.object({
2487
- id: z.string(),
2488
- type: z.literal("file_search_call"),
2489
- status: CreateResponseOutputRouterResponsesStatus$inboundSchema,
2490
- queries: z.array(z.string()).optional(),
2491
- results: z.any().optional(),
2492
- });
2493
-
2494
- export function output3FromJSON(
2495
- jsonString: string,
2496
- ): SafeParseResult<Output3, SDKValidationError> {
2497
- return safeParse(
2498
- jsonString,
2499
- (x) => Output3$inboundSchema.parse(JSON.parse(x)),
2500
- `Failed to parse 'Output3' from JSON`,
2501
- );
2502
- }
2503
-
2504
- /** @internal */
2505
- export const CreateResponseOutputStatus$inboundSchema: z.ZodNativeEnum<
2506
- typeof CreateResponseOutputStatus
2507
- > = z.nativeEnum(CreateResponseOutputStatus);
2508
-
2509
- /** @internal */
2510
- export const Output2$inboundSchema: z.ZodType<Output2, z.ZodTypeDef, unknown> =
2511
- z.object({
2512
- id: z.string(),
2513
- type: z.literal("web_search_call"),
2514
- status: CreateResponseOutputStatus$inboundSchema,
2515
- });
2516
-
2517
- export function output2FromJSON(
2518
- jsonString: string,
2519
- ): SafeParseResult<Output2, SDKValidationError> {
2520
- return safeParse(
2521
- jsonString,
2522
- (x) => Output2$inboundSchema.parse(JSON.parse(x)),
2523
- `Failed to parse 'Output2' from JSON`,
2524
- );
2525
- }
2526
-
2527
- /** @internal */
2528
- export const OutputRole$inboundSchema: z.ZodNativeEnum<typeof OutputRole> = z
2529
- .nativeEnum(OutputRole);
2530
-
2531
- /** @internal */
2532
- export const OutputStatus$inboundSchema: z.ZodNativeEnum<typeof OutputStatus> =
2533
- z.nativeEnum(OutputStatus);
2534
-
2535
- /** @internal */
2536
- export const ContentType$inboundSchema: z.ZodNativeEnum<typeof ContentType> = z
2537
- .nativeEnum(ContentType);
2538
-
2539
- /** @internal */
2540
- export const Annotations2$inboundSchema: z.ZodType<
2541
- Annotations2,
2542
- z.ZodTypeDef,
2543
- unknown
2544
- > = z.object({
2545
- type: z.literal("file_citation"),
2546
- index: z.number(),
2547
- file_id: z.string(),
2548
- filename: z.string(),
2549
- }).transform((v) => {
2550
- return remap$(v, {
2551
- "file_id": "fileId",
2552
- });
2553
- });
2554
-
2555
- export function annotations2FromJSON(
2556
- jsonString: string,
2557
- ): SafeParseResult<Annotations2, SDKValidationError> {
2558
- return safeParse(
2559
- jsonString,
2560
- (x) => Annotations2$inboundSchema.parse(JSON.parse(x)),
2561
- `Failed to parse 'Annotations2' from JSON`,
2562
- );
2563
- }
2564
-
2565
- /** @internal */
2566
- export const Annotations1$inboundSchema: z.ZodType<
2567
- Annotations1,
2568
- z.ZodTypeDef,
2569
- unknown
2570
- > = z.object({
2571
- type: z.literal("url_citation"),
2572
- start_index: z.number(),
2573
- end_index: z.number(),
2574
- url: z.string(),
2575
- title: z.string(),
2576
- }).transform((v) => {
2577
- return remap$(v, {
2578
- "start_index": "startIndex",
2579
- "end_index": "endIndex",
2580
- });
2581
- });
2582
-
2583
- export function annotations1FromJSON(
2584
- jsonString: string,
2585
- ): SafeParseResult<Annotations1, SDKValidationError> {
2586
- return safeParse(
2587
- jsonString,
2588
- (x) => Annotations1$inboundSchema.parse(JSON.parse(x)),
2589
- `Failed to parse 'Annotations1' from JSON`,
2590
- );
2591
- }
2592
-
2593
- /** @internal */
2594
- export const ContentAnnotations$inboundSchema: z.ZodType<
2595
- ContentAnnotations,
2596
- z.ZodTypeDef,
2597
- unknown
2598
- > = z.union([
2599
- z.lazy(() => Annotations1$inboundSchema),
2600
- z.lazy(() => Annotations2$inboundSchema),
2601
- ]);
2602
-
2603
- export function contentAnnotationsFromJSON(
2604
- jsonString: string,
2605
- ): SafeParseResult<ContentAnnotations, SDKValidationError> {
2606
- return safeParse(
2607
- jsonString,
2608
- (x) => ContentAnnotations$inboundSchema.parse(JSON.parse(x)),
2609
- `Failed to parse 'ContentAnnotations' from JSON`,
2610
- );
2611
- }
2612
-
2613
- /** @internal */
2614
- export const Content1$inboundSchema: z.ZodType<
2615
- Content1,
2616
- z.ZodTypeDef,
2617
- unknown
2618
- > = z.object({
2619
- type: ContentType$inboundSchema,
2620
- text: z.string(),
2621
- annotations: z.array(
2622
- z.union([
2623
- z.lazy(() => Annotations1$inboundSchema),
2624
- z.lazy(() => Annotations2$inboundSchema),
2625
- ]),
2626
- ).optional(),
2627
- logprobs: z.array(z.any()).optional(),
2628
- });
2629
-
2630
- export function content1FromJSON(
2631
- jsonString: string,
2632
- ): SafeParseResult<Content1, SDKValidationError> {
2633
- return safeParse(
2634
- jsonString,
2635
- (x) => Content1$inboundSchema.parse(JSON.parse(x)),
2636
- `Failed to parse 'Content1' from JSON`,
2637
- );
2638
- }
2639
-
2640
- /** @internal */
2641
- export const OutputContent$inboundSchema: z.ZodType<
2642
- OutputContent,
2643
- z.ZodTypeDef,
2644
- unknown
2645
- > = z.lazy(() => Content1$inboundSchema);
2646
-
2647
- export function outputContentFromJSON(
2648
- jsonString: string,
2649
- ): SafeParseResult<OutputContent, SDKValidationError> {
2650
- return safeParse(
2651
- jsonString,
2652
- (x) => OutputContent$inboundSchema.parse(JSON.parse(x)),
2653
- `Failed to parse 'OutputContent' from JSON`,
2654
- );
2655
- }
2656
-
2657
- /** @internal */
2658
- export const Output1$inboundSchema: z.ZodType<Output1, z.ZodTypeDef, unknown> =
2659
- z.object({
2660
- id: z.string(),
2661
- type: z.literal("message"),
2662
- role: OutputRole$inboundSchema,
2663
- status: OutputStatus$inboundSchema,
2664
- content: z.array(z.lazy(() => Content1$inboundSchema)).optional(),
2665
- });
2666
-
2667
- export function output1FromJSON(
2668
- jsonString: string,
2669
- ): SafeParseResult<Output1, SDKValidationError> {
2670
- return safeParse(
2671
- jsonString,
2672
- (x) => Output1$inboundSchema.parse(JSON.parse(x)),
2673
- `Failed to parse 'Output1' from JSON`,
2674
- );
2675
- }
2676
-
2677
- /** @internal */
2678
- export const Output$inboundSchema: z.ZodType<Output, z.ZodTypeDef, unknown> = z
2679
- .union([
2680
- z.lazy(() => Output1$inboundSchema),
2681
- z.lazy(() => Output2$inboundSchema),
2682
- z.lazy(() => Output3$inboundSchema),
2683
- z.lazy(() => Output4$inboundSchema),
2684
- ]);
2685
-
2686
- export function outputFromJSON(
2687
- jsonString: string,
2688
- ): SafeParseResult<Output, SDKValidationError> {
2689
- return safeParse(
2690
- jsonString,
2691
- (x) => Output$inboundSchema.parse(JSON.parse(x)),
2692
- `Failed to parse 'Output' from JSON`,
2693
- );
2694
- }
2695
-
2696
- /** @internal */
2697
- export const CreateResponseInputTokensDetails$inboundSchema: z.ZodType<
2698
- CreateResponseInputTokensDetails,
2699
- z.ZodTypeDef,
2700
- unknown
2701
- > = z.object({
2702
- cached_tokens: z.number().int().optional(),
2703
- }).transform((v) => {
2704
- return remap$(v, {
2705
- "cached_tokens": "cachedTokens",
2706
- });
2707
- });
2708
-
2709
- export function createResponseInputTokensDetailsFromJSON(
2710
- jsonString: string,
2711
- ): SafeParseResult<CreateResponseInputTokensDetails, SDKValidationError> {
2712
- return safeParse(
2713
- jsonString,
2714
- (x) => CreateResponseInputTokensDetails$inboundSchema.parse(JSON.parse(x)),
2715
- `Failed to parse 'CreateResponseInputTokensDetails' from JSON`,
2716
- );
2717
- }
2718
-
2719
- /** @internal */
2720
- export const OutputTokensDetails$inboundSchema: z.ZodType<
2721
- OutputTokensDetails,
2722
- z.ZodTypeDef,
2723
- unknown
2724
- > = z.object({
2725
- reasoning_tokens: z.number().int().optional(),
2726
- accepted_prediction_tokens: z.number().int().optional(),
2727
- rejected_prediction_tokens: z.number().int().optional(),
2728
- }).transform((v) => {
2729
- return remap$(v, {
2730
- "reasoning_tokens": "reasoningTokens",
2731
- "accepted_prediction_tokens": "acceptedPredictionTokens",
2732
- "rejected_prediction_tokens": "rejectedPredictionTokens",
2733
- });
2734
- });
2735
-
2736
- export function outputTokensDetailsFromJSON(
2737
- jsonString: string,
2738
- ): SafeParseResult<OutputTokensDetails, SDKValidationError> {
2739
- return safeParse(
2740
- jsonString,
2741
- (x) => OutputTokensDetails$inboundSchema.parse(JSON.parse(x)),
2742
- `Failed to parse 'OutputTokensDetails' from JSON`,
2743
- );
2744
- }
2745
-
2746
- /** @internal */
2747
- export const CreateResponseUsage$inboundSchema: z.ZodType<
2748
- CreateResponseUsage,
2749
- z.ZodTypeDef,
2750
- unknown
2751
- > = z.object({
2752
- input_tokens: z.number().optional(),
2753
- output_tokens: z.number().optional(),
2754
- total_tokens: z.number().optional(),
2755
- input_tokens_details: z.lazy(() =>
2756
- CreateResponseInputTokensDetails$inboundSchema
2757
- ).optional(),
2758
- output_tokens_details: z.lazy(() => OutputTokensDetails$inboundSchema)
2759
- .optional(),
2760
- }).transform((v) => {
2761
- return remap$(v, {
2762
- "input_tokens": "inputTokens",
2763
- "output_tokens": "outputTokens",
2764
- "total_tokens": "totalTokens",
2765
- "input_tokens_details": "inputTokensDetails",
2766
- "output_tokens_details": "outputTokensDetails",
2767
- });
2768
- });
2769
-
2770
- export function createResponseUsageFromJSON(
2771
- jsonString: string,
2772
- ): SafeParseResult<CreateResponseUsage, SDKValidationError> {
2773
- return safeParse(
2774
- jsonString,
2775
- (x) => CreateResponseUsage$inboundSchema.parse(JSON.parse(x)),
2776
- `Failed to parse 'CreateResponseUsage' from JSON`,
2777
- );
2778
- }
2779
-
2780
- /** @internal */
2781
- export const CreateResponseToolChoiceRouterResponsesResponseType$inboundSchema:
2782
- z.ZodNativeEnum<typeof CreateResponseToolChoiceRouterResponsesResponseType> =
2783
- z.nativeEnum(CreateResponseToolChoiceRouterResponsesResponseType);
2784
-
2785
- /** @internal */
2786
- export const CreateResponseToolChoiceFunction$inboundSchema: z.ZodType<
2787
- CreateResponseToolChoiceFunction,
2788
- z.ZodTypeDef,
2789
- unknown
2790
- > = z.object({
2791
- name: z.string(),
2792
- });
2793
-
2794
- export function createResponseToolChoiceFunctionFromJSON(
2795
- jsonString: string,
2796
- ): SafeParseResult<CreateResponseToolChoiceFunction, SDKValidationError> {
2797
- return safeParse(
2798
- jsonString,
2799
- (x) => CreateResponseToolChoiceFunction$inboundSchema.parse(JSON.parse(x)),
2800
- `Failed to parse 'CreateResponseToolChoiceFunction' from JSON`,
2801
- );
2802
- }
2803
-
2804
- /** @internal */
2805
- export const CreateResponseToolChoiceRouterResponses2$inboundSchema: z.ZodType<
2806
- CreateResponseToolChoiceRouterResponses2,
2807
- z.ZodTypeDef,
2808
- unknown
2809
- > = z.object({
2810
- type: CreateResponseToolChoiceRouterResponsesResponseType$inboundSchema,
2811
- function: z.lazy(() => CreateResponseToolChoiceFunction$inboundSchema),
2812
- });
2813
-
2814
- export function createResponseToolChoiceRouterResponses2FromJSON(
2815
- jsonString: string,
2816
- ): SafeParseResult<
2817
- CreateResponseToolChoiceRouterResponses2,
2818
- SDKValidationError
2819
- > {
2820
- return safeParse(
2821
- jsonString,
2822
- (x) =>
2823
- CreateResponseToolChoiceRouterResponses2$inboundSchema.parse(
2824
- JSON.parse(x),
2825
- ),
2826
- `Failed to parse 'CreateResponseToolChoiceRouterResponses2' from JSON`,
2827
- );
2828
- }
2829
-
2830
- /** @internal */
2831
- export const CreateResponseToolChoiceRouterResponses1$inboundSchema:
2832
- z.ZodNativeEnum<typeof CreateResponseToolChoiceRouterResponses1> = z
2833
- .nativeEnum(CreateResponseToolChoiceRouterResponses1);
2834
-
2835
- /** @internal */
2836
- export const CreateResponseRouterResponsesToolChoice$inboundSchema: z.ZodType<
2837
- CreateResponseRouterResponsesToolChoice,
2838
- z.ZodTypeDef,
2839
- unknown
2840
- > = z.union([
2841
- z.lazy(() => CreateResponseToolChoiceRouterResponses2$inboundSchema),
2842
- CreateResponseToolChoiceRouterResponses1$inboundSchema,
2843
- ]);
2844
-
2845
- export function createResponseRouterResponsesToolChoiceFromJSON(
2846
- jsonString: string,
2847
- ): SafeParseResult<
2848
- CreateResponseRouterResponsesToolChoice,
2849
- SDKValidationError
2850
- > {
2851
- return safeParse(
2852
- jsonString,
2853
- (x) =>
2854
- CreateResponseRouterResponsesToolChoice$inboundSchema.parse(
2855
- JSON.parse(x),
2856
- ),
2857
- `Failed to parse 'CreateResponseRouterResponsesToolChoice' from JSON`,
2858
- );
2859
- }
2860
-
2861
- /** @internal */
2862
- export const ToolsRanker$inboundSchema: z.ZodNativeEnum<typeof ToolsRanker> = z
2863
- .nativeEnum(ToolsRanker);
2864
-
2865
- /** @internal */
2866
- export const ToolsRankingOptions$inboundSchema: z.ZodType<
2867
- ToolsRankingOptions,
2868
- z.ZodTypeDef,
2869
- unknown
2870
- > = z.object({
2871
- ranker: ToolsRanker$inboundSchema.default("auto"),
2872
- score_threshold: z.number().default(0),
2873
- }).transform((v) => {
2874
- return remap$(v, {
2875
- "score_threshold": "scoreThreshold",
2876
- });
2877
- });
2878
-
2879
- export function toolsRankingOptionsFromJSON(
2880
- jsonString: string,
2881
- ): SafeParseResult<ToolsRankingOptions, SDKValidationError> {
2882
- return safeParse(
2883
- jsonString,
2884
- (x) => ToolsRankingOptions$inboundSchema.parse(JSON.parse(x)),
2885
- `Failed to parse 'ToolsRankingOptions' from JSON`,
2886
- );
2887
- }
2888
-
2889
- /** @internal */
2890
- export const CreateResponseTools3$inboundSchema: z.ZodType<
2891
- CreateResponseTools3,
2892
- z.ZodTypeDef,
2893
- unknown
2894
- > = z.object({
2895
- type: z.literal("file_search"),
2896
- vector_store_ids: z.array(z.string()).optional(),
2897
- max_num_results: z.number().int().default(20),
2898
- filters: z.any().optional(),
2899
- ranking_options: z.lazy(() => ToolsRankingOptions$inboundSchema).optional(),
2900
- }).transform((v) => {
2901
- return remap$(v, {
2902
- "vector_store_ids": "vectorStoreIds",
2903
- "max_num_results": "maxNumResults",
2904
- "ranking_options": "rankingOptions",
2905
- });
2906
- });
2907
-
2908
- export function createResponseTools3FromJSON(
2909
- jsonString: string,
2910
- ): SafeParseResult<CreateResponseTools3, SDKValidationError> {
2911
- return safeParse(
2912
- jsonString,
2913
- (x) => CreateResponseTools3$inboundSchema.parse(JSON.parse(x)),
2914
- `Failed to parse 'CreateResponseTools3' from JSON`,
2915
- );
2916
- }
2917
-
2918
- /** @internal */
2919
- export const ToolsSearchContextSize$inboundSchema: z.ZodNativeEnum<
2920
- typeof ToolsSearchContextSize
2921
- > = z.nativeEnum(ToolsSearchContextSize);
2922
-
2923
- /** @internal */
2924
- export const CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBodyType$inboundSchema:
2925
- z.ZodNativeEnum<
2926
- typeof CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBodyType
2927
- > = z.nativeEnum(
2928
- CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBodyType,
2929
- );
2930
-
2931
- /** @internal */
2932
- export const ToolsUserLocation$inboundSchema: z.ZodType<
2933
- ToolsUserLocation,
2934
- z.ZodTypeDef,
2935
- unknown
2936
- > = z.object({
2937
- type:
2938
- CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBodyType$inboundSchema
2939
- .optional(),
2940
- city: z.nullable(z.string()).optional(),
2941
- country: z.string().optional(),
2942
- region: z.nullable(z.string()).optional(),
2943
- timezone: z.nullable(z.string()).optional(),
2944
- });
2945
-
2946
- export function toolsUserLocationFromJSON(
2947
- jsonString: string,
2948
- ): SafeParseResult<ToolsUserLocation, SDKValidationError> {
2949
- return safeParse(
2950
- jsonString,
2951
- (x) => ToolsUserLocation$inboundSchema.parse(JSON.parse(x)),
2952
- `Failed to parse 'ToolsUserLocation' from JSON`,
2953
- );
2954
- }
2955
-
2956
- /** @internal */
2957
- export const CreateResponseTools2$inboundSchema: z.ZodType<
2958
- CreateResponseTools2,
2959
- z.ZodTypeDef,
2960
- unknown
2961
- > = z.object({
2962
- type: z.literal("web_search_preview"),
2963
- domains: z.array(z.string()).optional(),
2964
- search_context_size: ToolsSearchContextSize$inboundSchema.default("medium"),
2965
- user_location: z.lazy(() => ToolsUserLocation$inboundSchema).optional(),
2966
- }).transform((v) => {
2967
- return remap$(v, {
2968
- "search_context_size": "searchContextSize",
2969
- "user_location": "userLocation",
2970
- });
2971
- });
2972
-
2973
- export function createResponseTools2FromJSON(
2974
- jsonString: string,
2975
- ): SafeParseResult<CreateResponseTools2, SDKValidationError> {
2976
- return safeParse(
2977
- jsonString,
2978
- (x) => CreateResponseTools2$inboundSchema.parse(JSON.parse(x)),
2979
- `Failed to parse 'CreateResponseTools2' from JSON`,
2980
- );
2981
- }
2982
-
2983
- /** @internal */
2984
- export const CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBody1Type$inboundSchema:
2985
- z.ZodNativeEnum<
2986
- typeof CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBody1Type
2987
- > = z.nativeEnum(
2988
- CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBody1Type,
2989
- );
2990
-
2991
- /** @internal */
2992
- export const ToolsProperties$inboundSchema: z.ZodType<
2993
- ToolsProperties,
2994
- z.ZodTypeDef,
2995
- unknown
2996
- > = collectExtraKeys$(
2997
- z.object({
2998
- type: z.string(),
2999
- description: z.string().optional(),
3000
- enum: z.array(z.string()).optional(),
3001
- }).catchall(z.any()),
3002
- "additionalProperties",
3003
- true,
3004
- );
3005
-
3006
- export function toolsPropertiesFromJSON(
3007
- jsonString: string,
3008
- ): SafeParseResult<ToolsProperties, SDKValidationError> {
3009
- return safeParse(
3010
- jsonString,
3011
- (x) => ToolsProperties$inboundSchema.parse(JSON.parse(x)),
3012
- `Failed to parse 'ToolsProperties' from JSON`,
3013
- );
3014
- }
3015
-
3016
- /** @internal */
3017
- export const CreateResponseToolsParameters$inboundSchema: z.ZodType<
3018
- CreateResponseToolsParameters,
3019
- z.ZodTypeDef,
3020
- unknown
3021
- > = z.object({
3022
- type:
3023
- CreateResponseToolsRouterResponsesResponse200ApplicationJSONResponseBody1Type$inboundSchema,
3024
- properties: z.record(z.lazy(() => ToolsProperties$inboundSchema)),
3025
- required: z.array(z.string()).optional(),
3026
- additionalProperties: z.boolean().optional(),
3027
- });
3028
-
3029
- export function createResponseToolsParametersFromJSON(
3030
- jsonString: string,
3031
- ): SafeParseResult<CreateResponseToolsParameters, SDKValidationError> {
3032
- return safeParse(
3033
- jsonString,
3034
- (x) => CreateResponseToolsParameters$inboundSchema.parse(JSON.parse(x)),
3035
- `Failed to parse 'CreateResponseToolsParameters' from JSON`,
3036
- );
3037
- }
3038
-
3039
- /** @internal */
3040
- export const CreateResponseTools1$inboundSchema: z.ZodType<
3041
- CreateResponseTools1,
3042
- z.ZodTypeDef,
3043
- unknown
3044
- > = z.object({
3045
- type: z.literal("function"),
3046
- name: z.string(),
3047
- description: z.nullable(z.string()).optional(),
3048
- parameters: z.lazy(() => CreateResponseToolsParameters$inboundSchema),
3049
- strict: z.boolean().default(true),
3050
- });
3051
-
3052
- export function createResponseTools1FromJSON(
3053
- jsonString: string,
3054
- ): SafeParseResult<CreateResponseTools1, SDKValidationError> {
3055
- return safeParse(
3056
- jsonString,
3057
- (x) => CreateResponseTools1$inboundSchema.parse(JSON.parse(x)),
3058
- `Failed to parse 'CreateResponseTools1' from JSON`,
3059
- );
3060
- }
3061
-
3062
- /** @internal */
3063
- export const CreateResponseRouterResponsesTools$inboundSchema: z.ZodType<
3064
- CreateResponseRouterResponsesTools,
3065
- z.ZodTypeDef,
3066
- unknown
3067
- > = z.union([
3068
- z.lazy(() => CreateResponseTools1$inboundSchema),
3069
- z.lazy(() => CreateResponseTools2$inboundSchema),
3070
- z.lazy(() => CreateResponseTools3$inboundSchema),
3071
- ]);
3072
-
3073
- export function createResponseRouterResponsesToolsFromJSON(
3074
- jsonString: string,
3075
- ): SafeParseResult<CreateResponseRouterResponsesTools, SDKValidationError> {
3076
- return safeParse(
3077
- jsonString,
3078
- (x) =>
3079
- CreateResponseRouterResponsesTools$inboundSchema.parse(JSON.parse(x)),
3080
- `Failed to parse 'CreateResponseRouterResponsesTools' from JSON`,
3081
- );
3082
- }
3083
-
3084
- /** @internal */
3085
- export const CreateResponseReasoning$inboundSchema: z.ZodType<
3086
- CreateResponseReasoning,
3087
- z.ZodTypeDef,
3088
- unknown
3089
- > = z.object({
3090
- effort: z.nullable(z.string()).optional(),
3091
- summary: z.nullable(z.string()).optional(),
3092
- });
3093
-
3094
- export function createResponseReasoningFromJSON(
3095
- jsonString: string,
3096
- ): SafeParseResult<CreateResponseReasoning, SDKValidationError> {
3097
- return safeParse(
3098
- jsonString,
3099
- (x) => CreateResponseReasoning$inboundSchema.parse(JSON.parse(x)),
3100
- `Failed to parse 'CreateResponseReasoning' from JSON`,
3101
- );
3102
- }
3103
-
3104
- /** @internal */
3105
- export const CreateResponseFormat3$inboundSchema: z.ZodType<
3106
- CreateResponseFormat3,
3107
- z.ZodTypeDef,
3108
- unknown
3109
- > = z.object({
3110
- type: z.literal("json_schema"),
3111
- name: z.string(),
3112
- description: z.string().optional(),
3113
- schema: z.record(z.any()),
3114
- strict: z.boolean().default(true),
3115
- });
3116
-
3117
- export function createResponseFormat3FromJSON(
3118
- jsonString: string,
3119
- ): SafeParseResult<CreateResponseFormat3, SDKValidationError> {
3120
- return safeParse(
3121
- jsonString,
3122
- (x) => CreateResponseFormat3$inboundSchema.parse(JSON.parse(x)),
3123
- `Failed to parse 'CreateResponseFormat3' from JSON`,
3124
- );
3125
- }
3126
-
3127
- /** @internal */
3128
- export const CreateResponseFormat2$inboundSchema: z.ZodType<
3129
- CreateResponseFormat2,
3130
- z.ZodTypeDef,
3131
- unknown
3132
- > = z.object({
3133
- type: z.literal("json_object"),
3134
- });
3135
-
3136
- export function createResponseFormat2FromJSON(
3137
- jsonString: string,
3138
- ): SafeParseResult<CreateResponseFormat2, SDKValidationError> {
3139
- return safeParse(
3140
- jsonString,
3141
- (x) => CreateResponseFormat2$inboundSchema.parse(JSON.parse(x)),
3142
- `Failed to parse 'CreateResponseFormat2' from JSON`,
3143
- );
3144
- }
3145
-
3146
- /** @internal */
3147
- export const CreateResponseFormat1$inboundSchema: z.ZodType<
3148
- CreateResponseFormat1,
3149
- z.ZodTypeDef,
3150
- unknown
3151
- > = z.object({
3152
- type: z.literal("text"),
3153
- });
3154
-
3155
- export function createResponseFormat1FromJSON(
3156
- jsonString: string,
3157
- ): SafeParseResult<CreateResponseFormat1, SDKValidationError> {
3158
- return safeParse(
3159
- jsonString,
3160
- (x) => CreateResponseFormat1$inboundSchema.parse(JSON.parse(x)),
3161
- `Failed to parse 'CreateResponseFormat1' from JSON`,
3162
- );
3163
- }
3164
-
3165
- /** @internal */
3166
- export const CreateResponseRouterResponsesFormat$inboundSchema: z.ZodType<
3167
- CreateResponseRouterResponsesFormat,
3168
- z.ZodTypeDef,
3169
- unknown
3170
- > = z.union([
3171
- z.lazy(() => CreateResponseFormat1$inboundSchema),
3172
- z.lazy(() => CreateResponseFormat2$inboundSchema),
3173
- z.lazy(() => CreateResponseFormat3$inboundSchema),
3174
- ]);
3175
-
3176
- export function createResponseRouterResponsesFormatFromJSON(
3177
- jsonString: string,
3178
- ): SafeParseResult<CreateResponseRouterResponsesFormat, SDKValidationError> {
3179
- return safeParse(
3180
- jsonString,
3181
- (x) =>
3182
- CreateResponseRouterResponsesFormat$inboundSchema.parse(JSON.parse(x)),
3183
- `Failed to parse 'CreateResponseRouterResponsesFormat' from JSON`,
3184
- );
3185
- }
3186
-
3187
- /** @internal */
3188
- export const CreateResponseRouterResponsesText$inboundSchema: z.ZodType<
3189
- CreateResponseRouterResponsesText,
3190
- z.ZodTypeDef,
3191
- unknown
3192
- > = z.object({
3193
- format: z.union([
3194
- z.lazy(() => CreateResponseFormat1$inboundSchema),
3195
- z.lazy(() => CreateResponseFormat2$inboundSchema),
3196
- z.lazy(() => CreateResponseFormat3$inboundSchema),
3197
- ]),
3198
- });
3199
-
3200
- export function createResponseRouterResponsesTextFromJSON(
3201
- jsonString: string,
3202
- ): SafeParseResult<CreateResponseRouterResponsesText, SDKValidationError> {
3203
- return safeParse(
3204
- jsonString,
3205
- (x) => CreateResponseRouterResponsesText$inboundSchema.parse(JSON.parse(x)),
3206
- `Failed to parse 'CreateResponseRouterResponsesText' from JSON`,
3207
- );
3208
- }
3209
-
3210
- /** @internal */
3211
- export const Truncation$inboundSchema: z.ZodNativeEnum<typeof Truncation> = z
3212
- .nativeEnum(Truncation);
3213
-
3214
- /** @internal */
3215
- export const CreateResponseServiceTier$inboundSchema: z.ZodNativeEnum<
3216
- typeof CreateResponseServiceTier
3217
- > = z.nativeEnum(CreateResponseServiceTier);
3218
-
3219
- /** @internal */
3220
- export const CreateResponseResponseBody$inboundSchema: z.ZodType<
3221
- CreateResponseResponseBody,
3222
- z.ZodTypeDef,
3223
- unknown
3224
- > = z.object({
3225
- id: z.string(),
3226
- object: CreateResponseObject$inboundSchema,
3227
- created_at: z.number(),
3228
- status: CreateResponseStatus$inboundSchema,
3229
- error: z.nullable(z.lazy(() => ErrorT$inboundSchema)),
3230
- incomplete_details: z.nullable(z.lazy(() => IncompleteDetails$inboundSchema)),
3231
- model: z.string(),
3232
- instructions: z.nullable(z.string()).optional(),
3233
- output: z.array(
3234
- z.union([
3235
- z.lazy(() => Output1$inboundSchema),
3236
- z.lazy(() => Output2$inboundSchema),
3237
- z.lazy(() => Output3$inboundSchema),
3238
- z.lazy(() => Output4$inboundSchema),
3239
- ]),
3240
- ),
3241
- output_text: z.nullable(z.string()).optional(),
3242
- usage: z.lazy(() => CreateResponseUsage$inboundSchema).optional(),
3243
- temperature: z.nullable(z.number()).optional(),
3244
- top_p: z.nullable(z.number()).optional(),
3245
- max_output_tokens: z.nullable(z.number().int()).optional(),
3246
- parallel_tool_calls: z.boolean(),
3247
- previous_response_id: z.nullable(z.string()).optional(),
3248
- metadata: z.record(z.string()).optional(),
3249
- tool_choice: z.union([
3250
- z.lazy(() => CreateResponseToolChoiceRouterResponses2$inboundSchema),
3251
- CreateResponseToolChoiceRouterResponses1$inboundSchema,
3252
- ]).optional(),
3253
- tools: z.array(
3254
- z.union([
3255
- z.lazy(() => CreateResponseTools1$inboundSchema),
3256
- z.lazy(() => CreateResponseTools2$inboundSchema),
3257
- z.lazy(() => CreateResponseTools3$inboundSchema),
3258
- ]),
3259
- ).optional(),
3260
- reasoning: z.nullable(z.lazy(() => CreateResponseReasoning$inboundSchema))
3261
- .optional(),
3262
- store: z.boolean().optional(),
3263
- text: z.lazy(() => CreateResponseRouterResponsesText$inboundSchema)
3264
- .optional(),
3265
- truncation: z.nullable(Truncation$inboundSchema.default("disabled")),
3266
- user: z.nullable(z.string()).optional(),
3267
- service_tier: z.nullable(CreateResponseServiceTier$inboundSchema).optional(),
3268
- background: z.nullable(z.boolean()).optional(),
3269
- top_logprobs: z.nullable(z.number().int()).optional(),
3270
- logprobs: z.nullable(z.boolean()).optional(),
3271
- }).transform((v) => {
3272
- return remap$(v, {
3273
- "created_at": "createdAt",
3274
- "incomplete_details": "incompleteDetails",
3275
- "output_text": "outputText",
3276
- "top_p": "topP",
3277
- "max_output_tokens": "maxOutputTokens",
3278
- "parallel_tool_calls": "parallelToolCalls",
3279
- "previous_response_id": "previousResponseId",
3280
- "tool_choice": "toolChoice",
3281
- "service_tier": "serviceTier",
3282
- "top_logprobs": "topLogprobs",
3283
- });
3284
- });
3285
-
3286
- export function createResponseResponseBodyFromJSON(
3287
- jsonString: string,
3288
- ): SafeParseResult<CreateResponseResponseBody, SDKValidationError> {
3289
- return safeParse(
3290
- jsonString,
3291
- (x) => CreateResponseResponseBody$inboundSchema.parse(JSON.parse(x)),
3292
- `Failed to parse 'CreateResponseResponseBody' from JSON`,
3293
- );
3294
- }
3295
-
3296
- /** @internal */
3297
- export const CreateResponseResponse$inboundSchema: z.ZodType<
3298
- CreateResponseResponse,
3299
- z.ZodTypeDef,
3300
- unknown
3301
- > = z.union([
3302
- z.lazy(() => CreateResponseResponseBody$inboundSchema),
3303
- z.instanceof(ReadableStream<Uint8Array>)
3304
- .transform(stream => {
3305
- return new EventStream(stream, rawEvent => {
3306
- if (rawEvent.data === "[DONE]") return { done: true };
3307
- return {
3308
- value: z.lazy(() =>
3309
- CreateResponseRouterResponsesResponseBody$inboundSchema
3310
- ).parse(rawEvent),
3311
- };
3312
- });
3313
- }),
3314
- ]);
3315
-
3316
- export function createResponseResponseFromJSON(
3317
- jsonString: string,
3318
- ): SafeParseResult<CreateResponseResponse, SDKValidationError> {
3319
- return safeParse(
3320
- jsonString,
3321
- (x) => CreateResponseResponse$inboundSchema.parse(JSON.parse(x)),
3322
- `Failed to parse 'CreateResponseResponse' from JSON`,
3323
- );
3324
- }