@mixedbread/sdk 0.1.0-alpha.10

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 (284) hide show
  1. package/CHANGELOG.md +230 -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 +915 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +883 -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 +169 -0
  87. package/index.d.ts +169 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +175 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +132 -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/embeddings.d.ts +177 -0
  113. package/resources/embeddings.d.ts.map +1 -0
  114. package/resources/embeddings.js +20 -0
  115. package/resources/embeddings.js.map +1 -0
  116. package/resources/embeddings.mjs +16 -0
  117. package/resources/embeddings.mjs.map +1 -0
  118. package/resources/extractions/content.d.ts +33 -0
  119. package/resources/extractions/content.d.ts.map +1 -0
  120. package/resources/extractions/content.js +19 -0
  121. package/resources/extractions/content.js.map +1 -0
  122. package/resources/extractions/content.mjs +15 -0
  123. package/resources/extractions/content.mjs.map +1 -0
  124. package/resources/extractions/extractions.d.ts +18 -0
  125. package/resources/extractions/extractions.d.ts.map +1 -0
  126. package/resources/extractions/extractions.js +47 -0
  127. package/resources/extractions/extractions.js.map +1 -0
  128. package/resources/extractions/extractions.mjs +20 -0
  129. package/resources/extractions/extractions.mjs.map +1 -0
  130. package/resources/extractions/index.d.ts +5 -0
  131. package/resources/extractions/index.d.ts.map +1 -0
  132. package/resources/extractions/index.js +13 -0
  133. package/resources/extractions/index.js.map +1 -0
  134. package/resources/extractions/index.mjs +6 -0
  135. package/resources/extractions/index.mjs.map +1 -0
  136. package/resources/extractions/jobs.d.ts +84 -0
  137. package/resources/extractions/jobs.d.ts.map +1 -0
  138. package/resources/extractions/jobs.js +29 -0
  139. package/resources/extractions/jobs.js.map +1 -0
  140. package/resources/extractions/jobs.mjs +25 -0
  141. package/resources/extractions/jobs.mjs.map +1 -0
  142. package/resources/extractions/schema.d.ts +85 -0
  143. package/resources/extractions/schema.d.ts.map +1 -0
  144. package/resources/extractions/schema.js +39 -0
  145. package/resources/extractions/schema.js.map +1 -0
  146. package/resources/extractions/schema.mjs +35 -0
  147. package/resources/extractions/schema.mjs.map +1 -0
  148. package/resources/files.d.ts +125 -0
  149. package/resources/files.d.ts.map +1 -0
  150. package/resources/files.js +99 -0
  151. package/resources/files.js.map +1 -0
  152. package/resources/files.mjs +71 -0
  153. package/resources/files.mjs.map +1 -0
  154. package/resources/index.d.ts +8 -0
  155. package/resources/index.d.ts.map +1 -0
  156. package/resources/index.js +32 -0
  157. package/resources/index.js.map +1 -0
  158. package/resources/index.mjs +8 -0
  159. package/resources/index.mjs.map +1 -0
  160. package/resources/parsing/index.d.ts +3 -0
  161. package/resources/parsing/index.d.ts.map +1 -0
  162. package/resources/parsing/index.js +10 -0
  163. package/resources/parsing/index.js.map +1 -0
  164. package/resources/parsing/index.mjs +4 -0
  165. package/resources/parsing/index.mjs.map +1 -0
  166. package/resources/parsing/jobs.d.ts +290 -0
  167. package/resources/parsing/jobs.d.ts.map +1 -0
  168. package/resources/parsing/jobs.js +147 -0
  169. package/resources/parsing/jobs.js.map +1 -0
  170. package/resources/parsing/jobs.mjs +119 -0
  171. package/resources/parsing/jobs.mjs.map +1 -0
  172. package/resources/parsing/parsing.d.ts +10 -0
  173. package/resources/parsing/parsing.d.ts.map +1 -0
  174. package/resources/parsing/parsing.js +40 -0
  175. package/resources/parsing/parsing.js.map +1 -0
  176. package/resources/parsing/parsing.mjs +13 -0
  177. package/resources/parsing/parsing.mjs.map +1 -0
  178. package/resources/shared.d.ts +35 -0
  179. package/resources/shared.d.ts.map +1 -0
  180. package/resources/shared.js +4 -0
  181. package/resources/shared.js.map +1 -0
  182. package/resources/shared.mjs +3 -0
  183. package/resources/shared.mjs.map +1 -0
  184. package/resources/top-level.d.ts +165 -0
  185. package/resources/top-level.d.ts.map +1 -0
  186. package/resources/top-level.js +4 -0
  187. package/resources/top-level.js.map +1 -0
  188. package/resources/top-level.mjs +3 -0
  189. package/resources/top-level.mjs.map +1 -0
  190. package/resources/vector-stores/files.d.ts +284 -0
  191. package/resources/vector-stores/files.d.ts.map +1 -0
  192. package/resources/vector-stores/files.js +167 -0
  193. package/resources/vector-stores/files.js.map +1 -0
  194. package/resources/vector-stores/files.mjs +139 -0
  195. package/resources/vector-stores/files.mjs.map +1 -0
  196. package/resources/vector-stores/index.d.ts +3 -0
  197. package/resources/vector-stores/index.d.ts.map +1 -0
  198. package/resources/vector-stores/index.js +11 -0
  199. package/resources/vector-stores/index.js.map +1 -0
  200. package/resources/vector-stores/index.mjs +4 -0
  201. package/resources/vector-stores/index.mjs.map +1 -0
  202. package/resources/vector-stores/vector-stores.d.ts +425 -0
  203. package/resources/vector-stores/vector-stores.d.ts.map +1 -0
  204. package/resources/vector-stores/vector-stores.js +121 -0
  205. package/resources/vector-stores/vector-stores.js.map +1 -0
  206. package/resources/vector-stores/vector-stores.mjs +93 -0
  207. package/resources/vector-stores/vector-stores.mjs.map +1 -0
  208. package/shims/node.d.ts +30 -0
  209. package/shims/node.d.ts.map +1 -0
  210. package/shims/node.js +31 -0
  211. package/shims/node.js.map +1 -0
  212. package/shims/node.mjs +5 -0
  213. package/shims/node.mjs.map +1 -0
  214. package/shims/web.d.ts +26 -0
  215. package/shims/web.d.ts.map +1 -0
  216. package/shims/web.js +31 -0
  217. package/shims/web.js.map +1 -0
  218. package/shims/web.mjs +5 -0
  219. package/shims/web.mjs.map +1 -0
  220. package/src/_shims/MultipartBody.ts +9 -0
  221. package/src/_shims/README.md +46 -0
  222. package/src/_shims/auto/runtime-bun.ts +4 -0
  223. package/src/_shims/auto/runtime-node.ts +4 -0
  224. package/src/_shims/auto/runtime.ts +4 -0
  225. package/src/_shims/auto/types-node.ts +4 -0
  226. package/src/_shims/auto/types.d.ts +101 -0
  227. package/src/_shims/auto/types.js +3 -0
  228. package/src/_shims/auto/types.mjs +3 -0
  229. package/src/_shims/bun-runtime.ts +14 -0
  230. package/src/_shims/index.d.ts +81 -0
  231. package/src/_shims/index.js +13 -0
  232. package/src/_shims/index.mjs +7 -0
  233. package/src/_shims/manual-types.d.ts +12 -0
  234. package/src/_shims/manual-types.js +3 -0
  235. package/src/_shims/manual-types.mjs +3 -0
  236. package/src/_shims/node-runtime.ts +81 -0
  237. package/src/_shims/node-types.d.ts +42 -0
  238. package/src/_shims/node-types.js +3 -0
  239. package/src/_shims/node-types.mjs +3 -0
  240. package/src/_shims/registry.ts +67 -0
  241. package/src/_shims/web-runtime.ts +103 -0
  242. package/src/_shims/web-types.d.ts +83 -0
  243. package/src/_shims/web-types.js +3 -0
  244. package/src/_shims/web-types.mjs +3 -0
  245. package/src/core.ts +1208 -0
  246. package/src/error.ts +130 -0
  247. package/src/index.ts +346 -0
  248. package/src/lib/.keep +4 -0
  249. package/src/lib/polling.ts +115 -0
  250. package/src/pagination.ts +82 -0
  251. package/src/resource.ts +11 -0
  252. package/src/resources/embeddings.ts +248 -0
  253. package/src/resources/extractions/content.ts +42 -0
  254. package/src/resources/extractions/extractions.ts +47 -0
  255. package/src/resources/extractions/index.ts +14 -0
  256. package/src/resources/extractions/jobs.ts +105 -0
  257. package/src/resources/extractions/schema.ts +111 -0
  258. package/src/resources/files.ts +181 -0
  259. package/src/resources/index.ts +39 -0
  260. package/src/resources/parsing/index.ts +12 -0
  261. package/src/resources/parsing/jobs.ts +453 -0
  262. package/src/resources/parsing/parsing.ts +32 -0
  263. package/src/resources/shared.ts +41 -0
  264. package/src/resources/top-level.ts +231 -0
  265. package/src/resources/vector-stores/files.ts +439 -0
  266. package/src/resources/vector-stores/index.ts +31 -0
  267. package/src/resources/vector-stores/vector-stores.ts +592 -0
  268. package/src/shims/node.ts +50 -0
  269. package/src/shims/web.ts +50 -0
  270. package/src/tsconfig.json +11 -0
  271. package/src/uploads.ts +255 -0
  272. package/src/version.ts +1 -0
  273. package/uploads.d.ts +75 -0
  274. package/uploads.d.ts.map +1 -0
  275. package/uploads.js +171 -0
  276. package/uploads.js.map +1 -0
  277. package/uploads.mjs +158 -0
  278. package/uploads.mjs.map +1 -0
  279. package/version.d.ts +2 -0
  280. package/version.d.ts.map +1 -0
  281. package/version.js +5 -0
  282. package/version.js.map +1 -0
  283. package/version.mjs +2 -0
  284. package/version.mjs.map +1 -0
@@ -0,0 +1,31 @@
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 VectorStoreChunkSearchOptions,
22
+ type VectorStoreFileSearchOptions,
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';
@@ -0,0 +1,592 @@
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 FilesAPI from './files';
8
+ import {
9
+ FileCreateParams,
10
+ FileDeleteResponse,
11
+ FileListParams,
12
+ FileSearchParams,
13
+ FileSearchResponse,
14
+ Files,
15
+ ScoredVectorStoreFile,
16
+ VectorStoreFile,
17
+ VectorStoreFilesLimitOffset,
18
+ } from './files';
19
+ import { LimitOffset, type LimitOffsetParams } from '../../pagination';
20
+
21
+ export class VectorStores extends APIResource {
22
+ files: FilesAPI.Files = new FilesAPI.Files(this._client);
23
+
24
+ /**
25
+ * Create a new vector store.
26
+ *
27
+ * Args: vector_store_create: VectorStoreCreate object containing the name,
28
+ * description, and metadata.
29
+ *
30
+ * Returns: VectorStore: The response containing the created vector store details.
31
+ */
32
+ create(body: VectorStoreCreateParams, options?: Core.RequestOptions): Core.APIPromise<VectorStore> {
33
+ return this._client.post('/v1/vector_stores', { body, ...options });
34
+ }
35
+
36
+ /**
37
+ * Get a vector store by ID.
38
+ *
39
+ * Args: vector_store_id: The ID of the vector store to retrieve.
40
+ *
41
+ * Returns: VectorStore: The response containing the vector store details.
42
+ */
43
+ retrieve(vectorStoreId: string, options?: Core.RequestOptions): Core.APIPromise<VectorStore> {
44
+ return this._client.get(`/v1/vector_stores/${vectorStoreId}`, options);
45
+ }
46
+
47
+ /**
48
+ * Update a vector store by ID.
49
+ *
50
+ * Args: vector_store_id: The ID of the vector store to update.
51
+ * vector_store_update: VectorStoreCreate object containing the name, description,
52
+ * and metadata.
53
+ *
54
+ * Returns: VectorStore: The response containing the updated vector store details.
55
+ */
56
+ update(
57
+ vectorStoreId: string,
58
+ body: VectorStoreUpdateParams,
59
+ options?: Core.RequestOptions,
60
+ ): Core.APIPromise<VectorStore> {
61
+ return this._client.put(`/v1/vector_stores/${vectorStoreId}`, { body, ...options });
62
+ }
63
+
64
+ /**
65
+ * List all vector stores.
66
+ *
67
+ * Args: pagination: The pagination options.
68
+ *
69
+ * Returns: VectorStoreListResponse: The list of vector stores.
70
+ */
71
+ list(
72
+ query?: VectorStoreListParams,
73
+ options?: Core.RequestOptions,
74
+ ): Core.PagePromise<VectorStoresLimitOffset, VectorStore>;
75
+ list(options?: Core.RequestOptions): Core.PagePromise<VectorStoresLimitOffset, VectorStore>;
76
+ list(
77
+ query: VectorStoreListParams | Core.RequestOptions = {},
78
+ options?: Core.RequestOptions,
79
+ ): Core.PagePromise<VectorStoresLimitOffset, VectorStore> {
80
+ if (isRequestOptions(query)) {
81
+ return this.list({}, query);
82
+ }
83
+ return this._client.getAPIList('/v1/vector_stores', VectorStoresLimitOffset, { query, ...options });
84
+ }
85
+
86
+ /**
87
+ * Delete a vector store by ID.
88
+ *
89
+ * Args: vector_store_id: The ID of the vector store to delete.
90
+ *
91
+ * Returns: VectorStore: The response containing the deleted vector store details.
92
+ */
93
+ delete(vectorStoreId: string, options?: Core.RequestOptions): Core.APIPromise<VectorStoreDeleteResponse> {
94
+ return this._client.delete(`/v1/vector_stores/${vectorStoreId}`, options);
95
+ }
96
+
97
+ /**
98
+ * Question answering
99
+ */
100
+ questionAnswering(
101
+ body: VectorStoreQuestionAnsweringParams,
102
+ options?: Core.RequestOptions,
103
+ ): Core.APIPromise<unknown> {
104
+ return this._client.post('/v1/vector_stores/question-answering', { body, ...options });
105
+ }
106
+
107
+ /**
108
+ * Perform semantic search across vector store chunks.
109
+ *
110
+ * This endpoint searches through vector store chunks using semantic similarity
111
+ * matching. It supports complex search queries with filters and returns
112
+ * relevance-scored results.
113
+ *
114
+ * Args: search_params: Search configuration including: - query text or
115
+ * embeddings - metadata filters - pagination parameters - sorting preferences
116
+ * \_state: API state dependency \_ctx: Service context dependency
117
+ *
118
+ * Returns: VectorStoreSearchChunkResponse containing: - List of matched chunks
119
+ * with relevance scores - Pagination details including total result count
120
+ *
121
+ * Raises: HTTPException (400): If search parameters are invalid HTTPException
122
+ * (404): If no vector stores are found to search
123
+ */
124
+ search(
125
+ body: VectorStoreSearchParams,
126
+ options?: Core.RequestOptions,
127
+ ): Core.APIPromise<VectorStoreSearchResponse> {
128
+ return this._client.post('/v1/vector_stores/search', { body, ...options });
129
+ }
130
+ }
131
+
132
+ export class VectorStoresLimitOffset extends LimitOffset<VectorStore> {}
133
+
134
+ /**
135
+ * Represents an expiration policy for a vector store.
136
+ */
137
+ export interface ExpiresAfter {
138
+ /**
139
+ * Anchor date for the expiration policy
140
+ */
141
+ anchor?: 'last_active_at';
142
+
143
+ /**
144
+ * Number of days after which the vector store expires
145
+ */
146
+ days?: number;
147
+ }
148
+
149
+ /**
150
+ * Tracks counts of files in different states within a vector store.
151
+ */
152
+ export interface FileCounts {
153
+ /**
154
+ * Number of files currently being processed
155
+ */
156
+ in_progress?: number;
157
+
158
+ /**
159
+ * Number of files whose processing was cancelled
160
+ */
161
+ cancelled?: number;
162
+
163
+ /**
164
+ * Number of successfully processed files
165
+ */
166
+ completed?: number;
167
+
168
+ /**
169
+ * Number of files that failed processing
170
+ */
171
+ failed?: number;
172
+
173
+ /**
174
+ * Total number of files
175
+ */
176
+ total?: number;
177
+ }
178
+
179
+ export interface ScoredVectorStoreChunk {
180
+ /**
181
+ * position of the chunk in a file
182
+ */
183
+ position: number;
184
+
185
+ /**
186
+ * value of the chunk
187
+ */
188
+ value?:
189
+ | string
190
+ | ScoredVectorStoreChunk.ImageURLInput
191
+ | ScoredVectorStoreChunk.TextInput
192
+ | Record<string, unknown>
193
+ | null;
194
+
195
+ /**
196
+ * content of the chunk
197
+ */
198
+ content?: string | null;
199
+
200
+ /**
201
+ * score of the chunk
202
+ */
203
+ score: number;
204
+
205
+ /**
206
+ * file id
207
+ */
208
+ file_id: string;
209
+
210
+ /**
211
+ * vector store id
212
+ */
213
+ vector_store_id: string;
214
+
215
+ /**
216
+ * file metadata
217
+ */
218
+ metadata?: unknown;
219
+ }
220
+
221
+ export namespace ScoredVectorStoreChunk {
222
+ /**
223
+ * Model for image input validation.
224
+ */
225
+ export interface ImageURLInput {
226
+ /**
227
+ * Input type identifier
228
+ */
229
+ type?: 'image_url';
230
+
231
+ /**
232
+ * The image input specification.
233
+ */
234
+ image: ImageURLInput.Image;
235
+ }
236
+
237
+ export namespace ImageURLInput {
238
+ /**
239
+ * The image input specification.
240
+ */
241
+ export interface Image {
242
+ /**
243
+ * The image URL. Can be either a URL or a Data URI.
244
+ */
245
+ url: string;
246
+ }
247
+ }
248
+
249
+ /**
250
+ * Model for text input validation.
251
+ *
252
+ * Attributes: type: Input type identifier, always "text" text: The actual text
253
+ * content, with length and whitespace constraints
254
+ */
255
+ export interface TextInput {
256
+ /**
257
+ * Input type identifier
258
+ */
259
+ type?: 'text';
260
+
261
+ /**
262
+ * Text content to process
263
+ */
264
+ text: string;
265
+ }
266
+ }
267
+
268
+ /**
269
+ * Model representing a vector store with its metadata and timestamps.
270
+ */
271
+ export interface VectorStore {
272
+ /**
273
+ * Unique identifier for the vector store
274
+ */
275
+ id: string;
276
+
277
+ /**
278
+ * Name of the vector store
279
+ */
280
+ name: string;
281
+
282
+ /**
283
+ * Detailed description of the vector store's purpose and contents
284
+ */
285
+ description?: string | null;
286
+
287
+ /**
288
+ * Additional metadata associated with the vector store
289
+ */
290
+ metadata?: unknown;
291
+
292
+ /**
293
+ * Counts of files in different states
294
+ */
295
+ file_counts?: FileCounts;
296
+
297
+ /**
298
+ * Represents an expiration policy for a vector store.
299
+ */
300
+ expires_after?: ExpiresAfter | null;
301
+
302
+ /**
303
+ * Processing status of the vector store
304
+ */
305
+ status?: 'expired' | 'in_progress' | 'completed';
306
+
307
+ /**
308
+ * Timestamp when the vector store was created
309
+ */
310
+ created_at: string;
311
+
312
+ /**
313
+ * Timestamp when the vector store was last updated
314
+ */
315
+ updated_at: string;
316
+
317
+ /**
318
+ * Timestamp when the vector store was last used
319
+ */
320
+ last_active_at?: string | null;
321
+
322
+ /**
323
+ * Total storage usage in bytes
324
+ */
325
+ usage_bytes?: number;
326
+
327
+ /**
328
+ * Optional expiration timestamp for the vector store
329
+ */
330
+ expires_at?: string | null;
331
+
332
+ /**
333
+ * Type of the object
334
+ */
335
+ object?: 'vector_store';
336
+ }
337
+
338
+ /**
339
+ * Options for configuring vector store chunk searches.
340
+ */
341
+ export interface VectorStoreChunkSearchOptions {
342
+ /**
343
+ * Minimum similarity score threshold
344
+ */
345
+ score_threshold?: number;
346
+
347
+ /**
348
+ * Whether to rewrite the query
349
+ */
350
+ rewrite_query?: boolean;
351
+
352
+ /**
353
+ * Whether to return file metadata
354
+ */
355
+ return_metadata?: boolean;
356
+ }
357
+
358
+ /**
359
+ * Options for configuring vector store file searches.
360
+ */
361
+ export interface VectorStoreFileSearchOptions {
362
+ /**
363
+ * Minimum similarity score threshold
364
+ */
365
+ score_threshold?: number;
366
+
367
+ /**
368
+ * Whether to rewrite the query
369
+ */
370
+ rewrite_query?: boolean;
371
+
372
+ /**
373
+ * Whether to return file metadata
374
+ */
375
+ return_metadata?: boolean;
376
+
377
+ /**
378
+ * Whether to return matching text chunks
379
+ */
380
+ return_chunks?: boolean;
381
+
382
+ /**
383
+ * Number of chunks to return for each file
384
+ */
385
+ chunks_per_file?: number;
386
+ }
387
+
388
+ /**
389
+ * Response model for vector store deletion.
390
+ */
391
+ export interface VectorStoreDeleteResponse {
392
+ /**
393
+ * ID of the deleted vector store
394
+ */
395
+ id: string;
396
+
397
+ /**
398
+ * Whether the deletion was successful
399
+ */
400
+ deleted: boolean;
401
+
402
+ /**
403
+ * Type of the deleted object
404
+ */
405
+ object?: 'vector_store';
406
+ }
407
+
408
+ export type VectorStoreQuestionAnsweringResponse = unknown;
409
+
410
+ export interface VectorStoreSearchResponse {
411
+ /**
412
+ * The object type of the response
413
+ */
414
+ object?: 'list';
415
+
416
+ /**
417
+ * The list of scored vector store file chunks
418
+ */
419
+ data: Array<ScoredVectorStoreChunk>;
420
+ }
421
+
422
+ export interface VectorStoreCreateParams {
423
+ /**
424
+ * Name for the new vector store
425
+ */
426
+ name?: string | null;
427
+
428
+ /**
429
+ * Description of the vector store
430
+ */
431
+ description?: string | null;
432
+
433
+ /**
434
+ * Represents an expiration policy for a vector store.
435
+ */
436
+ expires_after?: ExpiresAfter | null;
437
+
438
+ /**
439
+ * Optional metadata key-value pairs
440
+ */
441
+ metadata?: unknown;
442
+
443
+ /**
444
+ * Optional list of file IDs
445
+ */
446
+ file_ids?: Array<string> | null;
447
+ }
448
+
449
+ export interface VectorStoreUpdateParams {
450
+ /**
451
+ * New name for the vector store
452
+ */
453
+ name?: string | null;
454
+
455
+ /**
456
+ * New description
457
+ */
458
+ description?: string | null;
459
+
460
+ /**
461
+ * Represents an expiration policy for a vector store.
462
+ */
463
+ expires_after?: ExpiresAfter | null;
464
+
465
+ /**
466
+ * Optional metadata key-value pairs
467
+ */
468
+ metadata?: unknown;
469
+ }
470
+
471
+ export interface VectorStoreListParams extends LimitOffsetParams {}
472
+
473
+ export interface VectorStoreQuestionAnsweringParams {
474
+ /**
475
+ * Question to answer. If not provided, the question will be extracted from the
476
+ * passed messages.
477
+ */
478
+ query?: string;
479
+
480
+ /**
481
+ * IDs of vector stores to search
482
+ */
483
+ vector_store_ids: Array<string>;
484
+
485
+ /**
486
+ * Number of results to return
487
+ */
488
+ top_k?: number;
489
+
490
+ /**
491
+ * Optional filter conditions
492
+ */
493
+ filters?:
494
+ | Shared.SearchFilter
495
+ | Shared.SearchFilterCondition
496
+ | Array<Shared.SearchFilter | Shared.SearchFilterCondition>
497
+ | null;
498
+
499
+ /**
500
+ * Search configuration options
501
+ */
502
+ search_options?: VectorStoreFileSearchOptions;
503
+
504
+ /**
505
+ * Whether to stream the answer
506
+ */
507
+ stream?: boolean;
508
+
509
+ /**
510
+ * Question answering configuration options
511
+ */
512
+ qa_options?: VectorStoreQuestionAnsweringParams.QaOptions;
513
+ }
514
+
515
+ export namespace VectorStoreQuestionAnsweringParams {
516
+ /**
517
+ * Question answering configuration options
518
+ */
519
+ export interface QaOptions {
520
+ /**
521
+ * Whether to use citations
522
+ */
523
+ cite?: boolean;
524
+ }
525
+ }
526
+
527
+ export interface VectorStoreSearchParams {
528
+ /**
529
+ * Search query text
530
+ */
531
+ query: string;
532
+
533
+ /**
534
+ * IDs of vector stores to search
535
+ */
536
+ vector_store_ids: Array<string>;
537
+
538
+ /**
539
+ * Number of results to return
540
+ */
541
+ top_k?: number;
542
+
543
+ /**
544
+ * Optional filter conditions
545
+ */
546
+ filters?:
547
+ | Shared.SearchFilter
548
+ | Shared.SearchFilterCondition
549
+ | Array<Shared.SearchFilter | Shared.SearchFilterCondition>
550
+ | null;
551
+
552
+ /**
553
+ * Search configuration options
554
+ */
555
+ search_options?: VectorStoreChunkSearchOptions;
556
+ }
557
+
558
+ VectorStores.VectorStoresLimitOffset = VectorStoresLimitOffset;
559
+ VectorStores.Files = Files;
560
+ VectorStores.VectorStoreFilesLimitOffset = VectorStoreFilesLimitOffset;
561
+
562
+ export declare namespace VectorStores {
563
+ export {
564
+ type ExpiresAfter as ExpiresAfter,
565
+ type FileCounts as FileCounts,
566
+ type ScoredVectorStoreChunk as ScoredVectorStoreChunk,
567
+ type VectorStore as VectorStore,
568
+ type VectorStoreChunkSearchOptions as VectorStoreChunkSearchOptions,
569
+ type VectorStoreFileSearchOptions as VectorStoreFileSearchOptions,
570
+ type VectorStoreDeleteResponse as VectorStoreDeleteResponse,
571
+ type VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse,
572
+ type VectorStoreSearchResponse as VectorStoreSearchResponse,
573
+ VectorStoresLimitOffset as VectorStoresLimitOffset,
574
+ type VectorStoreCreateParams as VectorStoreCreateParams,
575
+ type VectorStoreUpdateParams as VectorStoreUpdateParams,
576
+ type VectorStoreListParams as VectorStoreListParams,
577
+ type VectorStoreQuestionAnsweringParams as VectorStoreQuestionAnsweringParams,
578
+ type VectorStoreSearchParams as VectorStoreSearchParams,
579
+ };
580
+
581
+ export {
582
+ Files as Files,
583
+ type ScoredVectorStoreFile as ScoredVectorStoreFile,
584
+ type VectorStoreFile as VectorStoreFile,
585
+ type FileDeleteResponse as FileDeleteResponse,
586
+ type FileSearchResponse as FileSearchResponse,
587
+ VectorStoreFilesLimitOffset as VectorStoreFilesLimitOffset,
588
+ type FileCreateParams as FileCreateParams,
589
+ type FileListParams as FileListParams,
590
+ type FileSearchParams as FileSearchParams,
591
+ };
592
+ }
@@ -0,0 +1,50 @@
1
+ // @ts-ignore
2
+ import * as types from '../_shims/node-types';
3
+ import { setShims } from '../_shims/registry';
4
+ import { getRuntime } from '../_shims/node-runtime';
5
+ setShims(getRuntime());
6
+
7
+ declare module '../_shims/manual-types' {
8
+ export namespace manual {
9
+ // @ts-ignore
10
+ export type Agent = types.Agent;
11
+ // @ts-ignore
12
+ export import fetch = types.fetch;
13
+ // @ts-ignore
14
+ export type Request = types.Request;
15
+ // @ts-ignore
16
+ export type RequestInfo = types.RequestInfo;
17
+ // @ts-ignore
18
+ export type RequestInit = types.RequestInit;
19
+ // @ts-ignore
20
+ export type Response = types.Response;
21
+ // @ts-ignore
22
+ export type ResponseInit = types.ResponseInit;
23
+ // @ts-ignore
24
+ export type ResponseType = types.ResponseType;
25
+ // @ts-ignore
26
+ export type BodyInit = types.BodyInit;
27
+ // @ts-ignore
28
+ export type Headers = types.Headers;
29
+ // @ts-ignore
30
+ export type HeadersInit = types.HeadersInit;
31
+ // @ts-ignore
32
+ export type BlobPropertyBag = types.BlobPropertyBag;
33
+ // @ts-ignore
34
+ export type FilePropertyBag = types.FilePropertyBag;
35
+ // @ts-ignore
36
+ export type FileFromPathOptions = types.FileFromPathOptions;
37
+ // @ts-ignore
38
+ export import FormData = types.FormData;
39
+ // @ts-ignore
40
+ export import File = types.File;
41
+ // @ts-ignore
42
+ export import Blob = types.Blob;
43
+ // @ts-ignore
44
+ export type Readable = types.Readable;
45
+ // @ts-ignore
46
+ export type FsReadStream = types.FsReadStream;
47
+ // @ts-ignore
48
+ export import ReadableStream = types.ReadableStream;
49
+ }
50
+ }
@@ -0,0 +1,50 @@
1
+ // @ts-ignore
2
+ import * as types from '../_shims/web-types';
3
+ import { setShims } from '../_shims/registry';
4
+ import { getRuntime } from '../_shims/web-runtime';
5
+ setShims(getRuntime({ manuallyImported: true }));
6
+
7
+ declare module '../_shims/manual-types' {
8
+ export namespace manual {
9
+ // @ts-ignore
10
+ export type Agent = types.Agent;
11
+ // @ts-ignore
12
+ export import fetch = types.fetch;
13
+ // @ts-ignore
14
+ export type Request = types.Request;
15
+ // @ts-ignore
16
+ export type RequestInfo = types.RequestInfo;
17
+ // @ts-ignore
18
+ export type RequestInit = types.RequestInit;
19
+ // @ts-ignore
20
+ export type Response = types.Response;
21
+ // @ts-ignore
22
+ export type ResponseInit = types.ResponseInit;
23
+ // @ts-ignore
24
+ export type ResponseType = types.ResponseType;
25
+ // @ts-ignore
26
+ export type BodyInit = types.BodyInit;
27
+ // @ts-ignore
28
+ export type Headers = types.Headers;
29
+ // @ts-ignore
30
+ export type HeadersInit = types.HeadersInit;
31
+ // @ts-ignore
32
+ export type BlobPropertyBag = types.BlobPropertyBag;
33
+ // @ts-ignore
34
+ export type FilePropertyBag = types.FilePropertyBag;
35
+ // @ts-ignore
36
+ export type FileFromPathOptions = types.FileFromPathOptions;
37
+ // @ts-ignore
38
+ export import FormData = types.FormData;
39
+ // @ts-ignore
40
+ export import File = types.File;
41
+ // @ts-ignore
42
+ export import Blob = types.Blob;
43
+ // @ts-ignore
44
+ export type Readable = types.Readable;
45
+ // @ts-ignore
46
+ export type FsReadStream = types.FsReadStream;
47
+ // @ts-ignore
48
+ export import ReadableStream = types.ReadableStream;
49
+ }
50
+ }