@llamaindex/llama-cloud 1.7.0 → 1.8.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 (48) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/client.d.mts +5 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +5 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -6
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -6
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/classifier/jobs.d.mts +8 -0
  12. package/resources/classifier/jobs.d.mts.map +1 -1
  13. package/resources/classifier/jobs.d.ts +8 -0
  14. package/resources/classifier/jobs.d.ts.map +1 -1
  15. package/resources/classifier/jobs.js +8 -0
  16. package/resources/classifier/jobs.js.map +1 -1
  17. package/resources/classifier/jobs.mjs +8 -0
  18. package/resources/classifier/jobs.mjs.map +1 -1
  19. package/resources/classify.d.mts +326 -0
  20. package/resources/classify.d.mts.map +1 -0
  21. package/resources/classify.d.ts +326 -0
  22. package/resources/classify.d.ts.map +1 -0
  23. package/resources/classify.js +37 -0
  24. package/resources/classify.js.map +1 -0
  25. package/resources/classify.mjs +33 -0
  26. package/resources/classify.mjs.map +1 -0
  27. package/resources/index.d.mts +1 -0
  28. package/resources/index.d.mts.map +1 -1
  29. package/resources/index.d.ts +1 -0
  30. package/resources/index.d.ts.map +1 -1
  31. package/resources/index.js +3 -1
  32. package/resources/index.js.map +1 -1
  33. package/resources/index.mjs +1 -0
  34. package/resources/index.mjs.map +1 -1
  35. package/resources/parsing.d.mts +34 -2
  36. package/resources/parsing.d.mts.map +1 -1
  37. package/resources/parsing.d.ts +34 -2
  38. package/resources/parsing.d.ts.map +1 -1
  39. package/src/client.ts +36 -7
  40. package/src/resources/classifier/jobs.ts +8 -0
  41. package/src/resources/classify.ts +433 -0
  42. package/src/resources/index.ts +13 -0
  43. package/src/resources/parsing.ts +44 -0
  44. package/src/version.ts +1 -1
  45. package/version.d.mts +1 -1
  46. package/version.d.ts +1 -1
  47. package/version.js +1 -1
  48. package/version.mjs +1 -1
@@ -0,0 +1,433 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { PagePromise, PaginatedCursor, type PaginatedCursorParams } from '../core/pagination';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ export class Classify extends APIResource {
10
+ /**
11
+ * Create a classify job.
12
+ */
13
+ create(params: ClassifyCreateParams, options?: RequestOptions): APIPromise<ClassifyCreateResponse> {
14
+ const { organization_id, project_id, ...body } = params;
15
+ return this._client.post('/api/v2/classify', {
16
+ query: { organization_id, project_id },
17
+ body,
18
+ ...options,
19
+ });
20
+ }
21
+
22
+ /**
23
+ * List classify jobs.
24
+ */
25
+ list(
26
+ query: ClassifyListParams | null | undefined = {},
27
+ options?: RequestOptions,
28
+ ): PagePromise<ClassifyListResponsesPaginatedCursor, ClassifyListResponse> {
29
+ return this._client.getAPIList('/api/v2/classify', PaginatedCursor<ClassifyListResponse>, {
30
+ query,
31
+ ...options,
32
+ });
33
+ }
34
+
35
+ /**
36
+ * Retrieve classify job by ID.
37
+ */
38
+ get(
39
+ jobID: string,
40
+ query: ClassifyGetParams | null | undefined = {},
41
+ options?: RequestOptions,
42
+ ): APIPromise<ClassifyGetResponse> {
43
+ return this._client.get(path`/api/v2/classify/${jobID}`, { query, ...options });
44
+ }
45
+ }
46
+
47
+ export type ClassifyListResponsesPaginatedCursor = PaginatedCursor<ClassifyListResponse>;
48
+
49
+ /**
50
+ * Configuration for classification.
51
+ */
52
+ export interface ClassifyConfiguration {
53
+ /**
54
+ * Classification rules to apply (at least one required)
55
+ */
56
+ rules: Array<ClassifyConfiguration.Rule>;
57
+
58
+ /**
59
+ * Classification execution mode
60
+ */
61
+ mode?: 'FAST';
62
+ }
63
+
64
+ export namespace ClassifyConfiguration {
65
+ /**
66
+ * A rule for classifying documents.
67
+ */
68
+ export interface Rule {
69
+ /**
70
+ * Natural language description of what to classify
71
+ */
72
+ description: string;
73
+
74
+ /**
75
+ * Document type to assign when rule matches
76
+ */
77
+ type: string;
78
+ }
79
+ }
80
+
81
+ /**
82
+ * Request to create a classify job.
83
+ */
84
+ export interface ClassifyCreateRequest {
85
+ /**
86
+ * Configuration for classification.
87
+ */
88
+ configuration?: ClassifyConfiguration | null;
89
+
90
+ /**
91
+ * Product configuration ID for reusable presets
92
+ */
93
+ configuration_id?: string | null;
94
+
95
+ /**
96
+ * File ID to classify
97
+ */
98
+ file_id?: string | null;
99
+
100
+ /**
101
+ * Parse job ID to classify
102
+ */
103
+ parse_job_id?: string | null;
104
+
105
+ /**
106
+ * Idempotency key scoped to the project
107
+ */
108
+ transaction_id?: string | null;
109
+ }
110
+
111
+ /**
112
+ * Result of classifying a document.
113
+ */
114
+ export interface ClassifyResult {
115
+ /**
116
+ * Confidence score (0.0-1.0)
117
+ */
118
+ confidence: number;
119
+
120
+ /**
121
+ * Explanation of classification decision
122
+ */
123
+ reasoning: string;
124
+
125
+ /**
126
+ * Document type that matches, or None
127
+ */
128
+ type: string | null;
129
+ }
130
+
131
+ /**
132
+ * Response for a classify job.
133
+ */
134
+ export interface ClassifyCreateResponse {
135
+ /**
136
+ * Unique identifier
137
+ */
138
+ id: string;
139
+
140
+ /**
141
+ * Classification configuration
142
+ */
143
+ configuration: ClassifyConfiguration;
144
+
145
+ /**
146
+ * Type of document input
147
+ */
148
+ document_input_type: 'url' | 'file_id' | 'parse_job_id';
149
+
150
+ /**
151
+ * Document identifier
152
+ */
153
+ document_input_value: string;
154
+
155
+ /**
156
+ * Project ID
157
+ */
158
+ project_id: string;
159
+
160
+ /**
161
+ * Job status
162
+ */
163
+ status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED';
164
+
165
+ /**
166
+ * User ID
167
+ */
168
+ user_id: string;
169
+
170
+ /**
171
+ * Product configuration ID
172
+ */
173
+ configuration_id?: string | null;
174
+
175
+ /**
176
+ * Creation datetime
177
+ */
178
+ created_at?: string | null;
179
+
180
+ /**
181
+ * Error message if job failed
182
+ */
183
+ error_message?: string | null;
184
+
185
+ /**
186
+ * Associated parse job ID
187
+ */
188
+ parse_job_id?: string | null;
189
+
190
+ /**
191
+ * Result of classifying a document.
192
+ */
193
+ result?: ClassifyResult | null;
194
+
195
+ /**
196
+ * Idempotency key
197
+ */
198
+ transaction_id?: string | null;
199
+
200
+ /**
201
+ * Update datetime
202
+ */
203
+ updated_at?: string | null;
204
+ }
205
+
206
+ /**
207
+ * Response for a classify job.
208
+ */
209
+ export interface ClassifyListResponse {
210
+ /**
211
+ * Unique identifier
212
+ */
213
+ id: string;
214
+
215
+ /**
216
+ * Classification configuration
217
+ */
218
+ configuration: ClassifyConfiguration;
219
+
220
+ /**
221
+ * Type of document input
222
+ */
223
+ document_input_type: 'url' | 'file_id' | 'parse_job_id';
224
+
225
+ /**
226
+ * Document identifier
227
+ */
228
+ document_input_value: string;
229
+
230
+ /**
231
+ * Project ID
232
+ */
233
+ project_id: string;
234
+
235
+ /**
236
+ * Job status
237
+ */
238
+ status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED';
239
+
240
+ /**
241
+ * User ID
242
+ */
243
+ user_id: string;
244
+
245
+ /**
246
+ * Product configuration ID
247
+ */
248
+ configuration_id?: string | null;
249
+
250
+ /**
251
+ * Creation datetime
252
+ */
253
+ created_at?: string | null;
254
+
255
+ /**
256
+ * Error message if job failed
257
+ */
258
+ error_message?: string | null;
259
+
260
+ /**
261
+ * Associated parse job ID
262
+ */
263
+ parse_job_id?: string | null;
264
+
265
+ /**
266
+ * Result of classifying a document.
267
+ */
268
+ result?: ClassifyResult | null;
269
+
270
+ /**
271
+ * Idempotency key
272
+ */
273
+ transaction_id?: string | null;
274
+
275
+ /**
276
+ * Update datetime
277
+ */
278
+ updated_at?: string | null;
279
+ }
280
+
281
+ /**
282
+ * Response for a classify job.
283
+ */
284
+ export interface ClassifyGetResponse {
285
+ /**
286
+ * Unique identifier
287
+ */
288
+ id: string;
289
+
290
+ /**
291
+ * Classification configuration
292
+ */
293
+ configuration: ClassifyConfiguration;
294
+
295
+ /**
296
+ * Type of document input
297
+ */
298
+ document_input_type: 'url' | 'file_id' | 'parse_job_id';
299
+
300
+ /**
301
+ * Document identifier
302
+ */
303
+ document_input_value: string;
304
+
305
+ /**
306
+ * Project ID
307
+ */
308
+ project_id: string;
309
+
310
+ /**
311
+ * Job status
312
+ */
313
+ status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED';
314
+
315
+ /**
316
+ * User ID
317
+ */
318
+ user_id: string;
319
+
320
+ /**
321
+ * Product configuration ID
322
+ */
323
+ configuration_id?: string | null;
324
+
325
+ /**
326
+ * Creation datetime
327
+ */
328
+ created_at?: string | null;
329
+
330
+ /**
331
+ * Error message if job failed
332
+ */
333
+ error_message?: string | null;
334
+
335
+ /**
336
+ * Associated parse job ID
337
+ */
338
+ parse_job_id?: string | null;
339
+
340
+ /**
341
+ * Result of classifying a document.
342
+ */
343
+ result?: ClassifyResult | null;
344
+
345
+ /**
346
+ * Idempotency key
347
+ */
348
+ transaction_id?: string | null;
349
+
350
+ /**
351
+ * Update datetime
352
+ */
353
+ updated_at?: string | null;
354
+ }
355
+
356
+ export interface ClassifyCreateParams {
357
+ /**
358
+ * Query param
359
+ */
360
+ organization_id?: string | null;
361
+
362
+ /**
363
+ * Query param
364
+ */
365
+ project_id?: string | null;
366
+
367
+ /**
368
+ * Body param: Configuration for classification.
369
+ */
370
+ configuration?: ClassifyConfiguration | null;
371
+
372
+ /**
373
+ * Body param: Product configuration ID for reusable presets
374
+ */
375
+ configuration_id?: string | null;
376
+
377
+ /**
378
+ * Body param: File ID to classify
379
+ */
380
+ file_id?: string | null;
381
+
382
+ /**
383
+ * Body param: Parse job ID to classify
384
+ */
385
+ parse_job_id?: string | null;
386
+
387
+ /**
388
+ * Body param: Idempotency key scoped to the project
389
+ */
390
+ transaction_id?: string | null;
391
+ }
392
+
393
+ export interface ClassifyListParams extends PaginatedCursorParams {
394
+ /**
395
+ * Filter by configuration ID
396
+ */
397
+ configuration_id?: string | null;
398
+
399
+ /**
400
+ * Filter by specific job IDs
401
+ */
402
+ job_ids?: Array<string> | null;
403
+
404
+ organization_id?: string | null;
405
+
406
+ project_id?: string | null;
407
+
408
+ /**
409
+ * Filter by job status
410
+ */
411
+ status?: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | null;
412
+ }
413
+
414
+ export interface ClassifyGetParams {
415
+ organization_id?: string | null;
416
+
417
+ project_id?: string | null;
418
+ }
419
+
420
+ export declare namespace Classify {
421
+ export {
422
+ type ClassifyConfiguration as ClassifyConfiguration,
423
+ type ClassifyCreateRequest as ClassifyCreateRequest,
424
+ type ClassifyResult as ClassifyResult,
425
+ type ClassifyCreateResponse as ClassifyCreateResponse,
426
+ type ClassifyListResponse as ClassifyListResponse,
427
+ type ClassifyGetResponse as ClassifyGetResponse,
428
+ type ClassifyListResponsesPaginatedCursor as ClassifyListResponsesPaginatedCursor,
429
+ type ClassifyCreateParams as ClassifyCreateParams,
430
+ type ClassifyListParams as ClassifyListParams,
431
+ type ClassifyGetParams as ClassifyGetParams,
432
+ };
433
+ }
@@ -3,6 +3,19 @@
3
3
  export * from './shared';
4
4
  export { Beta } from './beta/beta';
5
5
  export { Classifier } from './classifier/classifier';
6
+ export {
7
+ Classify,
8
+ type ClassifyConfiguration,
9
+ type ClassifyCreateRequest,
10
+ type ClassifyResult,
11
+ type ClassifyCreateResponse,
12
+ type ClassifyListResponse,
13
+ type ClassifyGetResponse,
14
+ type ClassifyCreateParams,
15
+ type ClassifyListParams,
16
+ type ClassifyGetParams,
17
+ type ClassifyListResponsesPaginatedCursor,
18
+ } from './classify';
6
19
  export {
7
20
  DataSinks,
8
21
  type DataSink,
@@ -1016,6 +1016,17 @@ export namespace ParsingGetResponse {
1016
1016
  */
1017
1017
  index: number;
1018
1018
 
1019
+ /**
1020
+ * Bounding box for an image on its page.
1021
+ */
1022
+ bbox?: Image.Bbox | null;
1023
+
1024
+ /**
1025
+ * Image category: 'screenshot' (full page), 'embedded' (images in document), or
1026
+ * 'layout' (cropped from layout detection)
1027
+ */
1028
+ category?: 'screenshot' | 'embedded' | 'layout' | null;
1029
+
1019
1030
  /**
1020
1031
  * MIME type of the image
1021
1032
  */
@@ -1031,6 +1042,33 @@ export namespace ParsingGetResponse {
1031
1042
  */
1032
1043
  size_bytes?: number | null;
1033
1044
  }
1045
+
1046
+ export namespace Image {
1047
+ /**
1048
+ * Bounding box for an image on its page.
1049
+ */
1050
+ export interface Bbox {
1051
+ /**
1052
+ * Height of the bounding box
1053
+ */
1054
+ h: number;
1055
+
1056
+ /**
1057
+ * Width of the bounding box
1058
+ */
1059
+ w: number;
1060
+
1061
+ /**
1062
+ * X coordinate of the bounding box
1063
+ */
1064
+ x: number;
1065
+
1066
+ /**
1067
+ * Y coordinate of the bounding box
1068
+ */
1069
+ y: number;
1070
+ }
1071
+ }
1034
1072
  }
1035
1073
 
1036
1074
  /**
@@ -1283,6 +1321,9 @@ export interface ParsingCreateParams {
1283
1321
  | '2026-02-20'
1284
1322
  | '2026-02-24'
1285
1323
  | '2026-02-26'
1324
+ | '2026-03-02'
1325
+ | '2026-03-03'
1326
+ | '2026-03-04'
1286
1327
  | 'latest'
1287
1328
  | (string & {});
1288
1329
 
@@ -2002,6 +2043,9 @@ export namespace ParsingCreateParams {
2002
2043
  | '2026-02-20'
2003
2044
  | '2026-02-24'
2004
2045
  | '2026-02-26'
2046
+ | '2026-03-02'
2047
+ | '2026-03-03'
2048
+ | '2026-03-04'
2005
2049
  | 'latest'
2006
2050
  | (string & {})
2007
2051
  | null;
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.7.0'; // x-release-please-version
1
+ export const VERSION = '1.8.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.7.0";
1
+ export declare const VERSION = "1.8.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.7.0";
1
+ export declare const VERSION = "1.8.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.7.0'; // x-release-please-version
4
+ exports.VERSION = '1.8.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.7.0'; // x-release-please-version
1
+ export const VERSION = '1.8.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map