@usecortex_ai/node 0.2.0 → 0.3.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/README.md +1 -44
- package/dist/Client.d.ts +14 -5
- package/dist/Client.js +68 -12
- package/dist/api/resources/document/client/Client.d.ts +5 -5
- package/dist/api/resources/document/client/Client.js +8 -4
- package/dist/api/resources/embeddings/client/Client.d.ts +9 -9
- package/dist/api/resources/embeddings/client/Client.js +16 -12
- package/dist/api/resources/embeddings/client/requests/EmbeddingsCreateCollectionRequest.d.ts +1 -1
- package/dist/api/resources/embeddings/client/requests/EmbeddingsDeleteRequest.d.ts +3 -3
- package/dist/api/resources/embeddings/client/requests/EmbeddingsSearchRequest.d.ts +2 -2
- package/dist/api/resources/embeddings/client/requests/GetEmbeddingsBasedOnChunkIdsRequest.d.ts +3 -3
- package/dist/api/resources/fetch/client/Client.d.ts +6 -6
- package/dist/api/resources/fetch/client/Client.js +9 -5
- package/dist/api/resources/fetch/client/requests/FetchContentRequest.d.ts +3 -8
- package/dist/api/resources/index.d.ts +1 -1
- package/dist/api/resources/index.js +2 -2
- package/dist/api/resources/search/client/Client.d.ts +11 -11
- package/dist/api/resources/search/client/Client.js +14 -10
- package/dist/api/resources/search/client/requests/FullTextSearchRequest.d.ts +3 -3
- package/dist/api/resources/search/client/requests/QnARequest.d.ts +3 -3
- package/dist/api/resources/search/client/requests/SearchRequest.d.ts +5 -3
- package/dist/api/resources/sources/client/Client.d.ts +8 -33
- package/dist/api/resources/sources/client/Client.js +12 -95
- package/dist/api/resources/sources/client/requests/SourceBodyParams.d.ts +6 -2
- package/dist/api/resources/sources/client/requests/index.d.ts +0 -1
- package/dist/api/resources/tenant/client/Client.d.ts +8 -7
- package/dist/api/resources/tenant/client/Client.js +11 -6
- package/dist/api/resources/tenant/client/requests/TenantDeleteSubTenantRequest.d.ts +2 -2
- package/dist/api/resources/tenant/client/requests/TenantGetSubTenantIdsRequest.d.ts +1 -1
- package/dist/api/resources/tenant/client/requests/TenantStatsRequest.d.ts +3 -2
- package/dist/api/resources/upload/client/Client.d.ts +47 -32
- package/dist/api/resources/upload/client/Client.js +56 -31
- package/dist/api/resources/upload/client/requests/BodyBatchUpdateUploadBatchUpdatePatch.d.ts +3 -2
- package/dist/api/resources/upload/client/requests/BodyBatchUploadUploadBatchUploadPost.d.ts +5 -2
- package/dist/api/resources/upload/client/requests/BodyUpdateFileUploadUpdateDocumentPatch.d.ts +4 -3
- package/dist/api/resources/upload/client/requests/BodyUploadFilesUploadUploadDocumentPost.d.ts +5 -2
- package/dist/api/resources/upload/client/requests/EmbeddingsUpdateRequest.d.ts +3 -2
- package/dist/api/resources/upload/client/requests/EmbeddingsUploadRequest.d.ts +4 -3
- package/dist/api/resources/upload/client/requests/UploadScrapeWebpageRequest.d.ts +5 -3
- package/dist/api/resources/upload/client/requests/UploadUpdateMarkdownRequest.d.ts +5 -4
- package/dist/api/resources/upload/client/requests/UploadUpdateTextRequest.d.ts +5 -4
- package/dist/api/resources/upload/client/requests/UploadUpdateWebpageRequest.d.ts +5 -4
- package/dist/api/resources/upload/client/requests/UploadUploadAppSourcesRequest.d.ts +3 -2
- package/dist/api/resources/upload/client/requests/UploadUploadMarkdownRequest.d.ts +4 -3
- package/dist/api/resources/upload/client/requests/UploadUploadTextRequest.d.ts +4 -3
- package/dist/api/resources/upload/client/requests/UploadVerifyProcessingRequest.d.ts +2 -1
- package/dist/api/resources/user/client/Client.d.ts +6 -4
- package/dist/api/resources/user/client/Client.js +13 -4
- package/dist/api/resources/user/client/requests/BodyCreateTenantUserCreateTenantPost.d.ts +4 -1
- package/dist/api/resources/userMemory/client/Client.d.ts +19 -13
- package/dist/api/resources/userMemory/client/Client.js +22 -12
- package/dist/api/resources/userMemory/client/requests/AddUserMemoryRequest.d.ts +4 -3
- package/dist/api/resources/userMemory/client/requests/GenerateUserMemoryRequest.d.ts +6 -5
- package/dist/api/resources/userMemory/client/requests/RetrieveUserMemoryRequest.d.ts +7 -3
- package/dist/api/resources/userMemory/client/requests/UserMemoryDeleteUserMemoryRequest.d.ts +4 -3
- package/dist/api/resources/userMemory/client/requests/UserMemoryListUserMemoriesRequest.d.ts +3 -2
- package/dist/api/types/DeleteMemoryRequest.d.ts +1 -1
- package/dist/api/types/MarkdownUploadRequest.d.ts +2 -0
- package/dist/api/types/SubTenantIdsData.d.ts +2 -0
- package/dist/api/types/TenantStats.d.ts +2 -2
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ export declare namespace Upload {
|
|
|
9
9
|
environment?: core.Supplier<environments.CortexAIEnvironment | string>;
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
|
-
token
|
|
12
|
+
token?: core.Supplier<core.BearerToken | undefined>;
|
|
13
13
|
/** Additional headers to include in requests. */
|
|
14
14
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
15
15
|
}
|
|
@@ -28,7 +28,7 @@ export declare namespace Upload {
|
|
|
28
28
|
}
|
|
29
29
|
export declare class Upload {
|
|
30
30
|
protected readonly _options: Upload.Options;
|
|
31
|
-
constructor(_options
|
|
31
|
+
constructor(_options?: Upload.Options);
|
|
32
32
|
/**
|
|
33
33
|
* Upload multiple documents simultaneously for efficient bulk processing.
|
|
34
34
|
*
|
|
@@ -51,7 +51,8 @@ export declare class Upload {
|
|
|
51
51
|
* import { createReadStream } from "fs";
|
|
52
52
|
* await client.upload.batchUpload({
|
|
53
53
|
* files: [fs.createReadStream("/path/to/your/file")],
|
|
54
|
-
* tenant_id: "
|
|
54
|
+
* tenant_id: "tenant_1234",
|
|
55
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
55
56
|
* })
|
|
56
57
|
*/
|
|
57
58
|
batchUpload(request: CortexAI.BodyBatchUploadUploadBatchUploadPost, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.BatchUploadData>;
|
|
@@ -78,7 +79,8 @@ export declare class Upload {
|
|
|
78
79
|
* import { createReadStream } from "fs";
|
|
79
80
|
* await client.upload.batchUpdate({
|
|
80
81
|
* files: [fs.createReadStream("/path/to/your/file")],
|
|
81
|
-
* tenant_id: "
|
|
82
|
+
* tenant_id: "tenant_1234",
|
|
83
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
82
84
|
* })
|
|
83
85
|
*/
|
|
84
86
|
batchUpdate(request: CortexAI.BodyBatchUpdateUploadBatchUpdatePatch, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.BatchUploadData>;
|
|
@@ -105,7 +107,8 @@ export declare class Upload {
|
|
|
105
107
|
* import { createReadStream } from "fs";
|
|
106
108
|
* await client.upload.uploadDocument({
|
|
107
109
|
* file: fs.createReadStream("/path/to/your/file"),
|
|
108
|
-
* tenant_id: "
|
|
110
|
+
* tenant_id: "tenant_1234",
|
|
111
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
109
112
|
* })
|
|
110
113
|
*/
|
|
111
114
|
uploadDocument(request: CortexAI.BodyUploadFilesUploadUploadDocumentPost, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
|
|
@@ -132,8 +135,9 @@ export declare class Upload {
|
|
|
132
135
|
* import { createReadStream } from "fs";
|
|
133
136
|
* await client.upload.updateDocument({
|
|
134
137
|
* file: fs.createReadStream("/path/to/your/file"),
|
|
135
|
-
* source_id: "
|
|
136
|
-
* tenant_id: "
|
|
138
|
+
* source_id: "CortexDoc1234",
|
|
139
|
+
* tenant_id: "tenant_1234",
|
|
140
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
137
141
|
* })
|
|
138
142
|
*/
|
|
139
143
|
updateDocument(request: CortexAI.BodyUpdateFileUploadUpdateDocumentPatch, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
|
|
@@ -158,7 +162,8 @@ export declare class Upload {
|
|
|
158
162
|
*
|
|
159
163
|
* @example
|
|
160
164
|
* await client.upload.uploadAppSources({
|
|
161
|
-
* tenant_id: "
|
|
165
|
+
* tenant_id: "tenant_1234",
|
|
166
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
162
167
|
* body: [{}]
|
|
163
168
|
* })
|
|
164
169
|
*/
|
|
@@ -184,9 +189,10 @@ export declare class Upload {
|
|
|
184
189
|
*
|
|
185
190
|
* @example
|
|
186
191
|
* await client.upload.uploadMarkdown({
|
|
187
|
-
* tenant_id: "
|
|
192
|
+
* tenant_id: "tenant_1234",
|
|
193
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
188
194
|
* body: {
|
|
189
|
-
* content: "content"
|
|
195
|
+
* content: "<content>"
|
|
190
196
|
* }
|
|
191
197
|
* })
|
|
192
198
|
*/
|
|
@@ -212,9 +218,10 @@ export declare class Upload {
|
|
|
212
218
|
*
|
|
213
219
|
* @example
|
|
214
220
|
* await client.upload.uploadText({
|
|
215
|
-
* tenant_id: "
|
|
221
|
+
* tenant_id: "tenant_1234",
|
|
222
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
216
223
|
* body: {
|
|
217
|
-
* content: "content"
|
|
224
|
+
* content: "<content>"
|
|
218
225
|
* }
|
|
219
226
|
* })
|
|
220
227
|
*/
|
|
@@ -240,10 +247,11 @@ export declare class Upload {
|
|
|
240
247
|
*
|
|
241
248
|
* @example
|
|
242
249
|
* await client.upload.updateMarkdown({
|
|
243
|
-
* source_id: "
|
|
244
|
-
* tenant_id: "
|
|
250
|
+
* source_id: "CortexDoc1234",
|
|
251
|
+
* tenant_id: "tenant_1234",
|
|
252
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
245
253
|
* body: {
|
|
246
|
-
* content: "content"
|
|
254
|
+
* content: "<content>"
|
|
247
255
|
* }
|
|
248
256
|
* })
|
|
249
257
|
*/
|
|
@@ -269,10 +277,11 @@ export declare class Upload {
|
|
|
269
277
|
*
|
|
270
278
|
* @example
|
|
271
279
|
* await client.upload.updateText({
|
|
272
|
-
* source_id: "
|
|
273
|
-
* tenant_id: "
|
|
280
|
+
* source_id: "CortexDoc1234",
|
|
281
|
+
* tenant_id: "tenant_1234",
|
|
282
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
274
283
|
* body: {
|
|
275
|
-
* content: "content"
|
|
284
|
+
* content: "<content>"
|
|
276
285
|
* }
|
|
277
286
|
* })
|
|
278
287
|
*/
|
|
@@ -298,8 +307,9 @@ export declare class Upload {
|
|
|
298
307
|
*
|
|
299
308
|
* @example
|
|
300
309
|
* await client.upload.uploadEmbeddings({
|
|
301
|
-
* tenant_id: "
|
|
302
|
-
*
|
|
310
|
+
* tenant_id: "tenant_1234",
|
|
311
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
312
|
+
* embeddings: [[0.123413, 0.655367, 0.987654, 0.123456, 0.789012], [0.123413, 0.655367, 0.987654, 0.123456, 0.789012]]
|
|
303
313
|
* })
|
|
304
314
|
*/
|
|
305
315
|
uploadEmbeddings(request: CortexAI.EmbeddingsUploadRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
|
|
@@ -324,7 +334,8 @@ export declare class Upload {
|
|
|
324
334
|
*
|
|
325
335
|
* @example
|
|
326
336
|
* await client.upload.updateEmbeddings({
|
|
327
|
-
* tenant_id: "
|
|
337
|
+
* tenant_id: "tenant_1234",
|
|
338
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
328
339
|
* })
|
|
329
340
|
*/
|
|
330
341
|
updateEmbeddings(request: CortexAI.EmbeddingsUpdateRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SingleUploadData>;
|
|
@@ -349,8 +360,10 @@ export declare class Upload {
|
|
|
349
360
|
*
|
|
350
361
|
* @example
|
|
351
362
|
* await client.upload.scrapeWebpage({
|
|
352
|
-
* web_url: "
|
|
353
|
-
* tenant_id: "
|
|
363
|
+
* web_url: "https://www.usecortex.ai/",
|
|
364
|
+
* tenant_id: "tenant_1234",
|
|
365
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
366
|
+
* file_id: "CortexDoc1234",
|
|
354
367
|
* body: {}
|
|
355
368
|
* })
|
|
356
369
|
*/
|
|
@@ -376,9 +389,10 @@ export declare class Upload {
|
|
|
376
389
|
*
|
|
377
390
|
* @example
|
|
378
391
|
* await client.upload.updateWebpage({
|
|
379
|
-
* web_url: "
|
|
380
|
-
* source_id: "
|
|
381
|
-
* tenant_id: "
|
|
392
|
+
* web_url: "https://www.usecortex.ai/",
|
|
393
|
+
* source_id: "CortexDoc1234",
|
|
394
|
+
* tenant_id: "tenant_1234",
|
|
395
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
382
396
|
* body: {}
|
|
383
397
|
* })
|
|
384
398
|
*/
|
|
@@ -398,8 +412,8 @@ export declare class Upload {
|
|
|
398
412
|
*
|
|
399
413
|
* @example
|
|
400
414
|
* await client.upload.deleteSource({
|
|
401
|
-
* tenant_id: "
|
|
402
|
-
* source_ids: ["
|
|
415
|
+
* tenant_id: "tenant_1234",
|
|
416
|
+
* source_ids: ["CortexDoc1234", "CortexDoc4567"]
|
|
403
417
|
* })
|
|
404
418
|
*/
|
|
405
419
|
deleteSource(request: CortexAI.DeleteMemoryRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
@@ -418,8 +432,8 @@ export declare class Upload {
|
|
|
418
432
|
*
|
|
419
433
|
* @example
|
|
420
434
|
* await client.upload.deleteMemory({
|
|
421
|
-
* tenant_id: "
|
|
422
|
-
* source_ids: ["
|
|
435
|
+
* tenant_id: "tenant_1234",
|
|
436
|
+
* source_ids: ["CortexDoc1234", "CortexDoc4567"]
|
|
423
437
|
* })
|
|
424
438
|
*/
|
|
425
439
|
deleteMemory(request: CortexAI.DeleteMemoryRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
@@ -444,10 +458,11 @@ export declare class Upload {
|
|
|
444
458
|
*
|
|
445
459
|
* @example
|
|
446
460
|
* await client.upload.verifyProcessing({
|
|
447
|
-
* file_id: "
|
|
461
|
+
* file_id: "CortexDoc1234",
|
|
462
|
+
* tenant_id: "tenant_1234"
|
|
448
463
|
* })
|
|
449
464
|
*/
|
|
450
465
|
verifyProcessing(request: CortexAI.UploadVerifyProcessingRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.ProcessingStatus>;
|
|
451
466
|
private __verifyProcessing;
|
|
452
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
467
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
453
468
|
}
|
|
@@ -44,7 +44,7 @@ const CortexAI = __importStar(require("../../../index.js"));
|
|
|
44
44
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
45
45
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
46
46
|
class Upload {
|
|
47
|
-
constructor(_options) {
|
|
47
|
+
constructor(_options = {}) {
|
|
48
48
|
this._options = _options;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
@@ -69,7 +69,8 @@ class Upload {
|
|
|
69
69
|
* import { createReadStream } from "fs";
|
|
70
70
|
* await client.upload.batchUpload({
|
|
71
71
|
* files: [fs.createReadStream("/path/to/your/file")],
|
|
72
|
-
* tenant_id: "
|
|
72
|
+
* tenant_id: "tenant_1234",
|
|
73
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
73
74
|
* })
|
|
74
75
|
*/
|
|
75
76
|
batchUpload(request, requestOptions) {
|
|
@@ -86,6 +87,9 @@ class Upload {
|
|
|
86
87
|
for (const _file of request.files) {
|
|
87
88
|
await _request.appendFile("files", _file);
|
|
88
89
|
}
|
|
90
|
+
if (request.file_ids != null) {
|
|
91
|
+
_request.append("file_ids", request.file_ids);
|
|
92
|
+
}
|
|
89
93
|
if (request.tenant_metadata != null) {
|
|
90
94
|
_request.append("tenant_metadata", request.tenant_metadata);
|
|
91
95
|
}
|
|
@@ -171,7 +175,8 @@ class Upload {
|
|
|
171
175
|
* import { createReadStream } from "fs";
|
|
172
176
|
* await client.upload.batchUpdate({
|
|
173
177
|
* files: [fs.createReadStream("/path/to/your/file")],
|
|
174
|
-
* tenant_id: "
|
|
178
|
+
* tenant_id: "tenant_1234",
|
|
179
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
175
180
|
* })
|
|
176
181
|
*/
|
|
177
182
|
batchUpdate(request, requestOptions) {
|
|
@@ -278,7 +283,8 @@ class Upload {
|
|
|
278
283
|
* import { createReadStream } from "fs";
|
|
279
284
|
* await client.upload.uploadDocument({
|
|
280
285
|
* file: fs.createReadStream("/path/to/your/file"),
|
|
281
|
-
* tenant_id: "
|
|
286
|
+
* tenant_id: "tenant_1234",
|
|
287
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
282
288
|
* })
|
|
283
289
|
*/
|
|
284
290
|
uploadDocument(request, requestOptions) {
|
|
@@ -293,6 +299,9 @@ class Upload {
|
|
|
293
299
|
}
|
|
294
300
|
const _request = await core.newFormData();
|
|
295
301
|
await _request.appendFile("file", request.file);
|
|
302
|
+
if (request.file_id != null) {
|
|
303
|
+
_request.append("file_id", request.file_id);
|
|
304
|
+
}
|
|
296
305
|
if (request.tenant_metadata != null) {
|
|
297
306
|
_request.append("tenant_metadata", request.tenant_metadata);
|
|
298
307
|
}
|
|
@@ -378,8 +387,9 @@ class Upload {
|
|
|
378
387
|
* import { createReadStream } from "fs";
|
|
379
388
|
* await client.upload.updateDocument({
|
|
380
389
|
* file: fs.createReadStream("/path/to/your/file"),
|
|
381
|
-
* source_id: "
|
|
382
|
-
* tenant_id: "
|
|
390
|
+
* source_id: "CortexDoc1234",
|
|
391
|
+
* tenant_id: "tenant_1234",
|
|
392
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
383
393
|
* })
|
|
384
394
|
*/
|
|
385
395
|
updateDocument(request, requestOptions) {
|
|
@@ -478,7 +488,8 @@ class Upload {
|
|
|
478
488
|
*
|
|
479
489
|
* @example
|
|
480
490
|
* await client.upload.uploadAppSources({
|
|
481
|
-
* tenant_id: "
|
|
491
|
+
* tenant_id: "tenant_1234",
|
|
492
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
482
493
|
* body: [{}]
|
|
483
494
|
* })
|
|
484
495
|
*/
|
|
@@ -569,9 +580,10 @@ class Upload {
|
|
|
569
580
|
*
|
|
570
581
|
* @example
|
|
571
582
|
* await client.upload.uploadMarkdown({
|
|
572
|
-
* tenant_id: "
|
|
583
|
+
* tenant_id: "tenant_1234",
|
|
584
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
573
585
|
* body: {
|
|
574
|
-
* content: "content"
|
|
586
|
+
* content: "<content>"
|
|
575
587
|
* }
|
|
576
588
|
* })
|
|
577
589
|
*/
|
|
@@ -662,9 +674,10 @@ class Upload {
|
|
|
662
674
|
*
|
|
663
675
|
* @example
|
|
664
676
|
* await client.upload.uploadText({
|
|
665
|
-
* tenant_id: "
|
|
677
|
+
* tenant_id: "tenant_1234",
|
|
678
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
666
679
|
* body: {
|
|
667
|
-
* content: "content"
|
|
680
|
+
* content: "<content>"
|
|
668
681
|
* }
|
|
669
682
|
* })
|
|
670
683
|
*/
|
|
@@ -755,10 +768,11 @@ class Upload {
|
|
|
755
768
|
*
|
|
756
769
|
* @example
|
|
757
770
|
* await client.upload.updateMarkdown({
|
|
758
|
-
* source_id: "
|
|
759
|
-
* tenant_id: "
|
|
771
|
+
* source_id: "CortexDoc1234",
|
|
772
|
+
* tenant_id: "tenant_1234",
|
|
773
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
760
774
|
* body: {
|
|
761
|
-
* content: "content"
|
|
775
|
+
* content: "<content>"
|
|
762
776
|
* }
|
|
763
777
|
* })
|
|
764
778
|
*/
|
|
@@ -850,10 +864,11 @@ class Upload {
|
|
|
850
864
|
*
|
|
851
865
|
* @example
|
|
852
866
|
* await client.upload.updateText({
|
|
853
|
-
* source_id: "
|
|
854
|
-
* tenant_id: "
|
|
867
|
+
* source_id: "CortexDoc1234",
|
|
868
|
+
* tenant_id: "tenant_1234",
|
|
869
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
855
870
|
* body: {
|
|
856
|
-
* content: "content"
|
|
871
|
+
* content: "<content>"
|
|
857
872
|
* }
|
|
858
873
|
* })
|
|
859
874
|
*/
|
|
@@ -945,8 +960,9 @@ class Upload {
|
|
|
945
960
|
*
|
|
946
961
|
* @example
|
|
947
962
|
* await client.upload.uploadEmbeddings({
|
|
948
|
-
* tenant_id: "
|
|
949
|
-
*
|
|
963
|
+
* tenant_id: "tenant_1234",
|
|
964
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
965
|
+
* embeddings: [[0.123413, 0.655367, 0.987654, 0.123456, 0.789012], [0.123413, 0.655367, 0.987654, 0.123456, 0.789012]]
|
|
950
966
|
* })
|
|
951
967
|
*/
|
|
952
968
|
uploadEmbeddings(request, requestOptions) {
|
|
@@ -1036,7 +1052,8 @@ class Upload {
|
|
|
1036
1052
|
*
|
|
1037
1053
|
* @example
|
|
1038
1054
|
* await client.upload.updateEmbeddings({
|
|
1039
|
-
* tenant_id: "
|
|
1055
|
+
* tenant_id: "tenant_1234",
|
|
1056
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
1040
1057
|
* })
|
|
1041
1058
|
*/
|
|
1042
1059
|
updateEmbeddings(request, requestOptions) {
|
|
@@ -1126,8 +1143,10 @@ class Upload {
|
|
|
1126
1143
|
*
|
|
1127
1144
|
* @example
|
|
1128
1145
|
* await client.upload.scrapeWebpage({
|
|
1129
|
-
* web_url: "
|
|
1130
|
-
* tenant_id: "
|
|
1146
|
+
* web_url: "https://www.usecortex.ai/",
|
|
1147
|
+
* tenant_id: "tenant_1234",
|
|
1148
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
1149
|
+
* file_id: "CortexDoc1234",
|
|
1131
1150
|
* body: {}
|
|
1132
1151
|
* })
|
|
1133
1152
|
*/
|
|
@@ -1222,9 +1241,10 @@ class Upload {
|
|
|
1222
1241
|
*
|
|
1223
1242
|
* @example
|
|
1224
1243
|
* await client.upload.updateWebpage({
|
|
1225
|
-
* web_url: "
|
|
1226
|
-
* source_id: "
|
|
1227
|
-
* tenant_id: "
|
|
1244
|
+
* web_url: "https://www.usecortex.ai/",
|
|
1245
|
+
* source_id: "CortexDoc1234",
|
|
1246
|
+
* tenant_id: "tenant_1234",
|
|
1247
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
1228
1248
|
* body: {}
|
|
1229
1249
|
* })
|
|
1230
1250
|
*/
|
|
@@ -1311,8 +1331,8 @@ class Upload {
|
|
|
1311
1331
|
*
|
|
1312
1332
|
* @example
|
|
1313
1333
|
* await client.upload.deleteSource({
|
|
1314
|
-
* tenant_id: "
|
|
1315
|
-
* source_ids: ["
|
|
1334
|
+
* tenant_id: "tenant_1234",
|
|
1335
|
+
* source_ids: ["CortexDoc1234", "CortexDoc4567"]
|
|
1316
1336
|
* })
|
|
1317
1337
|
*/
|
|
1318
1338
|
deleteSource(request, requestOptions) {
|
|
@@ -1378,8 +1398,8 @@ class Upload {
|
|
|
1378
1398
|
*
|
|
1379
1399
|
* @example
|
|
1380
1400
|
* await client.upload.deleteMemory({
|
|
1381
|
-
* tenant_id: "
|
|
1382
|
-
* source_ids: ["
|
|
1401
|
+
* tenant_id: "tenant_1234",
|
|
1402
|
+
* source_ids: ["CortexDoc1234", "CortexDoc4567"]
|
|
1383
1403
|
* })
|
|
1384
1404
|
*/
|
|
1385
1405
|
deleteMemory(request, requestOptions) {
|
|
@@ -1451,7 +1471,8 @@ class Upload {
|
|
|
1451
1471
|
*
|
|
1452
1472
|
* @example
|
|
1453
1473
|
* await client.upload.verifyProcessing({
|
|
1454
|
-
* file_id: "
|
|
1474
|
+
* file_id: "CortexDoc1234",
|
|
1475
|
+
* tenant_id: "tenant_1234"
|
|
1455
1476
|
* })
|
|
1456
1477
|
*/
|
|
1457
1478
|
verifyProcessing(request, requestOptions) {
|
|
@@ -1519,7 +1540,11 @@ class Upload {
|
|
|
1519
1540
|
}
|
|
1520
1541
|
}
|
|
1521
1542
|
async _getAuthorizationHeader() {
|
|
1522
|
-
|
|
1543
|
+
const bearer = await core.Supplier.get(this._options.token);
|
|
1544
|
+
if (bearer != null) {
|
|
1545
|
+
return `Bearer ${bearer}`;
|
|
1546
|
+
}
|
|
1547
|
+
return undefined;
|
|
1523
1548
|
}
|
|
1524
1549
|
}
|
|
1525
1550
|
exports.Upload = Upload;
|
package/dist/api/resources/upload/client/requests/BodyBatchUpdateUploadBatchUpdatePatch.d.ts
CHANGED
|
@@ -6,13 +6,14 @@ import * as core from "../../../../../core/index.js";
|
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
8
|
* files: [fs.createReadStream("/path/to/your/file")],
|
|
9
|
-
* tenant_id: "
|
|
9
|
+
* tenant_id: "tenant_1234",
|
|
10
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
10
11
|
* }
|
|
11
12
|
*/
|
|
12
13
|
export interface BodyBatchUpdateUploadBatchUpdatePatch {
|
|
13
14
|
/** Unique identifier for the tenant/organization */
|
|
14
15
|
tenant_id: string;
|
|
15
|
-
/** Optional sub-tenant identifier
|
|
16
|
+
/** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
|
|
16
17
|
sub_tenant_id?: string;
|
|
17
18
|
/** The document file to upload (e.g., PDF, DOCX, TXT) */
|
|
18
19
|
files: core.file.Uploadable.FileLike[];
|
|
@@ -6,16 +6,19 @@ import * as core from "../../../../../core/index.js";
|
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
8
|
* files: [fs.createReadStream("/path/to/your/file")],
|
|
9
|
-
* tenant_id: "
|
|
9
|
+
* tenant_id: "tenant_1234",
|
|
10
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
10
11
|
* }
|
|
11
12
|
*/
|
|
12
13
|
export interface BodyBatchUploadUploadBatchUploadPost {
|
|
13
14
|
/** Unique identifier for the tenant/organization */
|
|
14
15
|
tenant_id: string;
|
|
15
|
-
/** Optional sub-tenant identifier
|
|
16
|
+
/** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
|
|
16
17
|
sub_tenant_id?: string;
|
|
17
18
|
/** The document file to upload (e.g., PDF, DOCX, TXT) */
|
|
18
19
|
files: core.file.Uploadable.FileLike[];
|
|
20
|
+
/** Optional JSON string array of file IDs for the uploaded content. If not provided or empty, will be generated automatically. */
|
|
21
|
+
file_ids?: string;
|
|
19
22
|
/**
|
|
20
23
|
* JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
21
24
|
*
|
package/dist/api/resources/upload/client/requests/BodyUpdateFileUploadUpdateDocumentPatch.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ import * as core from "../../../../../core/index.js";
|
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
8
|
* file: fs.createReadStream("/path/to/your/file"),
|
|
9
|
-
* source_id: "
|
|
10
|
-
* tenant_id: "
|
|
9
|
+
* source_id: "CortexDoc1234",
|
|
10
|
+
* tenant_id: "tenant_1234",
|
|
11
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
11
12
|
* }
|
|
12
13
|
*/
|
|
13
14
|
export interface BodyUpdateFileUploadUpdateDocumentPatch {
|
|
@@ -15,7 +16,7 @@ export interface BodyUpdateFileUploadUpdateDocumentPatch {
|
|
|
15
16
|
source_id: string;
|
|
16
17
|
/** Unique identifier for the tenant/organization */
|
|
17
18
|
tenant_id: string;
|
|
18
|
-
/** Optional sub-tenant identifier
|
|
19
|
+
/** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
|
|
19
20
|
sub_tenant_id?: string;
|
|
20
21
|
/** The document file to upload (e.g., PDF, DOCX, TXT) */
|
|
21
22
|
file: core.file.Uploadable.FileLike;
|
package/dist/api/resources/upload/client/requests/BodyUploadFilesUploadUploadDocumentPost.d.ts
CHANGED
|
@@ -6,16 +6,19 @@ import * as core from "../../../../../core/index.js";
|
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
8
|
* file: fs.createReadStream("/path/to/your/file"),
|
|
9
|
-
* tenant_id: "
|
|
9
|
+
* tenant_id: "tenant_1234",
|
|
10
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
10
11
|
* }
|
|
11
12
|
*/
|
|
12
13
|
export interface BodyUploadFilesUploadUploadDocumentPost {
|
|
13
14
|
/** Unique identifier for the tenant/organization */
|
|
14
15
|
tenant_id: string;
|
|
15
|
-
/** Optional sub-tenant identifier
|
|
16
|
+
/** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
|
|
16
17
|
sub_tenant_id?: string;
|
|
17
18
|
/** The document file to upload (e.g., PDF, DOCX, TXT) */
|
|
18
19
|
file: core.file.Uploadable.FileLike;
|
|
20
|
+
/** Optional file ID for the uploaded content. If not provided, will be generated automatically. */
|
|
21
|
+
file_id?: string;
|
|
19
22
|
/**
|
|
20
23
|
* JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
21
24
|
*
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
|
-
* tenant_id: "
|
|
7
|
+
* tenant_id: "tenant_1234",
|
|
8
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
8
9
|
* }
|
|
9
10
|
*/
|
|
10
11
|
export interface EmbeddingsUpdateRequest {
|
|
11
12
|
/** Unique identifier for the tenant/organization */
|
|
12
13
|
tenant_id: string;
|
|
13
|
-
/** Optional sub-tenant identifier
|
|
14
|
+
/** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
|
|
14
15
|
sub_tenant_id?: string;
|
|
15
16
|
/** The embeddings of source you want to index */
|
|
16
17
|
embeddings?: Record<string, number[]>;
|
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
|
-
* tenant_id: "
|
|
8
|
-
*
|
|
7
|
+
* tenant_id: "tenant_1234",
|
|
8
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
9
|
+
* embeddings: [[0.123413, 0.655367, 0.987654, 0.123456, 0.789012], [0.123413, 0.655367, 0.987654, 0.123456, 0.789012]]
|
|
9
10
|
* }
|
|
10
11
|
*/
|
|
11
12
|
export interface EmbeddingsUploadRequest {
|
|
12
13
|
/** Unique identifier for the tenant/organization */
|
|
13
14
|
tenant_id: string;
|
|
14
|
-
/** Optional sub-tenant identifier
|
|
15
|
+
/** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
|
|
15
16
|
sub_tenant_id?: string;
|
|
16
17
|
/** The embeddings of source you want to index */
|
|
17
18
|
embeddings: number[][];
|
|
@@ -5,8 +5,10 @@ import * as CortexAI from "../../../../index.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
* web_url: "
|
|
9
|
-
* tenant_id: "
|
|
8
|
+
* web_url: "https://www.usecortex.ai/",
|
|
9
|
+
* tenant_id: "tenant_1234",
|
|
10
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
11
|
+
* file_id: "CortexDoc1234",
|
|
10
12
|
* body: {}
|
|
11
13
|
* }
|
|
12
14
|
*/
|
|
@@ -15,7 +17,7 @@ export interface UploadScrapeWebpageRequest {
|
|
|
15
17
|
web_url: string;
|
|
16
18
|
/** Unique identifier for the tenant/organization */
|
|
17
19
|
tenant_id: string;
|
|
18
|
-
/** Optional sub-tenant identifier
|
|
20
|
+
/** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
|
|
19
21
|
sub_tenant_id?: string;
|
|
20
22
|
/** Optional custom file ID for the scraped content. If not provided, a unique ID will be generated */
|
|
21
23
|
file_id?: string;
|
|
@@ -5,10 +5,11 @@ import * as CortexAI from "../../../../index.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
* source_id: "
|
|
9
|
-
* tenant_id: "
|
|
8
|
+
* source_id: "CortexDoc1234",
|
|
9
|
+
* tenant_id: "tenant_1234",
|
|
10
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
10
11
|
* body: {
|
|
11
|
-
* content: "content"
|
|
12
|
+
* content: "<content>"
|
|
12
13
|
* }
|
|
13
14
|
* }
|
|
14
15
|
*/
|
|
@@ -17,7 +18,7 @@ export interface UploadUpdateMarkdownRequest {
|
|
|
17
18
|
source_id: string;
|
|
18
19
|
/** Unique identifier for the tenant/organization */
|
|
19
20
|
tenant_id: string;
|
|
20
|
-
/** Optional sub-tenant identifier
|
|
21
|
+
/** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
|
|
21
22
|
sub_tenant_id?: string;
|
|
22
23
|
body: CortexAI.MarkdownUploadRequest;
|
|
23
24
|
}
|
|
@@ -5,10 +5,11 @@ import * as CortexAI from "../../../../index.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
* source_id: "
|
|
9
|
-
* tenant_id: "
|
|
8
|
+
* source_id: "CortexDoc1234",
|
|
9
|
+
* tenant_id: "tenant_1234",
|
|
10
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
10
11
|
* body: {
|
|
11
|
-
* content: "content"
|
|
12
|
+
* content: "<content>"
|
|
12
13
|
* }
|
|
13
14
|
* }
|
|
14
15
|
*/
|
|
@@ -17,7 +18,7 @@ export interface UploadUpdateTextRequest {
|
|
|
17
18
|
source_id: string;
|
|
18
19
|
/** Unique identifier for the tenant/organization */
|
|
19
20
|
tenant_id: string;
|
|
20
|
-
/** Optional sub-tenant identifier
|
|
21
|
+
/** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
|
|
21
22
|
sub_tenant_id?: string;
|
|
22
23
|
body: CortexAI.MarkdownUploadRequest;
|
|
23
24
|
}
|
|
@@ -5,9 +5,10 @@ import * as CortexAI from "../../../../index.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
* web_url: "
|
|
9
|
-
* source_id: "
|
|
10
|
-
* tenant_id: "
|
|
8
|
+
* web_url: "https://www.usecortex.ai/",
|
|
9
|
+
* source_id: "CortexDoc1234",
|
|
10
|
+
* tenant_id: "tenant_1234",
|
|
11
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
11
12
|
* body: {}
|
|
12
13
|
* }
|
|
13
14
|
*/
|
|
@@ -18,7 +19,7 @@ export interface UploadUpdateWebpageRequest {
|
|
|
18
19
|
source_id: string;
|
|
19
20
|
/** Unique identifier for the tenant/organization */
|
|
20
21
|
tenant_id: string;
|
|
21
|
-
/** Optional sub-tenant identifier
|
|
22
|
+
/** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
|
|
22
23
|
sub_tenant_id?: string;
|
|
23
24
|
body: CortexAI.BodyUpdateScrapeJobUploadUpdateWebpagePatch;
|
|
24
25
|
}
|