@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.
- package/CHANGELOG.md +83 -0
- package/README.md +12 -24
- package/bin/migration-config.json +105 -2
- package/client.d.mts +12 -28
- package/client.d.mts.map +1 -1
- package/client.d.ts +12 -28
- package/client.d.ts.map +1 -1
- package/client.js +6 -22
- package/client.js.map +1 -1
- package/client.mjs +6 -22
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +1 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +1 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/resource.d.mts +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/internal/detect-platform.js +3 -3
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs +3 -3
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js +5 -5
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +5 -5
- package/internal/headers.mjs.map +1 -1
- package/internal/shim-types.d.mts +11 -22
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +11 -22
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +2 -2
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +2 -2
- package/internal/shims.d.ts.map +1 -1
- package/internal/uploads.js +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/log.js +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.d.mts.map +1 -1
- package/internal/utils/path.d.ts.map +1 -1
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/values.d.mts +2 -0
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts +2 -0
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +4 -1
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +2 -0
- package/internal/utils/values.mjs.map +1 -1
- package/package.json +1 -7
- package/resources/api-keys.d.mts +171 -0
- package/resources/api-keys.d.mts.map +1 -0
- package/resources/api-keys.d.ts +171 -0
- package/resources/api-keys.d.ts.map +1 -0
- package/resources/api-keys.js +76 -0
- package/resources/api-keys.js.map +1 -0
- package/resources/api-keys.mjs +72 -0
- package/resources/api-keys.mjs.map +1 -0
- package/resources/data-sources/connectors.d.mts +203 -0
- package/resources/data-sources/connectors.d.mts.map +1 -0
- package/resources/data-sources/connectors.d.ts +203 -0
- package/resources/data-sources/connectors.d.ts.map +1 -0
- package/resources/data-sources/connectors.js +73 -0
- package/resources/data-sources/connectors.js.map +1 -0
- package/resources/data-sources/connectors.mjs +69 -0
- package/resources/data-sources/connectors.mjs.map +1 -0
- package/resources/data-sources/data-sources.d.mts +287 -0
- package/resources/data-sources/data-sources.d.mts.map +1 -0
- package/resources/data-sources/data-sources.d.ts +287 -0
- package/resources/data-sources/data-sources.d.ts.map +1 -0
- package/resources/data-sources/data-sources.js +66 -0
- package/resources/data-sources/data-sources.js.map +1 -0
- package/resources/data-sources/data-sources.mjs +61 -0
- package/resources/data-sources/data-sources.mjs.map +1 -0
- package/resources/data-sources/index.d.mts +3 -0
- package/resources/data-sources/index.d.mts.map +1 -0
- package/resources/data-sources/index.d.ts +3 -0
- package/resources/data-sources/index.d.ts.map +1 -0
- package/resources/data-sources/index.js +9 -0
- package/resources/data-sources/index.js.map +1 -0
- package/resources/data-sources/index.mjs +4 -0
- package/resources/data-sources/index.mjs.map +1 -0
- package/resources/data-sources.d.mts +2 -0
- package/resources/data-sources.d.mts.map +1 -0
- package/resources/data-sources.d.ts +2 -0
- package/resources/data-sources.d.ts.map +1 -0
- package/resources/data-sources.js +6 -0
- package/resources/data-sources.js.map +1 -0
- package/resources/data-sources.mjs +3 -0
- package/resources/data-sources.mjs.map +1 -0
- package/resources/embeddings.d.mts +7 -11
- package/resources/embeddings.d.mts.map +1 -1
- package/resources/embeddings.d.ts +7 -11
- package/resources/embeddings.d.ts.map +1 -1
- package/resources/embeddings.js +0 -9
- package/resources/embeddings.js.map +1 -1
- package/resources/embeddings.mjs +0 -9
- package/resources/embeddings.mjs.map +1 -1
- package/resources/extractions/content.d.mts +44 -42
- package/resources/extractions/content.d.mts.map +1 -1
- package/resources/extractions/content.d.ts +44 -42
- package/resources/extractions/content.d.ts.map +1 -1
- package/resources/extractions/extractions.d.mts +2 -2
- package/resources/extractions/extractions.d.mts.map +1 -1
- package/resources/extractions/extractions.d.ts +2 -2
- package/resources/extractions/extractions.d.ts.map +1 -1
- package/resources/extractions/extractions.js.map +1 -1
- package/resources/extractions/extractions.mjs.map +1 -1
- package/resources/extractions/index.d.mts +1 -1
- package/resources/extractions/index.d.mts.map +1 -1
- package/resources/extractions/index.d.ts +1 -1
- package/resources/extractions/index.d.ts.map +1 -1
- package/resources/extractions/index.js.map +1 -1
- package/resources/extractions/index.mjs +1 -1
- package/resources/extractions/index.mjs.map +1 -1
- package/resources/extractions/jobs.d.mts +2 -1
- package/resources/extractions/jobs.d.mts.map +1 -1
- package/resources/extractions/jobs.d.ts +2 -1
- package/resources/extractions/jobs.d.ts.map +1 -1
- package/resources/extractions/jobs.js.map +1 -1
- package/resources/extractions/jobs.mjs.map +1 -1
- package/resources/files.d.mts +18 -1
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +18 -1
- package/resources/files.d.ts.map +1 -1
- package/resources/index.d.mts +5 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/parsing/index.d.mts +1 -1
- package/resources/parsing/index.d.mts.map +1 -1
- package/resources/parsing/index.d.ts +1 -1
- package/resources/parsing/index.d.ts.map +1 -1
- package/resources/parsing/index.js.map +1 -1
- package/resources/parsing/index.mjs.map +1 -1
- package/resources/parsing/jobs.d.mts +24 -10
- package/resources/parsing/jobs.d.mts.map +1 -1
- package/resources/parsing/jobs.d.ts +24 -10
- package/resources/parsing/jobs.d.ts.map +1 -1
- package/resources/parsing/jobs.js.map +1 -1
- package/resources/parsing/jobs.mjs.map +1 -1
- package/resources/parsing/parsing.d.mts +2 -2
- package/resources/parsing/parsing.d.mts.map +1 -1
- package/resources/parsing/parsing.d.ts +2 -2
- package/resources/parsing/parsing.d.ts.map +1 -1
- package/resources/parsing/parsing.js.map +1 -1
- package/resources/parsing/parsing.mjs.map +1 -1
- package/resources/top-level.d.mts +5 -4
- package/resources/top-level.d.mts.map +1 -1
- package/resources/top-level.d.ts +5 -4
- package/resources/top-level.d.ts.map +1 -1
- package/resources/vector-stores/files.d.mts +79 -19
- package/resources/vector-stores/files.d.mts.map +1 -1
- package/resources/vector-stores/files.d.ts +79 -19
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +19 -18
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs +19 -18
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/vector-stores/index.d.mts +1 -1
- package/resources/vector-stores/index.d.mts.map +1 -1
- package/resources/vector-stores/index.d.ts +1 -1
- package/resources/vector-stores/index.d.ts.map +1 -1
- package/resources/vector-stores/index.js.map +1 -1
- package/resources/vector-stores/index.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.mts +275 -90
- package/resources/vector-stores/vector-stores.d.mts.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +275 -90
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js +18 -15
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs +18 -15
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/src/client.ts +63 -30
- package/src/core/pagination.ts +1 -1
- package/src/core/resource.ts +1 -1
- package/src/internal/detect-platform.ts +3 -3
- package/src/internal/headers.ts +6 -6
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +2 -2
- package/src/internal/uploads.ts +2 -2
- package/src/internal/utils/log.ts +1 -1
- package/src/internal/utils/path.ts +1 -1
- package/src/internal/utils/values.ts +3 -0
- package/src/resources/api-keys.ts +225 -0
- package/src/resources/data-sources/connectors.ts +290 -0
- package/src/resources/data-sources/data-sources.ts +404 -0
- package/src/resources/data-sources/index.ts +24 -0
- package/src/resources/data-sources.ts +3 -0
- package/src/resources/embeddings.ts +25 -19
- package/src/resources/extractions/content.ts +51 -43
- package/src/resources/extractions/extractions.ts +3 -1
- package/src/resources/extractions/index.ts +7 -1
- package/src/resources/extractions/jobs.ts +2 -1
- package/src/resources/files.ts +21 -0
- package/src/resources/index.ts +26 -4
- package/src/resources/parsing/index.ts +4 -0
- package/src/resources/parsing/jobs.ts +42 -44
- package/src/resources/parsing/parsing.ts +8 -0
- package/src/resources/top-level.ts +5 -44
- package/src/resources/vector-stores/files.ts +104 -28
- package/src/resources/vector-stores/index.ts +4 -3
- package/src/resources/vector-stores/vector-stores.ts +330 -102
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- 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 {
|
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
|
-
|
30
|
-
|
31
|
-
|
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
|
-
*
|
34
|
+
* Input type identifier
|
37
35
|
*/
|
38
|
-
|
36
|
+
type?: 'image_url';
|
39
37
|
|
40
38
|
/**
|
41
|
-
*
|
39
|
+
* The image input specification.
|
42
40
|
*/
|
43
|
-
|
41
|
+
image_url: ImageURLInput.ImageURL;
|
44
42
|
}
|
45
43
|
|
46
|
-
export namespace
|
44
|
+
export namespace ImageURLInput {
|
47
45
|
/**
|
48
|
-
*
|
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
|
48
|
+
export interface ImageURL {
|
54
49
|
/**
|
55
|
-
*
|
50
|
+
* The image URL. Can be either a URL or a Data URI.
|
56
51
|
*/
|
57
|
-
|
52
|
+
url: string;
|
58
53
|
|
59
54
|
/**
|
60
|
-
*
|
55
|
+
* The image format/mimetype
|
61
56
|
*/
|
62
|
-
|
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
|
-
*
|
69
|
+
* Input type identifier
|
67
70
|
*/
|
68
|
-
|
69
|
-
/**
|
70
|
-
* Input type identifier
|
71
|
-
*/
|
72
|
-
type?: 'image_url';
|
71
|
+
type?: 'text';
|
73
72
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
73
|
+
/**
|
74
|
+
* Text content to process
|
75
|
+
*/
|
76
|
+
text: string;
|
77
|
+
}
|
79
78
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
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 {
|
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 {
|
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:
|
76
|
+
status: ParsingJobsAPI.ParsingJobStatus;
|
76
77
|
|
77
78
|
/**
|
78
79
|
* The result of an extraction job.
|
package/src/resources/files.ts
CHANGED
@@ -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,
|
package/src/resources/index.ts
CHANGED
@@ -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 {
|
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
|
20
|
-
type
|
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,
|
@@ -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:
|
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:
|
252
|
+
chunking_strategy: JobsAPI.ChunkingStrategy;
|
229
253
|
|
230
254
|
/**
|
231
255
|
* The format of the returned content
|
232
256
|
*/
|
233
|
-
return_format:
|
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:
|
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?:
|
419
|
+
chunking_strategy?: ChunkingStrategy;
|
426
420
|
|
427
421
|
/**
|
428
422
|
* The format of the returned content
|
429
423
|
*/
|
430
|
-
return_format?:
|
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 {
|