@usecortex_ai/node 0.5.0 → 0.5.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/LICENSE +23 -23
- package/README.md +141 -141
- package/dist/Client.d.ts +0 -2
- package/dist/Client.js +0 -2
- package/dist/api/errors/BadRequestError.d.ts +0 -0
- package/dist/api/errors/BadRequestError.js +0 -0
- package/dist/api/errors/ForbiddenError.d.ts +0 -0
- package/dist/api/errors/ForbiddenError.js +0 -0
- package/dist/api/errors/InternalServerError.d.ts +0 -0
- package/dist/api/errors/InternalServerError.js +0 -0
- package/dist/api/errors/NotFoundError.d.ts +0 -0
- package/dist/api/errors/NotFoundError.js +0 -0
- package/dist/api/errors/ServiceUnavailableError.d.ts +0 -0
- package/dist/api/errors/ServiceUnavailableError.js +0 -0
- package/dist/api/errors/TooManyRequestsError.d.ts +0 -0
- package/dist/api/errors/TooManyRequestsError.js +0 -0
- package/dist/api/errors/UnauthorizedError.d.ts +0 -0
- package/dist/api/errors/UnauthorizedError.js +0 -0
- package/dist/api/errors/UnprocessableEntityError.d.ts +0 -0
- package/dist/api/errors/UnprocessableEntityError.js +0 -0
- package/dist/api/errors/index.d.ts +0 -0
- package/dist/api/errors/index.js +0 -0
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/resources/dashboard/client/Client.d.ts +2 -16
- package/dist/api/resources/dashboard/client/Client.js +2 -16
- package/dist/api/resources/dashboard/client/index.d.ts +0 -0
- package/dist/api/resources/dashboard/client/index.js +0 -0
- package/dist/api/resources/dashboard/client/requests/CreateUserDashboardUserCreateUserPostRequest.d.ts +0 -0
- package/dist/api/resources/dashboard/client/requests/CreateUserDashboardUserCreateUserPostRequest.js +0 -0
- package/dist/api/resources/dashboard/client/requests/ListSourcesDashboardSourcesGetRequest.d.ts +2 -2
- package/dist/api/resources/dashboard/client/requests/ListSourcesDashboardSourcesGetRequest.js +0 -0
- package/dist/api/resources/dashboard/client/requests/index.d.ts +0 -0
- package/dist/api/resources/dashboard/client/requests/index.js +0 -0
- package/dist/api/resources/dashboard/index.d.ts +0 -0
- package/dist/api/resources/dashboard/index.js +0 -0
- package/dist/api/resources/embeddings/client/Client.d.ts +20 -33
- package/dist/api/resources/embeddings/client/Client.js +28 -41
- package/dist/api/resources/embeddings/client/index.d.ts +0 -0
- package/dist/api/resources/embeddings/client/index.js +0 -0
- package/dist/api/resources/embeddings/client/requests/BodyFilterRawEmbeddingsEndpointEmbeddingsFilterRawEmbeddingsPost.d.ts +2 -2
- package/dist/api/resources/embeddings/client/requests/BodyFilterRawEmbeddingsEndpointEmbeddingsFilterRawEmbeddingsPost.js +0 -0
- package/dist/api/resources/embeddings/client/requests/BodyInsertRawEmbeddingsEndpointEmbeddingsInsertRawEmbeddingsPost.d.ts +15 -3
- package/dist/api/resources/embeddings/client/requests/BodyInsertRawEmbeddingsEndpointEmbeddingsInsertRawEmbeddingsPost.js +0 -0
- package/dist/api/resources/embeddings/client/requests/BodySearchRawEmbeddingsEndpointEmbeddingsSearchRawEmbeddingsPost.d.ts +2 -2
- package/dist/api/resources/embeddings/client/requests/BodySearchRawEmbeddingsEndpointEmbeddingsSearchRawEmbeddingsPost.js +0 -0
- package/dist/api/resources/embeddings/client/requests/EmbeddingsDeleteRequest.d.ts +1 -1
- package/dist/api/resources/embeddings/client/requests/EmbeddingsDeleteRequest.js +0 -0
- package/dist/api/resources/embeddings/client/requests/index.d.ts +0 -0
- package/dist/api/resources/embeddings/client/requests/index.js +0 -0
- package/dist/api/resources/embeddings/index.d.ts +0 -0
- package/dist/api/resources/embeddings/index.js +0 -0
- package/dist/api/resources/fetch/client/Client.d.ts +9 -60
- package/dist/api/resources/fetch/client/Client.js +16 -129
- package/dist/api/resources/fetch/client/index.d.ts +0 -0
- package/dist/api/resources/fetch/client/index.js +0 -0
- package/dist/api/resources/fetch/client/requests/FetchGraphRelationsBySourceIdRequest.d.ts +2 -1
- package/dist/api/resources/fetch/client/requests/FetchGraphRelationsBySourceIdRequest.js +0 -0
- package/dist/api/resources/fetch/client/requests/ListContentRequest.d.ts +20 -0
- package/dist/api/resources/fetch/client/requests/{FetchSourcesRequest.js → ListContentRequest.js} +0 -0
- package/dist/api/resources/fetch/client/requests/SourceFetchRequest.d.ts +2 -2
- package/dist/api/resources/fetch/client/requests/SourceFetchRequest.js +0 -0
- package/dist/api/resources/fetch/client/requests/index.d.ts +1 -2
- package/dist/api/resources/fetch/client/requests/index.js +0 -0
- package/dist/api/resources/fetch/index.d.ts +1 -0
- package/dist/api/resources/fetch/index.js +1 -0
- package/dist/api/resources/fetch/types/FetchListKnowledgeResponse.d.ts +5 -0
- package/dist/api/resources/fetch/{client/requests/ListSourcesByIdRequest.js → types/FetchListKnowledgeResponse.js} +0 -0
- package/dist/api/resources/fetch/types/index.d.ts +1 -0
- package/dist/api/resources/fetch/types/index.js +17 -0
- package/dist/api/resources/index.d.ts +2 -1
- package/dist/api/resources/index.js +3 -2
- package/dist/api/resources/search/client/Client.d.ts +6 -45
- package/dist/api/resources/search/client/Client.js +12 -51
- package/dist/api/resources/search/client/index.d.ts +0 -0
- package/dist/api/resources/search/client/index.js +0 -0
- package/dist/api/resources/search/client/requests/FullTextSearchRequest.d.ts +3 -3
- package/dist/api/resources/search/client/requests/FullTextSearchRequest.js +0 -0
- package/dist/api/resources/search/client/requests/HybridSearchRequest.d.ts +6 -8
- package/dist/api/resources/search/client/requests/HybridSearchRequest.js +0 -0
- package/dist/api/resources/search/client/requests/QnASearchRequest.d.ts +2 -2
- package/dist/api/resources/search/client/requests/QnASearchRequest.js +0 -0
- package/dist/api/resources/search/client/requests/index.d.ts +0 -0
- package/dist/api/resources/search/client/requests/index.js +0 -0
- package/dist/api/resources/search/index.d.ts +0 -0
- package/dist/api/resources/search/index.js +0 -0
- package/dist/api/resources/sources/client/Client.d.ts +2 -9
- package/dist/api/resources/sources/client/Client.js +4 -11
- package/dist/api/resources/sources/client/index.d.ts +0 -0
- package/dist/api/resources/sources/client/index.js +0 -0
- package/dist/api/resources/sources/client/requests/SourceDeleteRequest.d.ts +2 -2
- package/dist/api/resources/sources/client/requests/SourceDeleteRequest.js +0 -0
- package/dist/api/resources/sources/client/requests/index.d.ts +0 -0
- package/dist/api/resources/sources/client/requests/index.js +0 -0
- package/dist/api/resources/sources/index.d.ts +0 -0
- package/dist/api/resources/sources/index.js +0 -0
- package/dist/api/resources/tenant/client/Client.d.ts +2 -54
- package/dist/api/resources/tenant/client/Client.js +4 -56
- package/dist/api/resources/tenant/client/index.d.ts +0 -0
- package/dist/api/resources/tenant/client/index.js +0 -0
- package/dist/api/resources/tenant/client/requests/TenantCreateRequest.d.ts +1 -1
- package/dist/api/resources/tenant/client/requests/TenantCreateRequest.js +0 -0
- package/dist/api/resources/tenant/client/requests/TenantStatsRequest.d.ts +1 -1
- package/dist/api/resources/tenant/client/requests/TenantStatsRequest.js +0 -0
- package/dist/api/resources/tenant/client/requests/index.d.ts +0 -0
- package/dist/api/resources/tenant/client/requests/index.js +0 -0
- package/dist/api/resources/tenant/index.d.ts +0 -0
- package/dist/api/resources/tenant/index.js +0 -0
- package/dist/api/resources/upload/client/Client.d.ts +9 -73
- package/dist/api/resources/upload/client/Client.js +22 -140
- package/dist/api/resources/upload/client/index.d.ts +0 -0
- package/dist/api/resources/upload/client/index.js +0 -0
- package/dist/api/resources/upload/client/requests/BodyAddMemoryMemoriesAddMemoryPost.d.ts +1 -1
- package/dist/api/resources/upload/client/requests/BodyAddMemoryMemoriesAddMemoryPost.js +0 -0
- package/dist/api/resources/upload/client/requests/{BodyUploadDocumentIngestionUploadDocumentPost.d.ts → BodyUploadKnowledgeIngestionUploadKnowledgePost.d.ts} +7 -5
- package/dist/api/resources/upload/client/requests/{BodyUploadAppIngestionUploadAppPost.js → BodyUploadKnowledgeIngestionUploadKnowledgePost.js} +0 -0
- package/dist/api/resources/upload/client/requests/UploadDeleteMemoryRequest.d.ts +2 -2
- package/dist/api/resources/upload/client/requests/UploadDeleteMemoryRequest.js +0 -0
- package/dist/api/resources/upload/client/requests/UploadVerifyProcessingRequest.d.ts +2 -1
- package/dist/api/resources/upload/client/requests/UploadVerifyProcessingRequest.js +0 -0
- package/dist/api/resources/upload/client/requests/index.d.ts +1 -2
- package/dist/api/resources/upload/client/requests/index.js +0 -0
- package/dist/api/resources/upload/index.d.ts +0 -0
- package/dist/api/resources/upload/index.js +0 -0
- package/dist/api/types/ActualErrorResponse.d.ts +0 -0
- package/dist/api/types/ActualErrorResponse.js +0 -0
- package/dist/api/types/AddMemoryResponse.d.ts +0 -0
- package/dist/api/types/AddMemoryResponse.js +0 -0
- package/dist/api/types/ApiKeyInfo.d.ts +0 -0
- package/dist/api/types/ApiKeyInfo.js +0 -0
- package/dist/api/types/AttachmentModel.d.ts +0 -0
- package/dist/api/types/AttachmentModel.js +0 -0
- package/dist/api/types/Bm25OperatorType.d.ts +0 -0
- package/dist/api/types/Bm25OperatorType.js +0 -0
- package/dist/api/types/CollectionStats.d.ts +0 -0
- package/dist/api/types/CollectionStats.js +0 -0
- package/dist/api/types/ContentModel.d.ts +0 -0
- package/dist/api/types/ContentModel.js +0 -0
- package/dist/api/types/CustomPropertyDefinition.d.ts +0 -0
- package/dist/api/types/CustomPropertyDefinition.js +0 -0
- package/dist/api/types/DashboardApisResponse.d.ts +0 -0
- package/dist/api/types/DashboardApisResponse.js +0 -0
- package/dist/api/types/DashboardSourcesResponse.d.ts +0 -0
- package/dist/api/types/DashboardSourcesResponse.js +0 -0
- package/dist/api/types/DashboardTenantsResponse.d.ts +0 -0
- package/dist/api/types/DashboardTenantsResponse.js +0 -0
- package/dist/api/types/DeleteResult.d.ts +0 -0
- package/dist/api/types/DeleteResult.js +0 -0
- package/dist/api/types/DeleteUserMemoryResponse.d.ts +0 -0
- package/dist/api/types/DeleteUserMemoryResponse.js +0 -0
- package/dist/api/types/Entity.d.ts +0 -0
- package/dist/api/types/Entity.js +0 -0
- package/dist/api/types/ErrorResponse.d.ts +0 -0
- package/dist/api/types/ErrorResponse.js +0 -0
- package/dist/api/types/FetchMode.d.ts +0 -0
- package/dist/api/types/FetchMode.js +0 -0
- package/dist/api/types/ForcefulRelationsPayload.d.ts +0 -0
- package/dist/api/types/ForcefulRelationsPayload.js +0 -0
- package/dist/api/types/GraphContext.d.ts +0 -0
- package/dist/api/types/GraphContext.js +0 -0
- package/dist/api/types/HttpValidationError.d.ts +0 -0
- package/dist/api/types/HttpValidationError.js +0 -0
- package/dist/api/types/Infra.d.ts +0 -0
- package/dist/api/types/Infra.js +0 -0
- package/dist/api/types/InsertResult.d.ts +0 -0
- package/dist/api/types/InsertResult.js +0 -0
- package/dist/api/types/ListContentKind.d.ts +8 -0
- package/dist/api/types/ListContentKind.js +10 -0
- package/dist/api/types/ListUserMemoriesResponse.d.ts +13 -0
- package/dist/api/{resources/upload/client/requests/BodyUploadDocumentIngestionUploadDocumentPost.js → types/ListUserMemoriesResponse.js} +0 -0
- package/dist/api/types/MemoryItem.d.ts +0 -0
- package/dist/api/types/MemoryItem.js +0 -0
- package/dist/api/types/MemoryResultItem.d.ts +0 -0
- package/dist/api/types/MemoryResultItem.js +0 -0
- package/dist/api/types/MilvusDataType.d.ts +0 -0
- package/dist/api/types/MilvusDataType.js +0 -0
- package/dist/api/types/PathTriplet.d.ts +0 -0
- package/dist/api/types/PathTriplet.js +0 -0
- package/dist/api/types/ProcessingStatus.d.ts +0 -0
- package/dist/api/types/ProcessingStatus.js +0 -0
- package/dist/api/types/QnASearchResponse.d.ts +0 -0
- package/dist/api/types/QnASearchResponse.js +0 -0
- package/dist/api/types/RawEmbeddingDocument.d.ts +0 -0
- package/dist/api/types/RawEmbeddingDocument.js +0 -0
- package/dist/api/types/RawEmbeddingSearchResult.d.ts +0 -0
- package/dist/api/types/RawEmbeddingSearchResult.js +0 -0
- package/dist/api/types/RawEmbeddingVector.d.ts +0 -0
- package/dist/api/types/RawEmbeddingVector.js +0 -0
- package/dist/api/types/RelationEvidence.d.ts +0 -0
- package/dist/api/types/RelationEvidence.js +0 -0
- package/dist/api/types/RetrievalResult.d.ts +1 -1
- package/dist/api/types/RetrievalResult.js +0 -0
- package/dist/api/types/RetrieveMode.d.ts +2 -2
- package/dist/api/types/RetrieveMode.js +1 -1
- package/dist/api/types/ScoredPathResponse.d.ts +0 -0
- package/dist/api/types/ScoredPathResponse.js +0 -0
- package/dist/api/types/SearchMode.d.ts +0 -0
- package/dist/api/types/SearchMode.js +0 -0
- package/dist/api/types/SourceDeleteResponse.d.ts +0 -0
- package/dist/api/types/SourceDeleteResponse.js +0 -0
- package/dist/api/types/SourceDeleteResultItem.d.ts +0 -0
- package/dist/api/types/SourceDeleteResultItem.js +0 -0
- package/dist/api/types/SourceFetchResponse.d.ts +0 -0
- package/dist/api/types/SourceFetchResponse.js +0 -0
- package/dist/api/types/SourceGraphRelationsResponse.d.ts +0 -0
- package/dist/api/types/SourceGraphRelationsResponse.js +0 -0
- package/dist/api/types/SourceListResponse.d.ts +0 -0
- package/dist/api/types/SourceListResponse.js +0 -0
- package/dist/api/types/SourceModel.d.ts +0 -0
- package/dist/api/types/SourceModel.js +0 -0
- package/dist/api/types/SourceStatus.d.ts +0 -0
- package/dist/api/types/SourceStatus.js +0 -0
- package/dist/api/types/SourceUploadResponse.d.ts +0 -0
- package/dist/api/types/SourceUploadResponse.js +0 -0
- package/dist/api/types/SourceUploadResultItem.d.ts +0 -0
- package/dist/api/types/SourceUploadResultItem.js +0 -0
- package/dist/api/types/SupportedLlmProviders.d.ts +0 -0
- package/dist/api/types/SupportedLlmProviders.js +0 -0
- package/dist/api/types/TenantCreateResponse.d.ts +0 -0
- package/dist/api/types/TenantCreateResponse.js +0 -0
- package/dist/api/types/TenantInfo.d.ts +0 -0
- package/dist/api/types/TenantInfo.js +0 -0
- package/dist/api/types/TenantMetadataSchemaInfo.d.ts +0 -0
- package/dist/api/types/TenantMetadataSchemaInfo.js +0 -0
- package/dist/api/types/TenantStatsResponse.d.ts +0 -0
- package/dist/api/types/TenantStatsResponse.js +0 -0
- package/dist/api/types/TripletWithEvidence.d.ts +0 -0
- package/dist/api/types/TripletWithEvidence.js +0 -0
- package/dist/api/types/UserAssistantPair.d.ts +0 -0
- package/dist/api/types/UserAssistantPair.js +0 -0
- package/dist/api/types/UserMemory.d.ts +12 -0
- package/dist/api/types/{AppSourcesUploadData.js → UserMemory.js} +0 -0
- package/dist/api/types/ValidationError.d.ts +0 -0
- package/dist/api/types/ValidationError.js +0 -0
- package/dist/api/types/VectorStoreChunk.d.ts +0 -0
- package/dist/api/types/VectorStoreChunk.js +0 -0
- package/dist/api/types/index.d.ts +3 -1
- package/dist/api/types/index.js +3 -1
- package/dist/core/auth/AuthProvider.d.ts +0 -0
- package/dist/core/auth/AuthProvider.js +0 -0
- package/dist/core/auth/AuthRequest.d.ts +0 -0
- package/dist/core/auth/AuthRequest.js +0 -0
- package/dist/core/auth/BasicAuth.d.ts +0 -0
- package/dist/core/auth/BasicAuth.js +0 -0
- package/dist/core/auth/BearerToken.d.ts +0 -0
- package/dist/core/auth/BearerToken.js +0 -0
- package/dist/core/auth/index.d.ts +0 -0
- package/dist/core/auth/index.js +0 -0
- package/dist/core/base64.d.ts +0 -0
- package/dist/core/base64.js +0 -0
- package/dist/core/exports.d.ts +0 -0
- package/dist/core/exports.js +0 -0
- package/dist/core/fetcher/APIResponse.d.ts +0 -0
- package/dist/core/fetcher/APIResponse.js +0 -0
- package/dist/core/fetcher/BinaryResponse.d.ts +0 -0
- package/dist/core/fetcher/BinaryResponse.js +0 -0
- package/dist/core/fetcher/Fetcher.d.ts +0 -0
- package/dist/core/fetcher/Fetcher.js +0 -0
- package/dist/core/fetcher/Headers.d.ts +0 -0
- package/dist/core/fetcher/Headers.js +0 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +0 -0
- package/dist/core/fetcher/HttpResponsePromise.js +0 -0
- package/dist/core/fetcher/RawResponse.d.ts +0 -0
- package/dist/core/fetcher/RawResponse.js +0 -0
- package/dist/core/fetcher/ResponseWithBody.d.ts +0 -0
- package/dist/core/fetcher/ResponseWithBody.js +0 -0
- package/dist/core/fetcher/Supplier.d.ts +0 -0
- package/dist/core/fetcher/Supplier.js +0 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +0 -0
- package/dist/core/fetcher/createRequestUrl.js +0 -0
- package/dist/core/fetcher/getErrorResponseBody.d.ts +0 -0
- package/dist/core/fetcher/getErrorResponseBody.js +0 -0
- package/dist/core/fetcher/getFetchFn.d.ts +0 -0
- package/dist/core/fetcher/getFetchFn.js +0 -0
- package/dist/core/fetcher/getHeader.d.ts +0 -0
- package/dist/core/fetcher/getHeader.js +0 -0
- package/dist/core/fetcher/getRequestBody.d.ts +0 -0
- package/dist/core/fetcher/getRequestBody.js +0 -0
- package/dist/core/fetcher/getResponseBody.d.ts +0 -0
- package/dist/core/fetcher/getResponseBody.js +0 -0
- package/dist/core/fetcher/index.d.ts +0 -0
- package/dist/core/fetcher/index.js +0 -0
- package/dist/core/fetcher/makeRequest.d.ts +0 -0
- package/dist/core/fetcher/makeRequest.js +0 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +0 -0
- package/dist/core/fetcher/requestWithRetries.js +0 -0
- package/dist/core/fetcher/signals.d.ts +0 -0
- package/dist/core/fetcher/signals.js +0 -0
- package/dist/core/file/exports.d.ts +0 -0
- package/dist/core/file/exports.js +0 -0
- package/dist/core/file/file.d.ts +0 -0
- package/dist/core/file/file.js +0 -0
- package/dist/core/file/index.d.ts +0 -0
- package/dist/core/file/index.js +0 -0
- package/dist/core/file/types.d.ts +0 -0
- package/dist/core/file/types.js +0 -0
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +0 -0
- package/dist/core/form-data-utils/FormDataWrapper.js +0 -0
- package/dist/core/form-data-utils/encodeAsFormParameter.d.ts +0 -0
- package/dist/core/form-data-utils/encodeAsFormParameter.js +0 -0
- package/dist/core/form-data-utils/index.d.ts +0 -0
- package/dist/core/form-data-utils/index.js +0 -0
- package/dist/core/headers.d.ts +0 -0
- package/dist/core/headers.js +0 -0
- package/dist/core/index.d.ts +0 -0
- package/dist/core/index.js +0 -0
- package/dist/core/json.d.ts +0 -0
- package/dist/core/json.js +0 -0
- package/dist/core/runtime/index.d.ts +0 -0
- package/dist/core/runtime/index.js +0 -0
- package/dist/core/runtime/runtime.d.ts +0 -0
- package/dist/core/runtime/runtime.js +0 -0
- package/dist/core/url/index.d.ts +0 -0
- package/dist/core/url/index.js +0 -0
- package/dist/core/url/join.d.ts +0 -0
- package/dist/core/url/join.js +0 -0
- package/dist/core/url/qs.d.ts +0 -0
- package/dist/core/url/qs.js +0 -0
- package/dist/environments.d.ts +0 -0
- package/dist/environments.js +0 -0
- package/dist/errors/CortexAIError.d.ts +0 -0
- package/dist/errors/CortexAIError.js +0 -0
- package/dist/errors/CortexAITimeoutError.d.ts +0 -0
- package/dist/errors/CortexAITimeoutError.js +0 -0
- package/dist/errors/index.d.ts +0 -0
- package/dist/errors/index.js +0 -0
- package/dist/exports.d.ts +0 -0
- package/dist/exports.js +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/package.json +34 -31
- package/dist/api/resources/fetch/client/requests/FetchSourcesRequest.d.ts +0 -15
- package/dist/api/resources/fetch/client/requests/ListSourcesByIdRequest.d.ts +0 -18
- package/dist/api/resources/upload/client/requests/BodyUploadAppIngestionUploadAppPost.d.ts +0 -31
- package/dist/api/types/AppSourcesUploadData.d.ts +0 -17
|
@@ -37,16 +37,6 @@ class Embeddings {
|
|
|
37
37
|
this._options = _options;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* Upload pre-computed embeddings for advanced similarity search.
|
|
41
|
-
*
|
|
42
|
-
* This endpoint accepts vector embeddings that you’ve generated externally,
|
|
43
|
-
* allowing you to integrate with custom embedding models or existing vector databases.
|
|
44
|
-
* The embeddings represent chunks of your content as numerical vectors.
|
|
45
|
-
*
|
|
46
|
-
* The system stores these embeddings and makes them available for semantic search and similarity matching.
|
|
47
|
-
* Use this when you want to leverage specialized embedding models or have existing vector representations.
|
|
48
|
-
* When upsert=True, existing embeddings with the same chunk_id will be updated.
|
|
49
|
-
*
|
|
50
40
|
* @param {CortexAI.BodyInsertRawEmbeddingsEndpointEmbeddingsInsertRawEmbeddingsPost} request
|
|
51
41
|
* @param {Embeddings.RequestOptions} requestOptions - Request-specific configuration.
|
|
52
42
|
*
|
|
@@ -60,11 +50,23 @@ class Embeddings {
|
|
|
60
50
|
*
|
|
61
51
|
* @example
|
|
62
52
|
* await client.embeddings.insert({
|
|
63
|
-
* tenant_id: "
|
|
53
|
+
* tenant_id: "tenant_1234",
|
|
64
54
|
* embeddings: [{
|
|
65
|
-
* source_id: "source_id",
|
|
55
|
+
* source_id: "<source_id>",
|
|
56
|
+
* embeddings: [{
|
|
57
|
+
* chunk_id: "<chunk_id>",
|
|
58
|
+
* embedding: [1.1]
|
|
59
|
+
* }, {
|
|
60
|
+
* chunk_id: "<chunk_id>",
|
|
61
|
+
* embedding: [1.1]
|
|
62
|
+
* }]
|
|
63
|
+
* }, {
|
|
64
|
+
* source_id: "<source_id>",
|
|
66
65
|
* embeddings: [{
|
|
67
|
-
* chunk_id: "chunk_id",
|
|
66
|
+
* chunk_id: "<chunk_id>",
|
|
67
|
+
* embedding: [1.1]
|
|
68
|
+
* }, {
|
|
69
|
+
* chunk_id: "<chunk_id>",
|
|
68
70
|
* embedding: [1.1]
|
|
69
71
|
* }]
|
|
70
72
|
* }]
|
|
@@ -77,7 +79,7 @@ class Embeddings {
|
|
|
77
79
|
var _a, _b, _c;
|
|
78
80
|
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);
|
|
79
81
|
const _response = await core.fetcher({
|
|
80
|
-
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, "embeddings/
|
|
82
|
+
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, "embeddings/insert_raw_embeddings"),
|
|
81
83
|
method: "POST",
|
|
82
84
|
headers: _headers,
|
|
83
85
|
contentType: "application/json",
|
|
@@ -123,7 +125,7 @@ class Embeddings {
|
|
|
123
125
|
rawResponse: _response.rawResponse,
|
|
124
126
|
});
|
|
125
127
|
case "timeout":
|
|
126
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /embeddings/
|
|
128
|
+
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /embeddings/insert_raw_embeddings.");
|
|
127
129
|
case "unknown":
|
|
128
130
|
throw new errors.CortexAIError({
|
|
129
131
|
message: _response.error.errorMessage,
|
|
@@ -132,13 +134,6 @@ class Embeddings {
|
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
/**
|
|
135
|
-
* Find similar chunks using an embedding vector.
|
|
136
|
-
*
|
|
137
|
-
* Use this to retrieve the most similar chunk IDs to a single query embedding.
|
|
138
|
-
*
|
|
139
|
-
* Expected outcome:
|
|
140
|
-
* - You receive the closest chunk IDs with optional similarity scores.
|
|
141
|
-
*
|
|
142
137
|
* @param {CortexAI.BodySearchRawEmbeddingsEndpointEmbeddingsSearchRawEmbeddingsPost} request
|
|
143
138
|
* @param {Embeddings.RequestOptions} requestOptions - Request-specific configuration.
|
|
144
139
|
*
|
|
@@ -152,8 +147,8 @@ class Embeddings {
|
|
|
152
147
|
*
|
|
153
148
|
* @example
|
|
154
149
|
* await client.embeddings.search({
|
|
155
|
-
* tenant_id: "
|
|
156
|
-
* sub_tenant_id: "
|
|
150
|
+
* tenant_id: "tenant_1234",
|
|
151
|
+
* sub_tenant_id: "sub_tenant_4567",
|
|
157
152
|
* query_embedding: [1.1]
|
|
158
153
|
* })
|
|
159
154
|
*/
|
|
@@ -164,7 +159,7 @@ class Embeddings {
|
|
|
164
159
|
var _a, _b, _c;
|
|
165
160
|
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);
|
|
166
161
|
const _response = await core.fetcher({
|
|
167
|
-
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, "embeddings/
|
|
162
|
+
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, "embeddings/search_raw_embeddings"),
|
|
168
163
|
method: "POST",
|
|
169
164
|
headers: _headers,
|
|
170
165
|
contentType: "application/json",
|
|
@@ -210,7 +205,7 @@ class Embeddings {
|
|
|
210
205
|
rawResponse: _response.rawResponse,
|
|
211
206
|
});
|
|
212
207
|
case "timeout":
|
|
213
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /embeddings/
|
|
208
|
+
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /embeddings/search_raw_embeddings.");
|
|
214
209
|
case "unknown":
|
|
215
210
|
throw new errors.CortexAIError({
|
|
216
211
|
message: _response.error.errorMessage,
|
|
@@ -219,9 +214,6 @@ class Embeddings {
|
|
|
219
214
|
}
|
|
220
215
|
}
|
|
221
216
|
/**
|
|
222
|
-
* Retrieve embeddings for specific chunk IDs.
|
|
223
|
-
* Use this when you already know the chunk IDs and need their corresponding embeddings.
|
|
224
|
-
*
|
|
225
217
|
* @param {CortexAI.BodyFilterRawEmbeddingsEndpointEmbeddingsFilterRawEmbeddingsPost} request
|
|
226
218
|
* @param {Embeddings.RequestOptions} requestOptions - Request-specific configuration.
|
|
227
219
|
*
|
|
@@ -235,8 +227,8 @@ class Embeddings {
|
|
|
235
227
|
*
|
|
236
228
|
* @example
|
|
237
229
|
* await client.embeddings.filter({
|
|
238
|
-
* tenant_id: "
|
|
239
|
-
* sub_tenant_id: "
|
|
230
|
+
* tenant_id: "tenant_1234",
|
|
231
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
240
232
|
* })
|
|
241
233
|
*/
|
|
242
234
|
filter(request, requestOptions) {
|
|
@@ -246,7 +238,7 @@ class Embeddings {
|
|
|
246
238
|
var _a, _b, _c;
|
|
247
239
|
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);
|
|
248
240
|
const _response = await core.fetcher({
|
|
249
|
-
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, "embeddings/
|
|
241
|
+
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, "embeddings/filter_raw_embeddings"),
|
|
250
242
|
method: "POST",
|
|
251
243
|
headers: _headers,
|
|
252
244
|
contentType: "application/json",
|
|
@@ -292,7 +284,7 @@ class Embeddings {
|
|
|
292
284
|
rawResponse: _response.rawResponse,
|
|
293
285
|
});
|
|
294
286
|
case "timeout":
|
|
295
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /embeddings/
|
|
287
|
+
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /embeddings/filter_raw_embeddings.");
|
|
296
288
|
case "unknown":
|
|
297
289
|
throw new errors.CortexAIError({
|
|
298
290
|
message: _response.error.errorMessage,
|
|
@@ -301,11 +293,6 @@ class Embeddings {
|
|
|
301
293
|
}
|
|
302
294
|
}
|
|
303
295
|
/**
|
|
304
|
-
* Delete embedding chunks by chunk ID.
|
|
305
|
-
*
|
|
306
|
-
* Use this to remove specific chunks from your embeddings index when they are no longer
|
|
307
|
-
* valid or should not appear in results.
|
|
308
|
-
*
|
|
309
296
|
* @param {CortexAI.EmbeddingsDeleteRequest} request
|
|
310
297
|
* @param {Embeddings.RequestOptions} requestOptions - Request-specific configuration.
|
|
311
298
|
*
|
|
@@ -319,7 +306,7 @@ class Embeddings {
|
|
|
319
306
|
*
|
|
320
307
|
* @example
|
|
321
308
|
* await client.embeddings.delete({
|
|
322
|
-
* tenant_id: "
|
|
309
|
+
* tenant_id: "tenant_1234"
|
|
323
310
|
* })
|
|
324
311
|
*/
|
|
325
312
|
delete(request, requestOptions) {
|
|
@@ -346,7 +333,7 @@ class Embeddings {
|
|
|
346
333
|
}
|
|
347
334
|
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);
|
|
348
335
|
const _response = await core.fetcher({
|
|
349
|
-
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, "embeddings/
|
|
336
|
+
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, "embeddings/delete_raw_embeddings"),
|
|
350
337
|
method: "DELETE",
|
|
351
338
|
headers: _headers,
|
|
352
339
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -389,7 +376,7 @@ class Embeddings {
|
|
|
389
376
|
rawResponse: _response.rawResponse,
|
|
390
377
|
});
|
|
391
378
|
case "timeout":
|
|
392
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling DELETE /embeddings/
|
|
379
|
+
throw new errors.CortexAITimeoutError("Timeout exceeded when calling DELETE /embeddings/delete_raw_embeddings.");
|
|
393
380
|
case "unknown":
|
|
394
381
|
throw new errors.CortexAIError({
|
|
395
382
|
message: _response.error.errorMessage,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,11 +5,23 @@ import * as CortexAI from "../../../../index.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
* tenant_id: "
|
|
8
|
+
* tenant_id: "tenant_1234",
|
|
9
9
|
* embeddings: [{
|
|
10
|
-
* source_id: "source_id",
|
|
10
|
+
* source_id: "<source_id>",
|
|
11
11
|
* embeddings: [{
|
|
12
|
-
* chunk_id: "chunk_id",
|
|
12
|
+
* chunk_id: "<chunk_id>",
|
|
13
|
+
* embedding: [1.1]
|
|
14
|
+
* }, {
|
|
15
|
+
* chunk_id: "<chunk_id>",
|
|
16
|
+
* embedding: [1.1]
|
|
17
|
+
* }]
|
|
18
|
+
* }, {
|
|
19
|
+
* source_id: "<source_id>",
|
|
20
|
+
* embeddings: [{
|
|
21
|
+
* chunk_id: "<chunk_id>",
|
|
22
|
+
* embedding: [1.1]
|
|
23
|
+
* }, {
|
|
24
|
+
* chunk_id: "<chunk_id>",
|
|
13
25
|
* embedding: [1.1]
|
|
14
26
|
* }]
|
|
15
27
|
* }]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -30,16 +30,7 @@ export declare class Fetch {
|
|
|
30
30
|
protected readonly _options: Fetch.Options;
|
|
31
31
|
constructor(_options?: Fetch.Options);
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* Use this endpoint to fetch a complete list of all sources associated
|
|
36
|
-
* with your tenant. This includes documents, files, and other content
|
|
37
|
-
* you've uploaded for processing.
|
|
38
|
-
*
|
|
39
|
-
* You can optionally specify a sub-tenant to narrow down the results to
|
|
40
|
-
* sources within that specific sub-tenant scope.
|
|
41
|
-
*
|
|
42
|
-
* @param {CortexAI.FetchSourcesRequest} request
|
|
33
|
+
* @param {CortexAI.ListContentRequest} request
|
|
43
34
|
* @param {Fetch.RequestOptions} requestOptions - Request-specific configuration.
|
|
44
35
|
*
|
|
45
36
|
* @throws {@link CortexAI.BadRequestError}
|
|
@@ -51,49 +42,13 @@ export declare class Fetch {
|
|
|
51
42
|
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
52
43
|
*
|
|
53
44
|
* @example
|
|
54
|
-
* await client.fetch.
|
|
55
|
-
* tenant_id: "
|
|
45
|
+
* await client.fetch.listKnowledge({
|
|
46
|
+
* tenant_id: "tenant_1234"
|
|
56
47
|
* })
|
|
57
48
|
*/
|
|
58
|
-
|
|
59
|
-
private
|
|
49
|
+
listKnowledge(request: CortexAI.ListContentRequest, requestOptions?: Fetch.RequestOptions): core.HttpResponsePromise<CortexAI.FetchListKnowledgeResponse>;
|
|
50
|
+
private __listKnowledge;
|
|
60
51
|
/**
|
|
61
|
-
* Retrieve specific sources by their IDs.
|
|
62
|
-
*
|
|
63
|
-
* Use this endpoint to fetch one or more sources by providing their
|
|
64
|
-
* unique identifiers. This is useful when you need detailed information
|
|
65
|
-
* about specific documents or content you've previously uploaded.
|
|
66
|
-
*
|
|
67
|
-
* Provide the source IDs in the request body along with your tenant
|
|
68
|
-
* information to get the exact sources you need.
|
|
69
|
-
*
|
|
70
|
-
* @param {CortexAI.ListSourcesByIdRequest} request
|
|
71
|
-
* @param {Fetch.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
|
-
*
|
|
73
|
-
* @throws {@link CortexAI.BadRequestError}
|
|
74
|
-
* @throws {@link CortexAI.UnauthorizedError}
|
|
75
|
-
* @throws {@link CortexAI.ForbiddenError}
|
|
76
|
-
* @throws {@link CortexAI.NotFoundError}
|
|
77
|
-
* @throws {@link CortexAI.UnprocessableEntityError}
|
|
78
|
-
* @throws {@link CortexAI.InternalServerError}
|
|
79
|
-
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* await client.fetch.sourceByIds({
|
|
83
|
-
* source_ids: ["source_ids"],
|
|
84
|
-
* tenant_id: "tenant_id"
|
|
85
|
-
* })
|
|
86
|
-
*/
|
|
87
|
-
sourceByIds(request: CortexAI.ListSourcesByIdRequest, requestOptions?: Fetch.RequestOptions): core.HttpResponsePromise<CortexAI.SourceListResponse>;
|
|
88
|
-
private __sourceByIds;
|
|
89
|
-
/**
|
|
90
|
-
* Retrieve relations for a specific source.
|
|
91
|
-
*
|
|
92
|
-
* Use this endpoint to fetch all relations associated with a specific source.
|
|
93
|
-
* This is useful when you need to understand the relationships between entities within a source.
|
|
94
|
-
*
|
|
95
|
-
* Provide the source ID in the request body along with your tenant information to get the relations for that source.
|
|
96
|
-
*
|
|
97
52
|
* @param {CortexAI.FetchGraphRelationsBySourceIdRequest} request
|
|
98
53
|
* @param {Fetch.RequestOptions} requestOptions - Request-specific configuration.
|
|
99
54
|
*
|
|
@@ -107,19 +62,13 @@ export declare class Fetch {
|
|
|
107
62
|
*
|
|
108
63
|
* @example
|
|
109
64
|
* await client.fetch.graphRelationsBySourceId({
|
|
110
|
-
* source_id: "
|
|
65
|
+
* source_id: "<str>",
|
|
66
|
+
* tenant_id: "tenant_1234"
|
|
111
67
|
* })
|
|
112
68
|
*/
|
|
113
69
|
graphRelationsBySourceId(request: CortexAI.FetchGraphRelationsBySourceIdRequest, requestOptions?: Fetch.RequestOptions): core.HttpResponsePromise<CortexAI.SourceGraphRelationsResponse>;
|
|
114
70
|
private __graphRelationsBySourceId;
|
|
115
71
|
/**
|
|
116
|
-
* Fetch the content of a source ingested.
|
|
117
|
-
*
|
|
118
|
-
* This endpoint can return:
|
|
119
|
-
* - File content directly (as string or base64)
|
|
120
|
-
* - A presigned URL to access the file
|
|
121
|
-
* - Both content and presigned URL
|
|
122
|
-
*
|
|
123
72
|
* @param {CortexAI.SourceFetchRequest} request
|
|
124
73
|
* @param {Fetch.RequestOptions} requestOptions - Request-specific configuration.
|
|
125
74
|
*
|
|
@@ -133,8 +82,8 @@ export declare class Fetch {
|
|
|
133
82
|
*
|
|
134
83
|
* @example
|
|
135
84
|
* await client.fetch.sourceContent({
|
|
136
|
-
* tenant_id: "
|
|
137
|
-
* source_id: "source_id"
|
|
85
|
+
* tenant_id: "tenant_1234",
|
|
86
|
+
* source_id: "<source_id>"
|
|
138
87
|
* })
|
|
139
88
|
*/
|
|
140
89
|
sourceContent(request: CortexAI.SourceFetchRequest, requestOptions?: Fetch.RequestOptions): core.HttpResponsePromise<CortexAI.SourceFetchResponse>;
|
|
@@ -37,106 +37,7 @@ class Fetch {
|
|
|
37
37
|
this._options = _options;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* Use this endpoint to fetch a complete list of all sources associated
|
|
43
|
-
* with your tenant. This includes documents, files, and other content
|
|
44
|
-
* you've uploaded for processing.
|
|
45
|
-
*
|
|
46
|
-
* You can optionally specify a sub-tenant to narrow down the results to
|
|
47
|
-
* sources within that specific sub-tenant scope.
|
|
48
|
-
*
|
|
49
|
-
* @param {CortexAI.FetchSourcesRequest} request
|
|
50
|
-
* @param {Fetch.RequestOptions} requestOptions - Request-specific configuration.
|
|
51
|
-
*
|
|
52
|
-
* @throws {@link CortexAI.BadRequestError}
|
|
53
|
-
* @throws {@link CortexAI.UnauthorizedError}
|
|
54
|
-
* @throws {@link CortexAI.ForbiddenError}
|
|
55
|
-
* @throws {@link CortexAI.NotFoundError}
|
|
56
|
-
* @throws {@link CortexAI.UnprocessableEntityError}
|
|
57
|
-
* @throws {@link CortexAI.InternalServerError}
|
|
58
|
-
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* await client.fetch.sources({
|
|
62
|
-
* tenant_id: "tenant_id"
|
|
63
|
-
* })
|
|
64
|
-
*/
|
|
65
|
-
sources(request, requestOptions) {
|
|
66
|
-
return core.HttpResponsePromise.fromPromise(this.__sources(request, requestOptions));
|
|
67
|
-
}
|
|
68
|
-
async __sources(request, requestOptions) {
|
|
69
|
-
var _a, _b, _c;
|
|
70
|
-
const { tenant_id: tenantId, sub_tenant_id: subTenantId } = request;
|
|
71
|
-
const _queryParams = {};
|
|
72
|
-
_queryParams["tenant_id"] = tenantId;
|
|
73
|
-
if (subTenantId != null) {
|
|
74
|
-
_queryParams["sub_tenant_id"] = subTenantId;
|
|
75
|
-
}
|
|
76
|
-
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);
|
|
77
|
-
const _response = await core.fetcher({
|
|
78
|
-
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/list-sources"),
|
|
79
|
-
method: "GET",
|
|
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 /list/list-sources.");
|
|
122
|
-
case "unknown":
|
|
123
|
-
throw new errors.CortexAIError({
|
|
124
|
-
message: _response.error.errorMessage,
|
|
125
|
-
rawResponse: _response.rawResponse,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Retrieve specific sources by their IDs.
|
|
131
|
-
*
|
|
132
|
-
* Use this endpoint to fetch one or more sources by providing their
|
|
133
|
-
* unique identifiers. This is useful when you need detailed information
|
|
134
|
-
* about specific documents or content you've previously uploaded.
|
|
135
|
-
*
|
|
136
|
-
* Provide the source IDs in the request body along with your tenant
|
|
137
|
-
* information to get the exact sources you need.
|
|
138
|
-
*
|
|
139
|
-
* @param {CortexAI.ListSourcesByIdRequest} request
|
|
40
|
+
* @param {CortexAI.ListContentRequest} request
|
|
140
41
|
* @param {Fetch.RequestOptions} requestOptions - Request-specific configuration.
|
|
141
42
|
*
|
|
142
43
|
* @throws {@link CortexAI.BadRequestError}
|
|
@@ -148,19 +49,18 @@ class Fetch {
|
|
|
148
49
|
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
149
50
|
*
|
|
150
51
|
* @example
|
|
151
|
-
* await client.fetch.
|
|
152
|
-
*
|
|
153
|
-
* tenant_id: "tenant_id"
|
|
52
|
+
* await client.fetch.listKnowledge({
|
|
53
|
+
* tenant_id: "tenant_1234"
|
|
154
54
|
* })
|
|
155
55
|
*/
|
|
156
|
-
|
|
157
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
56
|
+
listKnowledge(request, requestOptions) {
|
|
57
|
+
return core.HttpResponsePromise.fromPromise(this.__listKnowledge(request, requestOptions));
|
|
158
58
|
}
|
|
159
|
-
async
|
|
59
|
+
async __listKnowledge(request, requestOptions) {
|
|
160
60
|
var _a, _b, _c;
|
|
161
61
|
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);
|
|
162
62
|
const _response = await core.fetcher({
|
|
163
|
-
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/
|
|
63
|
+
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/data"),
|
|
164
64
|
method: "POST",
|
|
165
65
|
headers: _headers,
|
|
166
66
|
contentType: "application/json",
|
|
@@ -206,7 +106,7 @@ class Fetch {
|
|
|
206
106
|
rawResponse: _response.rawResponse,
|
|
207
107
|
});
|
|
208
108
|
case "timeout":
|
|
209
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /list/
|
|
109
|
+
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /list/data.");
|
|
210
110
|
case "unknown":
|
|
211
111
|
throw new errors.CortexAIError({
|
|
212
112
|
message: _response.error.errorMessage,
|
|
@@ -215,13 +115,6 @@ class Fetch {
|
|
|
215
115
|
}
|
|
216
116
|
}
|
|
217
117
|
/**
|
|
218
|
-
* Retrieve relations for a specific source.
|
|
219
|
-
*
|
|
220
|
-
* Use this endpoint to fetch all relations associated with a specific source.
|
|
221
|
-
* This is useful when you need to understand the relationships between entities within a source.
|
|
222
|
-
*
|
|
223
|
-
* Provide the source ID in the request body along with your tenant information to get the relations for that source.
|
|
224
|
-
*
|
|
225
118
|
* @param {CortexAI.FetchGraphRelationsBySourceIdRequest} request
|
|
226
119
|
* @param {Fetch.RequestOptions} requestOptions - Request-specific configuration.
|
|
227
120
|
*
|
|
@@ -235,7 +128,8 @@ class Fetch {
|
|
|
235
128
|
*
|
|
236
129
|
* @example
|
|
237
130
|
* await client.fetch.graphRelationsBySourceId({
|
|
238
|
-
* source_id: "
|
|
131
|
+
* source_id: "<str>",
|
|
132
|
+
* tenant_id: "tenant_1234"
|
|
239
133
|
* })
|
|
240
134
|
*/
|
|
241
135
|
graphRelationsBySourceId(request, requestOptions) {
|
|
@@ -254,7 +148,7 @@ class Fetch {
|
|
|
254
148
|
}
|
|
255
149
|
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);
|
|
256
150
|
const _response = await core.fetcher({
|
|
257
|
-
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/
|
|
151
|
+
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"),
|
|
258
152
|
method: "GET",
|
|
259
153
|
headers: _headers,
|
|
260
154
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -300,7 +194,7 @@ class Fetch {
|
|
|
300
194
|
rawResponse: _response.rawResponse,
|
|
301
195
|
});
|
|
302
196
|
case "timeout":
|
|
303
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /list/
|
|
197
|
+
throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /list/graph_relations_by_id.");
|
|
304
198
|
case "unknown":
|
|
305
199
|
throw new errors.CortexAIError({
|
|
306
200
|
message: _response.error.errorMessage,
|
|
@@ -309,13 +203,6 @@ class Fetch {
|
|
|
309
203
|
}
|
|
310
204
|
}
|
|
311
205
|
/**
|
|
312
|
-
* Fetch the content of a source ingested.
|
|
313
|
-
*
|
|
314
|
-
* This endpoint can return:
|
|
315
|
-
* - File content directly (as string or base64)
|
|
316
|
-
* - A presigned URL to access the file
|
|
317
|
-
* - Both content and presigned URL
|
|
318
|
-
*
|
|
319
206
|
* @param {CortexAI.SourceFetchRequest} request
|
|
320
207
|
* @param {Fetch.RequestOptions} requestOptions - Request-specific configuration.
|
|
321
208
|
*
|
|
@@ -329,8 +216,8 @@ class Fetch {
|
|
|
329
216
|
*
|
|
330
217
|
* @example
|
|
331
218
|
* await client.fetch.sourceContent({
|
|
332
|
-
* tenant_id: "
|
|
333
|
-
* source_id: "source_id"
|
|
219
|
+
* tenant_id: "tenant_1234",
|
|
220
|
+
* source_id: "<source_id>"
|
|
334
221
|
* })
|
|
335
222
|
*/
|
|
336
223
|
sourceContent(request, requestOptions) {
|
|
@@ -340,7 +227,7 @@ class Fetch {
|
|
|
340
227
|
var _a, _b, _c;
|
|
341
228
|
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);
|
|
342
229
|
const _response = await core.fetcher({
|
|
343
|
-
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, "fetch/
|
|
230
|
+
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, "fetch/content"),
|
|
344
231
|
method: "POST",
|
|
345
232
|
headers: _headers,
|
|
346
233
|
contentType: "application/json",
|
|
@@ -386,7 +273,7 @@ class Fetch {
|
|
|
386
273
|
rawResponse: _response.rawResponse,
|
|
387
274
|
});
|
|
388
275
|
case "timeout":
|
|
389
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /fetch/
|
|
276
|
+
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /fetch/content.");
|
|
390
277
|
case "unknown":
|
|
391
278
|
throw new errors.CortexAIError({
|
|
392
279
|
message: _response.error.errorMessage,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as CortexAI from "../../../../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* tenant_id: "tenant_1234"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface ListContentRequest {
|
|
12
|
+
/** Tenant ID */
|
|
13
|
+
tenant_id: string;
|
|
14
|
+
/** Sub-tenant ID */
|
|
15
|
+
sub_tenant_id?: string;
|
|
16
|
+
/** Whether to list normal sources or user memories. */
|
|
17
|
+
kind?: CortexAI.ListContentKind;
|
|
18
|
+
/** Optional list of IDs to fetch. If omitted, returns all. */
|
|
19
|
+
source_ids?: string[];
|
|
20
|
+
}
|
package/dist/api/resources/fetch/client/requests/{FetchSourcesRequest.js → ListContentRequest.js}
RENAMED
|
File without changes
|
|
File without changes
|