@usecortex_ai/node 0.4.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.
Files changed (68) hide show
  1. package/dist/Client.d.ts +0 -2
  2. package/dist/Client.js +0 -2
  3. package/dist/api/index.d.ts +1 -1
  4. package/dist/api/index.js +1 -1
  5. package/dist/api/resources/dashboard/client/Client.d.ts +2 -16
  6. package/dist/api/resources/dashboard/client/Client.js +2 -16
  7. package/dist/api/resources/dashboard/client/requests/ListSourcesDashboardSourcesGetRequest.d.ts +2 -2
  8. package/dist/api/resources/embeddings/client/Client.d.ts +20 -33
  9. package/dist/api/resources/embeddings/client/Client.js +28 -41
  10. package/dist/api/resources/embeddings/client/requests/BodyFilterRawEmbeddingsEndpointEmbeddingsFilterRawEmbeddingsPost.d.ts +2 -2
  11. package/dist/api/resources/embeddings/client/requests/BodyInsertRawEmbeddingsEndpointEmbeddingsInsertRawEmbeddingsPost.d.ts +15 -3
  12. package/dist/api/resources/embeddings/client/requests/BodySearchRawEmbeddingsEndpointEmbeddingsSearchRawEmbeddingsPost.d.ts +2 -2
  13. package/dist/api/resources/embeddings/client/requests/EmbeddingsDeleteRequest.d.ts +1 -1
  14. package/dist/api/resources/fetch/client/Client.d.ts +9 -60
  15. package/dist/api/resources/fetch/client/Client.js +16 -129
  16. package/dist/api/resources/fetch/client/requests/FetchGraphRelationsBySourceIdRequest.d.ts +2 -1
  17. package/dist/api/resources/fetch/client/requests/ListContentRequest.d.ts +20 -0
  18. package/dist/api/resources/fetch/client/requests/SourceFetchRequest.d.ts +2 -2
  19. package/dist/api/resources/fetch/client/requests/index.d.ts +1 -2
  20. package/dist/api/resources/fetch/index.d.ts +1 -0
  21. package/dist/api/resources/fetch/index.js +1 -0
  22. package/dist/api/resources/fetch/types/FetchListKnowledgeResponse.d.ts +5 -0
  23. package/dist/api/resources/fetch/types/index.d.ts +1 -0
  24. package/dist/api/resources/fetch/types/index.js +17 -0
  25. package/dist/api/resources/index.d.ts +2 -1
  26. package/dist/api/resources/index.js +3 -2
  27. package/dist/api/resources/search/client/Client.d.ts +6 -40
  28. package/dist/api/resources/search/client/Client.js +12 -46
  29. package/dist/api/resources/search/client/requests/FullTextSearchRequest.d.ts +3 -3
  30. package/dist/api/resources/search/client/requests/HybridSearchRequest.d.ts +7 -7
  31. package/dist/api/resources/search/client/requests/QnASearchRequest.d.ts +2 -2
  32. package/dist/api/resources/sources/client/Client.d.ts +2 -9
  33. package/dist/api/resources/sources/client/Client.js +4 -11
  34. package/dist/api/resources/sources/client/requests/SourceDeleteRequest.d.ts +2 -2
  35. package/dist/api/resources/tenant/client/Client.d.ts +2 -54
  36. package/dist/api/resources/tenant/client/Client.js +4 -56
  37. package/dist/api/resources/tenant/client/requests/TenantCreateRequest.d.ts +1 -1
  38. package/dist/api/resources/tenant/client/requests/TenantStatsRequest.d.ts +1 -1
  39. package/dist/api/resources/upload/client/Client.d.ts +9 -73
  40. package/dist/api/resources/upload/client/Client.js +22 -140
  41. package/dist/api/resources/upload/client/requests/BodyAddMemoryMemoriesAddMemoryPost.d.ts +1 -1
  42. package/dist/api/resources/upload/client/requests/{BodyUploadDocumentIngestionUploadDocumentPost.d.ts → BodyUploadKnowledgeIngestionUploadKnowledgePost.d.ts} +7 -5
  43. package/dist/api/resources/upload/client/requests/UploadDeleteMemoryRequest.d.ts +2 -2
  44. package/dist/api/resources/upload/client/requests/UploadVerifyProcessingRequest.d.ts +2 -1
  45. package/dist/api/resources/upload/client/requests/index.d.ts +1 -2
  46. package/dist/api/types/ForcefulRelationsPayload.d.ts +9 -0
  47. package/dist/api/types/ListContentKind.d.ts +8 -0
  48. package/dist/api/types/ListContentKind.js +10 -0
  49. package/dist/api/types/ListUserMemoriesResponse.d.ts +13 -0
  50. package/dist/api/types/MemoryItem.d.ts +3 -1
  51. package/dist/api/types/RetrievalResult.d.ts +2 -0
  52. package/dist/api/types/RetrieveMode.d.ts +2 -2
  53. package/dist/api/types/RetrieveMode.js +1 -1
  54. package/dist/api/types/UserMemory.d.ts +12 -0
  55. package/dist/api/types/UserMemory.js +5 -0
  56. package/dist/api/types/VectorStoreChunk.d.ts +2 -0
  57. package/dist/api/types/index.d.ts +4 -1
  58. package/dist/api/types/index.js +4 -1
  59. package/package.json +33 -30
  60. package/dist/api/resources/fetch/client/requests/FetchSourcesRequest.d.ts +0 -15
  61. package/dist/api/resources/fetch/client/requests/ListSourcesByIdRequest.d.ts +0 -18
  62. package/dist/api/resources/upload/client/requests/BodyUploadAppIngestionUploadAppPost.d.ts +0 -31
  63. package/dist/api/types/AppSourcesUploadData.d.ts +0 -17
  64. /package/dist/api/resources/fetch/client/requests/{FetchSourcesRequest.js → ListContentRequest.js} +0 -0
  65. /package/dist/api/resources/fetch/{client/requests/ListSourcesByIdRequest.js → types/FetchListKnowledgeResponse.js} +0 -0
  66. /package/dist/api/resources/upload/client/requests/{BodyUploadAppIngestionUploadAppPost.js → BodyUploadKnowledgeIngestionUploadKnowledgePost.js} +0 -0
  67. /package/dist/api/{resources/upload/client/requests/BodyUploadDocumentIngestionUploadDocumentPost.js → types/ForcefulRelationsPayload.js} +0 -0
  68. /package/dist/api/types/{AppSourcesUploadData.js → ListUserMemoriesResponse.js} +0 -0
@@ -30,13 +30,6 @@ export declare class Sources {
30
30
  protected readonly _options: Sources.Options;
31
31
  constructor(_options?: Sources.Options);
32
32
  /**
33
- * Remove documents and content from your knowledge base.
34
- *
35
- * This endpoint permanently deletes the specified sources from your knowledge base.
36
- * Once deleted, the content will no longer be available for search or retrieval.
37
- *
38
- * Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
39
- *
40
33
  * @param {CortexAI.SourceDeleteRequest} request
41
34
  * @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
42
35
  *
@@ -50,8 +43,8 @@ export declare class Sources {
50
43
  *
51
44
  * @example
52
45
  * await client.sources.delete({
53
- * tenant_id: "tenant_id",
54
- * sub_tenant_id: "sub_tenant_id",
46
+ * tenant_id: "tenant_1234",
47
+ * sub_tenant_id: "sub_tenant_4567",
55
48
  * source_ids: ["source_ids"]
56
49
  * })
57
50
  */
@@ -37,13 +37,6 @@ class Sources {
37
37
  this._options = _options;
38
38
  }
39
39
  /**
40
- * Remove documents and content from your knowledge base.
41
- *
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.
44
- *
45
- * Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
46
- *
47
40
  * @param {CortexAI.SourceDeleteRequest} request
48
41
  * @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
49
42
  *
@@ -57,8 +50,8 @@ class Sources {
57
50
  *
58
51
  * @example
59
52
  * await client.sources.delete({
60
- * tenant_id: "tenant_id",
61
- * sub_tenant_id: "sub_tenant_id",
53
+ * tenant_id: "tenant_1234",
54
+ * sub_tenant_id: "sub_tenant_4567",
62
55
  * source_ids: ["source_ids"]
63
56
  * })
64
57
  */
@@ -69,7 +62,7 @@ class Sources {
69
62
  var _a, _b, _c;
70
63
  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);
71
64
  const _response = await core.fetcher({
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"),
65
+ 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, "knowledge/delete_knowledge"),
73
66
  method: "POST",
74
67
  headers: _headers,
75
68
  contentType: "application/json",
@@ -115,7 +108,7 @@ class Sources {
115
108
  rawResponse: _response.rawResponse,
116
109
  });
117
110
  case "timeout":
118
- throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /delete/delete-sources.");
111
+ throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /knowledge/delete_knowledge.");
119
112
  case "unknown":
120
113
  throw new errors.CortexAIError({
121
114
  message: _response.error.errorMessage,
@@ -4,8 +4,8 @@
4
4
  /**
5
5
  * @example
6
6
  * {
7
- * tenant_id: "tenant_id",
8
- * sub_tenant_id: "sub_tenant_id",
7
+ * tenant_id: "tenant_1234",
8
+ * sub_tenant_id: "sub_tenant_4567",
9
9
  * source_ids: ["source_ids"]
10
10
  * }
11
11
  */
@@ -30,47 +30,6 @@ export declare class Tenant {
30
30
  protected readonly _options: Tenant.Options;
31
31
  constructor(_options?: Tenant.Options);
32
32
  /**
33
- * Create a tenant for your account.
34
- *
35
- * Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search.
36
- *
37
- * **Tenant Metadata Schema**
38
- *
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:
41
- *
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
45
- *
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.
73
- *
74
33
  * @param {CortexAI.TenantCreateRequest} request
75
34
  * @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
76
35
  *
@@ -84,23 +43,12 @@ export declare class Tenant {
84
43
  *
85
44
  * @example
86
45
  * await client.tenant.createTenant({
87
- * tenant_id: "tenant_id"
46
+ * tenant_id: "tenant_1234"
88
47
  * })
89
48
  */
90
49
  createTenant(request: CortexAI.TenantCreateRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.TenantCreateResponse>;
91
50
  private __createTenant;
92
51
  /**
93
- * Retrieve usage stats for your tenant.
94
- *
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.
98
- *
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
52
  * @param {CortexAI.TenantStatsRequest} request
105
53
  * @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
106
54
  *
@@ -114,7 +62,7 @@ export declare class Tenant {
114
62
  *
115
63
  * @example
116
64
  * await client.tenant.stats({
117
- * tenant_id: "tenant_id"
65
+ * tenant_id: "tenant_1234"
118
66
  * })
119
67
  */
120
68
  stats(request: CortexAI.TenantStatsRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.TenantStatsResponse>;
@@ -37,47 +37,6 @@ class Tenant {
37
37
  this._options = _options;
38
38
  }
39
39
  /**
40
- * Create a tenant for your account.
41
- *
42
- * Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search.
43
- *
44
- * **Tenant Metadata Schema**
45
- *
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:
48
- *
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
52
- *
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
- * ```
74
- *
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
40
  * @param {CortexAI.TenantCreateRequest} request
82
41
  * @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
83
42
  *
@@ -91,7 +50,7 @@ class Tenant {
91
50
  *
92
51
  * @example
93
52
  * await client.tenant.createTenant({
94
- * tenant_id: "tenant_id"
53
+ * tenant_id: "tenant_1234"
95
54
  * })
96
55
  */
97
56
  createTenant(request, requestOptions) {
@@ -156,17 +115,6 @@ class Tenant {
156
115
  }
157
116
  }
158
117
  /**
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
166
- *
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.
169
- *
170
118
  * @param {CortexAI.TenantStatsRequest} request
171
119
  * @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
172
120
  *
@@ -180,7 +128,7 @@ class Tenant {
180
128
  *
181
129
  * @example
182
130
  * await client.tenant.stats({
183
- * tenant_id: "tenant_id"
131
+ * tenant_id: "tenant_1234"
184
132
  * })
185
133
  */
186
134
  stats(request, requestOptions) {
@@ -193,7 +141,7 @@ class Tenant {
193
141
  _queryParams["tenant_id"] = tenantId;
194
142
  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);
195
143
  const _response = await core.fetcher({
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"),
144
+ 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/monitor"),
197
145
  method: "GET",
198
146
  headers: _headers,
199
147
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -236,7 +184,7 @@ class Tenant {
236
184
  rawResponse: _response.rawResponse,
237
185
  });
238
186
  case "timeout":
239
- throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /tenants/stats.");
187
+ throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /tenants/monitor.");
240
188
  case "unknown":
241
189
  throw new errors.CortexAIError({
242
190
  message: _response.error.errorMessage,
@@ -5,7 +5,7 @@ import * as CortexAI from "../../../../index.js";
5
5
  /**
6
6
  * @example
7
7
  * {
8
- * tenant_id: "tenant_id"
8
+ * tenant_id: "tenant_1234"
9
9
  * }
10
10
  */
11
11
  export interface TenantCreateRequest {
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * @example
6
6
  * {
7
- * tenant_id: "tenant_id"
7
+ * tenant_id: "tenant_1234"
8
8
  * }
9
9
  */
10
10
  export interface TenantStatsRequest {
@@ -30,12 +30,7 @@ export declare class Upload {
30
30
  protected readonly _options: Upload.Options;
31
31
  constructor(_options?: Upload.Options);
32
32
  /**
33
- * Upload one or more documents for ingestion.
34
- * Supports both single and batch uploads.
35
- * For single file: send one file with the 'files' field.
36
- * For batch: send multiple files with the 'files' field (FastAPI will parse as list).
37
- *
38
- * @param {CortexAI.BodyUploadDocumentIngestionUploadDocumentPost} request
33
+ * @param {CortexAI.BodyUploadKnowledgeIngestionUploadKnowledgePost} request
39
34
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
40
35
  *
41
36
  * @throws {@link CortexAI.BadRequestError}
@@ -48,47 +43,13 @@ export declare class Upload {
48
43
  *
49
44
  * @example
50
45
  * import { createReadStream } from "fs";
51
- * await client.upload.uploadDocument({
52
- * files: [fs.createReadStream("/path/to/your/file")],
46
+ * await client.upload.uploadKnowledge({
53
47
  * tenant_id: "tenant_id"
54
48
  * })
55
49
  */
56
- uploadDocument(request: CortexAI.BodyUploadDocumentIngestionUploadDocumentPost, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SourceUploadResponse>;
57
- private __uploadDocument;
50
+ uploadKnowledge(request: CortexAI.BodyUploadKnowledgeIngestionUploadKnowledgePost, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.SourceUploadResponse>;
51
+ private __uploadKnowledge;
58
52
  /**
59
- * Upload structured sources generated by first-party or third-party apps.
60
- * Supports both single and batch uploads.
61
- *
62
- * @param {CortexAI.BodyUploadAppIngestionUploadAppPost} request
63
- * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
64
- *
65
- * @throws {@link CortexAI.BadRequestError}
66
- * @throws {@link CortexAI.UnauthorizedError}
67
- * @throws {@link CortexAI.ForbiddenError}
68
- * @throws {@link CortexAI.NotFoundError}
69
- * @throws {@link CortexAI.UnprocessableEntityError}
70
- * @throws {@link CortexAI.InternalServerError}
71
- * @throws {@link CortexAI.ServiceUnavailableError}
72
- *
73
- * @example
74
- * await client.upload.uploadAppSources({
75
- * app_sources: {
76
- * id: "id",
77
- * tenant_id: "tenant_id",
78
- * sub_tenant_id: "sub_tenant_id"
79
- * },
80
- * tenant_id: "tenant_id"
81
- * })
82
- */
83
- uploadAppSources(request: CortexAI.BodyUploadAppIngestionUploadAppPost, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.AppSourcesUploadData>;
84
- private __uploadAppSources;
85
- /**
86
- * Check the current processing status of your uploaded content.
87
- *
88
- * This endpoint allows you to monitor the progress of documents, text, or other content you've uploaded. Simply provide the file ID to see whether processing is complete, still in progress, or if any errors occurred.
89
- *
90
- * Use this to determine when your content is ready for search and retrieval, or to troubleshoot any processing issues.
91
- *
92
53
  * @param {CortexAI.UploadVerifyProcessingRequest} request
93
54
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
94
55
  *
@@ -102,30 +63,13 @@ export declare class Upload {
102
63
  *
103
64
  * @example
104
65
  * await client.upload.verifyProcessing({
105
- * file_id: "file_id"
66
+ * file_id: "<str>",
67
+ * tenant_id: "tenant_1234"
106
68
  * })
107
69
  */
108
70
  verifyProcessing(request: CortexAI.UploadVerifyProcessingRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.ProcessingStatus>;
109
71
  private __verifyProcessing;
110
72
  /**
111
- * Add memories for indexing and retrieval.
112
- *
113
- * This API provides a unified entry point for ingesting various types of content:
114
- *
115
- * **Content Types Supported:**
116
- * - Raw text content (`text` field)
117
- * - Markdown formatted content (`text` + `is_markdown=true`)
118
- * - User/assistant conversation pairs (`user_assistant_pairs` field)
119
- *
120
- * **Key Features:**
121
- * - **Inference Mode (`infer=true`)**: When enabled, the system extracts additional
122
- * insights and implicit information from your content. Useful for conversation
123
- * analysis and knowledge extraction.
124
- * - **Direct Mode (`infer=false`)**: Content is chunked and indexed as-is without
125
- * additional processing.
126
- *
127
- * Use `/ingestion/verify-processing` endpoint to check the processing status.
128
- *
129
73
  * @param {CortexAI.BodyAddMemoryMemoriesAddMemoryPost} request
130
74
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
131
75
  *
@@ -140,20 +84,12 @@ export declare class Upload {
140
84
  * @example
141
85
  * await client.upload.addMemory({
142
86
  * memories: [{}],
143
- * tenant_id: "tenant_id"
87
+ * tenant_id: "tenant_1234"
144
88
  * })
145
89
  */
146
90
  addMemory(request: CortexAI.BodyAddMemoryMemoriesAddMemoryPost, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.AddMemoryResponse>;
147
91
  private __addMemory;
148
92
  /**
149
- * Permanently remove a specific memory from storage.
150
- *
151
- * This API allows you to delete a memory by its unique identifier.
152
- * Once deleted, the memory cannot be recovered, so use this operation carefully.
153
- *
154
- * The memory will be removed from your tenant's storage and will no longer
155
- * appear in search results or memory listings.
156
- *
157
93
  * @param {CortexAI.UploadDeleteMemoryRequest} request
158
94
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
159
95
  *
@@ -167,8 +103,8 @@ export declare class Upload {
167
103
  *
168
104
  * @example
169
105
  * await client.upload.deleteMemory({
170
- * tenant_id: "tenant_id",
171
- * memory_id: "memory_id"
106
+ * tenant_id: "tenant_1234",
107
+ * memory_id: "memory_1234"
172
108
  * })
173
109
  */
174
110
  deleteMemory(request: CortexAI.UploadDeleteMemoryRequest, requestOptions?: Upload.RequestOptions): core.HttpResponsePromise<CortexAI.DeleteUserMemoryResponse>;
@@ -37,12 +37,7 @@ class Upload {
37
37
  this._options = _options;
38
38
  }
39
39
  /**
40
- * Upload one or more documents for ingestion.
41
- * Supports both single and batch uploads.
42
- * For single file: send one file with the 'files' field.
43
- * For batch: send multiple files with the 'files' field (FastAPI will parse as list).
44
- *
45
- * @param {CortexAI.BodyUploadDocumentIngestionUploadDocumentPost} request
40
+ * @param {CortexAI.BodyUploadKnowledgeIngestionUploadKnowledgePost} request
46
41
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
47
42
  *
48
43
  * @throws {@link CortexAI.BadRequestError}
@@ -55,20 +50,16 @@ class Upload {
55
50
  *
56
51
  * @example
57
52
  * import { createReadStream } from "fs";
58
- * await client.upload.uploadDocument({
59
- * files: [fs.createReadStream("/path/to/your/file")],
53
+ * await client.upload.uploadKnowledge({
60
54
  * tenant_id: "tenant_id"
61
55
  * })
62
56
  */
63
- uploadDocument(request, requestOptions) {
64
- return core.HttpResponsePromise.fromPromise(this.__uploadDocument(request, requestOptions));
57
+ uploadKnowledge(request, requestOptions) {
58
+ return core.HttpResponsePromise.fromPromise(this.__uploadKnowledge(request, requestOptions));
65
59
  }
66
- async __uploadDocument(request, requestOptions) {
60
+ async __uploadKnowledge(request, requestOptions) {
67
61
  var _a, _b, _c;
68
62
  const _request = await core.newFormData();
69
- for (const _file of request.files) {
70
- await _request.appendFile("files", _file);
71
- }
72
63
  _request.append("tenant_id", request.tenant_id);
73
64
  if (request.sub_tenant_id != null) {
74
65
  _request.append("sub_tenant_id", request.sub_tenant_id);
@@ -76,13 +67,21 @@ class Upload {
76
67
  if (request.upsert != null) {
77
68
  _request.append("upsert", request.upsert.toString());
78
69
  }
70
+ if (request.files != null) {
71
+ for (const _file of request.files) {
72
+ await _request.appendFile("files", _file);
73
+ }
74
+ }
79
75
  if (request.file_metadata != null) {
80
76
  _request.append("file_metadata", request.file_metadata);
81
77
  }
78
+ if (request.app_sources != null) {
79
+ _request.append("app_sources", request.app_sources);
80
+ }
82
81
  const _maybeEncodedRequest = await _request.getRequest();
83
82
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: await this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
84
83
  const _response = await core.fetcher({
85
- 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, "ingestion/upload-document"),
84
+ 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, "ingestion/upload_knowledge"),
86
85
  method: "POST",
87
86
  headers: _headers,
88
87
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -128,7 +127,7 @@ class Upload {
128
127
  rawResponse: _response.rawResponse,
129
128
  });
130
129
  case "timeout":
131
- throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /ingestion/upload-document.");
130
+ throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /ingestion/upload_knowledge.");
132
131
  case "unknown":
133
132
  throw new errors.CortexAIError({
134
133
  message: _response.error.errorMessage,
@@ -137,98 +136,6 @@ class Upload {
137
136
  }
138
137
  }
139
138
  /**
140
- * Upload structured sources generated by first-party or third-party apps.
141
- * Supports both single and batch uploads.
142
- *
143
- * @param {CortexAI.BodyUploadAppIngestionUploadAppPost} request
144
- * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
145
- *
146
- * @throws {@link CortexAI.BadRequestError}
147
- * @throws {@link CortexAI.UnauthorizedError}
148
- * @throws {@link CortexAI.ForbiddenError}
149
- * @throws {@link CortexAI.NotFoundError}
150
- * @throws {@link CortexAI.UnprocessableEntityError}
151
- * @throws {@link CortexAI.InternalServerError}
152
- * @throws {@link CortexAI.ServiceUnavailableError}
153
- *
154
- * @example
155
- * await client.upload.uploadAppSources({
156
- * app_sources: {
157
- * id: "id",
158
- * tenant_id: "tenant_id",
159
- * sub_tenant_id: "sub_tenant_id"
160
- * },
161
- * tenant_id: "tenant_id"
162
- * })
163
- */
164
- uploadAppSources(request, requestOptions) {
165
- return core.HttpResponsePromise.fromPromise(this.__uploadAppSources(request, requestOptions));
166
- }
167
- async __uploadAppSources(request, requestOptions) {
168
- var _a, _b, _c;
169
- 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);
170
- const _response = await core.fetcher({
171
- 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, "ingestion/upload-app"),
172
- method: "POST",
173
- headers: _headers,
174
- contentType: "application/json",
175
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
176
- requestType: "json",
177
- body: request,
178
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
179
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
180
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
181
- });
182
- if (_response.ok) {
183
- return { data: _response.body, rawResponse: _response.rawResponse };
184
- }
185
- if (_response.error.reason === "status-code") {
186
- switch (_response.error.statusCode) {
187
- case 400:
188
- throw new CortexAI.BadRequestError(_response.error.body, _response.rawResponse);
189
- case 401:
190
- throw new CortexAI.UnauthorizedError(_response.error.body, _response.rawResponse);
191
- case 403:
192
- throw new CortexAI.ForbiddenError(_response.error.body, _response.rawResponse);
193
- case 404:
194
- throw new CortexAI.NotFoundError(_response.error.body, _response.rawResponse);
195
- case 422:
196
- throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
197
- case 500:
198
- throw new CortexAI.InternalServerError(_response.error.body, _response.rawResponse);
199
- case 503:
200
- throw new CortexAI.ServiceUnavailableError(_response.error.body, _response.rawResponse);
201
- default:
202
- throw new errors.CortexAIError({
203
- statusCode: _response.error.statusCode,
204
- body: _response.error.body,
205
- rawResponse: _response.rawResponse,
206
- });
207
- }
208
- }
209
- switch (_response.error.reason) {
210
- case "non-json":
211
- throw new errors.CortexAIError({
212
- statusCode: _response.error.statusCode,
213
- body: _response.error.rawBody,
214
- rawResponse: _response.rawResponse,
215
- });
216
- case "timeout":
217
- throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /ingestion/upload-app.");
218
- case "unknown":
219
- throw new errors.CortexAIError({
220
- message: _response.error.errorMessage,
221
- rawResponse: _response.rawResponse,
222
- });
223
- }
224
- }
225
- /**
226
- * Check the current processing status of your uploaded content.
227
- *
228
- * This endpoint allows you to monitor the progress of documents, text, or other content you've uploaded. Simply provide the file ID to see whether processing is complete, still in progress, or if any errors occurred.
229
- *
230
- * Use this to determine when your content is ready for search and retrieval, or to troubleshoot any processing issues.
231
- *
232
139
  * @param {CortexAI.UploadVerifyProcessingRequest} request
233
140
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
234
141
  *
@@ -242,7 +149,8 @@ class Upload {
242
149
  *
243
150
  * @example
244
151
  * await client.upload.verifyProcessing({
245
- * file_id: "file_id"
152
+ * file_id: "<str>",
153
+ * tenant_id: "tenant_1234"
246
154
  * })
247
155
  */
248
156
  verifyProcessing(request, requestOptions) {
@@ -261,7 +169,7 @@ class Upload {
261
169
  }
262
170
  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);
263
171
  const _response = await core.fetcher({
264
- 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, "ingestion/verify-processing"),
172
+ 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, "ingestion/verify_processing"),
265
173
  method: "POST",
266
174
  headers: _headers,
267
175
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -304,7 +212,7 @@ class Upload {
304
212
  rawResponse: _response.rawResponse,
305
213
  });
306
214
  case "timeout":
307
- throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /ingestion/verify-processing.");
215
+ throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /ingestion/verify_processing.");
308
216
  case "unknown":
309
217
  throw new errors.CortexAIError({
310
218
  message: _response.error.errorMessage,
@@ -313,24 +221,6 @@ class Upload {
313
221
  }
314
222
  }
315
223
  /**
316
- * Add memories for indexing and retrieval.
317
- *
318
- * This API provides a unified entry point for ingesting various types of content:
319
- *
320
- * **Content Types Supported:**
321
- * - Raw text content (`text` field)
322
- * - Markdown formatted content (`text` + `is_markdown=true`)
323
- * - User/assistant conversation pairs (`user_assistant_pairs` field)
324
- *
325
- * **Key Features:**
326
- * - **Inference Mode (`infer=true`)**: When enabled, the system extracts additional
327
- * insights and implicit information from your content. Useful for conversation
328
- * analysis and knowledge extraction.
329
- * - **Direct Mode (`infer=false`)**: Content is chunked and indexed as-is without
330
- * additional processing.
331
- *
332
- * Use `/ingestion/verify-processing` endpoint to check the processing status.
333
- *
334
224
  * @param {CortexAI.BodyAddMemoryMemoriesAddMemoryPost} request
335
225
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
336
226
  *
@@ -345,7 +235,7 @@ class Upload {
345
235
  * @example
346
236
  * await client.upload.addMemory({
347
237
  * memories: [{}],
348
- * tenant_id: "tenant_id"
238
+ * tenant_id: "tenant_1234"
349
239
  * })
350
240
  */
351
241
  addMemory(request, requestOptions) {
@@ -410,14 +300,6 @@ class Upload {
410
300
  }
411
301
  }
412
302
  /**
413
- * Permanently remove a specific memory from storage.
414
- *
415
- * This API allows you to delete a memory by its unique identifier.
416
- * Once deleted, the memory cannot be recovered, so use this operation carefully.
417
- *
418
- * The memory will be removed from your tenant's storage and will no longer
419
- * appear in search results or memory listings.
420
- *
421
303
  * @param {CortexAI.UploadDeleteMemoryRequest} request
422
304
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
423
305
  *
@@ -431,8 +313,8 @@ class Upload {
431
313
  *
432
314
  * @example
433
315
  * await client.upload.deleteMemory({
434
- * tenant_id: "tenant_id",
435
- * memory_id: "memory_id"
316
+ * tenant_id: "tenant_1234",
317
+ * memory_id: "memory_1234"
436
318
  * })
437
319
  */
438
320
  deleteMemory(request, requestOptions) {