@mixedbread/sdk 0.5.0 → 0.6.0
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 +33 -0
- package/bin/migration-config.json +103 -0
- package/client.d.mts +15 -28
- package/client.d.mts.map +1 -1
- package/client.d.ts +15 -28
- package/client.d.ts.map +1 -1
- package/client.js +9 -22
- package/client.js.map +1 -1
- package/client.mjs +9 -22
- package/client.mjs.map +1 -1
- package/internal/headers.js +1 -1
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +1 -1
- package/internal/headers.mjs.map +1 -1
- package/package.json +1 -4
- 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/chat.d.mts +27 -0
- package/resources/chat.d.mts.map +1 -0
- package/resources/chat.d.ts +27 -0
- package/resources/chat.d.ts.map +1 -0
- package/resources/chat.js +28 -0
- package/resources/chat.js.map +1 -0
- package/resources/chat.mjs +24 -0
- package/resources/chat.mjs.map +1 -0
- package/resources/data-sources/connectors.d.mts +193 -0
- package/resources/data-sources/connectors.d.mts.map +1 -0
- package/resources/data-sources/connectors.d.ts +193 -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 +183 -0
- package/resources/data-sources/data-sources.d.mts.map +1 -0
- package/resources/data-sources/data-sources.d.ts +183 -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 +42 -44
- package/resources/extractions/content.d.mts.map +1 -1
- package/resources/extractions/content.d.ts +42 -44
- 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 +6 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -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 +29 -2
- package/resources/vector-stores/files.d.mts.map +1 -1
- package/resources/vector-stores/files.d.ts +29 -2
- package/resources/vector-stores/files.d.ts.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 +209 -79
- package/resources/vector-stores/vector-stores.d.mts.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +209 -79
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/src/client.ts +68 -30
- package/src/internal/headers.ts +1 -1
- package/src/resources/api-keys.ts +225 -0
- package/src/resources/chat.ts +33 -0
- package/src/resources/data-sources/connectors.ts +280 -0
- package/src/resources/data-sources/data-sources.ts +271 -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 +48 -45
- 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 +27 -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 +39 -2
- package/src/resources/vector-stores/index.ts +4 -3
- package/src/resources/vector-stores/vector-stores.ts +251 -89
- 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
@@ -0,0 +1,271 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
import { APIResource } from '../../core/resource';
|
4
|
+
import * as ConnectorsAPI from './connectors';
|
5
|
+
import {
|
6
|
+
ConnectorCreateParams,
|
7
|
+
ConnectorDeleteParams,
|
8
|
+
ConnectorDeleteResponse,
|
9
|
+
ConnectorListParams,
|
10
|
+
ConnectorRetrieveParams,
|
11
|
+
ConnectorUpdateParams,
|
12
|
+
Connectors,
|
13
|
+
DataSourceConnector,
|
14
|
+
DataSourceConnectorsLimitOffset,
|
15
|
+
} from './connectors';
|
16
|
+
import { APIPromise } from '../../core/api-promise';
|
17
|
+
import { LimitOffset, type LimitOffsetParams, PagePromise } from '../../core/pagination';
|
18
|
+
import { RequestOptions } from '../../internal/request-options';
|
19
|
+
import { path } from '../../internal/utils/path';
|
20
|
+
|
21
|
+
export class DataSources extends APIResource {
|
22
|
+
connectors: ConnectorsAPI.Connectors = new ConnectorsAPI.Connectors(this._client);
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Create a new data source.
|
26
|
+
*
|
27
|
+
* Args: params: The data source to create.
|
28
|
+
*
|
29
|
+
* Returns: The created data source.
|
30
|
+
*/
|
31
|
+
create(body: DataSourceCreateParams, options?: RequestOptions): APIPromise<DataSource> {
|
32
|
+
return this._client.post('/v1/data_sources/', { body, ...options });
|
33
|
+
}
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Get a data source by ID.
|
37
|
+
*
|
38
|
+
* Args: data_source_id: The ID of the data source to fetch.
|
39
|
+
*
|
40
|
+
* Returns: The data source.
|
41
|
+
*/
|
42
|
+
retrieve(dataSourceID: string, options?: RequestOptions): APIPromise<DataSource> {
|
43
|
+
return this._client.get(path`/v1/data_sources/${dataSourceID}`, options);
|
44
|
+
}
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Update a data source.
|
48
|
+
*
|
49
|
+
* Args: data_source_id: The ID of the data source to update. params: The data
|
50
|
+
* source to update.
|
51
|
+
*
|
52
|
+
* Returns: The updated data source.
|
53
|
+
*/
|
54
|
+
update(
|
55
|
+
dataSourceID: string,
|
56
|
+
body: DataSourceUpdateParams,
|
57
|
+
options?: RequestOptions,
|
58
|
+
): APIPromise<DataSource> {
|
59
|
+
return this._client.put(path`/v1/data_sources/${dataSourceID}`, { body, ...options });
|
60
|
+
}
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Get all data sources.
|
64
|
+
*
|
65
|
+
* Returns: The list of data sources.
|
66
|
+
*/
|
67
|
+
list(
|
68
|
+
query: DataSourceListParams | null | undefined = {},
|
69
|
+
options?: RequestOptions,
|
70
|
+
): PagePromise<DataSourcesLimitOffset, DataSource> {
|
71
|
+
return this._client.getAPIList('/v1/data_sources/', LimitOffset<DataSource>, { query, ...options });
|
72
|
+
}
|
73
|
+
|
74
|
+
/**
|
75
|
+
* Delete a data source.
|
76
|
+
*
|
77
|
+
* Args: data_source_id: The ID of the data source to delete.
|
78
|
+
*/
|
79
|
+
delete(dataSourceID: string, options?: RequestOptions): APIPromise<DataSourceDeleteResponse> {
|
80
|
+
return this._client.delete(path`/v1/data_sources/${dataSourceID}`, options);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
export type DataSourcesLimitOffset = LimitOffset<DataSource>;
|
85
|
+
|
86
|
+
/**
|
87
|
+
* Service-level representation of a data source.
|
88
|
+
*/
|
89
|
+
export interface DataSource {
|
90
|
+
/**
|
91
|
+
* The ID of the data source
|
92
|
+
*/
|
93
|
+
id: string;
|
94
|
+
|
95
|
+
/**
|
96
|
+
* The creation time of the data source
|
97
|
+
*/
|
98
|
+
created_at: string;
|
99
|
+
|
100
|
+
/**
|
101
|
+
* The last update time of the data source
|
102
|
+
*/
|
103
|
+
updated_at: string;
|
104
|
+
|
105
|
+
/**
|
106
|
+
* The type of data source
|
107
|
+
*/
|
108
|
+
type: DataSourceType;
|
109
|
+
|
110
|
+
/**
|
111
|
+
* The name of the data source
|
112
|
+
*/
|
113
|
+
name: string;
|
114
|
+
|
115
|
+
/**
|
116
|
+
* The metadata of the data source
|
117
|
+
*/
|
118
|
+
metadata: unknown;
|
119
|
+
|
120
|
+
/**
|
121
|
+
* Authentication parameters for a OAuth data source.
|
122
|
+
*/
|
123
|
+
auth_params: DataSourceOauth2Params | null;
|
124
|
+
|
125
|
+
/**
|
126
|
+
* The type of the object
|
127
|
+
*/
|
128
|
+
object?: 'data_source';
|
129
|
+
}
|
130
|
+
|
131
|
+
/**
|
132
|
+
* Authentication parameters for a OAuth data source.
|
133
|
+
*/
|
134
|
+
export interface DataSourceOauth2Params {
|
135
|
+
type?: 'oauth2';
|
136
|
+
|
137
|
+
/**
|
138
|
+
* The timestamp when the OAuth2 credentials were created
|
139
|
+
*/
|
140
|
+
created_at?: string;
|
141
|
+
|
142
|
+
/**
|
143
|
+
* The OAuth2 client ID
|
144
|
+
*/
|
145
|
+
client_id: string;
|
146
|
+
|
147
|
+
/**
|
148
|
+
* The OAuth2 client secret
|
149
|
+
*/
|
150
|
+
client_secret: string;
|
151
|
+
|
152
|
+
/**
|
153
|
+
* The OAuth2 redirect URI
|
154
|
+
*/
|
155
|
+
redirect_uri: string;
|
156
|
+
|
157
|
+
/**
|
158
|
+
* The OAuth2 scope
|
159
|
+
*/
|
160
|
+
scope: string;
|
161
|
+
|
162
|
+
/**
|
163
|
+
* The OAuth2 access token
|
164
|
+
*/
|
165
|
+
access_token?: string | null;
|
166
|
+
|
167
|
+
/**
|
168
|
+
* The OAuth2 refresh token
|
169
|
+
*/
|
170
|
+
refresh_token?: string | null;
|
171
|
+
|
172
|
+
/**
|
173
|
+
* The OAuth2 token type
|
174
|
+
*/
|
175
|
+
token_type?: string | null;
|
176
|
+
|
177
|
+
/**
|
178
|
+
* The OAuth2 token expiration timestamp
|
179
|
+
*/
|
180
|
+
expires_on?: string | null;
|
181
|
+
}
|
182
|
+
|
183
|
+
export type DataSourceType = 'notion' | 'linear';
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Deleted data source.
|
187
|
+
*/
|
188
|
+
export interface DataSourceDeleteResponse {
|
189
|
+
/**
|
190
|
+
* The ID of the data source
|
191
|
+
*/
|
192
|
+
id: string;
|
193
|
+
|
194
|
+
/**
|
195
|
+
* Whether the data source was deleted
|
196
|
+
*/
|
197
|
+
deleted?: boolean;
|
198
|
+
|
199
|
+
/**
|
200
|
+
* The type of the object
|
201
|
+
*/
|
202
|
+
object?: 'data_source';
|
203
|
+
}
|
204
|
+
|
205
|
+
export interface DataSourceCreateParams {
|
206
|
+
/**
|
207
|
+
* The type of data source to create
|
208
|
+
*/
|
209
|
+
type: DataSourceType;
|
210
|
+
|
211
|
+
/**
|
212
|
+
* The name of the data source
|
213
|
+
*/
|
214
|
+
name: string;
|
215
|
+
|
216
|
+
/**
|
217
|
+
* The metadata of the data source
|
218
|
+
*/
|
219
|
+
metadata?: unknown;
|
220
|
+
|
221
|
+
/**
|
222
|
+
* Authentication parameters for a OAuth data source.
|
223
|
+
*/
|
224
|
+
auth_params?: DataSourceOauth2Params | null;
|
225
|
+
}
|
226
|
+
|
227
|
+
export interface DataSourceUpdateParams {
|
228
|
+
/**
|
229
|
+
* The name of the data source
|
230
|
+
*/
|
231
|
+
name?: string | null;
|
232
|
+
|
233
|
+
/**
|
234
|
+
* The metadata of the data source
|
235
|
+
*/
|
236
|
+
metadata?: unknown;
|
237
|
+
|
238
|
+
/**
|
239
|
+
* Authentication parameters for a OAuth data source.
|
240
|
+
*/
|
241
|
+
auth_params?: DataSourceOauth2Params | null;
|
242
|
+
}
|
243
|
+
|
244
|
+
export interface DataSourceListParams extends LimitOffsetParams {}
|
245
|
+
|
246
|
+
DataSources.Connectors = Connectors;
|
247
|
+
|
248
|
+
export declare namespace DataSources {
|
249
|
+
export {
|
250
|
+
type DataSource as DataSource,
|
251
|
+
type DataSourceOauth2Params as DataSourceOauth2Params,
|
252
|
+
type DataSourceType as DataSourceType,
|
253
|
+
type DataSourceDeleteResponse as DataSourceDeleteResponse,
|
254
|
+
type DataSourcesLimitOffset as DataSourcesLimitOffset,
|
255
|
+
type DataSourceCreateParams as DataSourceCreateParams,
|
256
|
+
type DataSourceUpdateParams as DataSourceUpdateParams,
|
257
|
+
type DataSourceListParams as DataSourceListParams,
|
258
|
+
};
|
259
|
+
|
260
|
+
export {
|
261
|
+
Connectors as Connectors,
|
262
|
+
type DataSourceConnector as DataSourceConnector,
|
263
|
+
type ConnectorDeleteResponse as ConnectorDeleteResponse,
|
264
|
+
type DataSourceConnectorsLimitOffset as DataSourceConnectorsLimitOffset,
|
265
|
+
type ConnectorCreateParams as ConnectorCreateParams,
|
266
|
+
type ConnectorRetrieveParams as ConnectorRetrieveParams,
|
267
|
+
type ConnectorUpdateParams as ConnectorUpdateParams,
|
268
|
+
type ConnectorListParams as ConnectorListParams,
|
269
|
+
type ConnectorDeleteParams as ConnectorDeleteParams,
|
270
|
+
};
|
271
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
export {
|
4
|
+
Connectors,
|
5
|
+
type DataSourceConnector,
|
6
|
+
type ConnectorDeleteResponse,
|
7
|
+
type ConnectorCreateParams,
|
8
|
+
type ConnectorRetrieveParams,
|
9
|
+
type ConnectorUpdateParams,
|
10
|
+
type ConnectorListParams,
|
11
|
+
type ConnectorDeleteParams,
|
12
|
+
type DataSourceConnectorsLimitOffset,
|
13
|
+
} from './connectors';
|
14
|
+
export {
|
15
|
+
DataSources,
|
16
|
+
type DataSource,
|
17
|
+
type DataSourceOauth2Params,
|
18
|
+
type DataSourceType,
|
19
|
+
type DataSourceDeleteResponse,
|
20
|
+
type DataSourceCreateParams,
|
21
|
+
type DataSourceUpdateParams,
|
22
|
+
type DataSourceListParams,
|
23
|
+
type DataSourcesLimitOffset,
|
24
|
+
} from './data-sources';
|
@@ -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,73 @@ export interface ExtractionResult {
|
|
26
26
|
warnings: Array<string>;
|
27
27
|
}
|
28
28
|
|
29
|
-
|
29
|
+
/**
|
30
|
+
* Model for image input validation.
|
31
|
+
*/
|
32
|
+
export interface ImageURLInput {
|
30
33
|
/**
|
31
|
-
*
|
34
|
+
* Input type identifier
|
32
35
|
*/
|
33
|
-
|
36
|
+
type?: 'image_url';
|
34
37
|
|
35
38
|
/**
|
36
|
-
* The
|
39
|
+
* The image input specification.
|
37
40
|
*/
|
38
|
-
|
41
|
+
image_url: ImageURLInput.ImageURL;
|
42
|
+
}
|
39
43
|
|
44
|
+
export namespace ImageURLInput {
|
40
45
|
/**
|
41
|
-
*
|
46
|
+
* The image input specification.
|
42
47
|
*/
|
43
|
-
|
48
|
+
export interface ImageURL {
|
49
|
+
/**
|
50
|
+
* The image URL. Can be either a URL or a Data URI.
|
51
|
+
*/
|
52
|
+
url: string;
|
53
|
+
}
|
44
54
|
}
|
45
55
|
|
46
|
-
|
56
|
+
/**
|
57
|
+
* Model for text input validation.
|
58
|
+
*
|
59
|
+
* Attributes: type: Input type identifier, always "text" text: The actual text
|
60
|
+
* content, with length and whitespace constraints
|
61
|
+
*/
|
62
|
+
export interface TextInput {
|
47
63
|
/**
|
48
|
-
*
|
49
|
-
*
|
50
|
-
* Attributes: type: Input type identifier, always "text" text: The actual text
|
51
|
-
* content, with length and whitespace constraints
|
64
|
+
* Input type identifier
|
52
65
|
*/
|
53
|
-
|
54
|
-
/**
|
55
|
-
* Input type identifier
|
56
|
-
*/
|
57
|
-
type?: 'text';
|
66
|
+
type?: 'text';
|
58
67
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
68
|
+
/**
|
69
|
+
* Text content to process
|
70
|
+
*/
|
71
|
+
text: string;
|
72
|
+
}
|
64
73
|
|
74
|
+
export interface ContentCreateParams {
|
65
75
|
/**
|
66
|
-
*
|
76
|
+
* The content to extract from
|
67
77
|
*/
|
68
|
-
|
69
|
-
/**
|
70
|
-
* Input type identifier
|
71
|
-
*/
|
72
|
-
type?: 'image_url';
|
78
|
+
content: string | Array<string> | Array<TextInput | ImageURLInput>;
|
73
79
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
}
|
80
|
+
/**
|
81
|
+
* The JSON schema to use for extraction
|
82
|
+
*/
|
83
|
+
json_schema: Record<string, unknown>;
|
79
84
|
|
80
|
-
|
81
|
-
|
82
|
-
|
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
|
-
}
|
85
|
+
/**
|
86
|
+
* Additional instructions for the extraction
|
87
|
+
*/
|
88
|
+
instructions?: string | null;
|
91
89
|
}
|
92
90
|
|
93
91
|
export declare namespace Content {
|
94
|
-
export {
|
92
|
+
export {
|
93
|
+
type ExtractionResult as ExtractionResult,
|
94
|
+
type ImageURLInput as ImageURLInput,
|
95
|
+
type TextInput as TextInput,
|
96
|
+
type ContentCreateParams as ContentCreateParams,
|
97
|
+
};
|
95
98
|
}
|
@@ -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,33 @@
|
|
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 { Chat, type ChatCreateCompletionResponse } from './chat';
|
14
|
+
export {
|
15
|
+
DataSources,
|
16
|
+
type DataSource,
|
17
|
+
type DataSourceOauth2Params,
|
18
|
+
type DataSourceType,
|
19
|
+
type DataSourceDeleteResponse,
|
20
|
+
type DataSourceCreateParams,
|
21
|
+
type DataSourceUpdateParams,
|
22
|
+
type DataSourceListParams,
|
23
|
+
type DataSourcesLimitOffset,
|
24
|
+
} from './data-sources/data-sources';
|
25
|
+
export { Embeddings, type EncodingFormat, type ObjectType, type EmbeddingCreateParams } from './embeddings';
|
5
26
|
export { Extractions } from './extractions/extractions';
|
6
27
|
export {
|
7
28
|
Files,
|
8
29
|
type FileObject,
|
30
|
+
type PaginationWithTotal,
|
9
31
|
type FileDeleteResponse,
|
10
32
|
type FileCreateParams,
|
11
33
|
type FileUpdateParams,
|
@@ -16,11 +38,12 @@ export { Parsing } from './parsing/parsing';
|
|
16
38
|
export {
|
17
39
|
VectorStores,
|
18
40
|
type ExpiresAfter,
|
19
|
-
type
|
20
|
-
type
|
41
|
+
type ScoredAudioURLInputChunk,
|
42
|
+
type ScoredImageURLInputChunk,
|
43
|
+
type ScoredTextInputChunk,
|
44
|
+
type ScoredVideoURLInputChunk,
|
21
45
|
type VectorStore,
|
22
46
|
type VectorStoreChunkSearchOptions,
|
23
|
-
type VectorStoreFileSearchOptions,
|
24
47
|
type VectorStoreDeleteResponse,
|
25
48
|
type VectorStoreQuestionAnsweringResponse,
|
26
49
|
type VectorStoreSearchResponse,
|