sarvamai 1.1.19 → 1.1.20

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 (52) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/docAi/client/Client.d.ts +2 -1
  3. package/dist/cjs/api/resources/docAi/client/Client.js +5 -1
  4. package/dist/cjs/api/resources/docAi/client/requests/DocAiExtractRequest.d.ts +10 -1
  5. package/dist/cjs/api/resources/docAi/client/requests/DocAiExtractRequest.js +5 -0
  6. package/dist/cjs/api/resources/speechToText/client/requests/SpeechToTextTranslationRequest.d.ts +3 -2
  7. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingLanguageCode.d.ts +1 -1
  8. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingLanguageCode.js +1 -1
  9. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingModel.d.ts +2 -2
  10. package/dist/cjs/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingModel.js +2 -2
  11. package/dist/cjs/api/resources/speechToTextTranslateStreaming/types/SpeechToTextTranslateStreamingModel.d.ts +14 -0
  12. package/dist/cjs/api/resources/speechToTextTranslateStreaming/types/SpeechToTextTranslateStreamingModel.js +17 -0
  13. package/dist/cjs/api/resources/speechToTextTranslateStreaming/types/index.d.ts +1 -0
  14. package/dist/cjs/api/resources/speechToTextTranslateStreaming/types/index.js +1 -0
  15. package/dist/cjs/api/resources/voiceCloning/client/Client.d.ts +2 -2
  16. package/dist/cjs/api/resources/voiceCloning/client/Client.js +2 -2
  17. package/dist/cjs/api/resources/voiceCloning/client/requests/VoiceCloningRequest.d.ts +1 -1
  18. package/dist/cjs/api/resources/voiceCloning/client/requests/VoiceCloningStreamRequest.d.ts +1 -1
  19. package/dist/cjs/api/types/RealtimeError.d.ts +6 -1
  20. package/dist/cjs/api/types/SpeechToTextTranslateJobParameters.d.ts +3 -2
  21. package/dist/cjs/api/types/SpeechToTextTranslateModel.d.ts +8 -3
  22. package/dist/cjs/api/types/SpeechToTextTranslateModel.js +14 -0
  23. package/dist/cjs/api/types/VoiceCloningConfigureConnection.d.ts +2 -5
  24. package/dist/cjs/version.d.ts +1 -1
  25. package/dist/cjs/version.js +1 -1
  26. package/dist/esm/BaseClient.mjs +2 -2
  27. package/dist/esm/api/resources/docAi/client/Client.d.mts +2 -1
  28. package/dist/esm/api/resources/docAi/client/Client.mjs +5 -1
  29. package/dist/esm/api/resources/docAi/client/requests/DocAiExtractRequest.d.mts +10 -1
  30. package/dist/esm/api/resources/docAi/client/requests/DocAiExtractRequest.mjs +5 -0
  31. package/dist/esm/api/resources/speechToText/client/requests/SpeechToTextTranslationRequest.d.mts +3 -2
  32. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingLanguageCode.d.mts +1 -1
  33. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingLanguageCode.mjs +1 -1
  34. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingModel.d.mts +2 -2
  35. package/dist/esm/api/resources/speechToTextRealtimeStreaming/types/SpeechToTextRealtimeStreamingModel.mjs +2 -2
  36. package/dist/esm/api/resources/speechToTextTranslateStreaming/types/SpeechToTextTranslateStreamingModel.d.mts +14 -0
  37. package/dist/esm/api/resources/speechToTextTranslateStreaming/types/SpeechToTextTranslateStreamingModel.mjs +14 -0
  38. package/dist/esm/api/resources/speechToTextTranslateStreaming/types/index.d.mts +1 -0
  39. package/dist/esm/api/resources/speechToTextTranslateStreaming/types/index.mjs +1 -0
  40. package/dist/esm/api/resources/voiceCloning/client/Client.d.mts +2 -2
  41. package/dist/esm/api/resources/voiceCloning/client/Client.mjs +2 -2
  42. package/dist/esm/api/resources/voiceCloning/client/requests/VoiceCloningRequest.d.mts +1 -1
  43. package/dist/esm/api/resources/voiceCloning/client/requests/VoiceCloningStreamRequest.d.mts +1 -1
  44. package/dist/esm/api/types/RealtimeError.d.mts +6 -1
  45. package/dist/esm/api/types/SpeechToTextTranslateJobParameters.d.mts +3 -2
  46. package/dist/esm/api/types/SpeechToTextTranslateModel.d.mts +8 -3
  47. package/dist/esm/api/types/SpeechToTextTranslateModel.mjs +13 -1
  48. package/dist/esm/api/types/VoiceCloningConfigureConnection.d.mts +2 -5
  49. package/dist/esm/version.d.mts +1 -1
  50. package/dist/esm/version.mjs +1 -1
  51. package/package.json +1 -1
  52. package/reference.md +4 -3
@@ -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.19",
47
- "User-Agent": "sarvamai/1.1.19",
46
+ "X-Fern-SDK-Version": "1.1.20",
47
+ "User-Agent": "sarvamai/1.1.20",
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);
@@ -84,7 +84,8 @@ export declare class DocAiClient {
84
84
  * import { createReadStream } from "fs";
85
85
  * await client.docAi.extract({
86
86
  * schema: "{\"type\":\"object\",\"properties\":{\"policy_number\":{\"type\":\"string\",\"description\":\"Insurance policy number\"},\"insured_name\":{\"type\":\"string\",\"description\":\"Name of the insured person\"},\"sum_insured\":{\"type\":\"number\",\"description\":\"Total sum insured, in INR\"}}}",
87
- * output_format: "json"
87
+ * output_format: "json",
88
+ * mode: "basic"
88
89
  * })
89
90
  */
90
91
  extract(request: SarvamAI.DocAiExtractRequest, requestOptions?: DocAiClient.RequestOptions): core.HttpResponsePromise<SarvamAI.DocAiStartJobResponse>;
@@ -243,7 +243,8 @@ class DocAiClient {
243
243
  * import { createReadStream } from "fs";
244
244
  * await client.docAi.extract({
245
245
  * schema: "{\"type\":\"object\",\"properties\":{\"policy_number\":{\"type\":\"string\",\"description\":\"Insurance policy number\"},\"insured_name\":{\"type\":\"string\",\"description\":\"Name of the insured person\"},\"sum_insured\":{\"type\":\"number\",\"description\":\"Total sum insured, in INR\"}}}",
246
- * output_format: "json"
246
+ * output_format: "json",
247
+ * mode: "basic"
247
248
  * })
248
249
  */
249
250
  extract(request, requestOptions) {
@@ -276,6 +277,9 @@ class DocAiClient {
276
277
  if (request.model != null) {
277
278
  _body.append("model", request.model);
278
279
  }
280
+ if (request.mode != null) {
281
+ _body.append("mode", request.mode);
282
+ }
279
283
  const _maybeEncodedRequest = yield _body.getRequest();
280
284
  const _authRequest = yield this._options.authProvider.getAuthRequest();
281
285
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -3,7 +3,8 @@ import type * as core from "../../../../../core/index.js";
3
3
  * @example
4
4
  * {
5
5
  * schema: "{\"type\":\"object\",\"properties\":{\"policy_number\":{\"type\":\"string\",\"description\":\"Insurance policy number\"},\"insured_name\":{\"type\":\"string\",\"description\":\"Name of the insured person\"},\"sum_insured\":{\"type\":\"number\",\"description\":\"Total sum insured, in INR\"}}}",
6
- * output_format: "json"
6
+ * output_format: "json",
7
+ * mode: "basic"
7
8
  * }
8
9
  */
9
10
  export interface DocAiExtractRequest {
@@ -21,6 +22,8 @@ export interface DocAiExtractRequest {
21
22
  classification?: string;
22
23
  /** Model to use for extraction. */
23
24
  model?: string;
25
+ /** Extraction mode. `basic` reads each field on the page where it is printed; best for forms, IDs, and invoices at volume. `advanced` adds a second reading of the whole document to resolve context such as quarterly vs annual values and to check that line items add up to the total; best for financial statements, filings, slide decks, and long records. `advanced` takes longer and costs more per page. Both modes take the same schema and return the same response format. */
26
+ mode?: DocAiExtractRequest.Mode;
24
27
  }
25
28
  export declare namespace DocAiExtractRequest {
26
29
  /** Output format of the extraction results. */
@@ -30,4 +33,10 @@ export declare namespace DocAiExtractRequest {
30
33
  readonly Xlsx: "xlsx";
31
34
  };
32
35
  type OutputFormat = (typeof OutputFormat)[keyof typeof OutputFormat];
36
+ /** Extraction mode. `basic` reads each field on the page where it is printed; best for forms, IDs, and invoices at volume. `advanced` adds a second reading of the whole document to resolve context such as quarterly vs annual values and to check that line items add up to the total; best for financial statements, filings, slide decks, and long records. `advanced` takes longer and costs more per page. Both modes take the same schema and return the same response format. */
37
+ const Mode: {
38
+ readonly Basic: "basic";
39
+ readonly Advanced: "advanced";
40
+ };
41
+ type Mode = (typeof Mode)[keyof typeof Mode];
33
42
  }
@@ -10,4 +10,9 @@ var DocAiExtractRequest;
10
10
  Csv: "csv",
11
11
  Xlsx: "xlsx",
12
12
  };
13
+ /** Extraction mode. `basic` reads each field on the page where it is printed; best for forms, IDs, and invoices at volume. `advanced` adds a second reading of the whole document to resolve context such as quarterly vs annual values and to check that line items add up to the total; best for financial statements, filings, slide decks, and long records. `advanced` takes longer and costs more per page. Both modes take the same schema and return the same response format. */
14
+ DocAiExtractRequest.Mode = {
15
+ Basic: "basic",
16
+ Advanced: "advanced",
17
+ };
13
18
  })(DocAiExtractRequest || (exports.DocAiExtractRequest = DocAiExtractRequest = {}));
@@ -17,10 +17,11 @@ export interface SpeechToTextTranslationRequest {
17
17
  /**
18
18
  * Model to be used for speech to text translation.
19
19
  *
20
- * - **saaras:v2.5** (default): Translation model that translates audio from any spoken Indic language to English.
20
+ * - **saaras:v3** (default): Translation model that translates audio from any spoken Indic language to English.
21
21
  * - Example: Hindi audio → English text output
22
+ * - **saaras:v2.5**: Earlier translation model, kept for backward compatibility.
22
23
  *
23
- * For the latest model (saaras:v3), use the `/speech-to-text` endpoint with `mode="translate"`.
24
+ * `saaras:v4` is not supported on this endpoint. For the latest model (saaras:v4), use the `/speech-to-text` endpoint with `mode="translate"`.
24
25
  */
25
26
  model?: SarvamAI.SpeechToTextTranslateModel;
26
27
  /** Audio codec/format of the input file. Our API automatically detects all codec formats, but for PCM files specifically (pcm_s16le, pcm_l16, pcm_raw), you must pass this parameter. PCM files are supported only at 16kHz sample rate. */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * BCP-47 language code of the input audio. **Required.**
3
3
  *
4
- * **Supported languages (saaras:v3-realtime and saaras:v4):**
4
+ * **Supported languages (saaras:v4 and saaras:v3-realtime):**
5
5
  * - `auto`: Adaptive automatic language detection
6
6
  * - `en-IN`: English
7
7
  * - `hi-IN`: Hindi
@@ -5,7 +5,7 @@ exports.SpeechToTextRealtimeStreamingLanguageCode = void 0;
5
5
  /**
6
6
  * BCP-47 language code of the input audio. **Required.**
7
7
  *
8
- * **Supported languages (saaras:v3-realtime and saaras:v4):**
8
+ * **Supported languages (saaras:v4 and saaras:v3-realtime):**
9
9
  * - `auto`: Adaptive automatic language detection
10
10
  * - `en-IN`: English
11
11
  * - `hi-IN`: Hindi
@@ -1,6 +1,6 @@
1
- /** Speech-to-text model for this endpoint. `saaras:v3-realtime` (default) or `saaras:v4`. */
1
+ /** Speech-to-text model for this endpoint. `saaras:v4` (default) or `saaras:v3-realtime`. */
2
2
  export declare const SpeechToTextRealtimeStreamingModel: {
3
- readonly SaarasV3Realtime: "saaras:v3-realtime";
4
3
  readonly SaarasV4: "saaras:v4";
4
+ readonly SaarasV3Realtime: "saaras:v3-realtime";
5
5
  };
6
6
  export type SpeechToTextRealtimeStreamingModel = (typeof SpeechToTextRealtimeStreamingModel)[keyof typeof SpeechToTextRealtimeStreamingModel];
@@ -2,8 +2,8 @@
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.SpeechToTextRealtimeStreamingModel = void 0;
5
- /** Speech-to-text model for this endpoint. `saaras:v3-realtime` (default) or `saaras:v4`. */
5
+ /** Speech-to-text model for this endpoint. `saaras:v4` (default) or `saaras:v3-realtime`. */
6
6
  exports.SpeechToTextRealtimeStreamingModel = {
7
- SaarasV3Realtime: "saaras:v3-realtime",
8
7
  SaarasV4: "saaras:v4",
8
+ SaarasV3Realtime: "saaras:v3-realtime",
9
9
  };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Model to be used for speech to text translation.
3
+ *
4
+ * - **saaras:v3** (default): Translation model that translates audio from any spoken Indic language to English.
5
+ * - Example: Hindi audio → English text output
6
+ * - **saaras:v2.5**: Earlier translation model, kept for backward compatibility.
7
+ *
8
+ * `saaras:v4` is not supported on this endpoint. For the latest model (saaras:v4), use the `/speech-to-text` endpoint with `mode="translate"`.
9
+ */
10
+ export declare const SpeechToTextTranslateStreamingModel: {
11
+ readonly SaarasV3: "saaras:v3";
12
+ readonly SaarasV25: "saaras:v2.5";
13
+ };
14
+ export type SpeechToTextTranslateStreamingModel = (typeof SpeechToTextTranslateStreamingModel)[keyof typeof SpeechToTextTranslateStreamingModel];
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SpeechToTextTranslateStreamingModel = void 0;
5
+ /**
6
+ * Model to be used for speech to text translation.
7
+ *
8
+ * - **saaras:v3** (default): Translation model that translates audio from any spoken Indic language to English.
9
+ * - Example: Hindi audio → English text output
10
+ * - **saaras:v2.5**: Earlier translation model, kept for backward compatibility.
11
+ *
12
+ * `saaras:v4` is not supported on this endpoint. For the latest model (saaras:v4), use the `/speech-to-text` endpoint with `mode="translate"`.
13
+ */
14
+ exports.SpeechToTextTranslateStreamingModel = {
15
+ SaarasV3: "saaras:v3",
16
+ SaarasV25: "saaras:v2.5",
17
+ };
@@ -1,4 +1,5 @@
1
1
  export * from "./SpeechToTextTranslateStreamingFlushSignal.js";
2
2
  export * from "./SpeechToTextTranslateStreamingHighVadSensitivity.js";
3
3
  export * from "./SpeechToTextTranslateStreamingInputAudioCodec.js";
4
+ export * from "./SpeechToTextTranslateStreamingModel.js";
4
5
  export * from "./SpeechToTextTranslateStreamingVadSignals.js";
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./SpeechToTextTranslateStreamingFlushSignal.js"), exports);
18
18
  __exportStar(require("./SpeechToTextTranslateStreamingHighVadSensitivity.js"), exports);
19
19
  __exportStar(require("./SpeechToTextTranslateStreamingInputAudioCodec.js"), exports);
20
+ __exportStar(require("./SpeechToTextTranslateStreamingModel.js"), exports);
20
21
  __exportStar(require("./SpeechToTextTranslateStreamingVadSignals.js"), exports);
@@ -15,7 +15,7 @@ export declare class VoiceCloningClient {
15
15
  *
16
16
  * Provide **exactly one** of:
17
17
  * - `voice_id` — a saved cloned voice from `POST /voices/create` (or Content Studio), or
18
- * - `ref_audio` — a reference audio clip uploaded with this request (optional `ref_text` transcript).
18
+ * - `ref_audio` — a reference audio clip uploaded with this request (`ref_text` has been deprecated).
19
19
  *
20
20
  * Sending both returns `400`. A saved `voice_id` avoids re-uploading the clip on every call.
21
21
  *
@@ -55,7 +55,7 @@ export declare class VoiceCloningClient {
55
55
  *
56
56
  * Provide **exactly one** of:
57
57
  * - `voice_id` — a saved cloned voice from `POST /voices/create` (or Content Studio), or
58
- * - `ref_audio` — a reference audio clip uploaded with this request (optional `ref_text` transcript).
58
+ * - `ref_audio` — a reference audio clip uploaded with this request (`ref_text` has been deprecated).
59
59
  *
60
60
  * Sending both returns `400`. `language_code` is optional — omit it to detect the language from `text`, or pass it when pronunciation has to be exact. The response is a binary audio stream (not JSON), so you can begin playback as soon as the first sentence is ready.
61
61
  *
@@ -60,7 +60,7 @@ class VoiceCloningClient {
60
60
  *
61
61
  * Provide **exactly one** of:
62
62
  * - `voice_id` — a saved cloned voice from `POST /voices/create` (or Content Studio), or
63
- * - `ref_audio` — a reference audio clip uploaded with this request (optional `ref_text` transcript).
63
+ * - `ref_audio` — a reference audio clip uploaded with this request (`ref_text` has been deprecated).
64
64
  *
65
65
  * Sending both returns `400`. A saved `voice_id` avoids re-uploading the clip on every call.
66
66
  *
@@ -202,7 +202,7 @@ class VoiceCloningClient {
202
202
  *
203
203
  * Provide **exactly one** of:
204
204
  * - `voice_id` — a saved cloned voice from `POST /voices/create` (or Content Studio), or
205
- * - `ref_audio` — a reference audio clip uploaded with this request (optional `ref_text` transcript).
205
+ * - `ref_audio` — a reference audio clip uploaded with this request (`ref_text` has been deprecated).
206
206
  *
207
207
  * Sending both returns `400`. `language_code` is optional — omit it to detect the language from `text`, or pass it when pronunciation has to be exact. The response is a binary audio stream (not JSON), so you can begin playback as soon as the first sentence is ready.
208
208
  *
@@ -16,7 +16,7 @@ export interface VoiceCloningRequest {
16
16
  * Limits: max file size 10 MB; max duration 15 seconds; single speaker. Exactly one of `ref_audio` or `voice_id` must be provided — sending both returns `400`.
17
17
  */
18
18
  ref_audio?: core.file.Uploadable | undefined;
19
- /** Optional transcript of `ref_audio` (max 500 characters). Improves fidelity when provided. Omit or leave empty to let the API transcribe the clip. Ignored when `voice_id` is used. */
19
+ /** Deprecated. No longer needed, since the API transcribes `ref_audio` automatically. */
20
20
  ref_text?: string;
21
21
  /** Text to synthesize in the cloned voice. Native scripts and code-mixed text are supported. Maximum 1000 characters; longer text is rejected with a 400. Split longer input client-side and synthesize it in parts. */
22
22
  text: string;
@@ -17,7 +17,7 @@ export interface VoiceCloningStreamRequest {
17
17
  * Limits: max file size 10 MB; max duration 15 seconds; single speaker. Exactly one of `ref_audio` or `voice_id` must be provided — sending both returns `400`.
18
18
  */
19
19
  ref_audio?: core.file.Uploadable | undefined;
20
- /** Optional transcript of `ref_audio` (max 500 characters). Improves fidelity when provided. Omit or leave empty to let the API transcribe the clip. Ignored when `voice_id` is used. */
20
+ /** Deprecated. No longer needed, since the API transcribes `ref_audio` automatically. */
21
21
  ref_text?: string;
22
22
  /** Text to synthesize in the cloned voice. Native scripts and code-mixed text are supported. Maximum 1000 characters; longer text is rejected with a 400. Split longer input client-side and synthesize it in parts. */
23
23
  text: string;
@@ -5,11 +5,16 @@
5
5
  *
6
6
  * **WebSocket close codes:**
7
7
  * - `1003`: Rate limit exceeded, quota exhausted, or invalid subscription key.
8
- * - `1008`: Inactivity timeout.
8
+ * - `1008`: Inactivity timeout (no audio received for 60 seconds).
9
9
  * - `1011`: Internal server error.
10
10
  * - `4000`: Application rejection (beta denied, invalid model, unsupported `language_code` / query param, gRPC backend unavailable). The close reason string is capped at 123 bytes.
11
11
  *
12
12
  * **Known error codes:**
13
+ * - `invalid_request` (fatal): A missing or invalid connection parameter (for example no `language_code`, an unsupported `sample_rate` or `encoding`, an out-of-range `threshold`, or `keyterms` on `saaras:v3-realtime`).
14
+ * - `invalid_model` (fatal): `model` is not `saaras:v4` or `saaras:v3-realtime`.
15
+ * - `invalid_subscription_key` (fatal): Missing or invalid API key (`status_code` 401).
16
+ * - `inactivity_timeout` (fatal): No audio received for 60 seconds (`status_code` 408).
17
+ * - `chunk_too_large` (non-fatal): One `audio_input` frame exceeds the per-frame cap (16,000 bytes on `stream_type` `fast`). The session stays open.
13
18
  * - `invalid_config` (non-fatal): A `config.update` value was rejected (e.g. changing `stream_type` to/from `simulated`). The session continues with the previous config.
14
19
  */
15
20
  export interface RealtimeError {
@@ -5,10 +5,11 @@ export interface SpeechToTextTranslateJobParameters {
5
5
  /**
6
6
  * Model to be used for speech to text translation.
7
7
  *
8
- * - **saaras:v2.5** (default): Translation model that translates audio from any spoken Indic language to English.
8
+ * - **saaras:v3** (default): Translation model that translates audio from any spoken Indic language to English.
9
9
  * - Example: Hindi audio → English text output
10
+ * - **saaras:v2.5**: Earlier translation model, kept for backward compatibility.
10
11
  *
11
- * For the latest model (saaras:v3), use the `/speech-to-text` endpoint with `mode="translate"`.
12
+ * `saaras:v4` is not supported on this endpoint. For the latest model (saaras:v4), use the `/speech-to-text` endpoint with `mode="translate"`.
12
13
  */
13
14
  model?: SarvamAI.SpeechToTextTranslateModel | undefined;
14
15
  /**
@@ -1,9 +1,14 @@
1
1
  /**
2
2
  * Model to be used for speech to text translation.
3
3
  *
4
- * - **saaras:v2.5** (default): Translation model that translates audio from any spoken Indic language to English.
4
+ * - **saaras:v3** (default): Translation model that translates audio from any spoken Indic language to English.
5
5
  * - Example: Hindi audio → English text output
6
+ * - **saaras:v2.5**: Earlier translation model, kept for backward compatibility.
6
7
  *
7
- * For the latest model (saaras:v3), use the `/speech-to-text` endpoint with `mode="translate"`.
8
+ * `saaras:v4` is not supported on this endpoint. For the latest model (saaras:v4), use the `/speech-to-text` endpoint with `mode="translate"`.
8
9
  */
9
- export type SpeechToTextTranslateModel = "saaras:v2.5";
10
+ export declare const SpeechToTextTranslateModel: {
11
+ readonly SaarasV3: "saaras:v3";
12
+ readonly SaarasV25: "saaras:v2.5";
13
+ };
14
+ export type SpeechToTextTranslateModel = (typeof SpeechToTextTranslateModel)[keyof typeof SpeechToTextTranslateModel];
@@ -1,3 +1,17 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SpeechToTextTranslateModel = void 0;
5
+ /**
6
+ * Model to be used for speech to text translation.
7
+ *
8
+ * - **saaras:v3** (default): Translation model that translates audio from any spoken Indic language to English.
9
+ * - Example: Hindi audio → English text output
10
+ * - **saaras:v2.5**: Earlier translation model, kept for backward compatibility.
11
+ *
12
+ * `saaras:v4` is not supported on this endpoint. For the latest model (saaras:v4), use the `/speech-to-text` endpoint with `mode="translate"`.
13
+ */
14
+ exports.SpeechToTextTranslateModel = {
15
+ SaarasV3: "saaras:v3",
16
+ SaarasV25: "saaras:v2.5",
17
+ };
@@ -3,7 +3,7 @@
3
3
  * Pass **exactly one** of `voice_id` (saved voice) or `ref_audio` (base64 reference clip).
4
4
  * `target_language_code` is optional: omit it to detect the language from the first
5
5
  * buffered text, then that language stays locked until the next config.
6
- * Optional `ref_text` improves fidelity when using `ref_audio`.
6
+ * `ref_text` has been deprecated.
7
7
  * Sending both `voice_id` and `ref_audio` returns an error. Duration bounds, QC, and VAD
8
8
  * are not accepted on this path.
9
9
  */
@@ -34,10 +34,7 @@ export declare namespace VoiceCloningConfigureConnection {
34
34
  * `voice_id` or `ref_audio` must be provided.
35
35
  */
36
36
  ref_audio?: string | undefined;
37
- /**
38
- * Optional transcript of `ref_audio` (max 500 characters). Improves fidelity.
39
- * Omit to let the API transcribe the clip. Ignored when `voice_id` is used.
40
- */
37
+ /** Deprecated. No longer needed, since the API transcribes `ref_audio` automatically. */
41
38
  ref_text?: string | undefined;
42
39
  /** Speech speed (0.5–2.0). 1.0 = natural speed. */
43
40
  pace?: number | undefined;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.1.19";
1
+ export declare const SDK_VERSION = "1.1.20";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.1.19";
4
+ exports.SDK_VERSION = "1.1.20";
@@ -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.19",
10
- "User-Agent": "sarvamai/1.1.19",
9
+ "X-Fern-SDK-Version": "1.1.20",
10
+ "User-Agent": "sarvamai/1.1.20",
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);
@@ -84,7 +84,8 @@ export declare class DocAiClient {
84
84
  * import { createReadStream } from "fs";
85
85
  * await client.docAi.extract({
86
86
  * schema: "{\"type\":\"object\",\"properties\":{\"policy_number\":{\"type\":\"string\",\"description\":\"Insurance policy number\"},\"insured_name\":{\"type\":\"string\",\"description\":\"Name of the insured person\"},\"sum_insured\":{\"type\":\"number\",\"description\":\"Total sum insured, in INR\"}}}",
87
- * output_format: "json"
87
+ * output_format: "json",
88
+ * mode: "basic"
88
89
  * })
89
90
  */
90
91
  extract(request: SarvamAI.DocAiExtractRequest, requestOptions?: DocAiClient.RequestOptions): core.HttpResponsePromise<SarvamAI.DocAiStartJobResponse>;
@@ -207,7 +207,8 @@ export class DocAiClient {
207
207
  * import { createReadStream } from "fs";
208
208
  * await client.docAi.extract({
209
209
  * schema: "{\"type\":\"object\",\"properties\":{\"policy_number\":{\"type\":\"string\",\"description\":\"Insurance policy number\"},\"insured_name\":{\"type\":\"string\",\"description\":\"Name of the insured person\"},\"sum_insured\":{\"type\":\"number\",\"description\":\"Total sum insured, in INR\"}}}",
210
- * output_format: "json"
210
+ * output_format: "json",
211
+ * mode: "basic"
211
212
  * })
212
213
  */
213
214
  extract(request, requestOptions) {
@@ -240,6 +241,9 @@ export class DocAiClient {
240
241
  if (request.model != null) {
241
242
  _body.append("model", request.model);
242
243
  }
244
+ if (request.mode != null) {
245
+ _body.append("mode", request.mode);
246
+ }
243
247
  const _maybeEncodedRequest = yield _body.getRequest();
244
248
  const _authRequest = yield this._options.authProvider.getAuthRequest();
245
249
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -3,7 +3,8 @@ import type * as core from "../../../../../core/index.mjs";
3
3
  * @example
4
4
  * {
5
5
  * schema: "{\"type\":\"object\",\"properties\":{\"policy_number\":{\"type\":\"string\",\"description\":\"Insurance policy number\"},\"insured_name\":{\"type\":\"string\",\"description\":\"Name of the insured person\"},\"sum_insured\":{\"type\":\"number\",\"description\":\"Total sum insured, in INR\"}}}",
6
- * output_format: "json"
6
+ * output_format: "json",
7
+ * mode: "basic"
7
8
  * }
8
9
  */
9
10
  export interface DocAiExtractRequest {
@@ -21,6 +22,8 @@ export interface DocAiExtractRequest {
21
22
  classification?: string;
22
23
  /** Model to use for extraction. */
23
24
  model?: string;
25
+ /** Extraction mode. `basic` reads each field on the page where it is printed; best for forms, IDs, and invoices at volume. `advanced` adds a second reading of the whole document to resolve context such as quarterly vs annual values and to check that line items add up to the total; best for financial statements, filings, slide decks, and long records. `advanced` takes longer and costs more per page. Both modes take the same schema and return the same response format. */
26
+ mode?: DocAiExtractRequest.Mode;
24
27
  }
25
28
  export declare namespace DocAiExtractRequest {
26
29
  /** Output format of the extraction results. */
@@ -30,4 +33,10 @@ export declare namespace DocAiExtractRequest {
30
33
  readonly Xlsx: "xlsx";
31
34
  };
32
35
  type OutputFormat = (typeof OutputFormat)[keyof typeof OutputFormat];
36
+ /** Extraction mode. `basic` reads each field on the page where it is printed; best for forms, IDs, and invoices at volume. `advanced` adds a second reading of the whole document to resolve context such as quarterly vs annual values and to check that line items add up to the total; best for financial statements, filings, slide decks, and long records. `advanced` takes longer and costs more per page. Both modes take the same schema and return the same response format. */
37
+ const Mode: {
38
+ readonly Basic: "basic";
39
+ readonly Advanced: "advanced";
40
+ };
41
+ type Mode = (typeof Mode)[keyof typeof Mode];
33
42
  }
@@ -7,4 +7,9 @@ export var DocAiExtractRequest;
7
7
  Csv: "csv",
8
8
  Xlsx: "xlsx",
9
9
  };
10
+ /** Extraction mode. `basic` reads each field on the page where it is printed; best for forms, IDs, and invoices at volume. `advanced` adds a second reading of the whole document to resolve context such as quarterly vs annual values and to check that line items add up to the total; best for financial statements, filings, slide decks, and long records. `advanced` takes longer and costs more per page. Both modes take the same schema and return the same response format. */
11
+ DocAiExtractRequest.Mode = {
12
+ Basic: "basic",
13
+ Advanced: "advanced",
14
+ };
10
15
  })(DocAiExtractRequest || (DocAiExtractRequest = {}));
@@ -17,10 +17,11 @@ export interface SpeechToTextTranslationRequest {
17
17
  /**
18
18
  * Model to be used for speech to text translation.
19
19
  *
20
- * - **saaras:v2.5** (default): Translation model that translates audio from any spoken Indic language to English.
20
+ * - **saaras:v3** (default): Translation model that translates audio from any spoken Indic language to English.
21
21
  * - Example: Hindi audio → English text output
22
+ * - **saaras:v2.5**: Earlier translation model, kept for backward compatibility.
22
23
  *
23
- * For the latest model (saaras:v3), use the `/speech-to-text` endpoint with `mode="translate"`.
24
+ * `saaras:v4` is not supported on this endpoint. For the latest model (saaras:v4), use the `/speech-to-text` endpoint with `mode="translate"`.
24
25
  */
25
26
  model?: SarvamAI.SpeechToTextTranslateModel;
26
27
  /** Audio codec/format of the input file. Our API automatically detects all codec formats, but for PCM files specifically (pcm_s16le, pcm_l16, pcm_raw), you must pass this parameter. PCM files are supported only at 16kHz sample rate. */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * BCP-47 language code of the input audio. **Required.**
3
3
  *
4
- * **Supported languages (saaras:v3-realtime and saaras:v4):**
4
+ * **Supported languages (saaras:v4 and saaras:v3-realtime):**
5
5
  * - `auto`: Adaptive automatic language detection
6
6
  * - `en-IN`: English
7
7
  * - `hi-IN`: Hindi
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * BCP-47 language code of the input audio. **Required.**
4
4
  *
5
- * **Supported languages (saaras:v3-realtime and saaras:v4):**
5
+ * **Supported languages (saaras:v4 and saaras:v3-realtime):**
6
6
  * - `auto`: Adaptive automatic language detection
7
7
  * - `en-IN`: English
8
8
  * - `hi-IN`: Hindi
@@ -1,6 +1,6 @@
1
- /** Speech-to-text model for this endpoint. `saaras:v3-realtime` (default) or `saaras:v4`. */
1
+ /** Speech-to-text model for this endpoint. `saaras:v4` (default) or `saaras:v3-realtime`. */
2
2
  export declare const SpeechToTextRealtimeStreamingModel: {
3
- readonly SaarasV3Realtime: "saaras:v3-realtime";
4
3
  readonly SaarasV4: "saaras:v4";
4
+ readonly SaarasV3Realtime: "saaras:v3-realtime";
5
5
  };
6
6
  export type SpeechToTextRealtimeStreamingModel = (typeof SpeechToTextRealtimeStreamingModel)[keyof typeof SpeechToTextRealtimeStreamingModel];
@@ -1,6 +1,6 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- /** Speech-to-text model for this endpoint. `saaras:v3-realtime` (default) or `saaras:v4`. */
2
+ /** Speech-to-text model for this endpoint. `saaras:v4` (default) or `saaras:v3-realtime`. */
3
3
  export const SpeechToTextRealtimeStreamingModel = {
4
- SaarasV3Realtime: "saaras:v3-realtime",
5
4
  SaarasV4: "saaras:v4",
5
+ SaarasV3Realtime: "saaras:v3-realtime",
6
6
  };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Model to be used for speech to text translation.
3
+ *
4
+ * - **saaras:v3** (default): Translation model that translates audio from any spoken Indic language to English.
5
+ * - Example: Hindi audio → English text output
6
+ * - **saaras:v2.5**: Earlier translation model, kept for backward compatibility.
7
+ *
8
+ * `saaras:v4` is not supported on this endpoint. For the latest model (saaras:v4), use the `/speech-to-text` endpoint with `mode="translate"`.
9
+ */
10
+ export declare const SpeechToTextTranslateStreamingModel: {
11
+ readonly SaarasV3: "saaras:v3";
12
+ readonly SaarasV25: "saaras:v2.5";
13
+ };
14
+ export type SpeechToTextTranslateStreamingModel = (typeof SpeechToTextTranslateStreamingModel)[keyof typeof SpeechToTextTranslateStreamingModel];
@@ -0,0 +1,14 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ /**
3
+ * Model to be used for speech to text translation.
4
+ *
5
+ * - **saaras:v3** (default): Translation model that translates audio from any spoken Indic language to English.
6
+ * - Example: Hindi audio → English text output
7
+ * - **saaras:v2.5**: Earlier translation model, kept for backward compatibility.
8
+ *
9
+ * `saaras:v4` is not supported on this endpoint. For the latest model (saaras:v4), use the `/speech-to-text` endpoint with `mode="translate"`.
10
+ */
11
+ export const SpeechToTextTranslateStreamingModel = {
12
+ SaarasV3: "saaras:v3",
13
+ SaarasV25: "saaras:v2.5",
14
+ };
@@ -1,4 +1,5 @@
1
1
  export * from "./SpeechToTextTranslateStreamingFlushSignal.mjs";
2
2
  export * from "./SpeechToTextTranslateStreamingHighVadSensitivity.mjs";
3
3
  export * from "./SpeechToTextTranslateStreamingInputAudioCodec.mjs";
4
+ export * from "./SpeechToTextTranslateStreamingModel.mjs";
4
5
  export * from "./SpeechToTextTranslateStreamingVadSignals.mjs";
@@ -1,4 +1,5 @@
1
1
  export * from "./SpeechToTextTranslateStreamingFlushSignal.mjs";
2
2
  export * from "./SpeechToTextTranslateStreamingHighVadSensitivity.mjs";
3
3
  export * from "./SpeechToTextTranslateStreamingInputAudioCodec.mjs";
4
+ export * from "./SpeechToTextTranslateStreamingModel.mjs";
4
5
  export * from "./SpeechToTextTranslateStreamingVadSignals.mjs";
@@ -15,7 +15,7 @@ export declare class VoiceCloningClient {
15
15
  *
16
16
  * Provide **exactly one** of:
17
17
  * - `voice_id` — a saved cloned voice from `POST /voices/create` (or Content Studio), or
18
- * - `ref_audio` — a reference audio clip uploaded with this request (optional `ref_text` transcript).
18
+ * - `ref_audio` — a reference audio clip uploaded with this request (`ref_text` has been deprecated).
19
19
  *
20
20
  * Sending both returns `400`. A saved `voice_id` avoids re-uploading the clip on every call.
21
21
  *
@@ -55,7 +55,7 @@ export declare class VoiceCloningClient {
55
55
  *
56
56
  * Provide **exactly one** of:
57
57
  * - `voice_id` — a saved cloned voice from `POST /voices/create` (or Content Studio), or
58
- * - `ref_audio` — a reference audio clip uploaded with this request (optional `ref_text` transcript).
58
+ * - `ref_audio` — a reference audio clip uploaded with this request (`ref_text` has been deprecated).
59
59
  *
60
60
  * Sending both returns `400`. `language_code` is optional — omit it to detect the language from `text`, or pass it when pronunciation has to be exact. The response is a binary audio stream (not JSON), so you can begin playback as soon as the first sentence is ready.
61
61
  *
@@ -24,7 +24,7 @@ export class VoiceCloningClient {
24
24
  *
25
25
  * Provide **exactly one** of:
26
26
  * - `voice_id` — a saved cloned voice from `POST /voices/create` (or Content Studio), or
27
- * - `ref_audio` — a reference audio clip uploaded with this request (optional `ref_text` transcript).
27
+ * - `ref_audio` — a reference audio clip uploaded with this request (`ref_text` has been deprecated).
28
28
  *
29
29
  * Sending both returns `400`. A saved `voice_id` avoids re-uploading the clip on every call.
30
30
  *
@@ -166,7 +166,7 @@ export class VoiceCloningClient {
166
166
  *
167
167
  * Provide **exactly one** of:
168
168
  * - `voice_id` — a saved cloned voice from `POST /voices/create` (or Content Studio), or
169
- * - `ref_audio` — a reference audio clip uploaded with this request (optional `ref_text` transcript).
169
+ * - `ref_audio` — a reference audio clip uploaded with this request (`ref_text` has been deprecated).
170
170
  *
171
171
  * Sending both returns `400`. `language_code` is optional — omit it to detect the language from `text`, or pass it when pronunciation has to be exact. The response is a binary audio stream (not JSON), so you can begin playback as soon as the first sentence is ready.
172
172
  *
@@ -16,7 +16,7 @@ export interface VoiceCloningRequest {
16
16
  * Limits: max file size 10 MB; max duration 15 seconds; single speaker. Exactly one of `ref_audio` or `voice_id` must be provided — sending both returns `400`.
17
17
  */
18
18
  ref_audio?: core.file.Uploadable | undefined;
19
- /** Optional transcript of `ref_audio` (max 500 characters). Improves fidelity when provided. Omit or leave empty to let the API transcribe the clip. Ignored when `voice_id` is used. */
19
+ /** Deprecated. No longer needed, since the API transcribes `ref_audio` automatically. */
20
20
  ref_text?: string;
21
21
  /** Text to synthesize in the cloned voice. Native scripts and code-mixed text are supported. Maximum 1000 characters; longer text is rejected with a 400. Split longer input client-side and synthesize it in parts. */
22
22
  text: string;
@@ -17,7 +17,7 @@ export interface VoiceCloningStreamRequest {
17
17
  * Limits: max file size 10 MB; max duration 15 seconds; single speaker. Exactly one of `ref_audio` or `voice_id` must be provided — sending both returns `400`.
18
18
  */
19
19
  ref_audio?: core.file.Uploadable | undefined;
20
- /** Optional transcript of `ref_audio` (max 500 characters). Improves fidelity when provided. Omit or leave empty to let the API transcribe the clip. Ignored when `voice_id` is used. */
20
+ /** Deprecated. No longer needed, since the API transcribes `ref_audio` automatically. */
21
21
  ref_text?: string;
22
22
  /** Text to synthesize in the cloned voice. Native scripts and code-mixed text are supported. Maximum 1000 characters; longer text is rejected with a 400. Split longer input client-side and synthesize it in parts. */
23
23
  text: string;
@@ -5,11 +5,16 @@
5
5
  *
6
6
  * **WebSocket close codes:**
7
7
  * - `1003`: Rate limit exceeded, quota exhausted, or invalid subscription key.
8
- * - `1008`: Inactivity timeout.
8
+ * - `1008`: Inactivity timeout (no audio received for 60 seconds).
9
9
  * - `1011`: Internal server error.
10
10
  * - `4000`: Application rejection (beta denied, invalid model, unsupported `language_code` / query param, gRPC backend unavailable). The close reason string is capped at 123 bytes.
11
11
  *
12
12
  * **Known error codes:**
13
+ * - `invalid_request` (fatal): A missing or invalid connection parameter (for example no `language_code`, an unsupported `sample_rate` or `encoding`, an out-of-range `threshold`, or `keyterms` on `saaras:v3-realtime`).
14
+ * - `invalid_model` (fatal): `model` is not `saaras:v4` or `saaras:v3-realtime`.
15
+ * - `invalid_subscription_key` (fatal): Missing or invalid API key (`status_code` 401).
16
+ * - `inactivity_timeout` (fatal): No audio received for 60 seconds (`status_code` 408).
17
+ * - `chunk_too_large` (non-fatal): One `audio_input` frame exceeds the per-frame cap (16,000 bytes on `stream_type` `fast`). The session stays open.
13
18
  * - `invalid_config` (non-fatal): A `config.update` value was rejected (e.g. changing `stream_type` to/from `simulated`). The session continues with the previous config.
14
19
  */
15
20
  export interface RealtimeError {
@@ -5,10 +5,11 @@ export interface SpeechToTextTranslateJobParameters {
5
5
  /**
6
6
  * Model to be used for speech to text translation.
7
7
  *
8
- * - **saaras:v2.5** (default): Translation model that translates audio from any spoken Indic language to English.
8
+ * - **saaras:v3** (default): Translation model that translates audio from any spoken Indic language to English.
9
9
  * - Example: Hindi audio → English text output
10
+ * - **saaras:v2.5**: Earlier translation model, kept for backward compatibility.
10
11
  *
11
- * For the latest model (saaras:v3), use the `/speech-to-text` endpoint with `mode="translate"`.
12
+ * `saaras:v4` is not supported on this endpoint. For the latest model (saaras:v4), use the `/speech-to-text` endpoint with `mode="translate"`.
12
13
  */
13
14
  model?: SarvamAI.SpeechToTextTranslateModel | undefined;
14
15
  /**
@@ -1,9 +1,14 @@
1
1
  /**
2
2
  * Model to be used for speech to text translation.
3
3
  *
4
- * - **saaras:v2.5** (default): Translation model that translates audio from any spoken Indic language to English.
4
+ * - **saaras:v3** (default): Translation model that translates audio from any spoken Indic language to English.
5
5
  * - Example: Hindi audio → English text output
6
+ * - **saaras:v2.5**: Earlier translation model, kept for backward compatibility.
6
7
  *
7
- * For the latest model (saaras:v3), use the `/speech-to-text` endpoint with `mode="translate"`.
8
+ * `saaras:v4` is not supported on this endpoint. For the latest model (saaras:v4), use the `/speech-to-text` endpoint with `mode="translate"`.
8
9
  */
9
- export type SpeechToTextTranslateModel = "saaras:v2.5";
10
+ export declare const SpeechToTextTranslateModel: {
11
+ readonly SaarasV3: "saaras:v3";
12
+ readonly SaarasV25: "saaras:v2.5";
13
+ };
14
+ export type SpeechToTextTranslateModel = (typeof SpeechToTextTranslateModel)[keyof typeof SpeechToTextTranslateModel];
@@ -1,2 +1,14 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export {};
2
+ /**
3
+ * Model to be used for speech to text translation.
4
+ *
5
+ * - **saaras:v3** (default): Translation model that translates audio from any spoken Indic language to English.
6
+ * - Example: Hindi audio → English text output
7
+ * - **saaras:v2.5**: Earlier translation model, kept for backward compatibility.
8
+ *
9
+ * `saaras:v4` is not supported on this endpoint. For the latest model (saaras:v4), use the `/speech-to-text` endpoint with `mode="translate"`.
10
+ */
11
+ export const SpeechToTextTranslateModel = {
12
+ SaarasV3: "saaras:v3",
13
+ SaarasV25: "saaras:v2.5",
14
+ };
@@ -3,7 +3,7 @@
3
3
  * Pass **exactly one** of `voice_id` (saved voice) or `ref_audio` (base64 reference clip).
4
4
  * `target_language_code` is optional: omit it to detect the language from the first
5
5
  * buffered text, then that language stays locked until the next config.
6
- * Optional `ref_text` improves fidelity when using `ref_audio`.
6
+ * `ref_text` has been deprecated.
7
7
  * Sending both `voice_id` and `ref_audio` returns an error. Duration bounds, QC, and VAD
8
8
  * are not accepted on this path.
9
9
  */
@@ -34,10 +34,7 @@ export declare namespace VoiceCloningConfigureConnection {
34
34
  * `voice_id` or `ref_audio` must be provided.
35
35
  */
36
36
  ref_audio?: string | undefined;
37
- /**
38
- * Optional transcript of `ref_audio` (max 500 characters). Improves fidelity.
39
- * Omit to let the API transcribe the clip. Ignored when `voice_id` is used.
40
- */
37
+ /** Deprecated. No longer needed, since the API transcribes `ref_audio` automatically. */
41
38
  ref_text?: string | undefined;
42
39
  /** Speech speed (0.5–2.0). 1.0 = natural speed. */
43
40
  pace?: number | undefined;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.1.19";
1
+ export declare const SDK_VERSION = "1.1.20";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.1.19";
1
+ export const SDK_VERSION = "1.1.20";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sarvamai",
3
- "version": "1.1.19",
3
+ "version": "1.1.20",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -1253,7 +1253,7 @@ await client.textToSpeech.convertStream({
1253
1253
 
1254
1254
  Provide **exactly one** of:
1255
1255
  - `voice_id` — a saved cloned voice from `POST /voices/create` (or Content Studio), or
1256
- - `ref_audio` — a reference audio clip uploaded with this request (optional `ref_text` transcript).
1256
+ - `ref_audio` — a reference audio clip uploaded with this request (`ref_text` has been deprecated).
1257
1257
 
1258
1258
  Sending both returns `400`. A saved `voice_id` avoids re-uploading the clip on every call.
1259
1259
 
@@ -1334,7 +1334,7 @@ await client.voiceCloning.convert({
1334
1334
 
1335
1335
  Provide **exactly one** of:
1336
1336
  - `voice_id` — a saved cloned voice from `POST /voices/create` (or Content Studio), or
1337
- - `ref_audio` — a reference audio clip uploaded with this request (optional `ref_text` transcript).
1337
+ - `ref_audio` — a reference audio clip uploaded with this request (`ref_text` has been deprecated).
1338
1338
 
1339
1339
  Sending both returns `400`. `language_code` is optional — omit it to detect the language from `text`, or pass it when pronunciation has to be exact. The response is a binary audio stream (not JSON), so you can begin playback as soon as the first sentence is ready.
1340
1340
 
@@ -3494,7 +3494,8 @@ Extract results include `result`, plus `annotations` mirroring the result shape
3494
3494
  ```typescript
3495
3495
  await client.docAi.extract({
3496
3496
  schema: "{\"type\":\"object\",\"properties\":{\"policy_number\":{\"type\":\"string\",\"description\":\"Insurance policy number\"},\"insured_name\":{\"type\":\"string\",\"description\":\"Name of the insured person\"},\"sum_insured\":{\"type\":\"number\",\"description\":\"Total sum insured, in INR\"}}}",
3497
- output_format: "json"
3497
+ output_format: "json",
3498
+ mode: "basic"
3498
3499
  });
3499
3500
 
3500
3501
  ```