@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,357 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { PagePromise, PaginatedCursor, type PaginatedCursorParams } from "../../core/pagination.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ export declare class Chat extends APIResource {
6
+ /**
7
+ * Create a chat session, optionally bound to indexes (locked after the first
8
+ * message).
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const chat = await client.beta.chat.create();
13
+ * ```
14
+ */
15
+ create(params?: ChatCreateParams | null | undefined, options?: RequestOptions): APIPromise<ChatCreateResponse>;
16
+ /**
17
+ * Retrieve a full session by ID, including its event history.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const chat = await client.beta.chat.retrieve('session_id');
22
+ * ```
23
+ */
24
+ retrieve(sessionID: string, query?: ChatRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<ChatRetrieveResponse>;
25
+ /**
26
+ * List all chat sessions for the current project.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * // Automatically fetches more pages as needed.
31
+ * for await (const chatListResponse of client.beta.chat.list()) {
32
+ * // ...
33
+ * }
34
+ * ```
35
+ */
36
+ list(query?: ChatListParams | null | undefined, options?: RequestOptions): PagePromise<ChatListResponsesPaginatedCursor, ChatListResponse>;
37
+ /**
38
+ * Delete a session.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * await client.beta.chat.delete('session_id');
43
+ * ```
44
+ */
45
+ delete(sessionID: string, params?: ChatDeleteParams | null | undefined, options?: RequestOptions): APIPromise<void>;
46
+ /**
47
+ * Retrieve a session summary by ID.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const response = await client.beta.chat.getSummary(
52
+ * 'session_id',
53
+ * );
54
+ * ```
55
+ */
56
+ getSummary(sessionID: string, query?: ChatGetSummaryParams | null | undefined, options?: RequestOptions): APIPromise<ChatGetSummaryResponse>;
57
+ /**
58
+ * Stream agent events for a chat turn as Server-Sent Events.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const response = await client.beta.chat.stream(
63
+ * 'session_id',
64
+ * {
65
+ * index_ids: ['idx-abc123', 'idx-def456'],
66
+ * prompt: 'What were the main findings in Q3?',
67
+ * },
68
+ * );
69
+ * ```
70
+ */
71
+ stream(sessionID: string, params: ChatStreamParams, options?: RequestOptions): APIPromise<unknown>;
72
+ }
73
+ export type ChatListResponsesPaginatedCursor = PaginatedCursor<ChatListResponse>;
74
+ /**
75
+ * Summary of a chat session, including its title and last run metadata.
76
+ */
77
+ export interface ChatCreateResponse {
78
+ /**
79
+ * ISO-format timestamp showing when the session was last updated.
80
+ */
81
+ last_updated_at: string;
82
+ /**
83
+ * Unique session identifier.
84
+ */
85
+ session_id: string;
86
+ /**
87
+ * Auto-generated title derived from the first user message.
88
+ */
89
+ generated_title?: string | null;
90
+ /**
91
+ * Indexes this session is bound to. Null on unbound sessions.
92
+ */
93
+ index_ids?: Array<string> | null;
94
+ /**
95
+ * Token usage and status from the most recent run. Null if the session has not
96
+ * been run yet.
97
+ */
98
+ job_metadata?: ChatCreateResponse.JobMetadata | null;
99
+ }
100
+ export declare namespace ChatCreateResponse {
101
+ /**
102
+ * Token usage and status from the most recent run. Null if the session has not
103
+ * been run yet.
104
+ */
105
+ interface JobMetadata {
106
+ duration_ms?: number;
107
+ error?: string | null;
108
+ export_config_ids?: Array<string> | null;
109
+ is_error?: boolean;
110
+ total_input_tokens?: number | null;
111
+ total_output_tokens?: number | null;
112
+ turns?: number;
113
+ }
114
+ }
115
+ /**
116
+ * Full chat session including its complete event history.
117
+ */
118
+ export interface ChatRetrieveResponse {
119
+ /**
120
+ * Ordered list of events that make up the conversation history.
121
+ */
122
+ events: Array<ChatRetrieveResponse.ThinkingDeltaEvent | ChatRetrieveResponse.TextDeltaEvent | ChatRetrieveResponse.ThinkingEvent | ChatRetrieveResponse.TextEvent | ChatRetrieveResponse.ToolCallEvent | ChatRetrieveResponse.ToolResultEvent | ChatRetrieveResponse.StopEvent | ChatRetrieveResponse.UserInputEvent>;
123
+ /**
124
+ * ISO-format timestamp showing when the session was last updated.
125
+ */
126
+ last_updated_at: string;
127
+ /**
128
+ * Unique session identifier.
129
+ */
130
+ session_id: string;
131
+ /**
132
+ * Auto-generated title derived from the first user message.
133
+ */
134
+ generated_title?: string | null;
135
+ /**
136
+ * Indexes this session is bound to. Null on unbound sessions.
137
+ */
138
+ index_ids?: Array<string> | null;
139
+ /**
140
+ * Token usage and status from the most recent run. Null if the session has not
141
+ * been run yet.
142
+ */
143
+ job_metadata?: ChatRetrieveResponse.JobMetadata | null;
144
+ }
145
+ export declare namespace ChatRetrieveResponse {
146
+ interface ThinkingDeltaEvent {
147
+ content: string;
148
+ type?: 'thinking_delta';
149
+ }
150
+ interface TextDeltaEvent {
151
+ content: string;
152
+ type?: 'text_delta';
153
+ }
154
+ interface ThinkingEvent {
155
+ content: string;
156
+ type?: 'thinking';
157
+ }
158
+ interface TextEvent {
159
+ content: string;
160
+ type?: 'text';
161
+ }
162
+ interface ToolCallEvent {
163
+ arguments: {
164
+ [key: string]: unknown;
165
+ };
166
+ call_id: string;
167
+ name: string;
168
+ type?: 'tool_call';
169
+ }
170
+ interface ToolResultEvent {
171
+ call_id: string;
172
+ name: string;
173
+ result: unknown;
174
+ /**
175
+ * Coordinates for lazily resolving a page screenshot presigned URL.
176
+ */
177
+ image_attachment?: ToolResultEvent.ImageAttachment | null;
178
+ type?: 'tool_result';
179
+ }
180
+ namespace ToolResultEvent {
181
+ /**
182
+ * Coordinates for lazily resolving a page screenshot presigned URL.
183
+ */
184
+ interface ImageAttachment {
185
+ attachment_name: string;
186
+ source_id: string;
187
+ }
188
+ }
189
+ interface StopEvent {
190
+ error: string | null;
191
+ is_error: boolean;
192
+ usage: StopEvent.Usage;
193
+ type?: 'stop';
194
+ }
195
+ namespace StopEvent {
196
+ interface Usage {
197
+ duration_ms?: number;
198
+ total_input_tokens?: number | null;
199
+ total_output_tokens?: number | null;
200
+ turns?: number;
201
+ }
202
+ }
203
+ interface UserInputEvent {
204
+ content: string;
205
+ type?: 'user_input';
206
+ }
207
+ /**
208
+ * Token usage and status from the most recent run. Null if the session has not
209
+ * been run yet.
210
+ */
211
+ interface JobMetadata {
212
+ duration_ms?: number;
213
+ error?: string | null;
214
+ export_config_ids?: Array<string> | null;
215
+ is_error?: boolean;
216
+ total_input_tokens?: number | null;
217
+ total_output_tokens?: number | null;
218
+ turns?: number;
219
+ }
220
+ }
221
+ /**
222
+ * Summary of a chat session, including its title and last run metadata.
223
+ */
224
+ export interface ChatListResponse {
225
+ /**
226
+ * ISO-format timestamp showing when the session was last updated.
227
+ */
228
+ last_updated_at: string;
229
+ /**
230
+ * Unique session identifier.
231
+ */
232
+ session_id: string;
233
+ /**
234
+ * Auto-generated title derived from the first user message.
235
+ */
236
+ generated_title?: string | null;
237
+ /**
238
+ * Indexes this session is bound to. Null on unbound sessions.
239
+ */
240
+ index_ids?: Array<string> | null;
241
+ /**
242
+ * Token usage and status from the most recent run. Null if the session has not
243
+ * been run yet.
244
+ */
245
+ job_metadata?: ChatListResponse.JobMetadata | null;
246
+ }
247
+ export declare namespace ChatListResponse {
248
+ /**
249
+ * Token usage and status from the most recent run. Null if the session has not
250
+ * been run yet.
251
+ */
252
+ interface JobMetadata {
253
+ duration_ms?: number;
254
+ error?: string | null;
255
+ export_config_ids?: Array<string> | null;
256
+ is_error?: boolean;
257
+ total_input_tokens?: number | null;
258
+ total_output_tokens?: number | null;
259
+ turns?: number;
260
+ }
261
+ }
262
+ /**
263
+ * Summary of a chat session, including its title and last run metadata.
264
+ */
265
+ export interface ChatGetSummaryResponse {
266
+ /**
267
+ * ISO-format timestamp showing when the session was last updated.
268
+ */
269
+ last_updated_at: string;
270
+ /**
271
+ * Unique session identifier.
272
+ */
273
+ session_id: string;
274
+ /**
275
+ * Auto-generated title derived from the first user message.
276
+ */
277
+ generated_title?: string | null;
278
+ /**
279
+ * Indexes this session is bound to. Null on unbound sessions.
280
+ */
281
+ index_ids?: Array<string> | null;
282
+ /**
283
+ * Token usage and status from the most recent run. Null if the session has not
284
+ * been run yet.
285
+ */
286
+ job_metadata?: ChatGetSummaryResponse.JobMetadata | null;
287
+ }
288
+ export declare namespace ChatGetSummaryResponse {
289
+ /**
290
+ * Token usage and status from the most recent run. Null if the session has not
291
+ * been run yet.
292
+ */
293
+ interface JobMetadata {
294
+ duration_ms?: number;
295
+ error?: string | null;
296
+ export_config_ids?: Array<string> | null;
297
+ is_error?: boolean;
298
+ total_input_tokens?: number | null;
299
+ total_output_tokens?: number | null;
300
+ turns?: number;
301
+ }
302
+ }
303
+ export type ChatStreamResponse = unknown;
304
+ export interface ChatCreateParams {
305
+ /**
306
+ * Query param
307
+ */
308
+ organization_id?: string | null;
309
+ /**
310
+ * Query param
311
+ */
312
+ project_id?: string | null;
313
+ /**
314
+ * Body param: Indexes this session will retrieve from. Once set and the first
315
+ * message has been sent, the source set is locked for the session's lifetime.
316
+ * Leave null to create an unbound session.
317
+ */
318
+ index_ids?: Array<string> | null;
319
+ }
320
+ export interface ChatRetrieveParams {
321
+ organization_id?: string | null;
322
+ project_id?: string | null;
323
+ }
324
+ export interface ChatListParams extends PaginatedCursorParams {
325
+ organization_id?: string | null;
326
+ project_id?: string | null;
327
+ }
328
+ export interface ChatDeleteParams {
329
+ organization_id?: string | null;
330
+ project_id?: string | null;
331
+ }
332
+ export interface ChatGetSummaryParams {
333
+ organization_id?: string | null;
334
+ project_id?: string | null;
335
+ }
336
+ export interface ChatStreamParams {
337
+ /**
338
+ * Body param: Indexes to retrieve data from.
339
+ */
340
+ index_ids: Array<string>;
341
+ /**
342
+ * Body param: User message for this chat turn.
343
+ */
344
+ prompt: string;
345
+ /**
346
+ * Query param
347
+ */
348
+ organization_id?: string | null;
349
+ /**
350
+ * Query param
351
+ */
352
+ project_id?: string | null;
353
+ }
354
+ export declare namespace Chat {
355
+ export { type ChatCreateResponse as ChatCreateResponse, type ChatRetrieveResponse as ChatRetrieveResponse, type ChatListResponse as ChatListResponse, type ChatGetSummaryResponse as ChatGetSummaryResponse, type ChatStreamResponse as ChatStreamResponse, type ChatListResponsesPaginatedCursor as ChatListResponsesPaginatedCursor, type ChatCreateParams as ChatCreateParams, type ChatRetrieveParams as ChatRetrieveParams, type ChatListParams as ChatListParams, type ChatDeleteParams as ChatDeleteParams, type ChatGetSummaryParams as ChatGetSummaryParams, type ChatStreamParams as ChatStreamParams, };
356
+ }
357
+ //# sourceMappingURL=chat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/resources/beta/chat.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,qBAAqB,EAAE,iCAA8B;AAEjG,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;;;OAQG;IACH,MAAM,CACJ,MAAM,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,kBAAkB,CAAC;IAKjC;;;;;;;OAOG;IACH,QAAQ,CACN,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAInC;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,cAAc,GAAG,IAAI,GAAG,SAAc,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,gCAAgC,EAAE,gBAAgB,CAAC;IAIlE;;;;;;;OAOG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,IAAI,CA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;CAC5B;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Chat = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const pagination_1 = require("../../core/pagination.js");
7
+ const headers_1 = require("../../internal/headers.js");
8
+ const path_1 = require("../../internal/utils/path.js");
9
+ class Chat extends resource_1.APIResource {
10
+ /**
11
+ * Create a chat session, optionally bound to indexes (locked after the first
12
+ * message).
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const chat = await client.beta.chat.create();
17
+ * ```
18
+ */
19
+ create(params = {}, options) {
20
+ const { organization_id, project_id, ...body } = params ?? {};
21
+ return this._client.post('/api/v1/chat', { query: { organization_id, project_id }, body, ...options });
22
+ }
23
+ /**
24
+ * Retrieve a full session by ID, including its event history.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const chat = await client.beta.chat.retrieve('session_id');
29
+ * ```
30
+ */
31
+ retrieve(sessionID, query = {}, options) {
32
+ return this._client.get((0, path_1.path) `/api/v1/chat/${sessionID}`, { query, ...options });
33
+ }
34
+ /**
35
+ * List all chat sessions for the current project.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * // Automatically fetches more pages as needed.
40
+ * for await (const chatListResponse of client.beta.chat.list()) {
41
+ * // ...
42
+ * }
43
+ * ```
44
+ */
45
+ list(query = {}, options) {
46
+ return this._client.getAPIList('/api/v1/chat', (pagination_1.PaginatedCursor), { query, ...options });
47
+ }
48
+ /**
49
+ * Delete a session.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * await client.beta.chat.delete('session_id');
54
+ * ```
55
+ */
56
+ delete(sessionID, params = {}, options) {
57
+ const { organization_id, project_id } = params ?? {};
58
+ return this._client.delete((0, path_1.path) `/api/v1/chat/${sessionID}`, {
59
+ query: { organization_id, project_id },
60
+ ...options,
61
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
62
+ });
63
+ }
64
+ /**
65
+ * Retrieve a session summary by ID.
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * const response = await client.beta.chat.getSummary(
70
+ * 'session_id',
71
+ * );
72
+ * ```
73
+ */
74
+ getSummary(sessionID, query = {}, options) {
75
+ return this._client.get((0, path_1.path) `/api/v1/chat/${sessionID}/summary`, { query, ...options });
76
+ }
77
+ /**
78
+ * Stream agent events for a chat turn as Server-Sent Events.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * const response = await client.beta.chat.stream(
83
+ * 'session_id',
84
+ * {
85
+ * index_ids: ['idx-abc123', 'idx-def456'],
86
+ * prompt: 'What were the main findings in Q3?',
87
+ * },
88
+ * );
89
+ * ```
90
+ */
91
+ stream(sessionID, params, options) {
92
+ const { organization_id, project_id, ...body } = params;
93
+ return this._client.post((0, path_1.path) `/api/v1/chat/${sessionID}/messages/stream`, {
94
+ query: { organization_id, project_id },
95
+ body,
96
+ ...options,
97
+ });
98
+ }
99
+ }
100
+ exports.Chat = Chat;
101
+ //# sourceMappingURL=chat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/resources/beta/chat.ts"],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AAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,UAAU,CACR,SAAiB,EACjB,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,SAAiB,EAAE,MAAwB,EAAE,OAAwB;QAC1E,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,kBAAkB,EAAE;YACxE,KAAK,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE;YACtC,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAjHD,oBAiHC"}
@@ -0,0 +1,97 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { PaginatedCursor } from "../../core/pagination.mjs";
4
+ import { buildHeaders } from "../../internal/headers.mjs";
5
+ import { path } from "../../internal/utils/path.mjs";
6
+ export class Chat extends APIResource {
7
+ /**
8
+ * Create a chat session, optionally bound to indexes (locked after the first
9
+ * message).
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const chat = await client.beta.chat.create();
14
+ * ```
15
+ */
16
+ create(params = {}, options) {
17
+ const { organization_id, project_id, ...body } = params ?? {};
18
+ return this._client.post('/api/v1/chat', { query: { organization_id, project_id }, body, ...options });
19
+ }
20
+ /**
21
+ * Retrieve a full session by ID, including its event history.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const chat = await client.beta.chat.retrieve('session_id');
26
+ * ```
27
+ */
28
+ retrieve(sessionID, query = {}, options) {
29
+ return this._client.get(path `/api/v1/chat/${sessionID}`, { query, ...options });
30
+ }
31
+ /**
32
+ * List all chat sessions for the current project.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * // Automatically fetches more pages as needed.
37
+ * for await (const chatListResponse of client.beta.chat.list()) {
38
+ * // ...
39
+ * }
40
+ * ```
41
+ */
42
+ list(query = {}, options) {
43
+ return this._client.getAPIList('/api/v1/chat', (PaginatedCursor), { query, ...options });
44
+ }
45
+ /**
46
+ * Delete a session.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * await client.beta.chat.delete('session_id');
51
+ * ```
52
+ */
53
+ delete(sessionID, params = {}, options) {
54
+ const { organization_id, project_id } = params ?? {};
55
+ return this._client.delete(path `/api/v1/chat/${sessionID}`, {
56
+ query: { organization_id, project_id },
57
+ ...options,
58
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
59
+ });
60
+ }
61
+ /**
62
+ * Retrieve a session summary by ID.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const response = await client.beta.chat.getSummary(
67
+ * 'session_id',
68
+ * );
69
+ * ```
70
+ */
71
+ getSummary(sessionID, query = {}, options) {
72
+ return this._client.get(path `/api/v1/chat/${sessionID}/summary`, { query, ...options });
73
+ }
74
+ /**
75
+ * Stream agent events for a chat turn as Server-Sent Events.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * const response = await client.beta.chat.stream(
80
+ * 'session_id',
81
+ * {
82
+ * index_ids: ['idx-abc123', 'idx-def456'],
83
+ * prompt: 'What were the main findings in Q3?',
84
+ * },
85
+ * );
86
+ * ```
87
+ */
88
+ stream(sessionID, params, options) {
89
+ const { organization_id, project_id, ...body } = params;
90
+ return this._client.post(path `/api/v1/chat/${sessionID}/messages/stream`, {
91
+ query: { organization_id, project_id },
92
+ body,
93
+ ...options,
94
+ });
95
+ }
96
+ }
97
+ //# sourceMappingURL=chat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