sarvamai 1.1.5 → 1.1.6-alpha.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 (306) hide show
  1. package/dist/cjs/BaseClient.d.ts +7 -7
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +4 -2
  4. package/dist/cjs/Client.js +21 -16
  5. package/dist/cjs/api/errors/BadRequestError.js +5 -1
  6. package/dist/cjs/api/errors/ContentTooLargeError.d.ts +6 -0
  7. package/dist/cjs/api/errors/ContentTooLargeError.js +54 -0
  8. package/dist/cjs/api/errors/ForbiddenError.js +5 -1
  9. package/dist/cjs/api/errors/InternalServerError.js +5 -1
  10. package/dist/cjs/api/errors/NotFoundError.d.ts +6 -0
  11. package/dist/cjs/api/errors/NotFoundError.js +54 -0
  12. package/dist/cjs/api/errors/ServiceUnavailableError.js +5 -1
  13. package/dist/cjs/api/errors/TooManyRequestsError.js +5 -1
  14. package/dist/cjs/api/errors/UnprocessableEntityError.js +5 -1
  15. package/dist/cjs/api/errors/index.d.ts +2 -0
  16. package/dist/cjs/api/errors/index.js +2 -0
  17. package/dist/cjs/api/resources/chat/client/requests/ChatCompletionsRequest.d.ts +1 -1
  18. package/dist/cjs/api/resources/chat/exports.d.ts +2 -0
  19. package/dist/cjs/api/resources/chat/exports.js +21 -0
  20. package/dist/cjs/api/resources/documentIntelligence/exports.d.ts +2 -0
  21. package/dist/cjs/api/resources/documentIntelligence/exports.js +21 -0
  22. package/dist/cjs/api/resources/index.d.ts +2 -0
  23. package/dist/cjs/api/resources/index.js +3 -1
  24. package/dist/cjs/api/resources/pronunciationDictionary/client/Client.d.ts +143 -0
  25. package/dist/cjs/api/resources/pronunciationDictionary/client/Client.js +445 -0
  26. package/dist/cjs/api/resources/pronunciationDictionary/client/index.d.ts +1 -0
  27. package/dist/cjs/api/resources/pronunciationDictionary/client/index.js +17 -0
  28. package/dist/cjs/api/resources/pronunciationDictionary/client/requests/CreatePronunciationDictionaryRequest.d.ts +10 -0
  29. package/dist/cjs/api/resources/pronunciationDictionary/client/requests/PronunciationDictionaryDeleteRequest.d.ts +10 -0
  30. package/dist/cjs/api/resources/pronunciationDictionary/client/requests/UpdatePronunciationDictionaryRequest.d.ts +13 -0
  31. package/dist/cjs/api/resources/pronunciationDictionary/client/requests/index.d.ts +3 -0
  32. package/dist/cjs/api/resources/pronunciationDictionary/client/requests/index.js +2 -0
  33. package/dist/cjs/api/resources/pronunciationDictionary/exports.d.ts +2 -0
  34. package/dist/cjs/api/resources/pronunciationDictionary/exports.js +21 -0
  35. package/dist/cjs/api/resources/pronunciationDictionary/index.d.ts +1 -0
  36. package/dist/cjs/api/resources/pronunciationDictionary/index.js +17 -0
  37. package/dist/cjs/api/resources/speechToText/client/Client.d.ts +1 -2
  38. package/dist/cjs/api/resources/speechToText/client/Client.js +16 -53
  39. package/dist/cjs/api/resources/speechToText/exports.d.ts +2 -0
  40. package/dist/cjs/api/resources/speechToText/exports.js +21 -0
  41. package/dist/cjs/api/resources/speechToTextJob/client/Client.d.ts +3 -3
  42. package/dist/cjs/api/resources/speechToTextJob/client/SpeechToTextJobInstance.d.ts +4 -4
  43. package/dist/cjs/api/resources/speechToTextJob/client/SpeechToTextJobInstance.js +1 -1
  44. package/dist/cjs/api/resources/speechToTextJob/exports.d.ts +2 -0
  45. package/dist/cjs/api/resources/speechToTextJob/exports.js +21 -0
  46. package/dist/cjs/api/resources/speechToTextStreaming/exports.d.ts +2 -0
  47. package/dist/cjs/api/resources/speechToTextStreaming/exports.js +21 -0
  48. package/dist/cjs/api/resources/speechToTextTranslateJob/client/Client.d.ts +3 -3
  49. package/dist/cjs/api/resources/speechToTextTranslateJob/client/SpeechToTextTranslateJobInstance.d.ts +4 -4
  50. package/dist/cjs/api/resources/speechToTextTranslateJob/client/SpeechToTextTranslateJobInstance.js +1 -1
  51. package/dist/cjs/api/resources/speechToTextTranslateJob/exports.d.ts +2 -0
  52. package/dist/cjs/api/resources/speechToTextTranslateJob/exports.js +21 -0
  53. package/dist/cjs/api/resources/speechToTextTranslateStreaming/exports.d.ts +2 -0
  54. package/dist/cjs/api/resources/speechToTextTranslateStreaming/exports.js +21 -0
  55. package/dist/cjs/api/resources/text/client/Client.d.ts +1 -2
  56. package/dist/cjs/api/resources/text/client/Client.js +4 -60
  57. package/dist/cjs/api/resources/text/exports.d.ts +2 -0
  58. package/dist/cjs/api/resources/text/exports.js +21 -0
  59. package/dist/cjs/api/resources/textToSpeech/client/Client.d.ts +15 -2
  60. package/dist/cjs/api/resources/textToSpeech/client/Client.js +62 -19
  61. package/dist/cjs/api/resources/textToSpeech/client/requests/TextToSpeechRequest.d.ts +14 -0
  62. package/dist/cjs/api/resources/textToSpeech/client/requests/TextToSpeechStreamRequest.d.ts +79 -0
  63. package/dist/cjs/api/resources/textToSpeech/client/requests/TextToSpeechStreamRequest.js +3 -0
  64. package/dist/cjs/api/resources/textToSpeech/client/requests/index.d.ts +1 -0
  65. package/dist/cjs/api/resources/textToSpeech/exports.d.ts +2 -0
  66. package/dist/cjs/api/resources/textToSpeech/exports.js +21 -0
  67. package/dist/cjs/api/resources/textToSpeechStreaming/client/Socket.d.ts +2 -0
  68. package/dist/cjs/api/resources/textToSpeechStreaming/client/Socket.js +1 -0
  69. package/dist/cjs/api/resources/textToSpeechStreaming/exports.d.ts +2 -0
  70. package/dist/cjs/api/resources/textToSpeechStreaming/exports.js +21 -0
  71. package/dist/cjs/api/types/AudioOutput.d.ts +1 -1
  72. package/dist/cjs/api/types/BulkJobCallback.d.ts +1 -1
  73. package/dist/cjs/api/types/{BulkJobInitResponseV1.d.ts → BulkJobInitResponse.d.ts} +1 -1
  74. package/dist/cjs/api/types/BulkJobInitResponse.js +3 -0
  75. package/dist/cjs/api/types/ChatCompletionRequestAssistantMessage.d.ts +2 -2
  76. package/dist/cjs/api/types/ChatCompletionResponseMessage.d.ts +4 -4
  77. package/dist/cjs/api/types/Choice.d.ts +1 -1
  78. package/dist/cjs/api/types/CompletionUsage.d.ts +2 -2
  79. package/dist/cjs/api/types/ConfigMessage.d.ts +1 -1
  80. package/dist/cjs/api/types/ConfigureConnection.d.ts +21 -11
  81. package/dist/cjs/api/types/CreateChatCompletionResponse.d.ts +3 -3
  82. package/dist/cjs/api/types/DocDigitizationDownloadFilesResponse.d.ts +2 -2
  83. package/dist/cjs/api/types/DocDigitizationErrorDetails.d.ts +1 -1
  84. package/dist/cjs/api/types/DocDigitizationJobDetail.d.ts +7 -7
  85. package/dist/cjs/api/types/DocDigitizationJobParameters.d.ts +2 -2
  86. package/dist/cjs/api/types/DocDigitizationJobStatusResponse.d.ts +5 -5
  87. package/dist/cjs/api/types/DocDigitizationWebhookCallback.d.ts +1 -1
  88. package/dist/cjs/api/types/ErrorCode.d.ts +1 -1
  89. package/dist/cjs/api/types/ErrorCode.js +1 -1
  90. package/dist/cjs/api/types/ErrorCode2.d.ts +11 -0
  91. package/dist/cjs/api/types/ErrorCode2.js +14 -0
  92. package/dist/cjs/api/types/ErrorDetails.d.ts +1 -2
  93. package/dist/cjs/api/types/ErrorDetails2.d.ts +9 -0
  94. package/dist/cjs/api/types/ErrorDetails2.js +3 -0
  95. package/dist/cjs/api/types/ErrorMessage2.d.ts +5 -0
  96. package/dist/cjs/api/types/ErrorMessage2.js +3 -0
  97. package/dist/cjs/api/types/ErrorResponse.d.ts +3 -3
  98. package/dist/cjs/api/types/EventResponse.d.ts +2 -2
  99. package/dist/cjs/api/types/EventsData.d.ts +4 -4
  100. package/dist/cjs/api/types/FileSignedUrlDetails.d.ts +1 -1
  101. package/dist/cjs/api/types/FunctionDefinition.d.ts +2 -2
  102. package/dist/cjs/api/types/{JobStatusV1Response.d.ts → JobStatusResponse.d.ts} +6 -6
  103. package/dist/cjs/api/types/JobStatusResponse.js +3 -0
  104. package/dist/cjs/api/types/LanguageIdentificationResponse.d.ts +3 -3
  105. package/dist/cjs/api/types/PronunciationDictionaryData.d.ts +7 -0
  106. package/dist/cjs/api/types/PronunciationDictionaryData.js +3 -0
  107. package/dist/cjs/api/types/PronunciationDictionaryDeleteResponse.d.ts +9 -0
  108. package/dist/cjs/api/types/PronunciationDictionaryDeleteResponse.js +3 -0
  109. package/dist/cjs/api/types/PronunciationDictionaryGetResponse.d.ts +9 -0
  110. package/dist/cjs/api/types/PronunciationDictionaryGetResponse.js +3 -0
  111. package/dist/cjs/api/types/PronunciationDictionaryResponse.d.ts +7 -0
  112. package/dist/cjs/api/types/PronunciationDictionaryResponse.js +3 -0
  113. package/dist/cjs/api/types/PronunciationDictionaryUpdateResponse.d.ts +9 -0
  114. package/dist/cjs/api/types/PronunciationDictionaryUpdateResponse.js +3 -0
  115. package/dist/cjs/api/types/SarvamModelIds.d.ts +3 -3
  116. package/dist/cjs/api/types/SarvamModelIds.js +3 -3
  117. package/dist/cjs/api/types/SpeechStreamBitrate.d.ts +8 -0
  118. package/dist/cjs/api/types/SpeechStreamBitrate.js +11 -0
  119. package/dist/cjs/api/types/SpeechStreamCodec.d.ts +11 -0
  120. package/dist/cjs/api/types/SpeechStreamCodec.js +14 -0
  121. package/dist/cjs/api/types/SpeechToTextJobParameters.d.ts +6 -6
  122. package/dist/cjs/api/types/SpeechToTextResponse.d.ts +5 -5
  123. package/dist/cjs/api/types/SpeechToTextTranscriptionData.d.ts +4 -4
  124. package/dist/cjs/api/types/SpeechToTextTranslateJobParameters.d.ts +4 -4
  125. package/dist/cjs/api/types/SpeechToTextTranslateResponse.d.ts +4 -4
  126. package/dist/cjs/api/types/SpeechToTextTranslateTranscriptionData.d.ts +2 -2
  127. package/dist/cjs/api/types/TaskDetail.d.ts +8 -0
  128. package/dist/cjs/api/types/TaskDetail.js +3 -0
  129. package/dist/cjs/api/types/TextToSpeechResponse.d.ts +1 -1
  130. package/dist/cjs/api/types/TranslationResponse.d.ts +1 -1
  131. package/dist/cjs/api/types/TransliterationResponse.d.ts +1 -1
  132. package/dist/cjs/api/types/index.d.ts +13 -3
  133. package/dist/cjs/api/types/index.js +13 -3
  134. package/dist/cjs/auth/HeaderAuthProvider.d.ts +14 -8
  135. package/dist/cjs/auth/HeaderAuthProvider.js +19 -9
  136. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
  137. package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -2
  138. package/dist/cjs/core/fetcher/Fetcher.js +8 -2
  139. package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
  140. package/dist/cjs/core/fetcher/makeRequest.js +30 -9
  141. package/dist/cjs/core/headers.d.ts +2 -2
  142. package/dist/cjs/core/websocket/ws.d.ts +1 -1
  143. package/dist/cjs/errors/SarvamAIError.js +5 -1
  144. package/dist/cjs/errors/SarvamAITimeoutError.js +5 -1
  145. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
  146. package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
  147. package/dist/cjs/version.d.ts +1 -1
  148. package/dist/cjs/version.js +1 -1
  149. package/dist/esm/BaseClient.d.mts +7 -7
  150. package/dist/esm/BaseClient.mjs +2 -2
  151. package/dist/esm/Client.d.mts +4 -2
  152. package/dist/esm/Client.mjs +5 -0
  153. package/dist/esm/api/errors/BadRequestError.mjs +5 -1
  154. package/dist/esm/api/errors/ContentTooLargeError.d.mts +6 -0
  155. package/dist/esm/api/errors/ContentTooLargeError.mjs +17 -0
  156. package/dist/esm/api/errors/ForbiddenError.mjs +5 -1
  157. package/dist/esm/api/errors/InternalServerError.mjs +5 -1
  158. package/dist/esm/api/errors/NotFoundError.d.mts +6 -0
  159. package/dist/esm/api/errors/NotFoundError.mjs +17 -0
  160. package/dist/esm/api/errors/ServiceUnavailableError.mjs +5 -1
  161. package/dist/esm/api/errors/TooManyRequestsError.mjs +5 -1
  162. package/dist/esm/api/errors/UnprocessableEntityError.mjs +5 -1
  163. package/dist/esm/api/errors/index.d.mts +2 -0
  164. package/dist/esm/api/errors/index.mjs +2 -0
  165. package/dist/esm/api/resources/chat/client/requests/ChatCompletionsRequest.d.mts +1 -1
  166. package/dist/esm/api/resources/chat/exports.d.mts +2 -0
  167. package/dist/esm/api/resources/chat/exports.mjs +3 -0
  168. package/dist/esm/api/resources/documentIntelligence/exports.d.mts +2 -0
  169. package/dist/esm/api/resources/documentIntelligence/exports.mjs +3 -0
  170. package/dist/esm/api/resources/index.d.mts +2 -0
  171. package/dist/esm/api/resources/index.mjs +2 -0
  172. package/dist/esm/api/resources/pronunciationDictionary/client/Client.d.mts +143 -0
  173. package/dist/esm/api/resources/pronunciationDictionary/client/Client.mjs +408 -0
  174. package/dist/esm/api/resources/pronunciationDictionary/client/index.d.mts +1 -0
  175. package/dist/esm/api/resources/pronunciationDictionary/client/index.mjs +1 -0
  176. package/dist/esm/api/resources/pronunciationDictionary/client/requests/CreatePronunciationDictionaryRequest.d.mts +10 -0
  177. package/dist/esm/api/resources/pronunciationDictionary/client/requests/PronunciationDictionaryDeleteRequest.d.mts +10 -0
  178. package/dist/esm/api/resources/pronunciationDictionary/client/requests/UpdatePronunciationDictionaryRequest.d.mts +13 -0
  179. package/dist/esm/api/resources/pronunciationDictionary/client/requests/index.d.mts +3 -0
  180. package/dist/esm/api/resources/pronunciationDictionary/client/requests/index.mjs +1 -0
  181. package/dist/esm/api/resources/pronunciationDictionary/exports.d.mts +2 -0
  182. package/dist/esm/api/resources/pronunciationDictionary/exports.mjs +3 -0
  183. package/dist/esm/api/resources/pronunciationDictionary/index.d.mts +1 -0
  184. package/dist/esm/api/resources/pronunciationDictionary/index.mjs +1 -0
  185. package/dist/esm/api/resources/speechToText/client/Client.d.mts +1 -2
  186. package/dist/esm/api/resources/speechToText/client/Client.mjs +16 -53
  187. package/dist/esm/api/resources/speechToText/exports.d.mts +2 -0
  188. package/dist/esm/api/resources/speechToText/exports.mjs +3 -0
  189. package/dist/esm/api/resources/speechToTextJob/client/Client.d.mts +3 -3
  190. package/dist/esm/api/resources/speechToTextJob/client/SpeechToTextJobInstance.d.mts +4 -4
  191. package/dist/esm/api/resources/speechToTextJob/client/SpeechToTextJobInstance.mjs +1 -1
  192. package/dist/esm/api/resources/speechToTextJob/exports.d.mts +2 -0
  193. package/dist/esm/api/resources/speechToTextJob/exports.mjs +3 -0
  194. package/dist/esm/api/resources/speechToTextStreaming/exports.d.mts +2 -0
  195. package/dist/esm/api/resources/speechToTextStreaming/exports.mjs +3 -0
  196. package/dist/esm/api/resources/speechToTextTranslateJob/client/Client.d.mts +3 -3
  197. package/dist/esm/api/resources/speechToTextTranslateJob/client/SpeechToTextTranslateJobInstance.d.mts +4 -4
  198. package/dist/esm/api/resources/speechToTextTranslateJob/client/SpeechToTextTranslateJobInstance.mjs +1 -1
  199. package/dist/esm/api/resources/speechToTextTranslateJob/exports.d.mts +2 -0
  200. package/dist/esm/api/resources/speechToTextTranslateJob/exports.mjs +3 -0
  201. package/dist/esm/api/resources/speechToTextTranslateStreaming/exports.d.mts +2 -0
  202. package/dist/esm/api/resources/speechToTextTranslateStreaming/exports.mjs +3 -0
  203. package/dist/esm/api/resources/text/client/Client.d.mts +1 -2
  204. package/dist/esm/api/resources/text/client/Client.mjs +4 -60
  205. package/dist/esm/api/resources/text/exports.d.mts +2 -0
  206. package/dist/esm/api/resources/text/exports.mjs +3 -0
  207. package/dist/esm/api/resources/textToSpeech/client/Client.d.mts +15 -2
  208. package/dist/esm/api/resources/textToSpeech/client/Client.mjs +62 -19
  209. package/dist/esm/api/resources/textToSpeech/client/requests/TextToSpeechRequest.d.mts +14 -0
  210. package/dist/esm/api/resources/textToSpeech/client/requests/TextToSpeechStreamRequest.d.mts +79 -0
  211. package/dist/esm/api/resources/textToSpeech/client/requests/TextToSpeechStreamRequest.mjs +2 -0
  212. package/dist/esm/api/resources/textToSpeech/client/requests/index.d.mts +1 -0
  213. package/dist/esm/api/resources/textToSpeech/exports.d.mts +2 -0
  214. package/dist/esm/api/resources/textToSpeech/exports.mjs +3 -0
  215. package/dist/esm/api/resources/textToSpeechStreaming/client/Socket.d.mts +2 -0
  216. package/dist/esm/api/resources/textToSpeechStreaming/client/Socket.mjs +1 -0
  217. package/dist/esm/api/resources/textToSpeechStreaming/exports.d.mts +2 -0
  218. package/dist/esm/api/resources/textToSpeechStreaming/exports.mjs +3 -0
  219. package/dist/esm/api/types/AudioOutput.d.mts +1 -1
  220. package/dist/esm/api/types/BulkJobCallback.d.mts +1 -1
  221. package/dist/esm/api/types/{BulkJobInitResponseV1.d.mts → BulkJobInitResponse.d.mts} +1 -1
  222. package/dist/esm/api/types/BulkJobInitResponse.mjs +2 -0
  223. package/dist/esm/api/types/ChatCompletionRequestAssistantMessage.d.mts +2 -2
  224. package/dist/esm/api/types/ChatCompletionResponseMessage.d.mts +4 -4
  225. package/dist/esm/api/types/Choice.d.mts +1 -1
  226. package/dist/esm/api/types/CompletionUsage.d.mts +2 -2
  227. package/dist/esm/api/types/ConfigMessage.d.mts +1 -1
  228. package/dist/esm/api/types/ConfigureConnection.d.mts +21 -11
  229. package/dist/esm/api/types/CreateChatCompletionResponse.d.mts +3 -3
  230. package/dist/esm/api/types/DocDigitizationDownloadFilesResponse.d.mts +2 -2
  231. package/dist/esm/api/types/DocDigitizationErrorDetails.d.mts +1 -1
  232. package/dist/esm/api/types/DocDigitizationJobDetail.d.mts +7 -7
  233. package/dist/esm/api/types/DocDigitizationJobParameters.d.mts +2 -2
  234. package/dist/esm/api/types/DocDigitizationJobStatusResponse.d.mts +5 -5
  235. package/dist/esm/api/types/DocDigitizationWebhookCallback.d.mts +1 -1
  236. package/dist/esm/api/types/ErrorCode.d.mts +1 -1
  237. package/dist/esm/api/types/ErrorCode.mjs +1 -1
  238. package/dist/esm/api/types/ErrorCode2.d.mts +11 -0
  239. package/dist/esm/api/types/ErrorCode2.mjs +11 -0
  240. package/dist/esm/api/types/ErrorDetails.d.mts +1 -2
  241. package/dist/esm/api/types/ErrorDetails2.d.mts +9 -0
  242. package/dist/esm/api/types/ErrorDetails2.mjs +2 -0
  243. package/dist/esm/api/types/ErrorMessage2.d.mts +5 -0
  244. package/dist/esm/api/types/ErrorMessage2.mjs +2 -0
  245. package/dist/esm/api/types/ErrorResponse.d.mts +3 -3
  246. package/dist/esm/api/types/EventResponse.d.mts +2 -2
  247. package/dist/esm/api/types/EventsData.d.mts +4 -4
  248. package/dist/esm/api/types/FileSignedUrlDetails.d.mts +1 -1
  249. package/dist/esm/api/types/FunctionDefinition.d.mts +2 -2
  250. package/dist/esm/api/types/{JobStatusV1Response.d.mts → JobStatusResponse.d.mts} +6 -6
  251. package/dist/esm/api/types/JobStatusResponse.mjs +2 -0
  252. package/dist/esm/api/types/LanguageIdentificationResponse.d.mts +3 -3
  253. package/dist/esm/api/types/PronunciationDictionaryData.d.mts +7 -0
  254. package/dist/esm/api/types/PronunciationDictionaryData.mjs +2 -0
  255. package/dist/esm/api/types/PronunciationDictionaryDeleteResponse.d.mts +9 -0
  256. package/dist/esm/api/types/PronunciationDictionaryDeleteResponse.mjs +2 -0
  257. package/dist/esm/api/types/PronunciationDictionaryGetResponse.d.mts +9 -0
  258. package/dist/esm/api/types/PronunciationDictionaryGetResponse.mjs +2 -0
  259. package/dist/esm/api/types/PronunciationDictionaryResponse.d.mts +7 -0
  260. package/dist/esm/api/types/PronunciationDictionaryResponse.mjs +2 -0
  261. package/dist/esm/api/types/PronunciationDictionaryUpdateResponse.d.mts +9 -0
  262. package/dist/esm/api/types/PronunciationDictionaryUpdateResponse.mjs +2 -0
  263. package/dist/esm/api/types/SarvamModelIds.d.mts +3 -3
  264. package/dist/esm/api/types/SarvamModelIds.mjs +3 -3
  265. package/dist/esm/api/types/SpeechStreamBitrate.d.mts +8 -0
  266. package/dist/esm/api/types/SpeechStreamBitrate.mjs +8 -0
  267. package/dist/esm/api/types/SpeechStreamCodec.d.mts +11 -0
  268. package/dist/esm/api/types/SpeechStreamCodec.mjs +11 -0
  269. package/dist/esm/api/types/SpeechToTextJobParameters.d.mts +6 -6
  270. package/dist/esm/api/types/SpeechToTextResponse.d.mts +5 -5
  271. package/dist/esm/api/types/SpeechToTextTranscriptionData.d.mts +4 -4
  272. package/dist/esm/api/types/SpeechToTextTranslateJobParameters.d.mts +4 -4
  273. package/dist/esm/api/types/SpeechToTextTranslateResponse.d.mts +4 -4
  274. package/dist/esm/api/types/SpeechToTextTranslateTranscriptionData.d.mts +2 -2
  275. package/dist/esm/api/types/TaskDetail.d.mts +8 -0
  276. package/dist/esm/api/types/TaskDetail.mjs +2 -0
  277. package/dist/esm/api/types/TextToSpeechResponse.d.mts +1 -1
  278. package/dist/esm/api/types/TranslationResponse.d.mts +1 -1
  279. package/dist/esm/api/types/TransliterationResponse.d.mts +1 -1
  280. package/dist/esm/api/types/index.d.mts +13 -3
  281. package/dist/esm/api/types/index.mjs +13 -3
  282. package/dist/esm/auth/HeaderAuthProvider.d.mts +14 -8
  283. package/dist/esm/auth/HeaderAuthProvider.mjs +19 -9
  284. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
  285. package/dist/esm/core/fetcher/Fetcher.d.mts +1 -2
  286. package/dist/esm/core/fetcher/Fetcher.mjs +8 -2
  287. package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
  288. package/dist/esm/core/fetcher/makeRequest.mjs +28 -9
  289. package/dist/esm/core/headers.d.mts +2 -2
  290. package/dist/esm/core/websocket/ws.d.mts +1 -1
  291. package/dist/esm/errors/SarvamAIError.mjs +5 -1
  292. package/dist/esm/errors/SarvamAITimeoutError.mjs +5 -1
  293. package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
  294. package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
  295. package/dist/esm/version.d.mts +1 -1
  296. package/dist/esm/version.mjs +1 -1
  297. package/package.json +140 -4
  298. package/reference.md +423 -6
  299. package/dist/cjs/api/types/TaskDetailV1.d.ts +0 -8
  300. package/dist/esm/api/types/TaskDetailV1.d.mts +0 -8
  301. /package/dist/cjs/api/{types/BulkJobInitResponseV1.js → resources/pronunciationDictionary/client/requests/CreatePronunciationDictionaryRequest.js} +0 -0
  302. /package/dist/cjs/api/{types/JobStatusV1Response.js → resources/pronunciationDictionary/client/requests/PronunciationDictionaryDeleteRequest.js} +0 -0
  303. /package/dist/cjs/api/{types/TaskDetailV1.js → resources/pronunciationDictionary/client/requests/UpdatePronunciationDictionaryRequest.js} +0 -0
  304. /package/dist/esm/api/{types/BulkJobInitResponseV1.mjs → resources/pronunciationDictionary/client/requests/CreatePronunciationDictionaryRequest.mjs} +0 -0
  305. /package/dist/esm/api/{types/JobStatusV1Response.mjs → resources/pronunciationDictionary/client/requests/PronunciationDictionaryDeleteRequest.mjs} +0 -0
  306. /package/dist/esm/api/{types/TaskDetailV1.mjs → resources/pronunciationDictionary/client/requests/UpdatePronunciationDictionaryRequest.mjs} +0 -0
@@ -1,10 +1,10 @@
1
+ import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.js";
1
2
  import * as core from "./core/index.js";
2
3
  import type * as environments from "./environments.js";
3
- export interface BaseClientOptions {
4
+ export type BaseClientOptions = {
4
5
  environment?: core.Supplier<environments.SarvamAIEnvironment | environments.SarvamAIEnvironmentUrls>;
5
6
  /** Specify a custom URL to connect the client to. */
6
7
  baseUrl?: core.Supplier<string>;
7
- apiSubscriptionKey?: core.Supplier<string>;
8
8
  /** Additional headers to include in requests. */
9
9
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
10
10
  /** The default maximum time to wait for a response in seconds. */
@@ -15,7 +15,7 @@ export interface BaseClientOptions {
15
15
  fetch?: typeof fetch;
16
16
  /** Configure logging for the client. */
17
17
  logging?: core.logging.LogConfig | core.logging.Logger;
18
- }
18
+ } & HeaderAuthProvider.AuthOptions;
19
19
  export interface BaseRequestOptions {
20
20
  /** The maximum time to wait for a response in seconds. */
21
21
  timeoutInSeconds?: number;
@@ -28,12 +28,12 @@ export interface BaseRequestOptions {
28
28
  /** Additional headers to include in the request. */
29
29
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
30
30
  }
31
- export type NormalizedClientOptions<T extends BaseClientOptions> = T & {
31
+ export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
32
32
  logging: core.logging.Logger;
33
33
  authProvider?: core.AuthProvider;
34
34
  };
35
- export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions> = NormalizedClientOptions<T> & {
35
+ export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions> = NormalizedClientOptions<T> & {
36
36
  authProvider: core.AuthProvider;
37
37
  };
38
- export declare function normalizeClientOptions<T extends BaseClientOptions>(options: T): NormalizedClientOptions<T>;
39
- export declare function normalizeClientOptionsWithAuth<T extends BaseClientOptions>(options: T): NormalizedClientOptionsWithAuth<T>;
38
+ export declare function normalizeClientOptions<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptions<T>;
39
+ export declare function normalizeClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptionsWithAuth<T>;
@@ -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.5",
47
- "User-Agent": "sarvamai/1.1.5",
46
+ "X-Fern-SDK-Version": "1.1.6",
47
+ "User-Agent": "sarvamai/1.1.6",
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,5 +1,6 @@
1
1
  import { ChatClient } from "./api/resources/chat/client/Client.js";
2
2
  import { DocumentIntelligenceClient } from "./api/resources/documentIntelligence/client/Client.js";
3
+ import { PronunciationDictionaryClient } from "./api/resources/pronunciationDictionary/client/Client.js";
3
4
  import { SpeechToTextClient } from "./api/resources/speechToText/client/Client.js";
4
5
  import { SpeechToTextJobClient } from "./api/resources/speechToTextJob/client/Client.js";
5
6
  import { SpeechToTextStreamingClient } from "./api/resources/speechToTextStreaming/client/Client.js";
@@ -11,8 +12,7 @@ import { TextToSpeechStreamingClient } from "./api/resources/textToSpeechStreami
11
12
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
12
13
  import { type NormalizedClientOptionsWithAuth } from "./BaseClient.js";
13
14
  export declare namespace SarvamAIClient {
14
- interface Options extends BaseClientOptions {
15
- }
15
+ type Options = BaseClientOptions;
16
16
  interface RequestOptions extends BaseRequestOptions {
17
17
  }
18
18
  }
@@ -21,6 +21,7 @@ export declare class SarvamAIClient {
21
21
  protected _text: TextClient | undefined;
22
22
  protected _speechToText: SpeechToTextClient | undefined;
23
23
  protected _textToSpeech: TextToSpeechClient | undefined;
24
+ protected _pronunciationDictionary: PronunciationDictionaryClient | undefined;
24
25
  protected _chat: ChatClient | undefined;
25
26
  protected _speechToTextJob: SpeechToTextJobClient | undefined;
26
27
  protected _speechToTextTranslateJob: SpeechToTextTranslateJobClient | undefined;
@@ -32,6 +33,7 @@ export declare class SarvamAIClient {
32
33
  get text(): TextClient;
33
34
  get speechToText(): SpeechToTextClient;
34
35
  get textToSpeech(): TextToSpeechClient;
36
+ get pronunciationDictionary(): PronunciationDictionaryClient;
35
37
  get chat(): ChatClient;
36
38
  get speechToTextJob(): SpeechToTextJobClient;
37
39
  get speechToTextTranslateJob(): SpeechToTextTranslateJobClient;
@@ -4,14 +4,15 @@ 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
6
  const Client_js_2 = require("./api/resources/documentIntelligence/client/Client.js");
7
- const Client_js_3 = require("./api/resources/speechToText/client/Client.js");
8
- const Client_js_4 = require("./api/resources/speechToTextJob/client/Client.js");
9
- const Client_js_5 = require("./api/resources/speechToTextStreaming/client/Client.js");
10
- const Client_js_6 = require("./api/resources/speechToTextTranslateJob/client/Client.js");
11
- const Client_js_7 = require("./api/resources/speechToTextTranslateStreaming/client/Client.js");
12
- const Client_js_8 = require("./api/resources/text/client/Client.js");
13
- const Client_js_9 = require("./api/resources/textToSpeech/client/Client.js");
14
- const Client_js_10 = require("./api/resources/textToSpeechStreaming/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");
15
16
  const BaseClient_js_1 = require("./BaseClient.js");
16
17
  class SarvamAIClient {
17
18
  constructor(options = {}) {
@@ -19,15 +20,19 @@ class SarvamAIClient {
19
20
  }
20
21
  get text() {
21
22
  var _a;
22
- return ((_a = this._text) !== null && _a !== void 0 ? _a : (this._text = new Client_js_8.TextClient(this._options)));
23
+ return ((_a = this._text) !== null && _a !== void 0 ? _a : (this._text = new Client_js_9.TextClient(this._options)));
23
24
  }
24
25
  get speechToText() {
25
26
  var _a;
26
- return ((_a = this._speechToText) !== null && _a !== void 0 ? _a : (this._speechToText = new Client_js_3.SpeechToTextClient(this._options)));
27
+ return ((_a = this._speechToText) !== null && _a !== void 0 ? _a : (this._speechToText = new Client_js_4.SpeechToTextClient(this._options)));
27
28
  }
28
29
  get textToSpeech() {
29
30
  var _a;
30
- return ((_a = this._textToSpeech) !== null && _a !== void 0 ? _a : (this._textToSpeech = new Client_js_9.TextToSpeechClient(this._options)));
31
+ return ((_a = this._textToSpeech) !== null && _a !== void 0 ? _a : (this._textToSpeech = new Client_js_10.TextToSpeechClient(this._options)));
32
+ }
33
+ get pronunciationDictionary() {
34
+ var _a;
35
+ return ((_a = this._pronunciationDictionary) !== null && _a !== void 0 ? _a : (this._pronunciationDictionary = new Client_js_3.PronunciationDictionaryClient(this._options)));
31
36
  }
32
37
  get chat() {
33
38
  var _a;
@@ -35,11 +40,11 @@ class SarvamAIClient {
35
40
  }
36
41
  get speechToTextJob() {
37
42
  var _a;
38
- return ((_a = this._speechToTextJob) !== null && _a !== void 0 ? _a : (this._speechToTextJob = new Client_js_4.SpeechToTextJobClient(this._options)));
43
+ return ((_a = this._speechToTextJob) !== null && _a !== void 0 ? _a : (this._speechToTextJob = new Client_js_5.SpeechToTextJobClient(this._options)));
39
44
  }
40
45
  get speechToTextTranslateJob() {
41
46
  var _a;
42
- return ((_a = this._speechToTextTranslateJob) !== null && _a !== void 0 ? _a : (this._speechToTextTranslateJob = new Client_js_6.SpeechToTextTranslateJobClient(this._options)));
47
+ return ((_a = this._speechToTextTranslateJob) !== null && _a !== void 0 ? _a : (this._speechToTextTranslateJob = new Client_js_7.SpeechToTextTranslateJobClient(this._options)));
43
48
  }
44
49
  get documentIntelligence() {
45
50
  var _a;
@@ -47,15 +52,15 @@ class SarvamAIClient {
47
52
  }
48
53
  get speechToTextStreaming() {
49
54
  var _a;
50
- return ((_a = this._speechToTextStreaming) !== null && _a !== void 0 ? _a : (this._speechToTextStreaming = new Client_js_5.SpeechToTextStreamingClient(this._options)));
55
+ return ((_a = this._speechToTextStreaming) !== null && _a !== void 0 ? _a : (this._speechToTextStreaming = new Client_js_6.SpeechToTextStreamingClient(this._options)));
51
56
  }
52
57
  get speechToTextTranslateStreaming() {
53
58
  var _a;
54
- return ((_a = this._speechToTextTranslateStreaming) !== null && _a !== void 0 ? _a : (this._speechToTextTranslateStreaming = new Client_js_7.SpeechToTextTranslateStreamingClient(this._options)));
59
+ return ((_a = this._speechToTextTranslateStreaming) !== null && _a !== void 0 ? _a : (this._speechToTextTranslateStreaming = new Client_js_8.SpeechToTextTranslateStreamingClient(this._options)));
55
60
  }
56
61
  get textToSpeechStreaming() {
57
62
  var _a;
58
- return ((_a = this._textToSpeechStreaming) !== null && _a !== void 0 ? _a : (this._textToSpeechStreaming = new Client_js_10.TextToSpeechStreamingClient(this._options)));
63
+ return ((_a = this._textToSpeechStreaming) !== null && _a !== void 0 ? _a : (this._textToSpeechStreaming = new Client_js_11.TextToSpeechStreamingClient(this._options)));
59
64
  }
60
65
  }
61
66
  exports.SarvamAIClient = SarvamAIClient;
@@ -44,7 +44,11 @@ class BadRequestError extends errors.SarvamAIError {
44
44
  body: body,
45
45
  rawResponse: rawResponse,
46
46
  });
47
- Object.setPrototypeOf(this, BadRequestError.prototype);
47
+ Object.setPrototypeOf(this, new.target.prototype);
48
+ if (Error.captureStackTrace) {
49
+ Error.captureStackTrace(this, this.constructor);
50
+ }
51
+ this.name = this.constructor.name;
48
52
  }
49
53
  }
50
54
  exports.BadRequestError = BadRequestError;
@@ -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 ContentTooLargeError 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.ContentTooLargeError = void 0;
38
+ const errors = __importStar(require("../../errors/index.js"));
39
+ class ContentTooLargeError extends errors.SarvamAIError {
40
+ constructor(body, rawResponse) {
41
+ super({
42
+ message: "ContentTooLargeError",
43
+ statusCode: 413,
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.ContentTooLargeError = ContentTooLargeError;
@@ -44,7 +44,11 @@ class ForbiddenError extends errors.SarvamAIError {
44
44
  body: body,
45
45
  rawResponse: rawResponse,
46
46
  });
47
- Object.setPrototypeOf(this, ForbiddenError.prototype);
47
+ Object.setPrototypeOf(this, new.target.prototype);
48
+ if (Error.captureStackTrace) {
49
+ Error.captureStackTrace(this, this.constructor);
50
+ }
51
+ this.name = this.constructor.name;
48
52
  }
49
53
  }
50
54
  exports.ForbiddenError = ForbiddenError;
@@ -44,7 +44,11 @@ class InternalServerError extends errors.SarvamAIError {
44
44
  body: body,
45
45
  rawResponse: rawResponse,
46
46
  });
47
- Object.setPrototypeOf(this, InternalServerError.prototype);
47
+ Object.setPrototypeOf(this, new.target.prototype);
48
+ if (Error.captureStackTrace) {
49
+ Error.captureStackTrace(this, this.constructor);
50
+ }
51
+ this.name = this.constructor.name;
48
52
  }
49
53
  }
50
54
  exports.InternalServerError = InternalServerError;
@@ -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 NotFoundError 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.NotFoundError = void 0;
38
+ const errors = __importStar(require("../../errors/index.js"));
39
+ class NotFoundError extends errors.SarvamAIError {
40
+ constructor(body, rawResponse) {
41
+ super({
42
+ message: "NotFoundError",
43
+ statusCode: 404,
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.NotFoundError = NotFoundError;
@@ -44,7 +44,11 @@ class ServiceUnavailableError extends errors.SarvamAIError {
44
44
  body: body,
45
45
  rawResponse: rawResponse,
46
46
  });
47
- Object.setPrototypeOf(this, ServiceUnavailableError.prototype);
47
+ Object.setPrototypeOf(this, new.target.prototype);
48
+ if (Error.captureStackTrace) {
49
+ Error.captureStackTrace(this, this.constructor);
50
+ }
51
+ this.name = this.constructor.name;
48
52
  }
49
53
  }
50
54
  exports.ServiceUnavailableError = ServiceUnavailableError;
@@ -44,7 +44,11 @@ class TooManyRequestsError extends errors.SarvamAIError {
44
44
  body: body,
45
45
  rawResponse: rawResponse,
46
46
  });
47
- Object.setPrototypeOf(this, TooManyRequestsError.prototype);
47
+ Object.setPrototypeOf(this, new.target.prototype);
48
+ if (Error.captureStackTrace) {
49
+ Error.captureStackTrace(this, this.constructor);
50
+ }
51
+ this.name = this.constructor.name;
48
52
  }
49
53
  }
50
54
  exports.TooManyRequestsError = TooManyRequestsError;
@@ -44,7 +44,11 @@ class UnprocessableEntityError extends errors.SarvamAIError {
44
44
  body: body,
45
45
  rawResponse: rawResponse,
46
46
  });
47
- Object.setPrototypeOf(this, UnprocessableEntityError.prototype);
47
+ Object.setPrototypeOf(this, new.target.prototype);
48
+ if (Error.captureStackTrace) {
49
+ Error.captureStackTrace(this, this.constructor);
50
+ }
51
+ this.name = this.constructor.name;
48
52
  }
49
53
  }
50
54
  exports.UnprocessableEntityError = UnprocessableEntityError;
@@ -1,6 +1,8 @@
1
1
  export * from "./BadRequestError.js";
2
+ export * from "./ContentTooLargeError.js";
2
3
  export * from "./ForbiddenError.js";
3
4
  export * from "./InternalServerError.js";
5
+ export * from "./NotFoundError.js";
4
6
  export * from "./ServiceUnavailableError.js";
5
7
  export * from "./TooManyRequestsError.js";
6
8
  export * from "./UnprocessableEntityError.js";
@@ -15,8 +15,10 @@ 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("./ContentTooLargeError.js"), exports);
18
19
  __exportStar(require("./ForbiddenError.js"), exports);
19
20
  __exportStar(require("./InternalServerError.js"), exports);
21
+ __exportStar(require("./NotFoundError.js"), exports);
20
22
  __exportStar(require("./ServiceUnavailableError.js"), exports);
21
23
  __exportStar(require("./TooManyRequestsError.js"), exports);
22
24
  __exportStar(require("./UnprocessableEntityError.js"), exports);
@@ -11,7 +11,7 @@ import type * as SarvamAI from "../../../../index.js";
11
11
  export interface ChatCompletionsRequest {
12
12
  /** A list of messages comprising the conversation so far. */
13
13
  messages: SarvamAI.ChatCompletionRequestMessage[];
14
- /** Model ID used to generate the response, like `sarvam-m`. */
14
+ /** Model ID used to generate the response, like `sarvam-105b`. */
15
15
  model: SarvamAI.SarvamModelIds;
16
16
  /**
17
17
  * 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.
@@ -0,0 +1,2 @@
1
+ export { ChatClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ChatClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "ChatClient", { enumerable: true, get: function () { return Client_js_1.ChatClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ export { DocumentIntelligenceClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DocumentIntelligenceClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "DocumentIntelligenceClient", { enumerable: true, get: function () { return Client_js_1.DocumentIntelligenceClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -2,6 +2,8 @@ export * from "./chat/client/requests/index.js";
2
2
  export * as chat from "./chat/index.js";
3
3
  export * from "./documentIntelligence/client/requests/index.js";
4
4
  export * as documentIntelligence from "./documentIntelligence/index.js";
5
+ export * from "./pronunciationDictionary/client/requests/index.js";
6
+ export * as pronunciationDictionary from "./pronunciationDictionary/index.js";
5
7
  export * from "./speechToText/client/requests/index.js";
6
8
  export * as speechToText from "./speechToText/index.js";
7
9
  export * from "./speechToTextJob/client/requests/index.js";
@@ -36,11 +36,13 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.textToSpeechStreaming = exports.textToSpeech = exports.text = exports.speechToTextTranslateStreaming = exports.speechToTextTranslateJob = exports.speechToTextStreaming = exports.speechToTextJob = exports.speechToText = exports.documentIntelligence = exports.chat = void 0;
39
+ exports.textToSpeechStreaming = exports.textToSpeech = exports.text = exports.speechToTextTranslateStreaming = exports.speechToTextTranslateJob = exports.speechToTextStreaming = exports.speechToTextJob = exports.speechToText = exports.pronunciationDictionary = exports.documentIntelligence = exports.chat = void 0;
40
40
  __exportStar(require("./chat/client/requests/index.js"), exports);
41
41
  exports.chat = __importStar(require("./chat/index.js"));
42
42
  __exportStar(require("./documentIntelligence/client/requests/index.js"), exports);
43
43
  exports.documentIntelligence = __importStar(require("./documentIntelligence/index.js"));
44
+ __exportStar(require("./pronunciationDictionary/client/requests/index.js"), exports);
45
+ exports.pronunciationDictionary = __importStar(require("./pronunciationDictionary/index.js"));
44
46
  __exportStar(require("./speechToText/client/requests/index.js"), exports);
45
47
  exports.speechToText = __importStar(require("./speechToText/index.js"));
46
48
  __exportStar(require("./speechToTextJob/client/requests/index.js"), exports);
@@ -0,0 +1,143 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as SarvamAI from "../../../index.js";
5
+ export declare namespace PronunciationDictionaryClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class PronunciationDictionaryClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<PronunciationDictionaryClient.Options>;
12
+ constructor(options?: PronunciationDictionaryClient.Options);
13
+ /**
14
+ * Retrieve a list of all pronunciation dictionary IDs associated with the authenticated user.
15
+ *
16
+ * @param {PronunciationDictionaryClient.RequestOptions} requestOptions - Request-specific configuration.
17
+ *
18
+ * @throws {@link SarvamAI.BadRequestError}
19
+ * @throws {@link SarvamAI.ForbiddenError}
20
+ * @throws {@link SarvamAI.UnprocessableEntityError}
21
+ * @throws {@link SarvamAI.TooManyRequestsError}
22
+ * @throws {@link SarvamAI.InternalServerError}
23
+ *
24
+ * @example
25
+ * await client.pronunciationDictionary.list()
26
+ */
27
+ list(requestOptions?: PronunciationDictionaryClient.RequestOptions): core.HttpResponsePromise<SarvamAI.PronunciationDictionaryGetResponse>;
28
+ private __list;
29
+ /**
30
+ * Upload a JSON file to create a new pronunciation dictionary. Only supported by **bulbul:v3**.
31
+ *
32
+ * The pronunciation dictionary lets you define custom word-to-pronunciation mappings per language. When attached to a TTS request via the `dict_id` parameter, the service replaces matching words with their specified pronunciations before synthesis.
33
+ *
34
+ * **Limits:**
35
+ * - Max 10 dictionaries per user
36
+ * - Max 100 words per dictionary
37
+ * - Max 1 MB file size
38
+ *
39
+ * **JSON file format:**
40
+ * ```json
41
+ * {
42
+ * "pronunciations": {
43
+ * "hi-IN": {
44
+ * "B2B": "B to B",
45
+ * "my name": "mera naam"
46
+ * },
47
+ * "en-IN": {
48
+ * "teting": "testing"
49
+ * }
50
+ * }
51
+ * }
52
+ * ```
53
+ *
54
+ * Save this as a `.json` file and upload it via the `file` field. The returned `dictionary_id` can then be passed as `dict_id` in text-to-speech requests (REST, streaming, and WebSocket).
55
+ *
56
+ * @param {SarvamAI.CreatePronunciationDictionaryRequest} request
57
+ * @param {PronunciationDictionaryClient.RequestOptions} requestOptions - Request-specific configuration.
58
+ *
59
+ * @throws {@link SarvamAI.BadRequestError}
60
+ * @throws {@link SarvamAI.ForbiddenError}
61
+ * @throws {@link SarvamAI.ContentTooLargeError}
62
+ * @throws {@link SarvamAI.UnprocessableEntityError}
63
+ * @throws {@link SarvamAI.TooManyRequestsError}
64
+ * @throws {@link SarvamAI.InternalServerError}
65
+ *
66
+ * @example
67
+ * import { createReadStream } from "fs";
68
+ * await client.pronunciationDictionary.create({
69
+ * file: fs.createReadStream("/path/to/your/file")
70
+ * })
71
+ */
72
+ create(request: SarvamAI.CreatePronunciationDictionaryRequest, requestOptions?: PronunciationDictionaryClient.RequestOptions): core.HttpResponsePromise<SarvamAI.PronunciationDictionaryResponse>;
73
+ private __create;
74
+ /**
75
+ * Replace an existing pronunciation dictionary by uploading a new JSON file. The old dictionary contents will be fully replaced with the new data.
76
+ *
77
+ * **Limits:**
78
+ * - Max 100 words per dictionary
79
+ * - Max 1 MB file size
80
+ *
81
+ * The response includes the `dictionary_id` and the updated pronunciation mappings for verification.
82
+ *
83
+ * @param {SarvamAI.UpdatePronunciationDictionaryRequest} request
84
+ * @param {PronunciationDictionaryClient.RequestOptions} requestOptions - Request-specific configuration.
85
+ *
86
+ * @throws {@link SarvamAI.BadRequestError}
87
+ * @throws {@link SarvamAI.ForbiddenError}
88
+ * @throws {@link SarvamAI.NotFoundError}
89
+ * @throws {@link SarvamAI.ContentTooLargeError}
90
+ * @throws {@link SarvamAI.UnprocessableEntityError}
91
+ * @throws {@link SarvamAI.TooManyRequestsError}
92
+ * @throws {@link SarvamAI.InternalServerError}
93
+ *
94
+ * @example
95
+ * import { createReadStream } from "fs";
96
+ * await client.pronunciationDictionary.update({
97
+ * file: fs.createReadStream("/path/to/your/file"),
98
+ * dict_id: "dict_id"
99
+ * })
100
+ */
101
+ update(request: SarvamAI.UpdatePronunciationDictionaryRequest, requestOptions?: PronunciationDictionaryClient.RequestOptions): core.HttpResponsePromise<SarvamAI.PronunciationDictionaryUpdateResponse>;
102
+ private __update;
103
+ /**
104
+ * Delete a pronunciation dictionary by its ID. Once deleted, the dictionary can no longer be referenced in text-to-speech requests.
105
+ *
106
+ * @param {SarvamAI.PronunciationDictionaryDeleteRequest} request
107
+ * @param {PronunciationDictionaryClient.RequestOptions} requestOptions - Request-specific configuration.
108
+ *
109
+ * @throws {@link SarvamAI.BadRequestError}
110
+ * @throws {@link SarvamAI.ForbiddenError}
111
+ * @throws {@link SarvamAI.NotFoundError}
112
+ * @throws {@link SarvamAI.UnprocessableEntityError}
113
+ * @throws {@link SarvamAI.TooManyRequestsError}
114
+ * @throws {@link SarvamAI.InternalServerError}
115
+ *
116
+ * @example
117
+ * await client.pronunciationDictionary.delete({
118
+ * dict_id: "dict_id"
119
+ * })
120
+ */
121
+ delete(request: SarvamAI.PronunciationDictionaryDeleteRequest, requestOptions?: PronunciationDictionaryClient.RequestOptions): core.HttpResponsePromise<SarvamAI.PronunciationDictionaryDeleteResponse>;
122
+ private __delete;
123
+ /**
124
+ * Retrieve the full pronunciation mappings for a specific dictionary by its ID.
125
+ *
126
+ * Returns the pronunciation data organized by language code, where each language contains word-to-pronunciation pairs.
127
+ *
128
+ * @param {string} dict_id
129
+ * @param {PronunciationDictionaryClient.RequestOptions} requestOptions - Request-specific configuration.
130
+ *
131
+ * @throws {@link SarvamAI.BadRequestError}
132
+ * @throws {@link SarvamAI.ForbiddenError}
133
+ * @throws {@link SarvamAI.NotFoundError}
134
+ * @throws {@link SarvamAI.UnprocessableEntityError}
135
+ * @throws {@link SarvamAI.TooManyRequestsError}
136
+ * @throws {@link SarvamAI.InternalServerError}
137
+ *
138
+ * @example
139
+ * await client.pronunciationDictionary.get("dict_id")
140
+ */
141
+ get(dict_id: string, requestOptions?: PronunciationDictionaryClient.RequestOptions): core.HttpResponsePromise<SarvamAI.PronunciationDictionaryData>;
142
+ private __get;
143
+ }