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