sarvamai 1.1.15 → 1.1.16-alpha.2

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 (83) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/chat/client/requests/CreateChatCompletionV2Request.d.ts +3 -3
  3. package/dist/cjs/api/resources/docAi/client/Client.d.ts +13 -6
  4. package/dist/cjs/api/resources/docAi/client/Client.js +22 -6
  5. package/dist/cjs/api/resources/docAi/client/requests/DocAiExtractRequest.d.ts +14 -3
  6. package/dist/cjs/api/resources/docAi/client/requests/DocAiExtractRequest.js +5 -0
  7. package/dist/cjs/api/resources/docAi/client/requests/DocAiGetResultsRequest.d.ts +2 -3
  8. package/dist/cjs/api/resources/docAi/client/requests/DocAiParseRequest.d.ts +15 -4
  9. package/dist/cjs/api/resources/docAi/client/requests/DocAiParseRequest.js +7 -1
  10. package/dist/cjs/api/resources/docAi/types/DocAiGetResultsResponse.d.ts +4 -1
  11. package/dist/cjs/api/resources/docAi/types/index.d.ts +0 -1
  12. package/dist/cjs/api/resources/docAi/types/index.js +0 -1
  13. package/dist/cjs/api/resources/dubbing/client/Client.d.ts +4 -4
  14. package/dist/cjs/api/resources/dubbing/client/Client.js +12 -12
  15. package/dist/cjs/api/resources/dubbing/client/requests/CreateDubbingJobRequest.d.ts +2 -2
  16. package/dist/cjs/api/resources/responses/client/requests/ResponsesCreateRequest.d.ts +1 -1
  17. package/dist/cjs/api/resources/responses/client/requests/ResponsesCreateStreamRequest.d.ts +1 -1
  18. package/dist/cjs/api/types/Choice.d.ts +1 -1
  19. package/dist/cjs/api/types/CreateResponseV2Request.d.ts +1 -1
  20. package/dist/cjs/api/types/DocAiJobStatusResponse.d.ts +1 -1
  21. package/dist/cjs/api/types/DocAiParseResults.d.ts +39 -6
  22. package/dist/cjs/api/types/DocAiPresignUploadResponse.d.ts +1 -1
  23. package/dist/cjs/api/types/DubbingErrorResponse.d.ts +10 -0
  24. package/dist/cjs/api/{resources/docAi/types/Format.js → types/DubbingErrorResponse.js} +0 -6
  25. package/dist/cjs/api/types/DubbingSourceLanguage.d.ts +43 -0
  26. package/dist/cjs/api/types/DubbingSourceLanguage.js +46 -0
  27. package/dist/cjs/api/types/ReasoningEffort.d.ts +1 -1
  28. package/dist/cjs/api/types/ReasoningEffort.js +1 -1
  29. package/dist/cjs/api/types/ResponseReasoning.d.ts +1 -1
  30. package/dist/cjs/api/types/ResponseReasoningEffort.d.ts +1 -1
  31. package/dist/cjs/api/types/ResponseReasoningEffort.js +1 -1
  32. package/dist/cjs/api/types/ResponsesModelIds.d.ts +3 -7
  33. package/dist/cjs/api/types/ResponsesModelIds.js +3 -7
  34. package/dist/cjs/api/types/V2ModelIds.d.ts +3 -7
  35. package/dist/cjs/api/types/V2ModelIds.js +3 -7
  36. package/dist/cjs/api/types/index.d.ts +2 -0
  37. package/dist/cjs/api/types/index.js +2 -0
  38. package/dist/cjs/version.d.ts +1 -1
  39. package/dist/cjs/version.js +1 -1
  40. package/dist/esm/BaseClient.mjs +2 -2
  41. package/dist/esm/api/resources/chat/client/requests/CreateChatCompletionV2Request.d.mts +3 -3
  42. package/dist/esm/api/resources/docAi/client/Client.d.mts +13 -6
  43. package/dist/esm/api/resources/docAi/client/Client.mjs +22 -6
  44. package/dist/esm/api/resources/docAi/client/requests/DocAiExtractRequest.d.mts +14 -3
  45. package/dist/esm/api/resources/docAi/client/requests/DocAiExtractRequest.mjs +5 -0
  46. package/dist/esm/api/resources/docAi/client/requests/DocAiGetResultsRequest.d.mts +2 -3
  47. package/dist/esm/api/resources/docAi/client/requests/DocAiParseRequest.d.mts +15 -4
  48. package/dist/esm/api/resources/docAi/client/requests/DocAiParseRequest.mjs +7 -1
  49. package/dist/esm/api/resources/docAi/types/DocAiGetResultsResponse.d.mts +4 -1
  50. package/dist/esm/api/resources/docAi/types/index.d.mts +0 -1
  51. package/dist/esm/api/resources/docAi/types/index.mjs +0 -1
  52. package/dist/esm/api/resources/dubbing/client/Client.d.mts +4 -4
  53. package/dist/esm/api/resources/dubbing/client/Client.mjs +12 -12
  54. package/dist/esm/api/resources/dubbing/client/requests/CreateDubbingJobRequest.d.mts +2 -2
  55. package/dist/esm/api/resources/responses/client/requests/ResponsesCreateRequest.d.mts +1 -1
  56. package/dist/esm/api/resources/responses/client/requests/ResponsesCreateStreamRequest.d.mts +1 -1
  57. package/dist/esm/api/types/Choice.d.mts +1 -1
  58. package/dist/esm/api/types/CreateResponseV2Request.d.mts +1 -1
  59. package/dist/esm/api/types/DocAiJobStatusResponse.d.mts +1 -1
  60. package/dist/esm/api/types/DocAiParseResults.d.mts +39 -6
  61. package/dist/esm/api/types/DocAiPresignUploadResponse.d.mts +1 -1
  62. package/dist/esm/api/types/DubbingErrorResponse.d.mts +10 -0
  63. package/dist/esm/api/types/DubbingErrorResponse.mjs +2 -0
  64. package/dist/esm/api/types/DubbingSourceLanguage.d.mts +43 -0
  65. package/dist/esm/api/types/DubbingSourceLanguage.mjs +43 -0
  66. package/dist/esm/api/types/ReasoningEffort.d.mts +1 -1
  67. package/dist/esm/api/types/ReasoningEffort.mjs +1 -1
  68. package/dist/esm/api/types/ResponseReasoning.d.mts +1 -1
  69. package/dist/esm/api/types/ResponseReasoningEffort.d.mts +1 -1
  70. package/dist/esm/api/types/ResponseReasoningEffort.mjs +1 -1
  71. package/dist/esm/api/types/ResponsesModelIds.d.mts +3 -7
  72. package/dist/esm/api/types/ResponsesModelIds.mjs +3 -7
  73. package/dist/esm/api/types/V2ModelIds.d.mts +3 -7
  74. package/dist/esm/api/types/V2ModelIds.mjs +3 -7
  75. package/dist/esm/api/types/index.d.mts +2 -0
  76. package/dist/esm/api/types/index.mjs +2 -0
  77. package/dist/esm/version.d.mts +1 -1
  78. package/dist/esm/version.mjs +1 -1
  79. package/package.json +1 -1
  80. package/reference.md +15 -8
  81. package/dist/cjs/api/resources/docAi/types/Format.d.ts +0 -6
  82. package/dist/esm/api/resources/docAi/types/Format.d.mts +0 -6
  83. package/dist/esm/api/resources/docAi/types/Format.mjs +0 -6
@@ -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.15",
47
- "User-Agent": "sarvamai/1.1.15",
46
+ "X-Fern-SDK-Version": "1.1.16-alpha.2",
47
+ "User-Agent": "sarvamai/1.1.16-alpha.2",
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);
@@ -20,7 +20,7 @@ export interface CreateChatCompletionV2Request {
20
20
  temperature?: number;
21
21
  /** Nucleus sampling: greater than `0` and at most `1`. On `glm5.3`, `top_p: 0` is rejected. Prefer changing either `top_p` or `temperature`, not both. */
22
22
  top_p?: number;
23
- /** On reasoning models (`glm5.3`, `glm5.3-flash`, `gemma4`, `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3`, `mimo-v2.6-flash`, `mimo-v2.6-pro`): **`low`**, **`high`**, or **`max`**. Default when omitted is **`max`**, except **`high`** on `glm5.3-flash`, `deepseekv4.1-flash-1017`, and `deepseekv4-pro`, and no reasoning on `gemma4`. **`none`** turns thinking off on `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `mimo-v2.6-flash`, and `mimo-v2.6-pro`; on `mimo-v2.6-*`, any other value only switches thinking on. `kimi-k3` always thinks. Trace in `message.reasoning_content`; billed as completion tokens and counts toward `max_tokens`. On `gemma4`, reasoning is off unless this is set (`low`, `high`, or `max`). */
23
+ /** On reasoning models (`glm5.3`, `glm5.3-flash`, `gemma4`, `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3.1-pro`): **`low`**, **`high`**, or **`max`**. Default when omitted is **`max`**, except **`high`** on `glm5.3-flash`, `deepseekv4.1-flash-1017`, and `deepseekv4-pro`, and no reasoning on `gemma4`. **`none`** turns thinking off on `deepseekv4.1-flash-1017` and `deepseekv4-pro`. `kimi-k3.1-pro` always thinks. Trace in `message.reasoning_content`; billed as completion tokens and counts toward `max_tokens`. On `gemma4`, reasoning is off unless this is set (`low`, `high`, or `max`). */
24
24
  reasoning_effort?: SarvamAI.ReasoningEffort;
25
25
  /** Maximum tokens to generate in the completion, including reasoning tokens on reasoning models. Default `2048`. Set explicitly when you need longer answers — a low limit can yield `finish_reason: "length"` with little or no visible `content` if reasoning consumes the budget. */
26
26
  max_tokens?: number;
@@ -59,8 +59,8 @@ export interface CreateChatCompletionV2Request {
59
59
  parallel_tool_calls?: boolean;
60
60
  /** Only valid with `stream: true` (otherwise `400`). Must be a top-level field, not inside `extra_body`. Use `{"include_usage": true}` to receive token usage in the final SSE chunk. */
61
61
  stream_options?: SarvamAI.ChatStreamOptions;
62
- /** If `true`, return log probabilities for output tokens (use with `top_logprobs`). Supported on **`sarvam-105b`**, **`gemma4`**, **`glm5.3-flash`**, **`deepseekv4.1-flash-1017`**, **`deepseekv4-pro`**, **`kimi-k3`**, **`mimo-v2.6-flash`**, and **`mimo-v2.6-pro`**. Not supported on **`glm5.3`** (`400` if enabled). */
62
+ /** If `true`, return log probabilities for output tokens (use with `top_logprobs`). Supported on **`sarvam-105b`**, **`gemma4`**, **`glm5.3-flash`**, **`deepseekv4.1-flash-1017`**, **`deepseekv4-pro`**, and **`kimi-k3.1-pro`**. Not supported on **`glm5.3`** (`400` if enabled). */
63
63
  logprobs?: boolean;
64
- /** How many top token log probabilities to return at each position. Takes effect only when `logprobs` is `true`; without it, some models ignore the field and others return **`400`**. Same model support as `logprobs`: works on `sarvam-105b`, `gemma4`, `glm5.3-flash`, `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3`, `mimo-v2.6-flash`, and `mimo-v2.6-pro`; on `glm5.3`, omit entirely — do not send `0`, since many SDKs add it by default. */
64
+ /** How many top token log probabilities to return at each position. Takes effect only when `logprobs` is `true`; without it, some models ignore the field and others return **`400`**. Same model support as `logprobs`: works on `sarvam-105b`, `gemma4`, `glm5.3-flash`, `deepseekv4.1-flash-1017`, `deepseekv4-pro`, and `kimi-k3.1-pro`; on `glm5.3`, omit entirely — do not send `0`, since many SDKs add it by default. */
65
65
  top_logprobs?: number;
66
66
  }
@@ -16,7 +16,7 @@ export declare class DocAiClient {
16
16
  * **Flow:**
17
17
  * 1. Call this endpoint with the MIME type you will upload (e.g. `application/pdf`).
18
18
  * 2. Upload the file using the returned `method`, `url` and `headers` before `expires_at`.
19
- * 3. Pass the returned `upload_id` through the `upload_ids` field on a later parse or extract job request.
19
+ * 3. Pass the returned `upload_id` through the `upload_ids` field on a later parse, extract, classify, or split job request.
20
20
  *
21
21
  * When `content_type` is set, the upload's `Content-Type` header must match it.
22
22
  *
@@ -55,7 +55,9 @@ export declare class DocAiClient {
55
55
  *
56
56
  * @example
57
57
  * import { createReadStream } from "fs";
58
- * await client.docAi.parse({})
58
+ * await client.docAi.parse({
59
+ * language: "en-IN"
60
+ * })
59
61
  */
60
62
  parse(request: SarvamAI.DocAiParseRequest, requestOptions?: DocAiClient.RequestOptions): core.HttpResponsePromise<SarvamAI.DocAiStartJobResponse>;
61
63
  private __parse;
@@ -84,16 +86,19 @@ export declare class DocAiClient {
84
86
  * import { createReadStream } from "fs";
85
87
  * await client.docAi.extract({
86
88
  * 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"
89
+ * output_format: "json",
90
+ * mode: "basic"
88
91
  * })
89
92
  */
90
93
  extract(request: SarvamAI.DocAiExtractRequest, requestOptions?: DocAiClient.RequestOptions): core.HttpResponsePromise<SarvamAI.DocAiStartJobResponse>;
91
94
  private __extract;
92
95
  /**
93
- * Creates a Classify job. Classify labels a document, or each page, against the categories you define, or suggests a document type when you supply none.
96
+ * Creates a Classify job. Classify labels a document against the categories you define, or suggests a document type when you supply none.
94
97
  *
95
98
  * **Input:** send `file` (PDF, PNG, JPEG or TIFF; repeat the field for up to 10 documents) or `upload_ids`, plus a JSON `request` with the options below. You can also send a JSON body with `input` set to `{"document_ref": "..."}` to classify a child document returned by Split.
96
99
  *
100
+ * **Availability:** options are enabled per deployment. If your deployment does not support an option, the request fails with `400 INVALID_REQUEST` (for example `additional properties 'scope' not allowed`). Call `GET /doc-ai/v1/capabilities` to see what is enabled, and send only those options.
101
+ *
97
102
  * **Processing:** the job runs asynchronously. Poll `GET /doc-ai/v1/job/{job_id}/status` until it is `completed`, then fetch `GET /doc-ai/v1/job/{job_id}/results`. Add `?include=details` to the results for inspected pages, provenance and evidence.
98
103
  *
99
104
  * **Review:** `review_required` tells you whether a person should check the answer. `confidence` can be `null`; it is a token-based score, not a measured probability.
@@ -122,7 +127,9 @@ export declare class DocAiClient {
122
127
  *
123
128
  * **Input:** send `file` (PDF, PNG, JPEG or TIFF; repeat the field for up to 10 documents) or `upload_ids`, plus a JSON `request`.
124
129
  *
125
- * **Processing:** the job runs asynchronously. Poll `GET /doc-ai/v1/job/{job_id}/status` until it is `completed`, then fetch `GET /doc-ai/v1/job/{job_id}/results`. `completed` means processing finished, not that every segment passed review: check each segment's `review.required`.
130
+ * **Availability:** options are enabled per deployment. If your deployment does not support an option, the request fails with `400 INVALID_REQUEST` (for example `additional properties 'scope' not allowed`). Call `GET /doc-ai/v1/capabilities` to see what is enabled, and send only those options.
131
+ *
132
+ * **Processing:** the job runs asynchronously. Poll `GET /doc-ai/v1/job/{job_id}/status` until it is `completed`, then fetch `GET /doc-ai/v1/job/{job_id}/results`. `completed` means processing finished, not that every segment passed review: check `review_required` on each segment.
126
133
  *
127
134
  * @param {SarvamAI.DocAiSplitRequest} request
128
135
  * @param {DocAiClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -176,7 +183,7 @@ export declare class DocAiClient {
176
183
  * })
177
184
  *
178
185
  * @example
179
- * await client.docAi.getResults("20260707_9f1c2b3a-4d5e-6f70-8a9b-c0d1e2f3a4b5", {
186
+ * await client.docAi.getResults("01a1b292-8d3d-710e-974c-fe45aa5bc7ce", {
180
187
  * format: "json"
181
188
  * })
182
189
  *
@@ -62,7 +62,7 @@ class DocAiClient {
62
62
  * **Flow:**
63
63
  * 1. Call this endpoint with the MIME type you will upload (e.g. `application/pdf`).
64
64
  * 2. Upload the file using the returned `method`, `url` and `headers` before `expires_at`.
65
- * 3. Pass the returned `upload_id` through the `upload_ids` field on a later parse or extract job request.
65
+ * 3. Pass the returned `upload_id` through the `upload_ids` field on a later parse, extract, classify, or split job request.
66
66
  *
67
67
  * When `content_type` is set, the upload's `Content-Type` header must match it.
68
68
  *
@@ -147,7 +147,9 @@ class DocAiClient {
147
147
  *
148
148
  * @example
149
149
  * import { createReadStream } from "fs";
150
- * await client.docAi.parse({})
150
+ * await client.docAi.parse({
151
+ * language: "en-IN"
152
+ * })
151
153
  */
152
154
  parse(request, requestOptions) {
153
155
  return core.HttpResponsePromise.fromPromise(this.__parse(request, requestOptions));
@@ -167,6 +169,9 @@ class DocAiClient {
167
169
  if (request.language != null) {
168
170
  _body.append("language", request.language);
169
171
  }
172
+ if (request.output_format != null) {
173
+ _body.append("output_format", request.output_format);
174
+ }
170
175
  if (request.content_type != null) {
171
176
  _body.append("content_type", request.content_type);
172
177
  }
@@ -243,7 +248,8 @@ class DocAiClient {
243
248
  * import { createReadStream } from "fs";
244
249
  * await client.docAi.extract({
245
250
  * 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"
251
+ * output_format: "json",
252
+ * mode: "basic"
247
253
  * })
248
254
  */
249
255
  extract(request, requestOptions) {
@@ -267,9 +273,15 @@ class DocAiClient {
267
273
  if (request.config_id != null) {
268
274
  _body.append("config_id", request.config_id);
269
275
  }
276
+ if (request.language != null) {
277
+ _body.append("language", request.language);
278
+ }
270
279
  if (request.output_format != null) {
271
280
  _body.append("output_format", request.output_format);
272
281
  }
282
+ if (request.mode != null) {
283
+ _body.append("mode", request.mode);
284
+ }
273
285
  if (request.classification != null) {
274
286
  _body.append("classification", request.classification);
275
287
  }
@@ -322,10 +334,12 @@ class DocAiClient {
322
334
  });
323
335
  }
324
336
  /**
325
- * Creates a Classify job. Classify labels a document, or each page, against the categories you define, or suggests a document type when you supply none.
337
+ * Creates a Classify job. Classify labels a document against the categories you define, or suggests a document type when you supply none.
326
338
  *
327
339
  * **Input:** send `file` (PDF, PNG, JPEG or TIFF; repeat the field for up to 10 documents) or `upload_ids`, plus a JSON `request` with the options below. You can also send a JSON body with `input` set to `{"document_ref": "..."}` to classify a child document returned by Split.
328
340
  *
341
+ * **Availability:** options are enabled per deployment. If your deployment does not support an option, the request fails with `400 INVALID_REQUEST` (for example `additional properties 'scope' not allowed`). Call `GET /doc-ai/v1/capabilities` to see what is enabled, and send only those options.
342
+ *
329
343
  * **Processing:** the job runs asynchronously. Poll `GET /doc-ai/v1/job/{job_id}/status` until it is `completed`, then fetch `GET /doc-ai/v1/job/{job_id}/results`. Add `?include=details` to the results for inspected pages, provenance and evidence.
330
344
  *
331
345
  * **Review:** `review_required` tells you whether a person should check the answer. `confidence` can be `null`; it is a token-based score, not a measured probability.
@@ -411,7 +425,9 @@ class DocAiClient {
411
425
  *
412
426
  * **Input:** send `file` (PDF, PNG, JPEG or TIFF; repeat the field for up to 10 documents) or `upload_ids`, plus a JSON `request`.
413
427
  *
414
- * **Processing:** the job runs asynchronously. Poll `GET /doc-ai/v1/job/{job_id}/status` until it is `completed`, then fetch `GET /doc-ai/v1/job/{job_id}/results`. `completed` means processing finished, not that every segment passed review: check each segment's `review.required`.
428
+ * **Availability:** options are enabled per deployment. If your deployment does not support an option, the request fails with `400 INVALID_REQUEST` (for example `additional properties 'scope' not allowed`). Call `GET /doc-ai/v1/capabilities` to see what is enabled, and send only those options.
429
+ *
430
+ * **Processing:** the job runs asynchronously. Poll `GET /doc-ai/v1/job/{job_id}/status` until it is `completed`, then fetch `GET /doc-ai/v1/job/{job_id}/results`. `completed` means processing finished, not that every segment passed review: check `review_required` on each segment.
415
431
  *
416
432
  * @param {SarvamAI.DocAiSplitRequest} request
417
433
  * @param {DocAiClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -557,7 +573,7 @@ class DocAiClient {
557
573
  * })
558
574
  *
559
575
  * @example
560
- * await client.docAi.getResults("20260707_9f1c2b3a-4d5e-6f70-8a9b-c0d1e2f3a4b5", {
576
+ * await client.docAi.getResults("01a1b292-8d3d-710e-974c-fe45aa5bc7ce", {
561
577
  * format: "json"
562
578
  * })
563
579
  *
@@ -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 {
@@ -13,13 +14,17 @@ export interface DocAiExtractRequest {
13
14
  upload_ids?: string;
14
15
  /** Inline extraction schema as a JSON string. The root must be `type: "object"` with non-empty `properties`; every field needs a `type` and a non-empty `description`. Supported types: `string`, `number`, `integer`, `boolean`, `object`, `array` (objects need `properties`, arrays need `items`); optional `enum`; maximum nesting depth 4. Exactly one of `schema` and `config_id` is required. */
15
16
  schema?: string;
16
- /** Saved extraction configuration ID. Exactly one of `schema` and `config_id` is required. To get your config_id, see [Reuse a schema](/api/api-guides-tutorials/document-intelligence/how-to/extract#reuse-a-schema). */
17
+ /** Saved extraction configuration ID. Exactly one of `schema` and `config_id` is required. To get your config_id, see [Reuse a schema](/api/api-guides-tutorials/document-intelligence/extract#reuse-a-schema). */
17
18
  config_id?: string;
19
+ /** Language code of the document (BCP-47), e.g. `en-IN`, `hi-IN`. Always pass the correct code for best accuracy. */
20
+ language?: string;
18
21
  /** Output format of the extraction results. */
19
22
  output_format?: DocAiExtractRequest.OutputFormat;
23
+ /** Extraction mode. `basic` (default) runs the standard extraction pipeline; `advanced` runs the enhanced pipeline for complex documents. */
24
+ mode?: DocAiExtractRequest.Mode;
20
25
  /** Enable document classification. Boolean sent as text: `true` or `false`. */
21
26
  classification?: string;
22
- /** Model to use for extraction. */
27
+ /** Model to use for extraction. Leave unset to use the default. */
23
28
  model?: string;
24
29
  }
25
30
  export declare namespace DocAiExtractRequest {
@@ -30,4 +35,10 @@ export declare namespace DocAiExtractRequest {
30
35
  readonly Xlsx: "xlsx";
31
36
  };
32
37
  type OutputFormat = (typeof OutputFormat)[keyof typeof OutputFormat];
38
+ /** Extraction mode. `basic` (default) runs the standard extraction pipeline; `advanced` runs the enhanced pipeline for complex documents. */
39
+ const Mode: {
40
+ readonly Basic: "basic";
41
+ readonly Advanced: "advanced";
42
+ };
43
+ type Mode = (typeof Mode)[keyof typeof Mode];
33
44
  }
@@ -10,4 +10,9 @@ var DocAiExtractRequest;
10
10
  Csv: "csv",
11
11
  Xlsx: "xlsx",
12
12
  };
13
+ /** Extraction mode. `basic` (default) runs the standard extraction pipeline; `advanced` runs the enhanced pipeline for complex documents. */
14
+ DocAiExtractRequest.Mode = {
15
+ Basic: "basic",
16
+ Advanced: "advanced",
17
+ };
13
18
  })(DocAiExtractRequest || (exports.DocAiExtractRequest = DocAiExtractRequest = {}));
@@ -1,4 +1,3 @@
1
- import type * as SarvamAI from "../../../../index.js";
2
1
  /**
3
2
  * @example
4
3
  * {
@@ -17,8 +16,8 @@ import type * as SarvamAI from "../../../../index.js";
17
16
  * {}
18
17
  */
19
18
  export interface DocAiGetResultsRequest {
20
- /** Output format of the results. Choose `md` for Markdown, `html` for HTML, or `json` for structured JSON. If you omit `format`, the results are returned as `json` by default. */
21
- format?: SarvamAI.Format;
19
+ /** Output format of the results. `json` (the default) returns the JSON results described below. To get the HTML or Markdown output of a Parse job, use `GET /doc-ai/v1/job/{job_id}/download-url`. */
20
+ format?: "json";
22
21
  /** Set to `details` for Classify and Split jobs to add inspected pages, provenance and boundary details. Supporting evidence also needs `output.include_evidence` on the request. */
23
22
  include?: "details";
24
23
  }
@@ -1,7 +1,9 @@
1
1
  import type * as core from "../../../../../core/index.js";
2
2
  /**
3
3
  * @example
4
- * {}
4
+ * {
5
+ * language: "en-IN"
6
+ * }
5
7
  */
6
8
  export interface DocAiParseRequest {
7
9
  /** Document file(s) to parse. Repeatable multipart part. Exactly one of `file` and `upload_ids` must be provided. */
@@ -10,13 +12,22 @@ export interface DocAiParseRequest {
10
12
  upload_ids?: string;
11
13
  /** Language of the document in BCP-47 format (e.g. `hi-IN`, `en-IN`). Defaults to Indic: when omitted, the document is processed as an Indic-language document. To process an English document, set `language` to `en-IN`. Sarvam Vision supports 22 Indian languages plus English; see the [Sarvam Vision model page](/api/api-guides-tutorials/models/sarvam-vision) for the full list. */
12
14
  language?: string;
13
- /** Nature of the document content. */
15
+ /** Output format of the parsed document: `html` (default), `md` (Markdown), or `json` (structured blocks). Fetch the output with the download-url endpoint. */
16
+ output_format?: DocAiParseRequest.OutputFormat;
17
+ /** Nature of the document content: `printed` (typed or printed text), `handwritten`, or `mixed`. */
14
18
  content_type?: DocAiParseRequest.ContentType;
15
- /** Model to use for digitisation. */
19
+ /** Model to use for parsing. Leave unset to use the default. */
16
20
  model?: string;
17
21
  }
18
22
  export declare namespace DocAiParseRequest {
19
- /** Nature of the document content. */
23
+ /** Output format of the parsed document: `html` (default), `md` (Markdown), or `json` (structured blocks). Fetch the output with the download-url endpoint. */
24
+ const OutputFormat: {
25
+ readonly Html: "html";
26
+ readonly Md: "md";
27
+ readonly Json: "json";
28
+ };
29
+ type OutputFormat = (typeof OutputFormat)[keyof typeof OutputFormat];
30
+ /** Nature of the document content: `printed` (typed or printed text), `handwritten`, or `mixed`. */
20
31
  const ContentType: {
21
32
  readonly Printed: "printed";
22
33
  readonly Handwritten: "handwritten";
@@ -4,7 +4,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.DocAiParseRequest = void 0;
5
5
  var DocAiParseRequest;
6
6
  (function (DocAiParseRequest) {
7
- /** Nature of the document content. */
7
+ /** Output format of the parsed document: `html` (default), `md` (Markdown), or `json` (structured blocks). Fetch the output with the download-url endpoint. */
8
+ DocAiParseRequest.OutputFormat = {
9
+ Html: "html",
10
+ Md: "md",
11
+ Json: "json",
12
+ };
13
+ /** Nature of the document content: `printed` (typed or printed text), `handwritten`, or `mixed`. */
8
14
  DocAiParseRequest.ContentType = {
9
15
  Printed: "printed",
10
16
  Handwritten: "handwritten",
@@ -1,5 +1,5 @@
1
1
  import type * as SarvamAI from "../../../index.js";
2
- export type DocAiGetResultsResponse = SarvamAI.DocAiGetResultsResponse.Extract | SarvamAI.DocAiGetResultsResponse.Parse | SarvamAI.DocAiGetResultsResponse.Classify | SarvamAI.DocAiGetResultsResponse.Split;
2
+ export type DocAiGetResultsResponse = SarvamAI.DocAiGetResultsResponse.Extract | SarvamAI.DocAiGetResultsResponse.Parse | SarvamAI.DocAiGetResultsResponse.Digitise | SarvamAI.DocAiGetResultsResponse.Classify | SarvamAI.DocAiGetResultsResponse.Split;
3
3
  export declare namespace DocAiGetResultsResponse {
4
4
  interface Extract extends SarvamAI.DocAiExtractResults {
5
5
  type: "extract";
@@ -7,6 +7,9 @@ export declare namespace DocAiGetResultsResponse {
7
7
  interface Parse extends SarvamAI.DocAiParseResults {
8
8
  type: "parse";
9
9
  }
10
+ interface Digitise extends SarvamAI.DocAiParseResults {
11
+ type: "digitise";
12
+ }
10
13
  interface Classify extends SarvamAI.DocAiClassifyResults {
11
14
  type: "classify";
12
15
  }
@@ -1,2 +1 @@
1
1
  export * from "./DocAiGetResultsResponse.js";
2
- export * from "./Format.js";
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./DocAiGetResultsResponse.js"), exports);
18
- __exportStar(require("./Format.js"), exports);
@@ -27,8 +27,8 @@ export declare class DubbingClient {
27
27
  * @param {SarvamAI.CreateDubbingJobRequest} request
28
28
  * @param {DubbingClient.RequestOptions} requestOptions - Request-specific configuration.
29
29
  *
30
+ * @throws {@link SarvamAI.BadRequestError}
30
31
  * @throws {@link SarvamAI.UnauthorizedError}
31
- * @throws {@link SarvamAI.UnprocessableEntityError}
32
32
  * @throws {@link SarvamAI.InternalServerError}
33
33
  *
34
34
  * @example
@@ -53,8 +53,8 @@ export declare class DubbingClient {
53
53
  * @param {string} job_id - The `job_id` returned by `POST /jobs`.
54
54
  * @param {DubbingClient.RequestOptions} requestOptions - Request-specific configuration.
55
55
  *
56
+ * @throws {@link SarvamAI.BadRequestError}
56
57
  * @throws {@link SarvamAI.UnauthorizedError}
57
- * @throws {@link SarvamAI.UnprocessableEntityError}
58
58
  * @throws {@link SarvamAI.InternalServerError}
59
59
  *
60
60
  * @example
@@ -70,8 +70,8 @@ export declare class DubbingClient {
70
70
  * @param {string} job_id - The `job_id` returned by `POST /jobs`.
71
71
  * @param {DubbingClient.RequestOptions} requestOptions - Request-specific configuration.
72
72
  *
73
+ * @throws {@link SarvamAI.BadRequestError}
73
74
  * @throws {@link SarvamAI.UnauthorizedError}
74
- * @throws {@link SarvamAI.UnprocessableEntityError}
75
75
  * @throws {@link SarvamAI.InternalServerError}
76
76
  *
77
77
  * @example
@@ -90,8 +90,8 @@ export declare class DubbingClient {
90
90
  * @param {SarvamAI.DubbingGetExportStatusRequest} request
91
91
  * @param {DubbingClient.RequestOptions} requestOptions - Request-specific configuration.
92
92
  *
93
+ * @throws {@link SarvamAI.BadRequestError}
93
94
  * @throws {@link SarvamAI.UnauthorizedError}
94
- * @throws {@link SarvamAI.UnprocessableEntityError}
95
95
  * @throws {@link SarvamAI.InternalServerError}
96
96
  *
97
97
  * @example
@@ -72,8 +72,8 @@ class DubbingClient {
72
72
  * @param {SarvamAI.CreateDubbingJobRequest} request
73
73
  * @param {DubbingClient.RequestOptions} requestOptions - Request-specific configuration.
74
74
  *
75
+ * @throws {@link SarvamAI.BadRequestError}
75
76
  * @throws {@link SarvamAI.UnauthorizedError}
76
- * @throws {@link SarvamAI.UnprocessableEntityError}
77
77
  * @throws {@link SarvamAI.InternalServerError}
78
78
  *
79
79
  * @example
@@ -115,10 +115,10 @@ class DubbingClient {
115
115
  }
116
116
  if (_response.error.reason === "status-code") {
117
117
  switch (_response.error.statusCode) {
118
+ case 400:
119
+ throw new SarvamAI.BadRequestError(_response.error.body, _response.rawResponse);
118
120
  case 401:
119
121
  throw new SarvamAI.UnauthorizedError(_response.error.body, _response.rawResponse);
120
- case 422:
121
- throw new SarvamAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
122
122
  case 500:
123
123
  throw new SarvamAI.InternalServerError(_response.error.body, _response.rawResponse);
124
124
  default:
@@ -140,8 +140,8 @@ class DubbingClient {
140
140
  * @param {string} job_id - The `job_id` returned by `POST /jobs`.
141
141
  * @param {DubbingClient.RequestOptions} requestOptions - Request-specific configuration.
142
142
  *
143
+ * @throws {@link SarvamAI.BadRequestError}
143
144
  * @throws {@link SarvamAI.UnauthorizedError}
144
- * @throws {@link SarvamAI.UnprocessableEntityError}
145
145
  * @throws {@link SarvamAI.InternalServerError}
146
146
  *
147
147
  * @example
@@ -171,10 +171,10 @@ class DubbingClient {
171
171
  }
172
172
  if (_response.error.reason === "status-code") {
173
173
  switch (_response.error.statusCode) {
174
+ case 400:
175
+ throw new SarvamAI.BadRequestError(_response.error.body, _response.rawResponse);
174
176
  case 401:
175
177
  throw new SarvamAI.UnauthorizedError(_response.error.body, _response.rawResponse);
176
- case 422:
177
- throw new SarvamAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
178
178
  case 500:
179
179
  throw new SarvamAI.InternalServerError(_response.error.body, _response.rawResponse);
180
180
  default:
@@ -196,8 +196,8 @@ class DubbingClient {
196
196
  * @param {string} job_id - The `job_id` returned by `POST /jobs`.
197
197
  * @param {DubbingClient.RequestOptions} requestOptions - Request-specific configuration.
198
198
  *
199
+ * @throws {@link SarvamAI.BadRequestError}
199
200
  * @throws {@link SarvamAI.UnauthorizedError}
200
- * @throws {@link SarvamAI.UnprocessableEntityError}
201
201
  * @throws {@link SarvamAI.InternalServerError}
202
202
  *
203
203
  * @example
@@ -227,10 +227,10 @@ class DubbingClient {
227
227
  }
228
228
  if (_response.error.reason === "status-code") {
229
229
  switch (_response.error.statusCode) {
230
+ case 400:
231
+ throw new SarvamAI.BadRequestError(_response.error.body, _response.rawResponse);
230
232
  case 401:
231
233
  throw new SarvamAI.UnauthorizedError(_response.error.body, _response.rawResponse);
232
- case 422:
233
- throw new SarvamAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
234
234
  case 500:
235
235
  throw new SarvamAI.InternalServerError(_response.error.body, _response.rawResponse);
236
236
  default:
@@ -255,8 +255,8 @@ class DubbingClient {
255
255
  * @param {SarvamAI.DubbingGetExportStatusRequest} request
256
256
  * @param {DubbingClient.RequestOptions} requestOptions - Request-specific configuration.
257
257
  *
258
+ * @throws {@link SarvamAI.BadRequestError}
258
259
  * @throws {@link SarvamAI.UnauthorizedError}
259
- * @throws {@link SarvamAI.UnprocessableEntityError}
260
260
  * @throws {@link SarvamAI.InternalServerError}
261
261
  *
262
262
  * @example
@@ -292,10 +292,10 @@ class DubbingClient {
292
292
  }
293
293
  if (_response.error.reason === "status-code") {
294
294
  switch (_response.error.statusCode) {
295
+ case 400:
296
+ throw new SarvamAI.BadRequestError(_response.error.body, _response.rawResponse);
295
297
  case 401:
296
298
  throw new SarvamAI.UnauthorizedError(_response.error.body, _response.rawResponse);
297
- case 422:
298
- throw new SarvamAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
299
299
  case 500:
300
300
  throw new SarvamAI.InternalServerError(_response.error.body, _response.rawResponse);
301
301
  default:
@@ -13,8 +13,8 @@ import type * as SarvamAI from "../../../../index.js";
13
13
  * }
14
14
  */
15
15
  export interface CreateDubbingJobRequest {
16
- /** Source language of the input media (BCP-47). */
17
- src_lang: SarvamAI.DubbingLanguage;
16
+ /** Source language of the input media (BCP-47), or `auto` to detect it. Pass the language when you know it: detection is not always accurate. See [Specify Language Codes](/api/api-guides-tutorials/dubbing/how-to/specify-language-codes). */
17
+ src_lang: SarvamAI.DubbingSourceLanguage;
18
18
  /** One or more target languages to dub into. A single job dubs into all of them. */
19
19
  target_langs: SarvamAI.DubbingLanguage[];
20
20
  /** Which formats to auto-produce per target language. When provided, only the listed formats are auto-exported. Accepted values: `video` (dubbed MP4), `audio` (dubbed voice over the background, `.wav`), `audio_vocals` (dubbed voice alone, `.wav`), `srt` and `vtt` (subtitles of the dubbed text). When omitted, only the dubbed video (MP4) is produced; request audio and subtitles explicitly. Audio-only sources cannot produce a video, so `video` resolves to `audio` for them. */
@@ -19,7 +19,7 @@ export interface ResponsesCreateRequest {
19
19
  tools?: SarvamAI.ResponseFunctionTool[];
20
20
  /** Forwarded exactly as written: `none`, `auto`, `required`, `{ "type": "function", "name": "..." }`, or another object. */
21
21
  tool_choice?: ResponsesCreateRequest.ToolChoice;
22
- /** Optional reasoning config for `glm5.3`, `glm5.3-flash`, `gemma4`, `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3`, `mimo-v2.6-flash`, `mimo-v2.6-pro`. **`effort`:** on `glm5.3` and `glm5.3-flash`, `low` or `high` only (the literal string `max` returns `400`; omitting it gives `max` on `glm5.3` and `high` on `glm5.3-flash`); on `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3`, `mimo-v2.6-flash`, and `mimo-v2.6-pro`, `low`, `high`, or `max` all work directly. The trace is in the reasoning item's `content[0].text`; `summary` is filled only when `summary` is set. Optional **`summary`:** `auto` or `detailed`. */
22
+ /** Optional reasoning config for `glm5.3`, `glm5.3-flash`, `gemma4`, `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3.1-pro`. **`effort`:** on `glm5.3` and `glm5.3-flash`, `low` or `high` only (the literal string `max` returns `400`; omitting it gives `max` on `glm5.3` and `high` on `glm5.3-flash`); on `deepseekv4.1-flash-1017`, `deepseekv4-pro`, and `kimi-k3.1-pro`, `low`, `high`, or `max` all work directly. The trace is in the reasoning item's `content[0].text`; `summary` is filled only when `summary` is set. Optional **`summary`:** `auto` or `detailed`. */
23
23
  reasoning?: SarvamAI.ResponseReasoning;
24
24
  /** Merged into the outbound body. Must not overwrite any modelled field (`400`). `max_tool_calls` and `prompt` are `400` here and in `extra_body` — not supported by any serving deployment. */
25
25
  extra_body?: Record<string, unknown>;
@@ -19,7 +19,7 @@ export interface ResponsesCreateStreamRequest {
19
19
  tools?: SarvamAI.ResponseFunctionTool[];
20
20
  /** Forwarded exactly as written: `none`, `auto`, `required`, `{ "type": "function", "name": "..." }`, or another object. */
21
21
  tool_choice?: ResponsesCreateStreamRequest.ToolChoice;
22
- /** Optional reasoning config for `glm5.3`, `glm5.3-flash`, `gemma4`, `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3`, `mimo-v2.6-flash`, `mimo-v2.6-pro`. **`effort`:** on `glm5.3` and `glm5.3-flash`, `low` or `high` only (the literal string `max` returns `400`; omitting it gives `max` on `glm5.3` and `high` on `glm5.3-flash`); on `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3`, `mimo-v2.6-flash`, and `mimo-v2.6-pro`, `low`, `high`, or `max` all work directly. The trace is in the reasoning item's `content[0].text`; `summary` is filled only when `summary` is set. Optional **`summary`:** `auto` or `detailed`. */
22
+ /** Optional reasoning config for `glm5.3`, `glm5.3-flash`, `gemma4`, `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3.1-pro`. **`effort`:** on `glm5.3` and `glm5.3-flash`, `low` or `high` only (the literal string `max` returns `400`; omitting it gives `max` on `glm5.3` and `high` on `glm5.3-flash`); on `deepseekv4.1-flash-1017`, `deepseekv4-pro`, and `kimi-k3.1-pro`, `low`, `high`, or `max` all work directly. The trace is in the reasoning item's `content[0].text`; `summary` is filled only when `summary` is set. Optional **`summary`:** `auto` or `detailed`. */
23
23
  reasoning?: SarvamAI.ResponseReasoning;
24
24
  /** Merged into the outbound body. Must not overwrite any modelled field (`400`). `max_tool_calls` and `prompt` are `400` here and in `extra_body` — not supported by any serving deployment. */
25
25
  extra_body?: Record<string, unknown>;
@@ -9,7 +9,7 @@ export interface Choice {
9
9
  finish_reason: SarvamAI.FinishReason;
10
10
  /** The index of the choice in the list of choices. */
11
11
  index: number;
12
- /** Token log probabilities when supported (`sarvam-105b`, `gemma4`, `glm5.3-flash`, `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3`, `mimo-v2.6-flash`, `mimo-v2.6-pro`). Always `null` on `glm5.3`, which doesn't support this field. */
12
+ /** Token log probabilities when supported (`sarvam-105b`, `gemma4`, `glm5.3-flash`, `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3.1-pro`). Always `null` on `glm5.3`, which doesn't support this field. */
13
13
  logprobs?: Record<string, unknown> | undefined;
14
14
  message: SarvamAI.ChatCompletionResponseMessage;
15
15
  }
@@ -14,7 +14,7 @@ export interface CreateResponseV2Request {
14
14
  tools?: SarvamAI.ResponseFunctionTool[] | undefined;
15
15
  /** Forwarded exactly as written: `none`, `auto`, `required`, `{ "type": "function", "name": "..." }`, or another object. */
16
16
  tool_choice?: CreateResponseV2Request.ToolChoice | undefined;
17
- /** Optional reasoning config for `glm5.3`, `glm5.3-flash`, `gemma4`, `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3`, `mimo-v2.6-flash`, `mimo-v2.6-pro`. **`effort`:** on `glm5.3` and `glm5.3-flash`, `low` or `high` only (the literal string `max` returns `400`; omitting it gives `max` on `glm5.3` and `high` on `glm5.3-flash`); on `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3`, `mimo-v2.6-flash`, and `mimo-v2.6-pro`, `low`, `high`, or `max` all work directly. The trace is in the reasoning item's `content[0].text`; `summary` is filled only when `summary` is set. Optional **`summary`:** `auto` or `detailed`. */
17
+ /** Optional reasoning config for `glm5.3`, `glm5.3-flash`, `gemma4`, `deepseekv4.1-flash-1017`, `deepseekv4-pro`, `kimi-k3.1-pro`. **`effort`:** on `glm5.3` and `glm5.3-flash`, `low` or `high` only (the literal string `max` returns `400`; omitting it gives `max` on `glm5.3` and `high` on `glm5.3-flash`); on `deepseekv4.1-flash-1017`, `deepseekv4-pro`, and `kimi-k3.1-pro`, `low`, `high`, or `max` all work directly. The trace is in the reasoning item's `content[0].text`; `summary` is filled only when `summary` is set. Optional **`summary`:** `auto` or `detailed`. */
18
18
  reasoning?: SarvamAI.ResponseReasoning | undefined;
19
19
  /** Merged into the outbound body. Must not overwrite any modelled field (`400`). `max_tool_calls` and `prompt` are `400` here and in `extra_body` — not supported by any serving deployment. */
20
20
  extra_body?: Record<string, unknown> | undefined;
@@ -4,7 +4,7 @@ export interface DocAiJobStatusResponse {
4
4
  job_id: string;
5
5
  /** Current status of the job. Terminal statuses: `completed`, `partially_completed`, `failed`, `rejected`. */
6
6
  status: string;
7
- /** Job pipeline: `parse` or `extract`. Classify and Split jobs report `type` instead. */
7
+ /** Job pipeline: `digitise` for Parse jobs (the pipeline Parse runs on) or `extract`. Classify and Split jobs report `type` instead. */
8
8
  pipeline?: string | undefined;
9
9
  usage: SarvamAI.DocAiUsage;
10
10
  /** Job creation timestamp. */
@@ -1,6 +1,6 @@
1
1
  import type * as SarvamAI from "../index.js";
2
2
  /**
3
- * Job results for the `parse` pipeline.
3
+ * Job results for a Parse job. The API currently reports `digitise` as the `type` of Parse jobs; `parse` is accepted as an alias.
4
4
  */
5
5
  export interface DocAiParseResults {
6
6
  /** The unique identifier of the job. */
@@ -8,23 +8,56 @@ export interface DocAiParseResults {
8
8
  /** Terminal status of the job: `completed`, `partially_completed`, `failed`, or `rejected`. */
9
9
  status: string;
10
10
  usage: SarvamAI.DocAiUsage;
11
- /** One entry per input document, each holding per-page content. */
11
+ /** One entry per input document, each holding per-page blocks. To get the HTML, Markdown, or JSON output file, use the download-url endpoint. */
12
12
  documents: DocAiParseResults.Documents.Item[];
13
13
  }
14
14
  export declare namespace DocAiParseResults {
15
15
  type Documents = Documents.Item[];
16
16
  namespace Documents {
17
17
  interface Item {
18
- file_name?: string | undefined;
18
+ /** Name of the uploaded file. */
19
+ filename?: string | undefined;
20
+ page_count?: number | undefined;
21
+ status?: string | undefined;
22
+ /** Language code the document was processed with. */
23
+ language?: string | undefined;
24
+ /** `true` when some pages did not process. */
25
+ partial?: boolean | undefined;
26
+ warnings?: string[] | undefined;
19
27
  pages?: Item.Pages.Item[] | undefined;
20
28
  }
21
29
  namespace Item {
22
30
  type Pages = Pages.Item[];
23
31
  namespace Pages {
24
32
  interface Item {
25
- page_number?: number | undefined;
26
- /** Page content in the requested output_format (HTML or Markdown). */
27
- content?: string | undefined;
33
+ page_num?: number | undefined;
34
+ status?: string | undefined;
35
+ image_width?: number | undefined;
36
+ image_height?: number | undefined;
37
+ /** Text blocks in reading order, each with its text, layout tag, and bounding box. */
38
+ blocks?: Item.Blocks.Item[] | undefined;
39
+ }
40
+ namespace Item {
41
+ type Blocks = Blocks.Item[];
42
+ namespace Blocks {
43
+ interface Item {
44
+ block_id?: string | undefined;
45
+ text?: string | undefined;
46
+ /** Block type, such as `paragraph`. */
47
+ layout_tag?: string | undefined;
48
+ reading_order?: number | undefined;
49
+ coordinates?: Item.Coordinates | undefined;
50
+ bbox_norm?: number[] | undefined;
51
+ }
52
+ namespace Item {
53
+ interface Coordinates {
54
+ x1?: number | undefined;
55
+ y1?: number | undefined;
56
+ x2?: number | undefined;
57
+ y2?: number | undefined;
58
+ }
59
+ }
60
+ }
28
61
  }
29
62
  }
30
63
  }
@@ -1,5 +1,5 @@
1
1
  export interface DocAiPresignUploadResponse {
2
- /** Handle for the uploaded file. Pass it through `upload_ids` on a later parse or extract job request. */
2
+ /** Handle for the uploaded file. Pass it through `upload_ids` on a later parse, extract, classify, or split job request. */
3
3
  upload_id: string;
4
4
  /** HTTP method to use for the upload (e.g. `PUT`). */
5
5
  method: string;