@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,368 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { PagePromise, PaginatedCursorPost, type PaginatedCursorPostParams } from "../../core/pagination.mjs";
4
+ import { RequestOptions } from "../../internal/request-options.mjs";
5
+ export declare class Retrieval extends APIResource {
6
+ /**
7
+ * Retrieve relevant chunks via hybrid search (vector + full-text), with filtering
8
+ * on built-in or user-defined metadata.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const retrieval = await client.beta.retrieval.retrieve({
13
+ * index_id: 'idx-abc123',
14
+ * query: 'What are the key findings?',
15
+ * });
16
+ * ```
17
+ */
18
+ retrieve(params: RetrievalRetrieveParams, options?: RequestOptions): APIPromise<RetrievalRetrieveResponse>;
19
+ /**
20
+ * Search for files by name.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * // Automatically fetches more pages as needed.
25
+ * for await (const retrievalFindResponse of client.beta.retrieval.find(
26
+ * { index_id: 'idx-abc123' },
27
+ * )) {
28
+ * // ...
29
+ * }
30
+ * ```
31
+ */
32
+ find(params: RetrievalFindParams, options?: RequestOptions): PagePromise<RetrievalFindResponsesPaginatedCursorPost, RetrievalFindResponse>;
33
+ /**
34
+ * Grep within a file's parsed content using a regex pattern.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * // Automatically fetches more pages as needed.
39
+ * for await (const retrievalGrepResponse of client.beta.retrieval.grep(
40
+ * {
41
+ * file_id: 'file_id',
42
+ * index_id: 'idx-abc123',
43
+ * pattern: 'revenue|profit',
44
+ * },
45
+ * )) {
46
+ * // ...
47
+ * }
48
+ * ```
49
+ */
50
+ grep(params: RetrievalGrepParams, options?: RequestOptions): PagePromise<RetrievalGrepResponsesPaginatedCursorPost, RetrievalGrepResponse>;
51
+ /**
52
+ * Read the parsed text content of a specific file.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const response = await client.beta.retrieval.read({
57
+ * file_id: 'file_id',
58
+ * index_id: 'idx-abc123',
59
+ * });
60
+ * ```
61
+ */
62
+ read(params: RetrievalReadParams, options?: RequestOptions): APIPromise<RetrievalReadResponse>;
63
+ }
64
+ export type RetrievalFindResponsesPaginatedCursorPost = PaginatedCursorPost<RetrievalFindResponse>;
65
+ export type RetrievalGrepResponsesPaginatedCursorPost = PaginatedCursorPost<RetrievalGrepResponse>;
66
+ /**
67
+ * Response containing retrieval results.
68
+ */
69
+ export interface RetrievalRetrieveResponse {
70
+ /**
71
+ * Ordered list of retrieved chunks.
72
+ */
73
+ results: Array<RetrievalRetrieveResponse.Result>;
74
+ }
75
+ export declare namespace RetrievalRetrieveResponse {
76
+ /**
77
+ * A single retrieval result.
78
+ */
79
+ interface Result {
80
+ /**
81
+ * Text content of the retrieved chunk.
82
+ */
83
+ content: string;
84
+ /**
85
+ * User-defined metadata associated with the chunk.
86
+ */
87
+ metadata?: {
88
+ [key: string]: string | number | boolean | Array<string> | null;
89
+ } | null;
90
+ /**
91
+ * Relevance score from the reranker, if reranking was applied.
92
+ */
93
+ rerank_score?: number | null;
94
+ /**
95
+ * Hybrid search relevance score.
96
+ */
97
+ score?: number | null;
98
+ /**
99
+ * Built-in fields stored for every exported chunk.
100
+ */
101
+ static_fields?: Result.StaticFields;
102
+ }
103
+ namespace Result {
104
+ /**
105
+ * Built-in fields stored for every exported chunk.
106
+ */
107
+ interface StaticFields {
108
+ /**
109
+ * Attachments associated with the chunk
110
+ */
111
+ attachments?: Array<StaticFields.Attachment>;
112
+ /**
113
+ * End character offset of the chunk.
114
+ */
115
+ chunk_end_char?: number | null;
116
+ /**
117
+ * Index of the chunk within the file.
118
+ */
119
+ chunk_index?: number | null;
120
+ /**
121
+ * Start character offset of the chunk.
122
+ */
123
+ chunk_start_char?: number | null;
124
+ /**
125
+ * Token count of the chunk.
126
+ */
127
+ chunk_token_count?: number | null;
128
+ /**
129
+ * Last page number covered by this chunk.
130
+ */
131
+ page_range_end?: number | null;
132
+ /**
133
+ * First page number covered by this chunk.
134
+ */
135
+ page_range_start?: number | null;
136
+ /**
137
+ * ID of the parsed file.
138
+ */
139
+ parsed_directory_file_id?: string | null;
140
+ }
141
+ namespace StaticFields {
142
+ /**
143
+ * Reference to a file attachment, retrievable via
144
+ * `GET /api/v1/beta/attachments/{attachment_name}?source_id=...`.
145
+ */
146
+ interface Attachment {
147
+ /**
148
+ * Attachment-relative path, e.g. 'screenshots/page_7.jpg'.
149
+ */
150
+ attachment_name: string;
151
+ /**
152
+ * File ID to pass as source_id when fetching the attachment.
153
+ */
154
+ source_id: string;
155
+ /**
156
+ * Attachment kind, e.g. 'screenshot', 'items'.
157
+ */
158
+ type: string;
159
+ }
160
+ }
161
+ }
162
+ }
163
+ /**
164
+ * A file returned by find.
165
+ */
166
+ export interface RetrievalFindResponse {
167
+ /**
168
+ * ID of the file.
169
+ */
170
+ file_id: string;
171
+ /**
172
+ * Display name of the file.
173
+ */
174
+ file_name: string;
175
+ }
176
+ /**
177
+ * A single grep match within a file.
178
+ */
179
+ export interface RetrievalGrepResponse {
180
+ /**
181
+ * Matched text content.
182
+ */
183
+ content: string;
184
+ /**
185
+ * End character offset of the match.
186
+ */
187
+ end_char: number;
188
+ /**
189
+ * Start character offset of the match.
190
+ */
191
+ start_char: number;
192
+ }
193
+ /**
194
+ * File read result.
195
+ */
196
+ export interface RetrievalReadResponse {
197
+ /**
198
+ * Parsed text content of the file.
199
+ */
200
+ content: string;
201
+ }
202
+ export interface RetrievalRetrieveParams {
203
+ /**
204
+ * Body param: ID of the index to retrieve against.
205
+ */
206
+ index_id: string;
207
+ /**
208
+ * Body param: Natural-language query to retrieve relevant chunks.
209
+ */
210
+ query: string;
211
+ /**
212
+ * Query param
213
+ */
214
+ organization_id?: string | null;
215
+ /**
216
+ * Query param
217
+ */
218
+ project_id?: string | null;
219
+ /**
220
+ * Body param: Filters on user-defined metadata fields.
221
+ */
222
+ custom_filters?: {
223
+ [key: string]: RetrievalRetrieveParams.FilterTypeUnionStrIntBoolFloat | Array<RetrievalRetrieveParams.UnionMember1> | null;
224
+ } | null;
225
+ /**
226
+ * Body param: Weight of the full-text search pipeline (0-1).
227
+ */
228
+ full_text_pipeline_weight?: number | null;
229
+ /**
230
+ * Body param: Number of candidates for approximate nearest neighbor search.
231
+ */
232
+ num_candidates?: number | null;
233
+ /**
234
+ * Body param: Reranking configuration applied after hybrid search. Enabled by
235
+ * default.
236
+ */
237
+ rerank?: RetrievalRetrieveParams.Rerank;
238
+ /**
239
+ * Body param: Minimum score threshold for returned results.
240
+ */
241
+ score_threshold?: number | null;
242
+ /**
243
+ * Body param: Filters on built-in document fields (page range, chunk index, etc.).
244
+ */
245
+ static_filters?: RetrievalRetrieveParams.StaticFilters | null;
246
+ /**
247
+ * Body param: Maximum number of results to return.
248
+ */
249
+ top_k?: number | null;
250
+ /**
251
+ * Body param: Weight of the vector search pipeline (0-1).
252
+ */
253
+ vector_pipeline_weight?: number | null;
254
+ }
255
+ export declare namespace RetrievalRetrieveParams {
256
+ interface FilterTypeUnionStrIntBoolFloat {
257
+ operator: 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' | 'in' | 'nin';
258
+ value: string | boolean | number | Array<string | boolean | number>;
259
+ }
260
+ interface UnionMember1 {
261
+ operator: 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' | 'in' | 'nin';
262
+ value: number | Array<number>;
263
+ }
264
+ /**
265
+ * Reranking configuration applied after hybrid search. Enabled by default.
266
+ */
267
+ interface Rerank {
268
+ /**
269
+ * Set to false to disable reranking.
270
+ */
271
+ enabled?: boolean;
272
+ /**
273
+ * Number of results to return after reranking.
274
+ */
275
+ top_n?: number | null;
276
+ }
277
+ /**
278
+ * Filters on built-in document fields (page range, chunk index, etc.).
279
+ */
280
+ interface StaticFilters {
281
+ parsed_directory_file_id?: StaticFilters.ParsedDirectoryFileID | null;
282
+ }
283
+ namespace StaticFilters {
284
+ interface ParsedDirectoryFileID {
285
+ operator: 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' | 'in' | 'nin';
286
+ value: string | Array<string>;
287
+ }
288
+ }
289
+ }
290
+ export interface RetrievalFindParams extends PaginatedCursorPostParams {
291
+ /**
292
+ * Body param: ID of the index to search within.
293
+ */
294
+ index_id: string;
295
+ /**
296
+ * Query param
297
+ */
298
+ organization_id?: string | null;
299
+ /**
300
+ * Query param
301
+ */
302
+ project_id?: string | null;
303
+ /**
304
+ * Body param: Exact file name to match.
305
+ */
306
+ file_name?: string | null;
307
+ /**
308
+ * Body param: Substring match on file name (case-insensitive).
309
+ */
310
+ file_name_contains?: string | null;
311
+ }
312
+ export interface RetrievalGrepParams extends PaginatedCursorPostParams {
313
+ /**
314
+ * Body param: ID of the file to grep.
315
+ */
316
+ file_id: string;
317
+ /**
318
+ * Body param: ID of the index the file belongs to.
319
+ */
320
+ index_id: string;
321
+ /**
322
+ * Body param: Regex pattern to search for.
323
+ */
324
+ pattern: string;
325
+ /**
326
+ * Query param
327
+ */
328
+ organization_id?: string | null;
329
+ /**
330
+ * Query param
331
+ */
332
+ project_id?: string | null;
333
+ /**
334
+ * Body param: Number of characters of context to include before and after the
335
+ * matched pattern in the content field of the response
336
+ */
337
+ context_chars?: number | null;
338
+ }
339
+ export interface RetrievalReadParams {
340
+ /**
341
+ * Body param: ID of the file to read.
342
+ */
343
+ file_id: string;
344
+ /**
345
+ * Body param: ID of the index the file belongs to.
346
+ */
347
+ index_id: string;
348
+ /**
349
+ * Query param
350
+ */
351
+ organization_id?: string | null;
352
+ /**
353
+ * Query param
354
+ */
355
+ project_id?: string | null;
356
+ /**
357
+ * Body param: Maximum number of characters to read from the offset.
358
+ */
359
+ max_length?: number | null;
360
+ /**
361
+ * Body param: Starting character offset.
362
+ */
363
+ offset?: number;
364
+ }
365
+ export declare namespace Retrieval {
366
+ export { type RetrievalRetrieveResponse as RetrievalRetrieveResponse, type RetrievalFindResponse as RetrievalFindResponse, type RetrievalGrepResponse as RetrievalGrepResponse, type RetrievalReadResponse as RetrievalReadResponse, type RetrievalFindResponsesPaginatedCursorPost as RetrievalFindResponsesPaginatedCursorPost, type RetrievalGrepResponsesPaginatedCursorPost as RetrievalGrepResponsesPaginatedCursorPost, type RetrievalRetrieveParams as RetrievalRetrieveParams, type RetrievalFindParams as RetrievalFindParams, type RetrievalGrepParams as RetrievalGrepParams, type RetrievalReadParams as RetrievalReadParams, };
367
+ }
368
+ //# sourceMappingURL=retrieval.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retrieval.d.mts","sourceRoot":"","sources":["../../src/resources/beta/retrieval.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,KAAK,yBAAyB,EAAE,kCAA8B;AACzG,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAEhE,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;IAS1G;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,yCAAyC,EAAE,qBAAqB,CAAC;IAShF;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,yCAAyC,EAAE,qBAAqB,CAAC;IAShF;;;;;;;;;;OAUG;IACH,IAAI,CAAC,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;CAQ/F;AAED,MAAM,MAAM,yCAAyC,GAAG,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;AAEnG,MAAM,MAAM,yCAAyC,GAAG,mBAAmB,CAAC,qB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