@mixedbread/sdk 0.4.0 → 0.6.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 (357) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +2 -2
  3. package/api-promise.js +2 -15
  4. package/api-promise.js.map +1 -1
  5. package/bin/cli +52 -0
  6. package/bin/migration-config.json +176 -0
  7. package/client.d.mts +20 -8
  8. package/client.d.mts.map +1 -1
  9. package/client.d.ts +20 -8
  10. package/client.d.ts.map +1 -1
  11. package/client.js +45 -50
  12. package/client.js.map +1 -1
  13. package/client.mjs +37 -19
  14. package/client.mjs.map +1 -1
  15. package/core/api-promise.d.mts +0 -1
  16. package/core/api-promise.d.mts.map +1 -1
  17. package/core/api-promise.d.ts +0 -1
  18. package/core/api-promise.d.ts.map +1 -1
  19. package/core/api-promise.js +4 -14
  20. package/core/api-promise.js.map +1 -1
  21. package/core/api-promise.mjs +1 -11
  22. package/core/api-promise.mjs.map +1 -1
  23. package/core/error.d.mts +0 -1
  24. package/core/error.d.mts.map +1 -1
  25. package/core/error.d.ts +0 -1
  26. package/core/error.d.ts.map +1 -1
  27. package/core/error.js.map +1 -1
  28. package/core/error.mjs.map +1 -1
  29. package/core/pagination.d.mts +0 -1
  30. package/core/pagination.d.mts.map +1 -1
  31. package/core/pagination.d.ts +0 -1
  32. package/core/pagination.d.ts.map +1 -1
  33. package/core/pagination.js +3 -13
  34. package/core/pagination.js.map +1 -1
  35. package/core/pagination.mjs +1 -11
  36. package/core/pagination.mjs.map +1 -1
  37. package/error.js +2 -15
  38. package/error.js.map +1 -1
  39. package/internal/builtin-types.d.mts +0 -2
  40. package/internal/builtin-types.d.mts.map +1 -1
  41. package/internal/builtin-types.d.ts +0 -2
  42. package/internal/builtin-types.d.ts.map +1 -1
  43. package/internal/detect-platform.js.map +1 -1
  44. package/internal/detect-platform.mjs.map +1 -1
  45. package/internal/errors.d.mts.map +1 -1
  46. package/internal/errors.d.ts.map +1 -1
  47. package/internal/errors.js +2 -2
  48. package/internal/errors.js.map +1 -1
  49. package/internal/errors.mjs.map +1 -1
  50. package/internal/headers.d.mts +1 -2
  51. package/internal/headers.d.mts.map +1 -1
  52. package/internal/headers.d.ts +1 -2
  53. package/internal/headers.d.ts.map +1 -1
  54. package/internal/headers.js +3 -1
  55. package/internal/headers.js.map +1 -1
  56. package/internal/headers.mjs +3 -1
  57. package/internal/headers.mjs.map +1 -1
  58. package/internal/parse.d.mts +0 -1
  59. package/internal/parse.d.mts.map +1 -1
  60. package/internal/parse.d.ts +0 -1
  61. package/internal/parse.d.ts.map +1 -1
  62. package/internal/parse.js +1 -2
  63. package/internal/parse.js.map +1 -1
  64. package/internal/parse.mjs.map +1 -1
  65. package/internal/request-options.d.mts +0 -1
  66. package/internal/request-options.d.mts.map +1 -1
  67. package/internal/request-options.d.ts +0 -1
  68. package/internal/request-options.d.ts.map +1 -1
  69. package/internal/shims.js +5 -6
  70. package/internal/shims.js.map +1 -1
  71. package/internal/shims.mjs.map +1 -1
  72. package/internal/to-file.d.mts +0 -1
  73. package/internal/to-file.d.mts.map +1 -1
  74. package/internal/to-file.d.ts +0 -1
  75. package/internal/to-file.d.ts.map +1 -1
  76. package/internal/to-file.js +4 -4
  77. package/internal/to-file.js.map +1 -1
  78. package/internal/to-file.mjs +3 -2
  79. package/internal/to-file.mjs.map +1 -1
  80. package/internal/tslib.js +81 -0
  81. package/internal/tslib.mjs +17 -0
  82. package/internal/types.d.mts +0 -1
  83. package/internal/types.d.mts.map +1 -1
  84. package/internal/types.d.ts +0 -1
  85. package/internal/types.d.ts.map +1 -1
  86. package/internal/uploads.d.mts +1 -3
  87. package/internal/uploads.d.mts.map +1 -1
  88. package/internal/uploads.d.ts +1 -3
  89. package/internal/uploads.d.ts.map +1 -1
  90. package/internal/uploads.js +16 -6
  91. package/internal/uploads.js.map +1 -1
  92. package/internal/uploads.mjs +12 -3
  93. package/internal/uploads.mjs.map +1 -1
  94. package/internal/utils/base64.d.mts.map +1 -1
  95. package/internal/utils/base64.d.ts.map +1 -1
  96. package/internal/utils/base64.js +12 -7
  97. package/internal/utils/base64.js.map +1 -1
  98. package/internal/utils/base64.mjs +12 -7
  99. package/internal/utils/base64.mjs.map +1 -1
  100. package/internal/utils/bytes.d.mts +4 -0
  101. package/internal/utils/bytes.d.mts.map +1 -0
  102. package/internal/utils/bytes.d.ts +4 -0
  103. package/internal/utils/bytes.d.ts.map +1 -0
  104. package/internal/utils/bytes.js +31 -0
  105. package/internal/utils/bytes.js.map +1 -0
  106. package/internal/utils/bytes.mjs +26 -0
  107. package/internal/utils/bytes.mjs.map +1 -0
  108. package/internal/utils/env.d.mts.map +1 -1
  109. package/internal/utils/env.d.ts.map +1 -1
  110. package/internal/utils/env.js.map +1 -1
  111. package/internal/utils/env.mjs.map +1 -1
  112. package/internal/utils/log.d.mts +0 -1
  113. package/internal/utils/log.d.mts.map +1 -1
  114. package/internal/utils/log.d.ts +0 -1
  115. package/internal/utils/log.d.ts.map +1 -1
  116. package/internal/utils/log.js +2 -2
  117. package/internal/utils/log.js.map +1 -1
  118. package/internal/utils/log.mjs.map +1 -1
  119. package/internal/utils/path.d.mts.map +1 -1
  120. package/internal/utils/path.d.ts.map +1 -1
  121. package/internal/utils/path.js +2 -2
  122. package/internal/utils/path.js.map +1 -1
  123. package/internal/utils/path.mjs.map +1 -1
  124. package/internal/utils/sleep.d.mts.map +1 -1
  125. package/internal/utils/sleep.d.ts.map +1 -1
  126. package/internal/utils/uuid.d.mts +1 -1
  127. package/internal/utils/uuid.d.mts.map +1 -1
  128. package/internal/utils/uuid.d.ts +1 -1
  129. package/internal/utils/uuid.d.ts.map +1 -1
  130. package/internal/utils/uuid.js +1 -2
  131. package/internal/utils/uuid.js.map +1 -1
  132. package/internal/utils/uuid.mjs +1 -2
  133. package/internal/utils/uuid.mjs.map +1 -1
  134. package/internal/utils/values.d.mts.map +1 -1
  135. package/internal/utils/values.d.ts.map +1 -1
  136. package/internal/utils/values.js +5 -5
  137. package/internal/utils/values.js.map +1 -1
  138. package/internal/utils/values.mjs.map +1 -1
  139. package/internal/utils.js +7 -20
  140. package/internal/utils.js.map +1 -1
  141. package/lib/polling.js +1 -2
  142. package/lib/polling.js.map +1 -1
  143. package/lib/polling.mjs.map +1 -1
  144. package/package.json +5 -6
  145. package/pagination.js +2 -15
  146. package/pagination.js.map +1 -1
  147. package/resource.js +2 -15
  148. package/resource.js.map +1 -1
  149. package/resources/api-keys.d.mts +171 -0
  150. package/resources/api-keys.d.mts.map +1 -0
  151. package/resources/api-keys.d.ts +171 -0
  152. package/resources/api-keys.d.ts.map +1 -0
  153. package/resources/api-keys.js +76 -0
  154. package/resources/api-keys.js.map +1 -0
  155. package/resources/api-keys.mjs +72 -0
  156. package/resources/api-keys.mjs.map +1 -0
  157. package/resources/chat.d.mts +27 -0
  158. package/resources/chat.d.mts.map +1 -0
  159. package/resources/chat.d.ts +27 -0
  160. package/resources/chat.d.ts.map +1 -0
  161. package/resources/chat.js +28 -0
  162. package/resources/chat.js.map +1 -0
  163. package/resources/chat.mjs +24 -0
  164. package/resources/chat.mjs.map +1 -0
  165. package/resources/data-sources/connectors.d.mts +193 -0
  166. package/resources/data-sources/connectors.d.mts.map +1 -0
  167. package/resources/data-sources/connectors.d.ts +193 -0
  168. package/resources/data-sources/connectors.d.ts.map +1 -0
  169. package/resources/data-sources/connectors.js +73 -0
  170. package/resources/data-sources/connectors.js.map +1 -0
  171. package/resources/data-sources/connectors.mjs +69 -0
  172. package/resources/data-sources/connectors.mjs.map +1 -0
  173. package/resources/data-sources/data-sources.d.mts +183 -0
  174. package/resources/data-sources/data-sources.d.mts.map +1 -0
  175. package/resources/data-sources/data-sources.d.ts +183 -0
  176. package/resources/data-sources/data-sources.d.ts.map +1 -0
  177. package/resources/data-sources/data-sources.js +66 -0
  178. package/resources/data-sources/data-sources.js.map +1 -0
  179. package/resources/data-sources/data-sources.mjs +61 -0
  180. package/resources/data-sources/data-sources.mjs.map +1 -0
  181. package/resources/data-sources/index.d.mts +3 -0
  182. package/resources/data-sources/index.d.mts.map +1 -0
  183. package/resources/data-sources/index.d.ts +3 -0
  184. package/resources/data-sources/index.d.ts.map +1 -0
  185. package/resources/data-sources/index.js +9 -0
  186. package/resources/data-sources/index.js.map +1 -0
  187. package/resources/data-sources/index.mjs +4 -0
  188. package/resources/data-sources/index.mjs.map +1 -0
  189. package/resources/data-sources.d.mts +2 -0
  190. package/resources/data-sources.d.mts.map +1 -0
  191. package/resources/data-sources.d.ts +2 -0
  192. package/resources/data-sources.d.ts.map +1 -0
  193. package/resources/data-sources.js +6 -0
  194. package/resources/data-sources.js.map +1 -0
  195. package/resources/data-sources.mjs +3 -0
  196. package/resources/data-sources.mjs.map +1 -0
  197. package/resources/embeddings.d.mts +7 -2
  198. package/resources/embeddings.d.mts.map +1 -1
  199. package/resources/embeddings.d.ts +7 -2
  200. package/resources/embeddings.d.ts.map +1 -1
  201. package/resources/extractions/content.d.mts +46 -2
  202. package/resources/extractions/content.d.mts.map +1 -1
  203. package/resources/extractions/content.d.ts +46 -2
  204. package/resources/extractions/content.d.ts.map +1 -1
  205. package/resources/extractions/extractions.d.mts +2 -2
  206. package/resources/extractions/extractions.d.mts.map +1 -1
  207. package/resources/extractions/extractions.d.ts +2 -2
  208. package/resources/extractions/extractions.d.ts.map +1 -1
  209. package/resources/extractions/extractions.js +4 -26
  210. package/resources/extractions/extractions.js.map +1 -1
  211. package/resources/extractions/extractions.mjs.map +1 -1
  212. package/resources/extractions/index.d.mts +1 -1
  213. package/resources/extractions/index.d.mts.map +1 -1
  214. package/resources/extractions/index.d.ts +1 -1
  215. package/resources/extractions/index.d.ts.map +1 -1
  216. package/resources/extractions/index.js.map +1 -1
  217. package/resources/extractions/index.mjs +1 -1
  218. package/resources/extractions/index.mjs.map +1 -1
  219. package/resources/extractions/jobs.d.mts +2 -1
  220. package/resources/extractions/jobs.d.mts.map +1 -1
  221. package/resources/extractions/jobs.d.ts +2 -1
  222. package/resources/extractions/jobs.d.ts.map +1 -1
  223. package/resources/extractions/jobs.js.map +1 -1
  224. package/resources/extractions/jobs.mjs.map +1 -1
  225. package/resources/extractions.js +2 -15
  226. package/resources/extractions.js.map +1 -1
  227. package/resources/files.d.mts +18 -2
  228. package/resources/files.d.mts.map +1 -1
  229. package/resources/files.d.ts +18 -2
  230. package/resources/files.d.ts.map +1 -1
  231. package/resources/index.d.mts +6 -3
  232. package/resources/index.d.mts.map +1 -1
  233. package/resources/index.d.ts +6 -3
  234. package/resources/index.d.ts.map +1 -1
  235. package/resources/index.js +9 -16
  236. package/resources/index.js.map +1 -1
  237. package/resources/index.mjs +3 -0
  238. package/resources/index.mjs.map +1 -1
  239. package/resources/parsing/index.d.mts +1 -1
  240. package/resources/parsing/index.d.mts.map +1 -1
  241. package/resources/parsing/index.d.ts +1 -1
  242. package/resources/parsing/index.d.ts.map +1 -1
  243. package/resources/parsing/index.js.map +1 -1
  244. package/resources/parsing/index.mjs.map +1 -1
  245. package/resources/parsing/jobs.d.mts +29 -11
  246. package/resources/parsing/jobs.d.mts.map +1 -1
  247. package/resources/parsing/jobs.d.ts +29 -11
  248. package/resources/parsing/jobs.d.ts.map +1 -1
  249. package/resources/parsing/jobs.js +2 -24
  250. package/resources/parsing/jobs.js.map +1 -1
  251. package/resources/parsing/jobs.mjs.map +1 -1
  252. package/resources/parsing/parsing.d.mts +2 -2
  253. package/resources/parsing/parsing.d.mts.map +1 -1
  254. package/resources/parsing/parsing.d.ts +2 -2
  255. package/resources/parsing/parsing.d.ts.map +1 -1
  256. package/resources/parsing/parsing.js +2 -24
  257. package/resources/parsing/parsing.js.map +1 -1
  258. package/resources/parsing/parsing.mjs.map +1 -1
  259. package/resources/parsing.js +2 -15
  260. package/resources/parsing.js.map +1 -1
  261. package/resources/top-level.d.mts +9 -4
  262. package/resources/top-level.d.mts.map +1 -1
  263. package/resources/top-level.d.ts +9 -4
  264. package/resources/top-level.d.ts.map +1 -1
  265. package/resources/vector-stores/files.d.mts +29 -2
  266. package/resources/vector-stores/files.d.mts.map +1 -1
  267. package/resources/vector-stores/files.d.ts +29 -2
  268. package/resources/vector-stores/files.d.ts.map +1 -1
  269. package/resources/vector-stores/files.js +2 -24
  270. package/resources/vector-stores/files.js.map +1 -1
  271. package/resources/vector-stores/index.d.mts +1 -1
  272. package/resources/vector-stores/index.d.mts.map +1 -1
  273. package/resources/vector-stores/index.d.ts +1 -1
  274. package/resources/vector-stores/index.d.ts.map +1 -1
  275. package/resources/vector-stores/index.js.map +1 -1
  276. package/resources/vector-stores/index.mjs.map +1 -1
  277. package/resources/vector-stores/vector-stores.d.mts +223 -81
  278. package/resources/vector-stores/vector-stores.d.mts.map +1 -1
  279. package/resources/vector-stores/vector-stores.d.ts +223 -81
  280. package/resources/vector-stores/vector-stores.d.ts.map +1 -1
  281. package/resources/vector-stores/vector-stores.js +2 -24
  282. package/resources/vector-stores/vector-stores.js.map +1 -1
  283. package/resources/vector-stores/vector-stores.mjs.map +1 -1
  284. package/resources/vector-stores.js +2 -15
  285. package/resources/vector-stores.js.map +1 -1
  286. package/resources.js +2 -15
  287. package/resources.js.map +1 -1
  288. package/src/client.ts +94 -16
  289. package/src/internal/headers.ts +4 -3
  290. package/src/internal/to-file.ts +4 -2
  291. package/src/internal/uploads.ts +16 -4
  292. package/src/internal/utils/base64.ts +13 -10
  293. package/src/internal/utils/bytes.ts +32 -0
  294. package/src/internal/utils/uuid.ts +1 -3
  295. package/src/resources/api-keys.ts +225 -0
  296. package/src/resources/chat.ts +33 -0
  297. package/src/resources/data-sources/connectors.ts +280 -0
  298. package/src/resources/data-sources/data-sources.ts +271 -0
  299. package/src/resources/data-sources/index.ts +24 -0
  300. package/src/resources/data-sources.ts +3 -0
  301. package/src/resources/embeddings.ts +25 -10
  302. package/src/resources/extractions/content.ts +57 -2
  303. package/src/resources/extractions/extractions.ts +3 -1
  304. package/src/resources/extractions/index.ts +7 -1
  305. package/src/resources/extractions/jobs.ts +2 -1
  306. package/src/resources/files.ts +21 -0
  307. package/src/resources/index.ts +27 -4
  308. package/src/resources/parsing/index.ts +4 -0
  309. package/src/resources/parsing/jobs.ts +48 -45
  310. package/src/resources/parsing/parsing.ts +8 -0
  311. package/src/resources/top-level.ts +10 -40
  312. package/src/resources/vector-stores/files.ts +39 -2
  313. package/src/resources/vector-stores/index.ts +4 -3
  314. package/src/resources/vector-stores/vector-stores.ts +269 -91
  315. package/src/version.ts +1 -1
  316. package/uploads.js +2 -15
  317. package/uploads.js.map +1 -1
  318. package/version.d.mts +1 -1
  319. package/version.d.ts +1 -1
  320. package/version.js +1 -1
  321. package/version.mjs +1 -1
  322. package/internal/shims/crypto.d.mts +0 -13
  323. package/internal/shims/crypto.d.mts.map +0 -1
  324. package/internal/shims/crypto.d.ts +0 -13
  325. package/internal/shims/crypto.d.ts.map +0 -1
  326. package/internal/shims/crypto.js +0 -13
  327. package/internal/shims/crypto.js.map +0 -1
  328. package/internal/shims/crypto.mjs +0 -9
  329. package/internal/shims/crypto.mjs.map +0 -1
  330. package/internal/shims/file.d.mts +0 -23
  331. package/internal/shims/file.d.mts.map +0 -1
  332. package/internal/shims/file.d.ts +0 -23
  333. package/internal/shims/file.d.ts.map +0 -1
  334. package/internal/shims/file.js +0 -16
  335. package/internal/shims/file.js.map +0 -1
  336. package/internal/shims/file.mjs +0 -12
  337. package/internal/shims/file.mjs.map +0 -1
  338. package/internal/shims/getBuiltinModule.d.mts +0 -11
  339. package/internal/shims/getBuiltinModule.d.mts.map +0 -1
  340. package/internal/shims/getBuiltinModule.d.ts +0 -11
  341. package/internal/shims/getBuiltinModule.d.ts.map +0 -1
  342. package/internal/shims/getBuiltinModule.js +0 -68
  343. package/internal/shims/getBuiltinModule.js.map +0 -1
  344. package/internal/shims/getBuiltinModule.mjs +0 -64
  345. package/internal/shims/getBuiltinModule.mjs.map +0 -1
  346. package/internal/shims/nullGetBuiltinModule.d.mts +0 -2
  347. package/internal/shims/nullGetBuiltinModule.d.mts.map +0 -1
  348. package/internal/shims/nullGetBuiltinModule.d.ts +0 -2
  349. package/internal/shims/nullGetBuiltinModule.d.ts.map +0 -1
  350. package/internal/shims/nullGetBuiltinModule.js +0 -5
  351. package/internal/shims/nullGetBuiltinModule.js.map +0 -1
  352. package/internal/shims/nullGetBuiltinModule.mjs +0 -2
  353. package/internal/shims/nullGetBuiltinModule.mjs.map +0 -1
  354. package/src/internal/shims/crypto.ts +0 -18
  355. package/src/internal/shims/file.ts +0 -32
  356. package/src/internal/shims/getBuiltinModule.ts +0 -64
  357. package/src/internal/shims/nullGetBuiltinModule.ts +0 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as ContentAPI from './content';
5
- import { Content, ContentCreateParams, ExtractionResult } from './content';
5
+ import { Content, ContentCreateParams, ExtractionResult, ImageURLInput, TextInput } from './content';
6
6
  import * as JobsAPI from './jobs';
7
7
  import { ExtractionJob, JobCreateParams, Jobs } from './jobs';
8
8
  import * as SchemaAPI from './schema';
@@ -42,6 +42,8 @@ export declare namespace Extractions {
42
42
  export {
43
43
  Content as Content,
44
44
  type ExtractionResult as ExtractionResult,
45
+ type ImageURLInput as ImageURLInput,
46
+ type TextInput as TextInput,
45
47
  type ContentCreateParams as ContentCreateParams,
46
48
  };
47
49
  }
@@ -1,6 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { Content, type ExtractionResult, type ContentCreateParams } from './content';
3
+ export {
4
+ Content,
5
+ type ExtractionResult,
6
+ type ImageURLInput,
7
+ type TextInput,
8
+ type ContentCreateParams,
9
+ } from './content';
4
10
  export { Extractions } from './extractions';
5
11
  export { Jobs, type ExtractionJob, type JobCreateParams } from './jobs';
6
12
  export {
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as ContentAPI from './content';
5
+ import * as ParsingJobsAPI from '../parsing/jobs';
5
6
  import { APIPromise } from '../../core/api-promise';
6
7
  import { RequestOptions } from '../../internal/request-options';
7
8
  import { path } from '../../internal/utils/path';
@@ -72,7 +73,7 @@ export interface ExtractionJob {
72
73
  /**
73
74
  * Current status of the job
74
75
  */
75
- status: 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
76
+ status: ParsingJobsAPI.ParsingJobStatus;
76
77
 
77
78
  /**
78
79
  * The result of an extraction job.
@@ -132,6 +132,26 @@ export interface FileObject {
132
132
  updated_at: string;
133
133
  }
134
134
 
135
+ /**
136
+ * Pagination model that includes total count of items.
137
+ */
138
+ export interface PaginationWithTotal {
139
+ /**
140
+ * Maximum number of items to return per page
141
+ */
142
+ limit?: number;
143
+
144
+ /**
145
+ * Offset of the first item to return
146
+ */
147
+ offset?: number;
148
+
149
+ /**
150
+ * Total number of items available
151
+ */
152
+ total?: number;
153
+ }
154
+
135
155
  export interface FileDeleteResponse {
136
156
  /**
137
157
  * The ID of the deleted file
@@ -168,6 +188,7 @@ export interface FileListParams extends LimitOffsetParams {}
168
188
  export declare namespace Files {
169
189
  export {
170
190
  type FileObject as FileObject,
191
+ type PaginationWithTotal as PaginationWithTotal,
171
192
  type FileDeleteResponse as FileDeleteResponse,
172
193
  type FileObjectsLimitOffset as FileObjectsLimitOffset,
173
194
  type FileCreateParams as FileCreateParams,
@@ -1,11 +1,33 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  export * from './shared';
4
- export { Embeddings, type EmbeddingCreateParams } from './embeddings';
4
+ export {
5
+ APIKeys,
6
+ type APIKey,
7
+ type APIKeyCreated,
8
+ type APIKeyDeleteResponse,
9
+ type APIKeyCreateParams,
10
+ type APIKeyListParams,
11
+ type APIKeysLimitOffset,
12
+ } from './api-keys';
13
+ export { Chat, type ChatCreateCompletionResponse } from './chat';
14
+ export {
15
+ DataSources,
16
+ type DataSource,
17
+ type DataSourceOauth2Params,
18
+ type DataSourceType,
19
+ type DataSourceDeleteResponse,
20
+ type DataSourceCreateParams,
21
+ type DataSourceUpdateParams,
22
+ type DataSourceListParams,
23
+ type DataSourcesLimitOffset,
24
+ } from './data-sources/data-sources';
25
+ export { Embeddings, type EncodingFormat, type ObjectType, type EmbeddingCreateParams } from './embeddings';
5
26
  export { Extractions } from './extractions/extractions';
6
27
  export {
7
28
  Files,
8
29
  type FileObject,
30
+ type PaginationWithTotal,
9
31
  type FileDeleteResponse,
10
32
  type FileCreateParams,
11
33
  type FileUpdateParams,
@@ -16,11 +38,12 @@ export { Parsing } from './parsing/parsing';
16
38
  export {
17
39
  VectorStores,
18
40
  type ExpiresAfter,
19
- type FileCounts,
20
- type ScoredVectorStoreChunk,
41
+ type ScoredAudioURLInputChunk,
42
+ type ScoredImageURLInputChunk,
43
+ type ScoredTextInputChunk,
44
+ type ScoredVideoURLInputChunk,
21
45
  type VectorStore,
22
46
  type VectorStoreChunkSearchOptions,
23
- type VectorStoreFileSearchOptions,
24
47
  type VectorStoreDeleteResponse,
25
48
  type VectorStoreQuestionAnsweringResponse,
26
49
  type VectorStoreSearchResponse,
@@ -2,7 +2,11 @@
2
2
 
3
3
  export {
4
4
  Jobs,
5
+ type ChunkingStrategy,
6
+ type ElementType,
7
+ type ParsingJobStatus,
5
8
  type ParsingJob,
9
+ type ReturnFormat,
6
10
  type JobListResponse,
7
11
  type JobDeleteResponse,
8
12
  type JobCreateParams,
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
+ import * as JobsAPI from './jobs';
4
5
  import { APIPromise } from '../../core/api-promise';
5
6
  import { LimitOffset, type LimitOffsetParams, PagePromise } from '../../core/pagination';
6
7
  import { RequestOptions } from '../../internal/request-options';
@@ -162,6 +163,29 @@ export class Jobs extends APIResource {
162
163
 
163
164
  export type JobListResponsesLimitOffset = LimitOffset<JobListResponse>;
164
165
 
166
+ /**
167
+ * Strategy used for chunking document content.
168
+ */
169
+ export type ChunkingStrategy = 'page';
170
+
171
+ /**
172
+ * Types of elements that can be extracted from a document.
173
+ */
174
+ export type ElementType =
175
+ | 'caption'
176
+ | 'footnote'
177
+ | 'formula'
178
+ | 'list-item'
179
+ | 'page-footer'
180
+ | 'page-header'
181
+ | 'picture'
182
+ | 'section-header'
183
+ | 'table'
184
+ | 'text'
185
+ | 'title';
186
+
187
+ export type ParsingJobStatus = 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
188
+
165
189
  /**
166
190
  * A job for parsing documents with its current state and result.
167
191
  */
@@ -179,7 +203,7 @@ export interface ParsingJob {
179
203
  /**
180
204
  * The status of the job
181
205
  */
182
- status: 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
206
+ status: ParsingJobStatus;
183
207
 
184
208
  /**
185
209
  * The error of the job
@@ -225,29 +249,17 @@ export namespace ParsingJob {
225
249
  /**
226
250
  * The strategy used for chunking the document
227
251
  */
228
- chunking_strategy: 'page';
252
+ chunking_strategy: JobsAPI.ChunkingStrategy;
229
253
 
230
254
  /**
231
255
  * The format of the returned content
232
256
  */
233
- return_format: 'html' | 'markdown' | 'plain';
257
+ return_format: JobsAPI.ReturnFormat;
234
258
 
235
259
  /**
236
260
  * The types of elements extracted
237
261
  */
238
- element_types: Array<
239
- | 'caption'
240
- | 'footnote'
241
- | 'formula'
242
- | 'list-item'
243
- | 'page-footer'
244
- | 'page-header'
245
- | 'picture'
246
- | 'section-header'
247
- | 'table'
248
- | 'text'
249
- | 'title'
250
- >;
262
+ element_types: Array<JobsAPI.ElementType>;
251
263
 
252
264
  /**
253
265
  * List of extracted chunks from the document
@@ -271,7 +283,7 @@ export namespace ParsingJob {
271
283
  content: string;
272
284
 
273
285
  /**
274
- * The content to be used for embedding
286
+ * The content of the chunk to embed
275
287
  */
276
288
  content_to_embed: string;
277
289
 
@@ -289,18 +301,7 @@ export namespace ParsingJob {
289
301
  /**
290
302
  * The type of the extracted element
291
303
  */
292
- type:
293
- | 'caption'
294
- | 'footnote'
295
- | 'formula'
296
- | 'list-item'
297
- | 'page-footer'
298
- | 'page-header'
299
- | 'picture'
300
- | 'section-header'
301
- | 'table'
302
- | 'text'
303
- | 'title';
304
+ type: JobsAPI.ElementType;
304
305
 
305
306
  /**
306
307
  * The confidence score of the extraction
@@ -331,6 +332,11 @@ export namespace ParsingJob {
331
332
  }
332
333
  }
333
334
 
335
+ /**
336
+ * Format options for the returned document content.
337
+ */
338
+ export type ReturnFormat = 'html' | 'markdown' | 'plain';
339
+
334
340
  /**
335
341
  * A parsing job item for list responses, omitting result and error fields.
336
342
  */
@@ -348,7 +354,7 @@ export interface JobListResponse {
348
354
  /**
349
355
  * The status of the job
350
356
  */
351
- status: 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
357
+ status: ParsingJobStatus;
352
358
 
353
359
  /**
354
360
  * The started time of the job
@@ -405,36 +411,33 @@ export interface JobCreateParams {
405
411
  /**
406
412
  * The elements to extract from the document
407
413
  */
408
- element_types?: Array<
409
- | 'caption'
410
- | 'footnote'
411
- | 'formula'
412
- | 'list-item'
413
- | 'page-footer'
414
- | 'page-header'
415
- | 'picture'
416
- | 'section-header'
417
- | 'table'
418
- | 'text'
419
- | 'title'
420
- > | null;
414
+ element_types?: Array<ElementType> | null;
421
415
 
422
416
  /**
423
417
  * The strategy to use for chunking the content
424
418
  */
425
- chunking_strategy?: 'page';
419
+ chunking_strategy?: ChunkingStrategy;
426
420
 
427
421
  /**
428
422
  * The format of the returned content
429
423
  */
430
- return_format?: 'html' | 'markdown' | 'plain';
424
+ return_format?: ReturnFormat;
425
+
426
+ /**
427
+ * The strategy to use for OCR
428
+ */
429
+ mode?: 'fast' | 'high_quality';
431
430
  }
432
431
 
433
432
  export interface JobListParams extends LimitOffsetParams {}
434
433
 
435
434
  export declare namespace Jobs {
436
435
  export {
436
+ type ChunkingStrategy as ChunkingStrategy,
437
+ type ElementType as ElementType,
438
+ type ParsingJobStatus as ParsingJobStatus,
437
439
  type ParsingJob as ParsingJob,
440
+ type ReturnFormat as ReturnFormat,
438
441
  type JobListResponse as JobListResponse,
439
442
  type JobDeleteResponse as JobDeleteResponse,
440
443
  type JobListResponsesLimitOffset as JobListResponsesLimitOffset,
@@ -3,6 +3,8 @@
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as JobsAPI from './jobs';
5
5
  import {
6
+ ChunkingStrategy,
7
+ ElementType,
6
8
  JobCreateParams,
7
9
  JobDeleteResponse,
8
10
  JobListParams,
@@ -10,6 +12,8 @@ import {
10
12
  JobListResponsesLimitOffset,
11
13
  Jobs,
12
14
  ParsingJob,
15
+ ParsingJobStatus,
16
+ ReturnFormat,
13
17
  } from './jobs';
14
18
 
15
19
  export class Parsing extends APIResource {
@@ -21,7 +25,11 @@ Parsing.Jobs = Jobs;
21
25
  export declare namespace Parsing {
22
26
  export {
23
27
  Jobs as Jobs,
28
+ type ChunkingStrategy as ChunkingStrategy,
29
+ type ElementType as ElementType,
30
+ type ParsingJobStatus as ParsingJobStatus,
24
31
  type ParsingJob as ParsingJob,
32
+ type ReturnFormat as ReturnFormat,
25
33
  type JobListResponse as JobListResponse,
26
34
  type JobDeleteResponse as JobDeleteResponse,
27
35
  type JobListResponsesLimitOffset as JobListResponsesLimitOffset,
@@ -1,5 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ import * as EmbeddingsAPI from './embeddings';
3
4
  import * as Shared from './shared';
4
5
 
5
6
  export interface Embedding {
@@ -38,17 +39,7 @@ export interface EmbeddingCreateResponse {
38
39
  /**
39
40
  * The object type of the response
40
41
  */
41
- object?:
42
- | 'list'
43
- | 'parsing_job'
44
- | 'job'
45
- | 'embedding'
46
- | 'embedding_dict'
47
- | 'rank_result'
48
- | 'file'
49
- | 'vector_store'
50
- | 'vector_store.file'
51
- | 'api_key';
42
+ object?: EmbeddingsAPI.ObjectType;
52
43
 
53
44
  /**
54
45
  * Whether the embeddings are normalized.
@@ -58,15 +49,7 @@ export interface EmbeddingCreateResponse {
58
49
  /**
59
50
  * The encoding formats of the embeddings.
60
51
  */
61
- encoding_format:
62
- | 'float'
63
- | 'float16'
64
- | 'base64'
65
- | 'binary'
66
- | 'ubinary'
67
- | 'int8'
68
- | 'uint8'
69
- | Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
52
+ encoding_format: EmbeddingsAPI.EncodingFormat | Array<EmbeddingsAPI.EncodingFormat>;
70
53
 
71
54
  /**
72
55
  * The number of dimensions used for the embeddings.
@@ -140,17 +123,7 @@ export interface RerankResponse {
140
123
  /**
141
124
  * The object type of the response
142
125
  */
143
- object?:
144
- | 'list'
145
- | 'parsing_job'
146
- | 'job'
147
- | 'embedding'
148
- | 'embedding_dict'
149
- | 'rank_result'
150
- | 'file'
151
- | 'vector_store'
152
- | 'vector_store.file'
153
- | 'api_key';
126
+ object?: 'list';
154
127
 
155
128
  /**
156
129
  * The number of documents to return.
@@ -217,15 +190,7 @@ export interface EmbedParams {
217
190
  * The encoding format(s) of the embeddings. Can be a single format or a list of
218
191
  * formats.
219
192
  */
220
- encoding_format?:
221
- | 'float'
222
- | 'float16'
223
- | 'base64'
224
- | 'binary'
225
- | 'ubinary'
226
- | 'int8'
227
- | 'uint8'
228
- | Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
193
+ encoding_format?: EmbeddingsAPI.EncodingFormat | Array<EmbeddingsAPI.EncodingFormat>;
229
194
  }
230
195
 
231
196
  export interface RerankParams {
@@ -258,6 +223,11 @@ export interface RerankParams {
258
223
  * Whether to return the documents.
259
224
  */
260
225
  return_input?: boolean;
226
+
227
+ /**
228
+ * Wether or not to rewrite the query before passing it to the reranking model
229
+ */
230
+ rewrite_query?: boolean;
261
231
  }
262
232
 
263
233
  export declare namespace TopLevel {
@@ -264,7 +264,12 @@ export interface ScoredVectorStoreFile {
264
264
  /**
265
265
  * chunks
266
266
  */
267
- chunks: Array<VectorStoresAPI.ScoredVectorStoreChunk> | null;
267
+ chunks: Array<
268
+ | VectorStoresAPI.ScoredTextInputChunk
269
+ | VectorStoresAPI.ScoredImageURLInputChunk
270
+ | VectorStoresAPI.ScoredAudioURLInputChunk
271
+ | VectorStoresAPI.ScoredVideoURLInputChunk
272
+ > | null;
268
273
  }
269
274
 
270
275
  /**
@@ -432,7 +437,39 @@ export interface FileSearchParams {
432
437
  /**
433
438
  * Search configuration options
434
439
  */
435
- search_options?: VectorStoresAPI.VectorStoreFileSearchOptions;
440
+ search_options?: FileSearchParams.SearchOptions;
441
+ }
442
+
443
+ export namespace FileSearchParams {
444
+ /**
445
+ * Search configuration options
446
+ */
447
+ export interface SearchOptions {
448
+ /**
449
+ * Minimum similarity score threshold
450
+ */
451
+ score_threshold?: number;
452
+
453
+ /**
454
+ * Whether to rewrite the query
455
+ */
456
+ rewrite_query?: boolean;
457
+
458
+ /**
459
+ * Whether to return file metadata
460
+ */
461
+ return_metadata?: boolean;
462
+
463
+ /**
464
+ * Whether to return matching text chunks
465
+ */
466
+ return_chunks?: boolean;
467
+
468
+ /**
469
+ * Number of chunks to return for each file
470
+ */
471
+ chunks_per_file?: number;
472
+ }
436
473
  }
437
474
 
438
475
  export declare namespace Files {
@@ -16,11 +16,12 @@ export {
16
16
  export {
17
17
  VectorStores,
18
18
  type ExpiresAfter,
19
- type FileCounts,
20
- type ScoredVectorStoreChunk,
19
+ type ScoredAudioURLInputChunk,
20
+ type ScoredImageURLInputChunk,
21
+ type ScoredTextInputChunk,
22
+ type ScoredVideoURLInputChunk,
21
23
  type VectorStore,
22
24
  type VectorStoreChunkSearchOptions,
23
- type VectorStoreFileSearchOptions,
24
25
  type VectorStoreDeleteResponse,
25
26
  type VectorStoreQuestionAnsweringResponse,
26
27
  type VectorStoreSearchResponse,