@mixedbread/sdk 0.1.0-alpha.8

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 (277) hide show
  1. package/CHANGELOG.md +210 -0
  2. package/LICENSE +201 -0
  3. package/README.md +360 -0
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +89 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +241 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +914 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +882 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +47 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +113 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +97 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +148 -0
  87. package/index.d.ts +148 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +151 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +108 -0
  92. package/index.mjs.map +1 -0
  93. package/lib/polling.d.ts +48 -0
  94. package/lib/polling.d.ts.map +1 -0
  95. package/lib/polling.js +75 -0
  96. package/lib/polling.js.map +1 -0
  97. package/lib/polling.mjs +71 -0
  98. package/lib/polling.mjs.map +1 -0
  99. package/package.json +124 -0
  100. package/pagination.d.ts +30 -0
  101. package/pagination.d.ts.map +1 -0
  102. package/pagination.js +45 -0
  103. package/pagination.js.map +1 -0
  104. package/pagination.mjs +41 -0
  105. package/pagination.mjs.map +1 -0
  106. package/resource.d.ts +6 -0
  107. package/resource.d.ts.map +1 -0
  108. package/resource.js +11 -0
  109. package/resource.js.map +1 -0
  110. package/resource.mjs +7 -0
  111. package/resource.mjs.map +1 -0
  112. package/resources/extractions/content.d.ts +35 -0
  113. package/resources/extractions/content.d.ts.map +1 -0
  114. package/resources/extractions/content.js +19 -0
  115. package/resources/extractions/content.js.map +1 -0
  116. package/resources/extractions/content.mjs +15 -0
  117. package/resources/extractions/content.mjs.map +1 -0
  118. package/resources/extractions/extractions.d.ts +18 -0
  119. package/resources/extractions/extractions.d.ts.map +1 -0
  120. package/resources/extractions/extractions.js +47 -0
  121. package/resources/extractions/extractions.js.map +1 -0
  122. package/resources/extractions/extractions.mjs +20 -0
  123. package/resources/extractions/extractions.mjs.map +1 -0
  124. package/resources/extractions/index.d.ts +5 -0
  125. package/resources/extractions/index.d.ts.map +1 -0
  126. package/resources/extractions/index.js +13 -0
  127. package/resources/extractions/index.js.map +1 -0
  128. package/resources/extractions/index.mjs +6 -0
  129. package/resources/extractions/index.mjs.map +1 -0
  130. package/resources/extractions/jobs.d.ts +44 -0
  131. package/resources/extractions/jobs.d.ts.map +1 -0
  132. package/resources/extractions/jobs.js +29 -0
  133. package/resources/extractions/jobs.js.map +1 -0
  134. package/resources/extractions/jobs.mjs +25 -0
  135. package/resources/extractions/jobs.mjs.map +1 -0
  136. package/resources/extractions/schema.d.ts +85 -0
  137. package/resources/extractions/schema.d.ts.map +1 -0
  138. package/resources/extractions/schema.js +39 -0
  139. package/resources/extractions/schema.js.map +1 -0
  140. package/resources/extractions/schema.mjs +35 -0
  141. package/resources/extractions/schema.mjs.map +1 -0
  142. package/resources/files.d.ts +125 -0
  143. package/resources/files.d.ts.map +1 -0
  144. package/resources/files.js +99 -0
  145. package/resources/files.js.map +1 -0
  146. package/resources/files.mjs +71 -0
  147. package/resources/files.mjs.map +1 -0
  148. package/resources/index.d.ts +7 -0
  149. package/resources/index.d.ts.map +1 -0
  150. package/resources/index.js +30 -0
  151. package/resources/index.js.map +1 -0
  152. package/resources/index.mjs +7 -0
  153. package/resources/index.mjs.map +1 -0
  154. package/resources/parsing/index.d.ts +3 -0
  155. package/resources/parsing/index.d.ts.map +1 -0
  156. package/resources/parsing/index.js +10 -0
  157. package/resources/parsing/index.js.map +1 -0
  158. package/resources/parsing/index.mjs +4 -0
  159. package/resources/parsing/index.mjs.map +1 -0
  160. package/resources/parsing/jobs.d.ts +278 -0
  161. package/resources/parsing/jobs.d.ts.map +1 -0
  162. package/resources/parsing/jobs.js +147 -0
  163. package/resources/parsing/jobs.js.map +1 -0
  164. package/resources/parsing/jobs.mjs +119 -0
  165. package/resources/parsing/jobs.mjs.map +1 -0
  166. package/resources/parsing/parsing.d.ts +10 -0
  167. package/resources/parsing/parsing.d.ts.map +1 -0
  168. package/resources/parsing/parsing.js +40 -0
  169. package/resources/parsing/parsing.js.map +1 -0
  170. package/resources/parsing/parsing.mjs +13 -0
  171. package/resources/parsing/parsing.mjs.map +1 -0
  172. package/resources/shared.d.ts +35 -0
  173. package/resources/shared.d.ts.map +1 -0
  174. package/resources/shared.js +4 -0
  175. package/resources/shared.js.map +1 -0
  176. package/resources/shared.mjs +3 -0
  177. package/resources/shared.mjs.map +1 -0
  178. package/resources/top-level.d.ts +11 -0
  179. package/resources/top-level.d.ts.map +1 -0
  180. package/resources/top-level.js +4 -0
  181. package/resources/top-level.js.map +1 -0
  182. package/resources/top-level.mjs +3 -0
  183. package/resources/top-level.mjs.map +1 -0
  184. package/resources/vector-stores/files.d.ts +280 -0
  185. package/resources/vector-stores/files.d.ts.map +1 -0
  186. package/resources/vector-stores/files.js +167 -0
  187. package/resources/vector-stores/files.js.map +1 -0
  188. package/resources/vector-stores/files.mjs +139 -0
  189. package/resources/vector-stores/files.mjs.map +1 -0
  190. package/resources/vector-stores/index.d.ts +3 -0
  191. package/resources/vector-stores/index.d.ts.map +1 -0
  192. package/resources/vector-stores/index.js +11 -0
  193. package/resources/vector-stores/index.js.map +1 -0
  194. package/resources/vector-stores/index.mjs +4 -0
  195. package/resources/vector-stores/index.mjs.map +1 -0
  196. package/resources/vector-stores/vector-stores.d.ts +400 -0
  197. package/resources/vector-stores/vector-stores.d.ts.map +1 -0
  198. package/resources/vector-stores/vector-stores.js +121 -0
  199. package/resources/vector-stores/vector-stores.js.map +1 -0
  200. package/resources/vector-stores/vector-stores.mjs +93 -0
  201. package/resources/vector-stores/vector-stores.mjs.map +1 -0
  202. package/shims/node.d.ts +30 -0
  203. package/shims/node.d.ts.map +1 -0
  204. package/shims/node.js +31 -0
  205. package/shims/node.js.map +1 -0
  206. package/shims/node.mjs +5 -0
  207. package/shims/node.mjs.map +1 -0
  208. package/shims/web.d.ts +26 -0
  209. package/shims/web.d.ts.map +1 -0
  210. package/shims/web.js +31 -0
  211. package/shims/web.js.map +1 -0
  212. package/shims/web.mjs +5 -0
  213. package/shims/web.mjs.map +1 -0
  214. package/src/_shims/MultipartBody.ts +9 -0
  215. package/src/_shims/README.md +46 -0
  216. package/src/_shims/auto/runtime-bun.ts +4 -0
  217. package/src/_shims/auto/runtime-node.ts +4 -0
  218. package/src/_shims/auto/runtime.ts +4 -0
  219. package/src/_shims/auto/types-node.ts +4 -0
  220. package/src/_shims/auto/types.d.ts +101 -0
  221. package/src/_shims/auto/types.js +3 -0
  222. package/src/_shims/auto/types.mjs +3 -0
  223. package/src/_shims/bun-runtime.ts +14 -0
  224. package/src/_shims/index.d.ts +81 -0
  225. package/src/_shims/index.js +13 -0
  226. package/src/_shims/index.mjs +7 -0
  227. package/src/_shims/manual-types.d.ts +12 -0
  228. package/src/_shims/manual-types.js +3 -0
  229. package/src/_shims/manual-types.mjs +3 -0
  230. package/src/_shims/node-runtime.ts +81 -0
  231. package/src/_shims/node-types.d.ts +42 -0
  232. package/src/_shims/node-types.js +3 -0
  233. package/src/_shims/node-types.mjs +3 -0
  234. package/src/_shims/registry.ts +67 -0
  235. package/src/_shims/web-runtime.ts +103 -0
  236. package/src/_shims/web-types.d.ts +83 -0
  237. package/src/_shims/web-types.js +3 -0
  238. package/src/_shims/web-types.mjs +3 -0
  239. package/src/core.ts +1208 -0
  240. package/src/error.ts +130 -0
  241. package/src/index.ts +294 -0
  242. package/src/lib/.keep +4 -0
  243. package/src/lib/polling.ts +115 -0
  244. package/src/pagination.ts +82 -0
  245. package/src/resource.ts +11 -0
  246. package/src/resources/extractions/content.ts +43 -0
  247. package/src/resources/extractions/extractions.ts +47 -0
  248. package/src/resources/extractions/index.ts +14 -0
  249. package/src/resources/extractions/jobs.ts +55 -0
  250. package/src/resources/extractions/schema.ts +111 -0
  251. package/src/resources/files.ts +181 -0
  252. package/src/resources/index.ts +32 -0
  253. package/src/resources/parsing/index.ts +12 -0
  254. package/src/resources/parsing/jobs.ts +438 -0
  255. package/src/resources/parsing/parsing.ts +32 -0
  256. package/src/resources/shared.ts +41 -0
  257. package/src/resources/top-level.ts +14 -0
  258. package/src/resources/vector-stores/files.ts +434 -0
  259. package/src/resources/vector-stores/index.ts +30 -0
  260. package/src/resources/vector-stores/vector-stores.ts +561 -0
  261. package/src/shims/node.ts +50 -0
  262. package/src/shims/web.ts +50 -0
  263. package/src/tsconfig.json +11 -0
  264. package/src/uploads.ts +255 -0
  265. package/src/version.ts +1 -0
  266. package/uploads.d.ts +75 -0
  267. package/uploads.d.ts.map +1 -0
  268. package/uploads.js +171 -0
  269. package/uploads.js.map +1 -0
  270. package/uploads.mjs +158 -0
  271. package/uploads.mjs.map +1 -0
  272. package/version.d.ts +2 -0
  273. package/version.d.ts.map +1 -0
  274. package/version.js +5 -0
  275. package/version.js.map +1 -0
  276. package/version.mjs +2 -0
  277. package/version.mjs.map +1 -0
@@ -0,0 +1,47 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as ContentAPI from './content';
5
+ import { Content, ContentCreateParams, ExtractionResult } from './content';
6
+ import * as JobsAPI from './jobs';
7
+ import { ExtractionJob, JobCreateParams, Jobs } from './jobs';
8
+ import * as SchemaAPI from './schema';
9
+ import {
10
+ CreatedJsonSchema,
11
+ EnhancedJsonSchema,
12
+ Schema,
13
+ SchemaCreateParams,
14
+ SchemaEnhanceParams,
15
+ SchemaValidateParams,
16
+ ValidatedJsonSchema,
17
+ } from './schema';
18
+
19
+ export class Extractions extends APIResource {
20
+ jobs: JobsAPI.Jobs = new JobsAPI.Jobs(this._client);
21
+ schema: SchemaAPI.Schema = new SchemaAPI.Schema(this._client);
22
+ content: ContentAPI.Content = new ContentAPI.Content(this._client);
23
+ }
24
+
25
+ Extractions.Jobs = Jobs;
26
+ Extractions.Schema = Schema;
27
+ Extractions.Content = Content;
28
+
29
+ export declare namespace Extractions {
30
+ export { Jobs as Jobs, type ExtractionJob as ExtractionJob, type JobCreateParams as JobCreateParams };
31
+
32
+ export {
33
+ Schema as Schema,
34
+ type CreatedJsonSchema as CreatedJsonSchema,
35
+ type EnhancedJsonSchema as EnhancedJsonSchema,
36
+ type ValidatedJsonSchema as ValidatedJsonSchema,
37
+ type SchemaCreateParams as SchemaCreateParams,
38
+ type SchemaEnhanceParams as SchemaEnhanceParams,
39
+ type SchemaValidateParams as SchemaValidateParams,
40
+ };
41
+
42
+ export {
43
+ Content as Content,
44
+ type ExtractionResult as ExtractionResult,
45
+ type ContentCreateParams as ContentCreateParams,
46
+ };
47
+ }
@@ -0,0 +1,14 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Content, type ExtractionResult, type ContentCreateParams } from './content';
4
+ export { Extractions } from './extractions';
5
+ export { Jobs, type ExtractionJob, type JobCreateParams } from './jobs';
6
+ export {
7
+ Schema,
8
+ type CreatedJsonSchema,
9
+ type EnhancedJsonSchema,
10
+ type ValidatedJsonSchema,
11
+ type SchemaCreateParams,
12
+ type SchemaEnhanceParams,
13
+ type SchemaValidateParams,
14
+ } from './schema';
@@ -0,0 +1,55 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+ import * as ContentAPI from './content';
6
+
7
+ export class Jobs extends APIResource {
8
+ /**
9
+ * Start an extraction job for the provided file and schema.
10
+ *
11
+ * Args: params: The parameters for creating an extraction job.
12
+ *
13
+ * Returns: The created extraction job.
14
+ */
15
+ create(body: JobCreateParams, options?: Core.RequestOptions): Core.APIPromise<ExtractionJob> {
16
+ return this._client.post('/v1/extractions/jobs', { body, ...options });
17
+ }
18
+
19
+ /**
20
+ * Get detailed information about a specific extraction job.
21
+ *
22
+ * Args: job_id: The ID of the extraction job.
23
+ *
24
+ * Returns: Detailed information about the extraction job.
25
+ */
26
+ retrieve(jobId: string, options?: Core.RequestOptions): Core.APIPromise<ExtractionJob> {
27
+ return this._client.get(`/v1/extractions/jobs/${jobId}`, options);
28
+ }
29
+ }
30
+
31
+ /**
32
+ * A job for extracting structured data from documents.
33
+ */
34
+ export interface ExtractionJob {
35
+ /**
36
+ * Result of an extraction operation.
37
+ */
38
+ result: ContentAPI.ExtractionResult | null;
39
+ }
40
+
41
+ export interface JobCreateParams {
42
+ /**
43
+ * The ID of the file to extract from
44
+ */
45
+ file_id: string;
46
+
47
+ /**
48
+ * The JSON schema to use for extraction
49
+ */
50
+ json_schema: unknown;
51
+ }
52
+
53
+ export declare namespace Jobs {
54
+ export { type ExtractionJob as ExtractionJob, type JobCreateParams as JobCreateParams };
55
+ }
@@ -0,0 +1,111 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+
6
+ export class Schema extends APIResource {
7
+ /**
8
+ * Create a schema with the provided parameters.
9
+ *
10
+ * Args: params: The parameters for creating a schema.
11
+ *
12
+ * Returns: The created schema.
13
+ */
14
+ create(body: SchemaCreateParams, options?: Core.RequestOptions): Core.APIPromise<CreatedJsonSchema> {
15
+ return this._client.post('/v1/extractions/schema', { body, ...options });
16
+ }
17
+
18
+ /**
19
+ * Enhance a schema by enriching the descriptions to aid extraction.
20
+ *
21
+ * Args: params: The parameters for enhancing a schema.
22
+ *
23
+ * Returns: The enhanced schema.
24
+ */
25
+ enhance(body: SchemaEnhanceParams, options?: Core.RequestOptions): Core.APIPromise<EnhancedJsonSchema> {
26
+ return this._client.post('/v1/extractions/schema/enhance', { body, ...options });
27
+ }
28
+
29
+ /**
30
+ * Validate a schema.
31
+ *
32
+ * Args: params: The parameters for validating a schema.
33
+ *
34
+ * Returns: The validation result.
35
+ */
36
+ validate(body: SchemaValidateParams, options?: Core.RequestOptions): Core.APIPromise<ValidatedJsonSchema> {
37
+ return this._client.post('/v1/extractions/schema/validate', { body, ...options });
38
+ }
39
+ }
40
+
41
+ /**
42
+ * Result of creating a JSON schema.
43
+ */
44
+ export interface CreatedJsonSchema {
45
+ /**
46
+ * The created JSON schema
47
+ */
48
+ json_schema: unknown;
49
+ }
50
+
51
+ /**
52
+ * Result of enhancing a JSON schema.
53
+ */
54
+ export interface EnhancedJsonSchema {
55
+ /**
56
+ * The enhanced JSON schema
57
+ */
58
+ json_schema: unknown;
59
+ }
60
+
61
+ /**
62
+ * Result of validating a JSON schema.
63
+ */
64
+ export interface ValidatedJsonSchema {
65
+ /**
66
+ * Whether the schema is valid
67
+ */
68
+ is_valid: boolean;
69
+
70
+ /**
71
+ * List of validation errors
72
+ */
73
+ errors: Array<string>;
74
+
75
+ /**
76
+ * The validated JSON schema
77
+ */
78
+ json_schema: unknown;
79
+ }
80
+
81
+ export interface SchemaCreateParams {
82
+ /**
83
+ * Description of the data to extract
84
+ */
85
+ description: string;
86
+ }
87
+
88
+ export interface SchemaEnhanceParams {
89
+ /**
90
+ * The JSON schema to enhance
91
+ */
92
+ json_schema: unknown;
93
+ }
94
+
95
+ export interface SchemaValidateParams {
96
+ /**
97
+ * The JSON schema to validate
98
+ */
99
+ json_schema: unknown;
100
+ }
101
+
102
+ export declare namespace Schema {
103
+ export {
104
+ type CreatedJsonSchema as CreatedJsonSchema,
105
+ type EnhancedJsonSchema as EnhancedJsonSchema,
106
+ type ValidatedJsonSchema as ValidatedJsonSchema,
107
+ type SchemaCreateParams as SchemaCreateParams,
108
+ type SchemaEnhanceParams as SchemaEnhanceParams,
109
+ type SchemaValidateParams as SchemaValidateParams,
110
+ };
111
+ }
@@ -0,0 +1,181 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../resource';
4
+ import { isRequestOptions } from '../core';
5
+ import * as Core from '../core';
6
+ import { LimitOffset, type LimitOffsetParams } from '../pagination';
7
+ import { type Response } from '../_shims/index';
8
+
9
+ export class Files extends APIResource {
10
+ /**
11
+ * Upload a new file.
12
+ *
13
+ * Args: file: The file to upload.
14
+ *
15
+ * Returns: FileResponse: The response containing the details of the uploaded file.
16
+ */
17
+ create(body: FileCreateParams, options?: Core.RequestOptions): Core.APIPromise<FileObject> {
18
+ return this._client.post('/v1/files', Core.multipartFormRequestOptions({ body, ...options }));
19
+ }
20
+
21
+ /**
22
+ * Retrieve details of a specific file by its ID.
23
+ *
24
+ * Args: file_id: The ID of the file to retrieve.
25
+ *
26
+ * Returns: FileResponse: The response containing the file details.
27
+ */
28
+ retrieve(fileId: string, options?: Core.RequestOptions): Core.APIPromise<FileObject> {
29
+ return this._client.get(`/v1/files/${fileId}`, options);
30
+ }
31
+
32
+ /**
33
+ * Update the details of a specific file.
34
+ *
35
+ * Args: file_id: The ID of the file to update. file: The new details for the file.
36
+ *
37
+ * Returns: FileObject: The updated file details.
38
+ */
39
+ update(fileId: string, body: FileUpdateParams, options?: Core.RequestOptions): Core.APIPromise<FileObject> {
40
+ return this._client.post(`/v1/files/${fileId}`, Core.multipartFormRequestOptions({ body, ...options }));
41
+ }
42
+
43
+ /**
44
+ * List all files for the authenticated user.
45
+ *
46
+ * Args: pagination: The pagination options
47
+ *
48
+ * Returns: A list of files belonging to the user.
49
+ */
50
+ list(
51
+ query?: FileListParams,
52
+ options?: Core.RequestOptions,
53
+ ): Core.PagePromise<FileObjectsLimitOffset, FileObject>;
54
+ list(options?: Core.RequestOptions): Core.PagePromise<FileObjectsLimitOffset, FileObject>;
55
+ list(
56
+ query: FileListParams | Core.RequestOptions = {},
57
+ options?: Core.RequestOptions,
58
+ ): Core.PagePromise<FileObjectsLimitOffset, FileObject> {
59
+ if (isRequestOptions(query)) {
60
+ return this.list({}, query);
61
+ }
62
+ return this._client.getAPIList('/v1/files', FileObjectsLimitOffset, { query, ...options });
63
+ }
64
+
65
+ /**
66
+ * Delete a specific file by its ID.
67
+ *
68
+ * Args: file_id: The ID of the file to delete.
69
+ *
70
+ * Returns: FileDeleted: The response containing the details of the deleted file.
71
+ */
72
+ delete(fileId: string, options?: Core.RequestOptions): Core.APIPromise<FileDeleteResponse> {
73
+ return this._client.delete(`/v1/files/${fileId}`, options);
74
+ }
75
+
76
+ /**
77
+ * Download a specific file by its ID.
78
+ *
79
+ * Args: file_id: The ID of the file to download.
80
+ *
81
+ * Returns: FileStreamResponse: The response containing the file to be downloaded.
82
+ */
83
+ content(fileId: string, options?: Core.RequestOptions): Core.APIPromise<Response> {
84
+ return this._client.get(`/v1/files/${fileId}/content`, {
85
+ ...options,
86
+ headers: { Accept: 'application/octet-stream', ...options?.headers },
87
+ __binaryResponse: true,
88
+ });
89
+ }
90
+ }
91
+
92
+ export class FileObjectsLimitOffset extends LimitOffset<FileObject> {}
93
+
94
+ /**
95
+ * A model representing a file object in the system.
96
+ *
97
+ * This model contains metadata about files stored in the system, including
98
+ * identifiers, size information, and timestamps.
99
+ */
100
+ export interface FileObject {
101
+ /**
102
+ * Unique identifier for the file
103
+ */
104
+ id: string;
105
+
106
+ /**
107
+ * Name of the file including extension
108
+ */
109
+ filename: string;
110
+
111
+ /**
112
+ * Size of the file in bytes
113
+ */
114
+ bytes: number;
115
+
116
+ /**
117
+ * MIME type of the file
118
+ */
119
+ mime_type: string;
120
+
121
+ /**
122
+ * Version of the file
123
+ */
124
+ version: number;
125
+
126
+ /**
127
+ * Timestamp when the file was created
128
+ */
129
+ created_at: string;
130
+
131
+ /**
132
+ * Timestamp when the file was last updated
133
+ */
134
+ updated_at: string;
135
+ }
136
+
137
+ export interface FileDeleteResponse {
138
+ /**
139
+ * The ID of the deleted file
140
+ */
141
+ id: string;
142
+
143
+ /**
144
+ * Whether the file was deleted
145
+ */
146
+ deleted?: boolean;
147
+
148
+ /**
149
+ * The type of the deleted object
150
+ */
151
+ object?: 'file';
152
+ }
153
+
154
+ export interface FileCreateParams {
155
+ /**
156
+ * The file to upload
157
+ */
158
+ file: Core.Uploadable;
159
+ }
160
+
161
+ export interface FileUpdateParams {
162
+ /**
163
+ * The file to update
164
+ */
165
+ file: Core.Uploadable;
166
+ }
167
+
168
+ export interface FileListParams extends LimitOffsetParams {}
169
+
170
+ Files.FileObjectsLimitOffset = FileObjectsLimitOffset;
171
+
172
+ export declare namespace Files {
173
+ export {
174
+ type FileObject as FileObject,
175
+ type FileDeleteResponse as FileDeleteResponse,
176
+ FileObjectsLimitOffset as FileObjectsLimitOffset,
177
+ type FileCreateParams as FileCreateParams,
178
+ type FileUpdateParams as FileUpdateParams,
179
+ type FileListParams as FileListParams,
180
+ };
181
+ }
@@ -0,0 +1,32 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './shared';
4
+ export { Extractions } from './extractions/extractions';
5
+ export {
6
+ FileObjectsLimitOffset,
7
+ Files,
8
+ type FileObject,
9
+ type FileDeleteResponse,
10
+ type FileCreateParams,
11
+ type FileUpdateParams,
12
+ type FileListParams,
13
+ } from './files';
14
+ export { Parsing } from './parsing/parsing';
15
+ export {
16
+ VectorStoresLimitOffset,
17
+ VectorStores,
18
+ type ExpiresAfter,
19
+ type FileCounts,
20
+ type ScoredVectorStoreChunk,
21
+ type VectorStore,
22
+ type VectorStoreSearchOptions,
23
+ type VectorStoreDeleteResponse,
24
+ type VectorStoreQuestionAnsweringResponse,
25
+ type VectorStoreSearchResponse,
26
+ type VectorStoreCreateParams,
27
+ type VectorStoreUpdateParams,
28
+ type VectorStoreListParams,
29
+ type VectorStoreQuestionAnsweringParams,
30
+ type VectorStoreSearchParams,
31
+ } from './vector-stores/vector-stores';
32
+ export { type InfoResponse } from './top-level';
@@ -0,0 +1,12 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ JobListResponsesLimitOffset,
5
+ Jobs,
6
+ type ParsingJob,
7
+ type JobListResponse,
8
+ type JobDeleteResponse,
9
+ type JobCreateParams,
10
+ type JobListParams,
11
+ } from './jobs';
12
+ export { Parsing } from './parsing';