sarvamai 1.1.8-alpha.2 → 1.1.8-alpha.4

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 (429) hide show
  1. package/README.md +19 -14
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +9 -0
  4. package/dist/cjs/Client.js +35 -20
  5. package/dist/cjs/api/errors/ConflictError.d.ts +6 -0
  6. package/dist/cjs/api/errors/ConflictError.js +54 -0
  7. package/dist/cjs/api/errors/ContentTooLargeError.d.ts +1 -2
  8. package/dist/cjs/api/errors/NotFoundError.d.ts +1 -2
  9. package/dist/cjs/api/errors/PaymentRequiredError.d.ts +6 -0
  10. package/dist/cjs/api/errors/PaymentRequiredError.js +54 -0
  11. package/dist/cjs/api/errors/UnauthorizedError.d.ts +6 -0
  12. package/dist/cjs/api/errors/UnauthorizedError.js +54 -0
  13. package/dist/cjs/api/errors/index.d.ts +3 -0
  14. package/dist/cjs/api/errors/index.js +3 -0
  15. package/dist/cjs/api/resources/chat/client/Client.d.ts +3 -3
  16. package/dist/cjs/api/resources/chat/client/requests/ChatCompletionsRequest.d.ts +3 -2
  17. package/dist/cjs/api/resources/docAi/client/Client.d.ts +146 -0
  18. package/dist/cjs/api/resources/docAi/client/Client.js +503 -0
  19. package/dist/cjs/api/resources/docAi/client/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/docAi/client/index.js +17 -0
  21. package/dist/cjs/api/resources/docAi/client/requests/DocAiDigitiseRequest.d.ts +36 -0
  22. package/dist/cjs/api/resources/docAi/client/requests/DocAiDigitiseRequest.js +18 -0
  23. package/dist/cjs/api/resources/docAi/client/requests/DocAiExtractRequest.d.ts +34 -0
  24. package/dist/cjs/api/resources/docAi/client/requests/DocAiExtractRequest.js +13 -0
  25. package/dist/cjs/api/resources/docAi/client/requests/DocAiGetResultsRequest.d.ts +15 -0
  26. package/dist/cjs/api/resources/docAi/client/requests/DocAiPresignUploadRequest.d.ts +8 -0
  27. package/dist/cjs/api/resources/docAi/client/requests/DocAiPresignUploadRequest.js +3 -0
  28. package/dist/cjs/api/resources/docAi/client/requests/index.d.ts +4 -0
  29. package/dist/cjs/api/resources/docAi/client/requests/index.js +7 -0
  30. package/dist/cjs/api/resources/docAi/exports.d.ts +2 -0
  31. package/dist/cjs/api/resources/docAi/exports.js +21 -0
  32. package/dist/cjs/api/resources/docAi/index.d.ts +2 -0
  33. package/dist/cjs/api/resources/docAi/index.js +18 -0
  34. package/dist/cjs/api/resources/docAi/types/DocAiGetResultsResponse.d.ts +10 -0
  35. package/dist/cjs/api/resources/docAi/types/DocAiGetResultsResponse.js +3 -0
  36. package/dist/cjs/api/resources/docAi/types/index.d.ts +1 -0
  37. package/dist/cjs/api/resources/docAi/types/index.js +17 -0
  38. package/dist/cjs/api/resources/documentIntelligence/DocumentIntelligenceJob.d.ts +0 -2
  39. package/dist/cjs/api/resources/documentIntelligence/client/Client.js +0 -5
  40. package/dist/cjs/api/resources/documentIntelligence/client/requests/DocumentIntelligenceJobRequest.d.ts +0 -2
  41. package/dist/cjs/api/resources/dubbing/client/Client.d.ts +104 -0
  42. package/dist/cjs/api/resources/dubbing/client/Client.js +313 -0
  43. package/dist/cjs/api/resources/dubbing/client/index.d.ts +1 -0
  44. package/dist/cjs/api/resources/dubbing/client/index.js +17 -0
  45. package/dist/cjs/api/resources/dubbing/client/requests/CreateDubbingJobRequest.d.ts +38 -0
  46. package/dist/cjs/api/resources/dubbing/client/requests/CreateDubbingJobRequest.js +3 -0
  47. package/dist/cjs/api/resources/dubbing/client/requests/DubbingGetExportStatusRequest.d.ts +10 -0
  48. package/dist/cjs/api/resources/dubbing/client/requests/DubbingGetExportStatusRequest.js +3 -0
  49. package/dist/cjs/api/resources/dubbing/client/requests/index.d.ts +2 -0
  50. package/dist/cjs/api/resources/dubbing/client/requests/index.js +2 -0
  51. package/dist/cjs/api/resources/dubbing/exports.d.ts +2 -0
  52. package/dist/cjs/api/resources/dubbing/exports.js +21 -0
  53. package/dist/cjs/api/resources/dubbing/index.d.ts +1 -0
  54. package/dist/cjs/api/resources/dubbing/index.js +17 -0
  55. package/dist/cjs/api/resources/index.d.ts +7 -0
  56. package/dist/cjs/api/resources/index.js +8 -1
  57. package/dist/cjs/api/resources/pronunciationDictionary/client/Client.d.ts +1 -1
  58. package/dist/cjs/api/resources/pronunciationDictionary/client/Client.js +1 -1
  59. package/dist/cjs/api/resources/pronunciationDictionary/client/requests/UpdatePronunciationDictionaryRequest.d.ts +1 -1
  60. package/dist/cjs/api/resources/speechToText/client/Client.js +9 -6
  61. package/dist/cjs/api/resources/speechToText/client/requests/SpeechToTextTranscriptionRequest.d.ts +7 -5
  62. package/dist/cjs/api/resources/speechToTextJob/client/Client.d.ts +3 -3
  63. package/dist/cjs/api/resources/speechToTextJob/client/Client.js +3 -3
  64. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/client/Client.d.ts +36 -0
  65. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/client/Client.js +87 -0
  66. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/client/Socket.d.ts +55 -0
  67. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/client/Socket.js +174 -0
  68. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/client/index.d.ts +1 -0
  69. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/client/index.js +2 -0
  70. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/exports.d.ts +2 -0
  71. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/exports.js +21 -0
  72. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/index.d.ts +2 -0
  73. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/index.js +18 -0
  74. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEncoding.d.ts +8 -0
  75. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEncoding.js +11 -0
  76. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEndpointing.d.ts +11 -0
  77. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEndpointing.js +14 -0
  78. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingLanguageCode.d.ts +56 -0
  79. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingLanguageCode.js +59 -0
  80. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingMode.d.ts +19 -0
  81. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingMode.js +22 -0
  82. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingReturnTimestamps.d.ts +9 -0
  83. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingReturnTimestamps.js +12 -0
  84. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingStreamType.d.ts +13 -0
  85. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingStreamType.js +16 -0
  86. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/index.d.ts +6 -0
  87. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/index.js +22 -0
  88. package/dist/cjs/api/resources/speechToTextStreaming/types/SpeechToTextStreamingLanguageCode.d.ts +1 -3
  89. package/dist/cjs/api/resources/speechToTextStreaming/types/SpeechToTextStreamingLanguageCode.js +1 -3
  90. package/dist/cjs/api/resources/speechToTextStreaming/types/SpeechToTextStreamingMode.d.ts +1 -1
  91. package/dist/cjs/api/resources/speechToTextStreaming/types/SpeechToTextStreamingMode.js +1 -1
  92. package/dist/cjs/api/resources/speechToTextStreaming/types/SpeechToTextStreamingModel.d.ts +2 -2
  93. package/dist/cjs/api/resources/speechToTextStreaming/types/SpeechToTextStreamingModel.js +2 -2
  94. package/dist/cjs/api/resources/speechToTextTranslateJob/client/requests/SpeechToTextTranslateJobRequest.d.ts +0 -1
  95. package/dist/cjs/api/resources/text/client/Client.d.ts +7 -7
  96. package/dist/cjs/api/resources/text/client/Client.js +7 -7
  97. package/dist/cjs/api/resources/text/client/requests/LanguageIdentificationRequest.d.ts +1 -1
  98. package/dist/cjs/api/resources/text/client/requests/TranslationRequest.d.ts +3 -3
  99. package/dist/cjs/api/resources/text/client/requests/TransliterationRequest.d.ts +3 -3
  100. package/dist/cjs/api/resources/textToSpeech/client/Client.d.ts +2 -2
  101. package/dist/cjs/api/resources/textToSpeech/client/Client.js +2 -2
  102. package/dist/cjs/api/resources/textToSpeech/client/requests/TextToSpeechRequest.d.ts +3 -3
  103. package/dist/cjs/api/resources/textToSpeech/client/requests/TextToSpeechStreamRequest.d.ts +2 -2
  104. package/dist/cjs/api/resources/textToSpeechStreaming/client/Socket.d.ts +3 -3
  105. package/dist/cjs/api/resources/textToSpeechStreaming/client/Socket.js +3 -3
  106. package/dist/cjs/api/types/ConfigureConnection.d.ts +3 -3
  107. package/dist/cjs/api/types/ConfigureConnection.js +1 -1
  108. package/dist/cjs/api/types/CreateDubbingJobData.d.ts +17 -0
  109. package/dist/cjs/api/types/CreateDubbingJobData.js +3 -0
  110. package/dist/cjs/api/types/CreateDubbingJobResponse.d.ts +7 -0
  111. package/dist/cjs/api/types/CreateDubbingJobResponse.js +3 -0
  112. package/dist/cjs/api/types/DocAiDigitiseResults.d.ts +32 -0
  113. package/dist/cjs/api/types/DocAiDigitiseResults.js +3 -0
  114. package/dist/cjs/api/types/DocAiDownloadUrlResponse.d.ts +10 -0
  115. package/dist/cjs/api/types/DocAiDownloadUrlResponse.js +3 -0
  116. package/dist/cjs/api/types/DocAiErrorDetail.d.ts +8 -0
  117. package/dist/cjs/api/types/DocAiErrorDetail.js +3 -0
  118. package/dist/cjs/api/types/DocAiErrorModel.d.ts +15 -0
  119. package/dist/cjs/api/types/DocAiErrorModel.js +3 -0
  120. package/dist/cjs/api/types/DocAiExtractResults.d.ts +17 -0
  121. package/dist/cjs/api/types/DocAiExtractResults.js +3 -0
  122. package/dist/cjs/api/types/DocAiJobStatusResponse.d.ts +14 -0
  123. package/dist/cjs/api/types/DocAiJobStatusResponse.js +3 -0
  124. package/dist/cjs/api/types/DocAiPresignUploadResponse.d.ts +12 -0
  125. package/dist/cjs/api/types/DocAiPresignUploadResponse.js +3 -0
  126. package/dist/cjs/api/types/DocAiStartJobResponse.d.ts +8 -0
  127. package/dist/cjs/api/types/DocAiStartJobResponse.js +3 -0
  128. package/dist/cjs/api/types/DocAiUsage.d.ts +10 -0
  129. package/dist/cjs/api/types/DocAiUsage.js +3 -0
  130. package/dist/cjs/api/types/DubbingExportItem.d.ts +17 -0
  131. package/dist/cjs/api/types/DubbingExportItem.js +3 -0
  132. package/dist/cjs/api/types/DubbingExportItemStatus.d.ts +6 -0
  133. package/dist/cjs/api/types/DubbingExportItemStatus.js +9 -0
  134. package/dist/cjs/api/types/DubbingExportOption.d.ts +7 -0
  135. package/dist/cjs/api/types/DubbingExportOption.js +10 -0
  136. package/dist/cjs/api/types/DubbingExportStatusData.d.ts +5 -0
  137. package/dist/cjs/api/types/DubbingExportStatusData.js +3 -0
  138. package/dist/cjs/api/types/DubbingExportStatusResponse.d.ts +7 -0
  139. package/dist/cjs/api/types/DubbingExportStatusResponse.js +3 -0
  140. package/dist/cjs/api/types/DubbingExportType.d.ts +8 -0
  141. package/dist/cjs/api/types/DubbingExportType.js +11 -0
  142. package/dist/cjs/api/types/DubbingJobStatus.d.ts +9 -0
  143. package/dist/cjs/api/types/DubbingJobStatus.js +12 -0
  144. package/dist/cjs/api/types/DubbingLanguage.d.ts +16 -0
  145. package/dist/cjs/api/types/DubbingLanguage.js +19 -0
  146. package/dist/cjs/api/types/DubbingLiveStatusData.d.ts +18 -0
  147. package/dist/cjs/api/types/DubbingLiveStatusData.js +3 -0
  148. package/dist/cjs/api/types/DubbingLiveStatusExportInfo.d.ts +14 -0
  149. package/dist/cjs/api/types/DubbingLiveStatusExportInfo.js +3 -0
  150. package/dist/cjs/api/types/DubbingLiveStatusResponse.d.ts +7 -0
  151. package/dist/cjs/api/types/DubbingLiveStatusResponse.js +3 -0
  152. package/dist/cjs/api/types/DubbingModelTier.d.ts +6 -0
  153. package/dist/cjs/api/types/DubbingModelTier.js +9 -0
  154. package/dist/cjs/api/types/DubbingPacePreset.d.ts +8 -0
  155. package/dist/cjs/api/types/DubbingPacePreset.js +11 -0
  156. package/dist/cjs/api/types/DubbingRegister.d.ts +10 -0
  157. package/dist/cjs/api/types/DubbingRegister.js +13 -0
  158. package/dist/cjs/api/types/DubbingStartData.d.ts +7 -0
  159. package/dist/cjs/api/types/DubbingStartData.js +3 -0
  160. package/dist/cjs/api/types/DubbingStartResponse.d.ts +8 -0
  161. package/dist/cjs/api/types/DubbingStartResponse.js +3 -0
  162. package/dist/cjs/api/types/RealtimeAudioInput.d.ts +10 -0
  163. package/dist/cjs/api/types/RealtimeAudioInput.js +3 -0
  164. package/dist/cjs/api/types/RealtimeConfigUpdate.d.ts +55 -0
  165. package/dist/cjs/api/types/RealtimeConfigUpdate.js +25 -0
  166. package/dist/cjs/api/types/RealtimeConfigUpdated.d.ts +8 -0
  167. package/dist/cjs/api/types/RealtimeConfigUpdated.js +3 -0
  168. package/dist/cjs/api/types/RealtimeEnd.d.ts +7 -0
  169. package/dist/cjs/api/types/RealtimeEnd.js +3 -0
  170. package/dist/cjs/api/types/RealtimeError.d.ts +29 -0
  171. package/dist/cjs/api/types/RealtimeError.js +3 -0
  172. package/dist/cjs/api/types/RealtimeFlush.d.ts +7 -0
  173. package/dist/cjs/api/types/RealtimeFlush.js +3 -0
  174. package/dist/cjs/api/types/RealtimePing.d.ts +6 -0
  175. package/dist/cjs/api/types/RealtimePing.js +3 -0
  176. package/dist/cjs/api/types/RealtimePong.d.ts +6 -0
  177. package/dist/cjs/api/types/RealtimePong.js +3 -0
  178. package/dist/cjs/api/types/RealtimeSessionBegin.d.ts +33 -0
  179. package/dist/cjs/api/types/RealtimeSessionBegin.js +3 -0
  180. package/dist/cjs/api/types/RealtimeSessionEnd.d.ts +15 -0
  181. package/dist/cjs/api/types/RealtimeSessionEnd.js +3 -0
  182. package/dist/cjs/api/types/RealtimeSpeechEnd.d.ts +7 -0
  183. package/dist/cjs/api/types/RealtimeSpeechEnd.js +3 -0
  184. package/dist/cjs/api/types/RealtimeSpeechStart.d.ts +7 -0
  185. package/dist/cjs/api/types/RealtimeSpeechStart.js +3 -0
  186. package/dist/cjs/api/types/RealtimeTranscriptFinal.d.ts +32 -0
  187. package/dist/cjs/api/types/RealtimeTranscriptFinal.js +3 -0
  188. package/dist/cjs/api/types/RealtimeTranscriptPartial.d.ts +17 -0
  189. package/dist/cjs/api/types/RealtimeTranscriptPartial.js +3 -0
  190. package/dist/cjs/api/types/RealtimeVadSpeechEnd.d.ts +10 -0
  191. package/dist/cjs/api/types/RealtimeVadSpeechEnd.js +3 -0
  192. package/dist/cjs/api/types/RealtimeVadSpeechStart.d.ts +10 -0
  193. package/dist/cjs/api/types/RealtimeVadSpeechStart.js +3 -0
  194. package/dist/cjs/api/types/SarvamModelIds.d.ts +4 -6
  195. package/dist/cjs/api/types/SarvamModelIds.js +0 -6
  196. package/dist/cjs/api/types/SpeechToTextBatchModel.d.ts +12 -0
  197. package/dist/cjs/api/types/SpeechToTextBatchModel.js +15 -0
  198. package/dist/cjs/api/types/SpeechToTextJobParameters.d.ts +4 -4
  199. package/dist/cjs/api/types/SpeechToTextLanguage.d.ts +1 -7
  200. package/dist/cjs/api/types/SpeechToTextLanguage.js +1 -7
  201. package/dist/cjs/api/types/SpeechToTextModel.d.ts +2 -2
  202. package/dist/cjs/api/types/SpeechToTextModel.js +2 -2
  203. package/dist/cjs/api/types/SpeechToTextResponse.d.ts +2 -15
  204. package/dist/cjs/api/types/SpeechToTextTranscriptionData.d.ts +2 -4
  205. package/dist/cjs/api/types/SpeechToTextTranslateResponse.d.ts +1 -1
  206. package/dist/cjs/api/types/TimestampsModel.d.ts +3 -3
  207. package/dist/cjs/api/types/index.d.ts +44 -1
  208. package/dist/cjs/api/types/index.js +44 -1
  209. package/dist/cjs/environments.d.ts +2 -0
  210. package/dist/cjs/environments.js +1 -0
  211. package/dist/cjs/version.d.ts +1 -1
  212. package/dist/cjs/version.js +1 -1
  213. package/dist/esm/BaseClient.mjs +2 -2
  214. package/dist/esm/Client.d.mts +9 -0
  215. package/dist/esm/Client.mjs +15 -0
  216. package/dist/esm/api/errors/ConflictError.d.mts +6 -0
  217. package/dist/esm/api/errors/ConflictError.mjs +17 -0
  218. package/dist/esm/api/errors/ContentTooLargeError.d.mts +1 -2
  219. package/dist/esm/api/errors/NotFoundError.d.mts +1 -2
  220. package/dist/esm/api/errors/PaymentRequiredError.d.mts +6 -0
  221. package/dist/esm/api/errors/PaymentRequiredError.mjs +17 -0
  222. package/dist/esm/api/errors/UnauthorizedError.d.mts +6 -0
  223. package/dist/esm/api/errors/UnauthorizedError.mjs +17 -0
  224. package/dist/esm/api/errors/index.d.mts +3 -0
  225. package/dist/esm/api/errors/index.mjs +3 -0
  226. package/dist/esm/api/resources/chat/client/Client.d.mts +3 -3
  227. package/dist/esm/api/resources/chat/client/requests/ChatCompletionsRequest.d.mts +3 -2
  228. package/dist/esm/api/resources/docAi/client/Client.d.mts +146 -0
  229. package/dist/esm/api/resources/docAi/client/Client.mjs +466 -0
  230. package/dist/esm/api/resources/docAi/client/index.d.mts +1 -0
  231. package/dist/esm/api/resources/docAi/client/index.mjs +1 -0
  232. package/dist/esm/api/resources/docAi/client/requests/DocAiDigitiseRequest.d.mts +36 -0
  233. package/dist/esm/api/resources/docAi/client/requests/DocAiDigitiseRequest.mjs +15 -0
  234. package/dist/esm/api/resources/docAi/client/requests/DocAiExtractRequest.d.mts +34 -0
  235. package/dist/esm/api/resources/docAi/client/requests/DocAiExtractRequest.mjs +10 -0
  236. package/dist/esm/api/resources/docAi/client/requests/DocAiGetResultsRequest.d.mts +15 -0
  237. package/dist/esm/api/resources/docAi/client/requests/DocAiPresignUploadRequest.d.mts +8 -0
  238. package/dist/esm/api/resources/docAi/client/requests/DocAiPresignUploadRequest.mjs +2 -0
  239. package/dist/esm/api/resources/docAi/client/requests/index.d.mts +4 -0
  240. package/dist/esm/api/resources/docAi/client/requests/index.mjs +2 -0
  241. package/dist/esm/api/resources/docAi/exports.d.mts +2 -0
  242. package/dist/esm/api/resources/docAi/exports.mjs +3 -0
  243. package/dist/esm/api/resources/docAi/index.d.mts +2 -0
  244. package/dist/esm/api/resources/docAi/index.mjs +2 -0
  245. package/dist/esm/api/resources/docAi/types/DocAiGetResultsResponse.d.mts +10 -0
  246. package/dist/esm/api/resources/docAi/types/DocAiGetResultsResponse.mjs +2 -0
  247. package/dist/esm/api/resources/docAi/types/index.d.mts +1 -0
  248. package/dist/esm/api/resources/docAi/types/index.mjs +1 -0
  249. package/dist/esm/api/resources/documentIntelligence/DocumentIntelligenceJob.d.mts +0 -2
  250. package/dist/esm/api/resources/documentIntelligence/client/Client.mjs +0 -5
  251. package/dist/esm/api/resources/documentIntelligence/client/requests/DocumentIntelligenceJobRequest.d.mts +0 -2
  252. package/dist/esm/api/resources/dubbing/client/Client.d.mts +104 -0
  253. package/dist/esm/api/resources/dubbing/client/Client.mjs +276 -0
  254. package/dist/esm/api/resources/dubbing/client/index.d.mts +1 -0
  255. package/dist/esm/api/resources/dubbing/client/index.mjs +1 -0
  256. package/dist/esm/api/resources/dubbing/client/requests/CreateDubbingJobRequest.d.mts +38 -0
  257. package/dist/esm/api/resources/dubbing/client/requests/CreateDubbingJobRequest.mjs +2 -0
  258. package/dist/esm/api/resources/dubbing/client/requests/DubbingGetExportStatusRequest.d.mts +10 -0
  259. package/dist/esm/api/resources/dubbing/client/requests/DubbingGetExportStatusRequest.mjs +2 -0
  260. package/dist/esm/api/resources/dubbing/client/requests/index.d.mts +2 -0
  261. package/dist/esm/api/resources/dubbing/client/requests/index.mjs +1 -0
  262. package/dist/esm/api/resources/dubbing/exports.d.mts +2 -0
  263. package/dist/esm/api/resources/dubbing/exports.mjs +3 -0
  264. package/dist/esm/api/resources/dubbing/index.d.mts +1 -0
  265. package/dist/esm/api/resources/dubbing/index.mjs +1 -0
  266. package/dist/esm/api/resources/index.d.mts +7 -0
  267. package/dist/esm/api/resources/index.mjs +7 -0
  268. package/dist/esm/api/resources/pronunciationDictionary/client/Client.d.mts +1 -1
  269. package/dist/esm/api/resources/pronunciationDictionary/client/Client.mjs +1 -1
  270. package/dist/esm/api/resources/pronunciationDictionary/client/requests/UpdatePronunciationDictionaryRequest.d.mts +1 -1
  271. package/dist/esm/api/resources/speechToText/client/Client.mjs +9 -6
  272. package/dist/esm/api/resources/speechToText/client/requests/SpeechToTextTranscriptionRequest.d.mts +7 -5
  273. package/dist/esm/api/resources/speechToTextJob/client/Client.d.mts +3 -3
  274. package/dist/esm/api/resources/speechToTextJob/client/Client.mjs +3 -3
  275. package/dist/esm/api/resources/speechToTextRealtimeStreaming/client/Client.d.mts +36 -0
  276. package/dist/esm/api/resources/speechToTextRealtimeStreaming/client/Client.mjs +50 -0
  277. package/dist/esm/api/resources/speechToTextRealtimeStreaming/client/Socket.d.mts +55 -0
  278. package/dist/esm/api/resources/speechToTextRealtimeStreaming/client/Socket.mjs +137 -0
  279. package/dist/esm/api/resources/speechToTextRealtimeStreaming/client/index.d.mts +1 -0
  280. package/dist/esm/api/resources/speechToTextRealtimeStreaming/client/index.mjs +1 -0
  281. package/dist/esm/api/resources/speechToTextRealtimeStreaming/exports.d.mts +2 -0
  282. package/dist/esm/api/resources/speechToTextRealtimeStreaming/exports.mjs +3 -0
  283. package/dist/esm/api/resources/speechToTextRealtimeStreaming/index.d.mts +2 -0
  284. package/dist/esm/api/resources/speechToTextRealtimeStreaming/index.mjs +2 -0
  285. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEncoding.d.mts +8 -0
  286. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEncoding.mjs +8 -0
  287. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEndpointing.d.mts +11 -0
  288. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEndpointing.mjs +11 -0
  289. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingLanguageCode.d.mts +56 -0
  290. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingLanguageCode.mjs +56 -0
  291. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingMode.d.mts +19 -0
  292. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingMode.mjs +19 -0
  293. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingReturnTimestamps.d.mts +9 -0
  294. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingReturnTimestamps.mjs +9 -0
  295. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingStreamType.d.mts +13 -0
  296. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingStreamType.mjs +13 -0
  297. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/index.d.mts +6 -0
  298. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/index.mjs +6 -0
  299. package/dist/esm/api/resources/speechToTextStreaming/types/SpeechToTextStreamingLanguageCode.d.mts +1 -3
  300. package/dist/esm/api/resources/speechToTextStreaming/types/SpeechToTextStreamingLanguageCode.mjs +1 -3
  301. package/dist/esm/api/resources/speechToTextStreaming/types/SpeechToTextStreamingMode.d.mts +1 -1
  302. package/dist/esm/api/resources/speechToTextStreaming/types/SpeechToTextStreamingMode.mjs +1 -1
  303. package/dist/esm/api/resources/speechToTextStreaming/types/SpeechToTextStreamingModel.d.mts +2 -2
  304. package/dist/esm/api/resources/speechToTextStreaming/types/SpeechToTextStreamingModel.mjs +2 -2
  305. package/dist/esm/api/resources/speechToTextTranslateJob/client/requests/SpeechToTextTranslateJobRequest.d.mts +0 -1
  306. package/dist/esm/api/resources/text/client/Client.d.mts +7 -7
  307. package/dist/esm/api/resources/text/client/Client.mjs +7 -7
  308. package/dist/esm/api/resources/text/client/requests/LanguageIdentificationRequest.d.mts +1 -1
  309. package/dist/esm/api/resources/text/client/requests/TranslationRequest.d.mts +3 -3
  310. package/dist/esm/api/resources/text/client/requests/TransliterationRequest.d.mts +3 -3
  311. package/dist/esm/api/resources/textToSpeech/client/Client.d.mts +2 -2
  312. package/dist/esm/api/resources/textToSpeech/client/Client.mjs +2 -2
  313. package/dist/esm/api/resources/textToSpeech/client/requests/TextToSpeechRequest.d.mts +3 -3
  314. package/dist/esm/api/resources/textToSpeech/client/requests/TextToSpeechStreamRequest.d.mts +2 -2
  315. package/dist/esm/api/resources/textToSpeechStreaming/client/Socket.d.mts +3 -3
  316. package/dist/esm/api/resources/textToSpeechStreaming/client/Socket.mjs +3 -3
  317. package/dist/esm/api/types/ConfigureConnection.d.mts +3 -3
  318. package/dist/esm/api/types/ConfigureConnection.mjs +1 -1
  319. package/dist/esm/api/types/CreateDubbingJobData.d.mts +17 -0
  320. package/dist/esm/api/types/CreateDubbingJobData.mjs +2 -0
  321. package/dist/esm/api/types/CreateDubbingJobResponse.d.mts +7 -0
  322. package/dist/esm/api/types/CreateDubbingJobResponse.mjs +2 -0
  323. package/dist/esm/api/types/DocAiDigitiseResults.d.mts +32 -0
  324. package/dist/esm/api/types/DocAiDigitiseResults.mjs +2 -0
  325. package/dist/esm/api/types/DocAiDownloadUrlResponse.d.mts +10 -0
  326. package/dist/esm/api/types/DocAiDownloadUrlResponse.mjs +2 -0
  327. package/dist/esm/api/types/DocAiErrorDetail.d.mts +8 -0
  328. package/dist/esm/api/types/DocAiErrorDetail.mjs +2 -0
  329. package/dist/esm/api/types/DocAiErrorModel.d.mts +15 -0
  330. package/dist/esm/api/types/DocAiErrorModel.mjs +2 -0
  331. package/dist/esm/api/types/DocAiExtractResults.d.mts +17 -0
  332. package/dist/esm/api/types/DocAiExtractResults.mjs +2 -0
  333. package/dist/esm/api/types/DocAiJobStatusResponse.d.mts +14 -0
  334. package/dist/esm/api/types/DocAiJobStatusResponse.mjs +2 -0
  335. package/dist/esm/api/types/DocAiPresignUploadResponse.d.mts +12 -0
  336. package/dist/esm/api/types/DocAiPresignUploadResponse.mjs +2 -0
  337. package/dist/esm/api/types/DocAiStartJobResponse.d.mts +8 -0
  338. package/dist/esm/api/types/DocAiStartJobResponse.mjs +2 -0
  339. package/dist/esm/api/types/DocAiUsage.d.mts +10 -0
  340. package/dist/esm/api/types/DocAiUsage.mjs +2 -0
  341. package/dist/esm/api/types/DubbingExportItem.d.mts +17 -0
  342. package/dist/esm/api/types/DubbingExportItem.mjs +2 -0
  343. package/dist/esm/api/types/DubbingExportItemStatus.d.mts +6 -0
  344. package/dist/esm/api/types/DubbingExportItemStatus.mjs +6 -0
  345. package/dist/esm/api/types/DubbingExportOption.d.mts +7 -0
  346. package/dist/esm/api/types/DubbingExportOption.mjs +7 -0
  347. package/dist/esm/api/types/DubbingExportStatusData.d.mts +5 -0
  348. package/dist/esm/api/types/DubbingExportStatusData.mjs +2 -0
  349. package/dist/esm/api/types/DubbingExportStatusResponse.d.mts +7 -0
  350. package/dist/esm/api/types/DubbingExportStatusResponse.mjs +2 -0
  351. package/dist/esm/api/types/DubbingExportType.d.mts +8 -0
  352. package/dist/esm/api/types/DubbingExportType.mjs +8 -0
  353. package/dist/esm/api/types/DubbingJobStatus.d.mts +9 -0
  354. package/dist/esm/api/types/DubbingJobStatus.mjs +9 -0
  355. package/dist/esm/api/types/DubbingLanguage.d.mts +16 -0
  356. package/dist/esm/api/types/DubbingLanguage.mjs +16 -0
  357. package/dist/esm/api/types/DubbingLiveStatusData.d.mts +18 -0
  358. package/dist/esm/api/types/DubbingLiveStatusData.mjs +2 -0
  359. package/dist/esm/api/types/DubbingLiveStatusExportInfo.d.mts +14 -0
  360. package/dist/esm/api/types/DubbingLiveStatusExportInfo.mjs +2 -0
  361. package/dist/esm/api/types/DubbingLiveStatusResponse.d.mts +7 -0
  362. package/dist/esm/api/types/DubbingLiveStatusResponse.mjs +2 -0
  363. package/dist/esm/api/types/DubbingModelTier.d.mts +6 -0
  364. package/dist/esm/api/types/DubbingModelTier.mjs +6 -0
  365. package/dist/esm/api/types/DubbingPacePreset.d.mts +8 -0
  366. package/dist/esm/api/types/DubbingPacePreset.mjs +8 -0
  367. package/dist/esm/api/types/DubbingRegister.d.mts +10 -0
  368. package/dist/esm/api/types/DubbingRegister.mjs +10 -0
  369. package/dist/esm/api/types/DubbingStartData.d.mts +7 -0
  370. package/dist/esm/api/types/DubbingStartData.mjs +2 -0
  371. package/dist/esm/api/types/DubbingStartResponse.d.mts +8 -0
  372. package/dist/esm/api/types/DubbingStartResponse.mjs +2 -0
  373. package/dist/esm/api/types/RealtimeAudioInput.d.mts +10 -0
  374. package/dist/esm/api/types/RealtimeAudioInput.mjs +2 -0
  375. package/dist/esm/api/types/RealtimeConfigUpdate.d.mts +55 -0
  376. package/dist/esm/api/types/RealtimeConfigUpdate.mjs +22 -0
  377. package/dist/esm/api/types/RealtimeConfigUpdated.d.mts +8 -0
  378. package/dist/esm/api/types/RealtimeConfigUpdated.mjs +2 -0
  379. package/dist/esm/api/types/RealtimeEnd.d.mts +7 -0
  380. package/dist/esm/api/types/RealtimeEnd.mjs +2 -0
  381. package/dist/esm/api/types/RealtimeError.d.mts +29 -0
  382. package/dist/esm/api/types/RealtimeError.mjs +2 -0
  383. package/dist/esm/api/types/RealtimeFlush.d.mts +7 -0
  384. package/dist/esm/api/types/RealtimeFlush.mjs +2 -0
  385. package/dist/esm/api/types/RealtimePing.d.mts +6 -0
  386. package/dist/esm/api/types/RealtimePing.mjs +2 -0
  387. package/dist/esm/api/types/RealtimePong.d.mts +6 -0
  388. package/dist/esm/api/types/RealtimePong.mjs +2 -0
  389. package/dist/esm/api/types/RealtimeSessionBegin.d.mts +33 -0
  390. package/dist/esm/api/types/RealtimeSessionBegin.mjs +2 -0
  391. package/dist/esm/api/types/RealtimeSessionEnd.d.mts +15 -0
  392. package/dist/esm/api/types/RealtimeSessionEnd.mjs +2 -0
  393. package/dist/esm/api/types/RealtimeSpeechEnd.d.mts +7 -0
  394. package/dist/esm/api/types/RealtimeSpeechEnd.mjs +2 -0
  395. package/dist/esm/api/types/RealtimeSpeechStart.d.mts +7 -0
  396. package/dist/esm/api/types/RealtimeSpeechStart.mjs +2 -0
  397. package/dist/esm/api/types/RealtimeTranscriptFinal.d.mts +32 -0
  398. package/dist/esm/api/types/RealtimeTranscriptFinal.mjs +2 -0
  399. package/dist/esm/api/types/RealtimeTranscriptPartial.d.mts +17 -0
  400. package/dist/esm/api/types/RealtimeTranscriptPartial.mjs +2 -0
  401. package/dist/esm/api/types/RealtimeVadSpeechEnd.d.mts +10 -0
  402. package/dist/esm/api/types/RealtimeVadSpeechEnd.mjs +2 -0
  403. package/dist/esm/api/types/RealtimeVadSpeechStart.d.mts +10 -0
  404. package/dist/esm/api/types/RealtimeVadSpeechStart.mjs +2 -0
  405. package/dist/esm/api/types/SarvamModelIds.d.mts +4 -6
  406. package/dist/esm/api/types/SarvamModelIds.mjs +1 -5
  407. package/dist/esm/api/types/SpeechToTextBatchModel.d.mts +12 -0
  408. package/dist/esm/api/types/SpeechToTextBatchModel.mjs +12 -0
  409. package/dist/esm/api/types/SpeechToTextJobParameters.d.mts +4 -4
  410. package/dist/esm/api/types/SpeechToTextLanguage.d.mts +1 -7
  411. package/dist/esm/api/types/SpeechToTextLanguage.mjs +1 -7
  412. package/dist/esm/api/types/SpeechToTextModel.d.mts +2 -2
  413. package/dist/esm/api/types/SpeechToTextModel.mjs +2 -2
  414. package/dist/esm/api/types/SpeechToTextResponse.d.mts +2 -15
  415. package/dist/esm/api/types/SpeechToTextTranscriptionData.d.mts +2 -4
  416. package/dist/esm/api/types/SpeechToTextTranslateResponse.d.mts +1 -1
  417. package/dist/esm/api/types/TimestampsModel.d.mts +3 -3
  418. package/dist/esm/api/types/index.d.mts +44 -1
  419. package/dist/esm/api/types/index.mjs +44 -1
  420. package/dist/esm/environments.d.mts +2 -0
  421. package/dist/esm/environments.mjs +1 -0
  422. package/dist/esm/version.d.mts +1 -1
  423. package/dist/esm/version.mjs +1 -1
  424. package/package.json +37 -1
  425. package/reference.md +734 -16
  426. package/dist/cjs/api/types/DocDigitizationWebhookCallback.d.ts +0 -9
  427. package/dist/esm/api/types/DocDigitizationWebhookCallback.d.mts +0 -9
  428. /package/dist/cjs/api/{types/DocDigitizationWebhookCallback.js → resources/docAi/client/requests/DocAiGetResultsRequest.js} +0 -0
  429. /package/dist/esm/api/{types/DocDigitizationWebhookCallback.mjs → resources/docAi/client/requests/DocAiGetResultsRequest.mjs} +0 -0
package/README.md CHANGED
@@ -49,10 +49,15 @@ Instantiate and use the client with the following:
49
49
  import { SarvamAIClient } from "sarvamai";
50
50
 
51
51
  const client = new SarvamAIClient({ apiSubscriptionKey: "YOUR_API_SUBSCRIPTION_KEY" });
52
- await client.text.translate({
53
- input: "input",
54
- source_language_code: "auto",
55
- target_language_code: "bn-IN"
52
+ await client.dubbing.create({
53
+ src_lang: "en-IN",
54
+ target_langs: ["hi-IN", "ta-IN", "te-IN"],
55
+ export_options: ["video", "audio", "srt"],
56
+ voice_cloning: true,
57
+ num_speakers: 1,
58
+ disable_watermark: true,
59
+ register: "modern-colloquial",
60
+ job_name: "segment1"
56
61
  });
57
62
  ```
58
63
 
@@ -64,7 +69,7 @@ following namespace:
64
69
  ```typescript
65
70
  import { SarvamAI } from "sarvamai";
66
71
 
67
- const request: SarvamAI.TranslationRequest = {
72
+ const request: SarvamAI.CreateDubbingJobRequest = {
68
73
  ...
69
74
  };
70
75
  ```
@@ -78,7 +83,7 @@ will be thrown.
78
83
  import { SarvamAIError } from "sarvamai";
79
84
 
80
85
  try {
81
- await client.text.translate(...);
86
+ await client.dubbing.create(...);
82
87
  } catch (err) {
83
88
  if (err instanceof SarvamAIError) {
84
89
  console.log(err.statusCode);
@@ -529,9 +534,9 @@ const text = new TextDecoder().decode(bytes);
529
534
  This SDK supports direct imports of subpackage clients, which allows JavaScript bundlers to tree-shake and include only the imported subpackage code. This results in much smaller bundle sizes.
530
535
 
531
536
  ```typescript
532
- import { TextClient } from 'sarvamai/text';
537
+ import { DubbingClient } from 'sarvamai/dubbing';
533
538
 
534
- const client = new TextClient({...});
539
+ const client = new DubbingClient({...});
535
540
  ```
536
541
 
537
542
  ### Additional Headers
@@ -548,7 +553,7 @@ const client = new SarvamAIClient({
548
553
  }
549
554
  });
550
555
 
551
- const response = await client.text.translate(..., {
556
+ const response = await client.dubbing.create(..., {
552
557
  headers: {
553
558
  'X-Custom-Header': 'custom value'
554
559
  }
@@ -560,7 +565,7 @@ const response = await client.text.translate(..., {
560
565
  If you would like to send additional query string parameters as part of the request, use the `queryParams` request option.
561
566
 
562
567
  ```typescript
563
- const response = await client.text.translate(..., {
568
+ const response = await client.dubbing.create(..., {
564
569
  queryParams: {
565
570
  'customQueryParamKey': 'custom query param value'
566
571
  }
@@ -582,7 +587,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
582
587
  Use the `maxRetries` request option to configure this behavior.
583
588
 
584
589
  ```typescript
585
- const response = await client.text.translate(..., {
590
+ const response = await client.dubbing.create(..., {
586
591
  maxRetries: 0 // override maxRetries at the request level
587
592
  });
588
593
  ```
@@ -592,7 +597,7 @@ const response = await client.text.translate(..., {
592
597
  The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
593
598
 
594
599
  ```typescript
595
- const response = await client.text.translate(..., {
600
+ const response = await client.dubbing.create(..., {
596
601
  timeoutInSeconds: 30 // override timeout to 30s
597
602
  });
598
603
  ```
@@ -603,7 +608,7 @@ The SDK allows users to abort requests at any point by passing in an abort signa
603
608
 
604
609
  ```typescript
605
610
  const controller = new AbortController();
606
- const response = await client.text.translate(..., {
611
+ const response = await client.dubbing.create(..., {
607
612
  abortSignal: controller.signal
608
613
  });
609
614
  controller.abort(); // aborts the request
@@ -615,7 +620,7 @@ The SDK provides access to raw response data, including headers, through the `.w
615
620
  The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
616
621
 
617
622
  ```typescript
618
- const { data, rawResponse } = await client.text.translate(...).withRawResponse();
623
+ const { data, rawResponse } = await client.dubbing.create(...).withRawResponse();
619
624
 
620
625
  console.log(data);
621
626
  console.log(rawResponse.headers['X-My-Header']);
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "sarvamai",
46
- "X-Fern-SDK-Version": "1.1.8-alpha.2",
47
- "User-Agent": "sarvamai/1.1.8-alpha.2",
46
+ "X-Fern-SDK-Version": "1.1.8-alpha.4",
47
+ "User-Agent": "sarvamai/1.1.8-alpha.4",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -1,8 +1,11 @@
1
1
  import { ChatClient } from "./api/resources/chat/client/Client.js";
2
+ import { DocAiClient } from "./api/resources/docAi/client/Client.js";
2
3
  import { DocumentIntelligenceClient } from "./api/resources/documentIntelligence/client/Client.js";
4
+ import { DubbingClient } from "./api/resources/dubbing/client/Client.js";
3
5
  import { PronunciationDictionaryClient } from "./api/resources/pronunciationDictionary/client/Client.js";
4
6
  import { SpeechToTextClient } from "./api/resources/speechToText/client/Client.js";
5
7
  import { SpeechToTextJobClient } from "./api/resources/speechToTextJob/client/Client.js";
8
+ import { SpeechToTextRealtimeStreamingClient } from "./api/resources/speechToTextRealtimeStreaming/client/Client.js";
6
9
  import { SpeechToTextStreamingClient } from "./api/resources/speechToTextStreaming/client/Client.js";
7
10
  import { SpeechToTextTranslateJobClient } from "./api/resources/speechToTextTranslateJob/client/Client.js";
8
11
  import { SpeechToTextTranslateStreamingClient } from "./api/resources/speechToTextTranslateStreaming/client/Client.js";
@@ -18,6 +21,7 @@ export declare namespace SarvamAIClient {
18
21
  }
19
22
  export declare class SarvamAIClient {
20
23
  protected readonly _options: NormalizedClientOptionsWithAuth<SarvamAIClient.Options>;
24
+ protected _dubbing: DubbingClient | undefined;
21
25
  protected _text: TextClient | undefined;
22
26
  protected _speechToText: SpeechToTextClient | undefined;
23
27
  protected _textToSpeech: TextToSpeechClient | undefined;
@@ -26,10 +30,13 @@ export declare class SarvamAIClient {
26
30
  protected _speechToTextJob: SpeechToTextJobClient | undefined;
27
31
  protected _speechToTextTranslateJob: SpeechToTextTranslateJobClient | undefined;
28
32
  protected _documentIntelligence: DocumentIntelligenceClient | undefined;
33
+ protected _docAi: DocAiClient | undefined;
29
34
  protected _speechToTextStreaming: SpeechToTextStreamingClient | undefined;
30
35
  protected _speechToTextTranslateStreaming: SpeechToTextTranslateStreamingClient | undefined;
36
+ protected _speechToTextRealtimeStreaming: SpeechToTextRealtimeStreamingClient | undefined;
31
37
  protected _textToSpeechStreaming: TextToSpeechStreamingClient | undefined;
32
38
  constructor(options?: SarvamAIClient.Options);
39
+ get dubbing(): DubbingClient;
33
40
  get text(): TextClient;
34
41
  get speechToText(): SpeechToTextClient;
35
42
  get textToSpeech(): TextToSpeechClient;
@@ -38,7 +45,9 @@ export declare class SarvamAIClient {
38
45
  get speechToTextJob(): SpeechToTextJobClient;
39
46
  get speechToTextTranslateJob(): SpeechToTextTranslateJobClient;
40
47
  get documentIntelligence(): DocumentIntelligenceClient;
48
+ get docAi(): DocAiClient;
41
49
  get speechToTextStreaming(): SpeechToTextStreamingClient;
42
50
  get speechToTextTranslateStreaming(): SpeechToTextTranslateStreamingClient;
51
+ get speechToTextRealtimeStreaming(): SpeechToTextRealtimeStreamingClient;
43
52
  get textToSpeechStreaming(): TextToSpeechStreamingClient;
44
53
  }
@@ -3,36 +3,43 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.SarvamAIClient = void 0;
5
5
  const Client_js_1 = require("./api/resources/chat/client/Client.js");
6
- const Client_js_2 = require("./api/resources/documentIntelligence/client/Client.js");
7
- const Client_js_3 = require("./api/resources/pronunciationDictionary/client/Client.js");
8
- const Client_js_4 = require("./api/resources/speechToText/client/Client.js");
9
- const Client_js_5 = require("./api/resources/speechToTextJob/client/Client.js");
10
- const Client_js_6 = require("./api/resources/speechToTextStreaming/client/Client.js");
11
- const Client_js_7 = require("./api/resources/speechToTextTranslateJob/client/Client.js");
12
- const Client_js_8 = require("./api/resources/speechToTextTranslateStreaming/client/Client.js");
13
- const Client_js_9 = require("./api/resources/text/client/Client.js");
14
- const Client_js_10 = require("./api/resources/textToSpeech/client/Client.js");
15
- const Client_js_11 = require("./api/resources/textToSpeechStreaming/client/Client.js");
6
+ const Client_js_2 = require("./api/resources/docAi/client/Client.js");
7
+ const Client_js_3 = require("./api/resources/documentIntelligence/client/Client.js");
8
+ const Client_js_4 = require("./api/resources/dubbing/client/Client.js");
9
+ const Client_js_5 = require("./api/resources/pronunciationDictionary/client/Client.js");
10
+ const Client_js_6 = require("./api/resources/speechToText/client/Client.js");
11
+ const Client_js_7 = require("./api/resources/speechToTextJob/client/Client.js");
12
+ const Client_js_8 = require("./api/resources/speechToTextRealtimeStreaming/client/Client.js");
13
+ const Client_js_9 = require("./api/resources/speechToTextStreaming/client/Client.js");
14
+ const Client_js_10 = require("./api/resources/speechToTextTranslateJob/client/Client.js");
15
+ const Client_js_11 = require("./api/resources/speechToTextTranslateStreaming/client/Client.js");
16
+ const Client_js_12 = require("./api/resources/text/client/Client.js");
17
+ const Client_js_13 = require("./api/resources/textToSpeech/client/Client.js");
18
+ const Client_js_14 = require("./api/resources/textToSpeechStreaming/client/Client.js");
16
19
  const BaseClient_js_1 = require("./BaseClient.js");
17
20
  class SarvamAIClient {
18
21
  constructor(options = {}) {
19
22
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
20
23
  }
24
+ get dubbing() {
25
+ var _a;
26
+ return ((_a = this._dubbing) !== null && _a !== void 0 ? _a : (this._dubbing = new Client_js_4.DubbingClient(this._options)));
27
+ }
21
28
  get text() {
22
29
  var _a;
23
- return ((_a = this._text) !== null && _a !== void 0 ? _a : (this._text = new Client_js_9.TextClient(this._options)));
30
+ return ((_a = this._text) !== null && _a !== void 0 ? _a : (this._text = new Client_js_12.TextClient(this._options)));
24
31
  }
25
32
  get speechToText() {
26
33
  var _a;
27
- return ((_a = this._speechToText) !== null && _a !== void 0 ? _a : (this._speechToText = new Client_js_4.SpeechToTextClient(this._options)));
34
+ return ((_a = this._speechToText) !== null && _a !== void 0 ? _a : (this._speechToText = new Client_js_6.SpeechToTextClient(this._options)));
28
35
  }
29
36
  get textToSpeech() {
30
37
  var _a;
31
- return ((_a = this._textToSpeech) !== null && _a !== void 0 ? _a : (this._textToSpeech = new Client_js_10.TextToSpeechClient(this._options)));
38
+ return ((_a = this._textToSpeech) !== null && _a !== void 0 ? _a : (this._textToSpeech = new Client_js_13.TextToSpeechClient(this._options)));
32
39
  }
33
40
  get pronunciationDictionary() {
34
41
  var _a;
35
- return ((_a = this._pronunciationDictionary) !== null && _a !== void 0 ? _a : (this._pronunciationDictionary = new Client_js_3.PronunciationDictionaryClient(this._options)));
42
+ return ((_a = this._pronunciationDictionary) !== null && _a !== void 0 ? _a : (this._pronunciationDictionary = new Client_js_5.PronunciationDictionaryClient(this._options)));
36
43
  }
37
44
  get chat() {
38
45
  var _a;
@@ -40,27 +47,35 @@ class SarvamAIClient {
40
47
  }
41
48
  get speechToTextJob() {
42
49
  var _a;
43
- return ((_a = this._speechToTextJob) !== null && _a !== void 0 ? _a : (this._speechToTextJob = new Client_js_5.SpeechToTextJobClient(this._options)));
50
+ return ((_a = this._speechToTextJob) !== null && _a !== void 0 ? _a : (this._speechToTextJob = new Client_js_7.SpeechToTextJobClient(this._options)));
44
51
  }
45
52
  get speechToTextTranslateJob() {
46
53
  var _a;
47
- return ((_a = this._speechToTextTranslateJob) !== null && _a !== void 0 ? _a : (this._speechToTextTranslateJob = new Client_js_7.SpeechToTextTranslateJobClient(this._options)));
54
+ return ((_a = this._speechToTextTranslateJob) !== null && _a !== void 0 ? _a : (this._speechToTextTranslateJob = new Client_js_10.SpeechToTextTranslateJobClient(this._options)));
48
55
  }
49
56
  get documentIntelligence() {
50
57
  var _a;
51
- return ((_a = this._documentIntelligence) !== null && _a !== void 0 ? _a : (this._documentIntelligence = new Client_js_2.DocumentIntelligenceClient(this._options)));
58
+ return ((_a = this._documentIntelligence) !== null && _a !== void 0 ? _a : (this._documentIntelligence = new Client_js_3.DocumentIntelligenceClient(this._options)));
59
+ }
60
+ get docAi() {
61
+ var _a;
62
+ return ((_a = this._docAi) !== null && _a !== void 0 ? _a : (this._docAi = new Client_js_2.DocAiClient(this._options)));
52
63
  }
53
64
  get speechToTextStreaming() {
54
65
  var _a;
55
- return ((_a = this._speechToTextStreaming) !== null && _a !== void 0 ? _a : (this._speechToTextStreaming = new Client_js_6.SpeechToTextStreamingClient(this._options)));
66
+ return ((_a = this._speechToTextStreaming) !== null && _a !== void 0 ? _a : (this._speechToTextStreaming = new Client_js_9.SpeechToTextStreamingClient(this._options)));
56
67
  }
57
68
  get speechToTextTranslateStreaming() {
58
69
  var _a;
59
- return ((_a = this._speechToTextTranslateStreaming) !== null && _a !== void 0 ? _a : (this._speechToTextTranslateStreaming = new Client_js_8.SpeechToTextTranslateStreamingClient(this._options)));
70
+ return ((_a = this._speechToTextTranslateStreaming) !== null && _a !== void 0 ? _a : (this._speechToTextTranslateStreaming = new Client_js_11.SpeechToTextTranslateStreamingClient(this._options)));
71
+ }
72
+ get speechToTextRealtimeStreaming() {
73
+ var _a;
74
+ return ((_a = this._speechToTextRealtimeStreaming) !== null && _a !== void 0 ? _a : (this._speechToTextRealtimeStreaming = new Client_js_8.SpeechToTextRealtimeStreamingClient(this._options)));
60
75
  }
61
76
  get textToSpeechStreaming() {
62
77
  var _a;
63
- return ((_a = this._textToSpeechStreaming) !== null && _a !== void 0 ? _a : (this._textToSpeechStreaming = new Client_js_11.TextToSpeechStreamingClient(this._options)));
78
+ return ((_a = this._textToSpeechStreaming) !== null && _a !== void 0 ? _a : (this._textToSpeechStreaming = new Client_js_14.TextToSpeechStreamingClient(this._options)));
64
79
  }
65
80
  }
66
81
  exports.SarvamAIClient = SarvamAIClient;
@@ -0,0 +1,6 @@
1
+ import type * as core from "../../core/index.js";
2
+ import * as errors from "../../errors/index.js";
3
+ import type * as SarvamAI from "../index.js";
4
+ export declare class ConflictError extends errors.SarvamAIError {
5
+ constructor(body: SarvamAI.DocAiErrorModel, rawResponse?: core.RawResponse);
6
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.ConflictError = void 0;
38
+ const errors = __importStar(require("../../errors/index.js"));
39
+ class ConflictError extends errors.SarvamAIError {
40
+ constructor(body, rawResponse) {
41
+ super({
42
+ message: "ConflictError",
43
+ statusCode: 409,
44
+ body: body,
45
+ rawResponse: rawResponse,
46
+ });
47
+ Object.setPrototypeOf(this, new.target.prototype);
48
+ if (Error.captureStackTrace) {
49
+ Error.captureStackTrace(this, this.constructor);
50
+ }
51
+ this.name = this.constructor.name;
52
+ }
53
+ }
54
+ exports.ConflictError = ConflictError;
@@ -1,6 +1,5 @@
1
1
  import type * as core from "../../core/index.js";
2
2
  import * as errors from "../../errors/index.js";
3
- import type * as SarvamAI from "../index.js";
4
3
  export declare class ContentTooLargeError extends errors.SarvamAIError {
5
- constructor(body: SarvamAI.ErrorMessage, rawResponse?: core.RawResponse);
4
+ constructor(body?: unknown, rawResponse?: core.RawResponse);
6
5
  }
@@ -1,6 +1,5 @@
1
1
  import type * as core from "../../core/index.js";
2
2
  import * as errors from "../../errors/index.js";
3
- import type * as SarvamAI from "../index.js";
4
3
  export declare class NotFoundError extends errors.SarvamAIError {
5
- constructor(body: SarvamAI.ErrorMessage, rawResponse?: core.RawResponse);
4
+ constructor(body?: unknown, rawResponse?: core.RawResponse);
6
5
  }
@@ -0,0 +1,6 @@
1
+ import type * as core from "../../core/index.js";
2
+ import * as errors from "../../errors/index.js";
3
+ import type * as SarvamAI from "../index.js";
4
+ export declare class PaymentRequiredError extends errors.SarvamAIError {
5
+ constructor(body: SarvamAI.DocAiErrorModel, rawResponse?: core.RawResponse);
6
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.PaymentRequiredError = void 0;
38
+ const errors = __importStar(require("../../errors/index.js"));
39
+ class PaymentRequiredError extends errors.SarvamAIError {
40
+ constructor(body, rawResponse) {
41
+ super({
42
+ message: "PaymentRequiredError",
43
+ statusCode: 402,
44
+ body: body,
45
+ rawResponse: rawResponse,
46
+ });
47
+ Object.setPrototypeOf(this, new.target.prototype);
48
+ if (Error.captureStackTrace) {
49
+ Error.captureStackTrace(this, this.constructor);
50
+ }
51
+ this.name = this.constructor.name;
52
+ }
53
+ }
54
+ exports.PaymentRequiredError = PaymentRequiredError;
@@ -0,0 +1,6 @@
1
+ import type * as core from "../../core/index.js";
2
+ import * as errors from "../../errors/index.js";
3
+ import type * as SarvamAI from "../index.js";
4
+ export declare class UnauthorizedError extends errors.SarvamAIError {
5
+ constructor(body: SarvamAI.ErrorMessage, rawResponse?: core.RawResponse);
6
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.UnauthorizedError = void 0;
38
+ const errors = __importStar(require("../../errors/index.js"));
39
+ class UnauthorizedError extends errors.SarvamAIError {
40
+ constructor(body, rawResponse) {
41
+ super({
42
+ message: "UnauthorizedError",
43
+ statusCode: 401,
44
+ body: body,
45
+ rawResponse: rawResponse,
46
+ });
47
+ Object.setPrototypeOf(this, new.target.prototype);
48
+ if (Error.captureStackTrace) {
49
+ Error.captureStackTrace(this, this.constructor);
50
+ }
51
+ this.name = this.constructor.name;
52
+ }
53
+ }
54
+ exports.UnauthorizedError = UnauthorizedError;
@@ -1,8 +1,11 @@
1
1
  export * from "./BadRequestError.js";
2
+ export * from "./ConflictError.js";
2
3
  export * from "./ContentTooLargeError.js";
3
4
  export * from "./ForbiddenError.js";
4
5
  export * from "./InternalServerError.js";
5
6
  export * from "./NotFoundError.js";
7
+ export * from "./PaymentRequiredError.js";
6
8
  export * from "./ServiceUnavailableError.js";
7
9
  export * from "./TooManyRequestsError.js";
10
+ export * from "./UnauthorizedError.js";
8
11
  export * from "./UnprocessableEntityError.js";
@@ -15,10 +15,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./BadRequestError.js"), exports);
18
+ __exportStar(require("./ConflictError.js"), exports);
18
19
  __exportStar(require("./ContentTooLargeError.js"), exports);
19
20
  __exportStar(require("./ForbiddenError.js"), exports);
20
21
  __exportStar(require("./InternalServerError.js"), exports);
21
22
  __exportStar(require("./NotFoundError.js"), exports);
23
+ __exportStar(require("./PaymentRequiredError.js"), exports);
22
24
  __exportStar(require("./ServiceUnavailableError.js"), exports);
23
25
  __exportStar(require("./TooManyRequestsError.js"), exports);
26
+ __exportStar(require("./UnauthorizedError.js"), exports);
24
27
  __exportStar(require("./UnprocessableEntityError.js"), exports);
@@ -28,14 +28,14 @@ export declare class ChatClient {
28
28
  * // Non-streaming
29
29
  * const response = await client.chat.completions({
30
30
  * messages: [{ role: "user", content: "Hello" }],
31
- * model: "sarvam-m"
31
+ * model: "sarvam-105b"
32
32
  * });
33
33
  *
34
34
  * @example
35
35
  * // Streaming
36
36
  * const stream = await client.chat.completions({
37
37
  * messages: [{ role: "user", content: "Hello" }],
38
- * model: "sarvam-m",
38
+ * model: "sarvam-105b",
39
39
  * stream: true
40
40
  * });
41
41
  * for await (const chunk of stream) {
@@ -46,7 +46,7 @@ export declare class ChatClient {
46
46
  * // Tool calling
47
47
  * const response = await client.chat.completions({
48
48
  * messages: [{ role: "user", content: "What is the weather?" }],
49
- * model: "sarvam-m",
49
+ * model: "sarvam-105b",
50
50
  * tools: [{
51
51
  * type: "function",
52
52
  * function: {
@@ -3,7 +3,8 @@ import type * as SarvamAI from "../../../../index.js";
3
3
  * @example
4
4
  * {
5
5
  * messages: [{
6
- * role: "assistant"
6
+ * role: "user",
7
+ * content: "content"
7
8
  * }],
8
9
  * model: "sarvam-105b"
9
10
  * }
@@ -11,7 +12,7 @@ import type * as SarvamAI from "../../../../index.js";
11
12
  export interface ChatCompletionsRequest {
12
13
  /** A list of messages comprising the conversation so far. */
13
14
  messages: SarvamAI.ChatCompletionRequestMessage[];
14
- /** Chat model ID. Use `sarvam-30b` (64K context) or `sarvam-105b` (128K context). */
15
+ /** Chat model ID. Use `sarvam-105b` (128K context). */
15
16
  model: SarvamAI.SarvamModelIds;
16
17
  /**
17
18
  * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.