@llamaindex/llama-cloud 2.4.1 → 2.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 (343) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/api-promise.d.mts +1 -0
  3. package/api-promise.d.mts.map +1 -1
  4. package/api-promise.d.ts +1 -0
  5. package/api-promise.d.ts.map +1 -1
  6. package/api-promise.mjs +1 -0
  7. package/api-promise.mjs.map +1 -1
  8. package/client.d.mts +5 -2
  9. package/client.d.mts.map +1 -1
  10. package/client.d.ts +5 -2
  11. package/client.d.ts.map +1 -1
  12. package/client.js +14 -0
  13. package/client.js.map +1 -1
  14. package/client.mjs +14 -0
  15. package/client.mjs.map +1 -1
  16. package/core/api-promise.d.mts.map +1 -1
  17. package/core/api-promise.d.ts.map +1 -1
  18. package/core/api-promise.mjs.map +1 -1
  19. package/core/error.mjs.map +1 -1
  20. package/core/pagination.d.mts.map +1 -1
  21. package/core/pagination.d.ts.map +1 -1
  22. package/core/pagination.mjs.map +1 -1
  23. package/core/resource.d.mts.map +1 -1
  24. package/core/resource.d.ts.map +1 -1
  25. package/core/uploads.d.mts.map +1 -1
  26. package/core/uploads.d.ts.map +1 -1
  27. package/core/uploads.mjs.map +1 -1
  28. package/error.d.mts +1 -0
  29. package/error.d.mts.map +1 -1
  30. package/error.d.ts +1 -0
  31. package/error.d.ts.map +1 -1
  32. package/error.mjs +1 -0
  33. package/error.mjs.map +1 -1
  34. package/index.d.mts.map +1 -1
  35. package/index.d.ts.map +1 -1
  36. package/index.mjs.map +1 -1
  37. package/internal/detect-platform.mjs.map +1 -1
  38. package/internal/headers.mjs.map +1 -1
  39. package/internal/parse.d.mts.map +1 -1
  40. package/internal/parse.d.ts.map +1 -1
  41. package/internal/parse.mjs.map +1 -1
  42. package/internal/qs/formats.d.mts.map +1 -1
  43. package/internal/qs/formats.d.ts.map +1 -1
  44. package/internal/qs/index.d.mts +2 -2
  45. package/internal/qs/index.d.mts.map +1 -1
  46. package/internal/qs/index.d.ts +2 -2
  47. package/internal/qs/index.d.ts.map +1 -1
  48. package/internal/qs/index.mjs.map +1 -1
  49. package/internal/qs/stringify.d.mts.map +1 -1
  50. package/internal/qs/stringify.d.ts.map +1 -1
  51. package/internal/qs/stringify.mjs.map +1 -1
  52. package/internal/qs/utils.d.mts.map +1 -1
  53. package/internal/qs/utils.d.ts.map +1 -1
  54. package/internal/qs/utils.mjs.map +1 -1
  55. package/internal/request-options.d.mts.map +1 -1
  56. package/internal/request-options.d.ts.map +1 -1
  57. package/internal/shims.d.mts +6 -0
  58. package/internal/shims.d.mts.map +1 -1
  59. package/internal/shims.d.ts +6 -0
  60. package/internal/shims.d.ts.map +1 -1
  61. package/internal/to-file.d.mts.map +1 -1
  62. package/internal/to-file.d.ts.map +1 -1
  63. package/internal/to-file.mjs.map +1 -1
  64. package/internal/types.d.mts +10 -10
  65. package/internal/types.d.mts.map +1 -1
  66. package/internal/types.d.ts +10 -10
  67. package/internal/types.d.ts.map +1 -1
  68. package/internal/uploads.d.mts.map +1 -1
  69. package/internal/uploads.d.ts.map +1 -1
  70. package/internal/uploads.mjs.map +1 -1
  71. package/internal/utils/base64.mjs.map +1 -1
  72. package/internal/utils/log.d.mts.map +1 -1
  73. package/internal/utils/log.d.ts.map +1 -1
  74. package/internal/utils/log.js +2 -0
  75. package/internal/utils/log.js.map +1 -1
  76. package/internal/utils/log.mjs +2 -0
  77. package/internal/utils/log.mjs.map +1 -1
  78. package/internal/utils/path.mjs.map +1 -1
  79. package/internal/utils/query.mjs.map +1 -1
  80. package/internal/utils/values.mjs.map +1 -1
  81. package/internal/utils.d.mts.map +1 -1
  82. package/internal/utils.d.ts.map +1 -1
  83. package/internal/utils.mjs.map +1 -1
  84. package/package.json +2 -2
  85. package/pagination.d.mts +1 -0
  86. package/pagination.d.mts.map +1 -1
  87. package/pagination.d.ts +1 -0
  88. package/pagination.d.ts.map +1 -1
  89. package/pagination.mjs +1 -0
  90. package/pagination.mjs.map +1 -1
  91. package/resource.d.mts +1 -0
  92. package/resource.d.mts.map +1 -1
  93. package/resource.d.ts +1 -0
  94. package/resource.d.ts.map +1 -1
  95. package/resource.mjs +1 -0
  96. package/resource.mjs.map +1 -1
  97. package/resources/batches.d.mts +492 -0
  98. package/resources/batches.d.mts.map +1 -0
  99. package/resources/batches.d.ts +492 -0
  100. package/resources/batches.d.ts.map +1 -0
  101. package/resources/batches.js +61 -0
  102. package/resources/batches.js.map +1 -0
  103. package/resources/batches.mjs +57 -0
  104. package/resources/batches.mjs.map +1 -0
  105. package/resources/beta/agent-data.d.mts.map +1 -1
  106. package/resources/beta/agent-data.d.ts.map +1 -1
  107. package/resources/beta/agent-data.mjs.map +1 -1
  108. package/resources/beta/batch/batch.d.mts.map +1 -1
  109. package/resources/beta/batch/batch.d.ts.map +1 -1
  110. package/resources/beta/batch/batch.mjs.map +1 -1
  111. package/resources/beta/batch/index.d.mts.map +1 -1
  112. package/resources/beta/batch/index.d.ts.map +1 -1
  113. package/resources/beta/batch/index.mjs.map +1 -1
  114. package/resources/beta/batch/job-items.d.mts.map +1 -1
  115. package/resources/beta/batch/job-items.d.ts.map +1 -1
  116. package/resources/beta/batch/job-items.mjs.map +1 -1
  117. package/resources/beta/batch.d.mts.map +1 -1
  118. package/resources/beta/batch.d.ts.map +1 -1
  119. package/resources/beta/batch.mjs.map +1 -1
  120. package/resources/beta/beta.d.mts +12 -0
  121. package/resources/beta/beta.d.mts.map +1 -1
  122. package/resources/beta/beta.d.ts +12 -0
  123. package/resources/beta/beta.d.ts.map +1 -1
  124. package/resources/beta/beta.js +12 -0
  125. package/resources/beta/beta.js.map +1 -1
  126. package/resources/beta/beta.mjs +12 -0
  127. package/resources/beta/beta.mjs.map +1 -1
  128. package/resources/beta/chat.d.mts +357 -0
  129. package/resources/beta/chat.d.mts.map +1 -0
  130. package/resources/beta/chat.d.ts +357 -0
  131. package/resources/beta/chat.d.ts.map +1 -0
  132. package/resources/beta/chat.js +101 -0
  133. package/resources/beta/chat.js.map +1 -0
  134. package/resources/beta/chat.mjs +97 -0
  135. package/resources/beta/chat.mjs.map +1 -0
  136. package/resources/beta/directories/directories.d.mts +72 -24
  137. package/resources/beta/directories/directories.d.mts.map +1 -1
  138. package/resources/beta/directories/directories.d.ts +72 -24
  139. package/resources/beta/directories/directories.d.ts.map +1 -1
  140. package/resources/beta/directories/directories.js +0 -3
  141. package/resources/beta/directories/directories.js.map +1 -1
  142. package/resources/beta/directories/directories.mjs +0 -3
  143. package/resources/beta/directories/directories.mjs.map +1 -1
  144. package/resources/beta/directories/files.d.mts +65 -57
  145. package/resources/beta/directories/files.d.mts.map +1 -1
  146. package/resources/beta/directories/files.d.ts +65 -57
  147. package/resources/beta/directories/files.d.ts.map +1 -1
  148. package/resources/beta/directories/files.js +14 -27
  149. package/resources/beta/directories/files.js.map +1 -1
  150. package/resources/beta/directories/files.mjs +14 -27
  151. package/resources/beta/directories/files.mjs.map +1 -1
  152. package/resources/beta/directories/index.d.mts.map +1 -1
  153. package/resources/beta/directories/index.d.ts.map +1 -1
  154. package/resources/beta/directories/index.mjs.map +1 -1
  155. package/resources/beta/directories.d.mts.map +1 -1
  156. package/resources/beta/directories.d.ts.map +1 -1
  157. package/resources/beta/directories.mjs.map +1 -1
  158. package/resources/beta/index.d.mts +3 -0
  159. package/resources/beta/index.d.mts.map +1 -1
  160. package/resources/beta/index.d.ts +3 -0
  161. package/resources/beta/index.d.ts.map +1 -1
  162. package/resources/beta/index.js +7 -1
  163. package/resources/beta/index.js.map +1 -1
  164. package/resources/beta/index.mjs +3 -0
  165. package/resources/beta/index.mjs.map +1 -1
  166. package/resources/beta/indexes.d.mts +311 -0
  167. package/resources/beta/indexes.d.mts.map +1 -0
  168. package/resources/beta/indexes.d.ts +311 -0
  169. package/resources/beta/indexes.d.ts.map +1 -0
  170. package/resources/beta/indexes.js +86 -0
  171. package/resources/beta/indexes.js.map +1 -0
  172. package/resources/beta/indexes.mjs +82 -0
  173. package/resources/beta/indexes.mjs.map +1 -0
  174. package/resources/beta/retrieval.d.mts +368 -0
  175. package/resources/beta/retrieval.d.mts.map +1 -0
  176. package/resources/beta/retrieval.d.ts +368 -0
  177. package/resources/beta/retrieval.d.ts.map +1 -0
  178. package/resources/beta/retrieval.js +87 -0
  179. package/resources/beta/retrieval.js.map +1 -0
  180. package/resources/beta/retrieval.mjs +83 -0
  181. package/resources/beta/retrieval.mjs.map +1 -0
  182. package/resources/beta/sheets.d.mts +10 -17
  183. package/resources/beta/sheets.d.mts.map +1 -1
  184. package/resources/beta/sheets.d.ts +10 -17
  185. package/resources/beta/sheets.d.ts.map +1 -1
  186. package/resources/beta/sheets.js +10 -17
  187. package/resources/beta/sheets.js.map +1 -1
  188. package/resources/beta/sheets.mjs +10 -17
  189. package/resources/beta/sheets.mjs.map +1 -1
  190. package/resources/beta/split.d.mts.map +1 -1
  191. package/resources/beta/split.d.ts.map +1 -1
  192. package/resources/beta/split.mjs.map +1 -1
  193. package/resources/beta.d.mts.map +1 -1
  194. package/resources/beta.d.ts.map +1 -1
  195. package/resources/beta.mjs.map +1 -1
  196. package/resources/classifier/classifier.d.mts.map +1 -1
  197. package/resources/classifier/classifier.d.ts.map +1 -1
  198. package/resources/classifier/classifier.mjs.map +1 -1
  199. package/resources/classifier/index.d.mts.map +1 -1
  200. package/resources/classifier/index.d.ts.map +1 -1
  201. package/resources/classifier/index.mjs.map +1 -1
  202. package/resources/classifier/jobs.d.mts +5 -8
  203. package/resources/classifier/jobs.d.mts.map +1 -1
  204. package/resources/classifier/jobs.d.ts +5 -8
  205. package/resources/classifier/jobs.d.ts.map +1 -1
  206. package/resources/classifier/jobs.js +5 -8
  207. package/resources/classifier/jobs.js.map +1 -1
  208. package/resources/classifier/jobs.mjs +5 -8
  209. package/resources/classifier/jobs.mjs.map +1 -1
  210. package/resources/classifier.d.mts.map +1 -1
  211. package/resources/classifier.d.ts.map +1 -1
  212. package/resources/classifier.mjs.map +1 -1
  213. package/resources/classify.d.mts.map +1 -1
  214. package/resources/classify.d.ts.map +1 -1
  215. package/resources/classify.mjs.map +1 -1
  216. package/resources/configurations.d.mts +27 -10
  217. package/resources/configurations.d.mts.map +1 -1
  218. package/resources/configurations.d.ts +27 -10
  219. package/resources/configurations.d.ts.map +1 -1
  220. package/resources/configurations.js +2 -4
  221. package/resources/configurations.js.map +1 -1
  222. package/resources/configurations.mjs +2 -4
  223. package/resources/configurations.mjs.map +1 -1
  224. package/resources/data-sinks.d.mts.map +1 -1
  225. package/resources/data-sinks.d.ts.map +1 -1
  226. package/resources/data-sinks.mjs.map +1 -1
  227. package/resources/data-sources.d.mts.map +1 -1
  228. package/resources/data-sources.d.ts.map +1 -1
  229. package/resources/data-sources.mjs.map +1 -1
  230. package/resources/extract.d.mts +2 -9
  231. package/resources/extract.d.mts.map +1 -1
  232. package/resources/extract.d.ts +2 -9
  233. package/resources/extract.d.ts.map +1 -1
  234. package/resources/extract.mjs.map +1 -1
  235. package/resources/files.d.mts +19 -56
  236. package/resources/files.d.mts.map +1 -1
  237. package/resources/files.d.ts +19 -56
  238. package/resources/files.d.ts.map +1 -1
  239. package/resources/files.js +1 -8
  240. package/resources/files.js.map +1 -1
  241. package/resources/files.mjs +1 -8
  242. package/resources/files.mjs.map +1 -1
  243. package/resources/index.d.mts +2 -1
  244. package/resources/index.d.mts.map +1 -1
  245. package/resources/index.d.ts +2 -1
  246. package/resources/index.d.ts.map +1 -1
  247. package/resources/index.js +3 -1
  248. package/resources/index.js.map +1 -1
  249. package/resources/index.mjs +1 -0
  250. package/resources/index.mjs.map +1 -1
  251. package/resources/parsing.d.mts +31 -8
  252. package/resources/parsing.d.mts.map +1 -1
  253. package/resources/parsing.d.ts +31 -8
  254. package/resources/parsing.d.ts.map +1 -1
  255. package/resources/parsing.mjs.map +1 -1
  256. package/resources/pipelines/data-sources.d.mts +2 -2
  257. package/resources/pipelines/data-sources.d.mts.map +1 -1
  258. package/resources/pipelines/data-sources.d.ts +2 -2
  259. package/resources/pipelines/data-sources.d.ts.map +1 -1
  260. package/resources/pipelines/data-sources.js +2 -2
  261. package/resources/pipelines/data-sources.mjs +2 -2
  262. package/resources/pipelines/data-sources.mjs.map +1 -1
  263. package/resources/pipelines/documents.d.mts +2 -4
  264. package/resources/pipelines/documents.d.mts.map +1 -1
  265. package/resources/pipelines/documents.d.ts +2 -4
  266. package/resources/pipelines/documents.d.ts.map +1 -1
  267. package/resources/pipelines/documents.js +2 -4
  268. package/resources/pipelines/documents.js.map +1 -1
  269. package/resources/pipelines/documents.mjs +2 -4
  270. package/resources/pipelines/documents.mjs.map +1 -1
  271. package/resources/pipelines/files.d.mts.map +1 -1
  272. package/resources/pipelines/files.d.ts.map +1 -1
  273. package/resources/pipelines/files.mjs.map +1 -1
  274. package/resources/pipelines/images.d.mts.map +1 -1
  275. package/resources/pipelines/images.d.ts.map +1 -1
  276. package/resources/pipelines/images.mjs.map +1 -1
  277. package/resources/pipelines/index.d.mts.map +1 -1
  278. package/resources/pipelines/index.d.ts.map +1 -1
  279. package/resources/pipelines/index.mjs.map +1 -1
  280. package/resources/pipelines/metadata.d.mts.map +1 -1
  281. package/resources/pipelines/metadata.d.ts.map +1 -1
  282. package/resources/pipelines/metadata.mjs.map +1 -1
  283. package/resources/pipelines/pipelines.d.mts.map +1 -1
  284. package/resources/pipelines/pipelines.d.ts.map +1 -1
  285. package/resources/pipelines/pipelines.mjs.map +1 -1
  286. package/resources/pipelines/sync.d.mts.map +1 -1
  287. package/resources/pipelines/sync.d.ts.map +1 -1
  288. package/resources/pipelines/sync.mjs.map +1 -1
  289. package/resources/pipelines.d.mts.map +1 -1
  290. package/resources/pipelines.d.ts.map +1 -1
  291. package/resources/pipelines.mjs.map +1 -1
  292. package/resources/projects.d.mts +0 -1
  293. package/resources/projects.d.mts.map +1 -1
  294. package/resources/projects.d.ts +0 -1
  295. package/resources/projects.d.ts.map +1 -1
  296. package/resources/projects.mjs.map +1 -1
  297. package/resources/retrievers/index.d.mts.map +1 -1
  298. package/resources/retrievers/index.d.ts.map +1 -1
  299. package/resources/retrievers/index.mjs.map +1 -1
  300. package/resources/retrievers/retriever.d.mts.map +1 -1
  301. package/resources/retrievers/retriever.d.ts.map +1 -1
  302. package/resources/retrievers/retriever.mjs.map +1 -1
  303. package/resources/retrievers/retrievers.d.mts.map +1 -1
  304. package/resources/retrievers/retrievers.d.ts.map +1 -1
  305. package/resources/retrievers/retrievers.mjs.map +1 -1
  306. package/resources/retrievers.d.mts.map +1 -1
  307. package/resources/retrievers.d.ts.map +1 -1
  308. package/resources/retrievers.mjs.map +1 -1
  309. package/resources.d.mts.map +1 -1
  310. package/resources.d.ts.map +1 -1
  311. package/resources.mjs.map +1 -1
  312. package/src/client.ts +35 -2
  313. package/src/internal/types.ts +6 -8
  314. package/src/internal/utils/log.ts +2 -0
  315. package/src/resources/batches.ts +588 -0
  316. package/src/resources/beta/beta.ts +94 -0
  317. package/src/resources/beta/chat.ts +523 -0
  318. package/src/resources/beta/directories/directories.ts +77 -29
  319. package/src/resources/beta/directories/files.ts +73 -60
  320. package/src/resources/beta/index.ts +41 -0
  321. package/src/resources/beta/indexes.ts +421 -0
  322. package/src/resources/beta/retrieval.ts +483 -0
  323. package/src/resources/beta/sheets.ts +10 -17
  324. package/src/resources/classifier/jobs.ts +5 -8
  325. package/src/resources/configurations.ts +29 -92
  326. package/src/resources/extract.ts +2 -11
  327. package/src/resources/files.ts +22 -60
  328. package/src/resources/index.ts +10 -1
  329. package/src/resources/parsing.ts +37 -90
  330. package/src/resources/pipelines/data-sources.ts +2 -2
  331. package/src/resources/pipelines/documents.ts +2 -4
  332. package/src/resources/projects.ts +0 -2
  333. package/src/version.ts +1 -1
  334. package/uploads.d.mts +1 -0
  335. package/uploads.d.mts.map +1 -1
  336. package/uploads.d.ts +1 -0
  337. package/uploads.d.ts.map +1 -1
  338. package/uploads.mjs +1 -0
  339. package/uploads.mjs.map +1 -1
  340. package/version.d.mts +1 -1
  341. package/version.d.ts +1 -1
  342. package/version.js +1 -1
  343. package/version.mjs +1 -1
@@ -0,0 +1,588 @@
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 Batches extends APIResource {
10
+ /**
11
+ * Create a batch over a source directory and start processing asynchronously.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const batch = await client.batches.create({
16
+ * config: {
17
+ * job: {
18
+ * configuration_id:
19
+ * 'cfg-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
20
+ * type: 'parse_v2',
21
+ * },
22
+ * },
23
+ * source_directory_id:
24
+ * 'dir-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
25
+ * });
26
+ * ```
27
+ */
28
+ create(params: BatchCreateParams, options?: RequestOptions): APIPromise<BatchCreateResponse> {
29
+ const { organization_id, project_id, ...body } = params;
30
+ return this._client.post('/api/v2/batches', { query: { organization_id, project_id }, body, ...options });
31
+ }
32
+
33
+ /**
34
+ * List batches for the current project.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * // Automatically fetches more pages as needed.
39
+ * for await (const batchListResponse of client.batches.list()) {
40
+ * // ...
41
+ * }
42
+ * ```
43
+ */
44
+ list(
45
+ query: BatchListParams | null | undefined = {},
46
+ options?: RequestOptions,
47
+ ): PagePromise<BatchListResponsesPaginatedCursor, BatchListResponse> {
48
+ return this._client.getAPIList('/api/v2/batches', PaginatedCursor<BatchListResponse>, {
49
+ query,
50
+ ...options,
51
+ });
52
+ }
53
+
54
+ /**
55
+ * Get a batch by ID.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const batch = await client.batches.get('batch_id');
60
+ * ```
61
+ */
62
+ get(
63
+ batchID: string,
64
+ query: BatchGetParams | null | undefined = {},
65
+ options?: RequestOptions,
66
+ ): APIPromise<BatchGetResponse> {
67
+ return this._client.get(path`/api/v2/batches/${batchID}`, { query, ...options });
68
+ }
69
+ }
70
+
71
+ export type BatchListResponsesPaginatedCursor = PaginatedCursor<BatchListResponse>;
72
+
73
+ /**
74
+ * A top-level batch.
75
+ *
76
+ * Example: { "id": "bat-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "project_id":
77
+ * "prj-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "source_directory_id":
78
+ * "dir-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "config": { "job": { "type":
79
+ * "parse_v2", "configuration_id": "cfg-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" } },
80
+ * "status": "COMPLETED", "results": [ { "source_directory_file_id":
81
+ * "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "job_reference": { "type":
82
+ * "parse_v2", "id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" }, "error_message":
83
+ * null } ] }
84
+ *
85
+ * Batch-level `FAILED` means the orchestration failed and cannot provide a
86
+ * reliable per-file result set. `results` is only populated when explicitly
87
+ * requested with `expand=results` and may be `null` while a batch is still running
88
+ * or before result mappings are available.
89
+ */
90
+ export interface BatchCreateResponse {
91
+ /**
92
+ * Unique identifier
93
+ */
94
+ id: string;
95
+
96
+ /**
97
+ * Batch configuration snapshot.
98
+ */
99
+ config: BatchCreateResponse.Config;
100
+
101
+ /**
102
+ * Project this batch belongs to.
103
+ */
104
+ project_id: string;
105
+
106
+ /**
107
+ * Directory being processed.
108
+ */
109
+ source_directory_id: string;
110
+
111
+ /**
112
+ * Current batch status.
113
+ */
114
+ status: 'PENDING' | 'THROTTLED' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED';
115
+
116
+ /**
117
+ * Creation datetime
118
+ */
119
+ created_at?: string | null;
120
+
121
+ /**
122
+ * Expanded per-file result mappings. Null unless requested with expand=results, or
123
+ * until result mappings are available.
124
+ */
125
+ results?: Array<BatchCreateResponse.Result> | null;
126
+
127
+ /**
128
+ * Update datetime
129
+ */
130
+ updated_at?: string | null;
131
+ }
132
+
133
+ export namespace BatchCreateResponse {
134
+ /**
135
+ * Batch configuration snapshot.
136
+ */
137
+ export interface Config {
138
+ /**
139
+ * Job to create for each file in the source directory.
140
+ */
141
+ job: Config.Job;
142
+ }
143
+
144
+ export namespace Config {
145
+ /**
146
+ * Job to create for each file in the source directory.
147
+ */
148
+ export interface Job {
149
+ /**
150
+ * Saved product configuration ID matching the job type.
151
+ */
152
+ configuration_id: string;
153
+
154
+ /**
155
+ * Product job type to run for each source directory file.
156
+ */
157
+ type: 'parse_v2' | 'extract_v2';
158
+ }
159
+ }
160
+
161
+ /**
162
+ * Result projection for one source directory file in a batch.
163
+ *
164
+ * Example: { "source_directory_file_id":
165
+ * "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "job_reference": { "type":
166
+ * "parse_v2", "id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" }, "error_message":
167
+ * null }
168
+ *
169
+ * This is a projection of directory-sync state, not a separate child resource that
170
+ * callers need to create. The source directory file ID is the stable correlation
171
+ * key. Underlying job progress and failures should be resolved through the
172
+ * referenced product job endpoint.
173
+ */
174
+ export interface Result {
175
+ /**
176
+ * Source directory file processed by this batch.
177
+ */
178
+ source_directory_file_id: string;
179
+
180
+ /**
181
+ * Batch-level mapping error if the system could not create or associate a job for
182
+ * this source file.
183
+ */
184
+ error_message?: string | null;
185
+
186
+ /**
187
+ * Reference to a job produced by a batch.
188
+ *
189
+ * Example: { "type": "parse_v2", "id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
190
+ * }
191
+ */
192
+ job_reference?: Result.JobReference | null;
193
+ }
194
+
195
+ export namespace Result {
196
+ /**
197
+ * Reference to a job produced by a batch.
198
+ *
199
+ * Example: { "type": "parse_v2", "id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
200
+ * }
201
+ */
202
+ export interface JobReference {
203
+ /**
204
+ * Job ID, such as a parse job ID.
205
+ */
206
+ id: string;
207
+
208
+ /**
209
+ * Type of job produced for the file.
210
+ */
211
+ type: 'parse_v2' | 'extract_v2';
212
+ }
213
+ }
214
+ }
215
+
216
+ /**
217
+ * A top-level batch.
218
+ *
219
+ * Example: { "id": "bat-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "project_id":
220
+ * "prj-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "source_directory_id":
221
+ * "dir-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "config": { "job": { "type":
222
+ * "parse_v2", "configuration_id": "cfg-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" } },
223
+ * "status": "COMPLETED", "results": [ { "source_directory_file_id":
224
+ * "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "job_reference": { "type":
225
+ * "parse_v2", "id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" }, "error_message":
226
+ * null } ] }
227
+ *
228
+ * Batch-level `FAILED` means the orchestration failed and cannot provide a
229
+ * reliable per-file result set. `results` is only populated when explicitly
230
+ * requested with `expand=results` and may be `null` while a batch is still running
231
+ * or before result mappings are available.
232
+ */
233
+ export interface BatchListResponse {
234
+ /**
235
+ * Unique identifier
236
+ */
237
+ id: string;
238
+
239
+ /**
240
+ * Batch configuration snapshot.
241
+ */
242
+ config: BatchListResponse.Config;
243
+
244
+ /**
245
+ * Project this batch belongs to.
246
+ */
247
+ project_id: string;
248
+
249
+ /**
250
+ * Directory being processed.
251
+ */
252
+ source_directory_id: string;
253
+
254
+ /**
255
+ * Current batch status.
256
+ */
257
+ status: 'PENDING' | 'THROTTLED' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED';
258
+
259
+ /**
260
+ * Creation datetime
261
+ */
262
+ created_at?: string | null;
263
+
264
+ /**
265
+ * Expanded per-file result mappings. Null unless requested with expand=results, or
266
+ * until result mappings are available.
267
+ */
268
+ results?: Array<BatchListResponse.Result> | null;
269
+
270
+ /**
271
+ * Update datetime
272
+ */
273
+ updated_at?: string | null;
274
+ }
275
+
276
+ export namespace BatchListResponse {
277
+ /**
278
+ * Batch configuration snapshot.
279
+ */
280
+ export interface Config {
281
+ /**
282
+ * Job to create for each file in the source directory.
283
+ */
284
+ job: Config.Job;
285
+ }
286
+
287
+ export namespace Config {
288
+ /**
289
+ * Job to create for each file in the source directory.
290
+ */
291
+ export interface Job {
292
+ /**
293
+ * Saved product configuration ID matching the job type.
294
+ */
295
+ configuration_id: string;
296
+
297
+ /**
298
+ * Product job type to run for each source directory file.
299
+ */
300
+ type: 'parse_v2' | 'extract_v2';
301
+ }
302
+ }
303
+
304
+ /**
305
+ * Result projection for one source directory file in a batch.
306
+ *
307
+ * Example: { "source_directory_file_id":
308
+ * "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "job_reference": { "type":
309
+ * "parse_v2", "id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" }, "error_message":
310
+ * null }
311
+ *
312
+ * This is a projection of directory-sync state, not a separate child resource that
313
+ * callers need to create. The source directory file ID is the stable correlation
314
+ * key. Underlying job progress and failures should be resolved through the
315
+ * referenced product job endpoint.
316
+ */
317
+ export interface Result {
318
+ /**
319
+ * Source directory file processed by this batch.
320
+ */
321
+ source_directory_file_id: string;
322
+
323
+ /**
324
+ * Batch-level mapping error if the system could not create or associate a job for
325
+ * this source file.
326
+ */
327
+ error_message?: string | null;
328
+
329
+ /**
330
+ * Reference to a job produced by a batch.
331
+ *
332
+ * Example: { "type": "parse_v2", "id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
333
+ * }
334
+ */
335
+ job_reference?: Result.JobReference | null;
336
+ }
337
+
338
+ export namespace Result {
339
+ /**
340
+ * Reference to a job produced by a batch.
341
+ *
342
+ * Example: { "type": "parse_v2", "id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
343
+ * }
344
+ */
345
+ export interface JobReference {
346
+ /**
347
+ * Job ID, such as a parse job ID.
348
+ */
349
+ id: string;
350
+
351
+ /**
352
+ * Type of job produced for the file.
353
+ */
354
+ type: 'parse_v2' | 'extract_v2';
355
+ }
356
+ }
357
+ }
358
+
359
+ /**
360
+ * A top-level batch.
361
+ *
362
+ * Example: { "id": "bat-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "project_id":
363
+ * "prj-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "source_directory_id":
364
+ * "dir-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "config": { "job": { "type":
365
+ * "parse_v2", "configuration_id": "cfg-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" } },
366
+ * "status": "COMPLETED", "results": [ { "source_directory_file_id":
367
+ * "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "job_reference": { "type":
368
+ * "parse_v2", "id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" }, "error_message":
369
+ * null } ] }
370
+ *
371
+ * Batch-level `FAILED` means the orchestration failed and cannot provide a
372
+ * reliable per-file result set. `results` is only populated when explicitly
373
+ * requested with `expand=results` and may be `null` while a batch is still running
374
+ * or before result mappings are available.
375
+ */
376
+ export interface BatchGetResponse {
377
+ /**
378
+ * Unique identifier
379
+ */
380
+ id: string;
381
+
382
+ /**
383
+ * Batch configuration snapshot.
384
+ */
385
+ config: BatchGetResponse.Config;
386
+
387
+ /**
388
+ * Project this batch belongs to.
389
+ */
390
+ project_id: string;
391
+
392
+ /**
393
+ * Directory being processed.
394
+ */
395
+ source_directory_id: string;
396
+
397
+ /**
398
+ * Current batch status.
399
+ */
400
+ status: 'PENDING' | 'THROTTLED' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED';
401
+
402
+ /**
403
+ * Creation datetime
404
+ */
405
+ created_at?: string | null;
406
+
407
+ /**
408
+ * Expanded per-file result mappings. Null unless requested with expand=results, or
409
+ * until result mappings are available.
410
+ */
411
+ results?: Array<BatchGetResponse.Result> | null;
412
+
413
+ /**
414
+ * Update datetime
415
+ */
416
+ updated_at?: string | null;
417
+ }
418
+
419
+ export namespace BatchGetResponse {
420
+ /**
421
+ * Batch configuration snapshot.
422
+ */
423
+ export interface Config {
424
+ /**
425
+ * Job to create for each file in the source directory.
426
+ */
427
+ job: Config.Job;
428
+ }
429
+
430
+ export namespace Config {
431
+ /**
432
+ * Job to create for each file in the source directory.
433
+ */
434
+ export interface Job {
435
+ /**
436
+ * Saved product configuration ID matching the job type.
437
+ */
438
+ configuration_id: string;
439
+
440
+ /**
441
+ * Product job type to run for each source directory file.
442
+ */
443
+ type: 'parse_v2' | 'extract_v2';
444
+ }
445
+ }
446
+
447
+ /**
448
+ * Result projection for one source directory file in a batch.
449
+ *
450
+ * Example: { "source_directory_file_id":
451
+ * "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "job_reference": { "type":
452
+ * "parse_v2", "id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" }, "error_message":
453
+ * null }
454
+ *
455
+ * This is a projection of directory-sync state, not a separate child resource that
456
+ * callers need to create. The source directory file ID is the stable correlation
457
+ * key. Underlying job progress and failures should be resolved through the
458
+ * referenced product job endpoint.
459
+ */
460
+ export interface Result {
461
+ /**
462
+ * Source directory file processed by this batch.
463
+ */
464
+ source_directory_file_id: string;
465
+
466
+ /**
467
+ * Batch-level mapping error if the system could not create or associate a job for
468
+ * this source file.
469
+ */
470
+ error_message?: string | null;
471
+
472
+ /**
473
+ * Reference to a job produced by a batch.
474
+ *
475
+ * Example: { "type": "parse_v2", "id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
476
+ * }
477
+ */
478
+ job_reference?: Result.JobReference | null;
479
+ }
480
+
481
+ export namespace Result {
482
+ /**
483
+ * Reference to a job produced by a batch.
484
+ *
485
+ * Example: { "type": "parse_v2", "id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
486
+ * }
487
+ */
488
+ export interface JobReference {
489
+ /**
490
+ * Job ID, such as a parse job ID.
491
+ */
492
+ id: string;
493
+
494
+ /**
495
+ * Type of job produced for the file.
496
+ */
497
+ type: 'parse_v2' | 'extract_v2';
498
+ }
499
+ }
500
+ }
501
+
502
+ export interface BatchCreateParams {
503
+ /**
504
+ * Body param: Batch configuration snapshot to apply to this source directory.
505
+ */
506
+ config: BatchCreateParams.Config;
507
+
508
+ /**
509
+ * Body param: Directory whose files should be processed.
510
+ */
511
+ source_directory_id: string;
512
+
513
+ /**
514
+ * Query param
515
+ */
516
+ organization_id?: string | null;
517
+
518
+ /**
519
+ * Query param
520
+ */
521
+ project_id?: string | null;
522
+ }
523
+
524
+ export namespace BatchCreateParams {
525
+ /**
526
+ * Batch configuration snapshot to apply to this source directory.
527
+ */
528
+ export interface Config {
529
+ /**
530
+ * Job to create for each file in the source directory.
531
+ */
532
+ job: Config.Job;
533
+ }
534
+
535
+ export namespace Config {
536
+ /**
537
+ * Job to create for each file in the source directory.
538
+ */
539
+ export interface Job {
540
+ /**
541
+ * Saved product configuration ID matching the job type.
542
+ */
543
+ configuration_id: string;
544
+
545
+ /**
546
+ * Product job type to run for each source directory file.
547
+ */
548
+ type: 'parse_v2' | 'extract_v2';
549
+ }
550
+ }
551
+ }
552
+
553
+ export interface BatchListParams extends PaginatedCursorParams {
554
+ created_at_on_or_after?: string | null;
555
+
556
+ created_at_on_or_before?: string | null;
557
+
558
+ organization_id?: string | null;
559
+
560
+ project_id?: string | null;
561
+
562
+ source_directory_id?: string | null;
563
+
564
+ status?: 'PENDING' | 'THROTTLED' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | null;
565
+ }
566
+
567
+ export interface BatchGetParams {
568
+ /**
569
+ * Fields to expand. Supported value: results.
570
+ */
571
+ expand?: Array<string> | null;
572
+
573
+ organization_id?: string | null;
574
+
575
+ project_id?: string | null;
576
+ }
577
+
578
+ export declare namespace Batches {
579
+ export {
580
+ type BatchCreateResponse as BatchCreateResponse,
581
+ type BatchListResponse as BatchListResponse,
582
+ type BatchGetResponse as BatchGetResponse,
583
+ type BatchListResponsesPaginatedCursor as BatchListResponsesPaginatedCursor,
584
+ type BatchCreateParams as BatchCreateParams,
585
+ type BatchListParams as BatchListParams,
586
+ type BatchGetParams as BatchGetParams,
587
+ };
588
+ }
@@ -17,6 +17,50 @@ import {
17
17
  AgentDataSearchParams,
18
18
  AgentDataUpdateParams,
19
19
  } from './agent-data';
20
+ import * as ChatAPI from './chat';
21
+ import {
22
+ Chat,
23
+ ChatCreateParams,
24
+ ChatCreateResponse,
25
+ ChatDeleteParams,
26
+ ChatGetSummaryParams,
27
+ ChatGetSummaryResponse,
28
+ ChatListParams,
29
+ ChatListResponse,
30
+ ChatListResponsesPaginatedCursor,
31
+ ChatRetrieveParams,
32
+ ChatRetrieveResponse,
33
+ ChatStreamParams,
34
+ ChatStreamResponse,
35
+ } from './chat';
36
+ import * as IndexesAPI from './indexes';
37
+ import {
38
+ IndexCreateParams,
39
+ IndexCreateResponse,
40
+ IndexDeleteParams,
41
+ IndexGetParams,
42
+ IndexGetResponse,
43
+ IndexListParams,
44
+ IndexListResponse,
45
+ IndexListResponsesPaginatedCursor,
46
+ IndexSyncParams,
47
+ IndexSyncResponse,
48
+ Indexes,
49
+ } from './indexes';
50
+ import * as RetrievalAPI from './retrieval';
51
+ import {
52
+ Retrieval,
53
+ RetrievalFindParams,
54
+ RetrievalFindResponse,
55
+ RetrievalFindResponsesPaginatedCursorPost,
56
+ RetrievalGrepParams,
57
+ RetrievalGrepResponse,
58
+ RetrievalGrepResponsesPaginatedCursorPost,
59
+ RetrievalReadParams,
60
+ RetrievalReadResponse,
61
+ RetrievalRetrieveParams,
62
+ RetrievalRetrieveResponse,
63
+ } from './retrieval';
20
64
  import * as SheetsAPI from './sheets';
21
65
  import {
22
66
  SheetCreateParams,
@@ -74,6 +118,9 @@ import {
74
118
  } from './directories/directories';
75
119
 
76
120
  export class Beta extends APIResource {
121
+ indexes: IndexesAPI.Indexes = new IndexesAPI.Indexes(this._client);
122
+ retrieval: RetrievalAPI.Retrieval = new RetrievalAPI.Retrieval(this._client);
123
+ chat: ChatAPI.Chat = new ChatAPI.Chat(this._client);
77
124
  agentData: AgentDataAPI.AgentData = new AgentDataAPI.AgentData(this._client);
78
125
  sheets: SheetsAPI.Sheets = new SheetsAPI.Sheets(this._client);
79
126
  directories: DirectoriesAPI.Directories = new DirectoriesAPI.Directories(this._client);
@@ -81,12 +128,59 @@ export class Beta extends APIResource {
81
128
  split: SplitAPI.Split = new SplitAPI.Split(this._client);
82
129
  }
83
130
 
131
+ Beta.Indexes = Indexes;
132
+ Beta.Retrieval = Retrieval;
133
+ Beta.Chat = Chat;
84
134
  Beta.Sheets = Sheets;
85
135
  Beta.Directories = Directories;
86
136
  Beta.Batch = Batch;
87
137
  Beta.Split = Split;
88
138
 
89
139
  export declare namespace Beta {
140
+ export {
141
+ Indexes as Indexes,
142
+ type IndexCreateResponse as IndexCreateResponse,
143
+ type IndexListResponse as IndexListResponse,
144
+ type IndexGetResponse as IndexGetResponse,
145
+ type IndexSyncResponse as IndexSyncResponse,
146
+ type IndexListResponsesPaginatedCursor as IndexListResponsesPaginatedCursor,
147
+ type IndexCreateParams as IndexCreateParams,
148
+ type IndexListParams as IndexListParams,
149
+ type IndexDeleteParams as IndexDeleteParams,
150
+ type IndexGetParams as IndexGetParams,
151
+ type IndexSyncParams as IndexSyncParams,
152
+ };
153
+
154
+ export {
155
+ Retrieval as Retrieval,
156
+ type RetrievalRetrieveResponse as RetrievalRetrieveResponse,
157
+ type RetrievalFindResponse as RetrievalFindResponse,
158
+ type RetrievalGrepResponse as RetrievalGrepResponse,
159
+ type RetrievalReadResponse as RetrievalReadResponse,
160
+ type RetrievalFindResponsesPaginatedCursorPost as RetrievalFindResponsesPaginatedCursorPost,
161
+ type RetrievalGrepResponsesPaginatedCursorPost as RetrievalGrepResponsesPaginatedCursorPost,
162
+ type RetrievalRetrieveParams as RetrievalRetrieveParams,
163
+ type RetrievalFindParams as RetrievalFindParams,
164
+ type RetrievalGrepParams as RetrievalGrepParams,
165
+ type RetrievalReadParams as RetrievalReadParams,
166
+ };
167
+
168
+ export {
169
+ Chat as Chat,
170
+ type ChatCreateResponse as ChatCreateResponse,
171
+ type ChatRetrieveResponse as ChatRetrieveResponse,
172
+ type ChatListResponse as ChatListResponse,
173
+ type ChatGetSummaryResponse as ChatGetSummaryResponse,
174
+ type ChatStreamResponse as ChatStreamResponse,
175
+ type ChatListResponsesPaginatedCursor as ChatListResponsesPaginatedCursor,
176
+ type ChatCreateParams as ChatCreateParams,
177
+ type ChatRetrieveParams as ChatRetrieveParams,
178
+ type ChatListParams as ChatListParams,
179
+ type ChatDeleteParams as ChatDeleteParams,
180
+ type ChatGetSummaryParams as ChatGetSummaryParams,
181
+ type ChatStreamParams as ChatStreamParams,
182
+ };
183
+
90
184
  export {
91
185
  type AgentData as AgentData,
92
186
  type AgentDataDeleteResponse as AgentDataDeleteResponse,