@usecortex_ai/node 0.3.5 → 0.4.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 +20 -24
- package/dist/Client.js +26 -34
- package/dist/api/errors/BadRequestError.d.ts +1 -2
- package/dist/api/errors/ForbiddenError.d.ts +1 -2
- package/dist/api/errors/InternalServerError.d.ts +1 -2
- package/dist/api/errors/NotFoundError.d.ts +1 -2
- package/dist/api/errors/ServiceUnavailableError.d.ts +1 -2
- package/dist/api/errors/TooManyRequestsError.d.ts +9 -0
- package/dist/api/errors/TooManyRequestsError.js +42 -0
- package/dist/api/errors/UnauthorizedError.d.ts +1 -2
- package/dist/api/errors/index.d.ts +1 -0
- package/dist/api/errors/index.js +1 -0
- package/dist/api/resources/dashboard/client/Client.d.ts +136 -0
- package/dist/api/resources/{userMemory → dashboard}/client/Client.js +191 -138
- package/dist/api/resources/dashboard/client/requests/CreateUserDashboardUserCreateUserPostRequest.d.ts +12 -0
- package/dist/api/resources/dashboard/client/requests/ListSourcesDashboardSourcesGetRequest.d.ts +16 -0
- package/dist/api/resources/dashboard/client/requests/index.d.ts +2 -0
- package/dist/api/resources/embeddings/client/Client.d.ts +40 -27
- package/dist/api/resources/embeddings/client/Client.js +68 -44
- package/dist/api/resources/embeddings/client/requests/BodyFilterRawEmbeddingsEndpointEmbeddingsFilterRawEmbeddingsPost.d.ts +24 -0
- package/dist/api/resources/embeddings/client/requests/BodyInsertRawEmbeddingsEndpointEmbeddingsInsertRawEmbeddingsPost.d.ts +27 -0
- package/dist/api/resources/embeddings/client/requests/BodySearchRawEmbeddingsEndpointEmbeddingsSearchRawEmbeddingsPost.d.ts +25 -0
- package/dist/api/resources/embeddings/client/requests/EmbeddingsDeleteRequest.d.ts +6 -5
- package/dist/api/resources/embeddings/client/requests/index.d.ts +3 -3
- package/dist/api/resources/fetch/client/Client.d.ts +96 -7
- package/dist/api/resources/fetch/client/Client.js +288 -10
- package/dist/api/resources/{sources/client/requests/SourcesGetGraphRelationsByIdRequest.d.ts → fetch/client/requests/FetchGraphRelationsBySourceIdRequest.d.ts} +2 -3
- package/dist/api/resources/{sources/client/requests/SourcesGetAllRequest.d.ts → fetch/client/requests/FetchSourcesRequest.d.ts} +2 -3
- package/dist/api/resources/fetch/client/requests/ListSourcesByIdRequest.d.ts +18 -0
- package/dist/api/resources/{upload/client/requests/UploadUpdateTextRequest.d.ts → fetch/client/requests/SourceFetchRequest.d.ts} +9 -10
- package/dist/api/resources/fetch/client/requests/index.d.ts +4 -1
- package/dist/api/resources/index.d.ts +10 -13
- package/dist/api/resources/index.js +11 -14
- package/dist/api/resources/search/client/Client.d.ts +50 -26
- package/dist/api/resources/search/client/Client.js +65 -35
- package/dist/api/resources/search/client/requests/FullTextSearchRequest.d.ts +6 -4
- package/dist/api/resources/search/client/requests/{SearchRequest.d.ts → HybridSearchRequest.d.ts} +13 -9
- package/dist/api/resources/search/client/requests/QnASearchRequest.d.ts +39 -0
- package/dist/api/resources/search/client/requests/index.d.ts +2 -2
- package/dist/api/resources/sources/client/Client.d.ts +11 -61
- package/dist/api/resources/sources/client/Client.js +14 -191
- package/dist/api/resources/sources/client/requests/SourceDeleteRequest.d.ts +17 -0
- package/dist/api/resources/sources/client/requests/index.d.ts +1 -3
- package/dist/api/resources/tenant/client/Client.d.ts +54 -38
- package/dist/api/resources/tenant/client/Client.js +67 -114
- package/dist/api/resources/tenant/client/requests/TenantCreateRequest.d.ts +20 -0
- package/dist/api/resources/tenant/client/requests/TenantStatsRequest.d.ts +1 -4
- package/dist/api/resources/tenant/client/requests/index.d.ts +1 -2
- package/dist/api/resources/upload/client/Client.d.ts +54 -428
- package/dist/api/resources/upload/client/Client.js +97 -1417
- package/dist/api/resources/upload/client/requests/{UploadUploadMarkdownRequest.d.ts → BodyAddMemoryMemoriesAddMemoryPost.d.ts} +7 -7
- package/dist/api/resources/upload/client/requests/BodyUploadAppIngestionUploadAppPost.d.ts +31 -0
- package/dist/api/resources/upload/client/requests/BodyUploadDocumentIngestionUploadDocumentPost.d.ts +22 -0
- package/dist/api/resources/upload/client/requests/UploadDeleteMemoryRequest.d.ts +18 -0
- package/dist/api/resources/upload/client/requests/UploadVerifyProcessingRequest.d.ts +1 -2
- package/dist/api/resources/upload/client/requests/index.d.ts +4 -16
- package/dist/api/types/AddMemoryResponse.d.ts +17 -0
- package/dist/api/types/ApiKeyInfo.d.ts +17 -0
- package/dist/api/types/AppSourcesUploadData.d.ts +10 -4
- package/dist/api/types/CollectionStats.d.ts +9 -0
- package/dist/api/types/CustomPropertyDefinition.d.ts +38 -0
- package/dist/api/types/DashboardApisResponse.d.ts +12 -0
- package/dist/api/types/DashboardSourcesResponse.d.ts +12 -0
- package/dist/api/types/DashboardTenantsResponse.d.ts +12 -0
- package/dist/api/types/DeleteResult.d.ts +14 -0
- package/dist/api/types/DeleteUserMemoryResponse.d.ts +1 -1
- package/dist/api/types/Entity.d.ts +2 -2
- package/dist/api/types/FetchMode.d.ts +12 -0
- package/dist/api/types/FetchMode.js +11 -0
- package/dist/api/types/GraphContext.d.ts +12 -0
- package/dist/api/types/Infra.d.ts +8 -0
- package/dist/api/types/InsertResult.d.ts +16 -0
- package/dist/api/types/MemoryItem.d.ts +41 -0
- package/dist/api/types/MemoryResultItem.d.ts +19 -0
- package/dist/api/types/MilvusDataType.d.ts +21 -0
- package/dist/api/types/MilvusDataType.js +20 -0
- package/dist/api/types/PathTriplet.d.ts +9 -0
- package/dist/api/types/ProcessingStatus.d.ts +16 -2
- package/dist/api/types/ProcessingStatus.js +12 -0
- package/dist/api/types/QnASearchResponse.d.ts +20 -0
- package/dist/api/types/RawEmbeddingDocument.d.ts +15 -0
- package/dist/api/types/RawEmbeddingSearchResult.d.ts +19 -0
- package/dist/api/types/RawEmbeddingVector.d.ts +12 -0
- package/dist/api/types/RelationEvidence.d.ts +8 -0
- package/dist/api/types/RetrievalResult.d.ts +11 -0
- package/dist/api/types/ScoredPathResponse.d.ts +11 -0
- package/dist/api/types/SearchMode.d.ts +11 -0
- package/dist/api/types/SearchMode.js +10 -0
- package/dist/api/types/SourceDeleteResponse.d.ts +14 -0
- package/dist/api/types/SourceDeleteResultItem.d.ts +14 -0
- package/dist/api/types/SourceFetchResponse.d.ts +26 -0
- package/dist/api/types/{GraphRelationsResponse.d.ts → SourceGraphRelationsResponse.d.ts} +2 -2
- package/dist/api/types/SourceListResponse.d.ts +11 -0
- package/dist/api/types/SourceModel.d.ts +5 -1
- package/dist/api/types/SourceStatus.d.ts +10 -0
- package/dist/api/types/SourceStatus.js +12 -0
- package/dist/api/types/SourceUploadResponse.d.ts +14 -0
- package/dist/api/types/SourceUploadResultItem.d.ts +14 -0
- package/dist/api/types/SupportedLlmProviders.d.ts +11 -0
- package/dist/api/types/SupportedLlmProviders.js +13 -0
- package/dist/api/types/TenantCreateResponse.d.ts +14 -0
- package/dist/api/types/TenantInfo.d.ts +11 -0
- package/dist/api/types/TenantMetadataSchemaInfo.d.ts +14 -0
- package/dist/api/types/TenantStatsResponse.d.ts +14 -0
- package/dist/api/types/{TripleWithEvidence.d.ts → TripletWithEvidence.d.ts} +1 -1
- package/dist/api/types/UserAssistantPair.d.ts +3 -0
- package/dist/api/types/{SearchChunk.d.ts → VectorStoreChunk.d.ts} +3 -6
- package/dist/api/types/index.d.ts +38 -31
- package/dist/api/types/index.js +38 -31
- package/package.json +30 -33
- package/dist/api/resources/document/client/Client.d.ts +0 -59
- package/dist/api/resources/document/client/Client.js +0 -132
- package/dist/api/resources/document/client/index.d.ts +0 -1
- package/dist/api/resources/embeddings/client/requests/EmbeddingsCreateCollectionRequest.d.ts +0 -13
- package/dist/api/resources/embeddings/client/requests/EmbeddingsSearchRequest.d.ts +0 -18
- package/dist/api/resources/embeddings/client/requests/GetEmbeddingsBasedOnChunkIdsRequest.d.ts +0 -18
- package/dist/api/resources/fetch/client/requests/FetchContentRequest.d.ts +0 -18
- package/dist/api/resources/search/client/requests/QnARequest.d.ts +0 -47
- package/dist/api/resources/sources/client/requests/SourceBodyParams.d.ts +0 -18
- package/dist/api/resources/tenant/client/requests/TenantDeleteSubTenantRequest.d.ts +0 -14
- package/dist/api/resources/tenant/client/requests/TenantGetSubTenantIdsRequest.d.ts +0 -12
- package/dist/api/resources/upload/client/requests/BodyBatchUpdateUploadBatchUpdatePatch.d.ts +0 -37
- package/dist/api/resources/upload/client/requests/BodyBatchUploadUploadBatchUploadPost.d.ts +0 -37
- package/dist/api/resources/upload/client/requests/BodyUpdateFileUploadUpdateDocumentPatch.d.ts +0 -38
- package/dist/api/resources/upload/client/requests/BodyUploadFilesUploadUploadDocumentPost.d.ts +0 -37
- package/dist/api/resources/upload/client/requests/EmbeddingsUpdateRequest.d.ts +0 -18
- package/dist/api/resources/upload/client/requests/EmbeddingsUploadRequest.d.ts +0 -21
- package/dist/api/resources/upload/client/requests/UploadBatchScrapeWebpageRequest.d.ts +0 -22
- package/dist/api/resources/upload/client/requests/UploadBatchUploadMarkdownRequest.d.ts +0 -22
- package/dist/api/resources/upload/client/requests/UploadBatchUploadTextRequest.d.ts +0 -22
- package/dist/api/resources/upload/client/requests/UploadScrapeWebpageRequest.d.ts +0 -25
- package/dist/api/resources/upload/client/requests/UploadUpdateMarkdownRequest.d.ts +0 -24
- package/dist/api/resources/upload/client/requests/UploadUpdateWebpageRequest.d.ts +0 -25
- package/dist/api/resources/upload/client/requests/UploadUploadAppSourcesRequest.d.ts +0 -20
- package/dist/api/resources/upload/client/requests/UploadUploadTextRequest.d.ts +0 -21
- package/dist/api/resources/user/client/Client.d.ts +0 -60
- package/dist/api/resources/user/client/Client.js +0 -152
- package/dist/api/resources/user/client/requests/BodyCreateTenantUserCreateTenantPost.d.ts +0 -15
- package/dist/api/resources/user/client/requests/index.d.ts +0 -1
- package/dist/api/resources/user/client/requests/index.js +0 -2
- package/dist/api/resources/user/index.d.ts +0 -1
- package/dist/api/resources/user/index.js +0 -17
- package/dist/api/resources/userMemory/client/Client.d.ts +0 -150
- package/dist/api/resources/userMemory/client/index.d.ts +0 -2
- package/dist/api/resources/userMemory/client/index.js +0 -17
- package/dist/api/resources/userMemory/client/requests/AddUserMemoryRequest.d.ts +0 -27
- package/dist/api/resources/userMemory/client/requests/RetrieveUserMemoryRequest.d.ts +0 -24
- package/dist/api/resources/userMemory/client/requests/UserMemoryDeleteUserMemoryRequest.d.ts +0 -19
- package/dist/api/resources/userMemory/client/requests/UserMemoryListUserMemoriesRequest.d.ts +0 -16
- package/dist/api/resources/userMemory/client/requests/index.d.ts +0 -4
- package/dist/api/resources/userMemory/client/requests/index.js +0 -2
- package/dist/api/resources/userMemory/index.d.ts +0 -1
- package/dist/api/resources/userMemory/index.js +0 -17
- package/dist/api/types/AddUserMemoryResponse.d.ts +0 -16
- package/dist/api/types/BatchUploadData.d.ts +0 -11
- package/dist/api/types/BodyScrapeWebpageUploadScrapeWebpagePost.d.ts +0 -5
- package/dist/api/types/BodyUpdateScrapeJobUploadUpdateWebpagePatch.d.ts +0 -5
- package/dist/api/types/DeleteMemoryRequest.d.ts +0 -11
- package/dist/api/types/DeleteSources.d.ts +0 -7
- package/dist/api/types/DeleteSubTenantData.d.ts +0 -15
- package/dist/api/types/EmbeddingsCreateCollectionData.d.ts +0 -13
- package/dist/api/types/EmbeddingsDeleteData.d.ts +0 -13
- package/dist/api/types/EmbeddingsGetData.d.ts +0 -13
- package/dist/api/types/EmbeddingsSearchData.d.ts +0 -13
- package/dist/api/types/ExtendedContext.d.ts +0 -8
- package/dist/api/types/FetchContentData.d.ts +0 -13
- package/dist/api/types/FileUploadResult.d.ts +0 -9
- package/dist/api/types/ListSourcesResponse.d.ts +0 -12
- package/dist/api/types/ListUserMemoriesResponse.d.ts +0 -13
- package/dist/api/types/MarkdownUploadRequest.d.ts +0 -22
- package/dist/api/types/RelatedChunk.d.ts +0 -9
- package/dist/api/types/RelatedChunk.js +0 -5
- package/dist/api/types/Relations.d.ts +0 -9
- package/dist/api/types/Relations.js +0 -5
- package/dist/api/types/RetrieveResponse.d.ts +0 -12
- package/dist/api/types/RetrieveResponse.js +0 -5
- package/dist/api/types/RetrieveUserMemoryResponse.d.ts +0 -15
- package/dist/api/types/RetrieveUserMemoryResponse.js +0 -5
- package/dist/api/types/SearchChunk.js +0 -5
- package/dist/api/types/SingleUploadData.d.ts +0 -10
- package/dist/api/types/SingleUploadData.js +0 -5
- package/dist/api/types/Source.d.ts +0 -19
- package/dist/api/types/Source.js +0 -5
- package/dist/api/types/SubTenantIdsData.d.ts +0 -17
- package/dist/api/types/SubTenantIdsData.js +0 -5
- package/dist/api/types/TenantCreateData.d.ts +0 -13
- package/dist/api/types/TenantCreateData.js +0 -5
- package/dist/api/types/TenantStats.d.ts +0 -15
- package/dist/api/types/TenantStats.js +0 -5
- package/dist/api/types/TripleWithEvidence.js +0 -5
- package/dist/api/types/UserMemory.d.ts +0 -12
- package/dist/api/types/UserMemory.js +0 -5
- package/dist/api/types/WebpageScrapeRequest.d.ts +0 -9
- package/dist/api/types/WebpageScrapeRequest.js +0 -5
- /package/dist/api/resources/{user → dashboard}/client/index.d.ts +0 -0
- /package/dist/api/resources/{user → dashboard}/client/index.js +0 -0
- /package/dist/api/resources/{embeddings/client/requests/EmbeddingsCreateCollectionRequest.js → dashboard/client/requests/CreateUserDashboardUserCreateUserPostRequest.js} +0 -0
- /package/dist/api/resources/{embeddings/client/requests/EmbeddingsSearchRequest.js → dashboard/client/requests/ListSourcesDashboardSourcesGetRequest.js} +0 -0
- /package/dist/api/resources/{document/client → dashboard/client/requests}/index.js +0 -0
- /package/dist/api/resources/{document → dashboard}/index.d.ts +0 -0
- /package/dist/api/resources/{document → dashboard}/index.js +0 -0
- /package/dist/api/resources/embeddings/client/requests/{GetEmbeddingsBasedOnChunkIdsRequest.js → BodyFilterRawEmbeddingsEndpointEmbeddingsFilterRawEmbeddingsPost.js} +0 -0
- /package/dist/api/resources/{fetch/client/requests/FetchContentRequest.js → embeddings/client/requests/BodyInsertRawEmbeddingsEndpointEmbeddingsInsertRawEmbeddingsPost.js} +0 -0
- /package/dist/api/resources/{search/client/requests/QnARequest.js → embeddings/client/requests/BodySearchRawEmbeddingsEndpointEmbeddingsSearchRawEmbeddingsPost.js} +0 -0
- /package/dist/api/resources/{search/client/requests/SearchRequest.js → fetch/client/requests/FetchGraphRelationsBySourceIdRequest.js} +0 -0
- /package/dist/api/resources/{sources/client/requests/SourceBodyParams.js → fetch/client/requests/FetchSourcesRequest.js} +0 -0
- /package/dist/api/resources/{sources/client/requests/SourcesGetAllRequest.js → fetch/client/requests/ListSourcesByIdRequest.js} +0 -0
- /package/dist/api/resources/{sources/client/requests/SourcesGetGraphRelationsByIdRequest.js → fetch/client/requests/SourceFetchRequest.js} +0 -0
- /package/dist/api/resources/{tenant/client/requests/TenantDeleteSubTenantRequest.js → search/client/requests/HybridSearchRequest.js} +0 -0
- /package/dist/api/resources/{tenant/client/requests/TenantGetSubTenantIdsRequest.js → search/client/requests/QnASearchRequest.js} +0 -0
- /package/dist/api/resources/{upload/client/requests/BodyBatchUpdateUploadBatchUpdatePatch.js → sources/client/requests/SourceDeleteRequest.js} +0 -0
- /package/dist/api/resources/{upload/client/requests/BodyBatchUploadUploadBatchUploadPost.js → tenant/client/requests/TenantCreateRequest.js} +0 -0
- /package/dist/api/resources/upload/client/requests/{BodyUpdateFileUploadUpdateDocumentPatch.js → BodyAddMemoryMemoriesAddMemoryPost.js} +0 -0
- /package/dist/api/resources/upload/client/requests/{BodyUploadFilesUploadUploadDocumentPost.js → BodyUploadAppIngestionUploadAppPost.js} +0 -0
- /package/dist/api/resources/upload/client/requests/{EmbeddingsUpdateRequest.js → BodyUploadDocumentIngestionUploadDocumentPost.js} +0 -0
- /package/dist/api/resources/upload/client/requests/{EmbeddingsUploadRequest.js → UploadDeleteMemoryRequest.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/UploadBatchScrapeWebpageRequest.js → types/AddMemoryResponse.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/UploadBatchUploadMarkdownRequest.js → types/ApiKeyInfo.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/UploadBatchUploadTextRequest.js → types/CollectionStats.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/UploadScrapeWebpageRequest.js → types/CustomPropertyDefinition.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/UploadUpdateMarkdownRequest.js → types/DashboardApisResponse.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/UploadUpdateTextRequest.js → types/DashboardSourcesResponse.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/UploadUpdateWebpageRequest.js → types/DashboardTenantsResponse.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/UploadUploadAppSourcesRequest.js → types/DeleteResult.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/UploadUploadMarkdownRequest.js → types/GraphContext.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/UploadUploadTextRequest.js → types/Infra.js} +0 -0
- /package/dist/api/{resources/user/client/requests/BodyCreateTenantUserCreateTenantPost.js → types/InsertResult.js} +0 -0
- /package/dist/api/{resources/userMemory/client/requests/AddUserMemoryRequest.js → types/MemoryItem.js} +0 -0
- /package/dist/api/{resources/userMemory/client/requests/RetrieveUserMemoryRequest.js → types/MemoryResultItem.js} +0 -0
- /package/dist/api/{resources/userMemory/client/requests/UserMemoryDeleteUserMemoryRequest.js → types/PathTriplet.js} +0 -0
- /package/dist/api/{resources/userMemory/client/requests/UserMemoryListUserMemoriesRequest.js → types/QnASearchResponse.js} +0 -0
- /package/dist/api/types/{AddUserMemoryResponse.js → RawEmbeddingDocument.js} +0 -0
- /package/dist/api/types/{BatchUploadData.js → RawEmbeddingSearchResult.js} +0 -0
- /package/dist/api/types/{BodyScrapeWebpageUploadScrapeWebpagePost.js → RawEmbeddingVector.js} +0 -0
- /package/dist/api/types/{BodyUpdateScrapeJobUploadUpdateWebpagePatch.js → RetrievalResult.js} +0 -0
- /package/dist/api/types/{DeleteMemoryRequest.js → ScoredPathResponse.js} +0 -0
- /package/dist/api/types/{DeleteSources.js → SourceDeleteResponse.js} +0 -0
- /package/dist/api/types/{DeleteSubTenantData.js → SourceDeleteResultItem.js} +0 -0
- /package/dist/api/types/{EmbeddingsCreateCollectionData.js → SourceFetchResponse.js} +0 -0
- /package/dist/api/types/{EmbeddingsDeleteData.js → SourceGraphRelationsResponse.js} +0 -0
- /package/dist/api/types/{EmbeddingsGetData.js → SourceListResponse.js} +0 -0
- /package/dist/api/types/{EmbeddingsSearchData.js → SourceUploadResponse.js} +0 -0
- /package/dist/api/types/{ExtendedContext.js → SourceUploadResultItem.js} +0 -0
- /package/dist/api/types/{FetchContentData.js → TenantCreateResponse.js} +0 -0
- /package/dist/api/types/{FileUploadResult.js → TenantInfo.js} +0 -0
- /package/dist/api/types/{GraphRelationsResponse.js → TenantMetadataSchemaInfo.js} +0 -0
- /package/dist/api/types/{ListSourcesResponse.js → TenantStatsResponse.js} +0 -0
- /package/dist/api/types/{ListUserMemoriesResponse.js → TripletWithEvidence.js} +0 -0
- /package/dist/api/types/{MarkdownUploadRequest.js → VectorStoreChunk.js} +0 -0
|
@@ -37,13 +37,14 @@ class Sources {
|
|
|
37
37
|
this._options = _options;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Remove documents and content from your knowledge base.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
42
|
+
* This endpoint permanently deletes the specified sources from your knowledge base.
|
|
43
|
+
* Once deleted, the content will no longer be available for search or retrieval.
|
|
43
44
|
*
|
|
44
|
-
*
|
|
45
|
+
* Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
|
|
45
46
|
*
|
|
46
|
-
* @param {CortexAI.
|
|
47
|
+
* @param {CortexAI.SourceDeleteRequest} request
|
|
47
48
|
* @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
49
|
*
|
|
49
50
|
* @throws {@link CortexAI.BadRequestError}
|
|
@@ -55,107 +56,20 @@ class Sources {
|
|
|
55
56
|
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
56
57
|
*
|
|
57
58
|
* @example
|
|
58
|
-
* await client.sources.
|
|
59
|
-
* tenant_id: "
|
|
60
|
-
* sub_tenant_id: "
|
|
59
|
+
* await client.sources.delete({
|
|
60
|
+
* tenant_id: "tenant_id",
|
|
61
|
+
* sub_tenant_id: "sub_tenant_id",
|
|
62
|
+
* source_ids: ["source_ids"]
|
|
61
63
|
* })
|
|
62
64
|
*/
|
|
63
|
-
|
|
64
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
65
|
+
delete(request, requestOptions) {
|
|
66
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
65
67
|
}
|
|
66
|
-
async
|
|
67
|
-
var _a, _b, _c;
|
|
68
|
-
const { tenant_id: tenantId, sub_tenant_id: subTenantId } = request;
|
|
69
|
-
const _queryParams = {};
|
|
70
|
-
_queryParams["tenant_id"] = tenantId;
|
|
71
|
-
if (subTenantId != null) {
|
|
72
|
-
_queryParams["sub_tenant_id"] = subTenantId;
|
|
73
|
-
}
|
|
74
|
-
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
75
|
-
const _response = await core.fetcher({
|
|
76
|
-
url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "list/sources"),
|
|
77
|
-
method: "GET",
|
|
78
|
-
headers: _headers,
|
|
79
|
-
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
80
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
81
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
82
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
83
|
-
});
|
|
84
|
-
if (_response.ok) {
|
|
85
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
86
|
-
}
|
|
87
|
-
if (_response.error.reason === "status-code") {
|
|
88
|
-
switch (_response.error.statusCode) {
|
|
89
|
-
case 400:
|
|
90
|
-
throw new CortexAI.BadRequestError(_response.error.body, _response.rawResponse);
|
|
91
|
-
case 401:
|
|
92
|
-
throw new CortexAI.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
93
|
-
case 403:
|
|
94
|
-
throw new CortexAI.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
95
|
-
case 404:
|
|
96
|
-
throw new CortexAI.NotFoundError(_response.error.body, _response.rawResponse);
|
|
97
|
-
case 422:
|
|
98
|
-
throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
99
|
-
case 500:
|
|
100
|
-
throw new CortexAI.InternalServerError(_response.error.body, _response.rawResponse);
|
|
101
|
-
case 503:
|
|
102
|
-
throw new CortexAI.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
103
|
-
default:
|
|
104
|
-
throw new errors.CortexAIError({
|
|
105
|
-
statusCode: _response.error.statusCode,
|
|
106
|
-
body: _response.error.body,
|
|
107
|
-
rawResponse: _response.rawResponse,
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
switch (_response.error.reason) {
|
|
112
|
-
case "non-json":
|
|
113
|
-
throw new errors.CortexAIError({
|
|
114
|
-
statusCode: _response.error.statusCode,
|
|
115
|
-
body: _response.error.rawBody,
|
|
116
|
-
rawResponse: _response.rawResponse,
|
|
117
|
-
});
|
|
118
|
-
case "timeout":
|
|
119
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /list/sources.");
|
|
120
|
-
case "unknown":
|
|
121
|
-
throw new errors.CortexAIError({
|
|
122
|
-
message: _response.error.errorMessage,
|
|
123
|
-
rawResponse: _response.rawResponse,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Retrieve specific sources by their IDs.
|
|
129
|
-
*
|
|
130
|
-
* 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.
|
|
131
|
-
*
|
|
132
|
-
* Provide the source IDs in the request body along with your tenant information to get the exact sources you need.
|
|
133
|
-
*
|
|
134
|
-
* @param {CortexAI.SourceBodyParams} request
|
|
135
|
-
* @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
|
|
136
|
-
*
|
|
137
|
-
* @throws {@link CortexAI.BadRequestError}
|
|
138
|
-
* @throws {@link CortexAI.UnauthorizedError}
|
|
139
|
-
* @throws {@link CortexAI.ForbiddenError}
|
|
140
|
-
* @throws {@link CortexAI.NotFoundError}
|
|
141
|
-
* @throws {@link CortexAI.UnprocessableEntityError}
|
|
142
|
-
* @throws {@link CortexAI.InternalServerError}
|
|
143
|
-
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
* await client.sources.getByIds({
|
|
147
|
-
* tenant_id: "tenant_1234",
|
|
148
|
-
* source_ids: ["CortexDoc1234", "CortexDoc4567"]
|
|
149
|
-
* })
|
|
150
|
-
*/
|
|
151
|
-
getByIds(request, requestOptions) {
|
|
152
|
-
return core.HttpResponsePromise.fromPromise(this.__getByIds(request, requestOptions));
|
|
153
|
-
}
|
|
154
|
-
async __getByIds(request, requestOptions) {
|
|
68
|
+
async __delete(request, requestOptions) {
|
|
155
69
|
var _a, _b, _c;
|
|
156
70
|
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
157
71
|
const _response = await core.fetcher({
|
|
158
|
-
url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "
|
|
72
|
+
url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "delete/delete-sources"),
|
|
159
73
|
method: "POST",
|
|
160
74
|
headers: _headers,
|
|
161
75
|
contentType: "application/json",
|
|
@@ -201,98 +115,7 @@ class Sources {
|
|
|
201
115
|
rawResponse: _response.rawResponse,
|
|
202
116
|
});
|
|
203
117
|
case "timeout":
|
|
204
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /
|
|
205
|
-
case "unknown":
|
|
206
|
-
throw new errors.CortexAIError({
|
|
207
|
-
message: _response.error.errorMessage,
|
|
208
|
-
rawResponse: _response.rawResponse,
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Retrieve relations for a specific source.
|
|
214
|
-
*
|
|
215
|
-
* Use this endpoint to fetch all relations associated with a specific source. This is useful when you need to understand the relationships between entities within a source.
|
|
216
|
-
*
|
|
217
|
-
* Provide the source ID in the request body along with your tenant information to get the relations for that source.
|
|
218
|
-
*
|
|
219
|
-
* @param {CortexAI.SourcesGetGraphRelationsByIdRequest} request
|
|
220
|
-
* @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
|
|
221
|
-
*
|
|
222
|
-
* @throws {@link CortexAI.BadRequestError}
|
|
223
|
-
* @throws {@link CortexAI.UnauthorizedError}
|
|
224
|
-
* @throws {@link CortexAI.ForbiddenError}
|
|
225
|
-
* @throws {@link CortexAI.NotFoundError}
|
|
226
|
-
* @throws {@link CortexAI.UnprocessableEntityError}
|
|
227
|
-
* @throws {@link CortexAI.InternalServerError}
|
|
228
|
-
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
229
|
-
*
|
|
230
|
-
* @example
|
|
231
|
-
* await client.sources.getGraphRelationsById({
|
|
232
|
-
* source_id: "CortexDoc1234",
|
|
233
|
-
* tenant_id: "tenant_1234"
|
|
234
|
-
* })
|
|
235
|
-
*/
|
|
236
|
-
getGraphRelationsById(request, requestOptions) {
|
|
237
|
-
return core.HttpResponsePromise.fromPromise(this.__getGraphRelationsById(request, requestOptions));
|
|
238
|
-
}
|
|
239
|
-
async __getGraphRelationsById(request, requestOptions) {
|
|
240
|
-
var _a, _b, _c;
|
|
241
|
-
const { source_id: sourceId, tenant_id: tenantId, sub_tenant_id: subTenantId } = request;
|
|
242
|
-
const _queryParams = {};
|
|
243
|
-
_queryParams["source_id"] = sourceId;
|
|
244
|
-
if (tenantId != null) {
|
|
245
|
-
_queryParams["tenant_id"] = tenantId;
|
|
246
|
-
}
|
|
247
|
-
if (subTenantId != null) {
|
|
248
|
-
_queryParams["sub_tenant_id"] = subTenantId;
|
|
249
|
-
}
|
|
250
|
-
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
251
|
-
const _response = await core.fetcher({
|
|
252
|
-
url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "list/graph_relations_by_id"),
|
|
253
|
-
method: "GET",
|
|
254
|
-
headers: _headers,
|
|
255
|
-
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
256
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
257
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
258
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
259
|
-
});
|
|
260
|
-
if (_response.ok) {
|
|
261
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
262
|
-
}
|
|
263
|
-
if (_response.error.reason === "status-code") {
|
|
264
|
-
switch (_response.error.statusCode) {
|
|
265
|
-
case 400:
|
|
266
|
-
throw new CortexAI.BadRequestError(_response.error.body, _response.rawResponse);
|
|
267
|
-
case 401:
|
|
268
|
-
throw new CortexAI.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
269
|
-
case 403:
|
|
270
|
-
throw new CortexAI.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
271
|
-
case 404:
|
|
272
|
-
throw new CortexAI.NotFoundError(_response.error.body, _response.rawResponse);
|
|
273
|
-
case 422:
|
|
274
|
-
throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
275
|
-
case 500:
|
|
276
|
-
throw new CortexAI.InternalServerError(_response.error.body, _response.rawResponse);
|
|
277
|
-
case 503:
|
|
278
|
-
throw new CortexAI.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
279
|
-
default:
|
|
280
|
-
throw new errors.CortexAIError({
|
|
281
|
-
statusCode: _response.error.statusCode,
|
|
282
|
-
body: _response.error.body,
|
|
283
|
-
rawResponse: _response.rawResponse,
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
switch (_response.error.reason) {
|
|
288
|
-
case "non-json":
|
|
289
|
-
throw new errors.CortexAIError({
|
|
290
|
-
statusCode: _response.error.statusCode,
|
|
291
|
-
body: _response.error.rawBody,
|
|
292
|
-
rawResponse: _response.rawResponse,
|
|
293
|
-
});
|
|
294
|
-
case "timeout":
|
|
295
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /list/graph_relations_by_id.");
|
|
118
|
+
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /delete/delete-sources.");
|
|
296
119
|
case "unknown":
|
|
297
120
|
throw new errors.CortexAIError({
|
|
298
121
|
message: _response.error.errorMessage,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* tenant_id: "tenant_id",
|
|
8
|
+
* sub_tenant_id: "sub_tenant_id",
|
|
9
|
+
* source_ids: ["source_ids"]
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export interface SourceDeleteRequest {
|
|
13
|
+
tenant_id: string;
|
|
14
|
+
sub_tenant_id: string;
|
|
15
|
+
/** List of source IDs to delete. */
|
|
16
|
+
source_ids: string[];
|
|
17
|
+
}
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export { type
|
|
2
|
-
export { type SourceBodyParams } from "./SourceBodyParams.js";
|
|
3
|
-
export { type SourcesGetGraphRelationsByIdRequest } from "./SourcesGetGraphRelationsByIdRequest.js";
|
|
1
|
+
export { type SourceDeleteRequest } from "./SourceDeleteRequest.js";
|
|
@@ -30,37 +30,48 @@ export declare class Tenant {
|
|
|
30
30
|
protected readonly _options: Tenant.Options;
|
|
31
31
|
constructor(_options?: Tenant.Options);
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Create a tenant for your account.
|
|
34
34
|
*
|
|
35
|
-
* Use this endpoint to
|
|
35
|
+
* Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search.
|
|
36
36
|
*
|
|
37
|
-
*
|
|
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.
|
|
37
|
+
* **Tenant Metadata Schema**
|
|
40
38
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
39
|
+
* You can optionally provide a `tenant_metadata_schema` to define custom fields that will be
|
|
40
|
+
* indexed in the vector store. Each field can be configured with:
|
|
43
41
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* @throws {@link CortexAI.NotFoundError}
|
|
48
|
-
* @throws {@link CortexAI.UnprocessableEntityError}
|
|
49
|
-
* @throws {@link CortexAI.InternalServerError}
|
|
50
|
-
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
42
|
+
* - `enable_match`: Enable text filtering on this field
|
|
43
|
+
* - `enable_dense_embedding`: Create dense embeddings for semantic similarity search
|
|
44
|
+
* - `enable_sparse_embedding`: Create sparse embeddings (BM25) for keyword search
|
|
51
45
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
*
|
|
46
|
+
* **Example Request:**
|
|
47
|
+
* ```json
|
|
48
|
+
* {
|
|
49
|
+
* "tenant_id": "my-tenant",
|
|
50
|
+
* "tenant_metadata_schema": [
|
|
51
|
+
* {
|
|
52
|
+
* "name": "category",
|
|
53
|
+
* "data_type": "VARCHAR",
|
|
54
|
+
* "max_length": 256,
|
|
55
|
+
* "enable_match": true
|
|
56
|
+
* },
|
|
57
|
+
* {
|
|
58
|
+
* "name": "product_description",
|
|
59
|
+
* "data_type": "VARCHAR",
|
|
60
|
+
* "max_length": 4096,
|
|
61
|
+
* "enable_dense_embedding": true,
|
|
62
|
+
* "enable_sparse_embedding": true
|
|
63
|
+
* }
|
|
64
|
+
* ]
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* Expected outcome:
|
|
69
|
+
* - A tenant is created and returned with its identifier.
|
|
70
|
+
* - If tenant_metadata_schema is provided, the vector store collection will include
|
|
71
|
+
* the specified custom fields with their configured search capabilities.
|
|
72
|
+
* - If the tenant already exists, you receive a success message with the existing identifier.
|
|
62
73
|
*
|
|
63
|
-
* @param {CortexAI.
|
|
74
|
+
* @param {CortexAI.TenantCreateRequest} request
|
|
64
75
|
* @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
|
|
65
76
|
*
|
|
66
77
|
* @throws {@link CortexAI.BadRequestError}
|
|
@@ -72,19 +83,25 @@ export declare class Tenant {
|
|
|
72
83
|
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
73
84
|
*
|
|
74
85
|
* @example
|
|
75
|
-
* await client.tenant.
|
|
76
|
-
* tenant_id: "
|
|
86
|
+
* await client.tenant.createTenant({
|
|
87
|
+
* tenant_id: "tenant_id"
|
|
77
88
|
* })
|
|
78
89
|
*/
|
|
79
|
-
|
|
80
|
-
private
|
|
90
|
+
createTenant(request: CortexAI.TenantCreateRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.TenantCreateResponse>;
|
|
91
|
+
private __createTenant;
|
|
81
92
|
/**
|
|
82
|
-
*
|
|
93
|
+
* Retrieve usage stats for your tenant.
|
|
83
94
|
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
95
|
+
* Use this endpoint to check whether a tenant exists and view core metrics like total
|
|
96
|
+
* indexed objects and vector dimension. This helps you validate
|
|
97
|
+
* setup and monitor ingestion.
|
|
86
98
|
*
|
|
87
|
-
*
|
|
99
|
+
* Expected outcome
|
|
100
|
+
*
|
|
101
|
+
* You receive the current object count and vector dimension for the tenant.
|
|
102
|
+
* If the tenant does not exist, you get a not-found error.
|
|
103
|
+
*
|
|
104
|
+
* @param {CortexAI.TenantStatsRequest} request
|
|
88
105
|
* @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
|
|
89
106
|
*
|
|
90
107
|
* @throws {@link CortexAI.BadRequestError}
|
|
@@ -96,12 +113,11 @@ export declare class Tenant {
|
|
|
96
113
|
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
97
114
|
*
|
|
98
115
|
* @example
|
|
99
|
-
* await client.tenant.
|
|
100
|
-
* tenant_id: "
|
|
101
|
-
* sub_tenant_id: "sub_tenant_4567"
|
|
116
|
+
* await client.tenant.stats({
|
|
117
|
+
* tenant_id: "tenant_id"
|
|
102
118
|
* })
|
|
103
119
|
*/
|
|
104
|
-
|
|
105
|
-
private
|
|
120
|
+
stats(request: CortexAI.TenantStatsRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.TenantStatsResponse>;
|
|
121
|
+
private __stats;
|
|
106
122
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
107
123
|
}
|
|
@@ -37,99 +37,48 @@ class Tenant {
|
|
|
37
37
|
this._options = _options;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Create a tenant for your account.
|
|
41
41
|
*
|
|
42
|
-
* Use this endpoint to
|
|
42
|
+
* Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search.
|
|
43
43
|
*
|
|
44
|
-
*
|
|
45
|
-
* - You receive the current object count and vector dimension for the tenant.
|
|
46
|
-
* - If the tenant does not exist, you get a not-found error.
|
|
44
|
+
* **Tenant Metadata Schema**
|
|
47
45
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
46
|
+
* You can optionally provide a `tenant_metadata_schema` to define custom fields that will be
|
|
47
|
+
* indexed in the vector store. Each field can be configured with:
|
|
50
48
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* @throws {@link CortexAI.NotFoundError}
|
|
55
|
-
* @throws {@link CortexAI.UnprocessableEntityError}
|
|
56
|
-
* @throws {@link CortexAI.InternalServerError}
|
|
57
|
-
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
49
|
+
* - `enable_match`: Enable text filtering on this field
|
|
50
|
+
* - `enable_dense_embedding`: Create dense embeddings for semantic similarity search
|
|
51
|
+
* - `enable_sparse_embedding`: Create sparse embeddings (BM25) for keyword search
|
|
58
52
|
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
headers: _headers,
|
|
81
|
-
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
82
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
83
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
84
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
85
|
-
});
|
|
86
|
-
if (_response.ok) {
|
|
87
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
88
|
-
}
|
|
89
|
-
if (_response.error.reason === "status-code") {
|
|
90
|
-
switch (_response.error.statusCode) {
|
|
91
|
-
case 400:
|
|
92
|
-
throw new CortexAI.BadRequestError(_response.error.body, _response.rawResponse);
|
|
93
|
-
case 401:
|
|
94
|
-
throw new CortexAI.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
95
|
-
case 403:
|
|
96
|
-
throw new CortexAI.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
97
|
-
case 404:
|
|
98
|
-
throw new CortexAI.NotFoundError(_response.error.body, _response.rawResponse);
|
|
99
|
-
case 422:
|
|
100
|
-
throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
101
|
-
case 500:
|
|
102
|
-
throw new CortexAI.InternalServerError(_response.error.body, _response.rawResponse);
|
|
103
|
-
case 503:
|
|
104
|
-
throw new CortexAI.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
105
|
-
default:
|
|
106
|
-
throw new errors.CortexAIError({
|
|
107
|
-
statusCode: _response.error.statusCode,
|
|
108
|
-
body: _response.error.body,
|
|
109
|
-
rawResponse: _response.rawResponse,
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
switch (_response.error.reason) {
|
|
114
|
-
case "non-json":
|
|
115
|
-
throw new errors.CortexAIError({
|
|
116
|
-
statusCode: _response.error.statusCode,
|
|
117
|
-
body: _response.error.rawBody,
|
|
118
|
-
rawResponse: _response.rawResponse,
|
|
119
|
-
});
|
|
120
|
-
case "timeout":
|
|
121
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /tenant/stats.");
|
|
122
|
-
case "unknown":
|
|
123
|
-
throw new errors.CortexAIError({
|
|
124
|
-
message: _response.error.errorMessage,
|
|
125
|
-
rawResponse: _response.rawResponse,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Retrieve all sub-tenant IDs contained within a specific tenant. Fetches the sub-tenant IDs directly from the underlying data store.
|
|
53
|
+
* **Example Request:**
|
|
54
|
+
* ```json
|
|
55
|
+
* {
|
|
56
|
+
* "tenant_id": "my-tenant",
|
|
57
|
+
* "tenant_metadata_schema": [
|
|
58
|
+
* {
|
|
59
|
+
* "name": "category",
|
|
60
|
+
* "data_type": "VARCHAR",
|
|
61
|
+
* "max_length": 256,
|
|
62
|
+
* "enable_match": true
|
|
63
|
+
* },
|
|
64
|
+
* {
|
|
65
|
+
* "name": "product_description",
|
|
66
|
+
* "data_type": "VARCHAR",
|
|
67
|
+
* "max_length": 4096,
|
|
68
|
+
* "enable_dense_embedding": true,
|
|
69
|
+
* "enable_sparse_embedding": true
|
|
70
|
+
* }
|
|
71
|
+
* ]
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
131
74
|
*
|
|
132
|
-
*
|
|
75
|
+
* Expected outcome:
|
|
76
|
+
* - A tenant is created and returned with its identifier.
|
|
77
|
+
* - If tenant_metadata_schema is provided, the vector store collection will include
|
|
78
|
+
* the specified custom fields with their configured search capabilities.
|
|
79
|
+
* - If the tenant already exists, you receive a success message with the existing identifier.
|
|
80
|
+
*
|
|
81
|
+
* @param {CortexAI.TenantCreateRequest} request
|
|
133
82
|
* @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
|
|
134
83
|
*
|
|
135
84
|
* @throws {@link CortexAI.BadRequestError}
|
|
@@ -141,24 +90,24 @@ class Tenant {
|
|
|
141
90
|
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
142
91
|
*
|
|
143
92
|
* @example
|
|
144
|
-
* await client.tenant.
|
|
145
|
-
* tenant_id: "
|
|
93
|
+
* await client.tenant.createTenant({
|
|
94
|
+
* tenant_id: "tenant_id"
|
|
146
95
|
* })
|
|
147
96
|
*/
|
|
148
|
-
|
|
149
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
97
|
+
createTenant(request, requestOptions) {
|
|
98
|
+
return core.HttpResponsePromise.fromPromise(this.__createTenant(request, requestOptions));
|
|
150
99
|
}
|
|
151
|
-
async
|
|
100
|
+
async __createTenant(request, requestOptions) {
|
|
152
101
|
var _a, _b, _c;
|
|
153
|
-
const { tenant_id: tenantId } = request;
|
|
154
|
-
const _queryParams = {};
|
|
155
|
-
_queryParams["tenant_id"] = tenantId;
|
|
156
102
|
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
157
103
|
const _response = await core.fetcher({
|
|
158
|
-
url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "
|
|
159
|
-
method: "
|
|
104
|
+
url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "tenants/create"),
|
|
105
|
+
method: "POST",
|
|
160
106
|
headers: _headers,
|
|
161
|
-
|
|
107
|
+
contentType: "application/json",
|
|
108
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
109
|
+
requestType: "json",
|
|
110
|
+
body: request,
|
|
162
111
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
163
112
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
164
113
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -198,7 +147,7 @@ class Tenant {
|
|
|
198
147
|
rawResponse: _response.rawResponse,
|
|
199
148
|
});
|
|
200
149
|
case "timeout":
|
|
201
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling
|
|
150
|
+
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /tenants/create.");
|
|
202
151
|
case "unknown":
|
|
203
152
|
throw new errors.CortexAIError({
|
|
204
153
|
message: _response.error.errorMessage,
|
|
@@ -207,12 +156,18 @@ class Tenant {
|
|
|
207
156
|
}
|
|
208
157
|
}
|
|
209
158
|
/**
|
|
210
|
-
*
|
|
159
|
+
* Retrieve usage stats for your tenant.
|
|
160
|
+
*
|
|
161
|
+
* Use this endpoint to check whether a tenant exists and view core metrics like total
|
|
162
|
+
* indexed objects and vector dimension. This helps you validate
|
|
163
|
+
* setup and monitor ingestion.
|
|
164
|
+
*
|
|
165
|
+
* Expected outcome
|
|
211
166
|
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
167
|
+
* You receive the current object count and vector dimension for the tenant.
|
|
168
|
+
* If the tenant does not exist, you get a not-found error.
|
|
214
169
|
*
|
|
215
|
-
* @param {CortexAI.
|
|
170
|
+
* @param {CortexAI.TenantStatsRequest} request
|
|
216
171
|
* @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
|
|
217
172
|
*
|
|
218
173
|
* @throws {@link CortexAI.BadRequestError}
|
|
@@ -224,24 +179,22 @@ class Tenant {
|
|
|
224
179
|
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
225
180
|
*
|
|
226
181
|
* @example
|
|
227
|
-
* await client.tenant.
|
|
228
|
-
* tenant_id: "
|
|
229
|
-
* sub_tenant_id: "sub_tenant_4567"
|
|
182
|
+
* await client.tenant.stats({
|
|
183
|
+
* tenant_id: "tenant_id"
|
|
230
184
|
* })
|
|
231
185
|
*/
|
|
232
|
-
|
|
233
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
186
|
+
stats(request, requestOptions) {
|
|
187
|
+
return core.HttpResponsePromise.fromPromise(this.__stats(request, requestOptions));
|
|
234
188
|
}
|
|
235
|
-
async
|
|
189
|
+
async __stats(request, requestOptions) {
|
|
236
190
|
var _a, _b, _c;
|
|
237
|
-
const { tenant_id: tenantId
|
|
191
|
+
const { tenant_id: tenantId } = request;
|
|
238
192
|
const _queryParams = {};
|
|
239
193
|
_queryParams["tenant_id"] = tenantId;
|
|
240
|
-
_queryParams["sub_tenant_id"] = subTenantId;
|
|
241
194
|
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
242
195
|
const _response = await core.fetcher({
|
|
243
|
-
url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "
|
|
244
|
-
method: "
|
|
196
|
+
url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "tenants/stats"),
|
|
197
|
+
method: "GET",
|
|
245
198
|
headers: _headers,
|
|
246
199
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
247
200
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -283,7 +236,7 @@ class Tenant {
|
|
|
283
236
|
rawResponse: _response.rawResponse,
|
|
284
237
|
});
|
|
285
238
|
case "timeout":
|
|
286
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling
|
|
239
|
+
throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /tenants/stats.");
|
|
287
240
|
case "unknown":
|
|
288
241
|
throw new errors.CortexAIError({
|
|
289
242
|
message: _response.error.errorMessage,
|