@usecortex_ai/node 0.1.1 → 0.2.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/dist/Client.d.ts +5 -11
- package/dist/Client.js +12 -63
- package/dist/api/resources/document/client/Client.d.ts +59 -0
- package/dist/api/resources/document/client/Client.js +128 -0
- package/dist/api/resources/document/client/index.d.ts +1 -0
- package/dist/api/resources/document/client/index.js +2 -0
- package/dist/api/resources/document/index.d.ts +1 -0
- package/dist/api/resources/document/index.js +17 -0
- package/dist/api/resources/embeddings/client/Client.d.ts +13 -39
- package/dist/api/resources/embeddings/client/Client.js +12 -42
- package/dist/api/resources/embeddings/client/requests/EmbeddingsCreateCollectionRequest.d.ts +1 -0
- package/dist/api/resources/embeddings/client/requests/EmbeddingsDeleteRequest.d.ts +3 -0
- package/dist/api/resources/embeddings/client/requests/EmbeddingsSearchRequest.d.ts +4 -3
- package/dist/api/resources/embeddings/client/requests/GetEmbeddingsBasedOnChunkIdsRequest.d.ts +3 -0
- package/dist/api/resources/fetch/client/Client.d.ts +3 -3
- package/dist/api/resources/fetch/client/Client.js +2 -6
- package/dist/api/resources/fetch/client/requests/FetchContentRequest.d.ts +5 -0
- package/dist/api/resources/index.d.ts +1 -0
- package/dist/api/resources/index.js +2 -1
- package/dist/api/resources/search/client/Client.d.ts +11 -38
- package/dist/api/resources/search/client/Client.js +10 -41
- package/dist/api/resources/search/client/requests/FullTextSearchRequest.d.ts +5 -0
- package/dist/api/resources/search/client/requests/QnARequest.d.ts +17 -0
- package/dist/api/resources/search/client/requests/SearchRequest.d.ts +9 -1
- package/dist/api/resources/sources/client/Client.d.ts +15 -3
- package/dist/api/resources/sources/client/Client.js +14 -6
- package/dist/api/resources/sources/client/requests/SourcesGetAllRequest.d.ts +2 -0
- package/dist/api/resources/sources/client/requests/SourcesGetSubTenantIdsRequest.d.ts +12 -0
- package/dist/api/resources/sources/client/requests/SourcesGetSubTenantIdsRequest.js +5 -0
- package/dist/api/resources/tenant/client/Client.d.ts +55 -5
- package/dist/api/resources/tenant/client/Client.js +173 -8
- package/dist/api/resources/tenant/client/requests/TenantDeleteSubTenantRequest.d.ts +14 -0
- package/dist/api/resources/tenant/client/requests/TenantDeleteSubTenantRequest.js +5 -0
- package/dist/api/resources/tenant/client/requests/TenantGetSubTenantIdsRequest.d.ts +12 -0
- package/dist/api/resources/tenant/client/requests/TenantGetSubTenantIdsRequest.js +5 -0
- package/dist/api/resources/tenant/client/requests/TenantStatsRequest.d.ts +2 -0
- package/dist/api/resources/tenant/client/requests/index.d.ts +2 -0
- package/dist/api/resources/upload/client/Client.d.ts +108 -26
- package/dist/api/resources/upload/client/Client.js +107 -41
- package/dist/api/resources/upload/client/requests/BodyBatchUpdateUploadBatchUpdatePatch.d.ts +17 -1
- package/dist/api/resources/upload/client/requests/BodyBatchUploadUploadBatchUploadPost.d.ts +16 -1
- package/dist/api/resources/upload/client/requests/BodyUpdateFileUploadUpdateDocumentPatch.d.ts +17 -1
- package/dist/api/resources/upload/client/requests/BodyUploadFilesUploadUploadDocumentPost.d.ts +16 -1
- package/dist/api/resources/upload/client/requests/EmbeddingsUpdateRequest.d.ts +5 -6
- package/dist/api/resources/upload/client/requests/EmbeddingsUploadRequest.d.ts +4 -0
- package/dist/api/resources/upload/client/requests/UploadScrapeWebpageRequest.d.ts +4 -0
- package/dist/api/resources/upload/client/requests/UploadUpdateMarkdownRequest.d.ts +23 -0
- package/dist/api/resources/upload/client/requests/UploadUpdateMarkdownRequest.js +5 -0
- package/dist/api/resources/upload/client/requests/UploadUpdateTextRequest.d.ts +23 -0
- package/dist/api/resources/upload/client/requests/UploadUpdateTextRequest.js +5 -0
- package/dist/api/resources/upload/client/requests/UploadUpdateWebpageRequest.d.ts +4 -0
- package/dist/api/resources/upload/client/requests/UploadUploadAppSourcesRequest.d.ts +3 -0
- package/dist/api/resources/upload/client/requests/UploadUploadMarkdownRequest.d.ts +20 -0
- package/dist/api/resources/upload/client/requests/UploadUploadMarkdownRequest.js +5 -0
- package/dist/api/resources/upload/client/requests/UploadUploadTextRequest.d.ts +20 -0
- package/dist/api/resources/upload/client/requests/UploadUploadTextRequest.js +5 -0
- package/dist/api/resources/upload/client/requests/UploadVerifyProcessingRequest.d.ts +2 -0
- package/dist/api/resources/upload/client/requests/index.d.ts +4 -4
- package/dist/api/resources/user/client/Client.d.ts +9 -6
- package/dist/api/resources/user/client/Client.js +8 -9
- package/dist/api/resources/user/client/requests/BodyCreateTenantUserCreateTenantPost.d.ts +1 -0
- package/dist/api/resources/userMemory/client/Client.d.ts +89 -21
- package/dist/api/resources/userMemory/client/Client.js +183 -33
- package/dist/api/resources/userMemory/client/requests/AddUserMemoryRequest.d.ts +18 -0
- package/dist/api/resources/userMemory/client/requests/AddUserMemoryRequest.js +5 -0
- package/dist/api/resources/userMemory/client/requests/GenerateUserMemoryRequest.d.ts +21 -0
- package/dist/api/resources/userMemory/client/requests/GenerateUserMemoryRequest.js +5 -0
- package/dist/api/resources/userMemory/client/requests/RetrieveUserMemoryRequest.d.ts +20 -0
- package/dist/api/resources/userMemory/client/requests/RetrieveUserMemoryRequest.js +5 -0
- package/dist/api/resources/userMemory/client/requests/UserMemoryDeleteUserMemoryRequest.d.ts +5 -3
- package/dist/api/resources/userMemory/client/requests/UserMemoryListUserMemoriesRequest.d.ts +4 -3
- package/dist/api/resources/userMemory/client/requests/index.d.ts +3 -3
- package/dist/api/types/AddUserMemoryResponse.d.ts +14 -0
- package/dist/api/types/AddUserMemoryResponse.js +5 -0
- package/dist/api/types/AppSourcesUploadData.d.ts +4 -2
- package/dist/api/types/AttachmentModel.d.ts +7 -0
- package/dist/api/types/BatchUploadData.d.ts +4 -2
- package/dist/api/types/BodyScrapeWebpageUploadScrapeWebpagePost.d.ts +0 -1
- package/dist/api/types/BodyUpdateScrapeJobUploadUpdateWebpagePatch.d.ts +0 -1
- package/dist/api/types/ContentModel.d.ts +6 -0
- package/dist/api/types/DeleteMemoryRequest.d.ts +3 -0
- package/dist/api/types/DeleteSources.d.ts +7 -0
- package/dist/api/types/DeleteSources.js +5 -0
- package/dist/api/types/DeleteSubTenantData.d.ts +15 -0
- package/dist/api/types/DeleteSubTenantData.js +5 -0
- package/dist/api/types/DeleteUserMemoryResponse.d.ts +12 -0
- package/dist/api/types/DeleteUserMemoryResponse.js +5 -0
- package/dist/api/types/EmbeddingsCreateCollectionData.d.ts +6 -2
- package/dist/api/types/EmbeddingsDeleteData.d.ts +6 -2
- package/dist/api/types/EmbeddingsGetData.d.ts +6 -2
- package/dist/api/types/EmbeddingsSearchData.d.ts +6 -2
- package/dist/api/types/ErrorResponse.d.ts +0 -1
- package/dist/api/types/FetchContentData.d.ts +6 -3
- package/dist/api/types/FileUploadResult.d.ts +2 -0
- package/dist/api/types/GenerateUserMemoryResponse.d.ts +13 -0
- package/dist/api/types/GenerateUserMemoryResponse.js +5 -0
- package/dist/api/types/ListSourcesResponse.d.ts +4 -1
- package/dist/api/types/ListUserMemoriesResponse.d.ts +13 -0
- package/dist/api/types/ListUserMemoriesResponse.js +5 -0
- package/dist/api/types/MarkdownUploadRequest.d.ts +12 -0
- package/dist/api/types/ProcessingStatus.d.ts +5 -2
- package/dist/api/types/Relations.d.ts +2 -2
- package/dist/api/types/RetrieveUserMemoryResponse.d.ts +13 -0
- package/dist/api/types/RetrieveUserMemoryResponse.js +5 -0
- package/dist/api/types/SearchChunk.d.ts +13 -7
- package/dist/api/types/SingleUploadData.d.ts +4 -2
- package/dist/api/types/Source.d.ts +9 -9
- package/dist/api/types/SourceContent.d.ts +2 -2
- package/dist/api/types/SourceModel.d.ts +23 -2
- package/dist/api/types/SubTenantIdsData.d.ts +15 -0
- package/dist/api/types/SubTenantIdsData.js +5 -0
- package/dist/api/types/TenantCreateData.d.ts +6 -2
- package/dist/api/types/TenantStats.d.ts +8 -3
- package/dist/api/types/UserMemory.d.ts +12 -0
- package/dist/api/types/UserMemory.js +5 -0
- package/dist/api/types/index.d.ts +9 -1
- package/dist/api/types/index.js +9 -1
- package/package.json +1 -1
|
@@ -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 Fetch {
|
|
36
|
-
constructor(_options
|
|
36
|
+
constructor(_options) {
|
|
37
37
|
this._options = _options;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
@@ -117,11 +117,7 @@ class Fetch {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
async _getAuthorizationHeader() {
|
|
120
|
-
|
|
121
|
-
if (bearer != null) {
|
|
122
|
-
return `Bearer ${bearer}`;
|
|
123
|
-
}
|
|
124
|
-
return undefined;
|
|
120
|
+
return `Bearer ${await core.Supplier.get(this._options.token)}`;
|
|
125
121
|
}
|
|
126
122
|
}
|
|
127
123
|
exports.Fetch = Fetch;
|
|
@@ -10,9 +10,14 @@
|
|
|
10
10
|
* }
|
|
11
11
|
*/
|
|
12
12
|
export interface FetchContentRequest {
|
|
13
|
+
/** Unique identifier for the file to fetch */
|
|
13
14
|
file_id: string;
|
|
15
|
+
/** Type of file (e.g., 'app', 'file', or other) */
|
|
14
16
|
file_type: string;
|
|
17
|
+
/** Tenant identifier for multi-tenancy */
|
|
15
18
|
tenant_id: string;
|
|
19
|
+
/** Whether to return the file content along with the URL */
|
|
16
20
|
return_content?: boolean;
|
|
21
|
+
/** Sub-tenant identifier, defaults to tenant_id if not provided */
|
|
17
22
|
sub_tenant_id?: string;
|
|
18
23
|
}
|
|
@@ -3,6 +3,7 @@ export * as sources from "./sources/index.js";
|
|
|
3
3
|
export * as userMemory from "./userMemory/index.js";
|
|
4
4
|
export * as fetch from "./fetch/index.js";
|
|
5
5
|
export * as upload from "./upload/index.js";
|
|
6
|
+
export * as document from "./document/index.js";
|
|
6
7
|
export * as embeddings from "./embeddings/index.js";
|
|
7
8
|
export * as user from "./user/index.js";
|
|
8
9
|
export * as tenant from "./tenant/index.js";
|
|
@@ -26,12 +26,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.tenant = exports.user = exports.embeddings = exports.upload = exports.fetch = exports.userMemory = exports.sources = exports.search = void 0;
|
|
29
|
+
exports.tenant = exports.user = exports.embeddings = exports.document = exports.upload = exports.fetch = exports.userMemory = exports.sources = exports.search = void 0;
|
|
30
30
|
exports.search = __importStar(require("./search/index.js"));
|
|
31
31
|
exports.sources = __importStar(require("./sources/index.js"));
|
|
32
32
|
exports.userMemory = __importStar(require("./userMemory/index.js"));
|
|
33
33
|
exports.fetch = __importStar(require("./fetch/index.js"));
|
|
34
34
|
exports.upload = __importStar(require("./upload/index.js"));
|
|
35
|
+
exports.document = __importStar(require("./document/index.js"));
|
|
35
36
|
exports.embeddings = __importStar(require("./embeddings/index.js"));
|
|
36
37
|
exports.user = __importStar(require("./user/index.js"));
|
|
37
38
|
exports.tenant = __importStar(require("./tenant/index.js"));
|
|
@@ -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>;
|
|
13
13
|
/** Additional headers to include in requests. */
|
|
14
14
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
15
15
|
}
|
|
@@ -28,8 +28,10 @@ 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
|
+
* Ask a question to your uploaded knowledge base and let Cortex AI answer it.
|
|
34
|
+
*
|
|
33
35
|
* @param {CortexAI.QnARequest} request
|
|
34
36
|
* @param {Search.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
37
|
*
|
|
@@ -51,25 +53,10 @@ export declare class Search {
|
|
|
51
53
|
qna(request: CortexAI.QnARequest, requestOptions?: Search.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
52
54
|
private __qna;
|
|
53
55
|
/**
|
|
54
|
-
* Search for content within indexed sources
|
|
55
|
-
*
|
|
56
|
-
* This endpoint performs a search query against the Findr backend, allowing users to retrieve
|
|
57
|
-
* relevant content chunks from their indexed documents and sources. The search can be customized
|
|
58
|
-
* with various parameters to control the number of results and search behavior.
|
|
59
|
-
*
|
|
60
|
-
* Args:
|
|
61
|
-
* request (SearchRequest): The search request containing:
|
|
62
|
-
* - query (str): Search query string to find relevant content
|
|
63
|
-
* - tenant_id (str, optional): Tenant identifier for multi-tenancy
|
|
64
|
-
* - sub_tenant_id (str, optional): Sub-tenant identifier, defaults to tenant_id
|
|
65
|
-
* - max_chunks (int, optional): Maximum number of content chunks to return
|
|
66
|
-
* - alpha (Union[float, str], optional): Search algorithm parameter for result ranking (default: 0.8). Can be float-type (0.0-1.0) or 'auto' for dynamic selection
|
|
67
|
-
* - recency_bias (float, optional): Bias towards more recent content (default: 0.5)
|
|
68
|
-
* - num_related_chunks (int, optional): Number of related chunks to return (default: 0)
|
|
69
|
-
* api_details (dict): Authentication details obtained from API key validation
|
|
56
|
+
* Search for relevant content within your indexed sources.
|
|
70
57
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
58
|
+
* This API returns the chunks related to the query you make. We use neural (embedding) search to give you the most relevant chunks.
|
|
59
|
+
* Results are ranked by relevance and can be customized with parameters like result limits and recency preferences.
|
|
73
60
|
*
|
|
74
61
|
* @param {CortexAI.SearchRequest} request
|
|
75
62
|
* @param {Search.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -91,24 +78,10 @@ export declare class Search {
|
|
|
91
78
|
retrieve(request: CortexAI.SearchRequest, requestOptions?: Search.RequestOptions): core.HttpResponsePromise<CortexAI.SearchChunk[]>;
|
|
92
79
|
private __retrieve;
|
|
93
80
|
/**
|
|
94
|
-
*
|
|
95
|
-
* Performs full text search with configurable operators for precise text matching against the Findr backend.
|
|
96
|
-
*
|
|
97
|
-
* This endpoint performs a full text search query against the Findr backend, allowing users to retrieve
|
|
98
|
-
* relevant content chunks from their indexed documents and sources using BM25-based text matching.
|
|
99
|
-
* The search can be customized with various operators to control the matching behavior.
|
|
100
|
-
*
|
|
101
|
-
* Args:
|
|
102
|
-
* request (FullTextSearchRequest): The full text search request containing:
|
|
103
|
-
* - query (str): Search query string to find relevant content
|
|
104
|
-
* - tenant_id (str): Tenant identifier for multi-tenancy
|
|
105
|
-
* - sub_tenant_id (str, optional): Sub-tenant identifier, defaults to tenant_id
|
|
106
|
-
* - operator (BM25OperatorType, optional): Full text search operator type (OR or AND). Defaults to OR
|
|
107
|
-
* - max_chunks (int, optional): Maximum number of content chunks to return (1-1001, defaults to 25)
|
|
108
|
-
* api_details (dict): Authentication details obtained from API key validation
|
|
81
|
+
* Perform full text search for exact matches within your indexed sources.
|
|
109
82
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
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.
|
|
112
85
|
*
|
|
113
86
|
* @param {CortexAI.FullTextSearchRequest} request
|
|
114
87
|
* @param {Search.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -129,5 +102,5 @@ export declare class Search {
|
|
|
129
102
|
*/
|
|
130
103
|
fullTextSearch(request: CortexAI.FullTextSearchRequest, requestOptions?: Search.RequestOptions): core.HttpResponsePromise<CortexAI.SearchChunk[]>;
|
|
131
104
|
private __fullTextSearch;
|
|
132
|
-
protected _getAuthorizationHeader(): Promise<string
|
|
105
|
+
protected _getAuthorizationHeader(): Promise<string>;
|
|
133
106
|
}
|
|
@@ -33,10 +33,12 @@ 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
|
/**
|
|
40
|
+
* Ask a question to your uploaded knowledge base and let Cortex AI answer it.
|
|
41
|
+
*
|
|
40
42
|
* @param {CortexAI.QnARequest} request
|
|
41
43
|
* @param {Search.RequestOptions} requestOptions - Request-specific configuration.
|
|
42
44
|
*
|
|
@@ -117,25 +119,10 @@ class Search {
|
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
/**
|
|
120
|
-
* Search for content within indexed sources
|
|
121
|
-
*
|
|
122
|
-
* This endpoint performs a search query against the Findr backend, allowing users to retrieve
|
|
123
|
-
* relevant content chunks from their indexed documents and sources. The search can be customized
|
|
124
|
-
* with various parameters to control the number of results and search behavior.
|
|
125
|
-
*
|
|
126
|
-
* Args:
|
|
127
|
-
* request (SearchRequest): The search request containing:
|
|
128
|
-
* - query (str): Search query string to find relevant content
|
|
129
|
-
* - tenant_id (str, optional): Tenant identifier for multi-tenancy
|
|
130
|
-
* - sub_tenant_id (str, optional): Sub-tenant identifier, defaults to tenant_id
|
|
131
|
-
* - max_chunks (int, optional): Maximum number of content chunks to return
|
|
132
|
-
* - alpha (Union[float, str], optional): Search algorithm parameter for result ranking (default: 0.8). Can be float-type (0.0-1.0) or 'auto' for dynamic selection
|
|
133
|
-
* - recency_bias (float, optional): Bias towards more recent content (default: 0.5)
|
|
134
|
-
* - num_related_chunks (int, optional): Number of related chunks to return (default: 0)
|
|
135
|
-
* api_details (dict): Authentication details obtained from API key validation
|
|
122
|
+
* Search for relevant content within your indexed sources.
|
|
136
123
|
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
124
|
+
* This API returns the chunks related to the query you make. We use neural (embedding) search to give you the most relevant chunks.
|
|
125
|
+
* Results are ranked by relevance and can be customized with parameters like result limits and recency preferences.
|
|
139
126
|
*
|
|
140
127
|
* @param {CortexAI.SearchRequest} request
|
|
141
128
|
* @param {Search.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -216,24 +203,10 @@ class Search {
|
|
|
216
203
|
}
|
|
217
204
|
}
|
|
218
205
|
/**
|
|
219
|
-
*
|
|
220
|
-
* Performs full text search with configurable operators for precise text matching against the Findr backend.
|
|
206
|
+
* Perform full text search for exact matches within your indexed sources.
|
|
221
207
|
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
* The search can be customized with various operators to control the matching behavior.
|
|
225
|
-
*
|
|
226
|
-
* Args:
|
|
227
|
-
* request (FullTextSearchRequest): The full text search request containing:
|
|
228
|
-
* - query (str): Search query string to find relevant content
|
|
229
|
-
* - tenant_id (str): Tenant identifier for multi-tenancy
|
|
230
|
-
* - sub_tenant_id (str, optional): Sub-tenant identifier, defaults to tenant_id
|
|
231
|
-
* - operator (BM25OperatorType, optional): Full text search operator type (OR or AND). Defaults to OR
|
|
232
|
-
* - max_chunks (int, optional): Maximum number of content chunks to return (1-1001, defaults to 25)
|
|
233
|
-
* api_details (dict): Authentication details obtained from API key validation
|
|
234
|
-
*
|
|
235
|
-
* Returns:
|
|
236
|
-
* FullTextSearchData: Success response with full text search results
|
|
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.
|
|
237
210
|
*
|
|
238
211
|
* @param {CortexAI.FullTextSearchRequest} request
|
|
239
212
|
* @param {Search.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -314,11 +287,7 @@ class Search {
|
|
|
314
287
|
}
|
|
315
288
|
}
|
|
316
289
|
async _getAuthorizationHeader() {
|
|
317
|
-
|
|
318
|
-
if (bearer != null) {
|
|
319
|
-
return `Bearer ${bearer}`;
|
|
320
|
-
}
|
|
321
|
-
return undefined;
|
|
290
|
+
return `Bearer ${await core.Supplier.get(this._options.token)}`;
|
|
322
291
|
}
|
|
323
292
|
}
|
|
324
293
|
exports.Search = Search;
|
|
@@ -10,9 +10,14 @@ import * as CortexAI from "../../../../index.js";
|
|
|
10
10
|
* }
|
|
11
11
|
*/
|
|
12
12
|
export interface FullTextSearchRequest {
|
|
13
|
+
/** Search terms to find in your content */
|
|
13
14
|
query: string;
|
|
15
|
+
/** Unique identifier for the tenant/organization */
|
|
14
16
|
tenant_id: string;
|
|
17
|
+
/** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
|
|
15
18
|
sub_tenant_id?: string;
|
|
19
|
+
/** How to combine search terms (OR or AND) */
|
|
16
20
|
operator?: CortexAI.Bm25OperatorType;
|
|
21
|
+
/** Maximum number of results to return */
|
|
17
22
|
max_chunks?: number;
|
|
18
23
|
}
|
|
@@ -10,21 +10,38 @@
|
|
|
10
10
|
* }
|
|
11
11
|
*/
|
|
12
12
|
export interface QnARequest {
|
|
13
|
+
/** The question to be answered */
|
|
13
14
|
question: string;
|
|
15
|
+
/** Unique identifier for the conversation session. Keep it same when the current question refers to a previous answer or question */
|
|
14
16
|
session_id: string;
|
|
17
|
+
/** Identifier for the tenant/organization */
|
|
15
18
|
tenant_id: string;
|
|
19
|
+
/** List of context strings to provide additional information */
|
|
16
20
|
context_list?: string[];
|
|
21
|
+
/** List of search modes to use for finding relevant information */
|
|
17
22
|
search_modes?: string[];
|
|
23
|
+
/** Identifier for sub-tenant within the tenant */
|
|
18
24
|
sub_tenant_id?: string;
|
|
25
|
+
/** Whether to return text chunks in the response along with final LLM generated answer */
|
|
19
26
|
highlight_chunks?: boolean;
|
|
27
|
+
/** Whether to stream the response */
|
|
20
28
|
stream?: boolean;
|
|
29
|
+
/** Closer to 0.0 means a exact keyword search will be performed, closer to 1.0 means semantics of the search will be considered. In most cases, you wont have to toggle it yourself. */
|
|
21
30
|
search_alpha?: number;
|
|
31
|
+
/** Bias towards more recent information (0.0 to 1.0) */
|
|
22
32
|
recency_bias?: number;
|
|
33
|
+
/** Whether to use AI for generating responses */
|
|
23
34
|
ai_generation?: boolean;
|
|
35
|
+
/** Number of top results to return */
|
|
24
36
|
top_n?: number;
|
|
37
|
+
/** Name of the user making the request. This helps LLM to know the user's name if semantics around the username are involved in query. Its generally a good practice to include it possible. */
|
|
25
38
|
user_name?: string;
|
|
39
|
+
/** Custom instructions for the AI response to add to our proprietary prompt. This can be used to provide additional context or instructions for the LLM to follow so that the answers are tailored towards your application style */
|
|
26
40
|
user_instructions?: string;
|
|
41
|
+
/** Enable advanced multi-step reasoning for complex queries. When enabled, the AI will automatically break down complex questions into multiple research steps to provide more comprehensive and accurate answers. */
|
|
27
42
|
multi_step_reasoning?: boolean;
|
|
43
|
+
/** Enable intelligent agent routing to automatically select the most suitable AI agent for your specific query type. Different agents are optimized for various use cases like social media, code, conversations, general knowledge, etc. */
|
|
28
44
|
auto_agent_routing?: boolean;
|
|
45
|
+
/** Additional metadata for the request */
|
|
29
46
|
metadata?: Record<string, unknown>;
|
|
30
47
|
}
|
|
@@ -9,14 +9,22 @@
|
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface SearchRequest {
|
|
12
|
+
/** Search terms to find relevant content */
|
|
12
13
|
query: string;
|
|
14
|
+
/** Unique identifier for the tenant/organization */
|
|
13
15
|
tenant_id: string;
|
|
16
|
+
/** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
|
|
14
17
|
sub_tenant_id?: string;
|
|
18
|
+
/** Maximum number of results to return */
|
|
15
19
|
max_chunks?: number;
|
|
20
|
+
/** Search ranking algorithm parameter (0.0-1.0 or 'auto') */
|
|
16
21
|
alpha?: SearchRequest.Alpha;
|
|
22
|
+
/** Preference for newer content (0.0 = no bias, 1.0 = strong recency preference) */
|
|
17
23
|
recency_bias?: number;
|
|
18
|
-
num_related_chunks?: number;
|
|
19
24
|
}
|
|
20
25
|
export declare namespace SearchRequest {
|
|
26
|
+
/**
|
|
27
|
+
* Search ranking algorithm parameter (0.0-1.0 or 'auto')
|
|
28
|
+
*/
|
|
21
29
|
type Alpha = number | string;
|
|
22
30
|
}
|
|
@@ -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>;
|
|
13
13
|
/** Additional headers to include in requests. */
|
|
14
14
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
15
15
|
}
|
|
@@ -28,8 +28,14 @@ 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
|
+
* Retrieve all sources for a specific tenant.
|
|
34
|
+
*
|
|
35
|
+
* Use this endpoint to fetch a complete list of all sources associated with your tenant. This includes documents, files, and other content you've uploaded for processing.
|
|
36
|
+
*
|
|
37
|
+
* You can optionally specify a sub-tenant to narrow down the results to sources within that specific sub-tenant scope.
|
|
38
|
+
*
|
|
33
39
|
* @param {CortexAI.SourcesGetAllRequest} request
|
|
34
40
|
* @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
41
|
*
|
|
@@ -49,6 +55,12 @@ export declare class Sources {
|
|
|
49
55
|
getAll(request: CortexAI.SourcesGetAllRequest, requestOptions?: Sources.RequestOptions): core.HttpResponsePromise<CortexAI.ListSourcesResponse>;
|
|
50
56
|
private __getAll;
|
|
51
57
|
/**
|
|
58
|
+
* Retrieve specific sources by their IDs.
|
|
59
|
+
*
|
|
60
|
+
* Use this endpoint to fetch one or more sources by providing their unique identifiers. This is useful when you need detailed information about specific documents or content you've previously uploaded.
|
|
61
|
+
*
|
|
62
|
+
* Provide the source IDs in the request body along with your tenant information to get the exact sources you need.
|
|
63
|
+
*
|
|
52
64
|
* @param {CortexAI.SourceBodyParams} request
|
|
53
65
|
* @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
66
|
*
|
|
@@ -68,5 +80,5 @@ export declare class Sources {
|
|
|
68
80
|
*/
|
|
69
81
|
getByIds(request: CortexAI.SourceBodyParams, requestOptions?: Sources.RequestOptions): core.HttpResponsePromise<CortexAI.ListSourcesResponse>;
|
|
70
82
|
private __getByIds;
|
|
71
|
-
protected _getAuthorizationHeader(): Promise<string
|
|
83
|
+
protected _getAuthorizationHeader(): Promise<string>;
|
|
72
84
|
}
|
|
@@ -33,10 +33,16 @@ 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
|
/**
|
|
40
|
+
* Retrieve all sources for a specific tenant.
|
|
41
|
+
*
|
|
42
|
+
* Use this endpoint to fetch a complete list of all sources associated with your tenant. This includes documents, files, and other content you've uploaded for processing.
|
|
43
|
+
*
|
|
44
|
+
* You can optionally specify a sub-tenant to narrow down the results to sources within that specific sub-tenant scope.
|
|
45
|
+
*
|
|
40
46
|
* @param {CortexAI.SourcesGetAllRequest} request
|
|
41
47
|
* @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
|
|
42
48
|
*
|
|
@@ -118,6 +124,12 @@ class Sources {
|
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
126
|
/**
|
|
127
|
+
* Retrieve specific sources by their IDs.
|
|
128
|
+
*
|
|
129
|
+
* Use this endpoint to fetch one or more sources by providing their unique identifiers. This is useful when you need detailed information about specific documents or content you've previously uploaded.
|
|
130
|
+
*
|
|
131
|
+
* Provide the source IDs in the request body along with your tenant information to get the exact sources you need.
|
|
132
|
+
*
|
|
121
133
|
* @param {CortexAI.SourceBodyParams} request
|
|
122
134
|
* @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
|
|
123
135
|
*
|
|
@@ -197,11 +209,7 @@ class Sources {
|
|
|
197
209
|
}
|
|
198
210
|
}
|
|
199
211
|
async _getAuthorizationHeader() {
|
|
200
|
-
|
|
201
|
-
if (bearer != null) {
|
|
202
|
-
return `Bearer ${bearer}`;
|
|
203
|
-
}
|
|
204
|
-
return undefined;
|
|
212
|
+
return `Bearer ${await core.Supplier.get(this._options.token)}`;
|
|
205
213
|
}
|
|
206
214
|
}
|
|
207
215
|
exports.Sources = Sources;
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* }
|
|
9
9
|
*/
|
|
10
10
|
export interface SourcesGetAllRequest {
|
|
11
|
+
/** Unique identifier for the tenant/organization */
|
|
11
12
|
tenant_id: string;
|
|
13
|
+
/** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
|
|
12
14
|
sub_tenant_id?: string;
|
|
13
15
|
}
|
|
@@ -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>;
|
|
13
13
|
/** Additional headers to include in requests. */
|
|
14
14
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
15
15
|
}
|
|
@@ -28,11 +28,15 @@ 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
|
*
|
|
35
|
-
*
|
|
35
|
+
* Use this endpoint to check whether a tenant exists and view core metrics like total indexed objects and vector dimension. This helps you validate setup and monitor ingestion.
|
|
36
|
+
*
|
|
37
|
+
* Expected outcome
|
|
38
|
+
* - You receive the current object count and vector dimension for the tenant.
|
|
39
|
+
* - If the tenant does not exist, you get a not-found error.
|
|
36
40
|
*
|
|
37
41
|
* @param {CortexAI.TenantStatsRequest} request
|
|
38
42
|
* @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -52,5 +56,51 @@ export declare class Tenant {
|
|
|
52
56
|
*/
|
|
53
57
|
stats(request: CortexAI.TenantStatsRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.TenantStats>;
|
|
54
58
|
private __stats;
|
|
55
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Retrieve all sub-tenant IDs contained within a specific tenant. Fetches the sub-tenant IDs directly from the underlying data store.
|
|
61
|
+
*
|
|
62
|
+
* @param {CortexAI.TenantGetSubTenantIdsRequest} request
|
|
63
|
+
* @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link CortexAI.BadRequestError}
|
|
66
|
+
* @throws {@link CortexAI.UnauthorizedError}
|
|
67
|
+
* @throws {@link CortexAI.ForbiddenError}
|
|
68
|
+
* @throws {@link CortexAI.NotFoundError}
|
|
69
|
+
* @throws {@link CortexAI.UnprocessableEntityError}
|
|
70
|
+
* @throws {@link CortexAI.InternalServerError}
|
|
71
|
+
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* await client.tenant.getSubTenantIds({
|
|
75
|
+
* tenant_id: "tenant_id"
|
|
76
|
+
* })
|
|
77
|
+
*/
|
|
78
|
+
getSubTenantIds(request: CortexAI.TenantGetSubTenantIdsRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.SubTenantIdsData>;
|
|
79
|
+
private __getSubTenantIds;
|
|
80
|
+
/**
|
|
81
|
+
* Delete a sub-tenant from a given tenant.
|
|
82
|
+
*
|
|
83
|
+
* This endpoint deletes a specific sub-tenant from the specified tenant.
|
|
84
|
+
* It validates that the sub-tenant is not the primary/default sub-tenant before deletion.
|
|
85
|
+
*
|
|
86
|
+
* @param {CortexAI.TenantDeleteSubTenantRequest} request
|
|
87
|
+
* @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
|
|
88
|
+
*
|
|
89
|
+
* @throws {@link CortexAI.BadRequestError}
|
|
90
|
+
* @throws {@link CortexAI.UnauthorizedError}
|
|
91
|
+
* @throws {@link CortexAI.ForbiddenError}
|
|
92
|
+
* @throws {@link CortexAI.NotFoundError}
|
|
93
|
+
* @throws {@link CortexAI.UnprocessableEntityError}
|
|
94
|
+
* @throws {@link CortexAI.InternalServerError}
|
|
95
|
+
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* await client.tenant.deleteSubTenant({
|
|
99
|
+
* tenant_id: "tenant_id",
|
|
100
|
+
* sub_tenant_id: "sub_tenant_id"
|
|
101
|
+
* })
|
|
102
|
+
*/
|
|
103
|
+
deleteSubTenant(request: CortexAI.TenantDeleteSubTenantRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.DeleteSubTenantData>;
|
|
104
|
+
private __deleteSubTenant;
|
|
105
|
+
protected _getAuthorizationHeader(): Promise<string>;
|
|
56
106
|
}
|