sarvamai 0.0.2 → 0.0.4

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 (111) hide show
  1. package/Client.d.ts +5 -5
  2. package/Client.js +3 -3
  3. package/README.md +8 -8
  4. package/api/errors/BadRequestError.d.ts +1 -1
  5. package/api/errors/BadRequestError.js +1 -1
  6. package/api/errors/ForbiddenError.d.ts +3 -3
  7. package/api/errors/ForbiddenError.js +1 -1
  8. package/api/errors/InternalServerError.d.ts +1 -1
  9. package/api/errors/InternalServerError.js +1 -1
  10. package/api/errors/ServiceUnavailableError.d.ts +3 -3
  11. package/api/errors/ServiceUnavailableError.js +1 -1
  12. package/api/errors/TooManyRequestsError.d.ts +3 -3
  13. package/api/errors/TooManyRequestsError.js +1 -1
  14. package/api/errors/UnprocessableEntityError.d.ts +1 -1
  15. package/api/errors/UnprocessableEntityError.js +1 -1
  16. package/api/resources/analytics/client/Client.d.ts +18 -18
  17. package/api/resources/analytics/client/Client.js +39 -39
  18. package/api/resources/analytics/client/requests/CallAnalyticsRequest.d.ts +2 -2
  19. package/api/resources/pdf/client/Client.d.ts +12 -12
  20. package/api/resources/pdf/client/Client.js +27 -27
  21. package/api/resources/pdf/client/requests/ParsePdfRequest.d.ts +3 -3
  22. package/api/resources/pdf/client/requests/TranslatePdfRequest.d.ts +2 -2
  23. package/api/resources/speechToText/client/Client.d.ts +18 -18
  24. package/api/resources/speechToText/client/Client.js +39 -39
  25. package/api/resources/speechToText/client/requests/SpeechToTextTranscriptionRequest.d.ts +3 -3
  26. package/api/resources/speechToText/client/requests/SpeechToTextTranslationRequest.d.ts +2 -2
  27. package/api/resources/text/client/Client.d.ts +23 -23
  28. package/api/resources/text/client/Client.js +52 -52
  29. package/api/resources/text/client/requests/TranslationRequest.d.ts +8 -8
  30. package/api/resources/text/client/requests/TransliterationRequest.d.ts +5 -5
  31. package/api/resources/textToSpeech/client/Client.d.ts +9 -9
  32. package/api/resources/textToSpeech/client/Client.js +18 -18
  33. package/api/resources/textToSpeech/client/requests/TextToSpeechRequest.d.ts +5 -5
  34. package/api/types/CallAnalyticsJobParameters.d.ts +3 -3
  35. package/api/types/CallAnalyticsJobRequest.d.ts +2 -2
  36. package/api/types/CallAnalyticsResponse.d.ts +4 -4
  37. package/api/types/DiarizedTranscript.d.ts +2 -2
  38. package/api/types/ErrorDetails.d.ts +2 -2
  39. package/api/types/ErrorMessage.d.ts +2 -2
  40. package/api/types/Question.d.ts +2 -2
  41. package/api/types/SpeechToTextResponse.d.ts +3 -3
  42. package/api/types/SpeechToTextTranslateResponse.d.ts +3 -3
  43. package/api/types/TextAnalyticsResponse.d.ts +2 -2
  44. package/dist/Client.d.ts +5 -5
  45. package/dist/Client.js +3 -3
  46. package/dist/api/errors/BadRequestError.d.ts +1 -1
  47. package/dist/api/errors/BadRequestError.js +1 -1
  48. package/dist/api/errors/ForbiddenError.d.ts +3 -3
  49. package/dist/api/errors/ForbiddenError.js +1 -1
  50. package/dist/api/errors/InternalServerError.d.ts +1 -1
  51. package/dist/api/errors/InternalServerError.js +1 -1
  52. package/dist/api/errors/ServiceUnavailableError.d.ts +3 -3
  53. package/dist/api/errors/ServiceUnavailableError.js +1 -1
  54. package/dist/api/errors/TooManyRequestsError.d.ts +3 -3
  55. package/dist/api/errors/TooManyRequestsError.js +1 -1
  56. package/dist/api/errors/UnprocessableEntityError.d.ts +1 -1
  57. package/dist/api/errors/UnprocessableEntityError.js +1 -1
  58. package/dist/api/resources/analytics/client/Client.d.ts +18 -18
  59. package/dist/api/resources/analytics/client/Client.js +39 -39
  60. package/dist/api/resources/analytics/client/requests/CallAnalyticsRequest.d.ts +2 -2
  61. package/dist/api/resources/pdf/client/Client.d.ts +12 -12
  62. package/dist/api/resources/pdf/client/Client.js +27 -27
  63. package/dist/api/resources/pdf/client/requests/ParsePdfRequest.d.ts +3 -3
  64. package/dist/api/resources/pdf/client/requests/TranslatePdfRequest.d.ts +2 -2
  65. package/dist/api/resources/speechToText/client/Client.d.ts +18 -18
  66. package/dist/api/resources/speechToText/client/Client.js +39 -39
  67. package/dist/api/resources/speechToText/client/requests/SpeechToTextTranscriptionRequest.d.ts +3 -3
  68. package/dist/api/resources/speechToText/client/requests/SpeechToTextTranslationRequest.d.ts +2 -2
  69. package/dist/api/resources/text/client/Client.d.ts +23 -23
  70. package/dist/api/resources/text/client/Client.js +52 -52
  71. package/dist/api/resources/text/client/requests/TranslationRequest.d.ts +8 -8
  72. package/dist/api/resources/text/client/requests/TransliterationRequest.d.ts +5 -5
  73. package/dist/api/resources/textToSpeech/client/Client.d.ts +9 -9
  74. package/dist/api/resources/textToSpeech/client/Client.js +18 -18
  75. package/dist/api/resources/textToSpeech/client/requests/TextToSpeechRequest.d.ts +5 -5
  76. package/dist/api/types/CallAnalyticsJobParameters.d.ts +3 -3
  77. package/dist/api/types/CallAnalyticsJobRequest.d.ts +2 -2
  78. package/dist/api/types/CallAnalyticsResponse.d.ts +4 -4
  79. package/dist/api/types/DiarizedTranscript.d.ts +2 -2
  80. package/dist/api/types/ErrorDetails.d.ts +2 -2
  81. package/dist/api/types/ErrorMessage.d.ts +2 -2
  82. package/dist/api/types/Question.d.ts +2 -2
  83. package/dist/api/types/SpeechToTextResponse.d.ts +3 -3
  84. package/dist/api/types/SpeechToTextTranslateResponse.d.ts +3 -3
  85. package/dist/api/types/TextAnalyticsResponse.d.ts +2 -2
  86. package/dist/environments.d.ts +2 -2
  87. package/dist/environments.js +2 -2
  88. package/dist/errors/{SarvamError.d.ts → SarvamAIError.d.ts} +1 -1
  89. package/{errors/SarvamError.js → dist/errors/SarvamAIError.js} +4 -4
  90. package/dist/errors/{SarvamTimeoutError.d.ts → SarvamAITimeoutError.d.ts} +1 -1
  91. package/{errors/SarvamTimeoutError.js → dist/errors/SarvamAITimeoutError.js} +4 -4
  92. package/dist/errors/index.d.ts +2 -2
  93. package/dist/errors/index.js +5 -5
  94. package/dist/index.d.ts +4 -4
  95. package/dist/index.js +6 -6
  96. package/dist/version.d.ts +1 -1
  97. package/dist/version.js +1 -1
  98. package/environments.d.ts +2 -2
  99. package/environments.js +2 -2
  100. package/errors/{SarvamError.d.ts → SarvamAIError.d.ts} +1 -1
  101. package/{dist/errors/SarvamError.js → errors/SarvamAIError.js} +4 -4
  102. package/errors/{SarvamTimeoutError.d.ts → SarvamAITimeoutError.d.ts} +1 -1
  103. package/{dist/errors/SarvamTimeoutError.js → errors/SarvamAITimeoutError.js} +4 -4
  104. package/errors/index.d.ts +2 -2
  105. package/errors/index.js +5 -5
  106. package/index.d.ts +4 -4
  107. package/index.js +6 -6
  108. package/package.json +1 -1
  109. package/reference.md +20 -20
  110. package/version.d.ts +1 -1
  111. package/version.js +1 -1
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as Sarvam from "../index";
4
+ import * as SarvamAI from "../index";
5
5
  export interface SpeechToTextTranslateResponse {
6
6
  request_id?: string;
7
7
  /** Transcript of the provided speech */
8
8
  transcript: string;
9
9
  /** This will return the BCP-47 code of language spoken in the input. If multiple languages are detected, this will return language code of most predominant spoken language. If no language is detected, this will be null */
10
- language_code?: Sarvam.SpeechToTextTranslateLanguage;
10
+ language_code?: SarvamAI.SpeechToTextTranslateLanguage;
11
11
  /** Diarized transcript of the provided speech */
12
- diarized_transcript?: Sarvam.DiarizedTranscript;
12
+ diarized_transcript?: SarvamAI.DiarizedTranscript;
13
13
  }
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as Sarvam from "../index";
4
+ import * as SarvamAI from "../index";
5
5
  export interface TextAnalyticsResponse {
6
6
  request_id?: string;
7
7
  /** List of answers derived from the text analysis. Each answer corresponds to a question from the original request. This field will be null if no valid answers could be generated. */
8
- answers?: Sarvam.QnaResponse[];
8
+ answers?: SarvamAI.QnaResponse[];
9
9
  }
package/dist/Client.d.ts CHANGED
@@ -8,9 +8,9 @@ import { Pdf } from "./api/resources/pdf/client/Client";
8
8
  import { SpeechToText } from "./api/resources/speechToText/client/Client";
9
9
  import { Analytics } from "./api/resources/analytics/client/Client";
10
10
  import { TextToSpeech } from "./api/resources/textToSpeech/client/Client";
11
- export declare namespace SarvamClient {
11
+ export declare namespace SarvamAIClient {
12
12
  interface Options {
13
- environment?: core.Supplier<environments.SarvamEnvironment | string>;
13
+ environment?: core.Supplier<environments.SarvamAIEnvironment | string>;
14
14
  /** Specify a custom URL to connect the client to. */
15
15
  baseUrl?: core.Supplier<string>;
16
16
  /** Override the api-subscription-key header */
@@ -29,14 +29,14 @@ export declare namespace SarvamClient {
29
29
  headers?: Record<string, string>;
30
30
  }
31
31
  }
32
- export declare class SarvamClient {
33
- protected readonly _options: SarvamClient.Options;
32
+ export declare class SarvamAIClient {
33
+ protected readonly _options: SarvamAIClient.Options;
34
34
  protected _text: Text | undefined;
35
35
  protected _pdf: Pdf | undefined;
36
36
  protected _speechToText: SpeechToText | undefined;
37
37
  protected _analytics: Analytics | undefined;
38
38
  protected _textToSpeech: TextToSpeech | undefined;
39
- constructor(_options?: SarvamClient.Options);
39
+ constructor(_options?: SarvamAIClient.Options);
40
40
  get text(): Text;
41
41
  get pdf(): Pdf;
42
42
  get speechToText(): SpeechToText;
package/dist/Client.js CHANGED
@@ -3,13 +3,13 @@
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.SarvamClient = void 0;
6
+ exports.SarvamAIClient = void 0;
7
7
  const Client_1 = require("./api/resources/text/client/Client");
8
8
  const Client_2 = require("./api/resources/pdf/client/Client");
9
9
  const Client_3 = require("./api/resources/speechToText/client/Client");
10
10
  const Client_4 = require("./api/resources/analytics/client/Client");
11
11
  const Client_5 = require("./api/resources/textToSpeech/client/Client");
12
- class SarvamClient {
12
+ class SarvamAIClient {
13
13
  constructor(_options = {}) {
14
14
  this._options = _options;
15
15
  }
@@ -34,4 +34,4 @@ class SarvamClient {
34
34
  return ((_a = this._textToSpeech) !== null && _a !== void 0 ? _a : (this._textToSpeech = new Client_5.TextToSpeech(this._options)));
35
35
  }
36
36
  }
37
- exports.SarvamClient = SarvamClient;
37
+ exports.SarvamAIClient = SarvamAIClient;
@@ -2,6 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
- export declare class BadRequestError extends errors.SarvamError {
5
+ export declare class BadRequestError extends errors.SarvamAIError {
6
6
  constructor(body?: unknown);
7
7
  }
@@ -38,7 +38,7 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.BadRequestError = void 0;
40
40
  const errors = __importStar(require("../../errors/index"));
41
- class BadRequestError extends errors.SarvamError {
41
+ class BadRequestError extends errors.SarvamAIError {
42
42
  constructor(body) {
43
43
  super({
44
44
  message: "BadRequestError",
@@ -2,7 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
- import * as Sarvam from "../index";
6
- export declare class ForbiddenError extends errors.SarvamError {
7
- constructor(body: Sarvam.ErrorMessage);
5
+ import * as SarvamAI from "../index";
6
+ export declare class ForbiddenError extends errors.SarvamAIError {
7
+ constructor(body: SarvamAI.ErrorMessage);
8
8
  }
@@ -38,7 +38,7 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.ForbiddenError = void 0;
40
40
  const errors = __importStar(require("../../errors/index"));
41
- class ForbiddenError extends errors.SarvamError {
41
+ class ForbiddenError extends errors.SarvamAIError {
42
42
  constructor(body) {
43
43
  super({
44
44
  message: "ForbiddenError",
@@ -2,6 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
- export declare class InternalServerError extends errors.SarvamError {
5
+ export declare class InternalServerError extends errors.SarvamAIError {
6
6
  constructor(body?: unknown);
7
7
  }
@@ -38,7 +38,7 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.InternalServerError = void 0;
40
40
  const errors = __importStar(require("../../errors/index"));
41
- class InternalServerError extends errors.SarvamError {
41
+ class InternalServerError extends errors.SarvamAIError {
42
42
  constructor(body) {
43
43
  super({
44
44
  message: "InternalServerError",
@@ -2,7 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
- import * as Sarvam from "../index";
6
- export declare class ServiceUnavailableError extends errors.SarvamError {
7
- constructor(body: Sarvam.ErrorMessage);
5
+ import * as SarvamAI from "../index";
6
+ export declare class ServiceUnavailableError extends errors.SarvamAIError {
7
+ constructor(body: SarvamAI.ErrorMessage);
8
8
  }
@@ -38,7 +38,7 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.ServiceUnavailableError = void 0;
40
40
  const errors = __importStar(require("../../errors/index"));
41
- class ServiceUnavailableError extends errors.SarvamError {
41
+ class ServiceUnavailableError extends errors.SarvamAIError {
42
42
  constructor(body) {
43
43
  super({
44
44
  message: "ServiceUnavailableError",
@@ -2,7 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
- import * as Sarvam from "../index";
6
- export declare class TooManyRequestsError extends errors.SarvamError {
7
- constructor(body: Sarvam.ErrorMessage);
5
+ import * as SarvamAI from "../index";
6
+ export declare class TooManyRequestsError extends errors.SarvamAIError {
7
+ constructor(body: SarvamAI.ErrorMessage);
8
8
  }
@@ -38,7 +38,7 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.TooManyRequestsError = void 0;
40
40
  const errors = __importStar(require("../../errors/index"));
41
- class TooManyRequestsError extends errors.SarvamError {
41
+ class TooManyRequestsError extends errors.SarvamAIError {
42
42
  constructor(body) {
43
43
  super({
44
44
  message: "TooManyRequestsError",
@@ -2,6 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
- export declare class UnprocessableEntityError extends errors.SarvamError {
5
+ export declare class UnprocessableEntityError extends errors.SarvamAIError {
6
6
  constructor(body?: unknown);
7
7
  }
@@ -38,7 +38,7 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.UnprocessableEntityError = void 0;
40
40
  const errors = __importStar(require("../../errors/index"));
41
- class UnprocessableEntityError extends errors.SarvamError {
41
+ class UnprocessableEntityError extends errors.SarvamAIError {
42
42
  constructor(body) {
43
43
  super({
44
44
  message: "UnprocessableEntityError",
@@ -3,12 +3,12 @@
3
3
  */
4
4
  import * as environments from "../../../../environments";
5
5
  import * as core from "../../../../core";
6
- import * as Sarvam from "../../../index";
6
+ import * as SarvamAI from "../../../index";
7
7
  import * as fs from "fs";
8
8
  import { Blob } from "buffer";
9
9
  export declare namespace Analytics {
10
10
  interface Options {
11
- environment?: core.Supplier<environments.SarvamEnvironment | string>;
11
+ environment?: core.Supplier<environments.SarvamAIEnvironment | string>;
12
12
  /** Specify a custom URL to connect the client to. */
13
13
  baseUrl?: core.Supplier<string>;
14
14
  /** Override the api-subscription-key header */
@@ -34,34 +34,34 @@ export declare class Analytics {
34
34
  * Given an audio file of a call between two parties and a list of questions, this API analyzes the content and returns the transcript, along with responses to the questions. Each response is supported by reasoning and exact phrases extracted from the transcript.
35
35
  *
36
36
  * @param {File | fs.ReadStream | Blob} file
37
- * @param {Sarvam.CallAnalyticsRequest} request
37
+ * @param {SarvamAI.CallAnalyticsRequest} request
38
38
  * @param {Analytics.RequestOptions} requestOptions - Request-specific configuration.
39
39
  *
40
- * @throws {@link Sarvam.BadRequestError}
41
- * @throws {@link Sarvam.ForbiddenError}
42
- * @throws {@link Sarvam.UnprocessableEntityError}
43
- * @throws {@link Sarvam.TooManyRequestsError}
44
- * @throws {@link Sarvam.InternalServerError}
45
- * @throws {@link Sarvam.ServiceUnavailableError}
40
+ * @throws {@link SarvamAI.BadRequestError}
41
+ * @throws {@link SarvamAI.ForbiddenError}
42
+ * @throws {@link SarvamAI.UnprocessableEntityError}
43
+ * @throws {@link SarvamAI.TooManyRequestsError}
44
+ * @throws {@link SarvamAI.InternalServerError}
45
+ * @throws {@link SarvamAI.ServiceUnavailableError}
46
46
  *
47
47
  * @example
48
48
  * await client.analytics.call(fs.createReadStream("/path/to/your/file"), {
49
49
  * questions: "questions"
50
50
  * })
51
51
  */
52
- call(file: File | fs.ReadStream | Blob, request: Sarvam.CallAnalyticsRequest, requestOptions?: Analytics.RequestOptions): Promise<Sarvam.CallAnalyticsResponse>;
52
+ call(file: File | fs.ReadStream | Blob, request: SarvamAI.CallAnalyticsRequest, requestOptions?: Analytics.RequestOptions): Promise<SarvamAI.CallAnalyticsResponse>;
53
53
  /**
54
54
  * This endpoint performs comprehensive text analysis on provided content and answers specific questions about the text. Each response is supported by reasoning and the exact phrase extracted from the content.
55
55
  *
56
- * @param {Sarvam.TextAnalyticsRequest} request
56
+ * @param {SarvamAI.TextAnalyticsRequest} request
57
57
  * @param {Analytics.RequestOptions} requestOptions - Request-specific configuration.
58
58
  *
59
- * @throws {@link Sarvam.BadRequestError}
60
- * @throws {@link Sarvam.ForbiddenError}
61
- * @throws {@link Sarvam.UnprocessableEntityError}
62
- * @throws {@link Sarvam.TooManyRequestsError}
63
- * @throws {@link Sarvam.InternalServerError}
64
- * @throws {@link Sarvam.ServiceUnavailableError}
59
+ * @throws {@link SarvamAI.BadRequestError}
60
+ * @throws {@link SarvamAI.ForbiddenError}
61
+ * @throws {@link SarvamAI.UnprocessableEntityError}
62
+ * @throws {@link SarvamAI.TooManyRequestsError}
63
+ * @throws {@link SarvamAI.InternalServerError}
64
+ * @throws {@link SarvamAI.ServiceUnavailableError}
65
65
  *
66
66
  * @example
67
67
  * await client.analytics.text({
@@ -69,5 +69,5 @@ export declare class Analytics {
69
69
  * questions: "questions"
70
70
  * })
71
71
  */
72
- text(request: Sarvam.TextAnalyticsRequest, requestOptions?: Analytics.RequestOptions): Promise<Sarvam.TextAnalyticsResponse>;
72
+ text(request: SarvamAI.TextAnalyticsRequest, requestOptions?: Analytics.RequestOptions): Promise<SarvamAI.TextAnalyticsResponse>;
73
73
  }
@@ -51,7 +51,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
51
51
  exports.Analytics = void 0;
52
52
  const environments = __importStar(require("../../../../environments"));
53
53
  const core = __importStar(require("../../../../core"));
54
- const Sarvam = __importStar(require("../../../index"));
54
+ const SarvamAI = __importStar(require("../../../index"));
55
55
  const url_join_1 = __importDefault(require("url-join"));
56
56
  const errors = __importStar(require("../../../../errors/index"));
57
57
  class Analytics {
@@ -62,15 +62,15 @@ class Analytics {
62
62
  * Given an audio file of a call between two parties and a list of questions, this API analyzes the content and returns the transcript, along with responses to the questions. Each response is supported by reasoning and exact phrases extracted from the transcript.
63
63
  *
64
64
  * @param {File | fs.ReadStream | Blob} file
65
- * @param {Sarvam.CallAnalyticsRequest} request
65
+ * @param {SarvamAI.CallAnalyticsRequest} request
66
66
  * @param {Analytics.RequestOptions} requestOptions - Request-specific configuration.
67
67
  *
68
- * @throws {@link Sarvam.BadRequestError}
69
- * @throws {@link Sarvam.ForbiddenError}
70
- * @throws {@link Sarvam.UnprocessableEntityError}
71
- * @throws {@link Sarvam.TooManyRequestsError}
72
- * @throws {@link Sarvam.InternalServerError}
73
- * @throws {@link Sarvam.ServiceUnavailableError}
68
+ * @throws {@link SarvamAI.BadRequestError}
69
+ * @throws {@link SarvamAI.ForbiddenError}
70
+ * @throws {@link SarvamAI.UnprocessableEntityError}
71
+ * @throws {@link SarvamAI.TooManyRequestsError}
72
+ * @throws {@link SarvamAI.InternalServerError}
73
+ * @throws {@link SarvamAI.ServiceUnavailableError}
74
74
  *
75
75
  * @example
76
76
  * await client.analytics.call(fs.createReadStream("/path/to/your/file"), {
@@ -94,11 +94,11 @@ class Analytics {
94
94
  }
95
95
  const _maybeEncodedRequest = yield _request.getRequest();
96
96
  const _response = yield core.fetcher({
97
- 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.SarvamEnvironment.Production, "call-analytics"),
97
+ 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, "call-analytics"),
98
98
  method: "POST",
99
99
  headers: Object.assign(Object.assign({ "api-subscription-key": (yield core.Supplier.get(this._options.apiSubscriptionKey)) != null
100
100
  ? yield core.Supplier.get(this._options.apiSubscriptionKey)
101
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.0.2", "User-Agent": "sarvamai/0.0.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
101
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.0.4", "User-Agent": "sarvamai/0.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
102
102
  requestType: "file",
103
103
  duplex: _maybeEncodedRequest.duplex,
104
104
  body: _maybeEncodedRequest.body,
@@ -112,19 +112,19 @@ class Analytics {
112
112
  if (_response.error.reason === "status-code") {
113
113
  switch (_response.error.statusCode) {
114
114
  case 400:
115
- throw new Sarvam.BadRequestError(_response.error.body);
115
+ throw new SarvamAI.BadRequestError(_response.error.body);
116
116
  case 403:
117
- throw new Sarvam.ForbiddenError(_response.error.body);
117
+ throw new SarvamAI.ForbiddenError(_response.error.body);
118
118
  case 422:
119
- throw new Sarvam.UnprocessableEntityError(_response.error.body);
119
+ throw new SarvamAI.UnprocessableEntityError(_response.error.body);
120
120
  case 429:
121
- throw new Sarvam.TooManyRequestsError(_response.error.body);
121
+ throw new SarvamAI.TooManyRequestsError(_response.error.body);
122
122
  case 500:
123
- throw new Sarvam.InternalServerError(_response.error.body);
123
+ throw new SarvamAI.InternalServerError(_response.error.body);
124
124
  case 503:
125
- throw new Sarvam.ServiceUnavailableError(_response.error.body);
125
+ throw new SarvamAI.ServiceUnavailableError(_response.error.body);
126
126
  default:
127
- throw new errors.SarvamError({
127
+ throw new errors.SarvamAIError({
128
128
  statusCode: _response.error.statusCode,
129
129
  body: _response.error.body,
130
130
  });
@@ -132,14 +132,14 @@ class Analytics {
132
132
  }
133
133
  switch (_response.error.reason) {
134
134
  case "non-json":
135
- throw new errors.SarvamError({
135
+ throw new errors.SarvamAIError({
136
136
  statusCode: _response.error.statusCode,
137
137
  body: _response.error.rawBody,
138
138
  });
139
139
  case "timeout":
140
- throw new errors.SarvamTimeoutError("Timeout exceeded when calling POST /call-analytics.");
140
+ throw new errors.SarvamAITimeoutError("Timeout exceeded when calling POST /call-analytics.");
141
141
  case "unknown":
142
- throw new errors.SarvamError({
142
+ throw new errors.SarvamAIError({
143
143
  message: _response.error.errorMessage,
144
144
  });
145
145
  }
@@ -148,15 +148,15 @@ class Analytics {
148
148
  /**
149
149
  * This endpoint performs comprehensive text analysis on provided content and answers specific questions about the text. Each response is supported by reasoning and the exact phrase extracted from the content.
150
150
  *
151
- * @param {Sarvam.TextAnalyticsRequest} request
151
+ * @param {SarvamAI.TextAnalyticsRequest} request
152
152
  * @param {Analytics.RequestOptions} requestOptions - Request-specific configuration.
153
153
  *
154
- * @throws {@link Sarvam.BadRequestError}
155
- * @throws {@link Sarvam.ForbiddenError}
156
- * @throws {@link Sarvam.UnprocessableEntityError}
157
- * @throws {@link Sarvam.TooManyRequestsError}
158
- * @throws {@link Sarvam.InternalServerError}
159
- * @throws {@link Sarvam.ServiceUnavailableError}
154
+ * @throws {@link SarvamAI.BadRequestError}
155
+ * @throws {@link SarvamAI.ForbiddenError}
156
+ * @throws {@link SarvamAI.UnprocessableEntityError}
157
+ * @throws {@link SarvamAI.TooManyRequestsError}
158
+ * @throws {@link SarvamAI.InternalServerError}
159
+ * @throws {@link SarvamAI.ServiceUnavailableError}
160
160
  *
161
161
  * @example
162
162
  * await client.analytics.text({
@@ -168,11 +168,11 @@ class Analytics {
168
168
  return __awaiter(this, void 0, void 0, function* () {
169
169
  var _a, _b;
170
170
  const _response = yield core.fetcher({
171
- 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.SarvamEnvironment.Production, "text-analytics"),
171
+ 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-analytics"),
172
172
  method: "POST",
173
173
  headers: Object.assign({ "api-subscription-key": (yield core.Supplier.get(this._options.apiSubscriptionKey)) != null
174
174
  ? yield core.Supplier.get(this._options.apiSubscriptionKey)
175
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.0.2", "User-Agent": "sarvamai/0.0.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
175
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "sarvamai", "X-Fern-SDK-Version": "0.0.4", "User-Agent": "sarvamai/0.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
176
176
  contentType: "application/x-www-form-urlencoded",
177
177
  requestType: "json",
178
178
  body: request,
@@ -186,19 +186,19 @@ class Analytics {
186
186
  if (_response.error.reason === "status-code") {
187
187
  switch (_response.error.statusCode) {
188
188
  case 400:
189
- throw new Sarvam.BadRequestError(_response.error.body);
189
+ throw new SarvamAI.BadRequestError(_response.error.body);
190
190
  case 403:
191
- throw new Sarvam.ForbiddenError(_response.error.body);
191
+ throw new SarvamAI.ForbiddenError(_response.error.body);
192
192
  case 422:
193
- throw new Sarvam.UnprocessableEntityError(_response.error.body);
193
+ throw new SarvamAI.UnprocessableEntityError(_response.error.body);
194
194
  case 429:
195
- throw new Sarvam.TooManyRequestsError(_response.error.body);
195
+ throw new SarvamAI.TooManyRequestsError(_response.error.body);
196
196
  case 500:
197
- throw new Sarvam.InternalServerError(_response.error.body);
197
+ throw new SarvamAI.InternalServerError(_response.error.body);
198
198
  case 503:
199
- throw new Sarvam.ServiceUnavailableError(_response.error.body);
199
+ throw new SarvamAI.ServiceUnavailableError(_response.error.body);
200
200
  default:
201
- throw new errors.SarvamError({
201
+ throw new errors.SarvamAIError({
202
202
  statusCode: _response.error.statusCode,
203
203
  body: _response.error.body,
204
204
  });
@@ -206,14 +206,14 @@ class Analytics {
206
206
  }
207
207
  switch (_response.error.reason) {
208
208
  case "non-json":
209
- throw new errors.SarvamError({
209
+ throw new errors.SarvamAIError({
210
210
  statusCode: _response.error.statusCode,
211
211
  body: _response.error.rawBody,
212
212
  });
213
213
  case "timeout":
214
- throw new errors.SarvamTimeoutError("Timeout exceeded when calling POST /text-analytics.");
214
+ throw new errors.SarvamAITimeoutError("Timeout exceeded when calling POST /text-analytics.");
215
215
  case "unknown":
216
- throw new errors.SarvamError({
216
+ throw new errors.SarvamAIError({
217
217
  message: _response.error.errorMessage,
218
218
  });
219
219
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as Sarvam from "../../../../index";
4
+ import * as SarvamAI from "../../../../index";
5
5
  /**
6
6
  * @example
7
7
  * {
@@ -18,7 +18,7 @@ export interface CallAnalyticsRequest {
18
18
  /** Optional comma-separated string of keywords specific to your domain. These keywords will be preserved as-is in the transcript. */
19
19
  hotwords?: string;
20
20
  /** Model to be used for converting speech to text in target language */
21
- model?: Sarvam.SpeechToTextTranslateModel;
21
+ model?: SarvamAI.SpeechToTextTranslateModel;
22
22
  /** Include diarization in the output */
23
23
  with_diarization?: boolean;
24
24
  }
@@ -3,12 +3,12 @@
3
3
  */
4
4
  import * as environments from "../../../../environments";
5
5
  import * as core from "../../../../core";
6
- import * as Sarvam from "../../../index";
6
+ import * as SarvamAI from "../../../index";
7
7
  import * as fs from "fs";
8
8
  import { Blob } from "buffer";
9
9
  export declare namespace Pdf {
10
10
  interface Options {
11
- environment?: core.Supplier<environments.SarvamEnvironment | string>;
11
+ environment?: core.Supplier<environments.SarvamAIEnvironment | string>;
12
12
  /** Specify a custom URL to connect the client to. */
13
13
  baseUrl?: core.Supplier<string>;
14
14
  /** Override the api-subscription-key header */
@@ -34,30 +34,30 @@ export declare class Pdf {
34
34
  * Given a PDF, this API helps to get structured extraction of data in the document.The API returns a base64 encoded XML string containing the extracted data.
35
35
  *
36
36
  * @param {File | fs.ReadStream | Blob} pdf
37
- * @param {Sarvam.ParsePdfRequest} request
37
+ * @param {SarvamAI.ParsePdfRequest} request
38
38
  * @param {Pdf.RequestOptions} requestOptions - Request-specific configuration.
39
39
  *
40
- * @throws {@link Sarvam.BadRequestError}
41
- * @throws {@link Sarvam.UnprocessableEntityError}
42
- * @throws {@link Sarvam.InternalServerError}
40
+ * @throws {@link SarvamAI.BadRequestError}
41
+ * @throws {@link SarvamAI.UnprocessableEntityError}
42
+ * @throws {@link SarvamAI.InternalServerError}
43
43
  *
44
44
  * @example
45
45
  * await client.pdf.parse(fs.createReadStream("/path/to/your/file"), {})
46
46
  */
47
- parse(pdf: File | fs.ReadStream | Blob, request: Sarvam.ParsePdfRequest, requestOptions?: Pdf.RequestOptions): Promise<Sarvam.ParsedPageResponse>;
47
+ parse(pdf: File | fs.ReadStream | Blob, request: SarvamAI.ParsePdfRequest, requestOptions?: Pdf.RequestOptions): Promise<SarvamAI.ParsedPageResponse>;
48
48
  /**
49
49
  * Given a PDF, this API helps to translate the content in the document
50
50
  *
51
51
  * @param {File | fs.ReadStream | Blob} pdf
52
- * @param {Sarvam.TranslatePdfRequest} request
52
+ * @param {SarvamAI.TranslatePdfRequest} request
53
53
  * @param {Pdf.RequestOptions} requestOptions - Request-specific configuration.
54
54
  *
55
- * @throws {@link Sarvam.BadRequestError}
56
- * @throws {@link Sarvam.UnprocessableEntityError}
57
- * @throws {@link Sarvam.InternalServerError}
55
+ * @throws {@link SarvamAI.BadRequestError}
56
+ * @throws {@link SarvamAI.UnprocessableEntityError}
57
+ * @throws {@link SarvamAI.InternalServerError}
58
58
  *
59
59
  * @example
60
60
  * await client.pdf.translate(fs.createReadStream("/path/to/your/file"), {})
61
61
  */
62
- translate(pdf: File | fs.ReadStream | Blob, request: Sarvam.TranslatePdfRequest, requestOptions?: Pdf.RequestOptions): Promise<Sarvam.TranslatedPage>;
62
+ translate(pdf: File | fs.ReadStream | Blob, request: SarvamAI.TranslatePdfRequest, requestOptions?: Pdf.RequestOptions): Promise<SarvamAI.TranslatedPage>;
63
63
  }