sarvamai 0.1.2 → 0.1.4-a0

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 (57) hide show
  1. package/README.md +1 -1
  2. package/api/resources/chat/client/Client.js +1 -1
  3. package/api/resources/speechToText/client/Client.js +2 -2
  4. package/api/resources/text/client/Client.d.ts +18 -4
  5. package/api/resources/text/client/Client.js +21 -7
  6. package/api/resources/text/client/requests/TranslationRequest.d.ts +33 -20
  7. package/api/resources/text/client/requests/TransliterationRequest.d.ts +1 -1
  8. package/api/resources/textToSpeech/client/Client.js +1 -1
  9. package/api/types/SpeechToTextModel.d.ts +2 -1
  10. package/api/types/SpeechToTextModel.js +1 -0
  11. package/api/types/SpeechToTextTranslateModel.d.ts +2 -2
  12. package/api/types/SpeechToTextTranslateModel.js +1 -1
  13. package/api/types/TranslateModel.d.ts +5 -1
  14. package/api/types/TranslateModel.js +5 -0
  15. package/api/types/TranslateSourceLanguage.d.ts +15 -3
  16. package/api/types/TranslateSourceLanguage.js +14 -2
  17. package/api/types/TranslateTargetLanguage.d.ts +15 -3
  18. package/api/types/TranslateTargetLanguage.js +14 -2
  19. package/api/types/TranslatiterateTargetLanguage.d.ts +3 -3
  20. package/api/types/TranslatiterateTargetLanguage.js +2 -2
  21. package/api/types/{TranslatePostprocessing.d.ts → TransliterateMode.d.ts} +2 -2
  22. package/api/types/{TranslatePostprocessing.js → TransliterateMode.js} +2 -2
  23. package/api/types/TransliterateSourceLanguage.d.ts +3 -3
  24. package/api/types/TransliterateSourceLanguage.js +2 -2
  25. package/api/types/index.d.ts +1 -1
  26. package/api/types/index.js +1 -1
  27. package/dist/api/resources/chat/client/Client.js +1 -1
  28. package/dist/api/resources/speechToText/client/Client.js +2 -2
  29. package/dist/api/resources/text/client/Client.d.ts +18 -4
  30. package/dist/api/resources/text/client/Client.js +21 -7
  31. package/dist/api/resources/text/client/requests/TranslationRequest.d.ts +33 -20
  32. package/dist/api/resources/text/client/requests/TransliterationRequest.d.ts +1 -1
  33. package/dist/api/resources/textToSpeech/client/Client.js +1 -1
  34. package/dist/api/types/SpeechToTextModel.d.ts +2 -1
  35. package/dist/api/types/SpeechToTextModel.js +1 -0
  36. package/dist/api/types/SpeechToTextTranslateModel.d.ts +2 -2
  37. package/dist/api/types/SpeechToTextTranslateModel.js +1 -1
  38. package/dist/api/types/TranslateModel.d.ts +5 -1
  39. package/dist/api/types/TranslateModel.js +5 -0
  40. package/dist/api/types/TranslateSourceLanguage.d.ts +15 -3
  41. package/dist/api/types/TranslateSourceLanguage.js +14 -2
  42. package/dist/api/types/TranslateTargetLanguage.d.ts +15 -3
  43. package/dist/api/types/TranslateTargetLanguage.js +14 -2
  44. package/dist/api/types/TranslatiterateTargetLanguage.d.ts +3 -3
  45. package/dist/api/types/TranslatiterateTargetLanguage.js +2 -2
  46. package/dist/api/types/{TranslatePostprocessing.d.ts → TransliterateMode.d.ts} +2 -2
  47. package/dist/api/types/{TranslatePostprocessing.js → TransliterateMode.js} +2 -2
  48. package/dist/api/types/TransliterateSourceLanguage.d.ts +3 -3
  49. package/dist/api/types/TransliterateSourceLanguage.js +2 -2
  50. package/dist/api/types/index.d.ts +1 -1
  51. package/dist/api/types/index.js +1 -1
  52. package/dist/version.d.ts +1 -1
  53. package/dist/version.js +1 -1
  54. package/package.json +1 -1
  55. package/reference.md +19 -4
  56. package/version.d.ts +1 -1
  57. package/version.js +1 -1
package/README.md CHANGED
@@ -30,7 +30,7 @@ const client = new SarvamAIClient({ apiSubscriptionKey: "YOUR_API_SUBSCRIPTION_K
30
30
  await client.text.translate({
31
31
  input: "input",
32
32
  source_language_code: "auto",
33
- target_language_code: "en-IN",
33
+ target_language_code: "bn-IN",
34
34
  });
35
35
  ```
36
36
 
@@ -85,7 +85,7 @@ class Chat {
85
85
  const _response = yield core.fetcher({
86
86
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SarvamAIEnvironment.Production, "v1/chat/completions"),
87
87
  method: "POST",
88
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "sarvamai/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
88
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.4a0", "User-Agent": "sarvamai/0.1.4a0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
89
89
  contentType: "application/json",
90
90
  requestType: "json",
91
91
  body: Object.assign(Object.assign({}, request), { model: "sarvam-m" }),
@@ -102,7 +102,7 @@ class SpeechToText {
102
102
  const _response = yield core.fetcher({
103
103
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SarvamAIEnvironment.Production, "speech-to-text"),
104
104
  method: "POST",
105
- headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "sarvamai/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
105
+ headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.4a0", "User-Agent": "sarvamai/0.1.4a0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
106
106
  requestType: "file",
107
107
  duplex: _maybeEncodedRequest.duplex,
108
108
  body: _maybeEncodedRequest.body,
@@ -193,7 +193,7 @@ class SpeechToText {
193
193
  const _response = yield core.fetcher({
194
194
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SarvamAIEnvironment.Production, "speech-to-text-translate"),
195
195
  method: "POST",
196
- headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "sarvamai/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
196
+ headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.4a0", "User-Agent": "sarvamai/0.1.4a0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
197
197
  requestType: "file",
198
198
  duplex: _maybeEncodedRequest.duplex,
199
199
  body: _maybeEncodedRequest.body,
@@ -30,10 +30,10 @@ export declare class Text {
30
30
  * For Example: **'मैं ऑफिस जा रहा हूँ'** translates to **'I am going to the office'** in English, where the script and language change, but the original meaning remains the same.
31
31
  *
32
32
  * Available languages:
33
- * - **`en-IN`**: English
34
- * - **`hi-IN`**: Hindi
35
33
  * - **`bn-IN`**: Bengali
34
+ * - **`en-IN`**: English
36
35
  * - **`gu-IN`**: Gujarati
36
+ * - **`hi-IN`**: Hindi
37
37
  * - **`kn-IN`**: Kannada
38
38
  * - **`ml-IN`**: Malayalam
39
39
  * - **`mr-IN`**: Marathi
@@ -42,6 +42,20 @@ export declare class Text {
42
42
  * - **`ta-IN`**: Tamil
43
43
  * - **`te-IN`**: Telugu
44
44
  *
45
+ * ### Newly added languages:
46
+ * - **`as-IN`**: Assamese
47
+ * - **`brx-IN`**: Bodo
48
+ * - **`doi-IN`**: Dogri
49
+ * - **`kok-IN`**: Konkani
50
+ * - **`ks-IN`**: Kashmiri
51
+ * - **`mai-IN`**: Maithili
52
+ * - **`mni-IN`**: Manipuri (Meiteilon)
53
+ * - **`ne-IN`**: Nepali
54
+ * - **`sa-IN`**: Sanskrit
55
+ * - **`sat-IN`**: Santali
56
+ * - **`sd-IN`**: Sindhi
57
+ * - **`ur-IN`**: Urdu
58
+ *
45
59
  * For hands-on practice, you can explore the notebook tutorial on [Translate API Tutorial](https://github.com/sarvamai/sarvam-ai-cookbook/blob/main/notebooks/translate/Translate_API_Tutorial.ipynb).
46
60
  *
47
61
  * @param {SarvamAI.TranslationRequest} request
@@ -57,7 +71,7 @@ export declare class Text {
57
71
  * await client.text.translate({
58
72
  * input: "input",
59
73
  * source_language_code: "auto",
60
- * target_language_code: "en-IN"
74
+ * target_language_code: "bn-IN"
61
75
  * })
62
76
  */
63
77
  translate(request: SarvamAI.TranslationRequest, requestOptions?: Text.RequestOptions): Promise<SarvamAI.TranslationResponse>;
@@ -117,7 +131,7 @@ export declare class Text {
117
131
  * await client.text.transliterate({
118
132
  * input: "input",
119
133
  * source_language_code: "auto",
120
- * target_language_code: "en-IN"
134
+ * target_language_code: "bn-IN"
121
135
  * })
122
136
  */
123
137
  transliterate(request: SarvamAI.TransliterationRequest, requestOptions?: Text.RequestOptions): Promise<SarvamAI.TransliterationResponse>;
@@ -63,10 +63,10 @@ class Text {
63
63
  * For Example: **'मैं ऑफिस जा रहा हूँ'** translates to **'I am going to the office'** in English, where the script and language change, but the original meaning remains the same.
64
64
  *
65
65
  * Available languages:
66
- * - **`en-IN`**: English
67
- * - **`hi-IN`**: Hindi
68
66
  * - **`bn-IN`**: Bengali
67
+ * - **`en-IN`**: English
69
68
  * - **`gu-IN`**: Gujarati
69
+ * - **`hi-IN`**: Hindi
70
70
  * - **`kn-IN`**: Kannada
71
71
  * - **`ml-IN`**: Malayalam
72
72
  * - **`mr-IN`**: Marathi
@@ -75,6 +75,20 @@ class Text {
75
75
  * - **`ta-IN`**: Tamil
76
76
  * - **`te-IN`**: Telugu
77
77
  *
78
+ * ### Newly added languages:
79
+ * - **`as-IN`**: Assamese
80
+ * - **`brx-IN`**: Bodo
81
+ * - **`doi-IN`**: Dogri
82
+ * - **`kok-IN`**: Konkani
83
+ * - **`ks-IN`**: Kashmiri
84
+ * - **`mai-IN`**: Maithili
85
+ * - **`mni-IN`**: Manipuri (Meiteilon)
86
+ * - **`ne-IN`**: Nepali
87
+ * - **`sa-IN`**: Sanskrit
88
+ * - **`sat-IN`**: Santali
89
+ * - **`sd-IN`**: Sindhi
90
+ * - **`ur-IN`**: Urdu
91
+ *
78
92
  * For hands-on practice, you can explore the notebook tutorial on [Translate API Tutorial](https://github.com/sarvamai/sarvam-ai-cookbook/blob/main/notebooks/translate/Translate_API_Tutorial.ipynb).
79
93
  *
80
94
  * @param {SarvamAI.TranslationRequest} request
@@ -90,7 +104,7 @@ class Text {
90
104
  * await client.text.translate({
91
105
  * input: "input",
92
106
  * source_language_code: "auto",
93
- * target_language_code: "en-IN"
107
+ * target_language_code: "bn-IN"
94
108
  * })
95
109
  */
96
110
  translate(request, requestOptions) {
@@ -99,7 +113,7 @@ class Text {
99
113
  const _response = yield core.fetcher({
100
114
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SarvamAIEnvironment.Production, "translate"),
101
115
  method: "POST",
102
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "sarvamai/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
116
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.4a0", "User-Agent": "sarvamai/0.1.4a0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
103
117
  contentType: "application/json",
104
118
  requestType: "json",
105
119
  body: request,
@@ -167,7 +181,7 @@ class Text {
167
181
  const _response = yield core.fetcher({
168
182
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SarvamAIEnvironment.Production, "text-lid"),
169
183
  method: "POST",
170
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "sarvamai/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
184
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.4a0", "User-Agent": "sarvamai/0.1.4a0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
171
185
  contentType: "application/json",
172
186
  requestType: "json",
173
187
  body: request,
@@ -250,7 +264,7 @@ class Text {
250
264
  * await client.text.transliterate({
251
265
  * input: "input",
252
266
  * source_language_code: "auto",
253
- * target_language_code: "en-IN"
267
+ * target_language_code: "bn-IN"
254
268
  * })
255
269
  */
256
270
  transliterate(request, requestOptions) {
@@ -259,7 +273,7 @@ class Text {
259
273
  const _response = yield core.fetcher({
260
274
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SarvamAIEnvironment.Production, "transliterate"),
261
275
  method: "POST",
262
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "sarvamai/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
276
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.4a0", "User-Agent": "sarvamai/0.1.4a0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
263
277
  contentType: "application/json",
264
278
  requestType: "json",
265
279
  body: request,
@@ -7,64 +7,77 @@ import * as SarvamAI from "../../../../index";
7
7
  * {
8
8
  * input: "input",
9
9
  * source_language_code: "auto",
10
- * target_language_code: "en-IN"
10
+ * target_language_code: "bn-IN"
11
11
  * }
12
12
  */
13
13
  export interface TranslationRequest {
14
- /** The text you want to translate. This is the input text that will be processed by the translation model. */
14
+ /** The text you want to translate is the input text that will be processed by the translation model. The maximum is 1000 characters for Mayura:v1 and 2000 characters for Sarvam-Translate:v1. */
15
15
  input: string;
16
16
  /**
17
- * The language code of the input text. This specifies the source language for translation.
17
+ * Source language code for translation input.
18
18
  *
19
+ * **mayura:v1 Languages:** Bengali, English, Gujarati, Hindi, Kannada, Malayalam, Marathi, Odia, Punjabi, Tamil, Telugu
19
20
  *
21
+ * **sarvam-translate:v1 Languages:** All mayura:v1 languages and Assamese, Bodo, Dogri, Konkani, Kashmiri, Maithili, Manipuri, Nepali, Sanskrit, Santali, Sindhi, Urdu
20
22
  *
21
- * Note: The source language should either be an Indic language or English. As we supports both Indic-to-English and English-to-Indic translation.
23
+ * **Note:** mayura:v1 supports automatic language detection using 'auto' as the source language code.
22
24
  *
23
25
  */
24
26
  source_language_code: SarvamAI.TranslateSourceLanguage;
25
27
  /**
26
28
  * The language code of the translated text. This specifies the target language for translation.
27
29
  *
30
+ * **mayura:v1 Languages:** Bengali, English, Gujarati, Hindi, Kannada, Malayalam, Marathi, Odia, Punjabi, Tamil, Telugu
28
31
  *
29
- *
30
- * Note:The target language should either be an Indic language or English. As we supports both Indic-to-English and English-to-Indic translation.
32
+ * **sarvam-translate:v1 Languages:** All mayura:v1 and Assamese, Bodo, Dogri, Konkani, Kashmiri, Maithili, Manipuri, Nepali, Sanskrit, Santali, Sindhi, Urdu
31
33
  *
32
34
  */
33
35
  target_language_code: SarvamAI.TranslateTargetLanguage;
34
- /** Please specify the gender of the speaker for better translations. This feature is only supported for the code-mixed translation models currently. */
36
+ /** Please specify the gender of the speaker for better translations. */
35
37
  speaker_gender?: SarvamAI.TranslateSpeakerGender;
36
- /** Specifies the tone or style of the translation. Choose between formal, classic-colloquial and modern-colloquial translations. Default is formal. */
38
+ /**
39
+ * Specifies the tone or style of the translation.
40
+ *
41
+ * **Model Support:**
42
+ * - **mayura:v1**: Supports formal, classic-colloquial, and modern-colloquial modes
43
+ * - **sarvam-translate:v1**: Only formal mode is supported
44
+ *
45
+ * **Default:** formal
46
+ */
37
47
  mode?: SarvamAI.TranslateMode;
38
- /** Specifies the translation model to use. Currently, only one model is supported.Note:- This parameter is optional but will be deprecated by the end of January; avoid including it in your requests. */
48
+ /**
49
+ * Specifies the translation model to use.
50
+ * - mayura:v1: Supports 12 languages with all modes, output scripts, and automatic language detection.
51
+ * - sarvam-translate:v1: Supports all 22 scheduled languages of India, formal mode only.
52
+ */
39
53
  model?: SarvamAI.TranslateModel;
40
- /** This will enable custom preprocessing of the input text which can result in better translations. */
54
+ /**
55
+ * This will enable custom preprocessing of the input text which can result in better translations.
56
+ * Recommendation- You can switch on whenever there is some complex text with difficult vocabulary and sentences, for which you want simple translations that people can understand.
57
+ */
41
58
  enable_preprocessing?: boolean;
42
59
  /**
43
60
  * **output_script**: This is an optional parameter which controls the transliteration style applied to the output text.
44
61
  *
45
62
  * **Transliteration**: Converting text from one script to another while preserving pronunciation.
46
63
  *
47
- *
48
- *
49
- * We support transliteration with four options:
50
- *
64
+ * For mayura:v1 - We support transliteration with four options:
51
65
  * - **`null`**(default): No transliteration applied.
52
- *
53
66
  * - **`roman`**: Transliteration in Romanized script.
54
67
  * - **`fully-native`**: Transliteration in the native script with formal style.
55
68
  * - **`spoken-form-in-native`**: Transliteration in the native script with spoken style.
69
+ *
70
+ * For sarvam-translate:v1 - Transliteration is not supported.
56
71
  * ### Example:
57
72
  * English: Your EMI of Rs. 3000 is pending.
58
73
  * Default modern translation: आपका Rs. 3000 का EMI pending है (when `null` is passed).
59
74
  *
60
- * With postprocessing enabled, we provide the following style of outputs:
75
+ * With postprocessing enabled:
61
76
  * - **roman output**: aapka Rs. 3000 ka EMI pending hai.
62
- * - **fully-native output**: आपका रु. 3000 का ई.एम.ऐ. पेंडिंग है।
63
- * - **spoken-form-in-native output**: आपका थ्री थाउजेंड रूपीस का ईएमअइ पेंडिंग है।
64
77
  */
65
- output_script?: SarvamAI.TranslatePostprocessing;
78
+ output_script?: SarvamAI.TransliterateMode;
66
79
  /**
67
- * `numerals_format` is an optional parameter with two options:
80
+ * `numerals_format` is an optional parameter with two options (supported for both mayura:v1 and sarvam-translate:v1):
68
81
  *
69
82
  * - **`international`** (default): Uses regular numerals (0-9).
70
83
  * - **`native`**: Uses language-specific native numerals.
@@ -7,7 +7,7 @@ import * as SarvamAI from "../../../../index";
7
7
  * {
8
8
  * input: "input",
9
9
  * source_language_code: "auto",
10
- * target_language_code: "en-IN"
10
+ * target_language_code: "bn-IN"
11
11
  * }
12
12
  */
13
13
  export interface TransliterationRequest {
@@ -83,7 +83,7 @@ class TextToSpeech {
83
83
  const _response = yield core.fetcher({
84
84
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SarvamAIEnvironment.Production, "text-to-speech"),
85
85
  method: "POST",
86
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "sarvamai/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
86
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.4a0", "User-Agent": "sarvamai/0.1.4a0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
87
  contentType: "application/json",
88
88
  requestType: "json",
89
89
  body: request,
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type SpeechToTextModel = "saarika:v1" | "saarika:v2" | "saarika:flash";
4
+ export type SpeechToTextModel = "saarika:v1" | "saarika:v2" | "saarika:v2.5" | "saarika:flash";
5
5
  export declare const SpeechToTextModel: {
6
6
  readonly SaarikaV1: "saarika:v1";
7
7
  readonly SaarikaV2: "saarika:v2";
8
+ readonly SaarikaV25: "saarika:v2.5";
8
9
  readonly SaarikaFlash: "saarika:flash";
9
10
  };
@@ -7,5 +7,6 @@ exports.SpeechToTextModel = void 0;
7
7
  exports.SpeechToTextModel = {
8
8
  SaarikaV1: "saarika:v1",
9
9
  SaarikaV2: "saarika:v2",
10
+ SaarikaV25: "saarika:v2.5",
10
11
  SaarikaFlash: "saarika:flash",
11
12
  };
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type SpeechToTextTranslateModel = "saaras:v1" | "saaras:v2" | "saaras:turbo" | "saaras:flash";
4
+ export type SpeechToTextTranslateModel = "saaras:v1" | "saaras:v2" | "saaras:v2.5" | "saaras:flash";
5
5
  export declare const SpeechToTextTranslateModel: {
6
6
  readonly SaarasV1: "saaras:v1";
7
7
  readonly SaarasV2: "saaras:v2";
8
- readonly SaarasTurbo: "saaras:turbo";
8
+ readonly SaarasV25: "saaras:v2.5";
9
9
  readonly SaarasFlash: "saaras:flash";
10
10
  };
@@ -7,6 +7,6 @@ exports.SpeechToTextTranslateModel = void 0;
7
7
  exports.SpeechToTextTranslateModel = {
8
8
  SaarasV1: "saaras:v1",
9
9
  SaarasV2: "saaras:v2",
10
- SaarasTurbo: "saaras:turbo",
10
+ SaarasV25: "saaras:v2.5",
11
11
  SaarasFlash: "saaras:flash",
12
12
  };
@@ -1,4 +1,8 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type TranslateModel = "mayura:v1";
4
+ export type TranslateModel = "mayura:v1" | "sarvam-translate:v1";
5
+ export declare const TranslateModel: {
6
+ readonly MayuraV1: "mayura:v1";
7
+ readonly SarvamTranslateV1: "sarvam-translate:v1";
8
+ };
@@ -3,3 +3,8 @@
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TranslateModel = void 0;
7
+ exports.TranslateModel = {
8
+ MayuraV1: "mayura:v1",
9
+ SarvamTranslateV1: "sarvam-translate:v1",
10
+ };
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type TranslateSourceLanguage = "auto" | "en-IN" | "hi-IN" | "bn-IN" | "gu-IN" | "kn-IN" | "ml-IN" | "mr-IN" | "od-IN" | "pa-IN" | "ta-IN" | "te-IN";
4
+ export type TranslateSourceLanguage = "auto" | "bn-IN" | "en-IN" | "gu-IN" | "hi-IN" | "kn-IN" | "ml-IN" | "mr-IN" | "od-IN" | "pa-IN" | "ta-IN" | "te-IN" | "as-IN" | "brx-IN" | "doi-IN" | "kok-IN" | "ks-IN" | "mai-IN" | "mni-IN" | "ne-IN" | "sa-IN" | "sat-IN" | "sd-IN" | "ur-IN";
5
5
  export declare const TranslateSourceLanguage: {
6
6
  readonly Auto: "auto";
7
- readonly EnIn: "en-IN";
8
- readonly HiIn: "hi-IN";
9
7
  readonly BnIn: "bn-IN";
8
+ readonly EnIn: "en-IN";
10
9
  readonly GuIn: "gu-IN";
10
+ readonly HiIn: "hi-IN";
11
11
  readonly KnIn: "kn-IN";
12
12
  readonly MlIn: "ml-IN";
13
13
  readonly MrIn: "mr-IN";
@@ -15,4 +15,16 @@ export declare const TranslateSourceLanguage: {
15
15
  readonly PaIn: "pa-IN";
16
16
  readonly TaIn: "ta-IN";
17
17
  readonly TeIn: "te-IN";
18
+ readonly AsIn: "as-IN";
19
+ readonly BrxIn: "brx-IN";
20
+ readonly DoiIn: "doi-IN";
21
+ readonly KokIn: "kok-IN";
22
+ readonly KsIn: "ks-IN";
23
+ readonly MaiIn: "mai-IN";
24
+ readonly MniIn: "mni-IN";
25
+ readonly NeIn: "ne-IN";
26
+ readonly SaIn: "sa-IN";
27
+ readonly SatIn: "sat-IN";
28
+ readonly SdIn: "sd-IN";
29
+ readonly UrIn: "ur-IN";
18
30
  };
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.TranslateSourceLanguage = void 0;
7
7
  exports.TranslateSourceLanguage = {
8
8
  Auto: "auto",
9
- EnIn: "en-IN",
10
- HiIn: "hi-IN",
11
9
  BnIn: "bn-IN",
10
+ EnIn: "en-IN",
12
11
  GuIn: "gu-IN",
12
+ HiIn: "hi-IN",
13
13
  KnIn: "kn-IN",
14
14
  MlIn: "ml-IN",
15
15
  MrIn: "mr-IN",
@@ -17,4 +17,16 @@ exports.TranslateSourceLanguage = {
17
17
  PaIn: "pa-IN",
18
18
  TaIn: "ta-IN",
19
19
  TeIn: "te-IN",
20
+ AsIn: "as-IN",
21
+ BrxIn: "brx-IN",
22
+ DoiIn: "doi-IN",
23
+ KokIn: "kok-IN",
24
+ KsIn: "ks-IN",
25
+ MaiIn: "mai-IN",
26
+ MniIn: "mni-IN",
27
+ NeIn: "ne-IN",
28
+ SaIn: "sa-IN",
29
+ SatIn: "sat-IN",
30
+ SdIn: "sd-IN",
31
+ UrIn: "ur-IN",
20
32
  };
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type TranslateTargetLanguage = "en-IN" | "hi-IN" | "bn-IN" | "gu-IN" | "kn-IN" | "ml-IN" | "mr-IN" | "od-IN" | "pa-IN" | "ta-IN" | "te-IN";
4
+ export type TranslateTargetLanguage = "bn-IN" | "en-IN" | "gu-IN" | "hi-IN" | "kn-IN" | "ml-IN" | "mr-IN" | "od-IN" | "pa-IN" | "ta-IN" | "te-IN" | "as-IN" | "brx-IN" | "doi-IN" | "kok-IN" | "ks-IN" | "mai-IN" | "mni-IN" | "ne-IN" | "sa-IN" | "sat-IN" | "sd-IN" | "ur-IN";
5
5
  export declare const TranslateTargetLanguage: {
6
- readonly EnIn: "en-IN";
7
- readonly HiIn: "hi-IN";
8
6
  readonly BnIn: "bn-IN";
7
+ readonly EnIn: "en-IN";
9
8
  readonly GuIn: "gu-IN";
9
+ readonly HiIn: "hi-IN";
10
10
  readonly KnIn: "kn-IN";
11
11
  readonly MlIn: "ml-IN";
12
12
  readonly MrIn: "mr-IN";
@@ -14,4 +14,16 @@ export declare const TranslateTargetLanguage: {
14
14
  readonly PaIn: "pa-IN";
15
15
  readonly TaIn: "ta-IN";
16
16
  readonly TeIn: "te-IN";
17
+ readonly AsIn: "as-IN";
18
+ readonly BrxIn: "brx-IN";
19
+ readonly DoiIn: "doi-IN";
20
+ readonly KokIn: "kok-IN";
21
+ readonly KsIn: "ks-IN";
22
+ readonly MaiIn: "mai-IN";
23
+ readonly MniIn: "mni-IN";
24
+ readonly NeIn: "ne-IN";
25
+ readonly SaIn: "sa-IN";
26
+ readonly SatIn: "sat-IN";
27
+ readonly SdIn: "sd-IN";
28
+ readonly UrIn: "ur-IN";
17
29
  };
@@ -5,10 +5,10 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.TranslateTargetLanguage = void 0;
7
7
  exports.TranslateTargetLanguage = {
8
- EnIn: "en-IN",
9
- HiIn: "hi-IN",
10
8
  BnIn: "bn-IN",
9
+ EnIn: "en-IN",
11
10
  GuIn: "gu-IN",
11
+ HiIn: "hi-IN",
12
12
  KnIn: "kn-IN",
13
13
  MlIn: "ml-IN",
14
14
  MrIn: "mr-IN",
@@ -16,4 +16,16 @@ exports.TranslateTargetLanguage = {
16
16
  PaIn: "pa-IN",
17
17
  TaIn: "ta-IN",
18
18
  TeIn: "te-IN",
19
+ AsIn: "as-IN",
20
+ BrxIn: "brx-IN",
21
+ DoiIn: "doi-IN",
22
+ KokIn: "kok-IN",
23
+ KsIn: "ks-IN",
24
+ MaiIn: "mai-IN",
25
+ MniIn: "mni-IN",
26
+ NeIn: "ne-IN",
27
+ SaIn: "sa-IN",
28
+ SatIn: "sat-IN",
29
+ SdIn: "sd-IN",
30
+ UrIn: "ur-IN",
19
31
  };
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type TranslatiterateTargetLanguage = "en-IN" | "hi-IN" | "bn-IN" | "gu-IN" | "kn-IN" | "ml-IN" | "mr-IN" | "od-IN" | "pa-IN" | "ta-IN" | "te-IN";
4
+ export type TranslatiterateTargetLanguage = "bn-IN" | "en-IN" | "gu-IN" | "hi-IN" | "kn-IN" | "ml-IN" | "mr-IN" | "od-IN" | "pa-IN" | "ta-IN" | "te-IN";
5
5
  export declare const TranslatiterateTargetLanguage: {
6
- readonly EnIn: "en-IN";
7
- readonly HiIn: "hi-IN";
8
6
  readonly BnIn: "bn-IN";
7
+ readonly EnIn: "en-IN";
9
8
  readonly GuIn: "gu-IN";
9
+ readonly HiIn: "hi-IN";
10
10
  readonly KnIn: "kn-IN";
11
11
  readonly MlIn: "ml-IN";
12
12
  readonly MrIn: "mr-IN";
@@ -5,10 +5,10 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.TranslatiterateTargetLanguage = void 0;
7
7
  exports.TranslatiterateTargetLanguage = {
8
- EnIn: "en-IN",
9
- HiIn: "hi-IN",
10
8
  BnIn: "bn-IN",
9
+ EnIn: "en-IN",
11
10
  GuIn: "gu-IN",
11
+ HiIn: "hi-IN",
12
12
  KnIn: "kn-IN",
13
13
  MlIn: "ml-IN",
14
14
  MrIn: "mr-IN",
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type TranslatePostprocessing = "roman" | "fully-native" | "spoken-form-in-native";
5
- export declare const TranslatePostprocessing: {
4
+ export type TransliterateMode = "roman" | "fully-native" | "spoken-form-in-native";
5
+ export declare const TransliterateMode: {
6
6
  readonly Roman: "roman";
7
7
  readonly FullyNative: "fully-native";
8
8
  readonly SpokenFormInNative: "spoken-form-in-native";
@@ -3,8 +3,8 @@
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TranslatePostprocessing = void 0;
7
- exports.TranslatePostprocessing = {
6
+ exports.TransliterateMode = void 0;
7
+ exports.TransliterateMode = {
8
8
  Roman: "roman",
9
9
  FullyNative: "fully-native",
10
10
  SpokenFormInNative: "spoken-form-in-native",
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type TransliterateSourceLanguage = "auto" | "en-IN" | "hi-IN" | "bn-IN" | "gu-IN" | "kn-IN" | "ml-IN" | "mr-IN" | "od-IN" | "pa-IN" | "ta-IN" | "te-IN";
4
+ export type TransliterateSourceLanguage = "auto" | "bn-IN" | "en-IN" | "gu-IN" | "hi-IN" | "kn-IN" | "ml-IN" | "mr-IN" | "od-IN" | "pa-IN" | "ta-IN" | "te-IN";
5
5
  export declare const TransliterateSourceLanguage: {
6
6
  readonly Auto: "auto";
7
- readonly EnIn: "en-IN";
8
- readonly HiIn: "hi-IN";
9
7
  readonly BnIn: "bn-IN";
8
+ readonly EnIn: "en-IN";
10
9
  readonly GuIn: "gu-IN";
10
+ readonly HiIn: "hi-IN";
11
11
  readonly KnIn: "kn-IN";
12
12
  readonly MlIn: "ml-IN";
13
13
  readonly MrIn: "mr-IN";
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.TransliterateSourceLanguage = void 0;
7
7
  exports.TransliterateSourceLanguage = {
8
8
  Auto: "auto",
9
- EnIn: "en-IN",
10
- HiIn: "hi-IN",
11
9
  BnIn: "bn-IN",
10
+ EnIn: "en-IN",
12
11
  GuIn: "gu-IN",
12
+ HiIn: "hi-IN",
13
13
  KnIn: "kn-IN",
14
14
  MlIn: "ml-IN",
15
15
  MrIn: "mr-IN",
@@ -19,7 +19,7 @@ export * from "./NumeralsFormat";
19
19
  export * from "./SpokenFormNumeralsFormat";
20
20
  export * from "./TranslateMode";
21
21
  export * from "./TranslateModel";
22
- export * from "./TranslatePostprocessing";
22
+ export * from "./TransliterateMode";
23
23
  export * from "./TranslateSourceLanguage";
24
24
  export * from "./TranslateSpeakerGender";
25
25
  export * from "./TranslateTargetLanguage";
@@ -35,7 +35,7 @@ __exportStar(require("./NumeralsFormat"), exports);
35
35
  __exportStar(require("./SpokenFormNumeralsFormat"), exports);
36
36
  __exportStar(require("./TranslateMode"), exports);
37
37
  __exportStar(require("./TranslateModel"), exports);
38
- __exportStar(require("./TranslatePostprocessing"), exports);
38
+ __exportStar(require("./TransliterateMode"), exports);
39
39
  __exportStar(require("./TranslateSourceLanguage"), exports);
40
40
  __exportStar(require("./TranslateSpeakerGender"), exports);
41
41
  __exportStar(require("./TranslateTargetLanguage"), exports);
@@ -85,7 +85,7 @@ class Chat {
85
85
  const _response = yield core.fetcher({
86
86
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SarvamAIEnvironment.Production, "v1/chat/completions"),
87
87
  method: "POST",
88
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "sarvamai/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
88
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.4a0", "User-Agent": "sarvamai/0.1.4a0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
89
89
  contentType: "application/json",
90
90
  requestType: "json",
91
91
  body: Object.assign(Object.assign({}, request), { model: "sarvam-m" }),
@@ -102,7 +102,7 @@ class SpeechToText {
102
102
  const _response = yield core.fetcher({
103
103
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SarvamAIEnvironment.Production, "speech-to-text"),
104
104
  method: "POST",
105
- headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "sarvamai/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
105
+ headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.4a0", "User-Agent": "sarvamai/0.1.4a0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
106
106
  requestType: "file",
107
107
  duplex: _maybeEncodedRequest.duplex,
108
108
  body: _maybeEncodedRequest.body,
@@ -193,7 +193,7 @@ class SpeechToText {
193
193
  const _response = yield core.fetcher({
194
194
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SarvamAIEnvironment.Production, "speech-to-text-translate"),
195
195
  method: "POST",
196
- headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.2", "User-Agent": "sarvamai/0.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
196
+ headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.1.4a0", "User-Agent": "sarvamai/0.1.4a0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
197
197
  requestType: "file",
198
198
  duplex: _maybeEncodedRequest.duplex,
199
199
  body: _maybeEncodedRequest.body,