@usecortex_ai/node 0.2.1 → 0.3.1
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 +6 -18
- 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 +7 -6
- package/dist/api/resources/sources/client/Client.js +10 -5
- package/dist/api/resources/sources/client/requests/SourceBodyParams.d.ts +6 -2
- package/dist/api/resources/sources/client/requests/SourcesGetAllRequest.d.ts +3 -2
- 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
- package/dist/api/resources/sources/client/requests/SourcesGetSubTenantIdsRequest.d.ts +0 -12
- package/dist/api/resources/sources/client/requests/SourcesGetSubTenantIdsRequest.js +0 -5
- package/dist/api/resources/upload/client/requests/BodyUpdateMarkdownUploadUpdateMarkdownPatch.d.ts +0 -21
- package/dist/api/resources/upload/client/requests/BodyUpdateMarkdownUploadUpdateMarkdownPatch.js +0 -5
- package/dist/api/resources/upload/client/requests/BodyUpdateMarkdownUploadUpdateTextPatch.d.ts +0 -21
- package/dist/api/resources/upload/client/requests/BodyUpdateMarkdownUploadUpdateTextPatch.js +0 -5
- package/dist/api/resources/upload/client/requests/BodyUploadMarkdownUploadUploadMarkdownPost.d.ts +0 -19
- package/dist/api/resources/upload/client/requests/BodyUploadMarkdownUploadUploadMarkdownPost.js +0 -5
- package/dist/api/resources/upload/client/requests/BodyUploadMarkdownUploadUploadTextPost.d.ts +0 -19
- package/dist/api/resources/upload/client/requests/BodyUploadMarkdownUploadUploadTextPost.js +0 -5
- package/dist/api/resources/userMemory/client/requests/UserMemoryAddUserMemoryRequest.d.ts +0 -16
- package/dist/api/resources/userMemory/client/requests/UserMemoryAddUserMemoryRequest.js +0 -5
- package/dist/api/resources/userMemory/client/requests/UserMemoryGenerateUserMemoryRequest.d.ts +0 -18
- package/dist/api/resources/userMemory/client/requests/UserMemoryGenerateUserMemoryRequest.js +0 -5
- package/dist/api/resources/userMemory/client/requests/UserMemoryRetrieveUserMemoryRequest.d.ts +0 -17
- package/dist/api/resources/userMemory/client/requests/UserMemoryRetrieveUserMemoryRequest.js +0 -5
- package/dist/api/types/SourceContent.d.ts +0 -11
- package/dist/api/types/SourceContent.js +0 -5
|
@@ -9,7 +9,7 @@ export declare namespace Search {
|
|
|
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 Search {
|
|
|
28
28
|
}
|
|
29
29
|
export declare class Search {
|
|
30
30
|
protected readonly _options: Search.Options;
|
|
31
|
-
constructor(_options
|
|
31
|
+
constructor(_options?: Search.Options);
|
|
32
32
|
/**
|
|
33
33
|
* Ask a question to your uploaded knowledge base and let Cortex AI answer it.
|
|
34
34
|
*
|
|
@@ -45,9 +45,9 @@ export declare class Search {
|
|
|
45
45
|
*
|
|
46
46
|
* @example
|
|
47
47
|
* await client.search.qna({
|
|
48
|
-
* question: "
|
|
49
|
-
* session_id: "
|
|
50
|
-
* tenant_id: "
|
|
48
|
+
* question: "What is Cortex AI",
|
|
49
|
+
* session_id: "chat_session_1234",
|
|
50
|
+
* tenant_id: "tenant_1234"
|
|
51
51
|
* })
|
|
52
52
|
*/
|
|
53
53
|
qna(request: CortexAI.QnARequest, requestOptions?: Search.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
@@ -71,8 +71,8 @@ export declare class Search {
|
|
|
71
71
|
*
|
|
72
72
|
* @example
|
|
73
73
|
* await client.search.retrieve({
|
|
74
|
-
* query: "
|
|
75
|
-
* tenant_id: "
|
|
74
|
+
* query: "Which mode does user prefer",
|
|
75
|
+
* tenant_id: "tenant_1234"
|
|
76
76
|
* })
|
|
77
77
|
*/
|
|
78
78
|
retrieve(request: CortexAI.SearchRequest, requestOptions?: Search.RequestOptions): core.HttpResponsePromise<CortexAI.SearchChunk[]>;
|
|
@@ -81,7 +81,7 @@ export declare class Search {
|
|
|
81
81
|
* Perform full text search for exact matches within your indexed sources.
|
|
82
82
|
*
|
|
83
83
|
* Use this endpoint to find content chunks using BM25-based text matching with configurable operators.
|
|
84
|
-
* Choose between OR and AND operators to control how search terms are combined for precise text matching.
|
|
84
|
+
* Choose between 'OR' and 'AND' operators to control how search terms are combined for precise text matching.
|
|
85
85
|
*
|
|
86
86
|
* @param {CortexAI.FullTextSearchRequest} request
|
|
87
87
|
* @param {Search.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -96,11 +96,11 @@ export declare class Search {
|
|
|
96
96
|
*
|
|
97
97
|
* @example
|
|
98
98
|
* await client.search.fullTextSearch({
|
|
99
|
-
* query: "
|
|
100
|
-
* tenant_id: "
|
|
99
|
+
* query: "John Smith Jake",
|
|
100
|
+
* tenant_id: "tenant_1234"
|
|
101
101
|
* })
|
|
102
102
|
*/
|
|
103
103
|
fullTextSearch(request: CortexAI.FullTextSearchRequest, requestOptions?: Search.RequestOptions): core.HttpResponsePromise<CortexAI.SearchChunk[]>;
|
|
104
104
|
private __fullTextSearch;
|
|
105
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
105
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
106
106
|
}
|
|
@@ -33,7 +33,7 @@ const CortexAI = __importStar(require("../../../index.js"));
|
|
|
33
33
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
34
34
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
35
35
|
class Search {
|
|
36
|
-
constructor(_options) {
|
|
36
|
+
constructor(_options = {}) {
|
|
37
37
|
this._options = _options;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
@@ -52,9 +52,9 @@ class Search {
|
|
|
52
52
|
*
|
|
53
53
|
* @example
|
|
54
54
|
* await client.search.qna({
|
|
55
|
-
* question: "
|
|
56
|
-
* session_id: "
|
|
57
|
-
* tenant_id: "
|
|
55
|
+
* question: "What is Cortex AI",
|
|
56
|
+
* session_id: "chat_session_1234",
|
|
57
|
+
* tenant_id: "tenant_1234"
|
|
58
58
|
* })
|
|
59
59
|
*/
|
|
60
60
|
qna(request, requestOptions) {
|
|
@@ -137,8 +137,8 @@ class Search {
|
|
|
137
137
|
*
|
|
138
138
|
* @example
|
|
139
139
|
* await client.search.retrieve({
|
|
140
|
-
* query: "
|
|
141
|
-
* tenant_id: "
|
|
140
|
+
* query: "Which mode does user prefer",
|
|
141
|
+
* tenant_id: "tenant_1234"
|
|
142
142
|
* })
|
|
143
143
|
*/
|
|
144
144
|
retrieve(request, requestOptions) {
|
|
@@ -206,7 +206,7 @@ class Search {
|
|
|
206
206
|
* Perform full text search for exact matches within your indexed sources.
|
|
207
207
|
*
|
|
208
208
|
* Use this endpoint to find content chunks using BM25-based text matching with configurable operators.
|
|
209
|
-
* Choose between OR and AND operators to control how search terms are combined for precise text matching.
|
|
209
|
+
* Choose between 'OR' and 'AND' operators to control how search terms are combined for precise text matching.
|
|
210
210
|
*
|
|
211
211
|
* @param {CortexAI.FullTextSearchRequest} request
|
|
212
212
|
* @param {Search.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -221,8 +221,8 @@ class Search {
|
|
|
221
221
|
*
|
|
222
222
|
* @example
|
|
223
223
|
* await client.search.fullTextSearch({
|
|
224
|
-
* query: "
|
|
225
|
-
* tenant_id: "
|
|
224
|
+
* query: "John Smith Jake",
|
|
225
|
+
* tenant_id: "tenant_1234"
|
|
226
226
|
* })
|
|
227
227
|
*/
|
|
228
228
|
fullTextSearch(request, requestOptions) {
|
|
@@ -287,7 +287,11 @@ class Search {
|
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
async _getAuthorizationHeader() {
|
|
290
|
-
|
|
290
|
+
const bearer = await core.Supplier.get(this._options.token);
|
|
291
|
+
if (bearer != null) {
|
|
292
|
+
return `Bearer ${bearer}`;
|
|
293
|
+
}
|
|
294
|
+
return undefined;
|
|
291
295
|
}
|
|
292
296
|
}
|
|
293
297
|
exports.Search = Search;
|
|
@@ -5,8 +5,8 @@ import * as CortexAI from "../../../../index.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
* query: "
|
|
9
|
-
* tenant_id: "
|
|
8
|
+
* query: "John Smith Jake",
|
|
9
|
+
* tenant_id: "tenant_1234"
|
|
10
10
|
* }
|
|
11
11
|
*/
|
|
12
12
|
export interface FullTextSearchRequest {
|
|
@@ -14,7 +14,7 @@ export interface FullTextSearchRequest {
|
|
|
14
14
|
query: string;
|
|
15
15
|
/** Unique identifier for the tenant/organization */
|
|
16
16
|
tenant_id: string;
|
|
17
|
-
/** Optional sub-tenant identifier
|
|
17
|
+
/** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
|
|
18
18
|
sub_tenant_id?: string;
|
|
19
19
|
/** How to combine search terms (OR or AND) */
|
|
20
20
|
operator?: CortexAI.Bm25OperatorType;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
|
-
* query: "
|
|
8
|
-
* tenant_id: "
|
|
7
|
+
* query: "Which mode does user prefer",
|
|
8
|
+
* tenant_id: "tenant_1234"
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface SearchRequest {
|
|
@@ -13,7 +13,7 @@ export interface SearchRequest {
|
|
|
13
13
|
query: string;
|
|
14
14
|
/** Unique identifier for the tenant/organization */
|
|
15
15
|
tenant_id: string;
|
|
16
|
-
/** 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. */
|
|
17
17
|
sub_tenant_id?: string;
|
|
18
18
|
/** Maximum number of results to return */
|
|
19
19
|
max_chunks?: number;
|
|
@@ -21,6 +21,8 @@ export interface SearchRequest {
|
|
|
21
21
|
alpha?: SearchRequest.Alpha;
|
|
22
22
|
/** Preference for newer content (0.0 = no bias, 1.0 = strong recency preference) */
|
|
23
23
|
recency_bias?: number;
|
|
24
|
+
/** Enable personalized search results based on user preferences */
|
|
25
|
+
personalise_search?: boolean;
|
|
24
26
|
}
|
|
25
27
|
export declare namespace SearchRequest {
|
|
26
28
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace Sources {
|
|
|
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 Sources {
|
|
|
28
28
|
}
|
|
29
29
|
export declare class Sources {
|
|
30
30
|
protected readonly _options: Sources.Options;
|
|
31
|
-
constructor(_options
|
|
31
|
+
constructor(_options?: Sources.Options);
|
|
32
32
|
/**
|
|
33
33
|
* Retrieve all sources for a specific tenant.
|
|
34
34
|
*
|
|
@@ -49,7 +49,8 @@ export declare class Sources {
|
|
|
49
49
|
*
|
|
50
50
|
* @example
|
|
51
51
|
* await client.sources.getAll({
|
|
52
|
-
* tenant_id: "
|
|
52
|
+
* tenant_id: "tenant_1234",
|
|
53
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
53
54
|
* })
|
|
54
55
|
*/
|
|
55
56
|
getAll(request: CortexAI.SourcesGetAllRequest, requestOptions?: Sources.RequestOptions): core.HttpResponsePromise<CortexAI.ListSourcesResponse>;
|
|
@@ -74,11 +75,11 @@ export declare class Sources {
|
|
|
74
75
|
*
|
|
75
76
|
* @example
|
|
76
77
|
* await client.sources.getByIds({
|
|
77
|
-
* tenant_id: "
|
|
78
|
-
* source_ids: ["
|
|
78
|
+
* tenant_id: "tenant_1234",
|
|
79
|
+
* source_ids: ["CortexDoc1234", "CortexDoc4567"]
|
|
79
80
|
* })
|
|
80
81
|
*/
|
|
81
82
|
getByIds(request: CortexAI.SourceBodyParams, requestOptions?: Sources.RequestOptions): core.HttpResponsePromise<CortexAI.ListSourcesResponse>;
|
|
82
83
|
private __getByIds;
|
|
83
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
84
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
84
85
|
}
|
|
@@ -33,7 +33,7 @@ const CortexAI = __importStar(require("../../../index.js"));
|
|
|
33
33
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
34
34
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
35
35
|
class Sources {
|
|
36
|
-
constructor(_options) {
|
|
36
|
+
constructor(_options = {}) {
|
|
37
37
|
this._options = _options;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
@@ -56,7 +56,8 @@ class Sources {
|
|
|
56
56
|
*
|
|
57
57
|
* @example
|
|
58
58
|
* await client.sources.getAll({
|
|
59
|
-
* tenant_id: "
|
|
59
|
+
* tenant_id: "tenant_1234",
|
|
60
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
60
61
|
* })
|
|
61
62
|
*/
|
|
62
63
|
getAll(request, requestOptions) {
|
|
@@ -143,8 +144,8 @@ class Sources {
|
|
|
143
144
|
*
|
|
144
145
|
* @example
|
|
145
146
|
* await client.sources.getByIds({
|
|
146
|
-
* tenant_id: "
|
|
147
|
-
* source_ids: ["
|
|
147
|
+
* tenant_id: "tenant_1234",
|
|
148
|
+
* source_ids: ["CortexDoc1234", "CortexDoc4567"]
|
|
148
149
|
* })
|
|
149
150
|
*/
|
|
150
151
|
getByIds(request, requestOptions) {
|
|
@@ -209,7 +210,11 @@ class Sources {
|
|
|
209
210
|
}
|
|
210
211
|
}
|
|
211
212
|
async _getAuthorizationHeader() {
|
|
212
|
-
|
|
213
|
+
const bearer = await core.Supplier.get(this._options.token);
|
|
214
|
+
if (bearer != null) {
|
|
215
|
+
return `Bearer ${bearer}`;
|
|
216
|
+
}
|
|
217
|
+
return undefined;
|
|
213
218
|
}
|
|
214
219
|
}
|
|
215
220
|
exports.Sources = Sources;
|
|
@@ -4,11 +4,15 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
|
-
* tenant_id: "
|
|
8
|
-
* source_ids: ["
|
|
7
|
+
* tenant_id: "tenant_1234",
|
|
8
|
+
* source_ids: ["CortexDoc1234", "CortexDoc4567"]
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface SourceBodyParams {
|
|
12
|
+
/** Unique identifier for the tenant/organization */
|
|
12
13
|
tenant_id: string;
|
|
14
|
+
/** List of source IDs to fetch */
|
|
13
15
|
source_ids: string[];
|
|
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. */
|
|
17
|
+
sub_tenant_id?: string;
|
|
14
18
|
}
|
|
@@ -4,12 +4,13 @@
|
|
|
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 SourcesGetAllRequest {
|
|
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
|
}
|
|
@@ -9,7 +9,7 @@ export declare namespace Tenant {
|
|
|
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 Tenant {
|
|
|
28
28
|
}
|
|
29
29
|
export declare class Tenant {
|
|
30
30
|
protected readonly _options: Tenant.Options;
|
|
31
|
-
constructor(_options
|
|
31
|
+
constructor(_options?: Tenant.Options);
|
|
32
32
|
/**
|
|
33
33
|
* Retrieve usage stats for your tenant.
|
|
34
34
|
*
|
|
@@ -51,7 +51,8 @@ export declare class Tenant {
|
|
|
51
51
|
*
|
|
52
52
|
* @example
|
|
53
53
|
* await client.tenant.stats({
|
|
54
|
-
* tenant_id: "
|
|
54
|
+
* tenant_id: "tenant_1234",
|
|
55
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
55
56
|
* })
|
|
56
57
|
*/
|
|
57
58
|
stats(request: CortexAI.TenantStatsRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.TenantStats>;
|
|
@@ -72,7 +73,7 @@ export declare class Tenant {
|
|
|
72
73
|
*
|
|
73
74
|
* @example
|
|
74
75
|
* await client.tenant.getSubTenantIds({
|
|
75
|
-
* tenant_id: "
|
|
76
|
+
* tenant_id: "tenant_1234"
|
|
76
77
|
* })
|
|
77
78
|
*/
|
|
78
79
|
getSubTenantIds(request: CortexAI.TenantGetSubTenantIdsRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.SubTenantIdsData>;
|
|
@@ -96,11 +97,11 @@ export declare class Tenant {
|
|
|
96
97
|
*
|
|
97
98
|
* @example
|
|
98
99
|
* await client.tenant.deleteSubTenant({
|
|
99
|
-
* tenant_id: "
|
|
100
|
-
* sub_tenant_id: "
|
|
100
|
+
* tenant_id: "tenant_1234",
|
|
101
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
101
102
|
* })
|
|
102
103
|
*/
|
|
103
104
|
deleteSubTenant(request: CortexAI.TenantDeleteSubTenantRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.DeleteSubTenantData>;
|
|
104
105
|
private __deleteSubTenant;
|
|
105
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
106
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
106
107
|
}
|
|
@@ -33,7 +33,7 @@ const CortexAI = __importStar(require("../../../index.js"));
|
|
|
33
33
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
34
34
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
35
35
|
class Tenant {
|
|
36
|
-
constructor(_options) {
|
|
36
|
+
constructor(_options = {}) {
|
|
37
37
|
this._options = _options;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
@@ -58,7 +58,8 @@ class Tenant {
|
|
|
58
58
|
*
|
|
59
59
|
* @example
|
|
60
60
|
* await client.tenant.stats({
|
|
61
|
-
* tenant_id: "
|
|
61
|
+
* tenant_id: "tenant_1234",
|
|
62
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
62
63
|
* })
|
|
63
64
|
*/
|
|
64
65
|
stats(request, requestOptions) {
|
|
@@ -141,7 +142,7 @@ class Tenant {
|
|
|
141
142
|
*
|
|
142
143
|
* @example
|
|
143
144
|
* await client.tenant.getSubTenantIds({
|
|
144
|
-
* tenant_id: "
|
|
145
|
+
* tenant_id: "tenant_1234"
|
|
145
146
|
* })
|
|
146
147
|
*/
|
|
147
148
|
getSubTenantIds(request, requestOptions) {
|
|
@@ -224,8 +225,8 @@ class Tenant {
|
|
|
224
225
|
*
|
|
225
226
|
* @example
|
|
226
227
|
* await client.tenant.deleteSubTenant({
|
|
227
|
-
* tenant_id: "
|
|
228
|
-
* sub_tenant_id: "
|
|
228
|
+
* tenant_id: "tenant_1234",
|
|
229
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
229
230
|
* })
|
|
230
231
|
*/
|
|
231
232
|
deleteSubTenant(request, requestOptions) {
|
|
@@ -291,7 +292,11 @@ class Tenant {
|
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
294
|
async _getAuthorizationHeader() {
|
|
294
|
-
|
|
295
|
+
const bearer = await core.Supplier.get(this._options.token);
|
|
296
|
+
if (bearer != null) {
|
|
297
|
+
return `Bearer ${bearer}`;
|
|
298
|
+
}
|
|
299
|
+
return undefined;
|
|
295
300
|
}
|
|
296
301
|
}
|
|
297
302
|
exports.Tenant = Tenant;
|
|
@@ -4,12 +4,13 @@
|
|
|
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 TenantStatsRequest {
|
|
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
|
}
|
|
@@ -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
|
}
|