@llamaindex/llama-cloud 2.2.0 → 2.4.0

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 (172) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/internal/utils/env.js +2 -2
  9. package/internal/utils/env.js.map +1 -1
  10. package/internal/utils/env.mjs +2 -2
  11. package/internal/utils/env.mjs.map +1 -1
  12. package/package.json +1 -1
  13. package/resources/beta/agent-data.d.mts +57 -0
  14. package/resources/beta/agent-data.d.mts.map +1 -1
  15. package/resources/beta/agent-data.d.ts +57 -0
  16. package/resources/beta/agent-data.d.ts.map +1 -1
  17. package/resources/beta/agent-data.js +57 -0
  18. package/resources/beta/agent-data.js.map +1 -1
  19. package/resources/beta/agent-data.mjs +57 -0
  20. package/resources/beta/agent-data.mjs.map +1 -1
  21. package/resources/beta/batch/batch.d.mts +27 -0
  22. package/resources/beta/batch/batch.d.mts.map +1 -1
  23. package/resources/beta/batch/batch.d.ts +27 -0
  24. package/resources/beta/batch/batch.d.ts.map +1 -1
  25. package/resources/beta/batch/batch.js +27 -0
  26. package/resources/beta/batch/batch.js.map +1 -1
  27. package/resources/beta/batch/batch.mjs +27 -0
  28. package/resources/beta/batch/batch.mjs.map +1 -1
  29. package/resources/beta/batch/job-items.d.mts +18 -0
  30. package/resources/beta/batch/job-items.d.mts.map +1 -1
  31. package/resources/beta/batch/job-items.d.ts +18 -0
  32. package/resources/beta/batch/job-items.d.ts.map +1 -1
  33. package/resources/beta/batch/job-items.js +18 -0
  34. package/resources/beta/batch/job-items.js.map +1 -1
  35. package/resources/beta/batch/job-items.mjs +18 -0
  36. package/resources/beta/batch/job-items.mjs.map +1 -1
  37. package/resources/beta/beta.d.mts +0 -4
  38. package/resources/beta/beta.d.mts.map +1 -1
  39. package/resources/beta/beta.d.ts +0 -4
  40. package/resources/beta/beta.d.ts.map +1 -1
  41. package/resources/beta/beta.js +0 -4
  42. package/resources/beta/beta.js.map +1 -1
  43. package/resources/beta/beta.mjs +0 -4
  44. package/resources/beta/beta.mjs.map +1 -1
  45. package/resources/beta/directories/directories.d.mts +34 -0
  46. package/resources/beta/directories/directories.d.mts.map +1 -1
  47. package/resources/beta/directories/directories.d.ts +34 -0
  48. package/resources/beta/directories/directories.d.ts.map +1 -1
  49. package/resources/beta/directories/directories.js +34 -0
  50. package/resources/beta/directories/directories.js.map +1 -1
  51. package/resources/beta/directories/directories.mjs +34 -0
  52. package/resources/beta/directories/directories.mjs.map +1 -1
  53. package/resources/beta/directories/files.d.mts +93 -0
  54. package/resources/beta/directories/files.d.mts.map +1 -1
  55. package/resources/beta/directories/files.d.ts +93 -0
  56. package/resources/beta/directories/files.d.ts.map +1 -1
  57. package/resources/beta/directories/files.js +50 -0
  58. package/resources/beta/directories/files.js.map +1 -1
  59. package/resources/beta/directories/files.mjs +50 -0
  60. package/resources/beta/directories/files.mjs.map +1 -1
  61. package/resources/beta/index.d.mts +0 -1
  62. package/resources/beta/index.d.mts.map +1 -1
  63. package/resources/beta/index.d.ts +0 -1
  64. package/resources/beta/index.d.ts.map +1 -1
  65. package/resources/beta/index.js +1 -3
  66. package/resources/beta/index.js.map +1 -1
  67. package/resources/beta/index.mjs +0 -1
  68. package/resources/beta/index.mjs.map +1 -1
  69. package/resources/beta/sheets.d.mts +38 -0
  70. package/resources/beta/sheets.d.mts.map +1 -1
  71. package/resources/beta/sheets.d.ts +38 -0
  72. package/resources/beta/sheets.d.ts.map +1 -1
  73. package/resources/beta/sheets.js +38 -0
  74. package/resources/beta/sheets.js.map +1 -1
  75. package/resources/beta/sheets.mjs +38 -0
  76. package/resources/beta/sheets.mjs.map +1 -1
  77. package/resources/beta/split.d.mts +25 -10
  78. package/resources/beta/split.d.mts.map +1 -1
  79. package/resources/beta/split.d.ts +25 -10
  80. package/resources/beta/split.d.ts.map +1 -1
  81. package/resources/beta/split.js +21 -6
  82. package/resources/beta/split.js.map +1 -1
  83. package/resources/beta/split.mjs +21 -6
  84. package/resources/beta/split.mjs.map +1 -1
  85. package/resources/classify.d.mts +70 -0
  86. package/resources/classify.d.mts.map +1 -1
  87. package/resources/classify.d.ts +70 -0
  88. package/resources/classify.d.ts.map +1 -1
  89. package/resources/classify.js +113 -0
  90. package/resources/classify.js.map +1 -1
  91. package/resources/classify.mjs +113 -0
  92. package/resources/classify.mjs.map +1 -1
  93. package/resources/configurations.d.mts +214 -13
  94. package/resources/configurations.d.mts.map +1 -1
  95. package/resources/configurations.d.ts +214 -13
  96. package/resources/configurations.d.ts.map +1 -1
  97. package/resources/extract.d.mts +16 -6
  98. package/resources/extract.d.mts.map +1 -1
  99. package/resources/extract.d.ts +16 -6
  100. package/resources/extract.d.ts.map +1 -1
  101. package/resources/extract.js +14 -1
  102. package/resources/extract.js.map +1 -1
  103. package/resources/extract.mjs +14 -1
  104. package/resources/extract.mjs.map +1 -1
  105. package/resources/index.d.mts +1 -1
  106. package/resources/index.d.mts.map +1 -1
  107. package/resources/index.d.ts +1 -1
  108. package/resources/index.d.ts.map +1 -1
  109. package/resources/index.js.map +1 -1
  110. package/resources/index.mjs.map +1 -1
  111. package/resources/parsing.d.mts +5 -4
  112. package/resources/parsing.d.mts.map +1 -1
  113. package/resources/parsing.d.ts +5 -4
  114. package/resources/parsing.d.ts.map +1 -1
  115. package/resources/pipelines/documents.d.mts +0 -3
  116. package/resources/pipelines/documents.d.mts.map +1 -1
  117. package/resources/pipelines/documents.d.ts +0 -3
  118. package/resources/pipelines/documents.d.ts.map +1 -1
  119. package/resources/pipelines/pipelines.d.mts +0 -7
  120. package/resources/pipelines/pipelines.d.mts.map +1 -1
  121. package/resources/pipelines/pipelines.d.ts +0 -7
  122. package/resources/pipelines/pipelines.d.ts.map +1 -1
  123. package/resources/pipelines/pipelines.js.map +1 -1
  124. package/resources/pipelines/pipelines.mjs.map +1 -1
  125. package/resources/retrievers/index.d.mts +1 -1
  126. package/resources/retrievers/index.d.mts.map +1 -1
  127. package/resources/retrievers/index.d.ts +1 -1
  128. package/resources/retrievers/index.d.ts.map +1 -1
  129. package/resources/retrievers/index.js.map +1 -1
  130. package/resources/retrievers/index.mjs.map +1 -1
  131. package/resources/retrievers/retrievers.d.mts +17 -5
  132. package/resources/retrievers/retrievers.d.mts.map +1 -1
  133. package/resources/retrievers/retrievers.d.ts +17 -5
  134. package/resources/retrievers/retrievers.d.ts.map +1 -1
  135. package/resources/retrievers/retrievers.js +10 -3
  136. package/resources/retrievers/retrievers.js.map +1 -1
  137. package/resources/retrievers/retrievers.mjs +10 -3
  138. package/resources/retrievers/retrievers.mjs.map +1 -1
  139. package/src/client.ts +2 -0
  140. package/src/internal/utils/env.ts +2 -2
  141. package/src/resources/beta/agent-data.ts +57 -0
  142. package/src/resources/beta/batch/batch.ts +27 -0
  143. package/src/resources/beta/batch/job-items.ts +18 -0
  144. package/src/resources/beta/beta.ts +0 -29
  145. package/src/resources/beta/directories/directories.ts +34 -0
  146. package/src/resources/beta/directories/files.ts +86 -0
  147. package/src/resources/beta/index.ts +0 -12
  148. package/src/resources/beta/sheets.ts +38 -0
  149. package/src/resources/beta/split.ts +25 -10
  150. package/src/resources/classify.ts +130 -0
  151. package/src/resources/configurations.ts +256 -8
  152. package/src/resources/extract.ts +16 -7
  153. package/src/resources/index.ts +1 -0
  154. package/src/resources/parsing.ts +9 -2
  155. package/src/resources/pipelines/documents.ts +0 -3
  156. package/src/resources/pipelines/pipelines.ts +0 -7
  157. package/src/resources/retrievers/index.ts +1 -0
  158. package/src/resources/retrievers/retrievers.ts +37 -5
  159. package/src/version.ts +1 -1
  160. package/version.d.mts +1 -1
  161. package/version.d.ts +1 -1
  162. package/version.js +1 -1
  163. package/version.mjs +1 -1
  164. package/resources/beta/parse-configurations.d.mts +0 -210
  165. package/resources/beta/parse-configurations.d.mts.map +0 -1
  166. package/resources/beta/parse-configurations.d.ts +0 -210
  167. package/resources/beta/parse-configurations.d.ts.map +0 -1
  168. package/resources/beta/parse-configurations.js +0 -84
  169. package/resources/beta/parse-configurations.js.map +0 -1
  170. package/resources/beta/parse-configurations.mjs +0 -80
  171. package/resources/beta/parse-configurations.mjs.map +0 -1
  172. package/src/resources/beta/parse-configurations.ts +0 -311
@@ -5,6 +5,7 @@ exports.Classify = void 0;
5
5
  const resource_1 = require("../core/resource.js");
6
6
  const pagination_1 = require("../core/pagination.js");
7
7
  const path_1 = require("../internal/utils/path.js");
8
+ const polling_1 = require("../core/polling.js");
8
9
  class Classify extends resource_1.APIResource {
9
10
  /**
10
11
  * Create a classify job.
@@ -19,6 +20,11 @@ class Classify extends resource_1.APIResource {
19
20
  *
20
21
  * The job runs asynchronously. Poll `GET /classify/{job_id}` to check status and
21
22
  * retrieve results.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const classify = await client.classify.create();
27
+ * ```
22
28
  */
23
29
  create(params, options) {
24
30
  const { organization_id, project_id, ...body } = params;
@@ -33,6 +39,14 @@ class Classify extends resource_1.APIResource {
33
39
  *
34
40
  * Filter by `status`, `configuration_id`, specific `job_ids`, or creation date
35
41
  * range.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * // Automatically fetches more pages as needed.
46
+ * for await (const classifyListResponse of client.classify.list()) {
47
+ * // ...
48
+ * }
49
+ * ```
36
50
  */
37
51
  list(query = {}, options) {
38
52
  return this._client.getAPIList('/api/v2/classify', (pagination_1.PaginatedCursor), {
@@ -45,10 +59,109 @@ class Classify extends resource_1.APIResource {
45
59
  *
46
60
  * Returns the job status, configuration, and classify result when complete. The
47
61
  * result includes the matched document type, confidence score, and reasoning.
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * const classify = await client.classify.get('job_id');
66
+ * ```
48
67
  */
49
68
  get(jobID, query = {}, options) {
50
69
  return this._client.get((0, path_1.path) `/api/v2/classify/${jobID}`, { query, ...options });
51
70
  }
71
+ /**
72
+ * Wait for a classify job to complete by polling until it reaches a terminal state.
73
+ *
74
+ * @param jobID - The ID of the classify job to wait for
75
+ * @param query - Optional query parameters (organization_id, project_id)
76
+ * @param options - Polling configuration and request options
77
+ * @returns The completed classify job
78
+ * @throws {PollingTimeoutError} If the job doesn't complete within the timeout period
79
+ * @throws {PollingError} If the job fails
80
+ *
81
+ * @example
82
+ * ```typescript
83
+ * const job = await client.classify.create({
84
+ * file_input: 'dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
85
+ * configuration_id: 'cfg-...',
86
+ * });
87
+ *
88
+ * const completed = await client.classify.waitForCompletion(job.id, undefined, { verbose: true });
89
+ * console.log(completed.result);
90
+ * ```
91
+ */
92
+ async waitForCompletion(jobID, query, options) {
93
+ const { pollingInterval, maxInterval, timeout, backoff, verbose, ...requestOptions } = options || {};
94
+ const getStatus = async () => {
95
+ return await this.get(jobID, query, requestOptions);
96
+ };
97
+ const isComplete = (job) => {
98
+ return job.status === 'COMPLETED';
99
+ };
100
+ const isError = (job) => {
101
+ return job.status === 'FAILED';
102
+ };
103
+ const getErrorMessage = (job) => {
104
+ const errorParts = [`Job ${jobID} failed with status: ${job.status}`];
105
+ if (job.error_message) {
106
+ errorParts.push(`Error: ${job.error_message}`);
107
+ }
108
+ return errorParts.join(' | ');
109
+ };
110
+ return await (0, polling_1.pollUntilComplete)(getStatus, isComplete, isError, getErrorMessage, {
111
+ pollingInterval,
112
+ maxInterval,
113
+ timeout: timeout || polling_1.DEFAULT_TIMEOUT,
114
+ backoff,
115
+ verbose,
116
+ });
117
+ }
118
+ /**
119
+ * Create a classify job, wait for it to complete, and return the result.
120
+ *
121
+ * This is a convenience method that combines create() and waitForCompletion()
122
+ * into a single call for the most common end-to-end workflow.
123
+ *
124
+ * @param params - Classify job creation parameters
125
+ * @param options - Polling configuration and request options
126
+ * @returns The completed classify job with result populated
127
+ * @throws {PollingTimeoutError} If the job doesn't complete within the timeout period
128
+ * @throws {PollingError} If the job fails
129
+ *
130
+ * @example
131
+ * ```typescript
132
+ * import { LlamaCloud } from 'llama-cloud';
133
+ *
134
+ * const client = new LlamaCloud({ apiKey: '...' });
135
+ *
136
+ * const result = await client.classify.run({
137
+ * file_input: 'dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
138
+ * configuration: {
139
+ * rules: [{ type: 'invoice', description: 'contains invoice number' }],
140
+ * },
141
+ * }, { verbose: true });
142
+ *
143
+ * console.log(result.result);
144
+ * ```
145
+ */
146
+ async run(params, options) {
147
+ const { pollingInterval, maxInterval, timeout, backoff, verbose, ...requestOptions } = options || {};
148
+ const job = await this.create(params, requestOptions);
149
+ const getQuery = {};
150
+ if (params.organization_id !== undefined) {
151
+ getQuery.organization_id = params.organization_id;
152
+ }
153
+ if (params.project_id !== undefined) {
154
+ getQuery.project_id = params.project_id;
155
+ }
156
+ return await this.waitForCompletion(job.id, getQuery, {
157
+ pollingInterval,
158
+ maxInterval,
159
+ timeout: timeout || polling_1.DEFAULT_TIMEOUT,
160
+ backoff,
161
+ verbose,
162
+ ...requestOptions,
163
+ });
164
+ }
52
165
  }
53
166
  exports.Classify = Classify;
54
167
  //# sourceMappingURL=classify.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"classify.js","sourceRoot":"","sources":["../src/resources/classify.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAA8F;AAE9F,oDAA8C;AAE9C,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,MAA4B,EAAE,OAAwB;QAC3D,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAC3C,KAAK,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE;YACtC,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAA,4BAAqC,CAAA,EAAE;YACxF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,GAAG,CACD,KAAa,EACb,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;CACF;AArDD,4BAqDC"}
1
+ {"version":3,"file":"classify.js","sourceRoot":"","sources":["../src/resources/classify.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAA8F;AAE9F,oDAA8C;AAC9C,gDAAqF;AAErF,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,MAA4B,EAAE,OAAwB;QAC3D,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAC3C,KAAK,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE;YACtC,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAA,4BAAqC,CAAA,EAAE;YACxF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,GAAG,CACD,KAAa,EACb,QAA8C,EAAE,EAChD,OAAwB;QAExB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;YACnC,OAAO;YACP,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,KAAK,CAAC,GAAG,CACP,MAA4B,EAC5B,OAAyC;QAEzC,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAErG,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QAEtD,MAAM,QAAQ,GAAsB,EAAE,CAAC;QACvC,IAAI,MAAM,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;YACzC,QAAQ,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QACpD,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACpC,QAAQ,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAC1C,CAAC;QAED,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,EAAE;YACpD,eAAe;YACf,WAAW;YACX,OAAO,EAAE,OAAO,IAAI,yBAAe;YACnC,OAAO;YACP,OAAO;YACP,GAAG,cAAc;SAClB,CAAC,CAAC;IACL,CAAC;CACF;AAtLD,4BAsLC"}
@@ -2,6 +2,7 @@
2
2
  import { APIResource } from "../core/resource.mjs";
3
3
  import { PaginatedCursor } from "../core/pagination.mjs";
4
4
  import { path } from "../internal/utils/path.mjs";
5
+ import { pollUntilComplete, DEFAULT_TIMEOUT } from "../core/polling.mjs";
5
6
  export class Classify extends APIResource {
6
7
  /**
7
8
  * Create a classify job.
@@ -16,6 +17,11 @@ export class Classify extends APIResource {
16
17
  *
17
18
  * The job runs asynchronously. Poll `GET /classify/{job_id}` to check status and
18
19
  * retrieve results.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const classify = await client.classify.create();
24
+ * ```
19
25
  */
20
26
  create(params, options) {
21
27
  const { organization_id, project_id, ...body } = params;
@@ -30,6 +36,14 @@ export class Classify extends APIResource {
30
36
  *
31
37
  * Filter by `status`, `configuration_id`, specific `job_ids`, or creation date
32
38
  * range.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * // Automatically fetches more pages as needed.
43
+ * for await (const classifyListResponse of client.classify.list()) {
44
+ * // ...
45
+ * }
46
+ * ```
33
47
  */
34
48
  list(query = {}, options) {
35
49
  return this._client.getAPIList('/api/v2/classify', (PaginatedCursor), {
@@ -42,9 +56,108 @@ export class Classify extends APIResource {
42
56
  *
43
57
  * Returns the job status, configuration, and classify result when complete. The
44
58
  * result includes the matched document type, confidence score, and reasoning.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const classify = await client.classify.get('job_id');
63
+ * ```
45
64
  */
46
65
  get(jobID, query = {}, options) {
47
66
  return this._client.get(path `/api/v2/classify/${jobID}`, { query, ...options });
48
67
  }
68
+ /**
69
+ * Wait for a classify job to complete by polling until it reaches a terminal state.
70
+ *
71
+ * @param jobID - The ID of the classify job to wait for
72
+ * @param query - Optional query parameters (organization_id, project_id)
73
+ * @param options - Polling configuration and request options
74
+ * @returns The completed classify job
75
+ * @throws {PollingTimeoutError} If the job doesn't complete within the timeout period
76
+ * @throws {PollingError} If the job fails
77
+ *
78
+ * @example
79
+ * ```typescript
80
+ * const job = await client.classify.create({
81
+ * file_input: 'dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
82
+ * configuration_id: 'cfg-...',
83
+ * });
84
+ *
85
+ * const completed = await client.classify.waitForCompletion(job.id, undefined, { verbose: true });
86
+ * console.log(completed.result);
87
+ * ```
88
+ */
89
+ async waitForCompletion(jobID, query, options) {
90
+ const { pollingInterval, maxInterval, timeout, backoff, verbose, ...requestOptions } = options || {};
91
+ const getStatus = async () => {
92
+ return await this.get(jobID, query, requestOptions);
93
+ };
94
+ const isComplete = (job) => {
95
+ return job.status === 'COMPLETED';
96
+ };
97
+ const isError = (job) => {
98
+ return job.status === 'FAILED';
99
+ };
100
+ const getErrorMessage = (job) => {
101
+ const errorParts = [`Job ${jobID} failed with status: ${job.status}`];
102
+ if (job.error_message) {
103
+ errorParts.push(`Error: ${job.error_message}`);
104
+ }
105
+ return errorParts.join(' | ');
106
+ };
107
+ return await pollUntilComplete(getStatus, isComplete, isError, getErrorMessage, {
108
+ pollingInterval,
109
+ maxInterval,
110
+ timeout: timeout || DEFAULT_TIMEOUT,
111
+ backoff,
112
+ verbose,
113
+ });
114
+ }
115
+ /**
116
+ * Create a classify job, wait for it to complete, and return the result.
117
+ *
118
+ * This is a convenience method that combines create() and waitForCompletion()
119
+ * into a single call for the most common end-to-end workflow.
120
+ *
121
+ * @param params - Classify job creation parameters
122
+ * @param options - Polling configuration and request options
123
+ * @returns The completed classify job with result populated
124
+ * @throws {PollingTimeoutError} If the job doesn't complete within the timeout period
125
+ * @throws {PollingError} If the job fails
126
+ *
127
+ * @example
128
+ * ```typescript
129
+ * import { LlamaCloud } from 'llama-cloud';
130
+ *
131
+ * const client = new LlamaCloud({ apiKey: '...' });
132
+ *
133
+ * const result = await client.classify.run({
134
+ * file_input: 'dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
135
+ * configuration: {
136
+ * rules: [{ type: 'invoice', description: 'contains invoice number' }],
137
+ * },
138
+ * }, { verbose: true });
139
+ *
140
+ * console.log(result.result);
141
+ * ```
142
+ */
143
+ async run(params, options) {
144
+ const { pollingInterval, maxInterval, timeout, backoff, verbose, ...requestOptions } = options || {};
145
+ const job = await this.create(params, requestOptions);
146
+ const getQuery = {};
147
+ if (params.organization_id !== undefined) {
148
+ getQuery.organization_id = params.organization_id;
149
+ }
150
+ if (params.project_id !== undefined) {
151
+ getQuery.project_id = params.project_id;
152
+ }
153
+ return await this.waitForCompletion(job.id, getQuery, {
154
+ pollingInterval,
155
+ maxInterval,
156
+ timeout: timeout || DEFAULT_TIMEOUT,
157
+ backoff,
158
+ verbose,
159
+ ...requestOptions,
160
+ });
161
+ }
49
162
  }
50
163
  //# sourceMappingURL=classify.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"classify.mjs","sourceRoot":"","sources":["../src/resources/classify.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAe,eAAe,EAA8B;OAE5D,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,MAA4B,EAAE,OAAwB;QAC3D,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAC3C,KAAK,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE;YACtC,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAA,eAAqC,CAAA,EAAE;YACxF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,GAAG,CACD,KAAa,EACb,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,oBAAoB,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;CACF"}
1
+ {"version":3,"file":"classify.mjs","sourceRoot":"","sources":["../src/resources/classify.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAe,eAAe,EAA8B;OAE5D,EAAE,IAAI,EAAE;OACR,EAAE,iBAAiB,EAAkB,eAAe,EA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AU,GAAG,MAAM,CAAC,UAAU,CAAC;QAC1C,CAAC;QAED,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,EAAE;YACpD,eAAe;YACf,WAAW;YACX,OAAO,EAAE,OAAO,IAAI,eAAe;YACnC,OAAO;YACP,OAAO;YACP,GAAG,cAAc;SAClB,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -95,7 +95,58 @@ export interface ConfigurationCreate {
95
95
  /**
96
96
  * Product-specific configuration parameters.
97
97
  */
98
- parameters: SplitV1Parameters | ExtractV2Parameters | ClassifyV2Parameters | ParseV2Parameters | UntypedParameters;
98
+ parameters: SplitV1Parameters | ExtractV2Parameters | ClassifyV2Parameters | ParseV2Parameters | ConfigurationCreate.SpreadsheetV1Parameters | UntypedParameters;
99
+ }
100
+ export declare namespace ConfigurationCreate {
101
+ /**
102
+ * Typed parameters for a _spreadsheet v1_ product configuration.
103
+ */
104
+ interface SpreadsheetV1Parameters {
105
+ /**
106
+ * Product type.
107
+ */
108
+ product_type: 'spreadsheet_v1';
109
+ /**
110
+ * A1 notation of the range to extract a single region from. If None, the entire
111
+ * sheet is used.
112
+ */
113
+ extraction_range?: string | null;
114
+ /**
115
+ * Return a flattened dataframe when a detected table is recognized as
116
+ * hierarchical.
117
+ */
118
+ flatten_hierarchical_tables?: boolean;
119
+ /**
120
+ * Whether to generate additional metadata (title, description) for each extracted
121
+ * region.
122
+ */
123
+ generate_additional_metadata?: boolean;
124
+ /**
125
+ * Whether to include hidden cells when extracting regions from the spreadsheet.
126
+ */
127
+ include_hidden_cells?: boolean;
128
+ /**
129
+ * The names of the sheets to extract regions from. If empty, all sheets will be
130
+ * processed.
131
+ */
132
+ sheet_names?: Array<string> | null;
133
+ /**
134
+ * Optional specialization mode for domain-specific extraction. Supported values:
135
+ * 'financial-standard', 'financial-enhanced', 'financial-precise'. Default None
136
+ * uses the general-purpose pipeline.
137
+ */
138
+ specialization?: string | null;
139
+ /**
140
+ * Influences how likely similar-looking regions are merged into a single table.
141
+ * Useful for spreadsheets that either have sparse tables (strong merging) or many
142
+ * distinct tables close together (weak merging).
143
+ */
144
+ table_merge_sensitivity?: 'strong' | 'weak';
145
+ /**
146
+ * Enables experimental processing. Accuracy may be impacted.
147
+ */
148
+ use_experimental_processing?: boolean;
149
+ }
99
150
  }
100
151
  /**
101
152
  * Response schema for a single product configuration.
@@ -112,11 +163,11 @@ export interface ConfigurationResponse {
112
163
  /**
113
164
  * Product-specific configuration parameters.
114
165
  */
115
- parameters: SplitV1Parameters | ExtractV2Parameters | ClassifyV2Parameters | ParseV2Parameters | UntypedParameters;
166
+ parameters: SplitV1Parameters | ExtractV2Parameters | ClassifyV2Parameters | ParseV2Parameters | ConfigurationResponse.SpreadsheetV1Parameters | UntypedParameters;
116
167
  /**
117
168
  * Product type.
118
169
  */
119
- product_type: 'split_v1' | 'extract_v2' | 'classify_v2' | 'parse_v2' | 'unknown';
170
+ product_type: 'split_v1' | 'extract_v2' | 'classify_v2' | 'parse_v2' | 'spreadsheet_v1' | 'unknown';
120
171
  /**
121
172
  * Version identifier (datetime string).
122
173
  */
@@ -130,6 +181,57 @@ export interface ConfigurationResponse {
130
181
  */
131
182
  updated_at?: string | null;
132
183
  }
184
+ export declare namespace ConfigurationResponse {
185
+ /**
186
+ * Typed parameters for a _spreadsheet v1_ product configuration.
187
+ */
188
+ interface SpreadsheetV1Parameters {
189
+ /**
190
+ * Product type.
191
+ */
192
+ product_type: 'spreadsheet_v1';
193
+ /**
194
+ * A1 notation of the range to extract a single region from. If None, the entire
195
+ * sheet is used.
196
+ */
197
+ extraction_range?: string | null;
198
+ /**
199
+ * Return a flattened dataframe when a detected table is recognized as
200
+ * hierarchical.
201
+ */
202
+ flatten_hierarchical_tables?: boolean;
203
+ /**
204
+ * Whether to generate additional metadata (title, description) for each extracted
205
+ * region.
206
+ */
207
+ generate_additional_metadata?: boolean;
208
+ /**
209
+ * Whether to include hidden cells when extracting regions from the spreadsheet.
210
+ */
211
+ include_hidden_cells?: boolean;
212
+ /**
213
+ * The names of the sheets to extract regions from. If empty, all sheets will be
214
+ * processed.
215
+ */
216
+ sheet_names?: Array<string> | null;
217
+ /**
218
+ * Optional specialization mode for domain-specific extraction. Supported values:
219
+ * 'financial-standard', 'financial-enhanced', 'financial-precise'. Default None
220
+ * uses the general-purpose pipeline.
221
+ */
222
+ specialization?: string | null;
223
+ /**
224
+ * Influences how likely similar-looking regions are merged into a single table.
225
+ * Useful for spreadsheets that either have sparse tables (strong merging) or many
226
+ * distinct tables close together (weak merging).
227
+ */
228
+ table_merge_sensitivity?: 'strong' | 'weak';
229
+ /**
230
+ * Enables experimental processing. Accuracy may be impacted.
231
+ */
232
+ use_experimental_processing?: boolean;
233
+ }
234
+ }
133
235
  /**
134
236
  * Typed parameters for an _extract v2_ product configuration.
135
237
  */
@@ -164,10 +266,6 @@ export interface ExtractV2Parameters {
164
266
  * returns one object per page, per_table_row returns one object per table row
165
267
  */
166
268
  extraction_target?: 'per_doc' | 'per_page' | 'per_table_row';
167
- /**
168
- * ISO 639-1 language code for the document
169
- */
170
- lang?: string;
171
269
  /**
172
270
  * Maximum number of pages to process. Omit for no limit.
173
271
  */
@@ -178,7 +276,8 @@ export interface ExtractV2Parameters {
178
276
  */
179
277
  parse_config_id?: string | null;
180
278
  /**
181
- * Parse tier to use before extraction (fast, cost_effective, or agentic)
279
+ * Parse tier to use before extraction. Defaults to the extract tier if not
280
+ * specified.
182
281
  */
183
282
  parse_tier?: string | null;
184
283
  /**
@@ -217,7 +316,7 @@ export interface ParseV2Parameters {
217
316
  * Tier version. Use 'latest' for the current stable version, or specify a specific
218
317
  * version (e.g., '1.0', '2.0') for reproducible results
219
318
  */
220
- version: '2025-12-11' | '2025-12-18' | '2025-12-31' | '2026-01-08' | '2026-01-09' | '2026-01-16' | '2026-01-21' | '2026-01-22' | '2026-01-24' | '2026-01-29' | '2026-01-30' | '2026-02-03' | '2026-02-18' | '2026-02-20' | '2026-02-24' | '2026-02-26' | '2026-03-02' | '2026-03-03' | '2026-03-04' | '2026-03-05' | '2026-03-09' | '2026-03-10' | '2026-03-11' | '2026-03-12' | '2026-03-17' | '2026-03-19' | '2026-03-20' | '2026-03-22' | '2026-03-23' | '2026-03-24' | '2026-03-25' | '2026-03-26' | '2026-03-27' | '2026-03-30' | '2026-03-31' | 'latest' | (string & {});
319
+ version: '2025-12-11' | '2025-12-18' | '2025-12-31' | '2026-01-08' | '2026-01-09' | '2026-01-16' | '2026-01-21' | '2026-01-22' | '2026-01-24' | '2026-01-29' | '2026-01-30' | '2026-02-03' | '2026-02-18' | '2026-02-20' | '2026-02-24' | '2026-02-26' | '2026-03-02' | '2026-03-03' | '2026-03-04' | '2026-03-05' | '2026-03-09' | '2026-03-10' | '2026-03-11' | '2026-03-12' | '2026-03-17' | '2026-03-19' | '2026-03-20' | '2026-03-22' | '2026-03-23' | '2026-03-24' | '2026-03-25' | '2026-03-26' | '2026-03-27' | '2026-03-30' | '2026-03-31' | '2026-04-02' | '2026-04-06' | '2026-04-09' | 'latest' | (string & {});
221
320
  /**
222
321
  * Options for AI-powered parsing tiers (cost_effective, agentic, agentic_plus).
223
322
  *
@@ -844,7 +943,7 @@ export declare namespace ParseV2Parameters {
844
943
  /**
845
944
  * Tier version when overriding tier. Required when tier is specified
846
945
  */
847
- version?: '2025-12-11' | '2025-12-18' | '2025-12-31' | '2026-01-08' | '2026-01-09' | '2026-01-16' | '2026-01-21' | '2026-01-22' | '2026-01-24' | '2026-01-29' | '2026-01-30' | '2026-02-03' | '2026-02-18' | '2026-02-20' | '2026-02-24' | '2026-02-26' | '2026-03-02' | '2026-03-03' | '2026-03-04' | '2026-03-05' | '2026-03-09' | '2026-03-10' | '2026-03-11' | '2026-03-12' | '2026-03-17' | '2026-03-19' | '2026-03-20' | '2026-03-22' | '2026-03-23' | '2026-03-24' | '2026-03-25' | '2026-03-26' | '2026-03-27' | '2026-03-30' | '2026-03-31' | 'latest' | (string & {}) | null;
946
+ version?: '2025-12-11' | '2025-12-18' | '2025-12-31' | '2026-01-08' | '2026-01-09' | '2026-01-16' | '2026-01-21' | '2026-01-22' | '2026-01-24' | '2026-01-29' | '2026-01-30' | '2026-02-03' | '2026-02-18' | '2026-02-20' | '2026-02-24' | '2026-02-26' | '2026-03-02' | '2026-03-03' | '2026-03-04' | '2026-03-05' | '2026-03-09' | '2026-03-10' | '2026-03-11' | '2026-03-12' | '2026-03-17' | '2026-03-19' | '2026-03-20' | '2026-03-22' | '2026-03-23' | '2026-03-24' | '2026-03-25' | '2026-03-26' | '2026-03-27' | '2026-03-30' | '2026-03-31' | '2026-04-02' | '2026-04-06' | '2026-04-09' | 'latest' | (string & {}) | null;
848
947
  }
849
948
  namespace ParsingConf {
850
949
  /**
@@ -1037,7 +1136,7 @@ export interface ConfigurationCreateParams {
1037
1136
  /**
1038
1137
  * Body param: Product-specific configuration parameters.
1039
1138
  */
1040
- parameters: SplitV1Parameters | ExtractV2Parameters | ClassifyV2Parameters | ParseV2Parameters | UntypedParameters;
1139
+ parameters: SplitV1Parameters | ExtractV2Parameters | ClassifyV2Parameters | ParseV2Parameters | ConfigurationCreateParams.SpreadsheetV1Parameters | UntypedParameters;
1041
1140
  /**
1042
1141
  * Query param
1043
1142
  */
@@ -1047,6 +1146,57 @@ export interface ConfigurationCreateParams {
1047
1146
  */
1048
1147
  project_id?: string | null;
1049
1148
  }
1149
+ export declare namespace ConfigurationCreateParams {
1150
+ /**
1151
+ * Typed parameters for a _spreadsheet v1_ product configuration.
1152
+ */
1153
+ interface SpreadsheetV1Parameters {
1154
+ /**
1155
+ * Product type.
1156
+ */
1157
+ product_type: 'spreadsheet_v1';
1158
+ /**
1159
+ * A1 notation of the range to extract a single region from. If None, the entire
1160
+ * sheet is used.
1161
+ */
1162
+ extraction_range?: string | null;
1163
+ /**
1164
+ * Return a flattened dataframe when a detected table is recognized as
1165
+ * hierarchical.
1166
+ */
1167
+ flatten_hierarchical_tables?: boolean;
1168
+ /**
1169
+ * Whether to generate additional metadata (title, description) for each extracted
1170
+ * region.
1171
+ */
1172
+ generate_additional_metadata?: boolean;
1173
+ /**
1174
+ * Whether to include hidden cells when extracting regions from the spreadsheet.
1175
+ */
1176
+ include_hidden_cells?: boolean;
1177
+ /**
1178
+ * The names of the sheets to extract regions from. If empty, all sheets will be
1179
+ * processed.
1180
+ */
1181
+ sheet_names?: Array<string> | null;
1182
+ /**
1183
+ * Optional specialization mode for domain-specific extraction. Supported values:
1184
+ * 'financial-standard', 'financial-enhanced', 'financial-precise'. Default None
1185
+ * uses the general-purpose pipeline.
1186
+ */
1187
+ specialization?: string | null;
1188
+ /**
1189
+ * Influences how likely similar-looking regions are merged into a single table.
1190
+ * Useful for spreadsheets that either have sparse tables (strong merging) or many
1191
+ * distinct tables close together (weak merging).
1192
+ */
1193
+ table_merge_sensitivity?: 'strong' | 'weak';
1194
+ /**
1195
+ * Enables experimental processing. Accuracy may be impacted.
1196
+ */
1197
+ use_experimental_processing?: boolean;
1198
+ }
1199
+ }
1050
1200
  export interface ConfigurationRetrieveParams {
1051
1201
  organization_id?: string | null;
1052
1202
  project_id?: string | null;
@@ -1067,7 +1217,58 @@ export interface ConfigurationUpdateParams {
1067
1217
  /**
1068
1218
  * Body param: Updated parameters (omit to leave unchanged).
1069
1219
  */
1070
- parameters?: SplitV1Parameters | ExtractV2Parameters | ClassifyV2Parameters | ParseV2Parameters | UntypedParameters | null;
1220
+ parameters?: SplitV1Parameters | ExtractV2Parameters | ClassifyV2Parameters | ParseV2Parameters | ConfigurationUpdateParams.SpreadsheetV1Parameters | UntypedParameters | null;
1221
+ }
1222
+ export declare namespace ConfigurationUpdateParams {
1223
+ /**
1224
+ * Typed parameters for a _spreadsheet v1_ product configuration.
1225
+ */
1226
+ interface SpreadsheetV1Parameters {
1227
+ /**
1228
+ * Product type.
1229
+ */
1230
+ product_type: 'spreadsheet_v1';
1231
+ /**
1232
+ * A1 notation of the range to extract a single region from. If None, the entire
1233
+ * sheet is used.
1234
+ */
1235
+ extraction_range?: string | null;
1236
+ /**
1237
+ * Return a flattened dataframe when a detected table is recognized as
1238
+ * hierarchical.
1239
+ */
1240
+ flatten_hierarchical_tables?: boolean;
1241
+ /**
1242
+ * Whether to generate additional metadata (title, description) for each extracted
1243
+ * region.
1244
+ */
1245
+ generate_additional_metadata?: boolean;
1246
+ /**
1247
+ * Whether to include hidden cells when extracting regions from the spreadsheet.
1248
+ */
1249
+ include_hidden_cells?: boolean;
1250
+ /**
1251
+ * The names of the sheets to extract regions from. If empty, all sheets will be
1252
+ * processed.
1253
+ */
1254
+ sheet_names?: Array<string> | null;
1255
+ /**
1256
+ * Optional specialization mode for domain-specific extraction. Supported values:
1257
+ * 'financial-standard', 'financial-enhanced', 'financial-precise'. Default None
1258
+ * uses the general-purpose pipeline.
1259
+ */
1260
+ specialization?: string | null;
1261
+ /**
1262
+ * Influences how likely similar-looking regions are merged into a single table.
1263
+ * Useful for spreadsheets that either have sparse tables (strong merging) or many
1264
+ * distinct tables close together (weak merging).
1265
+ */
1266
+ table_merge_sensitivity?: 'strong' | 'weak';
1267
+ /**
1268
+ * Enables experimental processing. Accuracy may be impacted.
1269
+ */
1270
+ use_experimental_processing?: boolean;
1271
+ }
1071
1272
  }
1072
1273
  export interface ConfigurationListParams extends PaginatedCursorParams {
1073
1274
  /**
@@ -1082,7 +1283,7 @@ export interface ConfigurationListParams extends PaginatedCursorParams {
1082
1283
  /**
1083
1284
  * Filter by one or more product types. Repeat the parameter for multiple values.
1084
1285
  */
1085
- product_type?: Array<'split_v1' | 'extract_v2' | 'classify_v2' | 'parse_v2' | 'unknown'> | null;
1286
+ product_type?: Array<'split_v1' | 'extract_v2' | 'classify_v2' | 'parse_v2' | 'spreadsheet_v1' | 'unknown'> | null;
1086
1287
  project_id?: string | null;
1087
1288
  }
1088
1289
  export interface ConfigurationDeleteParams {