@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,434 @@
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 * as Shared from '../shared';
7
+ import * as VectorStoresAPI from './vector-stores';
8
+ import { LimitOffset, type LimitOffsetParams } from '../../pagination';
9
+ import * as polling from '../../lib/polling';
10
+ import { Uploadable } from '../../uploads';
11
+
12
+ export class Files extends APIResource {
13
+ /**
14
+ * Upload a new file to a vector store for indexing.
15
+ *
16
+ * Args: vector_store_id: The ID of the vector store to upload to file: The file to
17
+ * upload and index
18
+ *
19
+ * Returns: VectorStoreFile: Details of the uploaded and indexed file
20
+ */
21
+ create(
22
+ vectorStoreId: string,
23
+ body: FileCreateParams,
24
+ options?: Core.RequestOptions,
25
+ ): Core.APIPromise<VectorStoreFile> {
26
+ return this._client.post(`/v1/vector_stores/${vectorStoreId}/files`, { body, ...options });
27
+ }
28
+
29
+ /**
30
+ * Get details of a specific file in a vector store.
31
+ *
32
+ * Args: vector_store_id: The ID of the vector store file_id: The ID of the file
33
+ *
34
+ * Returns: VectorStoreFile: Details of the vector store file
35
+ */
36
+ retrieve(
37
+ vectorStoreId: string,
38
+ fileId: string,
39
+ options?: Core.RequestOptions,
40
+ ): Core.APIPromise<VectorStoreFile> {
41
+ return this._client.get(`/v1/vector_stores/${vectorStoreId}/files/${fileId}`, options);
42
+ }
43
+
44
+ /**
45
+ * List files indexed in a vector store with pagination.
46
+ *
47
+ * Args: vector_store_id: The ID of the vector store pagination: Pagination
48
+ * parameters
49
+ *
50
+ * Returns: VectorStoreFileListResponse: Paginated list of vector store files
51
+ */
52
+ list(
53
+ vectorStoreId: string,
54
+ query?: FileListParams,
55
+ options?: Core.RequestOptions,
56
+ ): Core.PagePromise<VectorStoreFilesLimitOffset, VectorStoreFile>;
57
+ list(
58
+ vectorStoreId: string,
59
+ options?: Core.RequestOptions,
60
+ ): Core.PagePromise<VectorStoreFilesLimitOffset, VectorStoreFile>;
61
+ list(
62
+ vectorStoreId: string,
63
+ query: FileListParams | Core.RequestOptions = {},
64
+ options?: Core.RequestOptions,
65
+ ): Core.PagePromise<VectorStoreFilesLimitOffset, VectorStoreFile> {
66
+ if (isRequestOptions(query)) {
67
+ return this.list(vectorStoreId, {}, query);
68
+ }
69
+ return this._client.getAPIList(`/v1/vector_stores/${vectorStoreId}/files`, VectorStoreFilesLimitOffset, {
70
+ query,
71
+ ...options,
72
+ });
73
+ }
74
+
75
+ /**
76
+ * Delete a file from a vector store.
77
+ *
78
+ * Args: vector_store_id: The ID of the vector store file_id: The ID of the file to
79
+ * delete
80
+ *
81
+ * Returns: VectorStoreFileDeleted: The deleted file
82
+ */
83
+ delete(
84
+ vectorStoreId: string,
85
+ fileId: string,
86
+ options?: Core.RequestOptions,
87
+ ): Core.APIPromise<FileDeleteResponse> {
88
+ return this._client.delete(`/v1/vector_stores/${vectorStoreId}/files/${fileId}`, options);
89
+ }
90
+
91
+ /**
92
+ * Perform semantic search across complete vector store files.
93
+ *
94
+ * This endpoint searches through vector store files using semantic similarity
95
+ * matching. Unlike chunk search, it returns complete matching files rather than
96
+ * individual chunks. Supports complex search queries with filters and returns
97
+ * relevance-scored results.
98
+ *
99
+ * Args: search_params: Search configuration including: - query text or
100
+ * embeddings - metadata filters - pagination parameters - sorting preferences
101
+ * \_state: API state dependency \_ctx: Service context dependency
102
+ *
103
+ * Returns: VectorStoreSearchFileResponse containing: - List of matched files with
104
+ * relevance scores - Pagination details including total result count
105
+ *
106
+ * Raises: HTTPException (400): If search parameters are invalid HTTPException
107
+ * (404): If no vector stores are found to search
108
+ */
109
+ search(body: FileSearchParams, options?: Core.RequestOptions): Core.APIPromise<FileSearchResponse> {
110
+ return this._client.post('/v1/vector_stores/files/search', { body, ...options });
111
+ }
112
+
113
+ /**
114
+ * Poll for a file's processing status until it reaches a terminal state.
115
+ *
116
+ * @param vectorStoreId - The ID of the vector store
117
+ * @param fileId - The ID of the file to poll
118
+ * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
119
+ * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
120
+ * @param options - Additional request options
121
+ * @returns The file object once it reaches a terminal state
122
+ */
123
+ async poll(
124
+ vectorStoreId: string,
125
+ fileId: string,
126
+ pollIntervalMs?: number,
127
+ pollTimeoutMs?: number,
128
+ options?: Core.RequestOptions,
129
+ ): Promise<VectorStoreFile> {
130
+ const pollingIntervalMs = pollIntervalMs || 500;
131
+ const pollingTimeoutMs = pollTimeoutMs;
132
+
133
+ return polling.poll({
134
+ fn: () => this.retrieve(vectorStoreId, fileId, options),
135
+ condition: (result) =>
136
+ result.status === 'completed' || result.status === 'failed' || result.status === 'error',
137
+ intervalSeconds: pollingIntervalMs / 1000,
138
+ ...(pollingTimeoutMs && { timeoutSeconds: pollingTimeoutMs / 1000 }),
139
+ });
140
+ }
141
+
142
+ /**
143
+ * Create a file in a vector store and wait for it to be processed.
144
+ *
145
+ * @param vectorStoreId - The ID of the vector store to upload to
146
+ * @param body - The file creation parameters
147
+ * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
148
+ * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
149
+ * @param options - Additional request options
150
+ * @returns The file object once it reaches a terminal state
151
+ */
152
+ async createAndPoll(
153
+ vectorStoreId: string,
154
+ body: FileCreateParams,
155
+ pollIntervalMs?: number,
156
+ pollTimeoutMs?: number,
157
+ options?: Core.RequestOptions,
158
+ ): Promise<VectorStoreFile> {
159
+ const file = await this.create(vectorStoreId, body, options);
160
+ return this.poll(vectorStoreId, file.id, pollIntervalMs, pollTimeoutMs, options);
161
+ }
162
+
163
+ /**
164
+ * Upload a file to the files API and then create a file in a vector store.
165
+ * Note the file will be asynchronously processed.
166
+ *
167
+ * @param vectorStoreId - The ID of the vector store to add the file to
168
+ * @param file - The file to upload
169
+ * @param body - Additional parameters for the vector store file
170
+ * @param options - Additional request options
171
+ * @returns The created vector store file
172
+ */
173
+ async upload(
174
+ vectorStoreId: string,
175
+ file: Uploadable,
176
+ body?: Omit<FileCreateParams, 'file_id'>,
177
+ options?: Core.RequestOptions,
178
+ ): Promise<VectorStoreFile> {
179
+ const fileUploadResponse = await this._client.files.create({ file }, options);
180
+
181
+ return this.create(
182
+ vectorStoreId,
183
+ {
184
+ file_id: fileUploadResponse.id,
185
+ ...body,
186
+ },
187
+ options,
188
+ );
189
+ }
190
+
191
+ /**
192
+ * Upload a file to files API, create a file in a vector store, and poll until processing is complete.
193
+ *
194
+ * @param vectorStoreId - The ID of the vector store to add the file to
195
+ * @param file - The file to upload
196
+ * @param body - Additional parameters for the vector store file
197
+ * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
198
+ * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
199
+ * @param options - Additional request options
200
+ * @returns The vector store file object once it reaches a terminal state
201
+ */
202
+ async uploadAndPoll(
203
+ vectorStoreId: string,
204
+ file: Uploadable,
205
+ body?: Omit<FileCreateParams, 'file_id'>,
206
+ pollIntervalMs?: number,
207
+ pollTimeoutMs?: number,
208
+ options?: Core.RequestOptions,
209
+ ): Promise<VectorStoreFile> {
210
+ const vectorStoreFile = await this.upload(vectorStoreId, file, body, options);
211
+ return this.poll(vectorStoreId, vectorStoreFile.id, pollIntervalMs, pollTimeoutMs, options);
212
+ }
213
+ }
214
+
215
+ export class VectorStoreFilesLimitOffset extends LimitOffset<VectorStoreFile> {}
216
+
217
+ /**
218
+ * Represents a scored file stored in a vector store.
219
+ */
220
+ export interface ScoredVectorStoreFile {
221
+ /**
222
+ * Unique identifier for the file
223
+ */
224
+ id: string;
225
+
226
+ /**
227
+ * Optional file metadata
228
+ */
229
+ metadata?: unknown;
230
+
231
+ /**
232
+ * Processing status of the file
233
+ */
234
+ status?: string;
235
+
236
+ /**
237
+ * Last error message if processing failed
238
+ */
239
+ last_error?: unknown;
240
+
241
+ /**
242
+ * ID of the containing vector store
243
+ */
244
+ vector_store_id: string;
245
+
246
+ /**
247
+ * Timestamp of vector store file creation
248
+ */
249
+ created_at: string;
250
+
251
+ /**
252
+ * Version number of the file
253
+ */
254
+ version?: number | null;
255
+
256
+ /**
257
+ * Storage usage in bytes
258
+ */
259
+ usage_bytes?: number | null;
260
+
261
+ /**
262
+ * Type of the object
263
+ */
264
+ object?: 'vector_store.file';
265
+
266
+ /**
267
+ * score of the file
268
+ */
269
+ score: number;
270
+
271
+ /**
272
+ * chunks
273
+ */
274
+ chunks: Array<VectorStoresAPI.ScoredVectorStoreChunk>;
275
+ }
276
+
277
+ /**
278
+ * Represents a file stored in a vector store.
279
+ */
280
+ export interface VectorStoreFile {
281
+ /**
282
+ * Unique identifier for the file
283
+ */
284
+ id: string;
285
+
286
+ /**
287
+ * Optional file metadata
288
+ */
289
+ metadata?: unknown;
290
+
291
+ /**
292
+ * Processing status of the file
293
+ */
294
+ status?: string;
295
+
296
+ /**
297
+ * Last error message if processing failed
298
+ */
299
+ last_error?: unknown;
300
+
301
+ /**
302
+ * ID of the containing vector store
303
+ */
304
+ vector_store_id: string;
305
+
306
+ /**
307
+ * Timestamp of vector store file creation
308
+ */
309
+ created_at: string;
310
+
311
+ /**
312
+ * Version number of the file
313
+ */
314
+ version?: number | null;
315
+
316
+ /**
317
+ * Storage usage in bytes
318
+ */
319
+ usage_bytes?: number | null;
320
+
321
+ /**
322
+ * Type of the object
323
+ */
324
+ object?: 'vector_store.file';
325
+ }
326
+
327
+ /**
328
+ * Response model for file deletion.
329
+ */
330
+ export interface FileDeleteResponse {
331
+ /**
332
+ * ID of the deleted file
333
+ */
334
+ id: string;
335
+
336
+ /**
337
+ * Whether the deletion was successful
338
+ */
339
+ deleted?: boolean;
340
+
341
+ /**
342
+ * Type of the deleted object
343
+ */
344
+ object?: 'vector_store.file';
345
+ }
346
+
347
+ export interface FileSearchResponse {
348
+ /**
349
+ * The object type of the response
350
+ */
351
+ object?: 'list';
352
+
353
+ /**
354
+ * The list of scored vector store files
355
+ */
356
+ data: Array<ScoredVectorStoreFile>;
357
+ }
358
+
359
+ export interface FileCreateParams {
360
+ /**
361
+ * ID of the file to add
362
+ */
363
+ file_id: string;
364
+
365
+ /**
366
+ * Optional metadata for the file
367
+ */
368
+ metadata?: unknown;
369
+
370
+ /**
371
+ * Strategy for adding the file
372
+ */
373
+ experimental?: FileCreateParams.Experimental;
374
+ }
375
+
376
+ export namespace FileCreateParams {
377
+ /**
378
+ * Strategy for adding the file
379
+ */
380
+ export interface Experimental {
381
+ /**
382
+ * Strategy for adding the file
383
+ */
384
+ parsing_strategy?: 'fast' | 'high_quality';
385
+ }
386
+ }
387
+
388
+ export interface FileListParams extends LimitOffsetParams {}
389
+
390
+ export interface FileSearchParams {
391
+ /**
392
+ * Search query text
393
+ */
394
+ query: string;
395
+
396
+ /**
397
+ * IDs of vector stores to search
398
+ */
399
+ vector_store_ids: Array<string>;
400
+
401
+ /**
402
+ * Number of results to return
403
+ */
404
+ top_k?: number;
405
+
406
+ /**
407
+ * Optional filter conditions
408
+ */
409
+ filters?:
410
+ | Shared.SearchFilter
411
+ | Shared.SearchFilterCondition
412
+ | Array<Shared.SearchFilter | Shared.SearchFilterCondition>
413
+ | null;
414
+
415
+ /**
416
+ * Search configuration options
417
+ */
418
+ search_options?: VectorStoresAPI.VectorStoreSearchOptions;
419
+ }
420
+
421
+ Files.VectorStoreFilesLimitOffset = VectorStoreFilesLimitOffset;
422
+
423
+ export declare namespace Files {
424
+ export {
425
+ type ScoredVectorStoreFile as ScoredVectorStoreFile,
426
+ type VectorStoreFile as VectorStoreFile,
427
+ type FileDeleteResponse as FileDeleteResponse,
428
+ type FileSearchResponse as FileSearchResponse,
429
+ VectorStoreFilesLimitOffset as VectorStoreFilesLimitOffset,
430
+ type FileCreateParams as FileCreateParams,
431
+ type FileListParams as FileListParams,
432
+ type FileSearchParams as FileSearchParams,
433
+ };
434
+ }
@@ -0,0 +1,30 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ VectorStoreFilesLimitOffset,
5
+ Files,
6
+ type ScoredVectorStoreFile,
7
+ type VectorStoreFile,
8
+ type FileDeleteResponse,
9
+ type FileSearchResponse,
10
+ type FileCreateParams,
11
+ type FileListParams,
12
+ type FileSearchParams,
13
+ } from './files';
14
+ export {
15
+ VectorStoresLimitOffset,
16
+ VectorStores,
17
+ type ExpiresAfter,
18
+ type FileCounts,
19
+ type ScoredVectorStoreChunk,
20
+ type VectorStore,
21
+ type VectorStoreSearchOptions,
22
+ type VectorStoreDeleteResponse,
23
+ type VectorStoreQuestionAnsweringResponse,
24
+ type VectorStoreSearchResponse,
25
+ type VectorStoreCreateParams,
26
+ type VectorStoreUpdateParams,
27
+ type VectorStoreListParams,
28
+ type VectorStoreQuestionAnsweringParams,
29
+ type VectorStoreSearchParams,
30
+ } from './vector-stores';