@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.
- package/CHANGELOG.md +230 -0
- package/LICENSE +201 -0
- package/README.md +360 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +241 -0
- package/core.d.ts.map +1 -0
- package/core.js +915 -0
- package/core.js.map +1 -0
- package/core.mjs +883 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +47 -0
- package/error.d.ts.map +1 -0
- package/error.js +113 -0
- package/error.js.map +1 -0
- package/error.mjs +97 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +169 -0
- package/index.d.ts +169 -0
- package/index.d.ts.map +1 -0
- package/index.js +175 -0
- package/index.js.map +1 -0
- package/index.mjs +132 -0
- package/index.mjs.map +1 -0
- package/lib/polling.d.ts +48 -0
- package/lib/polling.d.ts.map +1 -0
- package/lib/polling.js +75 -0
- package/lib/polling.js.map +1 -0
- package/lib/polling.mjs +71 -0
- package/lib/polling.mjs.map +1 -0
- package/package.json +124 -0
- package/pagination.d.ts +30 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +45 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +41 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/embeddings.d.ts +177 -0
- package/resources/embeddings.d.ts.map +1 -0
- package/resources/embeddings.js +20 -0
- package/resources/embeddings.js.map +1 -0
- package/resources/embeddings.mjs +16 -0
- package/resources/embeddings.mjs.map +1 -0
- package/resources/extractions/content.d.ts +33 -0
- package/resources/extractions/content.d.ts.map +1 -0
- package/resources/extractions/content.js +19 -0
- package/resources/extractions/content.js.map +1 -0
- package/resources/extractions/content.mjs +15 -0
- package/resources/extractions/content.mjs.map +1 -0
- package/resources/extractions/extractions.d.ts +18 -0
- package/resources/extractions/extractions.d.ts.map +1 -0
- package/resources/extractions/extractions.js +47 -0
- package/resources/extractions/extractions.js.map +1 -0
- package/resources/extractions/extractions.mjs +20 -0
- package/resources/extractions/extractions.mjs.map +1 -0
- package/resources/extractions/index.d.ts +5 -0
- package/resources/extractions/index.d.ts.map +1 -0
- package/resources/extractions/index.js +13 -0
- package/resources/extractions/index.js.map +1 -0
- package/resources/extractions/index.mjs +6 -0
- package/resources/extractions/index.mjs.map +1 -0
- package/resources/extractions/jobs.d.ts +84 -0
- package/resources/extractions/jobs.d.ts.map +1 -0
- package/resources/extractions/jobs.js +29 -0
- package/resources/extractions/jobs.js.map +1 -0
- package/resources/extractions/jobs.mjs +25 -0
- package/resources/extractions/jobs.mjs.map +1 -0
- package/resources/extractions/schema.d.ts +85 -0
- package/resources/extractions/schema.d.ts.map +1 -0
- package/resources/extractions/schema.js +39 -0
- package/resources/extractions/schema.js.map +1 -0
- package/resources/extractions/schema.mjs +35 -0
- package/resources/extractions/schema.mjs.map +1 -0
- package/resources/files.d.ts +125 -0
- package/resources/files.d.ts.map +1 -0
- package/resources/files.js +99 -0
- package/resources/files.js.map +1 -0
- package/resources/files.mjs +71 -0
- package/resources/files.mjs.map +1 -0
- package/resources/index.d.ts +8 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +32 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +8 -0
- package/resources/index.mjs.map +1 -0
- package/resources/parsing/index.d.ts +3 -0
- package/resources/parsing/index.d.ts.map +1 -0
- package/resources/parsing/index.js +10 -0
- package/resources/parsing/index.js.map +1 -0
- package/resources/parsing/index.mjs +4 -0
- package/resources/parsing/index.mjs.map +1 -0
- package/resources/parsing/jobs.d.ts +290 -0
- package/resources/parsing/jobs.d.ts.map +1 -0
- package/resources/parsing/jobs.js +147 -0
- package/resources/parsing/jobs.js.map +1 -0
- package/resources/parsing/jobs.mjs +119 -0
- package/resources/parsing/jobs.mjs.map +1 -0
- package/resources/parsing/parsing.d.ts +10 -0
- package/resources/parsing/parsing.d.ts.map +1 -0
- package/resources/parsing/parsing.js +40 -0
- package/resources/parsing/parsing.js.map +1 -0
- package/resources/parsing/parsing.mjs +13 -0
- package/resources/parsing/parsing.mjs.map +1 -0
- package/resources/shared.d.ts +35 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/top-level.d.ts +165 -0
- package/resources/top-level.d.ts.map +1 -0
- package/resources/top-level.js +4 -0
- package/resources/top-level.js.map +1 -0
- package/resources/top-level.mjs +3 -0
- package/resources/top-level.mjs.map +1 -0
- package/resources/vector-stores/files.d.ts +284 -0
- package/resources/vector-stores/files.d.ts.map +1 -0
- package/resources/vector-stores/files.js +167 -0
- package/resources/vector-stores/files.js.map +1 -0
- package/resources/vector-stores/files.mjs +139 -0
- package/resources/vector-stores/files.mjs.map +1 -0
- package/resources/vector-stores/index.d.ts +3 -0
- package/resources/vector-stores/index.d.ts.map +1 -0
- package/resources/vector-stores/index.js +11 -0
- package/resources/vector-stores/index.js.map +1 -0
- package/resources/vector-stores/index.mjs +4 -0
- package/resources/vector-stores/index.mjs.map +1 -0
- package/resources/vector-stores/vector-stores.d.ts +425 -0
- package/resources/vector-stores/vector-stores.d.ts.map +1 -0
- package/resources/vector-stores/vector-stores.js +121 -0
- package/resources/vector-stores/vector-stores.js.map +1 -0
- package/resources/vector-stores/vector-stores.mjs +93 -0
- package/resources/vector-stores/vector-stores.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1208 -0
- package/src/error.ts +130 -0
- package/src/index.ts +346 -0
- package/src/lib/.keep +4 -0
- package/src/lib/polling.ts +115 -0
- package/src/pagination.ts +82 -0
- package/src/resource.ts +11 -0
- package/src/resources/embeddings.ts +248 -0
- package/src/resources/extractions/content.ts +42 -0
- package/src/resources/extractions/extractions.ts +47 -0
- package/src/resources/extractions/index.ts +14 -0
- package/src/resources/extractions/jobs.ts +105 -0
- package/src/resources/extractions/schema.ts +111 -0
- package/src/resources/files.ts +181 -0
- package/src/resources/index.ts +39 -0
- package/src/resources/parsing/index.ts +12 -0
- package/src/resources/parsing/jobs.ts +453 -0
- package/src/resources/parsing/parsing.ts +32 -0
- package/src/resources/shared.ts +41 -0
- package/src/resources/top-level.ts +231 -0
- package/src/resources/vector-stores/files.ts +439 -0
- package/src/resources/vector-stores/index.ts +31 -0
- package/src/resources/vector-stores/vector-stores.ts +592 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +255 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
@@ -0,0 +1,248 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
import { APIResource } from '../resource';
|
4
|
+
import * as Core from '../core';
|
5
|
+
|
6
|
+
export class Embeddings extends APIResource {
|
7
|
+
/**
|
8
|
+
* Create embeddings for text or images using the specified model, encoding format,
|
9
|
+
* and normalization.
|
10
|
+
*
|
11
|
+
* Args: params: The parameters for creating embeddings.
|
12
|
+
*
|
13
|
+
* Returns: EmbeddingCreateResponse: The response containing the embeddings.
|
14
|
+
*/
|
15
|
+
create(
|
16
|
+
body: EmbeddingCreateParams,
|
17
|
+
options?: Core.RequestOptions,
|
18
|
+
): Core.APIPromise<EmbeddingCreateResponse> {
|
19
|
+
return this._client.post('/v1/embeddings', { body, ...options });
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
export interface Embedding {
|
24
|
+
/**
|
25
|
+
* The encoded embedding.
|
26
|
+
*/
|
27
|
+
embedding: Array<number> | Array<number> | string;
|
28
|
+
|
29
|
+
/**
|
30
|
+
* The index of the embedding.
|
31
|
+
*/
|
32
|
+
index: number;
|
33
|
+
|
34
|
+
/**
|
35
|
+
* The object type of the embedding.
|
36
|
+
*/
|
37
|
+
object: 'embedding';
|
38
|
+
}
|
39
|
+
|
40
|
+
export interface EmbeddingCreateResponse {
|
41
|
+
/**
|
42
|
+
* The usage of the model
|
43
|
+
*/
|
44
|
+
usage: EmbeddingCreateResponse.Usage;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* The model used
|
48
|
+
*/
|
49
|
+
model: string;
|
50
|
+
|
51
|
+
/**
|
52
|
+
* The created embeddings.
|
53
|
+
*/
|
54
|
+
data: Array<Embedding> | Array<EmbeddingCreateResponse.UnionMember1>;
|
55
|
+
|
56
|
+
/**
|
57
|
+
* The object type of the response
|
58
|
+
*/
|
59
|
+
object?:
|
60
|
+
| 'list'
|
61
|
+
| 'parsing_job'
|
62
|
+
| 'job'
|
63
|
+
| 'embedding'
|
64
|
+
| 'embedding_dict'
|
65
|
+
| 'text_document'
|
66
|
+
| 'file'
|
67
|
+
| 'vector_store'
|
68
|
+
| 'vector_store.file'
|
69
|
+
| 'api_key';
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Whether the embeddings are normalized.
|
73
|
+
*/
|
74
|
+
normalized: boolean;
|
75
|
+
|
76
|
+
/**
|
77
|
+
* The encoding format of the embeddings.
|
78
|
+
*/
|
79
|
+
encoding_format:
|
80
|
+
| 'float'
|
81
|
+
| 'float16'
|
82
|
+
| 'base64'
|
83
|
+
| 'binary'
|
84
|
+
| 'ubinary'
|
85
|
+
| 'int8'
|
86
|
+
| 'uint8'
|
87
|
+
| Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
|
88
|
+
|
89
|
+
/**
|
90
|
+
* The number of dimensions used for the embeddings.
|
91
|
+
*/
|
92
|
+
dimensions: number | null;
|
93
|
+
}
|
94
|
+
|
95
|
+
export namespace EmbeddingCreateResponse {
|
96
|
+
/**
|
97
|
+
* The usage of the model
|
98
|
+
*/
|
99
|
+
export interface Usage {
|
100
|
+
/**
|
101
|
+
* The number of tokens used for the prompt
|
102
|
+
*/
|
103
|
+
prompt_tokens: number;
|
104
|
+
|
105
|
+
/**
|
106
|
+
* The total number of tokens used
|
107
|
+
*/
|
108
|
+
total_tokens: number;
|
109
|
+
|
110
|
+
/**
|
111
|
+
* The number of tokens used for the completion
|
112
|
+
*/
|
113
|
+
completion_tokens?: number | null;
|
114
|
+
}
|
115
|
+
|
116
|
+
export interface UnionMember1 {
|
117
|
+
/**
|
118
|
+
* The encoded embedding data by encoding format.Returned, if more than one
|
119
|
+
* encoding format is used.
|
120
|
+
*/
|
121
|
+
embedding: UnionMember1.Embedding;
|
122
|
+
|
123
|
+
/**
|
124
|
+
* The index of the embedding.
|
125
|
+
*/
|
126
|
+
index: number;
|
127
|
+
|
128
|
+
/**
|
129
|
+
* The object type of the embedding.
|
130
|
+
*/
|
131
|
+
object: 'embedding_dict';
|
132
|
+
}
|
133
|
+
|
134
|
+
export namespace UnionMember1 {
|
135
|
+
/**
|
136
|
+
* The encoded embedding data by encoding format.Returned, if more than one
|
137
|
+
* encoding format is used.
|
138
|
+
*/
|
139
|
+
export interface Embedding {
|
140
|
+
float?: Array<number>;
|
141
|
+
|
142
|
+
int8?: Array<number>;
|
143
|
+
|
144
|
+
uint8?: Array<number>;
|
145
|
+
|
146
|
+
binary?: Array<number>;
|
147
|
+
|
148
|
+
ubinary?: Array<number>;
|
149
|
+
|
150
|
+
base64?: Array<string>;
|
151
|
+
}
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
export interface EmbeddingCreateParams {
|
156
|
+
/**
|
157
|
+
* The model to use for creating embeddings.
|
158
|
+
*/
|
159
|
+
model: string;
|
160
|
+
|
161
|
+
/**
|
162
|
+
* The input to create embeddings for.
|
163
|
+
*/
|
164
|
+
input: string | EmbeddingCreateParams.ImageURLInput | EmbeddingCreateParams.TextInput;
|
165
|
+
|
166
|
+
/**
|
167
|
+
* The number of dimensions to use for the embeddings.
|
168
|
+
*/
|
169
|
+
dimensions?: number | null;
|
170
|
+
|
171
|
+
/**
|
172
|
+
* The prompt to use for the embedding creation.
|
173
|
+
*/
|
174
|
+
prompt?: string | null;
|
175
|
+
|
176
|
+
/**
|
177
|
+
* Whether to normalize the embeddings.
|
178
|
+
*/
|
179
|
+
normalized?: boolean;
|
180
|
+
|
181
|
+
/**
|
182
|
+
* The encoding format of the embeddings.
|
183
|
+
*/
|
184
|
+
encoding_format?:
|
185
|
+
| 'float'
|
186
|
+
| 'float16'
|
187
|
+
| 'base64'
|
188
|
+
| 'binary'
|
189
|
+
| 'ubinary'
|
190
|
+
| 'int8'
|
191
|
+
| 'uint8'
|
192
|
+
| Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
|
193
|
+
}
|
194
|
+
|
195
|
+
export namespace EmbeddingCreateParams {
|
196
|
+
/**
|
197
|
+
* Model for image input validation.
|
198
|
+
*/
|
199
|
+
export interface ImageURLInput {
|
200
|
+
/**
|
201
|
+
* Input type identifier
|
202
|
+
*/
|
203
|
+
type?: 'image_url';
|
204
|
+
|
205
|
+
/**
|
206
|
+
* The image input specification.
|
207
|
+
*/
|
208
|
+
image: ImageURLInput.Image;
|
209
|
+
}
|
210
|
+
|
211
|
+
export namespace ImageURLInput {
|
212
|
+
/**
|
213
|
+
* The image input specification.
|
214
|
+
*/
|
215
|
+
export interface Image {
|
216
|
+
/**
|
217
|
+
* The image URL. Can be either a URL or a Data URI.
|
218
|
+
*/
|
219
|
+
url: string;
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
223
|
+
/**
|
224
|
+
* Model for text input validation.
|
225
|
+
*
|
226
|
+
* Attributes: type: Input type identifier, always "text" text: The actual text
|
227
|
+
* content, with length and whitespace constraints
|
228
|
+
*/
|
229
|
+
export interface TextInput {
|
230
|
+
/**
|
231
|
+
* Input type identifier
|
232
|
+
*/
|
233
|
+
type?: 'text';
|
234
|
+
|
235
|
+
/**
|
236
|
+
* Text content to process
|
237
|
+
*/
|
238
|
+
text: string;
|
239
|
+
}
|
240
|
+
}
|
241
|
+
|
242
|
+
export declare namespace Embeddings {
|
243
|
+
export {
|
244
|
+
type Embedding as Embedding,
|
245
|
+
type EmbeddingCreateResponse as EmbeddingCreateResponse,
|
246
|
+
type EmbeddingCreateParams as EmbeddingCreateParams,
|
247
|
+
};
|
248
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
import { APIResource } from '../../resource';
|
4
|
+
import * as Core from '../../core';
|
5
|
+
|
6
|
+
export class Content extends APIResource {
|
7
|
+
/**
|
8
|
+
* Extract content from a string using the provided schema.
|
9
|
+
*
|
10
|
+
* Args: params: The parameters for extracting content from a string.
|
11
|
+
*
|
12
|
+
* Returns: The extracted content.
|
13
|
+
*/
|
14
|
+
create(body: ContentCreateParams, options?: Core.RequestOptions): Core.APIPromise<ExtractionResult> {
|
15
|
+
return this._client.post('/v1/extractions/content', { body, ...options });
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
/**
|
20
|
+
* The result of an extraction job.
|
21
|
+
*/
|
22
|
+
export interface ExtractionResult {
|
23
|
+
data: unknown;
|
24
|
+
|
25
|
+
warnings: Array<string>;
|
26
|
+
}
|
27
|
+
|
28
|
+
export interface ContentCreateParams {
|
29
|
+
/**
|
30
|
+
* The content to extract from
|
31
|
+
*/
|
32
|
+
content: string;
|
33
|
+
|
34
|
+
/**
|
35
|
+
* The JSON schema to use for extraction
|
36
|
+
*/
|
37
|
+
json_schema: unknown;
|
38
|
+
}
|
39
|
+
|
40
|
+
export declare namespace Content {
|
41
|
+
export { type ExtractionResult as ExtractionResult, type ContentCreateParams as ContentCreateParams };
|
42
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
import { APIResource } from '../../resource';
|
4
|
+
import * as ContentAPI from './content';
|
5
|
+
import { Content, ContentCreateParams, ExtractionResult } from './content';
|
6
|
+
import * as JobsAPI from './jobs';
|
7
|
+
import { ExtractionJob, JobCreateParams, Jobs } from './jobs';
|
8
|
+
import * as SchemaAPI from './schema';
|
9
|
+
import {
|
10
|
+
CreatedJsonSchema,
|
11
|
+
EnhancedJsonSchema,
|
12
|
+
Schema,
|
13
|
+
SchemaCreateParams,
|
14
|
+
SchemaEnhanceParams,
|
15
|
+
SchemaValidateParams,
|
16
|
+
ValidatedJsonSchema,
|
17
|
+
} from './schema';
|
18
|
+
|
19
|
+
export class Extractions extends APIResource {
|
20
|
+
jobs: JobsAPI.Jobs = new JobsAPI.Jobs(this._client);
|
21
|
+
schema: SchemaAPI.Schema = new SchemaAPI.Schema(this._client);
|
22
|
+
content: ContentAPI.Content = new ContentAPI.Content(this._client);
|
23
|
+
}
|
24
|
+
|
25
|
+
Extractions.Jobs = Jobs;
|
26
|
+
Extractions.Schema = Schema;
|
27
|
+
Extractions.Content = Content;
|
28
|
+
|
29
|
+
export declare namespace Extractions {
|
30
|
+
export { Jobs as Jobs, type ExtractionJob as ExtractionJob, type JobCreateParams as JobCreateParams };
|
31
|
+
|
32
|
+
export {
|
33
|
+
Schema as Schema,
|
34
|
+
type CreatedJsonSchema as CreatedJsonSchema,
|
35
|
+
type EnhancedJsonSchema as EnhancedJsonSchema,
|
36
|
+
type ValidatedJsonSchema as ValidatedJsonSchema,
|
37
|
+
type SchemaCreateParams as SchemaCreateParams,
|
38
|
+
type SchemaEnhanceParams as SchemaEnhanceParams,
|
39
|
+
type SchemaValidateParams as SchemaValidateParams,
|
40
|
+
};
|
41
|
+
|
42
|
+
export {
|
43
|
+
Content as Content,
|
44
|
+
type ExtractionResult as ExtractionResult,
|
45
|
+
type ContentCreateParams as ContentCreateParams,
|
46
|
+
};
|
47
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
export { Content, type ExtractionResult, type ContentCreateParams } from './content';
|
4
|
+
export { Extractions } from './extractions';
|
5
|
+
export { Jobs, type ExtractionJob, type JobCreateParams } from './jobs';
|
6
|
+
export {
|
7
|
+
Schema,
|
8
|
+
type CreatedJsonSchema,
|
9
|
+
type EnhancedJsonSchema,
|
10
|
+
type ValidatedJsonSchema,
|
11
|
+
type SchemaCreateParams,
|
12
|
+
type SchemaEnhanceParams,
|
13
|
+
type SchemaValidateParams,
|
14
|
+
} from './schema';
|
@@ -0,0 +1,105 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
import { APIResource } from '../../resource';
|
4
|
+
import * as Core from '../../core';
|
5
|
+
import * as ContentAPI from './content';
|
6
|
+
|
7
|
+
export class Jobs extends APIResource {
|
8
|
+
/**
|
9
|
+
* Start an extraction job for the provided file and schema.
|
10
|
+
*
|
11
|
+
* Args: params: The parameters for creating an extraction job.
|
12
|
+
*
|
13
|
+
* Returns: The created extraction job.
|
14
|
+
*/
|
15
|
+
create(body: JobCreateParams, options?: Core.RequestOptions): Core.APIPromise<ExtractionJob> {
|
16
|
+
return this._client.post('/v1/extractions/jobs', { body, ...options });
|
17
|
+
}
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Get detailed information about a specific extraction job.
|
21
|
+
*
|
22
|
+
* Args: job_id: The ID of the extraction job.
|
23
|
+
*
|
24
|
+
* Returns: Detailed information about the extraction job.
|
25
|
+
*/
|
26
|
+
retrieve(jobId: string, options?: Core.RequestOptions): Core.APIPromise<ExtractionJob> {
|
27
|
+
return this._client.get(`/v1/extractions/jobs/${jobId}`, options);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
/**
|
32
|
+
* A job for extracting structured data from documents.
|
33
|
+
*/
|
34
|
+
export interface ExtractionJob {
|
35
|
+
/**
|
36
|
+
* Unique identifier for the extraction job
|
37
|
+
*/
|
38
|
+
id: string;
|
39
|
+
|
40
|
+
/**
|
41
|
+
* ID of the organization that owns this job
|
42
|
+
*/
|
43
|
+
organization_id: string;
|
44
|
+
|
45
|
+
/**
|
46
|
+
* ID of the file being extracted
|
47
|
+
*/
|
48
|
+
file_id: string;
|
49
|
+
|
50
|
+
/**
|
51
|
+
* When the job was created
|
52
|
+
*/
|
53
|
+
created_at: string;
|
54
|
+
|
55
|
+
/**
|
56
|
+
* When the job was last updated
|
57
|
+
*/
|
58
|
+
updated_at: string;
|
59
|
+
|
60
|
+
/**
|
61
|
+
* When the job started processing
|
62
|
+
*/
|
63
|
+
started_at: string | null;
|
64
|
+
|
65
|
+
/**
|
66
|
+
* When the job finished processing
|
67
|
+
*/
|
68
|
+
finished_at: string | null;
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Current status of the job
|
72
|
+
*/
|
73
|
+
status: 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
|
74
|
+
|
75
|
+
/**
|
76
|
+
* The result of an extraction job.
|
77
|
+
*/
|
78
|
+
result: ContentAPI.ExtractionResult | null;
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Error information if failed
|
82
|
+
*/
|
83
|
+
error: unknown | null;
|
84
|
+
|
85
|
+
/**
|
86
|
+
* The JSON schema used for extraction
|
87
|
+
*/
|
88
|
+
json_schema: unknown;
|
89
|
+
}
|
90
|
+
|
91
|
+
export interface JobCreateParams {
|
92
|
+
/**
|
93
|
+
* The ID of the file to extract from
|
94
|
+
*/
|
95
|
+
file_id: string;
|
96
|
+
|
97
|
+
/**
|
98
|
+
* The JSON schema to use for extraction
|
99
|
+
*/
|
100
|
+
json_schema: unknown;
|
101
|
+
}
|
102
|
+
|
103
|
+
export declare namespace Jobs {
|
104
|
+
export { type ExtractionJob as ExtractionJob, type JobCreateParams as JobCreateParams };
|
105
|
+
}
|
@@ -0,0 +1,111 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
import { APIResource } from '../../resource';
|
4
|
+
import * as Core from '../../core';
|
5
|
+
|
6
|
+
export class Schema extends APIResource {
|
7
|
+
/**
|
8
|
+
* Create a schema with the provided parameters.
|
9
|
+
*
|
10
|
+
* Args: params: The parameters for creating a schema.
|
11
|
+
*
|
12
|
+
* Returns: The created schema.
|
13
|
+
*/
|
14
|
+
create(body: SchemaCreateParams, options?: Core.RequestOptions): Core.APIPromise<CreatedJsonSchema> {
|
15
|
+
return this._client.post('/v1/extractions/schema', { body, ...options });
|
16
|
+
}
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Enhance a schema by enriching the descriptions to aid extraction.
|
20
|
+
*
|
21
|
+
* Args: params: The parameters for enhancing a schema.
|
22
|
+
*
|
23
|
+
* Returns: The enhanced schema.
|
24
|
+
*/
|
25
|
+
enhance(body: SchemaEnhanceParams, options?: Core.RequestOptions): Core.APIPromise<EnhancedJsonSchema> {
|
26
|
+
return this._client.post('/v1/extractions/schema/enhance', { body, ...options });
|
27
|
+
}
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Validate a schema.
|
31
|
+
*
|
32
|
+
* Args: params: The parameters for validating a schema.
|
33
|
+
*
|
34
|
+
* Returns: The validation result.
|
35
|
+
*/
|
36
|
+
validate(body: SchemaValidateParams, options?: Core.RequestOptions): Core.APIPromise<ValidatedJsonSchema> {
|
37
|
+
return this._client.post('/v1/extractions/schema/validate', { body, ...options });
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Result of creating a JSON schema.
|
43
|
+
*/
|
44
|
+
export interface CreatedJsonSchema {
|
45
|
+
/**
|
46
|
+
* The created JSON schema
|
47
|
+
*/
|
48
|
+
json_schema: unknown;
|
49
|
+
}
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Result of enhancing a JSON schema.
|
53
|
+
*/
|
54
|
+
export interface EnhancedJsonSchema {
|
55
|
+
/**
|
56
|
+
* The enhanced JSON schema
|
57
|
+
*/
|
58
|
+
json_schema: unknown;
|
59
|
+
}
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Result of validating a JSON schema.
|
63
|
+
*/
|
64
|
+
export interface ValidatedJsonSchema {
|
65
|
+
/**
|
66
|
+
* Whether the schema is valid
|
67
|
+
*/
|
68
|
+
is_valid: boolean;
|
69
|
+
|
70
|
+
/**
|
71
|
+
* List of validation errors
|
72
|
+
*/
|
73
|
+
errors: Array<string>;
|
74
|
+
|
75
|
+
/**
|
76
|
+
* The validated JSON schema
|
77
|
+
*/
|
78
|
+
json_schema: unknown;
|
79
|
+
}
|
80
|
+
|
81
|
+
export interface SchemaCreateParams {
|
82
|
+
/**
|
83
|
+
* Description of the data to extract
|
84
|
+
*/
|
85
|
+
description: string;
|
86
|
+
}
|
87
|
+
|
88
|
+
export interface SchemaEnhanceParams {
|
89
|
+
/**
|
90
|
+
* The JSON schema to enhance
|
91
|
+
*/
|
92
|
+
json_schema: unknown;
|
93
|
+
}
|
94
|
+
|
95
|
+
export interface SchemaValidateParams {
|
96
|
+
/**
|
97
|
+
* The JSON schema to validate
|
98
|
+
*/
|
99
|
+
json_schema: unknown;
|
100
|
+
}
|
101
|
+
|
102
|
+
export declare namespace Schema {
|
103
|
+
export {
|
104
|
+
type CreatedJsonSchema as CreatedJsonSchema,
|
105
|
+
type EnhancedJsonSchema as EnhancedJsonSchema,
|
106
|
+
type ValidatedJsonSchema as ValidatedJsonSchema,
|
107
|
+
type SchemaCreateParams as SchemaCreateParams,
|
108
|
+
type SchemaEnhanceParams as SchemaEnhanceParams,
|
109
|
+
type SchemaValidateParams as SchemaValidateParams,
|
110
|
+
};
|
111
|
+
}
|