@mistralai/mistralai 1.13.0 → 1.14.1

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 (586) hide show
  1. package/README.md +9 -3
  2. package/examples/src/async_audio_transcription_diarize.ts +17 -0
  3. package/examples/src/realtime_microphone.ts +163 -0
  4. package/examples/src/realtime_transcription.ts +225 -0
  5. package/extra/realtime/connection.d.ts +44 -0
  6. package/extra/realtime/connection.d.ts.map +1 -0
  7. package/extra/realtime/connection.js +299 -0
  8. package/extra/realtime/connection.js.map +1 -0
  9. package/extra/realtime/errors.d.ts +18 -0
  10. package/extra/realtime/errors.d.ts.map +1 -0
  11. package/extra/realtime/errors.js +21 -0
  12. package/extra/realtime/errors.js.map +1 -0
  13. package/extra/realtime/index.d.ts +15 -0
  14. package/extra/realtime/index.d.ts.map +1 -0
  15. package/extra/realtime/index.js +10 -0
  16. package/extra/realtime/index.js.map +1 -0
  17. package/extra/realtime/transcription.d.ts +17 -0
  18. package/extra/realtime/transcription.d.ts.map +1 -0
  19. package/extra/realtime/transcription.js +200 -0
  20. package/extra/realtime/transcription.js.map +1 -0
  21. package/extra/structChat.js.map +1 -1
  22. package/funcs/audioTranscriptionsComplete.js +6 -0
  23. package/funcs/audioTranscriptionsComplete.js.map +1 -1
  24. package/funcs/audioTranscriptionsStream.js +6 -0
  25. package/funcs/audioTranscriptionsStream.js.map +1 -1
  26. package/funcs/batchJobsList.js +1 -0
  27. package/funcs/batchJobsList.js.map +1 -1
  28. package/funcs/betaAgentsCreateVersionAlias.d.ts +19 -0
  29. package/funcs/betaAgentsCreateVersionAlias.d.ts.map +1 -0
  30. package/funcs/betaAgentsCreateVersionAlias.js +130 -0
  31. package/funcs/betaAgentsCreateVersionAlias.js.map +1 -0
  32. package/funcs/betaAgentsDeleteVersionAlias.d.ts +18 -0
  33. package/funcs/betaAgentsDeleteVersionAlias.d.ts.map +1 -0
  34. package/funcs/betaAgentsDeleteVersionAlias.js +128 -0
  35. package/funcs/betaAgentsDeleteVersionAlias.js.map +1 -0
  36. package/funcs/betaAgentsGet.d.ts +1 -1
  37. package/funcs/betaAgentsGet.js +1 -1
  38. package/funcs/betaAgentsGetVersion.js +1 -1
  39. package/funcs/betaAgentsGetVersion.js.map +1 -1
  40. package/funcs/betaAgentsList.js +1 -0
  41. package/funcs/betaAgentsList.js.map +1 -1
  42. package/funcs/betaAgentsListVersionAliases.d.ts +19 -0
  43. package/funcs/betaAgentsListVersionAliases.d.ts.map +1 -0
  44. package/funcs/betaAgentsListVersionAliases.js +126 -0
  45. package/funcs/betaAgentsListVersionAliases.js.map +1 -0
  46. package/funcs/filesList.js +1 -0
  47. package/funcs/filesList.js.map +1 -1
  48. package/jsr.json +1 -1
  49. package/lib/config.d.ts +2 -2
  50. package/lib/config.js +2 -2
  51. package/models/components/agent.d.ts +2 -8
  52. package/models/components/agent.d.ts.map +1 -1
  53. package/models/components/agent.js +4 -8
  54. package/models/components/agent.js.map +1 -1
  55. package/models/components/agentaliasresponse.d.ts +13 -0
  56. package/models/components/agentaliasresponse.d.ts.map +1 -0
  57. package/models/components/agentaliasresponse.js +59 -0
  58. package/models/components/agentaliasresponse.js.map +1 -0
  59. package/models/components/agentconversation.d.ts +5 -8
  60. package/models/components/agentconversation.d.ts.map +1 -1
  61. package/models/components/agentconversation.js +8 -7
  62. package/models/components/agentconversation.js.map +1 -1
  63. package/models/components/agentcreationrequest.d.ts +2 -0
  64. package/models/components/agentcreationrequest.d.ts.map +1 -1
  65. package/models/components/agentcreationrequest.js +2 -0
  66. package/models/components/agentcreationrequest.js.map +1 -1
  67. package/models/components/agenthandoffdoneevent.d.ts +1 -8
  68. package/models/components/agenthandoffdoneevent.d.ts.map +1 -1
  69. package/models/components/agenthandoffdoneevent.js +2 -7
  70. package/models/components/agenthandoffdoneevent.js.map +1 -1
  71. package/models/components/agenthandoffentry.d.ts +4 -21
  72. package/models/components/agenthandoffentry.d.ts.map +1 -1
  73. package/models/components/agenthandoffentry.js +5 -19
  74. package/models/components/agenthandoffentry.js.map +1 -1
  75. package/models/components/agenthandoffstartedevent.d.ts +1 -8
  76. package/models/components/agenthandoffstartedevent.d.ts.map +1 -1
  77. package/models/components/agenthandoffstartedevent.js +2 -7
  78. package/models/components/agenthandoffstartedevent.js.map +1 -1
  79. package/models/components/agentupdaterequest.d.ts +2 -0
  80. package/models/components/agentupdaterequest.d.ts.map +1 -1
  81. package/models/components/agentupdaterequest.js +2 -0
  82. package/models/components/agentupdaterequest.js.map +1 -1
  83. package/models/components/archiveftmodelout.d.ts +1 -8
  84. package/models/components/archiveftmodelout.d.ts.map +1 -1
  85. package/models/components/archiveftmodelout.js +2 -7
  86. package/models/components/archiveftmodelout.js.map +1 -1
  87. package/models/components/assistantmessage.d.ts +2 -11
  88. package/models/components/assistantmessage.d.ts.map +1 -1
  89. package/models/components/assistantmessage.js +3 -10
  90. package/models/components/assistantmessage.js.map +1 -1
  91. package/models/components/audiochunk.d.ts +2 -11
  92. package/models/components/audiochunk.d.ts.map +1 -1
  93. package/models/components/audiochunk.js +3 -10
  94. package/models/components/audiochunk.js.map +1 -1
  95. package/models/components/audiotranscriptionrequest.d.ts +4 -0
  96. package/models/components/audiotranscriptionrequest.d.ts.map +1 -1
  97. package/models/components/audiotranscriptionrequest.js +3 -0
  98. package/models/components/audiotranscriptionrequest.js.map +1 -1
  99. package/models/components/audiotranscriptionrequeststream.d.ts +4 -0
  100. package/models/components/audiotranscriptionrequeststream.d.ts.map +1 -1
  101. package/models/components/audiotranscriptionrequeststream.js +3 -0
  102. package/models/components/audiotranscriptionrequeststream.js.map +1 -1
  103. package/models/components/basemodelcard.d.ts +0 -7
  104. package/models/components/basemodelcard.d.ts.map +1 -1
  105. package/models/components/basemodelcard.js +1 -6
  106. package/models/components/basemodelcard.js.map +1 -1
  107. package/models/components/batchjobout.d.ts +1 -8
  108. package/models/components/batchjobout.d.ts.map +1 -1
  109. package/models/components/batchjobout.js +2 -7
  110. package/models/components/batchjobout.js.map +1 -1
  111. package/models/components/batchjobsout.d.ts +1 -8
  112. package/models/components/batchjobsout.d.ts.map +1 -1
  113. package/models/components/batchjobsout.js +2 -7
  114. package/models/components/batchjobsout.js.map +1 -1
  115. package/models/components/classifierdetailedjobout.d.ts +2 -17
  116. package/models/components/classifierdetailedjobout.d.ts.map +1 -1
  117. package/models/components/classifierdetailedjobout.js +3 -13
  118. package/models/components/classifierdetailedjobout.js.map +1 -1
  119. package/models/components/classifierftmodelout.d.ts +2 -15
  120. package/models/components/classifierftmodelout.d.ts.map +1 -1
  121. package/models/components/classifierftmodelout.js +3 -13
  122. package/models/components/classifierftmodelout.js.map +1 -1
  123. package/models/components/classifierjobout.d.ts +2 -29
  124. package/models/components/classifierjobout.d.ts.map +1 -1
  125. package/models/components/classifierjobout.js +3 -19
  126. package/models/components/classifierjobout.js.map +1 -1
  127. package/models/components/codeinterpretertool.d.ts +3 -0
  128. package/models/components/codeinterpretertool.d.ts.map +1 -1
  129. package/models/components/codeinterpretertool.js +12 -0
  130. package/models/components/codeinterpretertool.js.map +1 -1
  131. package/models/components/completiondetailedjobout.d.ts +2 -17
  132. package/models/components/completiondetailedjobout.d.ts.map +1 -1
  133. package/models/components/completiondetailedjobout.js +3 -13
  134. package/models/components/completiondetailedjobout.js.map +1 -1
  135. package/models/components/completionftmodelout.d.ts +2 -15
  136. package/models/components/completionftmodelout.d.ts.map +1 -1
  137. package/models/components/completionftmodelout.js +3 -14
  138. package/models/components/completionftmodelout.js.map +1 -1
  139. package/models/components/completionjobout.d.ts +2 -29
  140. package/models/components/completionjobout.d.ts.map +1 -1
  141. package/models/components/completionjobout.js +3 -20
  142. package/models/components/completionjobout.js.map +1 -1
  143. package/models/components/conversationappendrequest.d.ts +5 -2
  144. package/models/components/conversationappendrequest.d.ts.map +1 -1
  145. package/models/components/conversationappendrequest.js +5 -1
  146. package/models/components/conversationappendrequest.js.map +1 -1
  147. package/models/components/conversationappendstreamrequest.d.ts +5 -2
  148. package/models/components/conversationappendstreamrequest.d.ts.map +1 -1
  149. package/models/components/conversationappendstreamrequest.js +5 -1
  150. package/models/components/conversationappendstreamrequest.js.map +1 -1
  151. package/models/components/conversationhistory.d.ts +1 -8
  152. package/models/components/conversationhistory.d.ts.map +1 -1
  153. package/models/components/conversationhistory.js +2 -7
  154. package/models/components/conversationhistory.js.map +1 -1
  155. package/models/components/conversationmessages.d.ts +1 -8
  156. package/models/components/conversationmessages.d.ts.map +1 -1
  157. package/models/components/conversationmessages.js +2 -7
  158. package/models/components/conversationmessages.js.map +1 -1
  159. package/models/components/conversationrequest.d.ts +8 -2
  160. package/models/components/conversationrequest.d.ts.map +1 -1
  161. package/models/components/conversationrequest.js +8 -2
  162. package/models/components/conversationrequest.js.map +1 -1
  163. package/models/components/conversationresponse.d.ts +1 -8
  164. package/models/components/conversationresponse.d.ts.map +1 -1
  165. package/models/components/conversationresponse.js +2 -7
  166. package/models/components/conversationresponse.js.map +1 -1
  167. package/models/components/conversationrestartrequest.d.ts +13 -4
  168. package/models/components/conversationrestartrequest.d.ts.map +1 -1
  169. package/models/components/conversationrestartrequest.js +9 -3
  170. package/models/components/conversationrestartrequest.js.map +1 -1
  171. package/models/components/conversationrestartstreamrequest.d.ts +13 -4
  172. package/models/components/conversationrestartstreamrequest.d.ts.map +1 -1
  173. package/models/components/conversationrestartstreamrequest.js +9 -3
  174. package/models/components/conversationrestartstreamrequest.js.map +1 -1
  175. package/models/components/conversationstreamrequest.d.ts +8 -2
  176. package/models/components/conversationstreamrequest.d.ts.map +1 -1
  177. package/models/components/conversationstreamrequest.js +8 -2
  178. package/models/components/conversationstreamrequest.js.map +1 -1
  179. package/models/components/documentlibrarytool.d.ts +3 -0
  180. package/models/components/documentlibrarytool.d.ts.map +1 -1
  181. package/models/components/documentlibrarytool.js +5 -0
  182. package/models/components/documentlibrarytool.js.map +1 -1
  183. package/models/components/documentout.d.ts +1 -1
  184. package/models/components/documentout.d.ts.map +1 -1
  185. package/models/components/documentout.js +2 -2
  186. package/models/components/documentout.js.map +1 -1
  187. package/models/components/documenturlchunk.d.ts +2 -11
  188. package/models/components/documenturlchunk.d.ts.map +1 -1
  189. package/models/components/documenturlchunk.js +3 -10
  190. package/models/components/documenturlchunk.js.map +1 -1
  191. package/models/components/ftmodelcard.d.ts +0 -7
  192. package/models/components/ftmodelcard.d.ts.map +1 -1
  193. package/models/components/ftmodelcard.js +1 -6
  194. package/models/components/ftmodelcard.js.map +1 -1
  195. package/models/components/functioncallentry.d.ts +13 -17
  196. package/models/components/functioncallentry.d.ts.map +1 -1
  197. package/models/components/functioncallentry.js +15 -16
  198. package/models/components/functioncallentry.js.map +1 -1
  199. package/models/components/functioncallevent.d.ts +8 -5
  200. package/models/components/functioncallevent.d.ts.map +1 -1
  201. package/models/components/functioncallevent.js +9 -5
  202. package/models/components/functioncallevent.js.map +1 -1
  203. package/models/components/functionresultentry.d.ts +4 -21
  204. package/models/components/functionresultentry.d.ts.map +1 -1
  205. package/models/components/functionresultentry.js +5 -19
  206. package/models/components/functionresultentry.js.map +1 -1
  207. package/models/components/functiontool.d.ts +5 -5
  208. package/models/components/functiontool.d.ts.map +1 -1
  209. package/models/components/functiontool.js +6 -6
  210. package/models/components/functiontool.js.map +1 -1
  211. package/models/components/githubrepositoryin.d.ts +2 -9
  212. package/models/components/githubrepositoryin.d.ts.map +1 -1
  213. package/models/components/githubrepositoryin.js +2 -7
  214. package/models/components/githubrepositoryin.js.map +1 -1
  215. package/models/components/githubrepositoryout.d.ts +1 -8
  216. package/models/components/githubrepositoryout.d.ts.map +1 -1
  217. package/models/components/githubrepositoryout.js +2 -7
  218. package/models/components/githubrepositoryout.js.map +1 -1
  219. package/models/components/imagedetail.d.ts +13 -0
  220. package/models/components/imagedetail.d.ts.map +1 -0
  221. package/models/components/imagedetail.js +51 -0
  222. package/models/components/imagedetail.js.map +1 -0
  223. package/models/components/imagegenerationtool.d.ts +3 -0
  224. package/models/components/imagegenerationtool.d.ts.map +1 -1
  225. package/models/components/imagegenerationtool.js +12 -0
  226. package/models/components/imagegenerationtool.js.map +1 -1
  227. package/models/components/imageurl.d.ts +2 -1
  228. package/models/components/imageurl.d.ts.map +1 -1
  229. package/models/components/imageurl.js +3 -2
  230. package/models/components/imageurl.js.map +1 -1
  231. package/models/components/imageurlchunk.d.ts +2 -11
  232. package/models/components/imageurlchunk.d.ts.map +1 -1
  233. package/models/components/imageurlchunk.js +3 -10
  234. package/models/components/imageurlchunk.js.map +1 -1
  235. package/models/components/index.d.ts +14 -0
  236. package/models/components/index.d.ts.map +1 -1
  237. package/models/components/index.js +14 -0
  238. package/models/components/index.js.map +1 -1
  239. package/models/components/jobin.d.ts +0 -3
  240. package/models/components/jobin.d.ts.map +1 -1
  241. package/models/components/jobin.js.map +1 -1
  242. package/models/components/jobsout.d.ts +1 -8
  243. package/models/components/jobsout.d.ts.map +1 -1
  244. package/models/components/jobsout.js +2 -7
  245. package/models/components/jobsout.js.map +1 -1
  246. package/models/components/legacyjobmetadataout.d.ts +1 -8
  247. package/models/components/legacyjobmetadataout.d.ts.map +1 -1
  248. package/models/components/legacyjobmetadataout.js +2 -7
  249. package/models/components/legacyjobmetadataout.js.map +1 -1
  250. package/models/components/messageinputentry.d.ts +9 -25
  251. package/models/components/messageinputentry.d.ts.map +1 -1
  252. package/models/components/messageinputentry.js +10 -25
  253. package/models/components/messageinputentry.js.map +1 -1
  254. package/models/components/messageoutputentry.d.ts +6 -31
  255. package/models/components/messageoutputentry.d.ts.map +1 -1
  256. package/models/components/messageoutputentry.js +7 -28
  257. package/models/components/messageoutputentry.js.map +1 -1
  258. package/models/components/messageoutputevent.d.ts +2 -15
  259. package/models/components/messageoutputevent.d.ts.map +1 -1
  260. package/models/components/messageoutputevent.js +3 -13
  261. package/models/components/messageoutputevent.js.map +1 -1
  262. package/models/components/mistralpromptmode.d.ts +14 -0
  263. package/models/components/mistralpromptmode.d.ts.map +1 -1
  264. package/models/components/mistralpromptmode.js +7 -0
  265. package/models/components/mistralpromptmode.js.map +1 -1
  266. package/models/components/modelcapabilities.d.ts +1 -0
  267. package/models/components/modelcapabilities.d.ts.map +1 -1
  268. package/models/components/modelcapabilities.js +2 -0
  269. package/models/components/modelcapabilities.js.map +1 -1
  270. package/models/components/modelconversation.d.ts +1 -8
  271. package/models/components/modelconversation.d.ts.map +1 -1
  272. package/models/components/modelconversation.js +2 -7
  273. package/models/components/modelconversation.js.map +1 -1
  274. package/models/components/realtimetranscriptionerror.d.ts +20 -0
  275. package/models/components/realtimetranscriptionerror.d.ts.map +1 -0
  276. package/models/components/realtimetranscriptionerror.js +61 -0
  277. package/models/components/realtimetranscriptionerror.js.map +1 -0
  278. package/models/components/realtimetranscriptionerrordetail.d.ts +45 -0
  279. package/models/components/realtimetranscriptionerrordetail.d.ts.map +1 -0
  280. package/models/components/realtimetranscriptionerrordetail.js +72 -0
  281. package/models/components/realtimetranscriptionerrordetail.js.map +1 -0
  282. package/models/components/realtimetranscriptioninputaudioappend.d.ts +22 -0
  283. package/models/components/realtimetranscriptioninputaudioappend.d.ts.map +1 -0
  284. package/models/components/realtimetranscriptioninputaudioappend.js +60 -0
  285. package/models/components/realtimetranscriptioninputaudioappend.js.map +1 -0
  286. package/models/components/realtimetranscriptioninputaudioend.d.ts +17 -0
  287. package/models/components/realtimetranscriptioninputaudioend.d.ts.map +1 -0
  288. package/models/components/realtimetranscriptioninputaudioend.js +58 -0
  289. package/models/components/realtimetranscriptioninputaudioend.js.map +1 -0
  290. package/models/components/realtimetranscriptioninputaudioflush.d.ts +17 -0
  291. package/models/components/realtimetranscriptioninputaudioflush.d.ts.map +1 -0
  292. package/models/components/realtimetranscriptioninputaudioflush.js +58 -0
  293. package/models/components/realtimetranscriptioninputaudioflush.js.map +1 -0
  294. package/models/components/realtimetranscriptionsession.d.ts +24 -0
  295. package/models/components/realtimetranscriptionsession.d.ts.map +1 -0
  296. package/models/components/realtimetranscriptionsession.js +78 -0
  297. package/models/components/realtimetranscriptionsession.js.map +1 -0
  298. package/models/components/realtimetranscriptionsessioncreated.d.ts +20 -0
  299. package/models/components/realtimetranscriptionsessioncreated.d.ts.map +1 -0
  300. package/models/components/realtimetranscriptionsessioncreated.js +61 -0
  301. package/models/components/realtimetranscriptionsessioncreated.js.map +1 -0
  302. package/models/components/realtimetranscriptionsessionupdated.d.ts +20 -0
  303. package/models/components/realtimetranscriptionsessionupdated.d.ts.map +1 -0
  304. package/models/components/realtimetranscriptionsessionupdated.js +61 -0
  305. package/models/components/realtimetranscriptionsessionupdated.js.map +1 -0
  306. package/models/components/realtimetranscriptionsessionupdatemessage.d.ts +20 -0
  307. package/models/components/realtimetranscriptionsessionupdatemessage.d.ts.map +1 -0
  308. package/models/components/realtimetranscriptionsessionupdatemessage.js +61 -0
  309. package/models/components/realtimetranscriptionsessionupdatemessage.js.map +1 -0
  310. package/models/components/realtimetranscriptionsessionupdatepayload.d.ts +26 -0
  311. package/models/components/realtimetranscriptionsessionupdatepayload.d.ts.map +1 -0
  312. package/models/components/realtimetranscriptionsessionupdatepayload.js +72 -0
  313. package/models/components/realtimetranscriptionsessionupdatepayload.js.map +1 -0
  314. package/models/components/referencechunk.d.ts +2 -11
  315. package/models/components/referencechunk.d.ts.map +1 -1
  316. package/models/components/referencechunk.js +3 -10
  317. package/models/components/referencechunk.js.map +1 -1
  318. package/models/components/responsedoneevent.d.ts +1 -8
  319. package/models/components/responsedoneevent.d.ts.map +1 -1
  320. package/models/components/responsedoneevent.js +2 -7
  321. package/models/components/responsedoneevent.js.map +1 -1
  322. package/models/components/responseerrorevent.d.ts +1 -8
  323. package/models/components/responseerrorevent.d.ts.map +1 -1
  324. package/models/components/responseerrorevent.js +2 -7
  325. package/models/components/responseerrorevent.js.map +1 -1
  326. package/models/components/responsestartedevent.d.ts +1 -8
  327. package/models/components/responsestartedevent.d.ts.map +1 -1
  328. package/models/components/responsestartedevent.js +2 -7
  329. package/models/components/responsestartedevent.js.map +1 -1
  330. package/models/components/systemmessage.d.ts +2 -9
  331. package/models/components/systemmessage.d.ts.map +1 -1
  332. package/models/components/systemmessage.js +2 -7
  333. package/models/components/systemmessage.js.map +1 -1
  334. package/models/components/textchunk.d.ts +2 -11
  335. package/models/components/textchunk.d.ts.map +1 -1
  336. package/models/components/textchunk.js +3 -10
  337. package/models/components/textchunk.js.map +1 -1
  338. package/models/components/thinkchunk.d.ts +8 -20
  339. package/models/components/thinkchunk.d.ts.map +1 -1
  340. package/models/components/thinkchunk.js +10 -17
  341. package/models/components/thinkchunk.js.map +1 -1
  342. package/models/components/timestampgranularity.d.ts +1 -0
  343. package/models/components/timestampgranularity.d.ts.map +1 -1
  344. package/models/components/timestampgranularity.js +1 -0
  345. package/models/components/timestampgranularity.js.map +1 -1
  346. package/models/components/toolcallconfirmation.d.ts +22 -0
  347. package/models/components/toolcallconfirmation.d.ts.map +1 -0
  348. package/models/components/toolcallconfirmation.js +61 -0
  349. package/models/components/toolcallconfirmation.js.map +1 -0
  350. package/models/components/toolconfiguration.d.ts +21 -0
  351. package/models/components/toolconfiguration.d.ts.map +1 -0
  352. package/models/components/toolconfiguration.js +71 -0
  353. package/models/components/toolconfiguration.js.map +1 -0
  354. package/models/components/toolexecutiondeltaevent.d.ts +1 -8
  355. package/models/components/toolexecutiondeltaevent.d.ts.map +1 -1
  356. package/models/components/toolexecutiondeltaevent.js +2 -7
  357. package/models/components/toolexecutiondeltaevent.js.map +1 -1
  358. package/models/components/toolexecutiondoneevent.d.ts +1 -8
  359. package/models/components/toolexecutiondoneevent.d.ts.map +1 -1
  360. package/models/components/toolexecutiondoneevent.js +2 -7
  361. package/models/components/toolexecutiondoneevent.js.map +1 -1
  362. package/models/components/toolexecutionentry.d.ts +4 -21
  363. package/models/components/toolexecutionentry.d.ts.map +1 -1
  364. package/models/components/toolexecutionentry.js +5 -19
  365. package/models/components/toolexecutionentry.js.map +1 -1
  366. package/models/components/toolexecutionstartedevent.d.ts +1 -8
  367. package/models/components/toolexecutionstartedevent.d.ts.map +1 -1
  368. package/models/components/toolexecutionstartedevent.js +2 -7
  369. package/models/components/toolexecutionstartedevent.js.map +1 -1
  370. package/models/components/toolfilechunk.d.ts +2 -11
  371. package/models/components/toolfilechunk.d.ts.map +1 -1
  372. package/models/components/toolfilechunk.js +3 -10
  373. package/models/components/toolfilechunk.js.map +1 -1
  374. package/models/components/toolmessage.d.ts +2 -9
  375. package/models/components/toolmessage.d.ts.map +1 -1
  376. package/models/components/toolmessage.js +2 -7
  377. package/models/components/toolmessage.js.map +1 -1
  378. package/models/components/toolreferencechunk.d.ts +2 -11
  379. package/models/components/toolreferencechunk.d.ts.map +1 -1
  380. package/models/components/toolreferencechunk.js +3 -10
  381. package/models/components/toolreferencechunk.js.map +1 -1
  382. package/models/components/transcriptionsegmentchunk.d.ts +6 -11
  383. package/models/components/transcriptionsegmentchunk.d.ts.map +1 -1
  384. package/models/components/transcriptionsegmentchunk.js +13 -11
  385. package/models/components/transcriptionsegmentchunk.js.map +1 -1
  386. package/models/components/transcriptionstreamdone.d.ts +2 -11
  387. package/models/components/transcriptionstreamdone.d.ts.map +1 -1
  388. package/models/components/transcriptionstreamdone.js +3 -10
  389. package/models/components/transcriptionstreamdone.js.map +1 -1
  390. package/models/components/transcriptionstreamlanguage.d.ts +2 -11
  391. package/models/components/transcriptionstreamlanguage.d.ts.map +1 -1
  392. package/models/components/transcriptionstreamlanguage.js +3 -10
  393. package/models/components/transcriptionstreamlanguage.js.map +1 -1
  394. package/models/components/transcriptionstreamsegmentdelta.d.ts +2 -8
  395. package/models/components/transcriptionstreamsegmentdelta.d.ts.map +1 -1
  396. package/models/components/transcriptionstreamsegmentdelta.js +9 -8
  397. package/models/components/transcriptionstreamsegmentdelta.js.map +1 -1
  398. package/models/components/transcriptionstreamtextdelta.d.ts +2 -11
  399. package/models/components/transcriptionstreamtextdelta.d.ts.map +1 -1
  400. package/models/components/transcriptionstreamtextdelta.js +3 -10
  401. package/models/components/transcriptionstreamtextdelta.js.map +1 -1
  402. package/models/components/unarchiveftmodelout.d.ts +1 -8
  403. package/models/components/unarchiveftmodelout.d.ts.map +1 -1
  404. package/models/components/unarchiveftmodelout.js +2 -7
  405. package/models/components/unarchiveftmodelout.js.map +1 -1
  406. package/models/components/usermessage.d.ts +2 -9
  407. package/models/components/usermessage.d.ts.map +1 -1
  408. package/models/components/usermessage.js +2 -7
  409. package/models/components/usermessage.js.map +1 -1
  410. package/models/components/wandbintegration.d.ts +2 -9
  411. package/models/components/wandbintegration.d.ts.map +1 -1
  412. package/models/components/wandbintegration.js +2 -7
  413. package/models/components/wandbintegration.js.map +1 -1
  414. package/models/components/wandbintegrationout.d.ts +1 -8
  415. package/models/components/wandbintegrationout.d.ts.map +1 -1
  416. package/models/components/wandbintegrationout.js +2 -7
  417. package/models/components/wandbintegrationout.js.map +1 -1
  418. package/models/components/websearchpremiumtool.d.ts +3 -0
  419. package/models/components/websearchpremiumtool.d.ts.map +1 -1
  420. package/models/components/websearchpremiumtool.js +12 -0
  421. package/models/components/websearchpremiumtool.js.map +1 -1
  422. package/models/components/websearchtool.d.ts +3 -0
  423. package/models/components/websearchtool.d.ts.map +1 -1
  424. package/models/components/websearchtool.js +12 -0
  425. package/models/components/websearchtool.js.map +1 -1
  426. package/models/operations/agentsapiv1agentscreateorupdatealias.d.ts +16 -0
  427. package/models/operations/agentsapiv1agentscreateorupdatealias.d.ts.map +1 -0
  428. package/models/operations/agentsapiv1agentscreateorupdatealias.js +56 -0
  429. package/models/operations/agentsapiv1agentscreateorupdatealias.js.map +1 -0
  430. package/models/operations/agentsapiv1agentsdeletealias.d.ts +14 -0
  431. package/models/operations/agentsapiv1agentsdeletealias.d.ts.map +1 -0
  432. package/models/operations/agentsapiv1agentsdeletealias.js +55 -0
  433. package/models/operations/agentsapiv1agentsdeletealias.js.map +1 -0
  434. package/models/operations/agentsapiv1agentsget.d.ts +8 -2
  435. package/models/operations/agentsapiv1agentsget.d.ts.map +1 -1
  436. package/models/operations/agentsapiv1agentsget.js +8 -2
  437. package/models/operations/agentsapiv1agentsget.js.map +1 -1
  438. package/models/operations/agentsapiv1agentsgetversion.d.ts +2 -2
  439. package/models/operations/agentsapiv1agentsgetversion.js +1 -1
  440. package/models/operations/agentsapiv1agentsgetversion.js.map +1 -1
  441. package/models/operations/agentsapiv1agentslist.d.ts +8 -0
  442. package/models/operations/agentsapiv1agentslist.d.ts.map +1 -1
  443. package/models/operations/agentsapiv1agentslist.js +1 -0
  444. package/models/operations/agentsapiv1agentslist.js.map +1 -1
  445. package/models/operations/agentsapiv1agentslistversionaliases.d.ts +12 -0
  446. package/models/operations/agentsapiv1agentslistversionaliases.d.ts.map +1 -0
  447. package/models/operations/agentsapiv1agentslistversionaliases.js +54 -0
  448. package/models/operations/agentsapiv1agentslistversionaliases.js.map +1 -0
  449. package/models/operations/filesapirouteslistfiles.d.ts +2 -0
  450. package/models/operations/filesapirouteslistfiles.d.ts.map +1 -1
  451. package/models/operations/filesapirouteslistfiles.js +1 -0
  452. package/models/operations/filesapirouteslistfiles.js.map +1 -1
  453. package/models/operations/index.d.ts +3 -0
  454. package/models/operations/index.d.ts.map +1 -1
  455. package/models/operations/index.js +3 -0
  456. package/models/operations/index.js.map +1 -1
  457. package/models/operations/jobsapiroutesbatchgetbatchjobs.d.ts +10 -0
  458. package/models/operations/jobsapiroutesbatchgetbatchjobs.d.ts.map +1 -1
  459. package/models/operations/jobsapiroutesbatchgetbatchjobs.js +10 -1
  460. package/models/operations/jobsapiroutesbatchgetbatchjobs.js.map +1 -1
  461. package/package.json +4 -1
  462. package/sdk/mistralagents.d.ts +22 -1
  463. package/sdk/mistralagents.d.ts.map +1 -1
  464. package/sdk/mistralagents.js +31 -1
  465. package/sdk/mistralagents.js.map +1 -1
  466. package/src/extra/realtime/connection.ts +459 -0
  467. package/src/extra/realtime/errors.ts +32 -0
  468. package/src/extra/realtime/index.ts +32 -0
  469. package/src/extra/realtime/transcription.ts +291 -0
  470. package/src/extra/structChat.ts +2 -2
  471. package/src/funcs/audioTranscriptionsComplete.ts +6 -0
  472. package/src/funcs/audioTranscriptionsStream.ts +6 -0
  473. package/src/funcs/batchJobsList.ts +1 -0
  474. package/src/funcs/betaAgentsCreateVersionAlias.ts +184 -0
  475. package/src/funcs/betaAgentsDeleteVersionAlias.ts +184 -0
  476. package/src/funcs/betaAgentsGet.ts +1 -1
  477. package/src/funcs/betaAgentsGetVersion.ts +1 -1
  478. package/src/funcs/betaAgentsList.ts +1 -0
  479. package/src/funcs/betaAgentsListVersionAliases.ts +179 -0
  480. package/src/funcs/filesList.ts +1 -0
  481. package/src/lib/config.ts +2 -2
  482. package/src/models/components/agent.ts +5 -12
  483. package/src/models/components/agentaliasresponse.ts +43 -0
  484. package/src/models/components/agentconversation.ts +20 -14
  485. package/src/models/components/agentcreationrequest.ts +4 -0
  486. package/src/models/components/agenthandoffdoneevent.ts +2 -15
  487. package/src/models/components/agenthandoffentry.ts +8 -39
  488. package/src/models/components/agenthandoffstartedevent.ts +2 -17
  489. package/src/models/components/agentupdaterequest.ts +4 -0
  490. package/src/models/components/archiveftmodelout.ts +2 -15
  491. package/src/models/components/assistantmessage.ts +4 -19
  492. package/src/models/components/audiochunk.ts +4 -19
  493. package/src/models/components/audiotranscriptionrequest.ts +7 -0
  494. package/src/models/components/audiotranscriptionrequeststream.ts +7 -0
  495. package/src/models/components/basemodelcard.ts +0 -11
  496. package/src/models/components/batchjobout.ts +2 -13
  497. package/src/models/components/batchjobsout.ts +2 -13
  498. package/src/models/components/classifierdetailedjobout.ts +4 -31
  499. package/src/models/components/classifierftmodelout.ts +4 -29
  500. package/src/models/components/classifierjobout.ts +4 -41
  501. package/src/models/components/codeinterpretertool.ts +19 -0
  502. package/src/models/components/completiondetailedjobout.ts +4 -31
  503. package/src/models/components/completionftmodelout.ts +4 -26
  504. package/src/models/components/completionjobout.ts +4 -38
  505. package/src/models/components/conversationappendrequest.ts +13 -3
  506. package/src/models/components/conversationappendstreamrequest.ts +13 -3
  507. package/src/models/components/conversationhistory.ts +2 -17
  508. package/src/models/components/conversationmessages.ts +2 -17
  509. package/src/models/components/conversationrequest.ts +19 -3
  510. package/src/models/components/conversationresponse.ts +2 -17
  511. package/src/models/components/conversationrestartrequest.ts +32 -6
  512. package/src/models/components/conversationrestartstreamrequest.ts +35 -6
  513. package/src/models/components/conversationstreamrequest.ts +25 -3
  514. package/src/models/components/documentlibrarytool.ts +12 -0
  515. package/src/models/components/documentout.ts +3 -3
  516. package/src/models/components/documenturlchunk.ts +4 -19
  517. package/src/models/components/ftmodelcard.ts +0 -11
  518. package/src/models/components/functioncallentry.ts +25 -33
  519. package/src/models/components/functioncallevent.ts +17 -8
  520. package/src/models/components/functionresultentry.ts +8 -41
  521. package/src/models/components/functiontool.ts +10 -11
  522. package/src/models/components/githubrepositoryin.ts +3 -14
  523. package/src/models/components/githubrepositoryout.ts +2 -15
  524. package/src/models/components/imagedetail.ts +20 -0
  525. package/src/models/components/imagegenerationtool.ts +19 -0
  526. package/src/models/components/imageurl.ts +8 -3
  527. package/src/models/components/imageurlchunk.ts +4 -19
  528. package/src/models/components/index.ts +14 -0
  529. package/src/models/components/jobin.ts +0 -3
  530. package/src/models/components/jobsout.ts +2 -13
  531. package/src/models/components/legacyjobmetadataout.ts +2 -15
  532. package/src/models/components/messageinputentry.ts +18 -45
  533. package/src/models/components/messageoutputentry.ts +12 -57
  534. package/src/models/components/messageoutputevent.ts +4 -25
  535. package/src/models/components/mistralpromptmode.ts +14 -0
  536. package/src/models/components/modelcapabilities.ts +3 -0
  537. package/src/models/components/modelconversation.ts +2 -15
  538. package/src/models/components/realtimetranscriptionerror.ts +61 -0
  539. package/src/models/components/realtimetranscriptionerrordetail.ts +94 -0
  540. package/src/models/components/realtimetranscriptioninputaudioappend.ts +61 -0
  541. package/src/models/components/realtimetranscriptioninputaudioend.ts +54 -0
  542. package/src/models/components/realtimetranscriptioninputaudioflush.ts +54 -0
  543. package/src/models/components/realtimetranscriptionsession.ts +84 -0
  544. package/src/models/components/realtimetranscriptionsessioncreated.ts +64 -0
  545. package/src/models/components/realtimetranscriptionsessionupdated.ts +64 -0
  546. package/src/models/components/realtimetranscriptionsessionupdatemessage.ts +71 -0
  547. package/src/models/components/realtimetranscriptionsessionupdatepayload.ts +88 -0
  548. package/src/models/components/referencechunk.ts +4 -19
  549. package/src/models/components/responsedoneevent.ts +2 -13
  550. package/src/models/components/responseerrorevent.ts +2 -13
  551. package/src/models/components/responsestartedevent.ts +2 -15
  552. package/src/models/components/systemmessage.ts +3 -14
  553. package/src/models/components/textchunk.ts +4 -19
  554. package/src/models/components/thinkchunk.ts +23 -39
  555. package/src/models/components/timestampgranularity.ts +1 -0
  556. package/src/models/components/toolcallconfirmation.ts +50 -0
  557. package/src/models/components/toolconfiguration.ts +68 -0
  558. package/src/models/components/toolexecutiondeltaevent.ts +2 -17
  559. package/src/models/components/toolexecutiondoneevent.ts +2 -15
  560. package/src/models/components/toolexecutionentry.ts +8 -39
  561. package/src/models/components/toolexecutionstartedevent.ts +2 -17
  562. package/src/models/components/toolfilechunk.ts +4 -19
  563. package/src/models/components/toolmessage.ts +3 -14
  564. package/src/models/components/toolreferencechunk.ts +4 -19
  565. package/src/models/components/transcriptionsegmentchunk.ts +20 -19
  566. package/src/models/components/transcriptionstreamdone.ts +4 -25
  567. package/src/models/components/transcriptionstreamlanguage.ts +5 -24
  568. package/src/models/components/transcriptionstreamsegmentdelta.ts +10 -18
  569. package/src/models/components/transcriptionstreamtextdelta.ts +7 -24
  570. package/src/models/components/unarchiveftmodelout.ts +2 -15
  571. package/src/models/components/usermessage.ts +3 -14
  572. package/src/models/components/wandbintegration.ts +3 -14
  573. package/src/models/components/wandbintegrationout.ts +2 -15
  574. package/src/models/components/websearchpremiumtool.ts +19 -0
  575. package/src/models/components/websearchtool.ts +19 -0
  576. package/src/models/operations/agentsapiv1agentscreateorupdatealias.ts +46 -0
  577. package/src/models/operations/agentsapiv1agentsdeletealias.ts +41 -0
  578. package/src/models/operations/agentsapiv1agentsget.ts +19 -3
  579. package/src/models/operations/agentsapiv1agentsgetversion.ts +3 -3
  580. package/src/models/operations/agentsapiv1agentslist.ts +9 -0
  581. package/src/models/operations/agentsapiv1agentslistversionaliases.ts +40 -0
  582. package/src/models/operations/filesapirouteslistfiles.ts +3 -0
  583. package/src/models/operations/index.ts +3 -0
  584. package/src/models/operations/jobsapiroutesbatchgetbatchjobs.ts +15 -0
  585. package/src/sdk/mistralagents.ts +55 -1
  586. package/tests/extra/realtime.test.ts +389 -0
@@ -5,7 +5,6 @@
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
8
  import { Result as SafeParseResult } from "../../types/fp.js";
10
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
10
  import {
@@ -13,40 +12,20 @@ import {
13
12
  OutputContentChunks$inboundSchema,
14
13
  } from "./outputcontentchunks.js";
15
14
 
16
- export const MessageOutputEventType = {
17
- MessageOutputDelta: "message.output.delta",
18
- } as const;
19
- export type MessageOutputEventType = ClosedEnum<typeof MessageOutputEventType>;
20
-
21
- export const MessageOutputEventRole = {
22
- Assistant: "assistant",
23
- } as const;
24
- export type MessageOutputEventRole = ClosedEnum<typeof MessageOutputEventRole>;
25
-
26
15
  export type MessageOutputEventContent = string | OutputContentChunks;
27
16
 
28
17
  export type MessageOutputEvent = {
29
- type: MessageOutputEventType | undefined;
18
+ type?: "message.output.delta" | undefined;
30
19
  createdAt?: Date | undefined;
31
20
  outputIndex: number | undefined;
32
21
  id: string;
33
22
  contentIndex: number | undefined;
34
23
  model?: string | null | undefined;
35
24
  agentId?: string | null | undefined;
36
- role: MessageOutputEventRole | undefined;
25
+ role?: "assistant" | undefined;
37
26
  content: string | OutputContentChunks;
38
27
  };
39
28
 
40
- /** @internal */
41
- export const MessageOutputEventType$inboundSchema: z.ZodNativeEnum<
42
- typeof MessageOutputEventType
43
- > = z.nativeEnum(MessageOutputEventType);
44
-
45
- /** @internal */
46
- export const MessageOutputEventRole$inboundSchema: z.ZodNativeEnum<
47
- typeof MessageOutputEventRole
48
- > = z.nativeEnum(MessageOutputEventRole);
49
-
50
29
  /** @internal */
51
30
  export const MessageOutputEventContent$inboundSchema: z.ZodType<
52
31
  MessageOutputEventContent,
@@ -70,7 +49,7 @@ export const MessageOutputEvent$inboundSchema: z.ZodType<
70
49
  z.ZodTypeDef,
71
50
  unknown
72
51
  > = z.object({
73
- type: MessageOutputEventType$inboundSchema.default("message.output.delta"),
52
+ type: z.literal("message.output.delta").default("message.output.delta"),
74
53
  created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
75
54
  .optional(),
76
55
  output_index: z.number().int().default(0),
@@ -78,7 +57,7 @@ export const MessageOutputEvent$inboundSchema: z.ZodType<
78
57
  content_index: z.number().int().default(0),
79
58
  model: z.nullable(z.string()).optional(),
80
59
  agent_id: z.nullable(z.string()).optional(),
81
- role: MessageOutputEventRole$inboundSchema.default("assistant"),
60
+ role: z.literal("assistant").default("assistant"),
82
61
  content: z.union([z.string(), OutputContentChunks$inboundSchema]),
83
62
  }).transform((v) => {
84
63
  return remap$(v, {
@@ -6,9 +6,23 @@ import * as z from "zod/v3";
6
6
  import * as openEnums from "../../types/enums.js";
7
7
  import { OpenEnum } from "../../types/enums.js";
8
8
 
9
+ /**
10
+ * Available options to the prompt_mode argument on the chat completion endpoint.
11
+ *
12
+ * @remarks
13
+ * Values represent high-level intent. Assignment to actual SPs is handled internally.
14
+ * System prompt may include knowledge cutoff date, model capabilities, tone to use, safety guidelines, etc.
15
+ */
9
16
  export const MistralPromptMode = {
10
17
  Reasoning: "reasoning",
11
18
  } as const;
19
+ /**
20
+ * Available options to the prompt_mode argument on the chat completion endpoint.
21
+ *
22
+ * @remarks
23
+ * Values represent high-level intent. Assignment to actual SPs is handled internally.
24
+ * System prompt may include knowledge cutoff date, model capabilities, tone to use, safety guidelines, etc.
25
+ */
12
26
  export type MistralPromptMode = OpenEnum<typeof MistralPromptMode>;
13
27
 
14
28
  /** @internal */
@@ -18,6 +18,7 @@ export type ModelCapabilities = {
18
18
  classification: boolean | undefined;
19
19
  moderation: boolean | undefined;
20
20
  audio: boolean | undefined;
21
+ audioTranscription: boolean | undefined;
21
22
  };
22
23
 
23
24
  /** @internal */
@@ -35,12 +36,14 @@ export const ModelCapabilities$inboundSchema: z.ZodType<
35
36
  classification: z.boolean().default(false),
36
37
  moderation: z.boolean().default(false),
37
38
  audio: z.boolean().default(false),
39
+ audio_transcription: z.boolean().default(false),
38
40
  }).transform((v) => {
39
41
  return remap$(v, {
40
42
  "completion_chat": "completionChat",
41
43
  "function_calling": "functionCalling",
42
44
  "completion_fim": "completionFim",
43
45
  "fine_tuning": "fineTuning",
46
+ "audio_transcription": "audioTranscription",
44
47
  });
45
48
  });
46
49
 
@@ -5,7 +5,6 @@
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
8
  import { Result as SafeParseResult } from "../../types/fp.js";
10
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
10
  import {
@@ -39,13 +38,6 @@ export type ModelConversationTools =
39
38
  | (WebSearchTool & { type: "web_search" })
40
39
  | (WebSearchPremiumTool & { type: "web_search_premium" });
41
40
 
42
- export const ModelConversationObject = {
43
- Conversation: "conversation",
44
- } as const;
45
- export type ModelConversationObject = ClosedEnum<
46
- typeof ModelConversationObject
47
- >;
48
-
49
41
  export type ModelConversation = {
50
42
  /**
51
43
  * Instruction prompt the model will follow during the conversation.
@@ -80,7 +72,7 @@ export type ModelConversation = {
80
72
  * Custom metadata for the conversation.
81
73
  */
82
74
  metadata?: { [k: string]: any } | null | undefined;
83
- object: ModelConversationObject | undefined;
75
+ object?: "conversation" | undefined;
84
76
  id: string;
85
77
  createdAt: Date;
86
78
  updatedAt: Date;
@@ -119,11 +111,6 @@ export function modelConversationToolsFromJSON(
119
111
  );
120
112
  }
121
113
 
122
- /** @internal */
123
- export const ModelConversationObject$inboundSchema: z.ZodNativeEnum<
124
- typeof ModelConversationObject
125
- > = z.nativeEnum(ModelConversationObject);
126
-
127
114
  /** @internal */
128
115
  export const ModelConversation$inboundSchema: z.ZodType<
129
116
  ModelConversation,
@@ -155,7 +142,7 @@ export const ModelConversation$inboundSchema: z.ZodType<
155
142
  name: z.nullable(z.string()).optional(),
156
143
  description: z.nullable(z.string()).optional(),
157
144
  metadata: z.nullable(z.record(z.any())).optional(),
158
- object: ModelConversationObject$inboundSchema.default("conversation"),
145
+ object: z.literal("conversation").default("conversation"),
159
146
  id: z.string(),
160
147
  created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
161
148
  updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
@@ -0,0 +1,61 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ RealtimeTranscriptionErrorDetail,
11
+ RealtimeTranscriptionErrorDetail$inboundSchema,
12
+ RealtimeTranscriptionErrorDetail$Outbound,
13
+ RealtimeTranscriptionErrorDetail$outboundSchema,
14
+ } from "./realtimetranscriptionerrordetail.js";
15
+
16
+ export type RealtimeTranscriptionError = {
17
+ type?: "error" | undefined;
18
+ error: RealtimeTranscriptionErrorDetail;
19
+ };
20
+
21
+ /** @internal */
22
+ export const RealtimeTranscriptionError$inboundSchema: z.ZodType<
23
+ RealtimeTranscriptionError,
24
+ z.ZodTypeDef,
25
+ unknown
26
+ > = z.object({
27
+ type: z.literal("error").default("error"),
28
+ error: RealtimeTranscriptionErrorDetail$inboundSchema,
29
+ });
30
+ /** @internal */
31
+ export type RealtimeTranscriptionError$Outbound = {
32
+ type: "error";
33
+ error: RealtimeTranscriptionErrorDetail$Outbound;
34
+ };
35
+
36
+ /** @internal */
37
+ export const RealtimeTranscriptionError$outboundSchema: z.ZodType<
38
+ RealtimeTranscriptionError$Outbound,
39
+ z.ZodTypeDef,
40
+ RealtimeTranscriptionError
41
+ > = z.object({
42
+ type: z.literal("error").default("error" as const),
43
+ error: RealtimeTranscriptionErrorDetail$outboundSchema,
44
+ });
45
+
46
+ export function realtimeTranscriptionErrorToJSON(
47
+ realtimeTranscriptionError: RealtimeTranscriptionError,
48
+ ): string {
49
+ return JSON.stringify(
50
+ RealtimeTranscriptionError$outboundSchema.parse(realtimeTranscriptionError),
51
+ );
52
+ }
53
+ export function realtimeTranscriptionErrorFromJSON(
54
+ jsonString: string,
55
+ ): SafeParseResult<RealtimeTranscriptionError, SDKValidationError> {
56
+ return safeParse(
57
+ jsonString,
58
+ (x) => RealtimeTranscriptionError$inboundSchema.parse(JSON.parse(x)),
59
+ `Failed to parse 'RealtimeTranscriptionError' from JSON`,
60
+ );
61
+ }
@@ -0,0 +1,94 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ /**
11
+ * Human-readable error message.
12
+ */
13
+ export type Message = string | { [k: string]: any };
14
+
15
+ export type RealtimeTranscriptionErrorDetail = {
16
+ /**
17
+ * Human-readable error message.
18
+ */
19
+ message: string | { [k: string]: any };
20
+ /**
21
+ * Internal error code for debugging.
22
+ */
23
+ code: number;
24
+ };
25
+
26
+ /** @internal */
27
+ export const Message$inboundSchema: z.ZodType<Message, z.ZodTypeDef, unknown> =
28
+ z.union([z.string(), z.record(z.any())]);
29
+ /** @internal */
30
+ export type Message$Outbound = string | { [k: string]: any };
31
+
32
+ /** @internal */
33
+ export const Message$outboundSchema: z.ZodType<
34
+ Message$Outbound,
35
+ z.ZodTypeDef,
36
+ Message
37
+ > = z.union([z.string(), z.record(z.any())]);
38
+
39
+ export function messageToJSON(message: Message): string {
40
+ return JSON.stringify(Message$outboundSchema.parse(message));
41
+ }
42
+ export function messageFromJSON(
43
+ jsonString: string,
44
+ ): SafeParseResult<Message, SDKValidationError> {
45
+ return safeParse(
46
+ jsonString,
47
+ (x) => Message$inboundSchema.parse(JSON.parse(x)),
48
+ `Failed to parse 'Message' from JSON`,
49
+ );
50
+ }
51
+
52
+ /** @internal */
53
+ export const RealtimeTranscriptionErrorDetail$inboundSchema: z.ZodType<
54
+ RealtimeTranscriptionErrorDetail,
55
+ z.ZodTypeDef,
56
+ unknown
57
+ > = z.object({
58
+ message: z.union([z.string(), z.record(z.any())]),
59
+ code: z.number().int(),
60
+ });
61
+ /** @internal */
62
+ export type RealtimeTranscriptionErrorDetail$Outbound = {
63
+ message: string | { [k: string]: any };
64
+ code: number;
65
+ };
66
+
67
+ /** @internal */
68
+ export const RealtimeTranscriptionErrorDetail$outboundSchema: z.ZodType<
69
+ RealtimeTranscriptionErrorDetail$Outbound,
70
+ z.ZodTypeDef,
71
+ RealtimeTranscriptionErrorDetail
72
+ > = z.object({
73
+ message: z.union([z.string(), z.record(z.any())]),
74
+ code: z.number().int(),
75
+ });
76
+
77
+ export function realtimeTranscriptionErrorDetailToJSON(
78
+ realtimeTranscriptionErrorDetail: RealtimeTranscriptionErrorDetail,
79
+ ): string {
80
+ return JSON.stringify(
81
+ RealtimeTranscriptionErrorDetail$outboundSchema.parse(
82
+ realtimeTranscriptionErrorDetail,
83
+ ),
84
+ );
85
+ }
86
+ export function realtimeTranscriptionErrorDetailFromJSON(
87
+ jsonString: string,
88
+ ): SafeParseResult<RealtimeTranscriptionErrorDetail, SDKValidationError> {
89
+ return safeParse(
90
+ jsonString,
91
+ (x) => RealtimeTranscriptionErrorDetail$inboundSchema.parse(JSON.parse(x)),
92
+ `Failed to parse 'RealtimeTranscriptionErrorDetail' from JSON`,
93
+ );
94
+ }
@@ -0,0 +1,61 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type RealtimeTranscriptionInputAudioAppend = {
11
+ type?: "input_audio.append" | undefined;
12
+ /**
13
+ * Base64-encoded raw PCM bytes matching the current audio_format. Max decoded size: 262144 bytes.
14
+ */
15
+ audio: string;
16
+ };
17
+
18
+ /** @internal */
19
+ export const RealtimeTranscriptionInputAudioAppend$inboundSchema: z.ZodType<
20
+ RealtimeTranscriptionInputAudioAppend,
21
+ z.ZodTypeDef,
22
+ unknown
23
+ > = z.object({
24
+ type: z.literal("input_audio.append").default("input_audio.append"),
25
+ audio: z.string(),
26
+ });
27
+ /** @internal */
28
+ export type RealtimeTranscriptionInputAudioAppend$Outbound = {
29
+ type: "input_audio.append";
30
+ audio: string;
31
+ };
32
+
33
+ /** @internal */
34
+ export const RealtimeTranscriptionInputAudioAppend$outboundSchema: z.ZodType<
35
+ RealtimeTranscriptionInputAudioAppend$Outbound,
36
+ z.ZodTypeDef,
37
+ RealtimeTranscriptionInputAudioAppend
38
+ > = z.object({
39
+ type: z.literal("input_audio.append").default("input_audio.append" as const),
40
+ audio: z.string(),
41
+ });
42
+
43
+ export function realtimeTranscriptionInputAudioAppendToJSON(
44
+ realtimeTranscriptionInputAudioAppend: RealtimeTranscriptionInputAudioAppend,
45
+ ): string {
46
+ return JSON.stringify(
47
+ RealtimeTranscriptionInputAudioAppend$outboundSchema.parse(
48
+ realtimeTranscriptionInputAudioAppend,
49
+ ),
50
+ );
51
+ }
52
+ export function realtimeTranscriptionInputAudioAppendFromJSON(
53
+ jsonString: string,
54
+ ): SafeParseResult<RealtimeTranscriptionInputAudioAppend, SDKValidationError> {
55
+ return safeParse(
56
+ jsonString,
57
+ (x) =>
58
+ RealtimeTranscriptionInputAudioAppend$inboundSchema.parse(JSON.parse(x)),
59
+ `Failed to parse 'RealtimeTranscriptionInputAudioAppend' from JSON`,
60
+ );
61
+ }
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type RealtimeTranscriptionInputAudioEnd = {
11
+ type?: "input_audio.end" | undefined;
12
+ };
13
+
14
+ /** @internal */
15
+ export const RealtimeTranscriptionInputAudioEnd$inboundSchema: z.ZodType<
16
+ RealtimeTranscriptionInputAudioEnd,
17
+ z.ZodTypeDef,
18
+ unknown
19
+ > = z.object({
20
+ type: z.literal("input_audio.end").default("input_audio.end"),
21
+ });
22
+ /** @internal */
23
+ export type RealtimeTranscriptionInputAudioEnd$Outbound = {
24
+ type: "input_audio.end";
25
+ };
26
+
27
+ /** @internal */
28
+ export const RealtimeTranscriptionInputAudioEnd$outboundSchema: z.ZodType<
29
+ RealtimeTranscriptionInputAudioEnd$Outbound,
30
+ z.ZodTypeDef,
31
+ RealtimeTranscriptionInputAudioEnd
32
+ > = z.object({
33
+ type: z.literal("input_audio.end").default("input_audio.end" as const),
34
+ });
35
+
36
+ export function realtimeTranscriptionInputAudioEndToJSON(
37
+ realtimeTranscriptionInputAudioEnd: RealtimeTranscriptionInputAudioEnd,
38
+ ): string {
39
+ return JSON.stringify(
40
+ RealtimeTranscriptionInputAudioEnd$outboundSchema.parse(
41
+ realtimeTranscriptionInputAudioEnd,
42
+ ),
43
+ );
44
+ }
45
+ export function realtimeTranscriptionInputAudioEndFromJSON(
46
+ jsonString: string,
47
+ ): SafeParseResult<RealtimeTranscriptionInputAudioEnd, SDKValidationError> {
48
+ return safeParse(
49
+ jsonString,
50
+ (x) =>
51
+ RealtimeTranscriptionInputAudioEnd$inboundSchema.parse(JSON.parse(x)),
52
+ `Failed to parse 'RealtimeTranscriptionInputAudioEnd' from JSON`,
53
+ );
54
+ }
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type RealtimeTranscriptionInputAudioFlush = {
11
+ type?: "input_audio.flush" | undefined;
12
+ };
13
+
14
+ /** @internal */
15
+ export const RealtimeTranscriptionInputAudioFlush$inboundSchema: z.ZodType<
16
+ RealtimeTranscriptionInputAudioFlush,
17
+ z.ZodTypeDef,
18
+ unknown
19
+ > = z.object({
20
+ type: z.literal("input_audio.flush").default("input_audio.flush"),
21
+ });
22
+ /** @internal */
23
+ export type RealtimeTranscriptionInputAudioFlush$Outbound = {
24
+ type: "input_audio.flush";
25
+ };
26
+
27
+ /** @internal */
28
+ export const RealtimeTranscriptionInputAudioFlush$outboundSchema: z.ZodType<
29
+ RealtimeTranscriptionInputAudioFlush$Outbound,
30
+ z.ZodTypeDef,
31
+ RealtimeTranscriptionInputAudioFlush
32
+ > = z.object({
33
+ type: z.literal("input_audio.flush").default("input_audio.flush" as const),
34
+ });
35
+
36
+ export function realtimeTranscriptionInputAudioFlushToJSON(
37
+ realtimeTranscriptionInputAudioFlush: RealtimeTranscriptionInputAudioFlush,
38
+ ): string {
39
+ return JSON.stringify(
40
+ RealtimeTranscriptionInputAudioFlush$outboundSchema.parse(
41
+ realtimeTranscriptionInputAudioFlush,
42
+ ),
43
+ );
44
+ }
45
+ export function realtimeTranscriptionInputAudioFlushFromJSON(
46
+ jsonString: string,
47
+ ): SafeParseResult<RealtimeTranscriptionInputAudioFlush, SDKValidationError> {
48
+ return safeParse(
49
+ jsonString,
50
+ (x) =>
51
+ RealtimeTranscriptionInputAudioFlush$inboundSchema.parse(JSON.parse(x)),
52
+ `Failed to parse 'RealtimeTranscriptionInputAudioFlush' from JSON`,
53
+ );
54
+ }
@@ -0,0 +1,84 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
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
+ AudioFormat,
12
+ AudioFormat$inboundSchema,
13
+ AudioFormat$Outbound,
14
+ AudioFormat$outboundSchema,
15
+ } from "./audioformat.js";
16
+
17
+ export type RealtimeTranscriptionSession = {
18
+ requestId: string;
19
+ model: string;
20
+ audioFormat: AudioFormat;
21
+ targetStreamingDelayMs?: number | null | undefined;
22
+ };
23
+
24
+ /** @internal */
25
+ export const RealtimeTranscriptionSession$inboundSchema: z.ZodType<
26
+ RealtimeTranscriptionSession,
27
+ z.ZodTypeDef,
28
+ unknown
29
+ > = z.object({
30
+ request_id: z.string(),
31
+ model: z.string(),
32
+ audio_format: AudioFormat$inboundSchema,
33
+ target_streaming_delay_ms: z.nullable(z.number().int()).optional(),
34
+ }).transform((v) => {
35
+ return remap$(v, {
36
+ "request_id": "requestId",
37
+ "audio_format": "audioFormat",
38
+ "target_streaming_delay_ms": "targetStreamingDelayMs",
39
+ });
40
+ });
41
+ /** @internal */
42
+ export type RealtimeTranscriptionSession$Outbound = {
43
+ request_id: string;
44
+ model: string;
45
+ audio_format: AudioFormat$Outbound;
46
+ target_streaming_delay_ms?: number | null | undefined;
47
+ };
48
+
49
+ /** @internal */
50
+ export const RealtimeTranscriptionSession$outboundSchema: z.ZodType<
51
+ RealtimeTranscriptionSession$Outbound,
52
+ z.ZodTypeDef,
53
+ RealtimeTranscriptionSession
54
+ > = z.object({
55
+ requestId: z.string(),
56
+ model: z.string(),
57
+ audioFormat: AudioFormat$outboundSchema,
58
+ targetStreamingDelayMs: z.nullable(z.number().int()).optional(),
59
+ }).transform((v) => {
60
+ return remap$(v, {
61
+ requestId: "request_id",
62
+ audioFormat: "audio_format",
63
+ targetStreamingDelayMs: "target_streaming_delay_ms",
64
+ });
65
+ });
66
+
67
+ export function realtimeTranscriptionSessionToJSON(
68
+ realtimeTranscriptionSession: RealtimeTranscriptionSession,
69
+ ): string {
70
+ return JSON.stringify(
71
+ RealtimeTranscriptionSession$outboundSchema.parse(
72
+ realtimeTranscriptionSession,
73
+ ),
74
+ );
75
+ }
76
+ export function realtimeTranscriptionSessionFromJSON(
77
+ jsonString: string,
78
+ ): SafeParseResult<RealtimeTranscriptionSession, SDKValidationError> {
79
+ return safeParse(
80
+ jsonString,
81
+ (x) => RealtimeTranscriptionSession$inboundSchema.parse(JSON.parse(x)),
82
+ `Failed to parse 'RealtimeTranscriptionSession' from JSON`,
83
+ );
84
+ }
@@ -0,0 +1,64 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ RealtimeTranscriptionSession,
11
+ RealtimeTranscriptionSession$inboundSchema,
12
+ RealtimeTranscriptionSession$Outbound,
13
+ RealtimeTranscriptionSession$outboundSchema,
14
+ } from "./realtimetranscriptionsession.js";
15
+
16
+ export type RealtimeTranscriptionSessionCreated = {
17
+ type?: "session.created" | undefined;
18
+ session: RealtimeTranscriptionSession;
19
+ };
20
+
21
+ /** @internal */
22
+ export const RealtimeTranscriptionSessionCreated$inboundSchema: z.ZodType<
23
+ RealtimeTranscriptionSessionCreated,
24
+ z.ZodTypeDef,
25
+ unknown
26
+ > = z.object({
27
+ type: z.literal("session.created").default("session.created"),
28
+ session: RealtimeTranscriptionSession$inboundSchema,
29
+ });
30
+ /** @internal */
31
+ export type RealtimeTranscriptionSessionCreated$Outbound = {
32
+ type: "session.created";
33
+ session: RealtimeTranscriptionSession$Outbound;
34
+ };
35
+
36
+ /** @internal */
37
+ export const RealtimeTranscriptionSessionCreated$outboundSchema: z.ZodType<
38
+ RealtimeTranscriptionSessionCreated$Outbound,
39
+ z.ZodTypeDef,
40
+ RealtimeTranscriptionSessionCreated
41
+ > = z.object({
42
+ type: z.literal("session.created").default("session.created" as const),
43
+ session: RealtimeTranscriptionSession$outboundSchema,
44
+ });
45
+
46
+ export function realtimeTranscriptionSessionCreatedToJSON(
47
+ realtimeTranscriptionSessionCreated: RealtimeTranscriptionSessionCreated,
48
+ ): string {
49
+ return JSON.stringify(
50
+ RealtimeTranscriptionSessionCreated$outboundSchema.parse(
51
+ realtimeTranscriptionSessionCreated,
52
+ ),
53
+ );
54
+ }
55
+ export function realtimeTranscriptionSessionCreatedFromJSON(
56
+ jsonString: string,
57
+ ): SafeParseResult<RealtimeTranscriptionSessionCreated, SDKValidationError> {
58
+ return safeParse(
59
+ jsonString,
60
+ (x) =>
61
+ RealtimeTranscriptionSessionCreated$inboundSchema.parse(JSON.parse(x)),
62
+ `Failed to parse 'RealtimeTranscriptionSessionCreated' from JSON`,
63
+ );
64
+ }