sarvamai 1.1.6 → 1.1.7
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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/chat/client/requests/ChatCompletionsRequest.d.ts +3 -3
- package/dist/cjs/api/resources/speechToTextJob/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/speechToTextJob/client/Client.js +3 -8
- 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 +8 -6
- package/dist/cjs/api/resources/textToSpeech/client/requests/TextToSpeechStreamRequest.d.ts +4 -2
- package/dist/cjs/api/types/SarvamModelIds.d.ts +3 -4
- package/dist/cjs/api/types/SarvamModelIds.js +3 -4
- package/dist/cjs/api/types/SpeechToTextJobParameters.d.ts +2 -0
- package/dist/cjs/api/types/SpeechToTextTranslateJobParameters.d.ts +2 -0
- package/dist/cjs/api/types/TextToSpeechSpeaker.d.ts +0 -2
- package/dist/cjs/api/types/TextToSpeechSpeaker.js +0 -2
- 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/api/resources/chat/client/requests/ChatCompletionsRequest.d.mts +3 -3
- package/dist/esm/api/resources/speechToTextJob/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/speechToTextJob/client/Client.mjs +3 -8
- 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 +8 -6
- package/dist/esm/api/resources/textToSpeech/client/requests/TextToSpeechStreamRequest.d.mts +4 -2
- package/dist/esm/api/types/SarvamModelIds.d.mts +3 -4
- package/dist/esm/api/types/SarvamModelIds.mjs +3 -4
- package/dist/esm/api/types/SpeechToTextJobParameters.d.mts +2 -0
- package/dist/esm/api/types/SpeechToTextTranslateJobParameters.d.mts +2 -0
- package/dist/esm/api/types/TextToSpeechSpeaker.d.mts +0 -2
- package/dist/esm/api/types/TextToSpeechSpeaker.mjs +0 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +5 -5
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.
|
|
47
|
-
"User-Agent": "sarvamai/1.1.
|
|
46
|
+
"X-Fern-SDK-Version": "1.1.7",
|
|
47
|
+
"User-Agent": "sarvamai/1.1.7",
|
|
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);
|
|
@@ -5,13 +5,13 @@ import type * as SarvamAI from "../../../../index.js";
|
|
|
5
5
|
* messages: [{
|
|
6
6
|
* role: "assistant"
|
|
7
7
|
* }],
|
|
8
|
-
* model: "sarvam-
|
|
8
|
+
* model: "sarvam-105b"
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface ChatCompletionsRequest {
|
|
12
12
|
/** A list of messages comprising the conversation so far. */
|
|
13
13
|
messages: SarvamAI.ChatCompletionRequestMessage[];
|
|
14
|
-
/**
|
|
14
|
+
/** Chat model ID. Prefer `sarvam-30b` (64K context) or `sarvam-105b` (128K context) for new workloads. The value `sarvam-m` is a legacy 24B model that remains accepted; migrate to Sarvam-30B or Sarvam-105B for better performance. */
|
|
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.
|
|
@@ -27,7 +27,7 @@ export interface ChatCompletionsRequest {
|
|
|
27
27
|
* We generally recommend altering this or `temperature` but not both.
|
|
28
28
|
*/
|
|
29
29
|
top_p?: number;
|
|
30
|
-
/** The effort to use for reasoning */
|
|
30
|
+
/** The effort to use for reasoning. Can be disabled by explicitly setting to None. Default is 'medium'. */
|
|
31
31
|
reasoning_effort?: SarvamAI.ReasoningEffort;
|
|
32
32
|
/** The maximum number of tokens that can be generated in the chat completion. */
|
|
33
33
|
max_tokens?: number;
|
|
@@ -124,6 +124,7 @@ export declare class SpeechToTextJobClient {
|
|
|
124
124
|
* @param params.withTimestamps - Whether to include word-level timestamps (default: false)
|
|
125
125
|
* @param params.languageCode - The language code of the input audio (e.g., "hi-IN", "bn-IN")
|
|
126
126
|
* @param params.numSpeakers - The number of distinct speakers in the audio, if known
|
|
127
|
+
* @param params.mode - Output mode for **saaras:v3** only (e.g. transcribe, translate, verbatim)
|
|
127
128
|
* @param params.callback - Optional callback configuration to receive job completion events
|
|
128
129
|
* @param requestOptions - Request-specific configuration
|
|
129
130
|
* @returns A handle to the newly created Speech-to-Text job
|
|
@@ -134,6 +135,7 @@ export declare class SpeechToTextJobClient {
|
|
|
134
135
|
withTimestamps?: boolean;
|
|
135
136
|
languageCode?: SarvamAI.SpeechToTextLanguage;
|
|
136
137
|
numSpeakers?: number;
|
|
138
|
+
mode?: SarvamAI.Mode;
|
|
137
139
|
callback?: SarvamAI.BulkJobCallback;
|
|
138
140
|
}, requestOptions?: SpeechToTextJobClient.RequestOptions): Promise<SpeechToTextJobInstance>;
|
|
139
141
|
/**
|
|
@@ -501,21 +501,16 @@ class SpeechToTextJobClient {
|
|
|
501
501
|
* @param params.withTimestamps - Whether to include word-level timestamps (default: false)
|
|
502
502
|
* @param params.languageCode - The language code of the input audio (e.g., "hi-IN", "bn-IN")
|
|
503
503
|
* @param params.numSpeakers - The number of distinct speakers in the audio, if known
|
|
504
|
+
* @param params.mode - Output mode for **saaras:v3** only (e.g. transcribe, translate, verbatim)
|
|
504
505
|
* @param params.callback - Optional callback configuration to receive job completion events
|
|
505
506
|
* @param requestOptions - Request-specific configuration
|
|
506
507
|
* @returns A handle to the newly created Speech-to-Text job
|
|
507
508
|
*/
|
|
508
509
|
createJob() {
|
|
509
510
|
return __awaiter(this, arguments, void 0, function* (params = {}, requestOptions) {
|
|
510
|
-
const { model = "saarika:v2.5", withDiarization = false, withTimestamps = false, languageCode, numSpeakers, callback, } = params;
|
|
511
|
+
const { model = "saarika:v2.5", withDiarization = false, withTimestamps = false, languageCode, numSpeakers, mode, callback, } = params;
|
|
511
512
|
const response = yield this.initialise({
|
|
512
|
-
job_parameters: {
|
|
513
|
-
language_code: languageCode,
|
|
514
|
-
model: model,
|
|
515
|
-
num_speakers: numSpeakers,
|
|
516
|
-
with_diarization: withDiarization,
|
|
517
|
-
with_timestamps: withTimestamps,
|
|
518
|
-
},
|
|
513
|
+
job_parameters: Object.assign({ language_code: languageCode, model: model, num_speakers: numSpeakers, with_diarization: withDiarization, with_timestamps: withTimestamps }, (mode !== undefined ? { mode } : {})),
|
|
519
514
|
callback: callback,
|
|
520
515
|
}, requestOptions);
|
|
521
516
|
return new SpeechToTextJobInstance_js_1.SpeechToTextJobInstance(response.job_id, this);
|
|
@@ -46,7 +46,7 @@ export declare class TextToSpeechClient {
|
|
|
46
46
|
*
|
|
47
47
|
* This endpoint supports streaming audio using the specified output codec (e.g., `audio/mpeg` for MP3). The response is returned as a binary audio stream, which can be played or saved directly by the client.
|
|
48
48
|
*
|
|
49
|
-
* Supports the `dict_id` parameter to apply a [pronunciation dictionary](/api-reference-docs/
|
|
49
|
+
* Supports the `dict_id` parameter to apply a [pronunciation dictionary](https://docs.sarvam.ai/api-reference-docs/pronunciation-dictionary/create) during synthesis.
|
|
50
50
|
* @throws {@link SarvamAI.BadRequestError}
|
|
51
51
|
* @throws {@link SarvamAI.ForbiddenError}
|
|
52
52
|
* @throws {@link SarvamAI.UnprocessableEntityError}
|
|
@@ -137,7 +137,7 @@ class TextToSpeechClient {
|
|
|
137
137
|
*
|
|
138
138
|
* This endpoint supports streaming audio using the specified output codec (e.g., `audio/mpeg` for MP3). The response is returned as a binary audio stream, which can be played or saved directly by the client.
|
|
139
139
|
*
|
|
140
|
-
* Supports the `dict_id` parameter to apply a [pronunciation dictionary](/api-reference-docs/
|
|
140
|
+
* Supports the `dict_id` parameter to apply a [pronunciation dictionary](https://docs.sarvam.ai/api-reference-docs/pronunciation-dictionary/create) during synthesis.
|
|
141
141
|
* @throws {@link SarvamAI.BadRequestError}
|
|
142
142
|
* @throws {@link SarvamAI.ForbiddenError}
|
|
143
143
|
* @throws {@link SarvamAI.UnprocessableEntityError}
|
|
@@ -22,21 +22,23 @@ export interface TextToSpeechRequest {
|
|
|
22
22
|
* - This ensures proper pronunciation as a whole number
|
|
23
23
|
*/
|
|
24
24
|
text: string;
|
|
25
|
-
/** The language code in BCP-47 format.
|
|
25
|
+
/** The language code in BCP-47 format. */
|
|
26
26
|
target_language_code: SarvamAI.TextToSpeechLanguage;
|
|
27
27
|
/**
|
|
28
28
|
* The speaker voice to be used for the output audio.
|
|
29
29
|
*
|
|
30
|
-
* **Default:**
|
|
30
|
+
* **Default:** shubh (for bulbul:v3), anushka (for bulbul:v2)
|
|
31
31
|
*
|
|
32
32
|
* **Model Compatibility (Speakers compatible with respective model):**
|
|
33
33
|
* - **bulbul:v3:**
|
|
34
|
-
* -
|
|
34
|
+
* - shubh (default), aditya, ritu, priya, neha, rahul, pooja, rohan, simran, kavya, amit, dev, ishita, shreya, ratan, varun, manan, sumit, roopa, kabir, aayan, ashutosh, advait, anand, tanya, tarun, sunny, mani, gokul, vijay, shruti, suhani, mohit, kavitha, rehan, soham, rupali
|
|
35
35
|
* - **bulbul:v2:**
|
|
36
|
-
* - Female:
|
|
37
|
-
* - Male:
|
|
36
|
+
* - Female: anushka, manisha, vidya, arya
|
|
37
|
+
* - Male: abhilash, karun, hitesh
|
|
38
38
|
*
|
|
39
39
|
* **Note:** Speaker selection must match the chosen model version.
|
|
40
|
+
*
|
|
41
|
+
* **Important:** Speaker names are case-sensitive and must be lowercase (e.g., `ritu` not `Ritu`).
|
|
40
42
|
*/
|
|
41
43
|
speaker?: SarvamAI.TextToSpeechSpeaker;
|
|
42
44
|
/**
|
|
@@ -96,7 +98,7 @@ export interface TextToSpeechRequest {
|
|
|
96
98
|
/**
|
|
97
99
|
* The ID of a pronunciation dictionary to apply during synthesis. When provided, matching words in the input text will be replaced with their custom pronunciations before generating speech.
|
|
98
100
|
*
|
|
99
|
-
* Create and manage dictionaries via the [Pronunciation Dictionary API](/api-reference-docs/
|
|
101
|
+
* Create and manage dictionaries via the [Pronunciation Dictionary API](https://docs.sarvam.ai/api-reference-docs/pronunciation-dictionary/create). Only supported by **bulbul:v3**.
|
|
100
102
|
*/
|
|
101
103
|
dict_id?: string;
|
|
102
104
|
/**
|
|
@@ -23,9 +23,11 @@ export interface TextToSpeechStreamRequest {
|
|
|
23
23
|
/**
|
|
24
24
|
* The speaker voice to be used for the output audio.
|
|
25
25
|
*
|
|
26
|
-
* **Default:**
|
|
26
|
+
* **Default:** shubh (for bulbul:v3), anushka (for bulbul:v2)
|
|
27
27
|
*
|
|
28
28
|
* **Note:** Speaker selection must match the chosen model version.
|
|
29
|
+
*
|
|
30
|
+
* **Important:** Speaker names are case-sensitive and must be lowercase (e.g., `ritu` not `Ritu`).
|
|
29
31
|
*/
|
|
30
32
|
speaker?: SarvamAI.TextToSpeechSpeaker;
|
|
31
33
|
/**
|
|
@@ -69,7 +71,7 @@ export interface TextToSpeechStreamRequest {
|
|
|
69
71
|
/**
|
|
70
72
|
* The ID of a pronunciation dictionary to apply during synthesis. When provided, matching words in the input text will be replaced with their custom pronunciations before generating speech.
|
|
71
73
|
*
|
|
72
|
-
* Create and manage dictionaries via the [Pronunciation Dictionary API](/api-reference-docs/
|
|
74
|
+
* Create and manage dictionaries via the [Pronunciation Dictionary API](https://docs.sarvam.ai/api-reference-docs/pronunciation-dictionary/create). Only supported by **bulbul:v3**.
|
|
73
75
|
*/
|
|
74
76
|
dict_id?: string;
|
|
75
77
|
/** Specifies the codec for the streamed output audio (e.g., 'mp3'). */
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
/** Supported chat completion model IDs. Primary models: `sarvam-30b`, `sarvam-105b`. Legacy: `sarvam-m` (24B); prefer Sarvam-30B or Sarvam-105B for new integrations. */
|
|
1
2
|
export declare const SarvamModelIds: {
|
|
2
|
-
readonly SarvamM: "sarvam-m";
|
|
3
|
-
readonly Sarvam30B: "sarvam-30b";
|
|
4
|
-
readonly Sarvam30B16K: "sarvam-30b-16k";
|
|
5
3
|
readonly Sarvam105B: "sarvam-105b";
|
|
6
|
-
readonly
|
|
4
|
+
readonly Sarvam30B: "sarvam-30b";
|
|
5
|
+
readonly SarvamM: "sarvam-m";
|
|
7
6
|
};
|
|
8
7
|
export type SarvamModelIds = (typeof SarvamModelIds)[keyof typeof SarvamModelIds];
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.SarvamModelIds = void 0;
|
|
5
|
+
/** Supported chat completion model IDs. Primary models: `sarvam-30b`, `sarvam-105b`. Legacy: `sarvam-m` (24B); prefer Sarvam-30B or Sarvam-105B for new integrations. */
|
|
5
6
|
exports.SarvamModelIds = {
|
|
6
|
-
SarvamM: "sarvam-m",
|
|
7
|
-
Sarvam30B: "sarvam-30b",
|
|
8
|
-
Sarvam30B16K: "sarvam-30b-16k",
|
|
9
7
|
Sarvam105B: "sarvam-105b",
|
|
10
|
-
|
|
8
|
+
Sarvam30B: "sarvam-30b",
|
|
9
|
+
SarvamM: "sarvam-m",
|
|
11
10
|
};
|
|
@@ -67,4 +67,6 @@ export interface SpeechToTextJobParameters {
|
|
|
67
67
|
with_diarization?: boolean | undefined;
|
|
68
68
|
/** Number of speakers to be detected in the audio. This is used when with_diarization is true. */
|
|
69
69
|
num_speakers?: number | undefined;
|
|
70
|
+
/** Audio codec/format of uploaded files. The API automatically detects most formats; for PCM files (pcm_s16le, pcm_l16, pcm_raw), you must specify this parameter. PCM files are supported only at 16kHz sample rate. */
|
|
71
|
+
input_audio_codec?: SarvamAI.InputAudioCodec | undefined;
|
|
70
72
|
}
|
|
@@ -17,4 +17,6 @@ export interface SpeechToTextTranslateJobParameters {
|
|
|
17
17
|
with_diarization?: boolean | undefined;
|
|
18
18
|
/** Number of speakers to be detected in the audio. This is used when with_diarization is set to true. */
|
|
19
19
|
num_speakers?: number | undefined;
|
|
20
|
+
/** Audio codec/format of uploaded files. The API automatically detects most formats; for PCM files (pcm_s16le, pcm_l16, pcm_raw), you must specify this parameter. PCM files are supported only at 16kHz sample rate. */
|
|
21
|
+
input_audio_codec?: SarvamAI.InputAudioCodec | undefined;
|
|
20
22
|
}
|
|
@@ -29,8 +29,6 @@ export declare const TextToSpeechSpeaker: {
|
|
|
29
29
|
readonly Shubh: "shubh";
|
|
30
30
|
readonly Ashutosh: "ashutosh";
|
|
31
31
|
readonly Advait: "advait";
|
|
32
|
-
readonly Amelia: "amelia";
|
|
33
|
-
readonly Sophia: "sophia";
|
|
34
32
|
readonly Anand: "anand";
|
|
35
33
|
readonly Tanya: "tanya";
|
|
36
34
|
readonly Tarun: "tarun";
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.1.
|
|
1
|
+
export declare const SDK_VERSION = "1.1.7";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "sarvamai",
|
|
9
|
-
"X-Fern-SDK-Version": "1.1.
|
|
10
|
-
"User-Agent": "sarvamai/1.1.
|
|
9
|
+
"X-Fern-SDK-Version": "1.1.7",
|
|
10
|
+
"User-Agent": "sarvamai/1.1.7",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -5,13 +5,13 @@ import type * as SarvamAI from "../../../../index.mjs";
|
|
|
5
5
|
* messages: [{
|
|
6
6
|
* role: "assistant"
|
|
7
7
|
* }],
|
|
8
|
-
* model: "sarvam-
|
|
8
|
+
* model: "sarvam-105b"
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface ChatCompletionsRequest {
|
|
12
12
|
/** A list of messages comprising the conversation so far. */
|
|
13
13
|
messages: SarvamAI.ChatCompletionRequestMessage[];
|
|
14
|
-
/**
|
|
14
|
+
/** Chat model ID. Prefer `sarvam-30b` (64K context) or `sarvam-105b` (128K context) for new workloads. The value `sarvam-m` is a legacy 24B model that remains accepted; migrate to Sarvam-30B or Sarvam-105B for better performance. */
|
|
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.
|
|
@@ -27,7 +27,7 @@ export interface ChatCompletionsRequest {
|
|
|
27
27
|
* We generally recommend altering this or `temperature` but not both.
|
|
28
28
|
*/
|
|
29
29
|
top_p?: number;
|
|
30
|
-
/** The effort to use for reasoning */
|
|
30
|
+
/** The effort to use for reasoning. Can be disabled by explicitly setting to None. Default is 'medium'. */
|
|
31
31
|
reasoning_effort?: SarvamAI.ReasoningEffort;
|
|
32
32
|
/** The maximum number of tokens that can be generated in the chat completion. */
|
|
33
33
|
max_tokens?: number;
|
|
@@ -124,6 +124,7 @@ export declare class SpeechToTextJobClient {
|
|
|
124
124
|
* @param params.withTimestamps - Whether to include word-level timestamps (default: false)
|
|
125
125
|
* @param params.languageCode - The language code of the input audio (e.g., "hi-IN", "bn-IN")
|
|
126
126
|
* @param params.numSpeakers - The number of distinct speakers in the audio, if known
|
|
127
|
+
* @param params.mode - Output mode for **saaras:v3** only (e.g. transcribe, translate, verbatim)
|
|
127
128
|
* @param params.callback - Optional callback configuration to receive job completion events
|
|
128
129
|
* @param requestOptions - Request-specific configuration
|
|
129
130
|
* @returns A handle to the newly created Speech-to-Text job
|
|
@@ -134,6 +135,7 @@ export declare class SpeechToTextJobClient {
|
|
|
134
135
|
withTimestamps?: boolean;
|
|
135
136
|
languageCode?: SarvamAI.SpeechToTextLanguage;
|
|
136
137
|
numSpeakers?: number;
|
|
138
|
+
mode?: SarvamAI.Mode;
|
|
137
139
|
callback?: SarvamAI.BulkJobCallback;
|
|
138
140
|
}, requestOptions?: SpeechToTextJobClient.RequestOptions): Promise<SpeechToTextJobInstance>;
|
|
139
141
|
/**
|
|
@@ -465,21 +465,16 @@ export class SpeechToTextJobClient {
|
|
|
465
465
|
* @param params.withTimestamps - Whether to include word-level timestamps (default: false)
|
|
466
466
|
* @param params.languageCode - The language code of the input audio (e.g., "hi-IN", "bn-IN")
|
|
467
467
|
* @param params.numSpeakers - The number of distinct speakers in the audio, if known
|
|
468
|
+
* @param params.mode - Output mode for **saaras:v3** only (e.g. transcribe, translate, verbatim)
|
|
468
469
|
* @param params.callback - Optional callback configuration to receive job completion events
|
|
469
470
|
* @param requestOptions - Request-specific configuration
|
|
470
471
|
* @returns A handle to the newly created Speech-to-Text job
|
|
471
472
|
*/
|
|
472
473
|
createJob() {
|
|
473
474
|
return __awaiter(this, arguments, void 0, function* (params = {}, requestOptions) {
|
|
474
|
-
const { model = "saarika:v2.5", withDiarization = false, withTimestamps = false, languageCode, numSpeakers, callback, } = params;
|
|
475
|
+
const { model = "saarika:v2.5", withDiarization = false, withTimestamps = false, languageCode, numSpeakers, mode, callback, } = params;
|
|
475
476
|
const response = yield this.initialise({
|
|
476
|
-
job_parameters: {
|
|
477
|
-
language_code: languageCode,
|
|
478
|
-
model: model,
|
|
479
|
-
num_speakers: numSpeakers,
|
|
480
|
-
with_diarization: withDiarization,
|
|
481
|
-
with_timestamps: withTimestamps,
|
|
482
|
-
},
|
|
477
|
+
job_parameters: Object.assign({ language_code: languageCode, model: model, num_speakers: numSpeakers, with_diarization: withDiarization, with_timestamps: withTimestamps }, (mode !== undefined ? { mode } : {})),
|
|
483
478
|
callback: callback,
|
|
484
479
|
}, requestOptions);
|
|
485
480
|
return new SpeechToTextJobInstance(response.job_id, this);
|
|
@@ -46,7 +46,7 @@ export declare class TextToSpeechClient {
|
|
|
46
46
|
*
|
|
47
47
|
* This endpoint supports streaming audio using the specified output codec (e.g., `audio/mpeg` for MP3). The response is returned as a binary audio stream, which can be played or saved directly by the client.
|
|
48
48
|
*
|
|
49
|
-
* Supports the `dict_id` parameter to apply a [pronunciation dictionary](/api-reference-docs/
|
|
49
|
+
* Supports the `dict_id` parameter to apply a [pronunciation dictionary](https://docs.sarvam.ai/api-reference-docs/pronunciation-dictionary/create) during synthesis.
|
|
50
50
|
* @throws {@link SarvamAI.BadRequestError}
|
|
51
51
|
* @throws {@link SarvamAI.ForbiddenError}
|
|
52
52
|
* @throws {@link SarvamAI.UnprocessableEntityError}
|
|
@@ -101,7 +101,7 @@ export class TextToSpeechClient {
|
|
|
101
101
|
*
|
|
102
102
|
* This endpoint supports streaming audio using the specified output codec (e.g., `audio/mpeg` for MP3). The response is returned as a binary audio stream, which can be played or saved directly by the client.
|
|
103
103
|
*
|
|
104
|
-
* Supports the `dict_id` parameter to apply a [pronunciation dictionary](/api-reference-docs/
|
|
104
|
+
* Supports the `dict_id` parameter to apply a [pronunciation dictionary](https://docs.sarvam.ai/api-reference-docs/pronunciation-dictionary/create) during synthesis.
|
|
105
105
|
* @throws {@link SarvamAI.BadRequestError}
|
|
106
106
|
* @throws {@link SarvamAI.ForbiddenError}
|
|
107
107
|
* @throws {@link SarvamAI.UnprocessableEntityError}
|
|
@@ -22,21 +22,23 @@ export interface TextToSpeechRequest {
|
|
|
22
22
|
* - This ensures proper pronunciation as a whole number
|
|
23
23
|
*/
|
|
24
24
|
text: string;
|
|
25
|
-
/** The language code in BCP-47 format.
|
|
25
|
+
/** The language code in BCP-47 format. */
|
|
26
26
|
target_language_code: SarvamAI.TextToSpeechLanguage;
|
|
27
27
|
/**
|
|
28
28
|
* The speaker voice to be used for the output audio.
|
|
29
29
|
*
|
|
30
|
-
* **Default:**
|
|
30
|
+
* **Default:** shubh (for bulbul:v3), anushka (for bulbul:v2)
|
|
31
31
|
*
|
|
32
32
|
* **Model Compatibility (Speakers compatible with respective model):**
|
|
33
33
|
* - **bulbul:v3:**
|
|
34
|
-
* -
|
|
34
|
+
* - shubh (default), aditya, ritu, priya, neha, rahul, pooja, rohan, simran, kavya, amit, dev, ishita, shreya, ratan, varun, manan, sumit, roopa, kabir, aayan, ashutosh, advait, anand, tanya, tarun, sunny, mani, gokul, vijay, shruti, suhani, mohit, kavitha, rehan, soham, rupali
|
|
35
35
|
* - **bulbul:v2:**
|
|
36
|
-
* - Female:
|
|
37
|
-
* - Male:
|
|
36
|
+
* - Female: anushka, manisha, vidya, arya
|
|
37
|
+
* - Male: abhilash, karun, hitesh
|
|
38
38
|
*
|
|
39
39
|
* **Note:** Speaker selection must match the chosen model version.
|
|
40
|
+
*
|
|
41
|
+
* **Important:** Speaker names are case-sensitive and must be lowercase (e.g., `ritu` not `Ritu`).
|
|
40
42
|
*/
|
|
41
43
|
speaker?: SarvamAI.TextToSpeechSpeaker;
|
|
42
44
|
/**
|
|
@@ -96,7 +98,7 @@ export interface TextToSpeechRequest {
|
|
|
96
98
|
/**
|
|
97
99
|
* The ID of a pronunciation dictionary to apply during synthesis. When provided, matching words in the input text will be replaced with their custom pronunciations before generating speech.
|
|
98
100
|
*
|
|
99
|
-
* Create and manage dictionaries via the [Pronunciation Dictionary API](/api-reference-docs/
|
|
101
|
+
* Create and manage dictionaries via the [Pronunciation Dictionary API](https://docs.sarvam.ai/api-reference-docs/pronunciation-dictionary/create). Only supported by **bulbul:v3**.
|
|
100
102
|
*/
|
|
101
103
|
dict_id?: string;
|
|
102
104
|
/**
|
|
@@ -23,9 +23,11 @@ export interface TextToSpeechStreamRequest {
|
|
|
23
23
|
/**
|
|
24
24
|
* The speaker voice to be used for the output audio.
|
|
25
25
|
*
|
|
26
|
-
* **Default:**
|
|
26
|
+
* **Default:** shubh (for bulbul:v3), anushka (for bulbul:v2)
|
|
27
27
|
*
|
|
28
28
|
* **Note:** Speaker selection must match the chosen model version.
|
|
29
|
+
*
|
|
30
|
+
* **Important:** Speaker names are case-sensitive and must be lowercase (e.g., `ritu` not `Ritu`).
|
|
29
31
|
*/
|
|
30
32
|
speaker?: SarvamAI.TextToSpeechSpeaker;
|
|
31
33
|
/**
|
|
@@ -69,7 +71,7 @@ export interface TextToSpeechStreamRequest {
|
|
|
69
71
|
/**
|
|
70
72
|
* The ID of a pronunciation dictionary to apply during synthesis. When provided, matching words in the input text will be replaced with their custom pronunciations before generating speech.
|
|
71
73
|
*
|
|
72
|
-
* Create and manage dictionaries via the [Pronunciation Dictionary API](/api-reference-docs/
|
|
74
|
+
* Create and manage dictionaries via the [Pronunciation Dictionary API](https://docs.sarvam.ai/api-reference-docs/pronunciation-dictionary/create). Only supported by **bulbul:v3**.
|
|
73
75
|
*/
|
|
74
76
|
dict_id?: string;
|
|
75
77
|
/** Specifies the codec for the streamed output audio (e.g., 'mp3'). */
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
/** Supported chat completion model IDs. Primary models: `sarvam-30b`, `sarvam-105b`. Legacy: `sarvam-m` (24B); prefer Sarvam-30B or Sarvam-105B for new integrations. */
|
|
1
2
|
export declare const SarvamModelIds: {
|
|
2
|
-
readonly SarvamM: "sarvam-m";
|
|
3
|
-
readonly Sarvam30B: "sarvam-30b";
|
|
4
|
-
readonly Sarvam30B16K: "sarvam-30b-16k";
|
|
5
3
|
readonly Sarvam105B: "sarvam-105b";
|
|
6
|
-
readonly
|
|
4
|
+
readonly Sarvam30B: "sarvam-30b";
|
|
5
|
+
readonly SarvamM: "sarvam-m";
|
|
7
6
|
};
|
|
8
7
|
export type SarvamModelIds = (typeof SarvamModelIds)[keyof typeof SarvamModelIds];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** Supported chat completion model IDs. Primary models: `sarvam-30b`, `sarvam-105b`. Legacy: `sarvam-m` (24B); prefer Sarvam-30B or Sarvam-105B for new integrations. */
|
|
2
3
|
export const SarvamModelIds = {
|
|
3
|
-
SarvamM: "sarvam-m",
|
|
4
|
-
Sarvam30B: "sarvam-30b",
|
|
5
|
-
Sarvam30B16K: "sarvam-30b-16k",
|
|
6
4
|
Sarvam105B: "sarvam-105b",
|
|
7
|
-
|
|
5
|
+
Sarvam30B: "sarvam-30b",
|
|
6
|
+
SarvamM: "sarvam-m",
|
|
8
7
|
};
|
|
@@ -67,4 +67,6 @@ export interface SpeechToTextJobParameters {
|
|
|
67
67
|
with_diarization?: boolean | undefined;
|
|
68
68
|
/** Number of speakers to be detected in the audio. This is used when with_diarization is true. */
|
|
69
69
|
num_speakers?: number | undefined;
|
|
70
|
+
/** Audio codec/format of uploaded files. The API automatically detects most formats; for PCM files (pcm_s16le, pcm_l16, pcm_raw), you must specify this parameter. PCM files are supported only at 16kHz sample rate. */
|
|
71
|
+
input_audio_codec?: SarvamAI.InputAudioCodec | undefined;
|
|
70
72
|
}
|
|
@@ -17,4 +17,6 @@ export interface SpeechToTextTranslateJobParameters {
|
|
|
17
17
|
with_diarization?: boolean | undefined;
|
|
18
18
|
/** Number of speakers to be detected in the audio. This is used when with_diarization is set to true. */
|
|
19
19
|
num_speakers?: number | undefined;
|
|
20
|
+
/** Audio codec/format of uploaded files. The API automatically detects most formats; for PCM files (pcm_s16le, pcm_l16, pcm_raw), you must specify this parameter. PCM files are supported only at 16kHz sample rate. */
|
|
21
|
+
input_audio_codec?: SarvamAI.InputAudioCodec | undefined;
|
|
20
22
|
}
|
|
@@ -29,8 +29,6 @@ export declare const TextToSpeechSpeaker: {
|
|
|
29
29
|
readonly Shubh: "shubh";
|
|
30
30
|
readonly Ashutosh: "ashutosh";
|
|
31
31
|
readonly Advait: "advait";
|
|
32
|
-
readonly Amelia: "amelia";
|
|
33
|
-
readonly Sophia: "sophia";
|
|
34
32
|
readonly Anand: "anand";
|
|
35
33
|
readonly Tanya: "tanya";
|
|
36
34
|
readonly Tarun: "tarun";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.1.
|
|
1
|
+
export declare const SDK_VERSION = "1.1.7";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.1.
|
|
1
|
+
export const SDK_VERSION = "1.1.7";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -500,7 +500,7 @@ Converts the input text into a streamed spoken audio response.
|
|
|
500
500
|
|
|
501
501
|
This endpoint supports streaming audio using the specified output codec (e.g., `audio/mpeg` for MP3). The response is returned as a binary audio stream, which can be played or saved directly by the client.
|
|
502
502
|
|
|
503
|
-
Supports the `dict_id` parameter to apply a [pronunciation dictionary](/api-reference-docs/
|
|
503
|
+
Supports the `dict_id` parameter to apply a [pronunciation dictionary](https://docs.sarvam.ai/api-reference-docs/pronunciation-dictionary/create) during synthesis.
|
|
504
504
|
</dd>
|
|
505
505
|
</dl>
|
|
506
506
|
</dd>
|
|
@@ -898,7 +898,7 @@ await client.chat.completions({
|
|
|
898
898
|
messages: [{
|
|
899
899
|
role: "assistant"
|
|
900
900
|
}],
|
|
901
|
-
model: "sarvam-
|
|
901
|
+
model: "sarvam-105b"
|
|
902
902
|
});
|
|
903
903
|
|
|
904
904
|
```
|
|
@@ -948,7 +948,7 @@ await client.chat.completions({
|
|
|
948
948
|
<dl>
|
|
949
949
|
<dd>
|
|
950
950
|
|
|
951
|
-
Create a new speech to text bulk job and receive a job UUID and storage folder details for processing multiple audio files
|
|
951
|
+
Create a new speech to text bulk job and receive a job UUID and storage folder details for processing multiple audio files. Set `job_parameters.input_audio_codec` when uploads are raw PCM (`pcm_s16le`, `pcm_l16`, or `pcm_raw`); the API auto-detects other formats. PCM must be 16 kHz.
|
|
952
952
|
</dd>
|
|
953
953
|
</dl>
|
|
954
954
|
</dd>
|
|
@@ -1284,7 +1284,7 @@ await client.speechToTextJob.getDownloadLinks({
|
|
|
1284
1284
|
<dl>
|
|
1285
1285
|
<dd>
|
|
1286
1286
|
|
|
1287
|
-
Create a new speech to text translate bulk job and receive a job UUID and storage folder details for processing multiple audio files with translation
|
|
1287
|
+
Create a new speech to text translate bulk job and receive a job UUID and storage folder details for processing multiple audio files with translation. Set `job_parameters.input_audio_codec` when uploads are raw PCM (`pcm_s16le`, `pcm_l16`, or `pcm_raw`); the API auto-detects other formats. PCM must be 16 kHz.
|
|
1288
1288
|
</dd>
|
|
1289
1289
|
</dl>
|
|
1290
1290
|
</dd>
|
|
@@ -1800,7 +1800,7 @@ Validates the uploaded file and starts processing.
|
|
|
1800
1800
|
- ZIP must contain only JPEG/PNG images
|
|
1801
1801
|
- ZIP must be flat (no nested folders beyond one level)
|
|
1802
1802
|
- ZIP must contain at least one valid image
|
|
1803
|
-
- Page/image count must not exceed
|
|
1803
|
+
- Page/image count must not exceed 10 (returns `422` with `max_page_limit_exceeded` if exceeded)
|
|
1804
1804
|
- User must have sufficient credits
|
|
1805
1805
|
|
|
1806
1806
|
**Processing:**
|