sarvamai 1.1.8-alpha.3 → 1.1.8
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.
- package/README.md +19 -14
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +9 -0
- package/dist/cjs/Client.js +35 -20
- package/dist/cjs/api/errors/ConflictError.d.ts +6 -0
- package/dist/cjs/api/errors/ConflictError.js +54 -0
- package/dist/cjs/api/errors/ContentTooLargeError.d.ts +1 -2
- package/dist/cjs/api/errors/NotFoundError.d.ts +1 -2
- package/dist/cjs/api/errors/PaymentRequiredError.d.ts +6 -0
- package/dist/cjs/api/errors/PaymentRequiredError.js +54 -0
- package/dist/cjs/api/errors/UnauthorizedError.d.ts +6 -0
- package/dist/cjs/api/errors/UnauthorizedError.js +54 -0
- package/dist/cjs/api/errors/index.d.ts +3 -0
- package/dist/cjs/api/errors/index.js +3 -0
- package/dist/cjs/api/resources/chat/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/chat/client/requests/ChatCompletionsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/docAi/client/Client.d.ts +146 -0
- package/dist/cjs/api/resources/docAi/client/Client.js +503 -0
- package/dist/cjs/api/resources/docAi/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/docAi/client/index.js +17 -0
- package/dist/cjs/api/resources/docAi/client/requests/DocAiDigitiseRequest.d.ts +36 -0
- package/dist/cjs/api/resources/docAi/client/requests/DocAiDigitiseRequest.js +18 -0
- package/dist/cjs/api/resources/docAi/client/requests/DocAiExtractRequest.d.ts +34 -0
- package/dist/cjs/api/resources/docAi/client/requests/DocAiExtractRequest.js +13 -0
- package/dist/cjs/api/resources/docAi/client/requests/DocAiGetResultsRequest.d.ts +15 -0
- package/dist/cjs/api/resources/docAi/client/requests/DocAiPresignUploadRequest.d.ts +8 -0
- package/dist/cjs/api/resources/docAi/client/requests/DocAiPresignUploadRequest.js +3 -0
- package/dist/cjs/api/resources/docAi/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/docAi/client/requests/index.js +7 -0
- package/dist/cjs/api/resources/docAi/exports.d.ts +2 -0
- package/dist/cjs/api/resources/docAi/exports.js +21 -0
- package/dist/cjs/api/resources/docAi/index.d.ts +2 -0
- package/dist/cjs/api/resources/docAi/index.js +18 -0
- package/dist/cjs/api/resources/docAi/types/DocAiGetResultsResponse.d.ts +10 -0
- package/dist/cjs/api/resources/docAi/types/DocAiGetResultsResponse.js +3 -0
- package/dist/cjs/api/resources/docAi/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/docAi/types/index.js +17 -0
- package/dist/cjs/api/resources/documentIntelligence/DocumentIntelligenceJob.d.ts +0 -2
- package/dist/cjs/api/resources/documentIntelligence/client/Client.js +0 -5
- package/dist/cjs/api/resources/documentIntelligence/client/requests/DocumentIntelligenceJobRequest.d.ts +0 -2
- package/dist/cjs/api/resources/dubbing/client/Client.d.ts +104 -0
- package/dist/cjs/api/resources/dubbing/client/Client.js +313 -0
- package/dist/cjs/api/resources/dubbing/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/dubbing/client/index.js +17 -0
- package/dist/cjs/api/resources/dubbing/client/requests/CreateDubbingJobRequest.d.ts +38 -0
- package/dist/cjs/api/resources/dubbing/client/requests/CreateDubbingJobRequest.js +3 -0
- package/dist/cjs/api/resources/dubbing/client/requests/DubbingGetExportStatusRequest.d.ts +10 -0
- package/dist/cjs/api/resources/dubbing/client/requests/DubbingGetExportStatusRequest.js +3 -0
- package/dist/cjs/api/resources/dubbing/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/dubbing/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/dubbing/exports.d.ts +2 -0
- package/dist/cjs/api/resources/dubbing/exports.js +21 -0
- package/dist/cjs/api/resources/dubbing/index.d.ts +1 -0
- package/dist/cjs/api/resources/dubbing/index.js +17 -0
- package/dist/cjs/api/resources/index.d.ts +7 -0
- package/dist/cjs/api/resources/index.js +8 -1
- package/dist/cjs/api/resources/speechToText/client/requests/SpeechToTextTranscriptionRequest.d.ts +0 -6
- package/dist/cjs/api/resources/speechToTextJob/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/speechToTextJob/client/Client.js +3 -3
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/client/Client.d.ts +36 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/client/Client.js +87 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/client/Socket.d.ts +55 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/client/Socket.js +174 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/client/index.js +2 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/exports.d.ts +2 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/exports.js +21 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/index.d.ts +2 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/index.js +18 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEncoding.d.ts +8 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEncoding.js +11 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEndpointing.d.ts +11 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEndpointing.js +14 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingLanguageCode.d.ts +56 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingLanguageCode.js +59 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingMode.d.ts +19 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingMode.js +22 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingReturnTimestamps.d.ts +9 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingReturnTimestamps.js +12 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingStreamType.d.ts +13 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingStreamType.js +16 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/index.d.ts +6 -0
- package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/index.js +22 -0
- package/dist/cjs/api/resources/speechToTextStreaming/types/SpeechToTextStreamingLanguageCode.d.ts +1 -3
- package/dist/cjs/api/resources/speechToTextStreaming/types/SpeechToTextStreamingLanguageCode.js +1 -3
- package/dist/cjs/api/resources/speechToTextStreaming/types/SpeechToTextStreamingModel.d.ts +0 -3
- package/dist/cjs/api/resources/speechToTextStreaming/types/SpeechToTextStreamingModel.js +0 -3
- package/dist/cjs/api/resources/textToSpeech/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/textToSpeech/client/Client.js +1 -1
- package/dist/cjs/api/resources/textToSpeech/client/requests/TextToSpeechRequest.d.ts +2 -2
- package/dist/cjs/api/resources/textToSpeech/client/requests/TextToSpeechStreamRequest.d.ts +1 -1
- package/dist/cjs/api/resources/textToSpeechStreaming/client/Socket.d.ts +3 -3
- package/dist/cjs/api/resources/textToSpeechStreaming/client/Socket.js +3 -3
- package/dist/cjs/api/types/ConfigureConnection.d.ts +3 -3
- package/dist/cjs/api/types/ConfigureConnection.js +1 -1
- package/dist/cjs/api/types/CreateDubbingJobData.d.ts +17 -0
- package/dist/cjs/api/types/CreateDubbingJobData.js +3 -0
- package/dist/cjs/api/types/CreateDubbingJobResponse.d.ts +7 -0
- package/dist/cjs/api/types/CreateDubbingJobResponse.js +3 -0
- package/dist/cjs/api/types/DocAiDigitiseResults.d.ts +32 -0
- package/dist/cjs/api/types/DocAiDigitiseResults.js +3 -0
- package/dist/cjs/api/types/DocAiDownloadUrlResponse.d.ts +10 -0
- package/dist/cjs/api/types/DocAiDownloadUrlResponse.js +3 -0
- package/dist/cjs/api/types/DocAiErrorDetail.d.ts +8 -0
- package/dist/cjs/api/types/DocAiErrorDetail.js +3 -0
- package/dist/cjs/api/types/DocAiErrorModel.d.ts +15 -0
- package/dist/cjs/api/types/DocAiErrorModel.js +3 -0
- package/dist/cjs/api/types/DocAiExtractResults.d.ts +17 -0
- package/dist/cjs/api/types/DocAiExtractResults.js +3 -0
- package/dist/cjs/api/types/DocAiJobStatusResponse.d.ts +14 -0
- package/dist/cjs/api/types/DocAiJobStatusResponse.js +3 -0
- package/dist/cjs/api/types/DocAiPresignUploadResponse.d.ts +12 -0
- package/dist/cjs/api/types/DocAiPresignUploadResponse.js +3 -0
- package/dist/cjs/api/types/DocAiStartJobResponse.d.ts +8 -0
- package/dist/cjs/api/types/DocAiStartJobResponse.js +3 -0
- package/dist/cjs/api/types/DocAiUsage.d.ts +10 -0
- package/dist/cjs/api/types/DocAiUsage.js +3 -0
- package/dist/cjs/api/types/DubbingExportItem.d.ts +17 -0
- package/dist/cjs/api/types/DubbingExportItem.js +3 -0
- package/dist/cjs/api/types/DubbingExportItemStatus.d.ts +6 -0
- package/dist/cjs/api/types/DubbingExportItemStatus.js +9 -0
- package/dist/cjs/api/types/DubbingExportOption.d.ts +7 -0
- package/dist/cjs/api/types/DubbingExportOption.js +10 -0
- package/dist/cjs/api/types/DubbingExportStatusData.d.ts +5 -0
- package/dist/cjs/api/types/DubbingExportStatusData.js +3 -0
- package/dist/cjs/api/types/DubbingExportStatusResponse.d.ts +7 -0
- package/dist/cjs/api/types/DubbingExportStatusResponse.js +3 -0
- package/dist/cjs/api/types/DubbingExportType.d.ts +8 -0
- package/dist/cjs/api/types/DubbingExportType.js +11 -0
- package/dist/cjs/api/types/DubbingJobStatus.d.ts +9 -0
- package/dist/cjs/api/types/DubbingJobStatus.js +12 -0
- package/dist/cjs/api/types/DubbingLanguage.d.ts +16 -0
- package/dist/cjs/api/types/DubbingLanguage.js +19 -0
- package/dist/cjs/api/types/DubbingLiveStatusData.d.ts +18 -0
- package/dist/cjs/api/types/DubbingLiveStatusData.js +3 -0
- package/dist/cjs/api/types/DubbingLiveStatusExportInfo.d.ts +14 -0
- package/dist/cjs/api/types/DubbingLiveStatusExportInfo.js +3 -0
- package/dist/cjs/api/types/DubbingLiveStatusResponse.d.ts +7 -0
- package/dist/cjs/api/types/DubbingLiveStatusResponse.js +3 -0
- package/dist/cjs/api/types/DubbingModelTier.d.ts +6 -0
- package/dist/cjs/api/types/DubbingModelTier.js +9 -0
- package/dist/cjs/api/types/DubbingPacePreset.d.ts +8 -0
- package/dist/cjs/api/types/DubbingPacePreset.js +11 -0
- package/dist/cjs/api/types/DubbingRegister.d.ts +10 -0
- package/dist/cjs/api/types/DubbingRegister.js +13 -0
- package/dist/cjs/api/types/DubbingStartData.d.ts +7 -0
- package/dist/cjs/api/types/DubbingStartData.js +3 -0
- package/dist/cjs/api/types/DubbingStartResponse.d.ts +8 -0
- package/dist/cjs/api/types/DubbingStartResponse.js +3 -0
- package/dist/cjs/api/types/RealtimeAudioInput.d.ts +10 -0
- package/dist/cjs/api/types/RealtimeAudioInput.js +3 -0
- package/dist/cjs/api/types/RealtimeConfigUpdate.d.ts +55 -0
- package/dist/cjs/api/types/RealtimeConfigUpdate.js +25 -0
- package/dist/cjs/api/types/RealtimeConfigUpdated.d.ts +8 -0
- package/dist/cjs/api/types/RealtimeConfigUpdated.js +3 -0
- package/dist/cjs/api/types/RealtimeEnd.d.ts +7 -0
- package/dist/cjs/api/types/RealtimeEnd.js +3 -0
- package/dist/cjs/api/types/RealtimeError.d.ts +29 -0
- package/dist/cjs/api/types/RealtimeError.js +3 -0
- package/dist/cjs/api/types/RealtimeFlush.d.ts +7 -0
- package/dist/cjs/api/types/RealtimeFlush.js +3 -0
- package/dist/cjs/api/types/RealtimePing.d.ts +6 -0
- package/dist/cjs/api/types/RealtimePing.js +3 -0
- package/dist/cjs/api/types/RealtimePong.d.ts +6 -0
- package/dist/cjs/api/types/RealtimePong.js +3 -0
- package/dist/cjs/api/types/RealtimeSessionBegin.d.ts +33 -0
- package/dist/cjs/api/types/RealtimeSessionBegin.js +3 -0
- package/dist/cjs/api/types/RealtimeSessionEnd.d.ts +15 -0
- package/dist/cjs/api/types/RealtimeSessionEnd.js +3 -0
- package/dist/cjs/api/types/RealtimeSpeechEnd.d.ts +7 -0
- package/dist/cjs/api/types/RealtimeSpeechEnd.js +3 -0
- package/dist/cjs/api/types/RealtimeSpeechStart.d.ts +7 -0
- package/dist/cjs/api/types/RealtimeSpeechStart.js +3 -0
- package/dist/cjs/api/types/RealtimeTranscriptFinal.d.ts +32 -0
- package/dist/cjs/api/types/RealtimeTranscriptFinal.js +3 -0
- package/dist/cjs/api/types/RealtimeTranscriptPartial.d.ts +17 -0
- package/dist/cjs/api/types/RealtimeTranscriptPartial.js +3 -0
- package/dist/cjs/api/types/RealtimeVadSpeechEnd.d.ts +10 -0
- package/dist/cjs/api/types/RealtimeVadSpeechEnd.js +3 -0
- package/dist/cjs/api/types/RealtimeVadSpeechStart.d.ts +10 -0
- package/dist/cjs/api/types/RealtimeVadSpeechStart.js +3 -0
- package/dist/cjs/api/types/SarvamModelIds.d.ts +4 -6
- package/dist/cjs/api/types/SarvamModelIds.js +0 -6
- package/dist/cjs/api/types/SpeechToTextBatchModel.d.ts +0 -6
- package/dist/cjs/api/types/SpeechToTextBatchModel.js +0 -6
- package/dist/cjs/api/types/SpeechToTextJobParameters.d.ts +3 -9
- package/dist/cjs/api/types/SpeechToTextLanguage.d.ts +1 -7
- package/dist/cjs/api/types/SpeechToTextLanguage.js +1 -7
- package/dist/cjs/api/types/SpeechToTextModel.d.ts +0 -3
- package/dist/cjs/api/types/SpeechToTextModel.js +0 -3
- package/dist/cjs/api/types/index.d.ts +43 -1
- package/dist/cjs/api/types/index.js +43 -1
- package/dist/cjs/environments.d.ts +2 -0
- package/dist/cjs/environments.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +9 -0
- package/dist/esm/Client.mjs +15 -0
- package/dist/esm/api/errors/ConflictError.d.mts +6 -0
- package/dist/esm/api/errors/ConflictError.mjs +17 -0
- package/dist/esm/api/errors/ContentTooLargeError.d.mts +1 -2
- package/dist/esm/api/errors/NotFoundError.d.mts +1 -2
- package/dist/esm/api/errors/PaymentRequiredError.d.mts +6 -0
- package/dist/esm/api/errors/PaymentRequiredError.mjs +17 -0
- package/dist/esm/api/errors/UnauthorizedError.d.mts +6 -0
- package/dist/esm/api/errors/UnauthorizedError.mjs +17 -0
- package/dist/esm/api/errors/index.d.mts +3 -0
- package/dist/esm/api/errors/index.mjs +3 -0
- package/dist/esm/api/resources/chat/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/chat/client/requests/ChatCompletionsRequest.d.mts +2 -2
- package/dist/esm/api/resources/docAi/client/Client.d.mts +146 -0
- package/dist/esm/api/resources/docAi/client/Client.mjs +466 -0
- package/dist/esm/api/resources/docAi/client/index.d.mts +1 -0
- package/dist/esm/api/resources/docAi/client/index.mjs +1 -0
- package/dist/esm/api/resources/docAi/client/requests/DocAiDigitiseRequest.d.mts +36 -0
- package/dist/esm/api/resources/docAi/client/requests/DocAiDigitiseRequest.mjs +15 -0
- package/dist/esm/api/resources/docAi/client/requests/DocAiExtractRequest.d.mts +34 -0
- package/dist/esm/api/resources/docAi/client/requests/DocAiExtractRequest.mjs +10 -0
- package/dist/esm/api/resources/docAi/client/requests/DocAiGetResultsRequest.d.mts +15 -0
- package/dist/esm/api/resources/docAi/client/requests/DocAiPresignUploadRequest.d.mts +8 -0
- package/dist/esm/api/resources/docAi/client/requests/DocAiPresignUploadRequest.mjs +2 -0
- package/dist/esm/api/resources/docAi/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/docAi/client/requests/index.mjs +2 -0
- package/dist/esm/api/resources/docAi/exports.d.mts +2 -0
- package/dist/esm/api/resources/docAi/exports.mjs +3 -0
- package/dist/esm/api/resources/docAi/index.d.mts +2 -0
- package/dist/esm/api/resources/docAi/index.mjs +2 -0
- package/dist/esm/api/resources/docAi/types/DocAiGetResultsResponse.d.mts +10 -0
- package/dist/esm/api/resources/docAi/types/DocAiGetResultsResponse.mjs +2 -0
- package/dist/esm/api/resources/docAi/types/index.d.mts +1 -0
- package/dist/esm/api/resources/docAi/types/index.mjs +1 -0
- package/dist/esm/api/resources/documentIntelligence/DocumentIntelligenceJob.d.mts +0 -2
- package/dist/esm/api/resources/documentIntelligence/client/Client.mjs +0 -5
- package/dist/esm/api/resources/documentIntelligence/client/requests/DocumentIntelligenceJobRequest.d.mts +0 -2
- package/dist/esm/api/resources/dubbing/client/Client.d.mts +104 -0
- package/dist/esm/api/resources/dubbing/client/Client.mjs +276 -0
- package/dist/esm/api/resources/dubbing/client/index.d.mts +1 -0
- package/dist/esm/api/resources/dubbing/client/index.mjs +1 -0
- package/dist/esm/api/resources/dubbing/client/requests/CreateDubbingJobRequest.d.mts +38 -0
- package/dist/esm/api/resources/dubbing/client/requests/CreateDubbingJobRequest.mjs +2 -0
- package/dist/esm/api/resources/dubbing/client/requests/DubbingGetExportStatusRequest.d.mts +10 -0
- package/dist/esm/api/resources/dubbing/client/requests/DubbingGetExportStatusRequest.mjs +2 -0
- package/dist/esm/api/resources/dubbing/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/dubbing/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/dubbing/exports.d.mts +2 -0
- package/dist/esm/api/resources/dubbing/exports.mjs +3 -0
- package/dist/esm/api/resources/dubbing/index.d.mts +1 -0
- package/dist/esm/api/resources/dubbing/index.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +7 -0
- package/dist/esm/api/resources/index.mjs +7 -0
- package/dist/esm/api/resources/speechToText/client/requests/SpeechToTextTranscriptionRequest.d.mts +0 -6
- package/dist/esm/api/resources/speechToTextJob/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/speechToTextJob/client/Client.mjs +3 -3
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/client/Client.d.mts +36 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/client/Client.mjs +50 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/client/Socket.d.mts +55 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/client/Socket.mjs +137 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/client/index.d.mts +1 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/client/index.mjs +1 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/exports.d.mts +2 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/exports.mjs +3 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/index.d.mts +2 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/index.mjs +2 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEncoding.d.mts +8 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEncoding.mjs +8 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEndpointing.d.mts +11 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingEndpointing.mjs +11 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingLanguageCode.d.mts +56 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingLanguageCode.mjs +56 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingMode.d.mts +19 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingMode.mjs +19 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingReturnTimestamps.d.mts +9 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingReturnTimestamps.mjs +9 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingStreamType.d.mts +13 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingStreamType.mjs +13 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/index.d.mts +6 -0
- package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/index.mjs +6 -0
- package/dist/esm/api/resources/speechToTextStreaming/types/SpeechToTextStreamingLanguageCode.d.mts +1 -3
- package/dist/esm/api/resources/speechToTextStreaming/types/SpeechToTextStreamingLanguageCode.mjs +1 -3
- package/dist/esm/api/resources/speechToTextStreaming/types/SpeechToTextStreamingModel.d.mts +0 -3
- package/dist/esm/api/resources/speechToTextStreaming/types/SpeechToTextStreamingModel.mjs +0 -3
- package/dist/esm/api/resources/textToSpeech/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/textToSpeech/client/Client.mjs +1 -1
- package/dist/esm/api/resources/textToSpeech/client/requests/TextToSpeechRequest.d.mts +2 -2
- package/dist/esm/api/resources/textToSpeech/client/requests/TextToSpeechStreamRequest.d.mts +1 -1
- package/dist/esm/api/resources/textToSpeechStreaming/client/Socket.d.mts +3 -3
- package/dist/esm/api/resources/textToSpeechStreaming/client/Socket.mjs +3 -3
- package/dist/esm/api/types/ConfigureConnection.d.mts +3 -3
- package/dist/esm/api/types/ConfigureConnection.mjs +1 -1
- package/dist/esm/api/types/CreateDubbingJobData.d.mts +17 -0
- package/dist/esm/api/types/CreateDubbingJobData.mjs +2 -0
- package/dist/esm/api/types/CreateDubbingJobResponse.d.mts +7 -0
- package/dist/esm/api/types/CreateDubbingJobResponse.mjs +2 -0
- package/dist/esm/api/types/DocAiDigitiseResults.d.mts +32 -0
- package/dist/esm/api/types/DocAiDigitiseResults.mjs +2 -0
- package/dist/esm/api/types/DocAiDownloadUrlResponse.d.mts +10 -0
- package/dist/esm/api/types/DocAiDownloadUrlResponse.mjs +2 -0
- package/dist/esm/api/types/DocAiErrorDetail.d.mts +8 -0
- package/dist/esm/api/types/DocAiErrorDetail.mjs +2 -0
- package/dist/esm/api/types/DocAiErrorModel.d.mts +15 -0
- package/dist/esm/api/types/DocAiErrorModel.mjs +2 -0
- package/dist/esm/api/types/DocAiExtractResults.d.mts +17 -0
- package/dist/esm/api/types/DocAiExtractResults.mjs +2 -0
- package/dist/esm/api/types/DocAiJobStatusResponse.d.mts +14 -0
- package/dist/esm/api/types/DocAiJobStatusResponse.mjs +2 -0
- package/dist/esm/api/types/DocAiPresignUploadResponse.d.mts +12 -0
- package/dist/esm/api/types/DocAiPresignUploadResponse.mjs +2 -0
- package/dist/esm/api/types/DocAiStartJobResponse.d.mts +8 -0
- package/dist/esm/api/types/DocAiStartJobResponse.mjs +2 -0
- package/dist/esm/api/types/DocAiUsage.d.mts +10 -0
- package/dist/esm/api/types/DocAiUsage.mjs +2 -0
- package/dist/esm/api/types/DubbingExportItem.d.mts +17 -0
- package/dist/esm/api/types/DubbingExportItem.mjs +2 -0
- package/dist/esm/api/types/DubbingExportItemStatus.d.mts +6 -0
- package/dist/esm/api/types/DubbingExportItemStatus.mjs +6 -0
- package/dist/esm/api/types/DubbingExportOption.d.mts +7 -0
- package/dist/esm/api/types/DubbingExportOption.mjs +7 -0
- package/dist/esm/api/types/DubbingExportStatusData.d.mts +5 -0
- package/dist/esm/api/types/DubbingExportStatusData.mjs +2 -0
- package/dist/esm/api/types/DubbingExportStatusResponse.d.mts +7 -0
- package/dist/esm/api/types/DubbingExportStatusResponse.mjs +2 -0
- package/dist/esm/api/types/DubbingExportType.d.mts +8 -0
- package/dist/esm/api/types/DubbingExportType.mjs +8 -0
- package/dist/esm/api/types/DubbingJobStatus.d.mts +9 -0
- package/dist/esm/api/types/DubbingJobStatus.mjs +9 -0
- package/dist/esm/api/types/DubbingLanguage.d.mts +16 -0
- package/dist/esm/api/types/DubbingLanguage.mjs +16 -0
- package/dist/esm/api/types/DubbingLiveStatusData.d.mts +18 -0
- package/dist/esm/api/types/DubbingLiveStatusData.mjs +2 -0
- package/dist/esm/api/types/DubbingLiveStatusExportInfo.d.mts +14 -0
- package/dist/esm/api/types/DubbingLiveStatusExportInfo.mjs +2 -0
- package/dist/esm/api/types/DubbingLiveStatusResponse.d.mts +7 -0
- package/dist/esm/api/types/DubbingLiveStatusResponse.mjs +2 -0
- package/dist/esm/api/types/DubbingModelTier.d.mts +6 -0
- package/dist/esm/api/types/DubbingModelTier.mjs +6 -0
- package/dist/esm/api/types/DubbingPacePreset.d.mts +8 -0
- package/dist/esm/api/types/DubbingPacePreset.mjs +8 -0
- package/dist/esm/api/types/DubbingRegister.d.mts +10 -0
- package/dist/esm/api/types/DubbingRegister.mjs +10 -0
- package/dist/esm/api/types/DubbingStartData.d.mts +7 -0
- package/dist/esm/api/types/DubbingStartData.mjs +2 -0
- package/dist/esm/api/types/DubbingStartResponse.d.mts +8 -0
- package/dist/esm/api/types/DubbingStartResponse.mjs +2 -0
- package/dist/esm/api/types/RealtimeAudioInput.d.mts +10 -0
- package/dist/esm/api/types/RealtimeAudioInput.mjs +2 -0
- package/dist/esm/api/types/RealtimeConfigUpdate.d.mts +55 -0
- package/dist/esm/api/types/RealtimeConfigUpdate.mjs +22 -0
- package/dist/esm/api/types/RealtimeConfigUpdated.d.mts +8 -0
- package/dist/esm/api/types/RealtimeConfigUpdated.mjs +2 -0
- package/dist/esm/api/types/RealtimeEnd.d.mts +7 -0
- package/dist/esm/api/types/RealtimeEnd.mjs +2 -0
- package/dist/esm/api/types/RealtimeError.d.mts +29 -0
- package/dist/esm/api/types/RealtimeError.mjs +2 -0
- package/dist/esm/api/types/RealtimeFlush.d.mts +7 -0
- package/dist/esm/api/types/RealtimeFlush.mjs +2 -0
- package/dist/esm/api/types/RealtimePing.d.mts +6 -0
- package/dist/esm/api/types/RealtimePing.mjs +2 -0
- package/dist/esm/api/types/RealtimePong.d.mts +6 -0
- package/dist/esm/api/types/RealtimePong.mjs +2 -0
- package/dist/esm/api/types/RealtimeSessionBegin.d.mts +33 -0
- package/dist/esm/api/types/RealtimeSessionBegin.mjs +2 -0
- package/dist/esm/api/types/RealtimeSessionEnd.d.mts +15 -0
- package/dist/esm/api/types/RealtimeSessionEnd.mjs +2 -0
- package/dist/esm/api/types/RealtimeSpeechEnd.d.mts +7 -0
- package/dist/esm/api/types/RealtimeSpeechEnd.mjs +2 -0
- package/dist/esm/api/types/RealtimeSpeechStart.d.mts +7 -0
- package/dist/esm/api/types/RealtimeSpeechStart.mjs +2 -0
- package/dist/esm/api/types/RealtimeTranscriptFinal.d.mts +32 -0
- package/dist/esm/api/types/RealtimeTranscriptFinal.mjs +2 -0
- package/dist/esm/api/types/RealtimeTranscriptPartial.d.mts +17 -0
- package/dist/esm/api/types/RealtimeTranscriptPartial.mjs +2 -0
- package/dist/esm/api/types/RealtimeVadSpeechEnd.d.mts +10 -0
- package/dist/esm/api/types/RealtimeVadSpeechEnd.mjs +2 -0
- package/dist/esm/api/types/RealtimeVadSpeechStart.d.mts +10 -0
- package/dist/esm/api/types/RealtimeVadSpeechStart.mjs +2 -0
- package/dist/esm/api/types/SarvamModelIds.d.mts +4 -6
- package/dist/esm/api/types/SarvamModelIds.mjs +1 -5
- package/dist/esm/api/types/SpeechToTextBatchModel.d.mts +0 -6
- package/dist/esm/api/types/SpeechToTextBatchModel.mjs +0 -6
- package/dist/esm/api/types/SpeechToTextJobParameters.d.mts +3 -9
- package/dist/esm/api/types/SpeechToTextLanguage.d.mts +1 -7
- package/dist/esm/api/types/SpeechToTextLanguage.mjs +1 -7
- package/dist/esm/api/types/SpeechToTextModel.d.mts +0 -3
- package/dist/esm/api/types/SpeechToTextModel.mjs +0 -3
- package/dist/esm/api/types/index.d.mts +43 -1
- package/dist/esm/api/types/index.mjs +43 -1
- package/dist/esm/environments.d.mts +2 -0
- package/dist/esm/environments.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +37 -1
- package/reference.md +722 -4
- package/dist/cjs/api/types/DocDigitizationWebhookCallback.d.ts +0 -9
- package/dist/esm/api/types/DocDigitizationWebhookCallback.d.mts +0 -9
- /package/dist/cjs/api/{types/DocDigitizationWebhookCallback.js → resources/docAi/client/requests/DocAiGetResultsRequest.js} +0 -0
- /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.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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.
|
|
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.
|
|
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 {
|
|
537
|
+
import { DubbingClient } from 'sarvamai/dubbing';
|
|
533
538
|
|
|
534
|
-
const client = new
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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']);
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -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
|
|
47
|
-
"User-Agent": "sarvamai/1.1.8
|
|
46
|
+
"X-Fern-SDK-Version": "1.1.8",
|
|
47
|
+
"User-Agent": "sarvamai/1.1.8",
|
|
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);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/cjs/Client.js
CHANGED
|
@@ -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/
|
|
7
|
-
const Client_js_3 = require("./api/resources/
|
|
8
|
-
const Client_js_4 = require("./api/resources/
|
|
9
|
-
const Client_js_5 = require("./api/resources/
|
|
10
|
-
const Client_js_6 = require("./api/resources/
|
|
11
|
-
const Client_js_7 = require("./api/resources/
|
|
12
|
-
const Client_js_8 = require("./api/resources/
|
|
13
|
-
const Client_js_9 = require("./api/resources/
|
|
14
|
-
const Client_js_10 = require("./api/resources/
|
|
15
|
-
const Client_js_11 = require("./api/resources/
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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-
|
|
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-
|
|
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-
|
|
49
|
+
* model: "sarvam-105b",
|
|
50
50
|
* tools: [{
|
|
51
51
|
* type: "function",
|
|
52
52
|
* function: {
|
|
@@ -6,13 +6,13 @@ import type * as SarvamAI from "../../../../index.js";
|
|
|
6
6
|
* role: "user",
|
|
7
7
|
* content: "content"
|
|
8
8
|
* }],
|
|
9
|
-
* model: "sarvam-
|
|
9
|
+
* model: "sarvam-105b"
|
|
10
10
|
* }
|
|
11
11
|
*/
|
|
12
12
|
export interface ChatCompletionsRequest {
|
|
13
13
|
/** A list of messages comprising the conversation so far. */
|
|
14
14
|
messages: SarvamAI.ChatCompletionRequestMessage[];
|
|
15
|
-
/** Chat model ID. Use `sarvam-
|
|
15
|
+
/** Chat model ID. Use `sarvam-105b` (128K context). */
|
|
16
16
|
model: SarvamAI.SarvamModelIds;
|
|
17
17
|
/**
|
|
18
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.
|