@mixedbread/sdk 0.5.0 → 0.7.2

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 (228) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +12 -24
  3. package/bin/migration-config.json +105 -2
  4. package/client.d.mts +12 -28
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +12 -28
  7. package/client.d.ts.map +1 -1
  8. package/client.js +6 -22
  9. package/client.js.map +1 -1
  10. package/client.mjs +6 -22
  11. package/client.mjs.map +1 -1
  12. package/core/pagination.d.mts +1 -1
  13. package/core/pagination.d.mts.map +1 -1
  14. package/core/pagination.d.ts +1 -1
  15. package/core/pagination.d.ts.map +1 -1
  16. package/core/resource.d.mts +1 -1
  17. package/core/resource.d.mts.map +1 -1
  18. package/core/resource.d.ts +1 -1
  19. package/core/resource.d.ts.map +1 -1
  20. package/core/resource.js.map +1 -1
  21. package/core/resource.mjs.map +1 -1
  22. package/internal/detect-platform.js +3 -3
  23. package/internal/detect-platform.js.map +1 -1
  24. package/internal/detect-platform.mjs +3 -3
  25. package/internal/detect-platform.mjs.map +1 -1
  26. package/internal/headers.d.mts.map +1 -1
  27. package/internal/headers.d.ts.map +1 -1
  28. package/internal/headers.js +5 -5
  29. package/internal/headers.js.map +1 -1
  30. package/internal/headers.mjs +5 -5
  31. package/internal/headers.mjs.map +1 -1
  32. package/internal/shim-types.d.mts +11 -22
  33. package/internal/shim-types.d.mts.map +1 -0
  34. package/internal/shim-types.d.ts +11 -22
  35. package/internal/shim-types.d.ts.map +1 -0
  36. package/internal/shim-types.js +4 -0
  37. package/internal/shim-types.js.map +1 -0
  38. package/internal/shim-types.mjs +3 -0
  39. package/internal/shim-types.mjs.map +1 -0
  40. package/internal/shims.d.mts +2 -2
  41. package/internal/shims.d.mts.map +1 -1
  42. package/internal/shims.d.ts +2 -2
  43. package/internal/shims.d.ts.map +1 -1
  44. package/internal/uploads.js +1 -1
  45. package/internal/uploads.js.map +1 -1
  46. package/internal/uploads.mjs +1 -1
  47. package/internal/uploads.mjs.map +1 -1
  48. package/internal/utils/log.js +1 -1
  49. package/internal/utils/log.js.map +1 -1
  50. package/internal/utils/log.mjs +1 -1
  51. package/internal/utils/log.mjs.map +1 -1
  52. package/internal/utils/path.d.mts.map +1 -1
  53. package/internal/utils/path.d.ts.map +1 -1
  54. package/internal/utils/path.js.map +1 -1
  55. package/internal/utils/path.mjs +1 -1
  56. package/internal/utils/path.mjs.map +1 -1
  57. package/internal/utils/values.d.mts +2 -0
  58. package/internal/utils/values.d.mts.map +1 -1
  59. package/internal/utils/values.d.ts +2 -0
  60. package/internal/utils/values.d.ts.map +1 -1
  61. package/internal/utils/values.js +4 -1
  62. package/internal/utils/values.js.map +1 -1
  63. package/internal/utils/values.mjs +2 -0
  64. package/internal/utils/values.mjs.map +1 -1
  65. package/package.json +1 -7
  66. package/resources/api-keys.d.mts +171 -0
  67. package/resources/api-keys.d.mts.map +1 -0
  68. package/resources/api-keys.d.ts +171 -0
  69. package/resources/api-keys.d.ts.map +1 -0
  70. package/resources/api-keys.js +76 -0
  71. package/resources/api-keys.js.map +1 -0
  72. package/resources/api-keys.mjs +72 -0
  73. package/resources/api-keys.mjs.map +1 -0
  74. package/resources/data-sources/connectors.d.mts +203 -0
  75. package/resources/data-sources/connectors.d.mts.map +1 -0
  76. package/resources/data-sources/connectors.d.ts +203 -0
  77. package/resources/data-sources/connectors.d.ts.map +1 -0
  78. package/resources/data-sources/connectors.js +73 -0
  79. package/resources/data-sources/connectors.js.map +1 -0
  80. package/resources/data-sources/connectors.mjs +69 -0
  81. package/resources/data-sources/connectors.mjs.map +1 -0
  82. package/resources/data-sources/data-sources.d.mts +287 -0
  83. package/resources/data-sources/data-sources.d.mts.map +1 -0
  84. package/resources/data-sources/data-sources.d.ts +287 -0
  85. package/resources/data-sources/data-sources.d.ts.map +1 -0
  86. package/resources/data-sources/data-sources.js +66 -0
  87. package/resources/data-sources/data-sources.js.map +1 -0
  88. package/resources/data-sources/data-sources.mjs +61 -0
  89. package/resources/data-sources/data-sources.mjs.map +1 -0
  90. package/resources/data-sources/index.d.mts +3 -0
  91. package/resources/data-sources/index.d.mts.map +1 -0
  92. package/resources/data-sources/index.d.ts +3 -0
  93. package/resources/data-sources/index.d.ts.map +1 -0
  94. package/resources/data-sources/index.js +9 -0
  95. package/resources/data-sources/index.js.map +1 -0
  96. package/resources/data-sources/index.mjs +4 -0
  97. package/resources/data-sources/index.mjs.map +1 -0
  98. package/resources/data-sources.d.mts +2 -0
  99. package/resources/data-sources.d.mts.map +1 -0
  100. package/resources/data-sources.d.ts +2 -0
  101. package/resources/data-sources.d.ts.map +1 -0
  102. package/resources/data-sources.js +6 -0
  103. package/resources/data-sources.js.map +1 -0
  104. package/resources/data-sources.mjs +3 -0
  105. package/resources/data-sources.mjs.map +1 -0
  106. package/resources/embeddings.d.mts +7 -11
  107. package/resources/embeddings.d.mts.map +1 -1
  108. package/resources/embeddings.d.ts +7 -11
  109. package/resources/embeddings.d.ts.map +1 -1
  110. package/resources/embeddings.js +0 -9
  111. package/resources/embeddings.js.map +1 -1
  112. package/resources/embeddings.mjs +0 -9
  113. package/resources/embeddings.mjs.map +1 -1
  114. package/resources/extractions/content.d.mts +44 -42
  115. package/resources/extractions/content.d.mts.map +1 -1
  116. package/resources/extractions/content.d.ts +44 -42
  117. package/resources/extractions/content.d.ts.map +1 -1
  118. package/resources/extractions/extractions.d.mts +2 -2
  119. package/resources/extractions/extractions.d.mts.map +1 -1
  120. package/resources/extractions/extractions.d.ts +2 -2
  121. package/resources/extractions/extractions.d.ts.map +1 -1
  122. package/resources/extractions/extractions.js.map +1 -1
  123. package/resources/extractions/extractions.mjs.map +1 -1
  124. package/resources/extractions/index.d.mts +1 -1
  125. package/resources/extractions/index.d.mts.map +1 -1
  126. package/resources/extractions/index.d.ts +1 -1
  127. package/resources/extractions/index.d.ts.map +1 -1
  128. package/resources/extractions/index.js.map +1 -1
  129. package/resources/extractions/index.mjs +1 -1
  130. package/resources/extractions/index.mjs.map +1 -1
  131. package/resources/extractions/jobs.d.mts +2 -1
  132. package/resources/extractions/jobs.d.mts.map +1 -1
  133. package/resources/extractions/jobs.d.ts +2 -1
  134. package/resources/extractions/jobs.d.ts.map +1 -1
  135. package/resources/extractions/jobs.js.map +1 -1
  136. package/resources/extractions/jobs.mjs.map +1 -1
  137. package/resources/files.d.mts +18 -1
  138. package/resources/files.d.mts.map +1 -1
  139. package/resources/files.d.ts +18 -1
  140. package/resources/files.d.ts.map +1 -1
  141. package/resources/index.d.mts +5 -3
  142. package/resources/index.d.mts.map +1 -1
  143. package/resources/index.d.ts +5 -3
  144. package/resources/index.d.ts.map +1 -1
  145. package/resources/index.js +5 -1
  146. package/resources/index.js.map +1 -1
  147. package/resources/index.mjs +2 -0
  148. package/resources/index.mjs.map +1 -1
  149. package/resources/parsing/index.d.mts +1 -1
  150. package/resources/parsing/index.d.mts.map +1 -1
  151. package/resources/parsing/index.d.ts +1 -1
  152. package/resources/parsing/index.d.ts.map +1 -1
  153. package/resources/parsing/index.js.map +1 -1
  154. package/resources/parsing/index.mjs.map +1 -1
  155. package/resources/parsing/jobs.d.mts +24 -10
  156. package/resources/parsing/jobs.d.mts.map +1 -1
  157. package/resources/parsing/jobs.d.ts +24 -10
  158. package/resources/parsing/jobs.d.ts.map +1 -1
  159. package/resources/parsing/jobs.js.map +1 -1
  160. package/resources/parsing/jobs.mjs.map +1 -1
  161. package/resources/parsing/parsing.d.mts +2 -2
  162. package/resources/parsing/parsing.d.mts.map +1 -1
  163. package/resources/parsing/parsing.d.ts +2 -2
  164. package/resources/parsing/parsing.d.ts.map +1 -1
  165. package/resources/parsing/parsing.js.map +1 -1
  166. package/resources/parsing/parsing.mjs.map +1 -1
  167. package/resources/top-level.d.mts +5 -4
  168. package/resources/top-level.d.mts.map +1 -1
  169. package/resources/top-level.d.ts +5 -4
  170. package/resources/top-level.d.ts.map +1 -1
  171. package/resources/vector-stores/files.d.mts +79 -19
  172. package/resources/vector-stores/files.d.mts.map +1 -1
  173. package/resources/vector-stores/files.d.ts +79 -19
  174. package/resources/vector-stores/files.d.ts.map +1 -1
  175. package/resources/vector-stores/files.js +19 -18
  176. package/resources/vector-stores/files.js.map +1 -1
  177. package/resources/vector-stores/files.mjs +19 -18
  178. package/resources/vector-stores/files.mjs.map +1 -1
  179. package/resources/vector-stores/index.d.mts +1 -1
  180. package/resources/vector-stores/index.d.mts.map +1 -1
  181. package/resources/vector-stores/index.d.ts +1 -1
  182. package/resources/vector-stores/index.d.ts.map +1 -1
  183. package/resources/vector-stores/index.js.map +1 -1
  184. package/resources/vector-stores/index.mjs.map +1 -1
  185. package/resources/vector-stores/vector-stores.d.mts +275 -90
  186. package/resources/vector-stores/vector-stores.d.mts.map +1 -1
  187. package/resources/vector-stores/vector-stores.d.ts +275 -90
  188. package/resources/vector-stores/vector-stores.d.ts.map +1 -1
  189. package/resources/vector-stores/vector-stores.js +18 -15
  190. package/resources/vector-stores/vector-stores.js.map +1 -1
  191. package/resources/vector-stores/vector-stores.mjs +18 -15
  192. package/resources/vector-stores/vector-stores.mjs.map +1 -1
  193. package/src/client.ts +63 -30
  194. package/src/core/pagination.ts +1 -1
  195. package/src/core/resource.ts +1 -1
  196. package/src/internal/detect-platform.ts +3 -3
  197. package/src/internal/headers.ts +6 -6
  198. package/src/internal/shim-types.ts +26 -0
  199. package/src/internal/shims.ts +2 -2
  200. package/src/internal/uploads.ts +2 -2
  201. package/src/internal/utils/log.ts +1 -1
  202. package/src/internal/utils/path.ts +1 -1
  203. package/src/internal/utils/values.ts +3 -0
  204. package/src/resources/api-keys.ts +225 -0
  205. package/src/resources/data-sources/connectors.ts +290 -0
  206. package/src/resources/data-sources/data-sources.ts +404 -0
  207. package/src/resources/data-sources/index.ts +24 -0
  208. package/src/resources/data-sources.ts +3 -0
  209. package/src/resources/embeddings.ts +25 -19
  210. package/src/resources/extractions/content.ts +51 -43
  211. package/src/resources/extractions/extractions.ts +3 -1
  212. package/src/resources/extractions/index.ts +7 -1
  213. package/src/resources/extractions/jobs.ts +2 -1
  214. package/src/resources/files.ts +21 -0
  215. package/src/resources/index.ts +26 -4
  216. package/src/resources/parsing/index.ts +4 -0
  217. package/src/resources/parsing/jobs.ts +42 -44
  218. package/src/resources/parsing/parsing.ts +8 -0
  219. package/src/resources/top-level.ts +5 -44
  220. package/src/resources/vector-stores/files.ts +104 -28
  221. package/src/resources/vector-stores/index.ts +4 -3
  222. package/src/resources/vector-stores/vector-stores.ts +330 -102
  223. package/src/version.ts +1 -1
  224. package/version.d.mts +1 -1
  225. package/version.d.ts +1 -1
  226. package/version.js +1 -1
  227. package/version.mjs +1 -1
  228. package/src/internal/shim-types.d.ts +0 -28
@@ -13,15 +13,6 @@ export class Embeddings extends APIResource {
13
13
  * Args: params: The parameters for creating embeddings.
14
14
  *
15
15
  * Returns: EmbeddingCreateResponse: The response containing the embeddings.
16
- *
17
- * @example
18
- * ```ts
19
- * const embeddingCreateResponse =
20
- * await client.embeddings.create({
21
- * model: 'mixedbread-ai/mxbai-embed-large-v1',
22
- * input: 'x',
23
- * });
24
- * ```
25
16
  */
26
17
  create(
27
18
  body: EmbeddingCreateParams,
@@ -31,6 +22,25 @@ export class Embeddings extends APIResource {
31
22
  }
32
23
  }
33
24
 
25
+ /**
26
+ * Enumeration of encoding formats.
27
+ */
28
+ export type EncodingFormat = 'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8';
29
+
30
+ export type ObjectType =
31
+ | 'list'
32
+ | 'parsing_job'
33
+ | 'extraction_job'
34
+ | 'embedding'
35
+ | 'embedding_dict'
36
+ | 'rank_result'
37
+ | 'file'
38
+ | 'vector_store'
39
+ | 'vector_store.file'
40
+ | 'api_key'
41
+ | 'data_source'
42
+ | 'data_source.connector';
43
+
34
44
  export interface EmbeddingCreateParams {
35
45
  /**
36
46
  * The model to use for creating embeddings.
@@ -61,17 +71,13 @@ export interface EmbeddingCreateParams {
61
71
  * The encoding format(s) of the embeddings. Can be a single format or a list of
62
72
  * formats.
63
73
  */
64
- encoding_format?:
65
- | 'float'
66
- | 'float16'
67
- | 'base64'
68
- | 'binary'
69
- | 'ubinary'
70
- | 'int8'
71
- | 'uint8'
72
- | Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
74
+ encoding_format?: EncodingFormat | Array<EncodingFormat>;
73
75
  }
74
76
 
75
77
  export declare namespace Embeddings {
76
- export { type EmbeddingCreateParams as EmbeddingCreateParams };
78
+ export {
79
+ type EncodingFormat as EncodingFormat,
80
+ type ObjectType as ObjectType,
81
+ type EmbeddingCreateParams as EmbeddingCreateParams,
82
+ };
77
83
  }
@@ -26,70 +26,78 @@ export interface ExtractionResult {
26
26
  warnings: Array<string>;
27
27
  }
28
28
 
29
- export interface ContentCreateParams {
30
- /**
31
- * The content to extract from
32
- */
33
- content: string | Array<string> | Array<ContentCreateParams.TextInput | ContentCreateParams.ImageURLInput>;
34
-
29
+ /**
30
+ * Model for image input validation.
31
+ */
32
+ export interface ImageURLInput {
35
33
  /**
36
- * The JSON schema to use for extraction
34
+ * Input type identifier
37
35
  */
38
- json_schema: Record<string, unknown>;
36
+ type?: 'image_url';
39
37
 
40
38
  /**
41
- * Additional instructions for the extraction
39
+ * The image input specification.
42
40
  */
43
- instructions?: string | null;
41
+ image_url: ImageURLInput.ImageURL;
44
42
  }
45
43
 
46
- export namespace ContentCreateParams {
44
+ export namespace ImageURLInput {
47
45
  /**
48
- * Model for text input validation.
49
- *
50
- * Attributes: type: Input type identifier, always "text" text: The actual text
51
- * content, with length and whitespace constraints
46
+ * The image input specification.
52
47
  */
53
- export interface TextInput {
48
+ export interface ImageURL {
54
49
  /**
55
- * Input type identifier
50
+ * The image URL. Can be either a URL or a Data URI.
56
51
  */
57
- type?: 'text';
52
+ url: string;
58
53
 
59
54
  /**
60
- * Text content to process
55
+ * The image format/mimetype
61
56
  */
62
- text: string;
57
+ format?: string;
63
58
  }
59
+ }
64
60
 
61
+ /**
62
+ * Model for text input validation.
63
+ *
64
+ * Attributes: type: Input type identifier, always "text" text: The actual text
65
+ * content, with length and whitespace constraints
66
+ */
67
+ export interface TextInput {
65
68
  /**
66
- * Model for image input validation.
69
+ * Input type identifier
67
70
  */
68
- export interface ImageURLInput {
69
- /**
70
- * Input type identifier
71
- */
72
- type?: 'image_url';
71
+ type?: 'text';
73
72
 
74
- /**
75
- * The image input specification.
76
- */
77
- image_url: ImageURLInput.ImageURL;
78
- }
73
+ /**
74
+ * Text content to process
75
+ */
76
+ text: string;
77
+ }
79
78
 
80
- export namespace ImageURLInput {
81
- /**
82
- * The image input specification.
83
- */
84
- export interface ImageURL {
85
- /**
86
- * The image URL. Can be either a URL or a Data URI.
87
- */
88
- url: string;
89
- }
90
- }
79
+ export interface ContentCreateParams {
80
+ /**
81
+ * The content to extract from
82
+ */
83
+ content: string | Array<string> | Array<TextInput | ImageURLInput>;
84
+
85
+ /**
86
+ * The JSON schema to use for extraction
87
+ */
88
+ json_schema: Record<string, unknown>;
89
+
90
+ /**
91
+ * Additional instructions for the extraction
92
+ */
93
+ instructions?: string | null;
91
94
  }
92
95
 
93
96
  export declare namespace Content {
94
- export { type ExtractionResult as ExtractionResult, type ContentCreateParams as ContentCreateParams };
97
+ export {
98
+ type ExtractionResult as ExtractionResult,
99
+ type ImageURLInput as ImageURLInput,
100
+ type TextInput as TextInput,
101
+ type ContentCreateParams as ContentCreateParams,
102
+ };
95
103
  }
@@ -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,32 @@
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 {
14
+ DataSources,
15
+ type DataSource,
16
+ type DataSourceOauth2Params,
17
+ type DataSourceType,
18
+ type DataSourceDeleteResponse,
19
+ type DataSourceCreateParams,
20
+ type DataSourceUpdateParams,
21
+ type DataSourceListParams,
22
+ type DataSourcesLimitOffset,
23
+ } from './data-sources/data-sources';
24
+ export { Embeddings, type EncodingFormat, type ObjectType, type EmbeddingCreateParams } from './embeddings';
5
25
  export { Extractions } from './extractions/extractions';
6
26
  export {
7
27
  Files,
8
28
  type FileObject,
29
+ type PaginationWithTotal,
9
30
  type FileDeleteResponse,
10
31
  type FileCreateParams,
11
32
  type FileUpdateParams,
@@ -16,11 +37,12 @@ export { Parsing } from './parsing/parsing';
16
37
  export {
17
38
  VectorStores,
18
39
  type ExpiresAfter,
19
- type FileCounts,
20
- type ScoredVectorStoreChunk,
40
+ type ScoredAudioURLInputChunk,
41
+ type ScoredImageURLInputChunk,
42
+ type ScoredTextInputChunk,
43
+ type ScoredVideoURLInputChunk,
21
44
  type VectorStore,
22
45
  type VectorStoreChunkSearchOptions,
23
- type VectorStoreFileSearchOptions,
24
46
  type VectorStoreDeleteResponse,
25
47
  type VectorStoreQuestionAnsweringResponse,
26
48
  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
@@ -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,29 +411,17 @@ 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;
431
425
 
432
426
  /**
433
427
  * The strategy to use for OCR
@@ -439,7 +433,11 @@ export interface JobListParams extends LimitOffsetParams {}
439
433
 
440
434
  export declare namespace Jobs {
441
435
  export {
436
+ type ChunkingStrategy as ChunkingStrategy,
437
+ type ElementType as ElementType,
438
+ type ParsingJobStatus as ParsingJobStatus,
442
439
  type ParsingJob as ParsingJob,
440
+ type ReturnFormat as ReturnFormat,
443
441
  type JobListResponse as JobListResponse,
444
442
  type JobDeleteResponse as JobDeleteResponse,
445
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,19 +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
- | 'extraction_job'
45
- | 'embedding'
46
- | 'embedding_dict'
47
- | 'rank_result'
48
- | 'file'
49
- | 'vector_store'
50
- | 'vector_store.file'
51
- | 'api_key'
52
- | 'data_source'
53
- | 'data_source.connector';
42
+ object?: EmbeddingsAPI.ObjectType;
54
43
 
55
44
  /**
56
45
  * Whether the embeddings are normalized.
@@ -60,15 +49,7 @@ export interface EmbeddingCreateResponse {
60
49
  /**
61
50
  * The encoding formats of the embeddings.
62
51
  */
63
- encoding_format:
64
- | 'float'
65
- | 'float16'
66
- | 'base64'
67
- | 'binary'
68
- | 'ubinary'
69
- | 'int8'
70
- | 'uint8'
71
- | Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
52
+ encoding_format: EmbeddingsAPI.EncodingFormat | Array<EmbeddingsAPI.EncodingFormat>;
72
53
 
73
54
  /**
74
55
  * The number of dimensions used for the embeddings.
@@ -142,19 +123,7 @@ export interface RerankResponse {
142
123
  /**
143
124
  * The object type of the response
144
125
  */
145
- object?:
146
- | 'list'
147
- | 'parsing_job'
148
- | 'extraction_job'
149
- | 'embedding'
150
- | 'embedding_dict'
151
- | 'rank_result'
152
- | 'file'
153
- | 'vector_store'
154
- | 'vector_store.file'
155
- | 'api_key'
156
- | 'data_source'
157
- | 'data_source.connector';
126
+ object?: 'list';
158
127
 
159
128
  /**
160
129
  * The number of documents to return.
@@ -221,15 +190,7 @@ export interface EmbedParams {
221
190
  * The encoding format(s) of the embeddings. Can be a single format or a list of
222
191
  * formats.
223
192
  */
224
- encoding_format?:
225
- | 'float'
226
- | 'float16'
227
- | 'base64'
228
- | 'binary'
229
- | 'ubinary'
230
- | 'int8'
231
- | 'uint8'
232
- | Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
193
+ encoding_format?: EmbeddingsAPI.EncodingFormat | Array<EmbeddingsAPI.EncodingFormat>;
233
194
  }
234
195
 
235
196
  export interface RerankParams {