@openrouter/sdk 0.8.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/FUNCTIONS.md +2 -1
  2. package/_speakeasy/.github/action-inputs-config.json +4 -0
  3. package/esm/funcs/analyticsGetUserActivity.js +2 -1
  4. package/esm/funcs/apiKeysCreate.js +2 -1
  5. package/esm/funcs/apiKeysDelete.js +2 -1
  6. package/esm/funcs/apiKeysGet.js +2 -1
  7. package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +2 -1
  8. package/esm/funcs/apiKeysList.js +2 -1
  9. package/esm/funcs/apiKeysUpdate.js +2 -1
  10. package/esm/funcs/betaResponsesSend.js +2 -1
  11. package/esm/funcs/call-model.d.ts +19 -70
  12. package/esm/funcs/call-model.js +29 -71
  13. package/esm/funcs/chatSend.d.ts +3 -3
  14. package/esm/funcs/chatSend.js +20 -3
  15. package/esm/funcs/creditsCreateCoinbaseCharge.js +2 -1
  16. package/esm/funcs/creditsGetCredits.js +2 -1
  17. package/esm/funcs/embeddingsGenerate.js +2 -1
  18. package/esm/funcs/embeddingsListModels.js +2 -1
  19. package/esm/funcs/endpointsList.js +2 -1
  20. package/esm/funcs/endpointsListZdrEndpoints.js +2 -1
  21. package/esm/funcs/generationsGetGeneration.js +2 -1
  22. package/esm/funcs/guardrailsBulkAssignKeys.js +2 -1
  23. package/esm/funcs/guardrailsBulkAssignMembers.js +2 -1
  24. package/esm/funcs/guardrailsBulkUnassignKeys.js +2 -1
  25. package/esm/funcs/guardrailsBulkUnassignMembers.js +2 -1
  26. package/esm/funcs/guardrailsCreate.js +2 -1
  27. package/esm/funcs/guardrailsDelete.js +2 -1
  28. package/esm/funcs/guardrailsGet.js +2 -1
  29. package/esm/funcs/guardrailsList.js +2 -1
  30. package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +2 -1
  31. package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +2 -1
  32. package/esm/funcs/guardrailsListKeyAssignments.js +2 -1
  33. package/esm/funcs/guardrailsListMemberAssignments.js +2 -1
  34. package/esm/funcs/guardrailsUpdate.js +2 -1
  35. package/esm/funcs/modelsCount.d.ts +1 -1
  36. package/esm/funcs/modelsCount.js +9 -4
  37. package/esm/funcs/modelsList.js +3 -1
  38. package/esm/funcs/modelsListForUser.js +2 -1
  39. package/esm/funcs/oAuthCreateAuthCode.d.ts +1 -1
  40. package/esm/funcs/oAuthCreateAuthCode.js +4 -3
  41. package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +2 -1
  42. package/esm/funcs/providersList.js +2 -1
  43. package/esm/index.d.ts +22 -23
  44. package/esm/index.js +20 -17
  45. package/esm/lib/anthropic-compat.d.ts +2 -1
  46. package/esm/lib/anthropic-compat.js +1 -2
  47. package/esm/lib/async-params.d.ts +19 -5
  48. package/esm/lib/async-params.js +5 -1
  49. package/esm/lib/chat-compat.d.ts +1 -1
  50. package/esm/lib/chat-compat.js +1 -2
  51. package/esm/lib/claude-type-guards.d.ts +2 -2
  52. package/esm/lib/config.d.ts +8 -10
  53. package/esm/lib/config.js +2 -2
  54. package/esm/lib/conversation-state.d.ts +1 -1
  55. package/esm/lib/conversation-state.js +35 -32
  56. package/esm/lib/env.d.ts +6 -2
  57. package/esm/lib/env.js +7 -3
  58. package/esm/lib/model-result.d.ts +73 -17
  59. package/esm/lib/model-result.js +329 -125
  60. package/esm/lib/sdks.d.ts +1 -1
  61. package/esm/lib/sdks.js +8 -28
  62. package/esm/lib/stream-transformers.d.ts +5 -4
  63. package/esm/lib/stream-transformers.js +24 -29
  64. package/esm/lib/stream-type-guards.js +8 -32
  65. package/esm/lib/tool-context.d.ts +68 -0
  66. package/esm/lib/tool-context.js +175 -0
  67. package/esm/lib/tool-executor.d.ts +9 -5
  68. package/esm/lib/tool-executor.js +26 -16
  69. package/esm/lib/tool-orchestrator.d.ts +2 -2
  70. package/esm/lib/tool-types.d.ts +101 -14
  71. package/esm/lib/tool-types.js +17 -0
  72. package/esm/lib/tool.d.ts +49 -60
  73. package/esm/lib/tool.js +15 -19
  74. package/esm/lib/turn-context.d.ts +1 -1
  75. package/esm/models/assistantmessage.d.ts +53 -36
  76. package/esm/models/assistantmessage.js +38 -47
  77. package/esm/models/assistantmessageimages.d.ts +33 -0
  78. package/esm/models/assistantmessageimages.js +44 -0
  79. package/esm/models/chatcompletionaudiooutput.d.ts +38 -0
  80. package/esm/models/chatcompletionaudiooutput.js +36 -0
  81. package/esm/models/chatgenerationparams.d.ts +527 -131
  82. package/esm/models/chatgenerationparams.js +280 -97
  83. package/esm/models/chatgenerationtokenusage.d.ts +48 -0
  84. package/esm/models/chatmessagecontentitem.d.ts +16 -10
  85. package/esm/models/chatmessagecontentitem.js +28 -4
  86. package/esm/models/chatmessagecontentitemaudio.d.ts +20 -2
  87. package/esm/models/chatmessagecontentitemaudio.js +9 -2
  88. package/esm/models/chatmessagecontentitemcachecontrol.d.ts +19 -8
  89. package/esm/models/chatmessagecontentitemcachecontrol.js +14 -9
  90. package/esm/models/chatmessagecontentitemfile.d.ts +57 -0
  91. package/esm/models/chatmessagecontentitemfile.js +59 -0
  92. package/esm/models/chatmessagecontentitemimage.d.ts +26 -3
  93. package/esm/models/chatmessagecontentitemimage.js +12 -2
  94. package/esm/models/chatmessagecontentitemtext.d.ts +17 -2
  95. package/esm/models/chatmessagecontentitemtext.js +9 -2
  96. package/esm/models/chatmessagecontentitemvideo.d.ts +12 -55
  97. package/esm/models/chatmessagecontentitemvideo.js +5 -72
  98. package/esm/models/chatmessagecontentitemvideolegacy.d.ts +28 -0
  99. package/esm/models/chatmessagecontentitemvideolegacy.js +33 -0
  100. package/esm/models/chatmessagetokenlogprob.d.ts +15 -0
  101. package/esm/models/chatmessagetokenlogprobs.d.ts +10 -1
  102. package/esm/models/chatmessagetokenlogprobs.js +2 -1
  103. package/esm/models/chatmessagetoolcall.d.ts +23 -2
  104. package/esm/models/chatmessagetoolcall.js +9 -2
  105. package/esm/models/chatresponse.d.ts +30 -2
  106. package/esm/models/chatresponse.js +7 -2
  107. package/esm/models/chatresponsechoice.d.ts +13 -2
  108. package/esm/models/chatresponsechoice.js +1 -2
  109. package/esm/models/chatstreamingchoice.d.ts +13 -2
  110. package/esm/models/chatstreamingchoice.js +1 -2
  111. package/esm/models/chatstreamingmessagechunk.d.ts +31 -2
  112. package/esm/models/chatstreamingmessagechunk.js +7 -2
  113. package/esm/models/chatstreamingmessagetoolcall.d.ts +38 -1
  114. package/esm/models/chatstreamingmessagetoolcall.js +9 -1
  115. package/esm/models/chatstreamingresponsechunk.d.ts +46 -12
  116. package/esm/models/chatstreamingresponsechunk.js +12 -26
  117. package/esm/models/chatstreamoptions.d.ts +8 -0
  118. package/esm/models/compoundfilter.d.ts +36 -0
  119. package/esm/models/compoundfilter.js +32 -0
  120. package/esm/models/conflictresponseerrordata.d.ts +17 -0
  121. package/esm/models/conflictresponseerrordata.js +16 -0
  122. package/esm/models/contextcompressionengine.d.ts +15 -0
  123. package/esm/models/contextcompressionengine.js +14 -0
  124. package/esm/models/datetimeservertool.d.ts +30 -0
  125. package/esm/models/datetimeservertool.js +22 -0
  126. package/esm/models/debugoptions.d.ts +18 -0
  127. package/esm/models/debugoptions.js +18 -0
  128. package/esm/models/defaultparameters.d.ts +3 -0
  129. package/esm/models/defaultparameters.js +6 -0
  130. package/esm/models/developermessage.d.ts +12 -0
  131. package/esm/models/errors/conflictresponseerror.d.ts +33 -0
  132. package/esm/models/errors/{chaterror.js → conflictresponseerror.js} +17 -7
  133. package/esm/models/errors/index.d.ts +1 -1
  134. package/esm/models/errors/index.js +1 -1
  135. package/esm/models/index.d.ts +35 -12
  136. package/esm/models/index.js +35 -12
  137. package/esm/models/jsonschemaconfig.d.ts +17 -2
  138. package/esm/models/jsonschemaconfig.js +1 -1
  139. package/esm/models/message.d.ts +9 -2
  140. package/esm/models/message.js +1 -1
  141. package/esm/models/modelscountresponse.d.ts +4 -4
  142. package/esm/models/modelscountresponse.js +4 -4
  143. package/esm/models/namedtoolchoice.d.ts +15 -2
  144. package/esm/models/namedtoolchoice.js +6 -1
  145. package/esm/models/openairesponsesinputunion.d.ts +32 -1
  146. package/esm/models/openairesponsesinputunion.js +53 -1
  147. package/esm/models/openairesponsesreasoningconfig.d.ts +1 -1
  148. package/esm/models/openairesponsesreasoningconfig.js +1 -1
  149. package/esm/models/openresponsesapplypatchtool.d.ts +20 -0
  150. package/esm/models/openresponsesapplypatchtool.js +21 -0
  151. package/esm/models/openresponsescodeinterpretertool.d.ts +68 -0
  152. package/esm/models/openresponsescodeinterpretertool.js +85 -0
  153. package/esm/models/openresponsescomputertool.d.ts +39 -0
  154. package/esm/models/openresponsescomputertool.js +50 -0
  155. package/esm/models/openresponsescustomtool.d.ts +75 -0
  156. package/esm/models/openresponsescustomtool.js +95 -0
  157. package/esm/models/openresponseseasyinputmessage.d.ts +30 -4
  158. package/esm/models/openresponseseasyinputmessage.js +28 -2
  159. package/esm/models/openresponsesfilesearchtool.d.ts +111 -0
  160. package/esm/models/openresponsesfilesearchtool.js +180 -0
  161. package/esm/models/openresponsesfunctioncalloutput.d.ts +46 -7
  162. package/esm/models/openresponsesfunctioncalloutput.js +56 -4
  163. package/esm/models/openresponsesfunctionshelltool.d.ts +20 -0
  164. package/esm/models/openresponsesfunctionshelltool.js +21 -0
  165. package/esm/models/openresponsesimagegenerationtool.d.ts +125 -0
  166. package/esm/models/openresponsesimagegenerationtool.js +153 -0
  167. package/esm/models/openresponsesinputmessageitem.d.ts +2 -2
  168. package/esm/models/openresponsesinputmessageitem.js +2 -2
  169. package/esm/models/openresponsesinputunion.d.ts +207 -0
  170. package/esm/models/openresponsesinputunion.js +225 -0
  171. package/esm/models/openresponseslocalshelltool.d.ts +20 -0
  172. package/esm/models/openresponseslocalshelltool.js +21 -0
  173. package/esm/models/openresponsesmcptool.d.ts +128 -0
  174. package/esm/models/openresponsesmcptool.js +173 -0
  175. package/esm/models/openresponsesnonstreamingresponse.d.ts +15 -6
  176. package/esm/models/openresponsesnonstreamingresponse.js +30 -3
  177. package/esm/models/openresponsesreasoning.d.ts +2 -2
  178. package/esm/models/openresponsesreasoning.js +1 -1
  179. package/esm/models/openresponsesreasoningconfig.d.ts +2 -2
  180. package/esm/models/openresponsesreasoningconfig.js +1 -1
  181. package/esm/models/openresponsesrequest.d.ts +111 -39
  182. package/esm/models/openresponsesrequest.js +112 -38
  183. package/esm/models/openresponsesstreamevent.d.ts +52 -4
  184. package/esm/models/openresponsesstreamevent.js +54 -3
  185. package/esm/models/openresponseswebsearch20250826tool.d.ts +29 -0
  186. package/esm/models/openresponseswebsearch20250826tool.js +23 -0
  187. package/esm/models/openresponseswebsearchcallcompleted.d.ts +16 -0
  188. package/esm/models/openresponseswebsearchcallcompleted.js +24 -0
  189. package/esm/models/openresponseswebsearchcallinprogress.d.ts +16 -0
  190. package/esm/models/openresponseswebsearchcallinprogress.js +24 -0
  191. package/esm/models/openresponseswebsearchcallsearching.d.ts +16 -0
  192. package/esm/models/openresponseswebsearchcallsearching.js +24 -0
  193. package/esm/models/openresponseswebsearchpreview20250311tool.d.ts +44 -0
  194. package/esm/models/openresponseswebsearchpreview20250311tool.js +51 -0
  195. package/esm/models/openresponseswebsearchpreviewtool.d.ts +44 -0
  196. package/esm/models/openresponseswebsearchpreviewtool.js +47 -0
  197. package/esm/models/openresponseswebsearchtool.d.ts +29 -0
  198. package/esm/models/openresponseswebsearchtool.js +23 -0
  199. package/esm/models/operations/bulkassignkeystoguardrail.d.ts +16 -3
  200. package/esm/models/operations/bulkassignkeystoguardrail.js +2 -2
  201. package/esm/models/operations/bulkassignmemberstoguardrail.d.ts +16 -3
  202. package/esm/models/operations/bulkassignmemberstoguardrail.js +2 -2
  203. package/esm/models/operations/bulkunassignkeysfromguardrail.d.ts +16 -3
  204. package/esm/models/operations/bulkunassignkeysfromguardrail.js +2 -2
  205. package/esm/models/operations/bulkunassignmembersfromguardrail.d.ts +16 -3
  206. package/esm/models/operations/bulkunassignmembersfromguardrail.js +2 -2
  207. package/esm/models/operations/createauthkeyscode.d.ts +40 -3
  208. package/esm/models/operations/createauthkeyscode.js +16 -2
  209. package/esm/models/operations/createcoinbasecharge.d.ts +16 -3
  210. package/esm/models/operations/createcoinbasecharge.js +2 -2
  211. package/esm/models/operations/createembeddings.d.ts +16 -3
  212. package/esm/models/operations/createembeddings.js +2 -2
  213. package/esm/models/operations/createguardrail.d.ts +25 -3
  214. package/esm/models/operations/createguardrail.js +6 -2
  215. package/esm/models/operations/createkeys.d.ts +16 -3
  216. package/esm/models/operations/createkeys.js +2 -2
  217. package/esm/models/operations/createresponses.d.ts +16 -3
  218. package/esm/models/operations/createresponses.js +2 -2
  219. package/esm/models/operations/deleteguardrail.d.ts +16 -3
  220. package/esm/models/operations/deleteguardrail.js +2 -2
  221. package/esm/models/operations/deletekeys.d.ts +16 -3
  222. package/esm/models/operations/deletekeys.js +2 -2
  223. package/esm/models/operations/exchangeauthcodeforapikey.d.ts +16 -3
  224. package/esm/models/operations/exchangeauthcodeforapikey.js +2 -2
  225. package/esm/models/operations/getcredits.d.ts +16 -3
  226. package/esm/models/operations/getcredits.js +2 -2
  227. package/esm/models/operations/getcurrentkey.d.ts +16 -3
  228. package/esm/models/operations/getcurrentkey.js +2 -2
  229. package/esm/models/operations/getgeneration.d.ts +27 -3
  230. package/esm/models/operations/getgeneration.js +9 -2
  231. package/esm/models/operations/getguardrail.d.ts +20 -3
  232. package/esm/models/operations/getguardrail.js +4 -2
  233. package/esm/models/operations/getkey.d.ts +16 -3
  234. package/esm/models/operations/getkey.js +2 -2
  235. package/esm/models/operations/getmodels.d.ts +21 -3
  236. package/esm/models/operations/getmodels.js +4 -2
  237. package/esm/models/operations/getuseractivity.d.ts +16 -3
  238. package/esm/models/operations/getuseractivity.js +2 -2
  239. package/esm/models/operations/list.d.ts +16 -3
  240. package/esm/models/operations/list.js +2 -2
  241. package/esm/models/operations/listembeddingsmodels.d.ts +16 -3
  242. package/esm/models/operations/listembeddingsmodels.js +2 -2
  243. package/esm/models/operations/listendpoints.d.ts +16 -3
  244. package/esm/models/operations/listendpoints.js +2 -2
  245. package/esm/models/operations/listendpointszdr.d.ts +16 -3
  246. package/esm/models/operations/listendpointszdr.js +2 -2
  247. package/esm/models/operations/listguardrailkeyassignments.d.ts +16 -3
  248. package/esm/models/operations/listguardrailkeyassignments.js +2 -2
  249. package/esm/models/operations/listguardrailmemberassignments.d.ts +16 -3
  250. package/esm/models/operations/listguardrailmemberassignments.js +2 -2
  251. package/esm/models/operations/listguardrails.d.ts +20 -3
  252. package/esm/models/operations/listguardrails.js +4 -2
  253. package/esm/models/operations/listkeyassignments.d.ts +16 -3
  254. package/esm/models/operations/listkeyassignments.js +2 -2
  255. package/esm/models/operations/listmemberassignments.d.ts +16 -3
  256. package/esm/models/operations/listmemberassignments.js +2 -2
  257. package/esm/models/operations/listmodelscount.d.ts +21 -3
  258. package/esm/models/operations/listmodelscount.js +4 -2
  259. package/esm/models/operations/listmodelsuser.d.ts +16 -3
  260. package/esm/models/operations/listmodelsuser.js +2 -2
  261. package/esm/models/operations/listproviders.d.ts +16 -3
  262. package/esm/models/operations/listproviders.js +2 -2
  263. package/esm/models/operations/sendchatcompletionrequest.d.ts +27 -5
  264. package/esm/models/operations/sendchatcompletionrequest.js +22 -4
  265. package/esm/models/operations/updateguardrail.d.ts +25 -3
  266. package/esm/models/operations/updateguardrail.js +6 -2
  267. package/esm/models/operations/updatekeys.d.ts +16 -3
  268. package/esm/models/operations/updatekeys.js +2 -2
  269. package/esm/models/outputmessage.d.ts +23 -0
  270. package/esm/models/outputmessage.js +24 -0
  271. package/esm/models/outputmodality.d.ts +1 -0
  272. package/esm/models/outputmodality.js +1 -0
  273. package/esm/models/providername.d.ts +3 -0
  274. package/esm/models/providername.js +3 -0
  275. package/esm/models/providerpreferences.d.ts +49 -14
  276. package/esm/models/providerpreferences.js +33 -15
  277. package/esm/models/providersort.d.ts +7 -0
  278. package/esm/models/providersort.js +4 -0
  279. package/esm/models/providersortconfig.d.ts +31 -2
  280. package/esm/models/providersortconfig.js +16 -2
  281. package/esm/models/reasoningdetailencrypted.d.ts +42 -0
  282. package/esm/models/reasoningdetailencrypted.js +42 -0
  283. package/esm/models/reasoningdetailsummary.d.ts +42 -0
  284. package/esm/models/reasoningdetailsummary.js +42 -0
  285. package/esm/models/reasoningdetailtext.d.ts +44 -0
  286. package/esm/models/reasoningdetailtext.js +44 -0
  287. package/esm/models/reasoningdetailunion.d.ts +19 -0
  288. package/esm/models/reasoningdetailunion.js +28 -0
  289. package/esm/models/responseformatjsonobject.d.ts +20 -0
  290. package/esm/models/responseformatjsonobject.js +21 -0
  291. package/esm/models/responseformatjsonschema.d.ts +6 -0
  292. package/esm/models/responseformattext.d.ts +15 -0
  293. package/esm/models/responseformattext.js +13 -0
  294. package/esm/models/responseformattextconfig.d.ts +3 -3
  295. package/esm/models/responseformattextconfig.js +3 -3
  296. package/esm/models/responseformattextgrammar.d.ts +6 -0
  297. package/esm/models/responseformattextpython.d.ts +15 -0
  298. package/esm/models/responseformattextpython.js +13 -0
  299. package/esm/models/responseoutputtext.d.ts +8 -8
  300. package/esm/models/responseoutputtext.js +10 -9
  301. package/esm/models/responseserrorfield.d.ts +4 -4
  302. package/esm/models/responseserrorfield.js +4 -4
  303. package/esm/models/responsesoutputitem.d.ts +2 -13
  304. package/esm/models/responsesoutputitem.js +8 -6
  305. package/esm/models/responsesoutputitemreasoning.d.ts +3 -32
  306. package/esm/models/responsesoutputitemreasoning.js +3 -45
  307. package/esm/models/responsesoutputmessage.d.ts +24 -32
  308. package/esm/models/responsesoutputmessage.js +26 -47
  309. package/esm/models/responsesservertooloutput.d.ts +42 -0
  310. package/esm/models/responsesservertooloutput.js +44 -0
  311. package/esm/models/responseswebsearchcalloutput.d.ts +90 -5
  312. package/esm/models/responseswebsearchcalloutput.js +113 -5
  313. package/esm/models/responseswebsearchservertool.d.ts +35 -0
  314. package/esm/models/responseswebsearchservertool.js +28 -0
  315. package/esm/models/systemmessage.d.ts +12 -0
  316. package/esm/models/toolchoiceoption.d.ts +31 -0
  317. package/esm/models/toolchoiceoption.js +32 -0
  318. package/esm/models/tooldefinitionjson.d.ts +62 -10
  319. package/esm/models/tooldefinitionjson.js +29 -6
  320. package/esm/models/toolresponsemessage.d.ts +12 -0
  321. package/esm/models/usermessage.d.ts +12 -0
  322. package/esm/models/videoinput.d.ts +23 -0
  323. package/esm/models/videoinput.js +22 -0
  324. package/esm/models/websearchengine.d.ts +2 -0
  325. package/esm/models/websearchengine.js +2 -0
  326. package/esm/models/websearchservertool.d.ts +116 -0
  327. package/esm/models/websearchservertool.js +77 -0
  328. package/esm/models/websearchshorthand.d.ts +215 -0
  329. package/esm/models/websearchshorthand.js +138 -0
  330. package/esm/sdk/chat.d.ts +1 -1
  331. package/esm/sdk/sdk.d.ts +6 -3
  332. package/esm/sdk/sdk.js +3 -4
  333. package/esm/types/index.d.ts +0 -2
  334. package/esm/types/index.js +0 -1
  335. package/jsr.json +1 -1
  336. package/package.json +11 -6
  337. package/turbo.json +10 -0
  338. package/esm/models/chaterror.d.ts +0 -17
  339. package/esm/models/chaterror.js +0 -25
  340. package/esm/models/errors/chaterror.d.ts +0 -19
  341. package/esm/models/openresponsesinput.d.ts +0 -28
  342. package/esm/models/openresponsesinput.js +0 -54
  343. package/esm/models/openresponseslogprobs.d.ts +0 -16
  344. package/esm/models/openresponseslogprobs.js +0 -22
  345. package/esm/models/openresponsestoplogprobs.d.ts +0 -14
  346. package/esm/models/openresponsestoplogprobs.js +0 -15
  347. package/esm/models/providersortunion.d.ts +0 -10
  348. package/esm/models/providersortunion.js +0 -13
  349. package/esm/models/responsesformatjsonobject.d.ts +0 -20
  350. package/esm/models/responsesformatjsonobject.js +0 -21
  351. package/esm/models/schema10.d.ts +0 -33
  352. package/esm/models/schema10.js +0 -30
  353. package/esm/models/schema14.d.ts +0 -8
  354. package/esm/models/schema14.js +0 -12
  355. package/esm/models/schema17.d.ts +0 -102
  356. package/esm/models/schema17.js +0 -95
  357. package/esm/models/schema19.d.ts +0 -92
  358. package/esm/models/schema19.js +0 -109
  359. package/esm/models/schema5.d.ts +0 -86
  360. package/esm/models/schema5.js +0 -89
@@ -5,23 +5,131 @@
5
5
  import * as z from "zod/v4";
6
6
  import { safeParse } from "../lib/schemas.js";
7
7
  import { WebSearchStatus$inboundSchema, WebSearchStatus$outboundSchema, } from "./websearchstatus.js";
8
- export const ResponsesWebSearchCallOutputType = {
8
+ export const TypeWebSearchCall = {
9
9
  WebSearchCall: "web_search_call",
10
10
  };
11
+ export const TypeURL = {
12
+ Url: "url",
13
+ };
14
+ /** @internal */
15
+ export const TypeWebSearchCall$inboundSchema = z.enum(TypeWebSearchCall);
16
+ /** @internal */
17
+ export const TypeWebSearchCall$outboundSchema = TypeWebSearchCall$inboundSchema;
18
+ /** @internal */
19
+ export const ActionFindInPage$inboundSchema = z.object({
20
+ type: z.literal("find_in_page"),
21
+ pattern: z.string(),
22
+ url: z.string(),
23
+ });
24
+ /** @internal */
25
+ export const ActionFindInPage$outboundSchema = z.object({
26
+ type: z.literal("find_in_page"),
27
+ pattern: z.string(),
28
+ url: z.string(),
29
+ });
30
+ export function actionFindInPageToJSON(actionFindInPage) {
31
+ return JSON.stringify(ActionFindInPage$outboundSchema.parse(actionFindInPage));
32
+ }
33
+ export function actionFindInPageFromJSON(jsonString) {
34
+ return safeParse(jsonString, (x) => ActionFindInPage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ActionFindInPage' from JSON`);
35
+ }
36
+ /** @internal */
37
+ export const ActionOpenPage$inboundSchema = z.object({
38
+ type: z.literal("open_page"),
39
+ url: z.nullable(z.string()).optional(),
40
+ });
41
+ /** @internal */
42
+ export const ActionOpenPage$outboundSchema = z.object({
43
+ type: z.literal("open_page"),
44
+ url: z.nullable(z.string()).optional(),
45
+ });
46
+ export function actionOpenPageToJSON(actionOpenPage) {
47
+ return JSON.stringify(ActionOpenPage$outboundSchema.parse(actionOpenPage));
48
+ }
49
+ export function actionOpenPageFromJSON(jsonString) {
50
+ return safeParse(jsonString, (x) => ActionOpenPage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ActionOpenPage' from JSON`);
51
+ }
52
+ /** @internal */
53
+ export const TypeURL$inboundSchema = z.enum(TypeURL);
11
54
  /** @internal */
12
- export const ResponsesWebSearchCallOutputType$inboundSchema = z.enum(ResponsesWebSearchCallOutputType);
55
+ export const TypeURL$outboundSchema = TypeURL$inboundSchema;
13
56
  /** @internal */
14
- export const ResponsesWebSearchCallOutputType$outboundSchema = ResponsesWebSearchCallOutputType$inboundSchema;
57
+ export const Source$inboundSchema = z.object({
58
+ type: TypeURL$inboundSchema,
59
+ url: z.string(),
60
+ });
61
+ /** @internal */
62
+ export const Source$outboundSchema = z
63
+ .object({
64
+ type: TypeURL$outboundSchema,
65
+ url: z.string(),
66
+ });
67
+ export function sourceToJSON(source) {
68
+ return JSON.stringify(Source$outboundSchema.parse(source));
69
+ }
70
+ export function sourceFromJSON(jsonString) {
71
+ return safeParse(jsonString, (x) => Source$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Source' from JSON`);
72
+ }
73
+ /** @internal */
74
+ export const ActionSearch$inboundSchema = z
75
+ .object({
76
+ type: z.literal("search"),
77
+ query: z.string(),
78
+ queries: z.array(z.string()).optional(),
79
+ sources: z.array(z.lazy(() => Source$inboundSchema)).optional(),
80
+ });
81
+ /** @internal */
82
+ export const ActionSearch$outboundSchema = z.object({
83
+ type: z.literal("search"),
84
+ query: z.string(),
85
+ queries: z.array(z.string()).optional(),
86
+ sources: z.array(z.lazy(() => Source$outboundSchema)).optional(),
87
+ });
88
+ export function actionSearchToJSON(actionSearch) {
89
+ return JSON.stringify(ActionSearch$outboundSchema.parse(actionSearch));
90
+ }
91
+ export function actionSearchFromJSON(jsonString) {
92
+ return safeParse(jsonString, (x) => ActionSearch$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ActionSearch' from JSON`);
93
+ }
94
+ /** @internal */
95
+ export const Action$inboundSchema = z.union([
96
+ z.lazy(() => ActionSearch$inboundSchema),
97
+ z.lazy(() => ActionOpenPage$inboundSchema),
98
+ z.lazy(() => ActionFindInPage$inboundSchema),
99
+ ]);
100
+ /** @internal */
101
+ export const Action$outboundSchema = z
102
+ .union([
103
+ z.lazy(() => ActionSearch$outboundSchema),
104
+ z.lazy(() => ActionOpenPage$outboundSchema),
105
+ z.lazy(() => ActionFindInPage$outboundSchema),
106
+ ]);
107
+ export function actionToJSON(action) {
108
+ return JSON.stringify(Action$outboundSchema.parse(action));
109
+ }
110
+ export function actionFromJSON(jsonString) {
111
+ return safeParse(jsonString, (x) => Action$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Action' from JSON`);
112
+ }
15
113
  /** @internal */
16
114
  export const ResponsesWebSearchCallOutput$inboundSchema = z.object({
17
- type: ResponsesWebSearchCallOutputType$inboundSchema,
115
+ type: TypeWebSearchCall$inboundSchema,
18
116
  id: z.string(),
117
+ action: z.union([
118
+ z.lazy(() => ActionSearch$inboundSchema),
119
+ z.lazy(() => ActionOpenPage$inboundSchema),
120
+ z.lazy(() => ActionFindInPage$inboundSchema),
121
+ ]),
19
122
  status: WebSearchStatus$inboundSchema,
20
123
  });
21
124
  /** @internal */
22
125
  export const ResponsesWebSearchCallOutput$outboundSchema = z.object({
23
- type: ResponsesWebSearchCallOutputType$outboundSchema,
126
+ type: TypeWebSearchCall$outboundSchema,
24
127
  id: z.string(),
128
+ action: z.union([
129
+ z.lazy(() => ActionSearch$outboundSchema),
130
+ z.lazy(() => ActionOpenPage$outboundSchema),
131
+ z.lazy(() => ActionFindInPage$outboundSchema),
132
+ ]),
25
133
  status: WebSearchStatus$outboundSchema,
26
134
  });
27
135
  export function responsesWebSearchCallOutputToJSON(responsesWebSearchCallOutput) {
@@ -0,0 +1,35 @@
1
+ import * as z from "zod/v4";
2
+ export type ResponsesWebSearchServerToolParameters = {
3
+ /**
4
+ * Maximum number of search results to return per search call. Defaults to 5.
5
+ */
6
+ maxResults?: number | undefined;
7
+ /**
8
+ * Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results.
9
+ */
10
+ maxTotalResults?: number | undefined;
11
+ };
12
+ /**
13
+ * OpenRouter built-in server tool: searches the web for current information
14
+ */
15
+ export type ResponsesWebSearchServerTool = {
16
+ type: "openrouter:web_search";
17
+ parameters?: ResponsesWebSearchServerToolParameters | undefined;
18
+ };
19
+ /** @internal */
20
+ export type ResponsesWebSearchServerToolParameters$Outbound = {
21
+ max_results?: number | undefined;
22
+ max_total_results?: number | undefined;
23
+ };
24
+ /** @internal */
25
+ export declare const ResponsesWebSearchServerToolParameters$outboundSchema: z.ZodType<ResponsesWebSearchServerToolParameters$Outbound, ResponsesWebSearchServerToolParameters>;
26
+ export declare function responsesWebSearchServerToolParametersToJSON(responsesWebSearchServerToolParameters: ResponsesWebSearchServerToolParameters): string;
27
+ /** @internal */
28
+ export type ResponsesWebSearchServerTool$Outbound = {
29
+ type: "openrouter:web_search";
30
+ parameters?: ResponsesWebSearchServerToolParameters$Outbound | undefined;
31
+ };
32
+ /** @internal */
33
+ export declare const ResponsesWebSearchServerTool$outboundSchema: z.ZodType<ResponsesWebSearchServerTool$Outbound, ResponsesWebSearchServerTool>;
34
+ export declare function responsesWebSearchServerToolToJSON(responsesWebSearchServerTool: ResponsesWebSearchServerTool): string;
35
+ //# sourceMappingURL=responseswebsearchservertool.d.ts.map
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 8ef0e49c5731
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ /** @internal */
8
+ export const ResponsesWebSearchServerToolParameters$outboundSchema = z.object({
9
+ maxResults: z.number().optional(),
10
+ maxTotalResults: z.number().optional(),
11
+ }).transform((v) => {
12
+ return remap$(v, {
13
+ maxResults: "max_results",
14
+ maxTotalResults: "max_total_results",
15
+ });
16
+ });
17
+ export function responsesWebSearchServerToolParametersToJSON(responsesWebSearchServerToolParameters) {
18
+ return JSON.stringify(ResponsesWebSearchServerToolParameters$outboundSchema.parse(responsesWebSearchServerToolParameters));
19
+ }
20
+ /** @internal */
21
+ export const ResponsesWebSearchServerTool$outboundSchema = z.object({
22
+ type: z.literal("openrouter:web_search"),
23
+ parameters: z.lazy(() => ResponsesWebSearchServerToolParameters$outboundSchema).optional(),
24
+ });
25
+ export function responsesWebSearchServerToolToJSON(responsesWebSearchServerTool) {
26
+ return JSON.stringify(ResponsesWebSearchServerTool$outboundSchema.parse(responsesWebSearchServerTool));
27
+ }
28
+ //# sourceMappingURL=responseswebsearchservertool.js.map
@@ -1,9 +1,21 @@
1
1
  import * as z from "zod/v4";
2
2
  import { ChatMessageContentItemText, ChatMessageContentItemText$Outbound } from "./chatmessagecontentitemtext.js";
3
+ /**
4
+ * System message content
5
+ */
3
6
  export type SystemMessageContent = string | Array<ChatMessageContentItemText>;
7
+ /**
8
+ * System message for setting behavior
9
+ */
4
10
  export type SystemMessage = {
5
11
  role: "system";
12
+ /**
13
+ * System message content
14
+ */
6
15
  content: string | Array<ChatMessageContentItemText>;
16
+ /**
17
+ * Optional name for the system message
18
+ */
7
19
  name?: string | undefined;
8
20
  };
9
21
  /** @internal */
@@ -0,0 +1,31 @@
1
+ import * as z from "zod/v4";
2
+ import { ClosedEnum } from "../types/enums.js";
3
+ import { NamedToolChoice, NamedToolChoice$Outbound } from "./namedtoolchoice.js";
4
+ export declare const ToolChoiceOptionRequired: {
5
+ readonly Required: "required";
6
+ };
7
+ export type ToolChoiceOptionRequired = ClosedEnum<typeof ToolChoiceOptionRequired>;
8
+ export declare const ToolChoiceOptionAuto: {
9
+ readonly Auto: "auto";
10
+ };
11
+ export type ToolChoiceOptionAuto = ClosedEnum<typeof ToolChoiceOptionAuto>;
12
+ export declare const ToolChoiceOptionNone: {
13
+ readonly None: "none";
14
+ };
15
+ export type ToolChoiceOptionNone = ClosedEnum<typeof ToolChoiceOptionNone>;
16
+ /**
17
+ * Tool choice configuration
18
+ */
19
+ export type ToolChoiceOption = NamedToolChoice | ToolChoiceOptionNone | ToolChoiceOptionAuto | ToolChoiceOptionRequired;
20
+ /** @internal */
21
+ export declare const ToolChoiceOptionRequired$outboundSchema: z.ZodEnum<typeof ToolChoiceOptionRequired>;
22
+ /** @internal */
23
+ export declare const ToolChoiceOptionAuto$outboundSchema: z.ZodEnum<typeof ToolChoiceOptionAuto>;
24
+ /** @internal */
25
+ export declare const ToolChoiceOptionNone$outboundSchema: z.ZodEnum<typeof ToolChoiceOptionNone>;
26
+ /** @internal */
27
+ export type ToolChoiceOption$Outbound = NamedToolChoice$Outbound | string | string | string;
28
+ /** @internal */
29
+ export declare const ToolChoiceOption$outboundSchema: z.ZodType<ToolChoiceOption$Outbound, ToolChoiceOption>;
30
+ export declare function toolChoiceOptionToJSON(toolChoiceOption: ToolChoiceOption): string;
31
+ //# sourceMappingURL=toolchoiceoption.d.ts.map
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: d767ca0ded82
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { NamedToolChoice$outboundSchema, } from "./namedtoolchoice.js";
7
+ export const ToolChoiceOptionRequired = {
8
+ Required: "required",
9
+ };
10
+ export const ToolChoiceOptionAuto = {
11
+ Auto: "auto",
12
+ };
13
+ export const ToolChoiceOptionNone = {
14
+ None: "none",
15
+ };
16
+ /** @internal */
17
+ export const ToolChoiceOptionRequired$outboundSchema = z.enum(ToolChoiceOptionRequired);
18
+ /** @internal */
19
+ export const ToolChoiceOptionAuto$outboundSchema = z.enum(ToolChoiceOptionAuto);
20
+ /** @internal */
21
+ export const ToolChoiceOptionNone$outboundSchema = z.enum(ToolChoiceOptionNone);
22
+ /** @internal */
23
+ export const ToolChoiceOption$outboundSchema = z.union([
24
+ NamedToolChoice$outboundSchema,
25
+ ToolChoiceOptionNone$outboundSchema,
26
+ ToolChoiceOptionAuto$outboundSchema,
27
+ ToolChoiceOptionRequired$outboundSchema,
28
+ ]);
29
+ export function toolChoiceOptionToJSON(toolChoiceOption) {
30
+ return JSON.stringify(ToolChoiceOption$outboundSchema.parse(toolChoiceOption));
31
+ }
32
+ //# sourceMappingURL=toolchoiceoption.js.map
@@ -1,34 +1,86 @@
1
1
  import * as z from "zod/v4";
2
- export type ToolDefinitionJsonFunction = {
2
+ import { ChatMessageContentItemCacheControl, ChatMessageContentItemCacheControl$Outbound } from "./chatmessagecontentitemcachecontrol.js";
3
+ import { DatetimeServerTool, DatetimeServerTool$Outbound } from "./datetimeservertool.js";
4
+ import { WebSearchServerTool, WebSearchServerTool$Outbound } from "./websearchservertool.js";
5
+ import { WebSearchShorthand, WebSearchShorthand$Outbound } from "./websearchshorthand.js";
6
+ /**
7
+ * Function definition for tool calling
8
+ */
9
+ export type ToolDefinitionJsonFunctionFunction = {
10
+ /**
11
+ * Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)
12
+ */
3
13
  name: string;
14
+ /**
15
+ * Function description for the model
16
+ */
4
17
  description?: string | undefined;
18
+ /**
19
+ * Function parameters as JSON Schema object
20
+ */
5
21
  parameters?: {
6
- [k: string]: any;
22
+ [k: string]: any | null;
7
23
  } | undefined;
24
+ /**
25
+ * Enable strict schema adherence
26
+ */
8
27
  strict?: boolean | null | undefined;
9
28
  };
10
- export type ToolDefinitionJson = {
29
+ export type ToolDefinitionJsonFunction = {
11
30
  type: "function";
12
- function: ToolDefinitionJsonFunction;
31
+ /**
32
+ * Function definition for tool calling
33
+ */
34
+ function: ToolDefinitionJsonFunctionFunction;
35
+ /**
36
+ * Cache control for the content part
37
+ */
38
+ cacheControl?: ChatMessageContentItemCacheControl | undefined;
13
39
  };
40
+ /**
41
+ * Tool definition for function calling (regular function or OpenRouter built-in server tool)
42
+ */
43
+ export type ToolDefinitionJson = ToolDefinitionJsonFunction | DatetimeServerTool | WebSearchServerTool | (WebSearchShorthand & {
44
+ type: "web_search";
45
+ }) | (WebSearchShorthand & {
46
+ type: "web_search_preview";
47
+ }) | (WebSearchShorthand & {
48
+ type: "web_search_preview_2025_03_11";
49
+ }) | (WebSearchShorthand & {
50
+ type: "web_search_2025_08_26";
51
+ });
14
52
  /** @internal */
15
- export type ToolDefinitionJsonFunction$Outbound = {
53
+ export type ToolDefinitionJsonFunctionFunction$Outbound = {
16
54
  name: string;
17
55
  description?: string | undefined;
18
56
  parameters?: {
19
- [k: string]: any;
57
+ [k: string]: any | null;
20
58
  } | undefined;
21
59
  strict?: boolean | null | undefined;
22
60
  };
23
61
  /** @internal */
24
- export declare const ToolDefinitionJsonFunction$outboundSchema: z.ZodType<ToolDefinitionJsonFunction$Outbound, ToolDefinitionJsonFunction>;
25
- export declare function toolDefinitionJsonFunctionToJSON(toolDefinitionJsonFunction: ToolDefinitionJsonFunction): string;
62
+ export declare const ToolDefinitionJsonFunctionFunction$outboundSchema: z.ZodType<ToolDefinitionJsonFunctionFunction$Outbound, ToolDefinitionJsonFunctionFunction>;
63
+ export declare function toolDefinitionJsonFunctionFunctionToJSON(toolDefinitionJsonFunctionFunction: ToolDefinitionJsonFunctionFunction): string;
26
64
  /** @internal */
27
- export type ToolDefinitionJson$Outbound = {
65
+ export type ToolDefinitionJsonFunction$Outbound = {
28
66
  type: "function";
29
- function: ToolDefinitionJsonFunction$Outbound;
67
+ function: ToolDefinitionJsonFunctionFunction$Outbound;
68
+ cache_control?: ChatMessageContentItemCacheControl$Outbound | undefined;
30
69
  };
31
70
  /** @internal */
71
+ export declare const ToolDefinitionJsonFunction$outboundSchema: z.ZodType<ToolDefinitionJsonFunction$Outbound, ToolDefinitionJsonFunction>;
72
+ export declare function toolDefinitionJsonFunctionToJSON(toolDefinitionJsonFunction: ToolDefinitionJsonFunction): string;
73
+ /** @internal */
74
+ export type ToolDefinitionJson$Outbound = ToolDefinitionJsonFunction$Outbound | DatetimeServerTool$Outbound | WebSearchServerTool$Outbound | (WebSearchShorthand$Outbound & {
75
+ type: "web_search";
76
+ }) | (WebSearchShorthand$Outbound & {
77
+ type: "web_search_preview";
78
+ }) | (WebSearchShorthand$Outbound & {
79
+ type: "web_search_preview_2025_03_11";
80
+ }) | (WebSearchShorthand$Outbound & {
81
+ type: "web_search_2025_08_26";
82
+ });
83
+ /** @internal */
32
84
  export declare const ToolDefinitionJson$outboundSchema: z.ZodType<ToolDefinitionJson$Outbound, ToolDefinitionJson>;
33
85
  export declare function toolDefinitionJsonToJSON(toolDefinitionJson: ToolDefinitionJson): string;
34
86
  //# sourceMappingURL=tooldefinitionjson.d.ts.map
@@ -3,21 +3,44 @@
3
3
  * @generated-id: 546c340f3013
4
4
  */
5
5
  import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { ChatMessageContentItemCacheControl$outboundSchema, } from "./chatmessagecontentitemcachecontrol.js";
8
+ import { DatetimeServerTool$outboundSchema, } from "./datetimeservertool.js";
9
+ import { WebSearchServerTool$outboundSchema, } from "./websearchservertool.js";
10
+ import { WebSearchShorthand$outboundSchema, } from "./websearchshorthand.js";
6
11
  /** @internal */
7
- export const ToolDefinitionJsonFunction$outboundSchema = z.object({
12
+ export const ToolDefinitionJsonFunctionFunction$outboundSchema = z.object({
8
13
  name: z.string(),
9
14
  description: z.string().optional(),
10
- parameters: z.record(z.string(), z.any()).optional(),
15
+ parameters: z.record(z.string(), z.nullable(z.any())).optional(),
11
16
  strict: z.nullable(z.boolean()).optional(),
12
17
  });
13
- export function toolDefinitionJsonFunctionToJSON(toolDefinitionJsonFunction) {
14
- return JSON.stringify(ToolDefinitionJsonFunction$outboundSchema.parse(toolDefinitionJsonFunction));
18
+ export function toolDefinitionJsonFunctionFunctionToJSON(toolDefinitionJsonFunctionFunction) {
19
+ return JSON.stringify(ToolDefinitionJsonFunctionFunction$outboundSchema.parse(toolDefinitionJsonFunctionFunction));
15
20
  }
16
21
  /** @internal */
17
- export const ToolDefinitionJson$outboundSchema = z.object({
22
+ export const ToolDefinitionJsonFunction$outboundSchema = z.object({
18
23
  type: z.literal("function"),
19
- function: z.lazy(() => ToolDefinitionJsonFunction$outboundSchema),
24
+ function: z.lazy(() => ToolDefinitionJsonFunctionFunction$outboundSchema),
25
+ cacheControl: ChatMessageContentItemCacheControl$outboundSchema.optional(),
26
+ }).transform((v) => {
27
+ return remap$(v, {
28
+ cacheControl: "cache_control",
29
+ });
20
30
  });
31
+ export function toolDefinitionJsonFunctionToJSON(toolDefinitionJsonFunction) {
32
+ return JSON.stringify(ToolDefinitionJsonFunction$outboundSchema.parse(toolDefinitionJsonFunction));
33
+ }
34
+ /** @internal */
35
+ export const ToolDefinitionJson$outboundSchema = z.union([
36
+ z.lazy(() => ToolDefinitionJsonFunction$outboundSchema),
37
+ DatetimeServerTool$outboundSchema,
38
+ WebSearchServerTool$outboundSchema,
39
+ WebSearchShorthand$outboundSchema.and(z.object({ type: z.literal("web_search") })),
40
+ WebSearchShorthand$outboundSchema.and(z.object({ type: z.literal("web_search_preview") })),
41
+ WebSearchShorthand$outboundSchema.and(z.object({ type: z.literal("web_search_preview_2025_03_11") })),
42
+ WebSearchShorthand$outboundSchema.and(z.object({ type: z.literal("web_search_2025_08_26") })),
43
+ ]);
21
44
  export function toolDefinitionJsonToJSON(toolDefinitionJson) {
22
45
  return JSON.stringify(ToolDefinitionJson$outboundSchema.parse(toolDefinitionJson));
23
46
  }
@@ -1,9 +1,21 @@
1
1
  import * as z from "zod/v4";
2
2
  import { ChatMessageContentItem, ChatMessageContentItem$Outbound } from "./chatmessagecontentitem.js";
3
+ /**
4
+ * Tool response content
5
+ */
3
6
  export type ToolResponseMessageContent = string | Array<ChatMessageContentItem>;
7
+ /**
8
+ * Tool response message
9
+ */
4
10
  export type ToolResponseMessage = {
5
11
  role: "tool";
12
+ /**
13
+ * Tool response content
14
+ */
6
15
  content: string | Array<ChatMessageContentItem>;
16
+ /**
17
+ * ID of the assistant message tool call this message responds to
18
+ */
7
19
  toolCallId: string;
8
20
  };
9
21
  /** @internal */
@@ -1,9 +1,21 @@
1
1
  import * as z from "zod/v4";
2
2
  import { ChatMessageContentItem, ChatMessageContentItem$Outbound } from "./chatmessagecontentitem.js";
3
+ /**
4
+ * User message content
5
+ */
3
6
  export type UserMessageContent = string | Array<ChatMessageContentItem>;
7
+ /**
8
+ * User message
9
+ */
4
10
  export type UserMessage = {
5
11
  role: "user";
12
+ /**
13
+ * User message content
14
+ */
6
15
  content: string | Array<ChatMessageContentItem>;
16
+ /**
17
+ * Optional name for the user
18
+ */
7
19
  name?: string | undefined;
8
20
  };
9
21
  /** @internal */
@@ -0,0 +1,23 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ /**
5
+ * Video input object
6
+ */
7
+ export type VideoInput = {
8
+ /**
9
+ * URL of the video (data: URLs supported)
10
+ */
11
+ url: string;
12
+ };
13
+ /** @internal */
14
+ export declare const VideoInput$inboundSchema: z.ZodType<VideoInput, unknown>;
15
+ /** @internal */
16
+ export type VideoInput$Outbound = {
17
+ url: string;
18
+ };
19
+ /** @internal */
20
+ export declare const VideoInput$outboundSchema: z.ZodType<VideoInput$Outbound, VideoInput>;
21
+ export declare function videoInputToJSON(videoInput: VideoInput): string;
22
+ export declare function videoInputFromJSON(jsonString: string): SafeParseResult<VideoInput, SDKValidationError>;
23
+ //# sourceMappingURL=videoinput.d.ts.map
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: c9307d9d04a6
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ /** @internal */
8
+ export const VideoInput$inboundSchema = z
9
+ .object({
10
+ url: z.string(),
11
+ });
12
+ /** @internal */
13
+ export const VideoInput$outboundSchema = z.object({
14
+ url: z.string(),
15
+ });
16
+ export function videoInputToJSON(videoInput) {
17
+ return JSON.stringify(VideoInput$outboundSchema.parse(videoInput));
18
+ }
19
+ export function videoInputFromJSON(jsonString) {
20
+ return safeParse(jsonString, (x) => VideoInput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VideoInput' from JSON`);
21
+ }
22
+ //# sourceMappingURL=videoinput.js.map
@@ -6,6 +6,8 @@ import { OpenEnum } from "../types/enums.js";
6
6
  export declare const WebSearchEngine: {
7
7
  readonly Native: "native";
8
8
  readonly Exa: "exa";
9
+ readonly Firecrawl: "firecrawl";
10
+ readonly Parallel: "parallel";
9
11
  };
10
12
  /**
11
13
  * The search engine to use for web search.
@@ -9,6 +9,8 @@ import * as openEnums from "../types/enums.js";
9
9
  export const WebSearchEngine = {
10
10
  Native: "native",
11
11
  Exa: "exa",
12
+ Firecrawl: "firecrawl",
13
+ Parallel: "parallel",
12
14
  };
13
15
  /** @internal */
14
16
  export const WebSearchEngine$outboundSchema = openEnums.outboundSchema(WebSearchEngine);
@@ -0,0 +1,116 @@
1
+ import * as z from "zod/v4";
2
+ import { ClosedEnum, OpenEnum } from "../types/enums.js";
3
+ /**
4
+ * Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API.
5
+ */
6
+ export declare const WebSearchServerToolEngine: {
7
+ readonly Auto: "auto";
8
+ readonly Native: "native";
9
+ readonly Exa: "exa";
10
+ };
11
+ /**
12
+ * Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API.
13
+ */
14
+ export type WebSearchServerToolEngine = OpenEnum<typeof WebSearchServerToolEngine>;
15
+ /**
16
+ * How much context to retrieve per result. Defaults to medium (15000 chars).
17
+ */
18
+ export declare const WebSearchServerToolSearchContextSize: {
19
+ readonly Low: "low";
20
+ readonly Medium: "medium";
21
+ readonly High: "high";
22
+ };
23
+ /**
24
+ * How much context to retrieve per result. Defaults to medium (15000 chars).
25
+ */
26
+ export type WebSearchServerToolSearchContextSize = OpenEnum<typeof WebSearchServerToolSearchContextSize>;
27
+ export declare const WebSearchServerToolParametersType: {
28
+ readonly Approximate: "approximate";
29
+ };
30
+ export type WebSearchServerToolParametersType = ClosedEnum<typeof WebSearchServerToolParametersType>;
31
+ /**
32
+ * Approximate user location for location-biased results.
33
+ */
34
+ export type WebSearchServerToolUserLocation = {
35
+ type?: WebSearchServerToolParametersType | undefined;
36
+ city?: string | undefined;
37
+ region?: string | undefined;
38
+ country?: string | undefined;
39
+ timezone?: string | undefined;
40
+ };
41
+ export type WebSearchServerToolParameters = {
42
+ /**
43
+ * Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API.
44
+ */
45
+ engine?: WebSearchServerToolEngine | undefined;
46
+ /**
47
+ * Maximum number of search results to return per search call. Defaults to 5.
48
+ */
49
+ maxResults?: number | undefined;
50
+ /**
51
+ * Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops.
52
+ */
53
+ maxTotalResults?: number | undefined;
54
+ /**
55
+ * How much context to retrieve per result. Defaults to medium (15000 chars).
56
+ */
57
+ searchContextSize?: WebSearchServerToolSearchContextSize | undefined;
58
+ /**
59
+ * Approximate user location for location-biased results.
60
+ */
61
+ userLocation?: WebSearchServerToolUserLocation | undefined;
62
+ /**
63
+ * Limit search results to these domains.
64
+ */
65
+ allowedDomains?: Array<string> | undefined;
66
+ /**
67
+ * Exclude search results from these domains.
68
+ */
69
+ excludedDomains?: Array<string> | undefined;
70
+ };
71
+ /**
72
+ * OpenRouter built-in server tool: searches the web for current information
73
+ */
74
+ export type WebSearchServerTool = {
75
+ type: "openrouter:web_search";
76
+ parameters?: WebSearchServerToolParameters | undefined;
77
+ };
78
+ /** @internal */
79
+ export declare const WebSearchServerToolEngine$outboundSchema: z.ZodType<string, WebSearchServerToolEngine>;
80
+ /** @internal */
81
+ export declare const WebSearchServerToolSearchContextSize$outboundSchema: z.ZodType<string, WebSearchServerToolSearchContextSize>;
82
+ /** @internal */
83
+ export declare const WebSearchServerToolParametersType$outboundSchema: z.ZodEnum<typeof WebSearchServerToolParametersType>;
84
+ /** @internal */
85
+ export type WebSearchServerToolUserLocation$Outbound = {
86
+ type?: string | undefined;
87
+ city?: string | undefined;
88
+ region?: string | undefined;
89
+ country?: string | undefined;
90
+ timezone?: string | undefined;
91
+ };
92
+ /** @internal */
93
+ export declare const WebSearchServerToolUserLocation$outboundSchema: z.ZodType<WebSearchServerToolUserLocation$Outbound, WebSearchServerToolUserLocation>;
94
+ export declare function webSearchServerToolUserLocationToJSON(webSearchServerToolUserLocation: WebSearchServerToolUserLocation): string;
95
+ /** @internal */
96
+ export type WebSearchServerToolParameters$Outbound = {
97
+ engine?: string | undefined;
98
+ max_results?: number | undefined;
99
+ max_total_results?: number | undefined;
100
+ search_context_size?: string | undefined;
101
+ user_location?: WebSearchServerToolUserLocation$Outbound | undefined;
102
+ allowed_domains?: Array<string> | undefined;
103
+ excluded_domains?: Array<string> | undefined;
104
+ };
105
+ /** @internal */
106
+ export declare const WebSearchServerToolParameters$outboundSchema: z.ZodType<WebSearchServerToolParameters$Outbound, WebSearchServerToolParameters>;
107
+ export declare function webSearchServerToolParametersToJSON(webSearchServerToolParameters: WebSearchServerToolParameters): string;
108
+ /** @internal */
109
+ export type WebSearchServerTool$Outbound = {
110
+ type: "openrouter:web_search";
111
+ parameters?: WebSearchServerToolParameters$Outbound | undefined;
112
+ };
113
+ /** @internal */
114
+ export declare const WebSearchServerTool$outboundSchema: z.ZodType<WebSearchServerTool$Outbound, WebSearchServerTool>;
115
+ export declare function webSearchServerToolToJSON(webSearchServerTool: WebSearchServerTool): string;
116
+ //# sourceMappingURL=websearchservertool.d.ts.map