@openrouter/sdk 0.9.11 → 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 (274) 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.js +2 -1
  14. package/esm/funcs/creditsCreateCoinbaseCharge.js +2 -1
  15. package/esm/funcs/creditsGetCredits.js +2 -1
  16. package/esm/funcs/embeddingsGenerate.js +2 -1
  17. package/esm/funcs/embeddingsListModels.js +2 -1
  18. package/esm/funcs/endpointsList.js +2 -1
  19. package/esm/funcs/endpointsListZdrEndpoints.js +2 -1
  20. package/esm/funcs/generationsGetGeneration.js +2 -1
  21. package/esm/funcs/guardrailsBulkAssignKeys.js +2 -1
  22. package/esm/funcs/guardrailsBulkAssignMembers.js +2 -1
  23. package/esm/funcs/guardrailsBulkUnassignKeys.js +2 -1
  24. package/esm/funcs/guardrailsBulkUnassignMembers.js +2 -1
  25. package/esm/funcs/guardrailsCreate.js +2 -1
  26. package/esm/funcs/guardrailsDelete.js +2 -1
  27. package/esm/funcs/guardrailsGet.js +2 -1
  28. package/esm/funcs/guardrailsList.js +2 -1
  29. package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +2 -1
  30. package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +2 -1
  31. package/esm/funcs/guardrailsListKeyAssignments.js +2 -1
  32. package/esm/funcs/guardrailsListMemberAssignments.js +2 -1
  33. package/esm/funcs/guardrailsUpdate.js +2 -1
  34. package/esm/funcs/modelsCount.d.ts +1 -1
  35. package/esm/funcs/modelsCount.js +9 -4
  36. package/esm/funcs/modelsList.js +3 -1
  37. package/esm/funcs/modelsListForUser.js +2 -1
  38. package/esm/funcs/oAuthCreateAuthCode.d.ts +1 -1
  39. package/esm/funcs/oAuthCreateAuthCode.js +4 -3
  40. package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +2 -1
  41. package/esm/funcs/providersList.js +2 -1
  42. package/esm/index.d.ts +22 -23
  43. package/esm/index.js +20 -17
  44. package/esm/lib/anthropic-compat.d.ts +2 -1
  45. package/esm/lib/anthropic-compat.js +1 -2
  46. package/esm/lib/async-params.d.ts +19 -5
  47. package/esm/lib/async-params.js +5 -1
  48. package/esm/lib/chat-compat.d.ts +1 -1
  49. package/esm/lib/chat-compat.js +1 -2
  50. package/esm/lib/claude-type-guards.d.ts +2 -2
  51. package/esm/lib/config.d.ts +8 -10
  52. package/esm/lib/config.js +2 -2
  53. package/esm/lib/conversation-state.d.ts +1 -1
  54. package/esm/lib/conversation-state.js +35 -32
  55. package/esm/lib/env.d.ts +6 -2
  56. package/esm/lib/env.js +7 -3
  57. package/esm/lib/model-result.d.ts +73 -17
  58. package/esm/lib/model-result.js +329 -125
  59. package/esm/lib/sdks.d.ts +1 -1
  60. package/esm/lib/sdks.js +8 -28
  61. package/esm/lib/stream-transformers.d.ts +5 -4
  62. package/esm/lib/stream-transformers.js +24 -29
  63. package/esm/lib/stream-type-guards.js +8 -32
  64. package/esm/lib/tool-context.d.ts +68 -0
  65. package/esm/lib/tool-context.js +175 -0
  66. package/esm/lib/tool-executor.d.ts +9 -5
  67. package/esm/lib/tool-executor.js +26 -16
  68. package/esm/lib/tool-orchestrator.d.ts +2 -2
  69. package/esm/lib/tool-types.d.ts +101 -14
  70. package/esm/lib/tool-types.js +17 -0
  71. package/esm/lib/tool.d.ts +49 -60
  72. package/esm/lib/tool.js +15 -19
  73. package/esm/lib/turn-context.d.ts +1 -1
  74. package/esm/models/assistantmessage.d.ts +6 -0
  75. package/esm/models/assistantmessage.js +3 -0
  76. package/esm/models/chatcompletionaudiooutput.d.ts +38 -0
  77. package/esm/models/chatcompletionaudiooutput.js +36 -0
  78. package/esm/models/chatgenerationparams.d.ts +75 -6
  79. package/esm/models/chatgenerationparams.js +42 -0
  80. package/esm/models/chatmessagecontentitem.d.ts +3 -2
  81. package/esm/models/chatmessagecontentitem.js +3 -0
  82. package/esm/models/chatmessagecontentitemcachecontrol.d.ts +5 -5
  83. package/esm/models/chatmessagecontentitemcachecontrol.js +5 -7
  84. package/esm/models/chatmessagecontentitemfile.d.ts +57 -0
  85. package/esm/models/chatmessagecontentitemfile.js +59 -0
  86. package/esm/models/chatmessagetokenlogprobs.d.ts +1 -1
  87. package/esm/models/chatmessagetokenlogprobs.js +2 -1
  88. package/esm/models/chatresponse.d.ts +1 -1
  89. package/esm/models/chatresponse.js +1 -1
  90. package/esm/models/chatstreamingmessagechunk.d.ts +2 -0
  91. package/esm/models/chatstreamingmessagechunk.js +2 -0
  92. package/esm/models/chatstreamingresponsechunk.d.ts +1 -1
  93. package/esm/models/chatstreamingresponsechunk.js +1 -1
  94. package/esm/models/compoundfilter.d.ts +36 -0
  95. package/esm/models/compoundfilter.js +32 -0
  96. package/esm/models/conflictresponseerrordata.d.ts +17 -0
  97. package/esm/models/conflictresponseerrordata.js +16 -0
  98. package/esm/models/contextcompressionengine.d.ts +15 -0
  99. package/esm/models/contextcompressionengine.js +14 -0
  100. package/esm/models/datetimeservertool.d.ts +30 -0
  101. package/esm/models/datetimeservertool.js +22 -0
  102. package/esm/models/defaultparameters.d.ts +3 -0
  103. package/esm/models/defaultparameters.js +6 -0
  104. package/esm/models/errors/conflictresponseerror.d.ts +33 -0
  105. package/esm/models/errors/conflictresponseerror.js +42 -0
  106. package/esm/models/errors/index.d.ts +1 -0
  107. package/esm/models/errors/index.js +1 -0
  108. package/esm/models/index.d.ts +23 -4
  109. package/esm/models/index.js +23 -4
  110. package/esm/models/openairesponsesinputunion.d.ts +32 -1
  111. package/esm/models/openairesponsesinputunion.js +53 -1
  112. package/esm/models/openresponsesapplypatchtool.d.ts +20 -0
  113. package/esm/models/openresponsesapplypatchtool.js +21 -0
  114. package/esm/models/openresponsescodeinterpretertool.d.ts +68 -0
  115. package/esm/models/openresponsescodeinterpretertool.js +85 -0
  116. package/esm/models/openresponsescomputertool.d.ts +39 -0
  117. package/esm/models/openresponsescomputertool.js +50 -0
  118. package/esm/models/openresponsescustomtool.d.ts +75 -0
  119. package/esm/models/openresponsescustomtool.js +95 -0
  120. package/esm/models/openresponseseasyinputmessage.d.ts +30 -4
  121. package/esm/models/openresponseseasyinputmessage.js +28 -2
  122. package/esm/models/openresponsesfilesearchtool.d.ts +111 -0
  123. package/esm/models/openresponsesfilesearchtool.js +180 -0
  124. package/esm/models/openresponsesfunctioncalloutput.d.ts +46 -7
  125. package/esm/models/openresponsesfunctioncalloutput.js +56 -4
  126. package/esm/models/openresponsesfunctionshelltool.d.ts +20 -0
  127. package/esm/models/openresponsesfunctionshelltool.js +21 -0
  128. package/esm/models/openresponsesimagegenerationtool.d.ts +125 -0
  129. package/esm/models/openresponsesimagegenerationtool.js +153 -0
  130. package/esm/models/openresponsesinputmessageitem.d.ts +2 -2
  131. package/esm/models/openresponsesinputmessageitem.js +2 -2
  132. package/esm/models/openresponsesinputunion.d.ts +207 -0
  133. package/esm/models/openresponsesinputunion.js +225 -0
  134. package/esm/models/openresponseslocalshelltool.d.ts +20 -0
  135. package/esm/models/openresponseslocalshelltool.js +21 -0
  136. package/esm/models/openresponsesmcptool.d.ts +128 -0
  137. package/esm/models/openresponsesmcptool.js +173 -0
  138. package/esm/models/openresponsesnonstreamingresponse.d.ts +11 -2
  139. package/esm/models/openresponsesnonstreamingresponse.js +27 -0
  140. package/esm/models/openresponsesrequest.d.ts +53 -11
  141. package/esm/models/openresponsesrequest.js +51 -2
  142. package/esm/models/openresponsesstreamevent.d.ts +52 -4
  143. package/esm/models/openresponsesstreamevent.js +54 -3
  144. package/esm/models/openresponseswebsearch20250826tool.d.ts +29 -0
  145. package/esm/models/openresponseswebsearch20250826tool.js +23 -0
  146. package/esm/models/openresponseswebsearchcallcompleted.d.ts +16 -0
  147. package/esm/models/openresponseswebsearchcallcompleted.js +24 -0
  148. package/esm/models/openresponseswebsearchcallinprogress.d.ts +16 -0
  149. package/esm/models/openresponseswebsearchcallinprogress.js +24 -0
  150. package/esm/models/openresponseswebsearchcallsearching.d.ts +16 -0
  151. package/esm/models/openresponseswebsearchcallsearching.js +24 -0
  152. package/esm/models/openresponseswebsearchpreview20250311tool.d.ts +44 -0
  153. package/esm/models/openresponseswebsearchpreview20250311tool.js +51 -0
  154. package/esm/models/openresponseswebsearchpreviewtool.d.ts +44 -0
  155. package/esm/models/openresponseswebsearchpreviewtool.js +47 -0
  156. package/esm/models/openresponseswebsearchtool.d.ts +29 -0
  157. package/esm/models/openresponseswebsearchtool.js +23 -0
  158. package/esm/models/operations/bulkassignkeystoguardrail.d.ts +16 -3
  159. package/esm/models/operations/bulkassignkeystoguardrail.js +2 -2
  160. package/esm/models/operations/bulkassignmemberstoguardrail.d.ts +16 -3
  161. package/esm/models/operations/bulkassignmemberstoguardrail.js +2 -2
  162. package/esm/models/operations/bulkunassignkeysfromguardrail.d.ts +16 -3
  163. package/esm/models/operations/bulkunassignkeysfromguardrail.js +2 -2
  164. package/esm/models/operations/bulkunassignmembersfromguardrail.d.ts +16 -3
  165. package/esm/models/operations/bulkunassignmembersfromguardrail.js +2 -2
  166. package/esm/models/operations/createauthkeyscode.d.ts +16 -3
  167. package/esm/models/operations/createauthkeyscode.js +2 -2
  168. package/esm/models/operations/createcoinbasecharge.d.ts +16 -3
  169. package/esm/models/operations/createcoinbasecharge.js +2 -2
  170. package/esm/models/operations/createembeddings.d.ts +16 -3
  171. package/esm/models/operations/createembeddings.js +2 -2
  172. package/esm/models/operations/createguardrail.d.ts +25 -3
  173. package/esm/models/operations/createguardrail.js +6 -2
  174. package/esm/models/operations/createkeys.d.ts +16 -3
  175. package/esm/models/operations/createkeys.js +2 -2
  176. package/esm/models/operations/createresponses.d.ts +16 -3
  177. package/esm/models/operations/createresponses.js +2 -2
  178. package/esm/models/operations/deleteguardrail.d.ts +16 -3
  179. package/esm/models/operations/deleteguardrail.js +2 -2
  180. package/esm/models/operations/deletekeys.d.ts +16 -3
  181. package/esm/models/operations/deletekeys.js +2 -2
  182. package/esm/models/operations/exchangeauthcodeforapikey.d.ts +16 -3
  183. package/esm/models/operations/exchangeauthcodeforapikey.js +2 -2
  184. package/esm/models/operations/getcredits.d.ts +16 -3
  185. package/esm/models/operations/getcredits.js +2 -2
  186. package/esm/models/operations/getcurrentkey.d.ts +16 -3
  187. package/esm/models/operations/getcurrentkey.js +2 -2
  188. package/esm/models/operations/getgeneration.d.ts +25 -3
  189. package/esm/models/operations/getgeneration.js +7 -2
  190. package/esm/models/operations/getguardrail.d.ts +20 -3
  191. package/esm/models/operations/getguardrail.js +4 -2
  192. package/esm/models/operations/getkey.d.ts +16 -3
  193. package/esm/models/operations/getkey.js +2 -2
  194. package/esm/models/operations/getmodels.d.ts +21 -3
  195. package/esm/models/operations/getmodels.js +4 -2
  196. package/esm/models/operations/getuseractivity.d.ts +16 -3
  197. package/esm/models/operations/getuseractivity.js +2 -2
  198. package/esm/models/operations/list.d.ts +16 -3
  199. package/esm/models/operations/list.js +2 -2
  200. package/esm/models/operations/listembeddingsmodels.d.ts +16 -3
  201. package/esm/models/operations/listembeddingsmodels.js +2 -2
  202. package/esm/models/operations/listendpoints.d.ts +16 -3
  203. package/esm/models/operations/listendpoints.js +2 -2
  204. package/esm/models/operations/listendpointszdr.d.ts +16 -3
  205. package/esm/models/operations/listendpointszdr.js +2 -2
  206. package/esm/models/operations/listguardrailkeyassignments.d.ts +16 -3
  207. package/esm/models/operations/listguardrailkeyassignments.js +2 -2
  208. package/esm/models/operations/listguardrailmemberassignments.d.ts +16 -3
  209. package/esm/models/operations/listguardrailmemberassignments.js +2 -2
  210. package/esm/models/operations/listguardrails.d.ts +20 -3
  211. package/esm/models/operations/listguardrails.js +4 -2
  212. package/esm/models/operations/listkeyassignments.d.ts +16 -3
  213. package/esm/models/operations/listkeyassignments.js +2 -2
  214. package/esm/models/operations/listmemberassignments.d.ts +16 -3
  215. package/esm/models/operations/listmemberassignments.js +2 -2
  216. package/esm/models/operations/listmodelscount.d.ts +21 -3
  217. package/esm/models/operations/listmodelscount.js +4 -2
  218. package/esm/models/operations/listmodelsuser.d.ts +16 -3
  219. package/esm/models/operations/listmodelsuser.js +2 -2
  220. package/esm/models/operations/listproviders.d.ts +16 -3
  221. package/esm/models/operations/listproviders.js +2 -2
  222. package/esm/models/operations/sendchatcompletionrequest.d.ts +16 -3
  223. package/esm/models/operations/sendchatcompletionrequest.js +2 -2
  224. package/esm/models/operations/updateguardrail.d.ts +25 -3
  225. package/esm/models/operations/updateguardrail.js +6 -2
  226. package/esm/models/operations/updatekeys.d.ts +16 -3
  227. package/esm/models/operations/updatekeys.js +2 -2
  228. package/esm/models/outputmessage.d.ts +23 -0
  229. package/esm/models/outputmessage.js +24 -0
  230. package/esm/models/outputmodality.d.ts +1 -0
  231. package/esm/models/outputmodality.js +1 -0
  232. package/esm/models/providername.d.ts +1 -0
  233. package/esm/models/providername.js +1 -0
  234. package/esm/models/providerpreferences.d.ts +4 -0
  235. package/esm/models/providerpreferences.js +4 -0
  236. package/esm/models/providersort.d.ts +1 -0
  237. package/esm/models/providersort.js +1 -0
  238. package/esm/models/providersortconfig.d.ts +1 -0
  239. package/esm/models/providersortconfig.js +1 -0
  240. package/esm/models/responseoutputtext.d.ts +8 -8
  241. package/esm/models/responseoutputtext.js +10 -9
  242. package/esm/models/responsesoutputitem.d.ts +2 -13
  243. package/esm/models/responsesoutputitem.js +8 -6
  244. package/esm/models/responsesoutputitemreasoning.d.ts +2 -31
  245. package/esm/models/responsesoutputitemreasoning.js +2 -44
  246. package/esm/models/responsesoutputmessage.d.ts +24 -32
  247. package/esm/models/responsesoutputmessage.js +26 -47
  248. package/esm/models/responsesservertooloutput.d.ts +42 -0
  249. package/esm/models/responsesservertooloutput.js +44 -0
  250. package/esm/models/responseswebsearchcalloutput.d.ts +90 -5
  251. package/esm/models/responseswebsearchcalloutput.js +113 -5
  252. package/esm/models/responseswebsearchservertool.d.ts +35 -0
  253. package/esm/models/responseswebsearchservertool.js +28 -0
  254. package/esm/models/tooldefinitionjson.d.ts +38 -20
  255. package/esm/models/tooldefinitionjson.js +22 -11
  256. package/esm/models/websearchengine.d.ts +2 -0
  257. package/esm/models/websearchengine.js +2 -0
  258. package/esm/models/websearchservertool.d.ts +116 -0
  259. package/esm/models/websearchservertool.js +77 -0
  260. package/esm/models/websearchshorthand.d.ts +215 -0
  261. package/esm/models/websearchshorthand.js +138 -0
  262. package/esm/sdk/sdk.d.ts +4 -1
  263. package/esm/sdk/sdk.js +0 -1
  264. package/esm/types/index.d.ts +0 -2
  265. package/esm/types/index.js +0 -1
  266. package/jsr.json +1 -1
  267. package/package.json +11 -6
  268. package/turbo.json +10 -0
  269. package/esm/models/openresponsesinput.d.ts +0 -28
  270. package/esm/models/openresponsesinput.js +0 -54
  271. package/esm/models/openresponseslogprobs.d.ts +0 -16
  272. package/esm/models/openresponseslogprobs.js +0 -22
  273. package/esm/models/openresponsestoplogprobs.d.ts +0 -14
  274. package/esm/models/openresponsestoplogprobs.js +0 -15
@@ -0,0 +1,215 @@
1
+ import * as z from "zod/v4";
2
+ import { ClosedEnum, OpenEnum } from "../types/enums.js";
3
+ export declare const WebSearchShorthandType: {
4
+ readonly WebSearch: "web_search";
5
+ readonly WebSearchPreview: "web_search_preview";
6
+ readonly WebSearchPreview20250311: "web_search_preview_2025_03_11";
7
+ readonly WebSearch20250826: "web_search_2025_08_26";
8
+ };
9
+ export type WebSearchShorthandType = OpenEnum<typeof WebSearchShorthandType>;
10
+ /**
11
+ * 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.
12
+ */
13
+ export declare const WebSearchShorthandEngine: {
14
+ readonly Auto: "auto";
15
+ readonly Native: "native";
16
+ readonly Exa: "exa";
17
+ };
18
+ /**
19
+ * 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.
20
+ */
21
+ export type WebSearchShorthandEngine = OpenEnum<typeof WebSearchShorthandEngine>;
22
+ /**
23
+ * How much context to retrieve per result. Defaults to medium (15000 chars).
24
+ */
25
+ export declare const WebSearchShorthandSearchContextSize: {
26
+ readonly Low: "low";
27
+ readonly Medium: "medium";
28
+ readonly High: "high";
29
+ };
30
+ /**
31
+ * How much context to retrieve per result. Defaults to medium (15000 chars).
32
+ */
33
+ export type WebSearchShorthandSearchContextSize = OpenEnum<typeof WebSearchShorthandSearchContextSize>;
34
+ export declare const WebSearchShorthandTypeApproximate: {
35
+ readonly Approximate: "approximate";
36
+ };
37
+ export type WebSearchShorthandTypeApproximate = ClosedEnum<typeof WebSearchShorthandTypeApproximate>;
38
+ /**
39
+ * Approximate user location for location-biased results.
40
+ */
41
+ export type WebSearchShorthandUserLocation = {
42
+ type?: WebSearchShorthandTypeApproximate | undefined;
43
+ city?: string | undefined;
44
+ region?: string | undefined;
45
+ country?: string | undefined;
46
+ timezone?: string | undefined;
47
+ };
48
+ /**
49
+ * 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.
50
+ */
51
+ export declare const WebSearchShorthandParametersEngine: {
52
+ readonly Auto: "auto";
53
+ readonly Native: "native";
54
+ readonly Exa: "exa";
55
+ };
56
+ /**
57
+ * 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.
58
+ */
59
+ export type WebSearchShorthandParametersEngine = OpenEnum<typeof WebSearchShorthandParametersEngine>;
60
+ /**
61
+ * How much context to retrieve per result. Defaults to medium (15000 chars).
62
+ */
63
+ export declare const WebSearchShorthandParametersSearchContextSize: {
64
+ readonly Low: "low";
65
+ readonly Medium: "medium";
66
+ readonly High: "high";
67
+ };
68
+ /**
69
+ * How much context to retrieve per result. Defaults to medium (15000 chars).
70
+ */
71
+ export type WebSearchShorthandParametersSearchContextSize = OpenEnum<typeof WebSearchShorthandParametersSearchContextSize>;
72
+ export declare const WebSearchShorthandParametersType: {
73
+ readonly Approximate: "approximate";
74
+ };
75
+ export type WebSearchShorthandParametersType = ClosedEnum<typeof WebSearchShorthandParametersType>;
76
+ /**
77
+ * Approximate user location for location-biased results.
78
+ */
79
+ export type WebSearchShorthandParametersUserLocation = {
80
+ type?: WebSearchShorthandParametersType | undefined;
81
+ city?: string | undefined;
82
+ region?: string | undefined;
83
+ country?: string | undefined;
84
+ timezone?: string | undefined;
85
+ };
86
+ export type WebSearchShorthandParameters = {
87
+ /**
88
+ * 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.
89
+ */
90
+ engine?: WebSearchShorthandParametersEngine | undefined;
91
+ /**
92
+ * Maximum number of search results to return per search call. Defaults to 5.
93
+ */
94
+ maxResults?: number | undefined;
95
+ /**
96
+ * 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.
97
+ */
98
+ maxTotalResults?: number | undefined;
99
+ /**
100
+ * How much context to retrieve per result. Defaults to medium (15000 chars).
101
+ */
102
+ searchContextSize?: WebSearchShorthandParametersSearchContextSize | undefined;
103
+ /**
104
+ * Approximate user location for location-biased results.
105
+ */
106
+ userLocation?: WebSearchShorthandParametersUserLocation | undefined;
107
+ /**
108
+ * Limit search results to these domains.
109
+ */
110
+ allowedDomains?: Array<string> | undefined;
111
+ /**
112
+ * Exclude search results from these domains.
113
+ */
114
+ excludedDomains?: Array<string> | undefined;
115
+ };
116
+ /**
117
+ * Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.
118
+ */
119
+ export type WebSearchShorthand = {
120
+ type: WebSearchShorthandType;
121
+ /**
122
+ * 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.
123
+ */
124
+ engine?: WebSearchShorthandEngine | undefined;
125
+ /**
126
+ * Maximum number of search results to return per search call. Defaults to 5.
127
+ */
128
+ maxResults?: number | undefined;
129
+ /**
130
+ * 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.
131
+ */
132
+ maxTotalResults?: number | undefined;
133
+ /**
134
+ * How much context to retrieve per result. Defaults to medium (15000 chars).
135
+ */
136
+ searchContextSize?: WebSearchShorthandSearchContextSize | undefined;
137
+ /**
138
+ * Approximate user location for location-biased results.
139
+ */
140
+ userLocation?: WebSearchShorthandUserLocation | undefined;
141
+ /**
142
+ * Limit search results to these domains.
143
+ */
144
+ allowedDomains?: Array<string> | undefined;
145
+ /**
146
+ * Exclude search results from these domains.
147
+ */
148
+ excludedDomains?: Array<string> | undefined;
149
+ parameters?: WebSearchShorthandParameters | undefined;
150
+ };
151
+ /** @internal */
152
+ export declare const WebSearchShorthandType$outboundSchema: z.ZodType<string, WebSearchShorthandType>;
153
+ /** @internal */
154
+ export declare const WebSearchShorthandEngine$outboundSchema: z.ZodType<string, WebSearchShorthandEngine>;
155
+ /** @internal */
156
+ export declare const WebSearchShorthandSearchContextSize$outboundSchema: z.ZodType<string, WebSearchShorthandSearchContextSize>;
157
+ /** @internal */
158
+ export declare const WebSearchShorthandTypeApproximate$outboundSchema: z.ZodEnum<typeof WebSearchShorthandTypeApproximate>;
159
+ /** @internal */
160
+ export type WebSearchShorthandUserLocation$Outbound = {
161
+ type?: string | undefined;
162
+ city?: string | undefined;
163
+ region?: string | undefined;
164
+ country?: string | undefined;
165
+ timezone?: string | undefined;
166
+ };
167
+ /** @internal */
168
+ export declare const WebSearchShorthandUserLocation$outboundSchema: z.ZodType<WebSearchShorthandUserLocation$Outbound, WebSearchShorthandUserLocation>;
169
+ export declare function webSearchShorthandUserLocationToJSON(webSearchShorthandUserLocation: WebSearchShorthandUserLocation): string;
170
+ /** @internal */
171
+ export declare const WebSearchShorthandParametersEngine$outboundSchema: z.ZodType<string, WebSearchShorthandParametersEngine>;
172
+ /** @internal */
173
+ export declare const WebSearchShorthandParametersSearchContextSize$outboundSchema: z.ZodType<string, WebSearchShorthandParametersSearchContextSize>;
174
+ /** @internal */
175
+ export declare const WebSearchShorthandParametersType$outboundSchema: z.ZodEnum<typeof WebSearchShorthandParametersType>;
176
+ /** @internal */
177
+ export type WebSearchShorthandParametersUserLocation$Outbound = {
178
+ type?: string | undefined;
179
+ city?: string | undefined;
180
+ region?: string | undefined;
181
+ country?: string | undefined;
182
+ timezone?: string | undefined;
183
+ };
184
+ /** @internal */
185
+ export declare const WebSearchShorthandParametersUserLocation$outboundSchema: z.ZodType<WebSearchShorthandParametersUserLocation$Outbound, WebSearchShorthandParametersUserLocation>;
186
+ export declare function webSearchShorthandParametersUserLocationToJSON(webSearchShorthandParametersUserLocation: WebSearchShorthandParametersUserLocation): string;
187
+ /** @internal */
188
+ export type WebSearchShorthandParameters$Outbound = {
189
+ engine?: string | undefined;
190
+ max_results?: number | undefined;
191
+ max_total_results?: number | undefined;
192
+ search_context_size?: string | undefined;
193
+ user_location?: WebSearchShorthandParametersUserLocation$Outbound | undefined;
194
+ allowed_domains?: Array<string> | undefined;
195
+ excluded_domains?: Array<string> | undefined;
196
+ };
197
+ /** @internal */
198
+ export declare const WebSearchShorthandParameters$outboundSchema: z.ZodType<WebSearchShorthandParameters$Outbound, WebSearchShorthandParameters>;
199
+ export declare function webSearchShorthandParametersToJSON(webSearchShorthandParameters: WebSearchShorthandParameters): string;
200
+ /** @internal */
201
+ export type WebSearchShorthand$Outbound = {
202
+ type: string;
203
+ engine?: string | undefined;
204
+ max_results?: number | undefined;
205
+ max_total_results?: number | undefined;
206
+ search_context_size?: string | undefined;
207
+ user_location?: WebSearchShorthandUserLocation$Outbound | undefined;
208
+ allowed_domains?: Array<string> | undefined;
209
+ excluded_domains?: Array<string> | undefined;
210
+ parameters?: WebSearchShorthandParameters$Outbound | undefined;
211
+ };
212
+ /** @internal */
213
+ export declare const WebSearchShorthand$outboundSchema: z.ZodType<WebSearchShorthand$Outbound, WebSearchShorthand>;
214
+ export declare function webSearchShorthandToJSON(webSearchShorthand: WebSearchShorthand): string;
215
+ //# sourceMappingURL=websearchshorthand.d.ts.map
@@ -0,0 +1,138 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 1de0cb463e93
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import * as openEnums from "../types/enums.js";
8
+ export const WebSearchShorthandType = {
9
+ WebSearch: "web_search",
10
+ WebSearchPreview: "web_search_preview",
11
+ WebSearchPreview20250311: "web_search_preview_2025_03_11",
12
+ WebSearch20250826: "web_search_2025_08_26",
13
+ };
14
+ /**
15
+ * 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.
16
+ */
17
+ export const WebSearchShorthandEngine = {
18
+ Auto: "auto",
19
+ Native: "native",
20
+ Exa: "exa",
21
+ };
22
+ /**
23
+ * How much context to retrieve per result. Defaults to medium (15000 chars).
24
+ */
25
+ export const WebSearchShorthandSearchContextSize = {
26
+ Low: "low",
27
+ Medium: "medium",
28
+ High: "high",
29
+ };
30
+ export const WebSearchShorthandTypeApproximate = {
31
+ Approximate: "approximate",
32
+ };
33
+ /**
34
+ * 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.
35
+ */
36
+ export const WebSearchShorthandParametersEngine = {
37
+ Auto: "auto",
38
+ Native: "native",
39
+ Exa: "exa",
40
+ };
41
+ /**
42
+ * How much context to retrieve per result. Defaults to medium (15000 chars).
43
+ */
44
+ export const WebSearchShorthandParametersSearchContextSize = {
45
+ Low: "low",
46
+ Medium: "medium",
47
+ High: "high",
48
+ };
49
+ export const WebSearchShorthandParametersType = {
50
+ Approximate: "approximate",
51
+ };
52
+ /** @internal */
53
+ export const WebSearchShorthandType$outboundSchema = openEnums.outboundSchema(WebSearchShorthandType);
54
+ /** @internal */
55
+ export const WebSearchShorthandEngine$outboundSchema = openEnums.outboundSchema(WebSearchShorthandEngine);
56
+ /** @internal */
57
+ export const WebSearchShorthandSearchContextSize$outboundSchema = openEnums.outboundSchema(WebSearchShorthandSearchContextSize);
58
+ /** @internal */
59
+ export const WebSearchShorthandTypeApproximate$outboundSchema = z.enum(WebSearchShorthandTypeApproximate);
60
+ /** @internal */
61
+ export const WebSearchShorthandUserLocation$outboundSchema = z.object({
62
+ type: WebSearchShorthandTypeApproximate$outboundSchema.optional(),
63
+ city: z.string().optional(),
64
+ region: z.string().optional(),
65
+ country: z.string().optional(),
66
+ timezone: z.string().optional(),
67
+ });
68
+ export function webSearchShorthandUserLocationToJSON(webSearchShorthandUserLocation) {
69
+ return JSON.stringify(WebSearchShorthandUserLocation$outboundSchema.parse(webSearchShorthandUserLocation));
70
+ }
71
+ /** @internal */
72
+ export const WebSearchShorthandParametersEngine$outboundSchema = openEnums.outboundSchema(WebSearchShorthandParametersEngine);
73
+ /** @internal */
74
+ export const WebSearchShorthandParametersSearchContextSize$outboundSchema = openEnums
75
+ .outboundSchema(WebSearchShorthandParametersSearchContextSize);
76
+ /** @internal */
77
+ export const WebSearchShorthandParametersType$outboundSchema = z.enum(WebSearchShorthandParametersType);
78
+ /** @internal */
79
+ export const WebSearchShorthandParametersUserLocation$outboundSchema = z.object({
80
+ type: WebSearchShorthandParametersType$outboundSchema.optional(),
81
+ city: z.string().optional(),
82
+ region: z.string().optional(),
83
+ country: z.string().optional(),
84
+ timezone: z.string().optional(),
85
+ });
86
+ export function webSearchShorthandParametersUserLocationToJSON(webSearchShorthandParametersUserLocation) {
87
+ return JSON.stringify(WebSearchShorthandParametersUserLocation$outboundSchema.parse(webSearchShorthandParametersUserLocation));
88
+ }
89
+ /** @internal */
90
+ export const WebSearchShorthandParameters$outboundSchema = z.object({
91
+ engine: WebSearchShorthandParametersEngine$outboundSchema.optional(),
92
+ maxResults: z.number().optional(),
93
+ maxTotalResults: z.number().optional(),
94
+ searchContextSize: WebSearchShorthandParametersSearchContextSize$outboundSchema.optional(),
95
+ userLocation: z.lazy(() => WebSearchShorthandParametersUserLocation$outboundSchema).optional(),
96
+ allowedDomains: z.array(z.string()).optional(),
97
+ excludedDomains: z.array(z.string()).optional(),
98
+ }).transform((v) => {
99
+ return remap$(v, {
100
+ maxResults: "max_results",
101
+ maxTotalResults: "max_total_results",
102
+ searchContextSize: "search_context_size",
103
+ userLocation: "user_location",
104
+ allowedDomains: "allowed_domains",
105
+ excludedDomains: "excluded_domains",
106
+ });
107
+ });
108
+ export function webSearchShorthandParametersToJSON(webSearchShorthandParameters) {
109
+ return JSON.stringify(WebSearchShorthandParameters$outboundSchema.parse(webSearchShorthandParameters));
110
+ }
111
+ /** @internal */
112
+ export const WebSearchShorthand$outboundSchema = z.object({
113
+ type: WebSearchShorthandType$outboundSchema,
114
+ engine: WebSearchShorthandEngine$outboundSchema.optional(),
115
+ maxResults: z.number().optional(),
116
+ maxTotalResults: z.number().optional(),
117
+ searchContextSize: WebSearchShorthandSearchContextSize$outboundSchema
118
+ .optional(),
119
+ userLocation: z.lazy(() => WebSearchShorthandUserLocation$outboundSchema)
120
+ .optional(),
121
+ allowedDomains: z.array(z.string()).optional(),
122
+ excludedDomains: z.array(z.string()).optional(),
123
+ parameters: z.lazy(() => WebSearchShorthandParameters$outboundSchema)
124
+ .optional(),
125
+ }).transform((v) => {
126
+ return remap$(v, {
127
+ maxResults: "max_results",
128
+ maxTotalResults: "max_total_results",
129
+ searchContextSize: "search_context_size",
130
+ userLocation: "user_location",
131
+ allowedDomains: "allowed_domains",
132
+ excludedDomains: "excluded_domains",
133
+ });
134
+ });
135
+ export function webSearchShorthandToJSON(webSearchShorthand) {
136
+ return JSON.stringify(WebSearchShorthand$outboundSchema.parse(webSearchShorthand));
137
+ }
138
+ //# sourceMappingURL=websearchshorthand.js.map
package/esm/sdk/sdk.d.ts CHANGED
@@ -11,6 +11,7 @@ import { Guardrails } from "./guardrails.js";
11
11
  import { Models } from "./models.js";
12
12
  import { OAuth } from "./oauth.js";
13
13
  import { Providers } from "./providers.js";
14
+ import type { $ZodObject, $ZodShape, infer as zodInfer } from "zod/v4/core";
14
15
  import { type CallModelInput } from "../funcs/call-model.js";
15
16
  import type { ModelResult } from "../lib/model-result.js";
16
17
  import type { RequestOptions } from "../lib/sdks.js";
@@ -41,6 +42,8 @@ export declare class OpenRouter extends ClientSDK {
41
42
  get guardrails(): Guardrails;
42
43
  private _oAuth?;
43
44
  get oAuth(): OAuth;
44
- callModel<TTools extends readonly Tool[]>(request: CallModelInput<TTools>, options?: RequestOptions): ModelResult<TTools>;
45
+ callModel<TTools extends readonly Tool[], TSharedSchema extends $ZodObject<$ZodShape> | undefined = undefined, TShared extends Record<string, unknown> = TSharedSchema extends $ZodObject<$ZodShape> ? zodInfer<TSharedSchema> : Record<string, never>>(request: CallModelInput<TTools, TShared> & {
46
+ sharedContextSchema?: TSharedSchema;
47
+ }, options?: RequestOptions): ModelResult<TTools, TShared>;
45
48
  }
46
49
  //# sourceMappingURL=sdk.d.ts.map
package/esm/sdk/sdk.js CHANGED
@@ -15,7 +15,6 @@ import { Guardrails } from "./guardrails.js";
15
15
  import { Models } from "./models.js";
16
16
  import { OAuth } from "./oauth.js";
17
17
  import { Providers } from "./providers.js";
18
- // #region imports
19
18
  import { callModel as callModelFunc, } from "../funcs/call-model.js";
20
19
  import { ToolType } from "../lib/tool-types.js";
21
20
  export { ToolType };
@@ -5,6 +5,4 @@ export type { PageIterator, Paginator } from "./operations.js";
5
5
  export { createPageIterator } from "./operations.js";
6
6
  export { RFCDate } from "./rfcdate.js";
7
7
  export * from "./unrecognized.js";
8
- export type { ModelId, Variant, StaticVariant, VirtualVariant } from "./models.js";
9
- export { MODEL_HASH } from "./models.js";
10
8
  //# sourceMappingURL=index.d.ts.map
@@ -6,5 +6,4 @@ export { blobLikeSchema, isBlobLike } from "./blobs.js";
6
6
  export { createPageIterator } from "./operations.js";
7
7
  export { RFCDate } from "./rfcdate.js";
8
8
  export * from "./unrecognized.js";
9
- export { MODEL_HASH } from "./models.js";
10
9
  //# sourceMappingURL=index.js.map
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.9.11",
5
+ "version": "0.10.2",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "0.9.11",
3
+ "version": "0.10.2",
4
4
  "author": "OpenRouter",
5
5
  "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
6
6
  "keywords": [
@@ -19,6 +19,7 @@
19
19
  "llm"
20
20
  ],
21
21
  "license": "Apache-2.0",
22
+ "packageManager": "pnpm@10.22.0",
22
23
  "type": "module",
23
24
  "main": "./esm/index.js",
24
25
  "exports": {
@@ -67,14 +68,19 @@
67
68
  "scripts": {
68
69
  "lint": "eslint --cache --max-warnings=0 src",
69
70
  "build": "tsc",
70
- "typecheck": "tsc --noEmit",
71
71
  "prepublishOnly": "npm run build",
72
+ "compile": "tsc",
72
73
  "postinstall": "node scripts/check-types.js || true",
73
74
  "test": "vitest --run --project unit",
74
75
  "test:e2e": "vitest --run --project e2e",
75
- "test:watch": "vitest --watch --project unit"
76
+ "test:transit": "exit 0",
77
+ "test:watch": "vitest --watch --project unit",
78
+ "typecheck": "tsc --noEmit",
79
+ "typecheck:transit": "exit 0"
80
+ },
81
+ "peerDependencies": {
82
+
76
83
  },
77
- "peerDependencies": {},
78
84
  "devDependencies": {
79
85
  "@eslint/js": "^9.19.0",
80
86
  "@types/node": "^22.13.12",
@@ -87,6 +93,5 @@
87
93
  },
88
94
  "dependencies": {
89
95
  "zod": "^3.25.0 || ^4.0.0"
90
- },
91
- "packageManager": "pnpm@10.22.0"
96
+ }
92
97
  }
package/turbo.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://turbo.build/schema.json",
3
+ "extends": ["//"],
4
+ "tasks": {
5
+ "compile": {
6
+ "dependsOn": ["^compile"],
7
+ "outputs": ["esm/**"]
8
+ }
9
+ }
10
+ }
@@ -1,28 +0,0 @@
1
- import * as z from "zod/v4";
2
- import { OpenResponsesEasyInputMessage, OpenResponsesEasyInputMessage$Outbound } from "./openresponseseasyinputmessage.js";
3
- import { OpenResponsesFunctionCallOutput, OpenResponsesFunctionCallOutput$Outbound } from "./openresponsesfunctioncalloutput.js";
4
- import { OpenResponsesFunctionToolCall, OpenResponsesFunctionToolCall$Outbound } from "./openresponsesfunctiontoolcall.js";
5
- import { OpenResponsesInputMessageItem, OpenResponsesInputMessageItem$Outbound } from "./openresponsesinputmessageitem.js";
6
- import { OpenResponsesReasoning, OpenResponsesReasoning$Outbound } from "./openresponsesreasoning.js";
7
- import { ResponsesImageGenerationCall, ResponsesImageGenerationCall$Outbound } from "./responsesimagegenerationcall.js";
8
- import { ResponsesOutputItemFileSearchCall, ResponsesOutputItemFileSearchCall$Outbound } from "./responsesoutputitemfilesearchcall.js";
9
- import { ResponsesOutputItemFunctionCall, ResponsesOutputItemFunctionCall$Outbound } from "./responsesoutputitemfunctioncall.js";
10
- import { ResponsesOutputItemReasoning, ResponsesOutputItemReasoning$Outbound } from "./responsesoutputitemreasoning.js";
11
- import { ResponsesOutputMessage, ResponsesOutputMessage$Outbound } from "./responsesoutputmessage.js";
12
- import { ResponsesWebSearchCallOutput, ResponsesWebSearchCallOutput$Outbound } from "./responseswebsearchcalloutput.js";
13
- export type OpenResponsesInput1 = OpenResponsesFunctionToolCall | ResponsesOutputMessage | ResponsesOutputItemFunctionCall | ResponsesOutputItemFileSearchCall | OpenResponsesReasoning | OpenResponsesFunctionCallOutput | ResponsesOutputItemReasoning | ResponsesWebSearchCallOutput | ResponsesImageGenerationCall | OpenResponsesEasyInputMessage | OpenResponsesInputMessageItem;
14
- /**
15
- * Input for a response request - can be a string or array of items
16
- */
17
- export type OpenResponsesInput = string | Array<OpenResponsesFunctionToolCall | ResponsesOutputMessage | ResponsesOutputItemFunctionCall | ResponsesOutputItemFileSearchCall | OpenResponsesReasoning | OpenResponsesFunctionCallOutput | ResponsesOutputItemReasoning | ResponsesWebSearchCallOutput | ResponsesImageGenerationCall | OpenResponsesEasyInputMessage | OpenResponsesInputMessageItem>;
18
- /** @internal */
19
- export type OpenResponsesInput1$Outbound = OpenResponsesFunctionToolCall$Outbound | ResponsesOutputMessage$Outbound | ResponsesOutputItemFunctionCall$Outbound | ResponsesOutputItemFileSearchCall$Outbound | OpenResponsesReasoning$Outbound | OpenResponsesFunctionCallOutput$Outbound | ResponsesOutputItemReasoning$Outbound | ResponsesWebSearchCallOutput$Outbound | ResponsesImageGenerationCall$Outbound | OpenResponsesEasyInputMessage$Outbound | OpenResponsesInputMessageItem$Outbound;
20
- /** @internal */
21
- export declare const OpenResponsesInput1$outboundSchema: z.ZodType<OpenResponsesInput1$Outbound, OpenResponsesInput1>;
22
- export declare function openResponsesInput1ToJSON(openResponsesInput1: OpenResponsesInput1): string;
23
- /** @internal */
24
- export type OpenResponsesInput$Outbound = string | Array<OpenResponsesFunctionToolCall$Outbound | ResponsesOutputMessage$Outbound | ResponsesOutputItemFunctionCall$Outbound | ResponsesOutputItemFileSearchCall$Outbound | OpenResponsesReasoning$Outbound | OpenResponsesFunctionCallOutput$Outbound | ResponsesOutputItemReasoning$Outbound | ResponsesWebSearchCallOutput$Outbound | ResponsesImageGenerationCall$Outbound | OpenResponsesEasyInputMessage$Outbound | OpenResponsesInputMessageItem$Outbound>;
25
- /** @internal */
26
- export declare const OpenResponsesInput$outboundSchema: z.ZodType<OpenResponsesInput$Outbound, OpenResponsesInput>;
27
- export declare function openResponsesInputToJSON(openResponsesInput: OpenResponsesInput): string;
28
- //# sourceMappingURL=openresponsesinput.d.ts.map
@@ -1,54 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: cc6c94fdea13
4
- */
5
- import * as z from "zod/v4";
6
- import { OpenResponsesEasyInputMessage$outboundSchema, } from "./openresponseseasyinputmessage.js";
7
- import { OpenResponsesFunctionCallOutput$outboundSchema, } from "./openresponsesfunctioncalloutput.js";
8
- import { OpenResponsesFunctionToolCall$outboundSchema, } from "./openresponsesfunctiontoolcall.js";
9
- import { OpenResponsesInputMessageItem$outboundSchema, } from "./openresponsesinputmessageitem.js";
10
- import { OpenResponsesReasoning$outboundSchema, } from "./openresponsesreasoning.js";
11
- import { ResponsesImageGenerationCall$outboundSchema, } from "./responsesimagegenerationcall.js";
12
- import { ResponsesOutputItemFileSearchCall$outboundSchema, } from "./responsesoutputitemfilesearchcall.js";
13
- import { ResponsesOutputItemFunctionCall$outboundSchema, } from "./responsesoutputitemfunctioncall.js";
14
- import { ResponsesOutputItemReasoning$outboundSchema, } from "./responsesoutputitemreasoning.js";
15
- import { ResponsesOutputMessage$outboundSchema, } from "./responsesoutputmessage.js";
16
- import { ResponsesWebSearchCallOutput$outboundSchema, } from "./responseswebsearchcalloutput.js";
17
- /** @internal */
18
- export const OpenResponsesInput1$outboundSchema = z.union([
19
- OpenResponsesFunctionToolCall$outboundSchema,
20
- ResponsesOutputMessage$outboundSchema,
21
- ResponsesOutputItemFunctionCall$outboundSchema,
22
- ResponsesOutputItemFileSearchCall$outboundSchema,
23
- OpenResponsesReasoning$outboundSchema,
24
- OpenResponsesFunctionCallOutput$outboundSchema,
25
- ResponsesOutputItemReasoning$outboundSchema,
26
- ResponsesWebSearchCallOutput$outboundSchema,
27
- ResponsesImageGenerationCall$outboundSchema,
28
- OpenResponsesEasyInputMessage$outboundSchema,
29
- OpenResponsesInputMessageItem$outboundSchema,
30
- ]);
31
- export function openResponsesInput1ToJSON(openResponsesInput1) {
32
- return JSON.stringify(OpenResponsesInput1$outboundSchema.parse(openResponsesInput1));
33
- }
34
- /** @internal */
35
- export const OpenResponsesInput$outboundSchema = z.union([
36
- z.string(),
37
- z.array(z.union([
38
- OpenResponsesFunctionToolCall$outboundSchema,
39
- ResponsesOutputMessage$outboundSchema,
40
- ResponsesOutputItemFunctionCall$outboundSchema,
41
- ResponsesOutputItemFileSearchCall$outboundSchema,
42
- OpenResponsesReasoning$outboundSchema,
43
- OpenResponsesFunctionCallOutput$outboundSchema,
44
- ResponsesOutputItemReasoning$outboundSchema,
45
- ResponsesWebSearchCallOutput$outboundSchema,
46
- ResponsesImageGenerationCall$outboundSchema,
47
- OpenResponsesEasyInputMessage$outboundSchema,
48
- OpenResponsesInputMessageItem$outboundSchema,
49
- ])),
50
- ]);
51
- export function openResponsesInputToJSON(openResponsesInput) {
52
- return JSON.stringify(OpenResponsesInput$outboundSchema.parse(openResponsesInput));
53
- }
54
- //# sourceMappingURL=openresponsesinput.js.map
@@ -1,16 +0,0 @@
1
- import * as z from "zod/v4";
2
- import { Result as SafeParseResult } from "../types/fp.js";
3
- import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
- import { OpenResponsesTopLogprobs } from "./openresponsestoplogprobs.js";
5
- /**
6
- * Log probability information for a token
7
- */
8
- export type OpenResponsesLogProbs = {
9
- logprob: number;
10
- token: string;
11
- topLogprobs?: Array<OpenResponsesTopLogprobs> | undefined;
12
- };
13
- /** @internal */
14
- export declare const OpenResponsesLogProbs$inboundSchema: z.ZodType<OpenResponsesLogProbs, unknown>;
15
- export declare function openResponsesLogProbsFromJSON(jsonString: string): SafeParseResult<OpenResponsesLogProbs, SDKValidationError>;
16
- //# sourceMappingURL=openresponseslogprobs.d.ts.map
@@ -1,22 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 7ec69a3158fc
4
- */
5
- import * as z from "zod/v4";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
- import { safeParse } from "../lib/schemas.js";
8
- import { OpenResponsesTopLogprobs$inboundSchema, } from "./openresponsestoplogprobs.js";
9
- /** @internal */
10
- export const OpenResponsesLogProbs$inboundSchema = z.object({
11
- logprob: z.number(),
12
- token: z.string(),
13
- top_logprobs: z.array(OpenResponsesTopLogprobs$inboundSchema).optional(),
14
- }).transform((v) => {
15
- return remap$(v, {
16
- "top_logprobs": "topLogprobs",
17
- });
18
- });
19
- export function openResponsesLogProbsFromJSON(jsonString) {
20
- return safeParse(jsonString, (x) => OpenResponsesLogProbs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesLogProbs' from JSON`);
21
- }
22
- //# sourceMappingURL=openresponseslogprobs.js.map
@@ -1,14 +0,0 @@
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
- * Alternative token with its log probability
6
- */
7
- export type OpenResponsesTopLogprobs = {
8
- token?: string | undefined;
9
- logprob?: number | undefined;
10
- };
11
- /** @internal */
12
- export declare const OpenResponsesTopLogprobs$inboundSchema: z.ZodType<OpenResponsesTopLogprobs, unknown>;
13
- export declare function openResponsesTopLogprobsFromJSON(jsonString: string): SafeParseResult<OpenResponsesTopLogprobs, SDKValidationError>;
14
- //# sourceMappingURL=openresponsestoplogprobs.d.ts.map
@@ -1,15 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 9deb0a6359d1
4
- */
5
- import * as z from "zod/v4";
6
- import { safeParse } from "../lib/schemas.js";
7
- /** @internal */
8
- export const OpenResponsesTopLogprobs$inboundSchema = z.object({
9
- token: z.string().optional(),
10
- logprob: z.number().optional(),
11
- });
12
- export function openResponsesTopLogprobsFromJSON(jsonString) {
13
- return safeParse(jsonString, (x) => OpenResponsesTopLogprobs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesTopLogprobs' from JSON`);
14
- }
15
- //# sourceMappingURL=openresponsestoplogprobs.js.map