@mistralai/mistralai 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. package/README.md +45 -33
  2. package/RUNTIMES.md +1 -1
  3. package/esm/extra/structChat.js +1 -1
  4. package/esm/extra/structChat.js.map +1 -1
  5. package/esm/funcs/audioSpeechComplete.d.ts +22 -0
  6. package/esm/funcs/audioSpeechComplete.d.ts.map +1 -0
  7. package/esm/funcs/audioSpeechComplete.js +88 -0
  8. package/esm/funcs/audioSpeechComplete.js.map +1 -0
  9. package/esm/funcs/audioVoicesCreate.d.ts +18 -0
  10. package/esm/funcs/audioVoicesCreate.d.ts.map +1 -0
  11. package/esm/funcs/audioVoicesCreate.js +83 -0
  12. package/esm/funcs/audioVoicesCreate.js.map +1 -0
  13. package/esm/funcs/audioVoicesDelete.d.ts +19 -0
  14. package/esm/funcs/audioVoicesDelete.d.ts.map +1 -0
  15. package/esm/funcs/audioVoicesDelete.js +90 -0
  16. package/esm/funcs/audioVoicesDelete.js.map +1 -0
  17. package/esm/funcs/audioVoicesGet.d.ts +19 -0
  18. package/esm/funcs/audioVoicesGet.d.ts.map +1 -0
  19. package/esm/funcs/audioVoicesGet.js +89 -0
  20. package/esm/funcs/audioVoicesGet.js.map +1 -0
  21. package/esm/funcs/audioVoicesGetSampleAudio.d.ts +18 -0
  22. package/esm/funcs/audioVoicesGetSampleAudio.d.ts.map +1 -0
  23. package/esm/funcs/audioVoicesGetSampleAudio.js +91 -0
  24. package/esm/funcs/audioVoicesGetSampleAudio.js.map +1 -0
  25. package/esm/funcs/audioVoicesList.d.ts +19 -0
  26. package/esm/funcs/audioVoicesList.d.ts.map +1 -0
  27. package/esm/funcs/audioVoicesList.js +89 -0
  28. package/esm/funcs/audioVoicesList.js.map +1 -0
  29. package/esm/funcs/audioVoicesUpdate.d.ts +19 -0
  30. package/esm/funcs/audioVoicesUpdate.d.ts.map +1 -0
  31. package/esm/funcs/audioVoicesUpdate.js +93 -0
  32. package/esm/funcs/audioVoicesUpdate.js.map +1 -0
  33. package/esm/lib/config.d.ts +2 -2
  34. package/esm/lib/config.js +2 -2
  35. package/esm/models/components/agent.d.ts +28 -5
  36. package/esm/models/components/agent.d.ts.map +1 -1
  37. package/esm/models/components/agent.js +14 -13
  38. package/esm/models/components/agent.js.map +1 -1
  39. package/esm/models/components/agentconversation.d.ts +2 -3
  40. package/esm/models/components/agentconversation.d.ts.map +1 -1
  41. package/esm/models/components/agentconversation.js +2 -1
  42. package/esm/models/components/agentconversation.js.map +1 -1
  43. package/esm/models/components/agentscompletionrequest.d.ts +22 -2
  44. package/esm/models/components/agentscompletionrequest.d.ts.map +1 -1
  45. package/esm/models/components/agentscompletionrequest.js +62 -14
  46. package/esm/models/components/agentscompletionrequest.js.map +1 -1
  47. package/esm/models/components/agentscompletionstreamrequest.d.ts +22 -2
  48. package/esm/models/components/agentscompletionstreamrequest.d.ts.map +1 -1
  49. package/esm/models/components/agentscompletionstreamrequest.js +62 -14
  50. package/esm/models/components/agentscompletionstreamrequest.js.map +1 -1
  51. package/esm/models/components/basefielddefinition.d.ts +4 -4
  52. package/esm/models/components/basefielddefinition.d.ts.map +1 -1
  53. package/esm/models/components/basefielddefinition.js +3 -4
  54. package/esm/models/components/basefielddefinition.js.map +1 -1
  55. package/esm/models/components/chatcompletionrequest.d.ts +25 -2
  56. package/esm/models/components/chatcompletionrequest.d.ts.map +1 -1
  57. package/esm/models/components/chatcompletionrequest.js +63 -15
  58. package/esm/models/components/chatcompletionrequest.js.map +1 -1
  59. package/esm/models/components/chatcompletionstreamrequest.d.ts +25 -2
  60. package/esm/models/components/chatcompletionstreamrequest.d.ts.map +1 -1
  61. package/esm/models/components/chatcompletionstreamrequest.js +63 -15
  62. package/esm/models/components/chatcompletionstreamrequest.js.map +1 -1
  63. package/esm/models/components/codeinterpretertool.d.ts +11 -2
  64. package/esm/models/components/codeinterpretertool.d.ts.map +1 -1
  65. package/esm/models/components/codeinterpretertool.js +9 -2
  66. package/esm/models/components/codeinterpretertool.js.map +1 -1
  67. package/esm/models/components/completionargs.d.ts +3 -0
  68. package/esm/models/components/completionargs.d.ts.map +1 -1
  69. package/esm/models/components/completionargs.js +5 -0
  70. package/esm/models/components/completionargs.js.map +1 -1
  71. package/esm/models/components/conversationrequest.d.ts +55 -10
  72. package/esm/models/components/conversationrequest.d.ts.map +1 -1
  73. package/esm/models/components/conversationrequest.js +14 -13
  74. package/esm/models/components/conversationrequest.js.map +1 -1
  75. package/esm/models/components/conversationrestartrequest.d.ts +3 -6
  76. package/esm/models/components/conversationrestartrequest.d.ts.map +1 -1
  77. package/esm/models/components/conversationrestartrequest.js +2 -1
  78. package/esm/models/components/conversationrestartrequest.js.map +1 -1
  79. package/esm/models/components/conversationrestartstreamrequest.d.ts +3 -6
  80. package/esm/models/components/conversationrestartstreamrequest.d.ts.map +1 -1
  81. package/esm/models/components/conversationrestartstreamrequest.js +2 -1
  82. package/esm/models/components/conversationrestartstreamrequest.js.map +1 -1
  83. package/esm/models/components/conversationstreamrequest.d.ts +55 -10
  84. package/esm/models/components/conversationstreamrequest.d.ts.map +1 -1
  85. package/esm/models/components/conversationstreamrequest.js +14 -13
  86. package/esm/models/components/conversationstreamrequest.js.map +1 -1
  87. package/esm/models/components/createagentrequest.d.ts +55 -10
  88. package/esm/models/components/createagentrequest.d.ts.map +1 -1
  89. package/esm/models/components/createagentrequest.js +14 -13
  90. package/esm/models/components/createagentrequest.js.map +1 -1
  91. package/esm/models/components/customconnector.d.ts +11 -2
  92. package/esm/models/components/customconnector.d.ts.map +1 -1
  93. package/esm/models/components/customconnector.js +9 -2
  94. package/esm/models/components/customconnector.js.map +1 -1
  95. package/esm/models/components/documentlibrarytool.d.ts +11 -2
  96. package/esm/models/components/documentlibrarytool.d.ts.map +1 -1
  97. package/esm/models/components/documentlibrarytool.js +9 -2
  98. package/esm/models/components/documentlibrarytool.js.map +1 -1
  99. package/esm/models/components/imagegenerationtool.d.ts +11 -2
  100. package/esm/models/components/imagegenerationtool.d.ts.map +1 -1
  101. package/esm/models/components/imagegenerationtool.js +9 -2
  102. package/esm/models/components/imagegenerationtool.js.map +1 -1
  103. package/esm/models/components/index.d.ts +17 -0
  104. package/esm/models/components/index.d.ts.map +1 -1
  105. package/esm/models/components/index.js +17 -0
  106. package/esm/models/components/index.js.map +1 -1
  107. package/esm/models/components/internalmetadata.d.ts +42 -0
  108. package/esm/models/components/internalmetadata.d.ts.map +1 -0
  109. package/esm/models/components/internalmetadata.js +56 -0
  110. package/esm/models/components/internalmetadata.js.map +1 -0
  111. package/esm/models/components/messagetokens.d.ts +17 -0
  112. package/esm/models/components/messagetokens.d.ts.map +1 -0
  113. package/esm/models/components/messagetokens.js +25 -0
  114. package/esm/models/components/messagetokens.js.map +1 -0
  115. package/esm/models/components/metadatadict.d.ts +23 -0
  116. package/esm/models/components/metadatadict.d.ts.map +1 -0
  117. package/esm/models/components/metadatadict.js +23 -0
  118. package/esm/models/components/metadatadict.js.map +1 -0
  119. package/esm/models/components/mirrorconfig.d.ts +24 -0
  120. package/esm/models/components/mirrorconfig.d.ts.map +1 -0
  121. package/esm/models/components/mirrorconfig.js +32 -0
  122. package/esm/models/components/mirrorconfig.js.map +1 -0
  123. package/esm/models/components/mirrorsource.d.ts +28 -0
  124. package/esm/models/components/mirrorsource.d.ts.map +1 -0
  125. package/esm/models/components/mirrorsource.js +43 -0
  126. package/esm/models/components/mirrorsource.js.map +1 -0
  127. package/esm/models/components/modelcapabilities.d.ts +1 -0
  128. package/esm/models/components/modelcapabilities.d.ts.map +1 -1
  129. package/esm/models/components/modelcapabilities.js +1 -0
  130. package/esm/models/components/modelcapabilities.js.map +1 -1
  131. package/esm/models/components/modelconversation.d.ts +28 -5
  132. package/esm/models/components/modelconversation.d.ts.map +1 -1
  133. package/esm/models/components/modelconversation.js +14 -13
  134. package/esm/models/components/modelconversation.js.map +1 -1
  135. package/esm/models/components/prompttokensdetails.d.ts +15 -0
  136. package/esm/models/components/prompttokensdetails.d.ts.map +1 -0
  137. package/esm/models/components/prompttokensdetails.js +21 -0
  138. package/esm/models/components/prompttokensdetails.js.map +1 -0
  139. package/esm/models/components/reasoningeffort.d.ts +5 -3
  140. package/esm/models/components/reasoningeffort.d.ts.map +1 -1
  141. package/esm/models/components/reasoningeffort.js +4 -2
  142. package/esm/models/components/reasoningeffort.js.map +1 -1
  143. package/esm/models/components/roles.d.ts +12 -0
  144. package/esm/models/components/roles.d.ts.map +1 -0
  145. package/esm/models/components/roles.js +15 -0
  146. package/esm/models/components/roles.js.map +1 -0
  147. package/esm/models/components/speechoutputformat.d.ts +13 -0
  148. package/esm/models/components/speechoutputformat.d.ts.map +1 -0
  149. package/esm/models/components/speechoutputformat.js +15 -0
  150. package/esm/models/components/speechoutputformat.js.map +1 -0
  151. package/esm/models/components/speechrequest.d.ts +37 -0
  152. package/esm/models/components/speechrequest.d.ts.map +1 -0
  153. package/esm/models/components/speechrequest.js +30 -0
  154. package/esm/models/components/speechrequest.js.map +1 -0
  155. package/esm/models/components/speechstreamaudiodelta.d.ts +11 -0
  156. package/esm/models/components/speechstreamaudiodelta.d.ts.map +1 -0
  157. package/esm/models/components/speechstreamaudiodelta.js +20 -0
  158. package/esm/models/components/speechstreamaudiodelta.js.map +1 -0
  159. package/esm/models/components/speechstreamdone.d.ts +12 -0
  160. package/esm/models/components/speechstreamdone.d.ts.map +1 -0
  161. package/esm/models/components/speechstreamdone.js +16 -0
  162. package/esm/models/components/speechstreamdone.js.map +1 -0
  163. package/esm/models/components/speechstreameventtypes.d.ts +10 -0
  164. package/esm/models/components/speechstreameventtypes.d.ts.map +1 -0
  165. package/esm/models/components/speechstreameventtypes.js +12 -0
  166. package/esm/models/components/speechstreameventtypes.js.map +1 -0
  167. package/esm/models/components/updateagentrequest.d.ts +55 -10
  168. package/esm/models/components/updateagentrequest.d.ts.map +1 -1
  169. package/esm/models/components/updateagentrequest.js +14 -13
  170. package/esm/models/components/updateagentrequest.js.map +1 -1
  171. package/esm/models/components/usageinfodollardefs.d.ts +18 -0
  172. package/esm/models/components/usageinfodollardefs.d.ts.map +1 -0
  173. package/esm/models/components/usageinfodollardefs.js +36 -0
  174. package/esm/models/components/usageinfodollardefs.js.map +1 -0
  175. package/esm/models/components/voicecreaterequest.d.ts +39 -0
  176. package/esm/models/components/voicecreaterequest.d.ts.map +1 -0
  177. package/esm/models/components/voicecreaterequest.js +29 -0
  178. package/esm/models/components/voicecreaterequest.js.map +1 -0
  179. package/esm/models/components/voicelistresponse.d.ts +18 -0
  180. package/esm/models/components/voicelistresponse.d.ts.map +1 -0
  181. package/esm/models/components/voicelistresponse.js +25 -0
  182. package/esm/models/components/voicelistresponse.js.map +1 -0
  183. package/esm/models/components/voiceresponse.d.ts +23 -0
  184. package/esm/models/components/voiceresponse.d.ts.map +1 -0
  185. package/esm/models/components/voiceresponse.js +32 -0
  186. package/esm/models/components/voiceresponse.js.map +1 -0
  187. package/esm/models/components/voiceupdaterequest.d.ts +23 -0
  188. package/esm/models/components/voiceupdaterequest.d.ts.map +1 -0
  189. package/esm/models/components/voiceupdaterequest.js +17 -0
  190. package/esm/models/components/voiceupdaterequest.js.map +1 -0
  191. package/esm/models/components/websearchpremiumtool.d.ts +11 -2
  192. package/esm/models/components/websearchpremiumtool.d.ts.map +1 -1
  193. package/esm/models/components/websearchpremiumtool.js +9 -2
  194. package/esm/models/components/websearchpremiumtool.js.map +1 -1
  195. package/esm/models/components/websearchtool.d.ts +11 -2
  196. package/esm/models/components/websearchtool.d.ts.map +1 -1
  197. package/esm/models/components/websearchtool.js +9 -2
  198. package/esm/models/components/websearchtool.js.map +1 -1
  199. package/esm/models/operations/deletevoicev1audiovoicesvoiceiddelete.d.ts +12 -0
  200. package/esm/models/operations/deletevoicev1audiovoicesvoiceiddelete.d.ts.map +1 -0
  201. package/esm/models/operations/deletevoicev1audiovoicesvoiceiddelete.js +18 -0
  202. package/esm/models/operations/deletevoicev1audiovoicesvoiceiddelete.js.map +1 -0
  203. package/esm/models/operations/getvoicesampleaudiov1audiovoicesvoiceidsampleget.d.ts +12 -0
  204. package/esm/models/operations/getvoicesampleaudiov1audiovoicesvoiceidsampleget.d.ts.map +1 -0
  205. package/esm/models/operations/getvoicesampleaudiov1audiovoicesvoiceidsampleget.js +19 -0
  206. package/esm/models/operations/getvoicesampleaudiov1audiovoicesvoiceidsampleget.js.map +1 -0
  207. package/esm/models/operations/getvoicev1audiovoicesvoiceidget.d.ts +12 -0
  208. package/esm/models/operations/getvoicev1audiovoicesvoiceidget.d.ts.map +1 -0
  209. package/esm/models/operations/getvoicev1audiovoicesvoiceidget.js +18 -0
  210. package/esm/models/operations/getvoicev1audiovoicesvoiceidget.js.map +1 -0
  211. package/esm/models/operations/index.d.ts +6 -0
  212. package/esm/models/operations/index.d.ts.map +1 -1
  213. package/esm/models/operations/index.js +6 -0
  214. package/esm/models/operations/index.js.map +1 -1
  215. package/esm/models/operations/listvoicesv1audiovoicesget.d.ts +20 -0
  216. package/esm/models/operations/listvoicesv1audiovoicesget.d.ts.map +1 -0
  217. package/esm/models/operations/listvoicesv1audiovoicesget.js +14 -0
  218. package/esm/models/operations/listvoicesv1audiovoicesget.js.map +1 -0
  219. package/esm/models/operations/speechv1audiospeechpost.d.ts +37 -0
  220. package/esm/models/operations/speechv1audiospeechpost.d.ts.map +1 -0
  221. package/esm/models/operations/speechv1audiospeechpost.js +70 -0
  222. package/esm/models/operations/speechv1audiospeechpost.js.map +1 -0
  223. package/esm/models/operations/updatevoicev1audiovoicesvoiceidpatch.d.ts +15 -0
  224. package/esm/models/operations/updatevoicev1audiovoicesvoiceidpatch.d.ts.map +1 -0
  225. package/esm/models/operations/updatevoicev1audiovoicesvoiceidpatch.js +21 -0
  226. package/esm/models/operations/updatevoicev1audiovoicesvoiceidpatch.js.map +1 -0
  227. package/esm/sdk/audio.d.ts +6 -0
  228. package/esm/sdk/audio.d.ts.map +1 -1
  229. package/esm/sdk/audio.js +10 -0
  230. package/esm/sdk/audio.js.map +1 -1
  231. package/esm/sdk/sdk.d.ts +2 -2
  232. package/esm/sdk/sdk.d.ts.map +1 -1
  233. package/esm/sdk/sdk.js +4 -4
  234. package/esm/sdk/sdk.js.map +1 -1
  235. package/esm/sdk/speech.d.ts +14 -0
  236. package/esm/sdk/speech.d.ts.map +1 -0
  237. package/esm/sdk/speech.js +17 -0
  238. package/esm/sdk/speech.js.map +1 -0
  239. package/esm/sdk/voices.d.ts +48 -0
  240. package/esm/sdk/voices.d.ts.map +1 -0
  241. package/esm/sdk/voices.js +69 -0
  242. package/esm/sdk/voices.js.map +1 -0
  243. package/jsr.json +1 -1
  244. package/package.json +1 -1
  245. package/src/extra/structChat.ts +2 -2
  246. package/src/funcs/audioSpeechComplete.ts +175 -0
  247. package/src/funcs/audioVoicesCreate.ts +170 -0
  248. package/src/funcs/audioVoicesDelete.ts +179 -0
  249. package/src/funcs/audioVoicesGet.ts +180 -0
  250. package/src/funcs/audioVoicesGetSampleAudio.ts +180 -0
  251. package/src/funcs/audioVoicesList.ts +178 -0
  252. package/src/funcs/audioVoicesUpdate.ts +182 -0
  253. package/src/lib/config.ts +2 -2
  254. package/src/models/components/agent.ts +51 -26
  255. package/src/models/components/agentconversation.ts +3 -2
  256. package/src/models/components/agentscompletionrequest.ts +186 -16
  257. package/src/models/components/agentscompletionstreamrequest.ts +186 -16
  258. package/src/models/components/basefielddefinition.ts +8 -6
  259. package/src/models/components/chatcompletionrequest.ts +190 -17
  260. package/src/models/components/chatcompletionstreamrequest.ts +190 -17
  261. package/src/models/components/codeinterpretertool.ts +21 -4
  262. package/src/models/components/completionargs.ts +11 -0
  263. package/src/models/components/conversationrequest.ts +66 -39
  264. package/src/models/components/conversationrestartrequest.ts +8 -3
  265. package/src/models/components/conversationrestartstreamrequest.ts +8 -3
  266. package/src/models/components/conversationstreamrequest.ts +66 -39
  267. package/src/models/components/createagentrequest.ts +66 -39
  268. package/src/models/components/customconnector.ts +19 -4
  269. package/src/models/components/documentlibrarytool.ts +21 -4
  270. package/src/models/components/imagegenerationtool.ts +21 -4
  271. package/src/models/components/index.ts +17 -0
  272. package/src/models/components/internalmetadata.ts +126 -0
  273. package/src/models/components/messagetokens.ts +45 -0
  274. package/src/models/components/metadatadict.ts +55 -0
  275. package/src/models/components/mirrorconfig.ts +65 -0
  276. package/src/models/components/mirrorsource.ts +76 -0
  277. package/src/models/components/modelcapabilities.ts +2 -0
  278. package/src/models/components/modelconversation.ts +51 -26
  279. package/src/models/components/prompttokensdetails.ts +42 -0
  280. package/src/models/components/reasoningeffort.ts +12 -4
  281. package/src/models/components/roles.ts +20 -0
  282. package/src/models/components/speechoutputformat.ts +21 -0
  283. package/src/models/components/speechrequest.ts +74 -0
  284. package/src/models/components/speechstreamaudiodelta.ts +38 -0
  285. package/src/models/components/speechstreamdone.ts +37 -0
  286. package/src/models/components/speechstreameventtypes.ts +20 -0
  287. package/src/models/components/updateagentrequest.ts +66 -39
  288. package/src/models/components/usageinfodollardefs.ts +63 -0
  289. package/src/models/components/voicecreaterequest.ts +74 -0
  290. package/src/models/components/voicelistresponse.ts +49 -0
  291. package/src/models/components/voiceresponse.ts +59 -0
  292. package/src/models/components/voiceupdaterequest.ts +46 -0
  293. package/src/models/components/websearchpremiumtool.ts +21 -4
  294. package/src/models/components/websearchtool.ts +19 -4
  295. package/src/models/operations/deletevoicev1audiovoicesvoiceiddelete.ts +40 -0
  296. package/src/models/operations/getvoicesampleaudiov1audiovoicesvoiceidsampleget.ts +39 -0
  297. package/src/models/operations/getvoicev1audiovoicesvoiceidget.ts +39 -0
  298. package/src/models/operations/index.ts +6 -0
  299. package/src/models/operations/listvoicesv1audiovoicesget.ts +42 -0
  300. package/src/models/operations/speechv1audiospeechpost.ts +146 -0
  301. package/src/models/operations/updatevoicev1audiovoicesvoiceidpatch.ts +45 -0
  302. package/src/sdk/audio.ts +12 -0
  303. package/src/sdk/sdk.ts +5 -5
  304. package/src/sdk/speech.ts +31 -0
  305. package/src/sdk/voices.ts +119 -0
@@ -0,0 +1,126 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 5bb58674fbba
4
+ */
5
+
6
+ import * as z from "zod/v4";
7
+ import { remap as remap$ } from "../../lib/primitives.js";
8
+ import { safeParse } from "../../lib/schemas.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { smartUnion } from "../../types/smartUnion.js";
11
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
+ import {
13
+ MirrorConfig,
14
+ MirrorConfig$inboundSchema,
15
+ MirrorConfig$Outbound,
16
+ MirrorConfig$outboundSchema,
17
+ } from "./mirrorconfig.js";
18
+
19
+ export type InternalMetadataAgentVersion = string | number;
20
+
21
+ /**
22
+ * Typed structure for internal metadata.
23
+ */
24
+ export type InternalMetadata = {
25
+ agentId?: string | null | undefined;
26
+ agentVersion?: string | number | null | undefined;
27
+ mirrorConfig?: MirrorConfig | null | undefined;
28
+ scienceConfig?: { [k: string]: any } | null | undefined;
29
+ [additionalProperties: string]: unknown;
30
+ };
31
+
32
+ /** @internal */
33
+ export const InternalMetadataAgentVersion$inboundSchema: z.ZodType<
34
+ InternalMetadataAgentVersion,
35
+ unknown
36
+ > = smartUnion([z.string(), z.int()]);
37
+ /** @internal */
38
+ export type InternalMetadataAgentVersion$Outbound = string | number;
39
+
40
+ /** @internal */
41
+ export const InternalMetadataAgentVersion$outboundSchema: z.ZodType<
42
+ InternalMetadataAgentVersion$Outbound,
43
+ InternalMetadataAgentVersion
44
+ > = smartUnion([z.string(), z.int()]);
45
+
46
+ export function internalMetadataAgentVersionToJSON(
47
+ internalMetadataAgentVersion: InternalMetadataAgentVersion,
48
+ ): string {
49
+ return JSON.stringify(
50
+ InternalMetadataAgentVersion$outboundSchema.parse(
51
+ internalMetadataAgentVersion,
52
+ ),
53
+ );
54
+ }
55
+ export function internalMetadataAgentVersionFromJSON(
56
+ jsonString: string,
57
+ ): SafeParseResult<InternalMetadataAgentVersion, SDKValidationError> {
58
+ return safeParse(
59
+ jsonString,
60
+ (x) => InternalMetadataAgentVersion$inboundSchema.parse(JSON.parse(x)),
61
+ `Failed to parse 'InternalMetadataAgentVersion' from JSON`,
62
+ );
63
+ }
64
+
65
+ /** @internal */
66
+ export const InternalMetadata$inboundSchema: z.ZodType<
67
+ InternalMetadata,
68
+ unknown
69
+ > = z.object({
70
+ agent_id: z.nullable(z.string()).optional(),
71
+ agent_version: z.nullable(smartUnion([z.string(), z.int()])).optional(),
72
+ mirror_config: z.nullable(MirrorConfig$inboundSchema).optional(),
73
+ science_config: z.nullable(z.record(z.string(), z.any())).optional(),
74
+ }).catchall(z.any()).transform((v) => {
75
+ return remap$(v, {
76
+ "agent_id": "agentId",
77
+ "agent_version": "agentVersion",
78
+ "mirror_config": "mirrorConfig",
79
+ "science_config": "scienceConfig",
80
+ });
81
+ });
82
+ /** @internal */
83
+ export type InternalMetadata$Outbound = {
84
+ agent_id?: string | null | undefined;
85
+ agent_version?: string | number | null | undefined;
86
+ mirror_config?: MirrorConfig$Outbound | null | undefined;
87
+ science_config?: { [k: string]: any } | null | undefined;
88
+ [additionalProperties: string]: unknown;
89
+ };
90
+
91
+ /** @internal */
92
+ export const InternalMetadata$outboundSchema: z.ZodType<
93
+ InternalMetadata$Outbound,
94
+ InternalMetadata
95
+ > = z.object({
96
+ agentId: z.nullable(z.string()).optional(),
97
+ agentVersion: z.nullable(smartUnion([z.string(), z.int()])).optional(),
98
+ mirrorConfig: z.nullable(MirrorConfig$outboundSchema).optional(),
99
+ scienceConfig: z.nullable(z.record(z.string(), z.any())).optional(),
100
+ }).catchall(z.any()).transform((v) => {
101
+ return {
102
+ ...remap$(v, {
103
+ agentId: "agent_id",
104
+ agentVersion: "agent_version",
105
+ mirrorConfig: "mirror_config",
106
+ scienceConfig: "science_config",
107
+ }),
108
+ };
109
+ });
110
+
111
+ export function internalMetadataToJSON(
112
+ internalMetadata: InternalMetadata,
113
+ ): string {
114
+ return JSON.stringify(
115
+ InternalMetadata$outboundSchema.parse(internalMetadata),
116
+ );
117
+ }
118
+ export function internalMetadataFromJSON(
119
+ jsonString: string,
120
+ ): SafeParseResult<InternalMetadata, SDKValidationError> {
121
+ return safeParse(
122
+ jsonString,
123
+ (x) => InternalMetadata$inboundSchema.parse(JSON.parse(x)),
124
+ `Failed to parse 'InternalMetadata' from JSON`,
125
+ );
126
+ }
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: e56d14b1a3f2
4
+ */
5
+
6
+ import * as z from "zod/v4";
7
+ import { remap as remap$ } from "../../lib/primitives.js";
8
+ import { safeParse } from "../../lib/schemas.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import { Roles, Roles$inboundSchema } from "./roles.js";
12
+
13
+ /**
14
+ * Information on a single message included in a tokenized prompt as part of an InstructRequest.
15
+ */
16
+ export type MessageTokens = {
17
+ role: Roles;
18
+ totalTokens?: number | null | undefined;
19
+ truncated: boolean;
20
+ usageCount: number;
21
+ };
22
+
23
+ /** @internal */
24
+ export const MessageTokens$inboundSchema: z.ZodType<MessageTokens, unknown> = z
25
+ .object({
26
+ role: Roles$inboundSchema,
27
+ total_tokens: z.nullable(z.int()).optional(),
28
+ truncated: z.boolean().default(false),
29
+ usage_count: z.int().default(1),
30
+ }).transform((v) => {
31
+ return remap$(v, {
32
+ "total_tokens": "totalTokens",
33
+ "usage_count": "usageCount",
34
+ });
35
+ });
36
+
37
+ export function messageTokensFromJSON(
38
+ jsonString: string,
39
+ ): SafeParseResult<MessageTokens, SDKValidationError> {
40
+ return safeParse(
41
+ jsonString,
42
+ (x) => MessageTokens$inboundSchema.parse(JSON.parse(x)),
43
+ `Failed to parse 'MessageTokens' from JSON`,
44
+ );
45
+ }
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: a8e91799a548
4
+ */
5
+
6
+ import * as z from "zod/v4";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ InternalMetadata,
12
+ InternalMetadata$inboundSchema,
13
+ InternalMetadata$Outbound,
14
+ InternalMetadata$outboundSchema,
15
+ } from "./internalmetadata.js";
16
+
17
+ /**
18
+ * Custom type for metadata with embedded validation.
19
+ */
20
+ export type MetadataDict = {
21
+ internal?: InternalMetadata | null | undefined;
22
+ [additionalProperties: string]: unknown;
23
+ };
24
+
25
+ /** @internal */
26
+ export const MetadataDict$inboundSchema: z.ZodType<MetadataDict, unknown> = z
27
+ .object({
28
+ internal: z.nullable(InternalMetadata$inboundSchema).optional(),
29
+ }).catchall(z.any());
30
+ /** @internal */
31
+ export type MetadataDict$Outbound = {
32
+ internal?: InternalMetadata$Outbound | null | undefined;
33
+ [additionalProperties: string]: unknown;
34
+ };
35
+
36
+ /** @internal */
37
+ export const MetadataDict$outboundSchema: z.ZodType<
38
+ MetadataDict$Outbound,
39
+ MetadataDict
40
+ > = z.object({
41
+ internal: z.nullable(InternalMetadata$outboundSchema).optional(),
42
+ }).catchall(z.any());
43
+
44
+ export function metadataDictToJSON(metadataDict: MetadataDict): string {
45
+ return JSON.stringify(MetadataDict$outboundSchema.parse(metadataDict));
46
+ }
47
+ export function metadataDictFromJSON(
48
+ jsonString: string,
49
+ ): SafeParseResult<MetadataDict, SDKValidationError> {
50
+ return safeParse(
51
+ jsonString,
52
+ (x) => MetadataDict$inboundSchema.parse(JSON.parse(x)),
53
+ `Failed to parse 'MetadataDict' from JSON`,
54
+ );
55
+ }
@@ -0,0 +1,65 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: c8c262460c15
4
+ */
5
+
6
+ import * as z from "zod/v4";
7
+ import { remap as remap$ } from "../../lib/primitives.js";
8
+ import { safeParse } from "../../lib/schemas.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import {
12
+ MirrorSource,
13
+ MirrorSource$inboundSchema,
14
+ MirrorSource$Outbound,
15
+ MirrorSource$outboundSchema,
16
+ } from "./mirrorsource.js";
17
+
18
+ /**
19
+ * Configuration for mirroring behavior.
20
+ */
21
+ export type MirrorConfig = {
22
+ /**
23
+ * Source information for mirrored requests.
24
+ */
25
+ mirrorSource: MirrorSource;
26
+ };
27
+
28
+ /** @internal */
29
+ export const MirrorConfig$inboundSchema: z.ZodType<MirrorConfig, unknown> = z
30
+ .object({
31
+ mirror_source: MirrorSource$inboundSchema,
32
+ }).transform((v) => {
33
+ return remap$(v, {
34
+ "mirror_source": "mirrorSource",
35
+ });
36
+ });
37
+ /** @internal */
38
+ export type MirrorConfig$Outbound = {
39
+ mirror_source: MirrorSource$Outbound;
40
+ };
41
+
42
+ /** @internal */
43
+ export const MirrorConfig$outboundSchema: z.ZodType<
44
+ MirrorConfig$Outbound,
45
+ MirrorConfig
46
+ > = z.object({
47
+ mirrorSource: MirrorSource$outboundSchema,
48
+ }).transform((v) => {
49
+ return remap$(v, {
50
+ mirrorSource: "mirror_source",
51
+ });
52
+ });
53
+
54
+ export function mirrorConfigToJSON(mirrorConfig: MirrorConfig): string {
55
+ return JSON.stringify(MirrorConfig$outboundSchema.parse(mirrorConfig));
56
+ }
57
+ export function mirrorConfigFromJSON(
58
+ jsonString: string,
59
+ ): SafeParseResult<MirrorConfig, SDKValidationError> {
60
+ return safeParse(
61
+ jsonString,
62
+ (x) => MirrorConfig$inboundSchema.parse(JSON.parse(x)),
63
+ `Failed to parse 'MirrorConfig' from JSON`,
64
+ );
65
+ }
@@ -0,0 +1,76 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 3bd93f177873
4
+ */
5
+
6
+ import * as z from "zod/v4";
7
+ import { remap as remap$ } from "../../lib/primitives.js";
8
+ import { safeParse } from "../../lib/schemas.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ /**
13
+ * Source information for mirrored requests.
14
+ */
15
+ export type MirrorSource = {
16
+ app: string;
17
+ version?: string | null | undefined;
18
+ rootModelName: string;
19
+ mirrorModelName: string;
20
+ experimentId?: string | null | undefined;
21
+ };
22
+
23
+ /** @internal */
24
+ export const MirrorSource$inboundSchema: z.ZodType<MirrorSource, unknown> = z
25
+ .object({
26
+ app: z.string(),
27
+ version: z.nullable(z.string()).optional(),
28
+ root_model_name: z.string(),
29
+ mirror_model_name: z.string(),
30
+ experiment_id: z.nullable(z.string()).optional(),
31
+ }).transform((v) => {
32
+ return remap$(v, {
33
+ "root_model_name": "rootModelName",
34
+ "mirror_model_name": "mirrorModelName",
35
+ "experiment_id": "experimentId",
36
+ });
37
+ });
38
+ /** @internal */
39
+ export type MirrorSource$Outbound = {
40
+ app: string;
41
+ version?: string | null | undefined;
42
+ root_model_name: string;
43
+ mirror_model_name: string;
44
+ experiment_id?: string | null | undefined;
45
+ };
46
+
47
+ /** @internal */
48
+ export const MirrorSource$outboundSchema: z.ZodType<
49
+ MirrorSource$Outbound,
50
+ MirrorSource
51
+ > = z.object({
52
+ app: z.string(),
53
+ version: z.nullable(z.string()).optional(),
54
+ rootModelName: z.string(),
55
+ mirrorModelName: z.string(),
56
+ experimentId: z.nullable(z.string()).optional(),
57
+ }).transform((v) => {
58
+ return remap$(v, {
59
+ rootModelName: "root_model_name",
60
+ mirrorModelName: "mirror_model_name",
61
+ experimentId: "experiment_id",
62
+ });
63
+ });
64
+
65
+ export function mirrorSourceToJSON(mirrorSource: MirrorSource): string {
66
+ return JSON.stringify(MirrorSource$outboundSchema.parse(mirrorSource));
67
+ }
68
+ export function mirrorSourceFromJSON(
69
+ jsonString: string,
70
+ ): SafeParseResult<MirrorSource, SDKValidationError> {
71
+ return safeParse(
72
+ jsonString,
73
+ (x) => MirrorSource$inboundSchema.parse(JSON.parse(x)),
74
+ `Failed to parse 'MirrorSource' from JSON`,
75
+ );
76
+ }
@@ -18,6 +18,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
18
18
  export type ModelCapabilities = {
19
19
  completionChat: boolean;
20
20
  functionCalling: boolean;
21
+ reasoning: boolean;
21
22
  completionFim: boolean;
22
23
  fineTuning: boolean;
23
24
  vision: boolean;
@@ -37,6 +38,7 @@ export const ModelCapabilities$inboundSchema: z.ZodType<
37
38
  > = z.object({
38
39
  completion_chat: z.boolean().default(false),
39
40
  function_calling: z.boolean().default(false),
41
+ reasoning: z.boolean().default(false),
40
42
  completion_fim: z.boolean().default(false),
41
43
  fine_tuning: z.boolean().default(false),
42
44
  vision: z.boolean().default(false),
@@ -35,6 +35,7 @@ import {
35
35
  ImageGenerationTool,
36
36
  ImageGenerationTool$inboundSchema,
37
37
  } from "./imagegenerationtool.js";
38
+ import { MetadataDict, MetadataDict$inboundSchema } from "./metadatadict.js";
38
39
  import {
39
40
  WebSearchPremiumTool,
40
41
  WebSearchPremiumTool$inboundSchema,
@@ -42,13 +43,13 @@ import {
42
43
  import { WebSearchTool, WebSearchTool$inboundSchema } from "./websearchtool.js";
43
44
 
44
45
  export type ModelConversationTool =
45
- | CodeInterpreterTool
46
- | CustomConnector
47
- | DocumentLibraryTool
46
+ | (CodeInterpreterTool & { type: "code_interpreter" })
47
+ | (CustomConnector & { type: "connector" })
48
+ | (DocumentLibraryTool & { type: "document_library" })
48
49
  | FunctionTool
49
- | ImageGenerationTool
50
- | WebSearchTool
51
- | WebSearchPremiumTool
50
+ | (ImageGenerationTool & { type: "image_generation" })
51
+ | (WebSearchTool & { type: "web_search" })
52
+ | (WebSearchPremiumTool & { type: "web_search_premium" })
52
53
  | discriminatedUnionTypes.Unknown<"type">;
53
54
 
54
55
  export type ModelConversation = {
@@ -61,13 +62,13 @@ export type ModelConversation = {
61
62
  */
62
63
  tools?:
63
64
  | Array<
64
- | CodeInterpreterTool
65
- | CustomConnector
66
- | DocumentLibraryTool
65
+ | (CodeInterpreterTool & { type: "code_interpreter" })
66
+ | (CustomConnector & { type: "connector" })
67
+ | (DocumentLibraryTool & { type: "document_library" })
67
68
  | FunctionTool
68
- | ImageGenerationTool
69
- | WebSearchTool
70
- | WebSearchPremiumTool
69
+ | (ImageGenerationTool & { type: "image_generation" })
70
+ | (WebSearchTool & { type: "web_search" })
71
+ | (WebSearchPremiumTool & { type: "web_search_premium" })
71
72
  | discriminatedUnionTypes.Unknown<"type">
72
73
  >
73
74
  | undefined;
@@ -87,7 +88,7 @@ export type ModelConversation = {
87
88
  /**
88
89
  * Custom metadata for the conversation.
89
90
  */
90
- metadata?: { [k: string]: any } | null | undefined;
91
+ metadata?: MetadataDict | null | undefined;
91
92
  object: "conversation";
92
93
  id: string;
93
94
  createdAt: Date;
@@ -100,13 +101,25 @@ export const ModelConversationTool$inboundSchema: z.ZodType<
100
101
  ModelConversationTool,
101
102
  unknown
102
103
  > = discriminatedUnion("type", {
103
- code_interpreter: CodeInterpreterTool$inboundSchema,
104
- connector: CustomConnector$inboundSchema,
105
- document_library: DocumentLibraryTool$inboundSchema,
104
+ code_interpreter: CodeInterpreterTool$inboundSchema.and(
105
+ z.object({ type: z.literal("code_interpreter") }),
106
+ ),
107
+ connector: CustomConnector$inboundSchema.and(
108
+ z.object({ type: z.literal("connector") }),
109
+ ),
110
+ document_library: DocumentLibraryTool$inboundSchema.and(
111
+ z.object({ type: z.literal("document_library") }),
112
+ ),
106
113
  function: FunctionTool$inboundSchema,
107
- image_generation: ImageGenerationTool$inboundSchema,
108
- web_search: WebSearchTool$inboundSchema,
109
- web_search_premium: WebSearchPremiumTool$inboundSchema,
114
+ image_generation: ImageGenerationTool$inboundSchema.and(
115
+ z.object({ type: z.literal("image_generation") }),
116
+ ),
117
+ web_search: WebSearchTool$inboundSchema.and(
118
+ z.object({ type: z.literal("web_search") }),
119
+ ),
120
+ web_search_premium: WebSearchPremiumTool$inboundSchema.and(
121
+ z.object({ type: z.literal("web_search_premium") }),
122
+ ),
110
123
  });
111
124
 
112
125
  export function modelConversationToolFromJSON(
@@ -126,19 +139,31 @@ export const ModelConversation$inboundSchema: z.ZodType<
126
139
  > = z.object({
127
140
  instructions: z.nullable(z.string()).optional(),
128
141
  tools: z.array(discriminatedUnion("type", {
129
- code_interpreter: CodeInterpreterTool$inboundSchema,
130
- connector: CustomConnector$inboundSchema,
131
- document_library: DocumentLibraryTool$inboundSchema,
142
+ code_interpreter: CodeInterpreterTool$inboundSchema.and(
143
+ z.object({ type: z.literal("code_interpreter") }),
144
+ ),
145
+ connector: CustomConnector$inboundSchema.and(
146
+ z.object({ type: z.literal("connector") }),
147
+ ),
148
+ document_library: DocumentLibraryTool$inboundSchema.and(
149
+ z.object({ type: z.literal("document_library") }),
150
+ ),
132
151
  function: FunctionTool$inboundSchema,
133
- image_generation: ImageGenerationTool$inboundSchema,
134
- web_search: WebSearchTool$inboundSchema,
135
- web_search_premium: WebSearchPremiumTool$inboundSchema,
152
+ image_generation: ImageGenerationTool$inboundSchema.and(
153
+ z.object({ type: z.literal("image_generation") }),
154
+ ),
155
+ web_search: WebSearchTool$inboundSchema.and(
156
+ z.object({ type: z.literal("web_search") }),
157
+ ),
158
+ web_search_premium: WebSearchPremiumTool$inboundSchema.and(
159
+ z.object({ type: z.literal("web_search_premium") }),
160
+ ),
136
161
  })).optional(),
137
162
  completion_args: CompletionArgs$inboundSchema.optional(),
138
163
  guardrails: z.nullable(z.array(GuardrailConfig$inboundSchema)).optional(),
139
164
  name: z.nullable(z.string()).optional(),
140
165
  description: z.nullable(z.string()).optional(),
141
- metadata: z.nullable(z.record(z.string(), z.any())).optional(),
166
+ metadata: z.nullable(MetadataDict$inboundSchema).optional(),
142
167
  object: z.literal("conversation").default("conversation"),
143
168
  id: z.string(),
144
169
  created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)),
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 5d93876e4d19
4
+ */
5
+
6
+ import * as z from "zod/v4";
7
+ import { remap as remap$ } from "../../lib/primitives.js";
8
+ import { safeParse } from "../../lib/schemas.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import { MessageTokens, MessageTokens$inboundSchema } from "./messagetokens.js";
12
+
13
+ /**
14
+ * Token usage details for the prompt.
15
+ */
16
+ export type PromptTokensDetails = {
17
+ messages?: Array<MessageTokens> | undefined;
18
+ cachedTokens: number;
19
+ };
20
+
21
+ /** @internal */
22
+ export const PromptTokensDetails$inboundSchema: z.ZodType<
23
+ PromptTokensDetails,
24
+ unknown
25
+ > = z.object({
26
+ messages: z.array(MessageTokens$inboundSchema).optional(),
27
+ cached_tokens: z.int().default(0),
28
+ }).transform((v) => {
29
+ return remap$(v, {
30
+ "cached_tokens": "cachedTokens",
31
+ });
32
+ });
33
+
34
+ export function promptTokensDetailsFromJSON(
35
+ jsonString: string,
36
+ ): SafeParseResult<PromptTokensDetails, SDKValidationError> {
37
+ return safeParse(
38
+ jsonString,
39
+ (x) => PromptTokensDetails$inboundSchema.parse(JSON.parse(x)),
40
+ `Failed to parse 'PromptTokensDetails' from JSON`,
41
+ );
42
+ }
@@ -4,14 +4,22 @@
4
4
  */
5
5
 
6
6
  import * as z from "zod/v4";
7
- import { ClosedEnum } from "../../types/enums.js";
7
+ import * as openEnums from "../../types/enums.js";
8
+ import { OpenEnum } from "../../types/enums.js";
8
9
 
9
10
  export const ReasoningEffort = {
10
11
  None: "none",
11
12
  High: "high",
12
13
  } as const;
13
- export type ReasoningEffort = ClosedEnum<typeof ReasoningEffort>;
14
+ export type ReasoningEffort = OpenEnum<typeof ReasoningEffort>;
14
15
 
15
16
  /** @internal */
16
- export const ReasoningEffort$outboundSchema: z.ZodEnum<typeof ReasoningEffort> =
17
- z.enum(ReasoningEffort);
17
+ export const ReasoningEffort$inboundSchema: z.ZodType<
18
+ ReasoningEffort,
19
+ unknown
20
+ > = openEnums.inboundSchema(ReasoningEffort);
21
+ /** @internal */
22
+ export const ReasoningEffort$outboundSchema: z.ZodType<
23
+ string,
24
+ ReasoningEffort
25
+ > = openEnums.outboundSchema(ReasoningEffort);
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 14506aa40233
4
+ */
5
+
6
+ import * as z from "zod/v4";
7
+ import * as openEnums from "../../types/enums.js";
8
+ import { OpenEnum } from "../../types/enums.js";
9
+
10
+ export const Roles = {
11
+ System: "system",
12
+ User: "user",
13
+ Assistant: "assistant",
14
+ Tool: "tool",
15
+ } as const;
16
+ export type Roles = OpenEnum<typeof Roles>;
17
+
18
+ /** @internal */
19
+ export const Roles$inboundSchema: z.ZodType<Roles, unknown> = openEnums
20
+ .inboundSchema(Roles);
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 563b60b8536d
4
+ */
5
+
6
+ import * as z from "zod/v4";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+
9
+ export const SpeechOutputFormat = {
10
+ Pcm: "pcm",
11
+ Wav: "wav",
12
+ Mp3: "mp3",
13
+ Flac: "flac",
14
+ Opus: "opus",
15
+ } as const;
16
+ export type SpeechOutputFormat = ClosedEnum<typeof SpeechOutputFormat>;
17
+
18
+ /** @internal */
19
+ export const SpeechOutputFormat$outboundSchema: z.ZodEnum<
20
+ typeof SpeechOutputFormat
21
+ > = z.enum(SpeechOutputFormat);