@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
@@ -6,7 +6,7 @@ import * as CortexAI from "../../../../index.js";
6
6
  * @example
7
7
  * {
8
8
  * memories: [{}],
9
- * tenant_id: "tenant_id"
9
+ * tenant_id: "tenant_1234"
10
10
  * }
11
11
  */
12
12
  export interface BodyAddMemoryMemoriesAddMemoryPost {
@@ -5,18 +5,20 @@ import * as core from "../../../../../core/index.js";
5
5
  /**
6
6
  * @example
7
7
  * {
8
- * files: [fs.createReadStream("/path/to/your/file")],
9
8
  * tenant_id: "tenant_id"
10
9
  * }
11
10
  */
12
- export interface BodyUploadDocumentIngestionUploadDocumentPost {
13
- /** Files to be uploaded */
14
- files: core.file.Uploadable.FileLike[];
11
+ export interface BodyUploadKnowledgeIngestionUploadKnowledgePost {
15
12
  /** Unique identifier for the tenant/organization */
16
13
  tenant_id: string;
17
14
  /** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
18
15
  sub_tenant_id?: string;
16
+ /** If true, update existing sources with the same id. */
19
17
  upsert?: boolean;
20
- /** JSON Array of file metadata objects */
18
+ /** Files to upload (documents). Omit or leave empty when only sending app_sources. */
19
+ files?: core.file.Uploadable.FileLike[] | undefined;
20
+ /** JSON array of file metadata objects; length must match files when provided. */
21
21
  file_metadata?: string;
22
+ /** JSON: single source object or array of app-generated sources to index. Omit when only uploading files. */
23
+ app_sources?: string;
22
24
  }
@@ -4,8 +4,8 @@
4
4
  /**
5
5
  * @example
6
6
  * {
7
- * tenant_id: "tenant_id",
8
- * memory_id: "memory_id"
7
+ * tenant_id: "tenant_1234",
8
+ * memory_id: "memory_1234"
9
9
  * }
10
10
  */
11
11
  export interface UploadDeleteMemoryRequest {
@@ -4,7 +4,8 @@
4
4
  /**
5
5
  * @example
6
6
  * {
7
- * file_id: "file_id"
7
+ * file_id: "<str>",
8
+ * tenant_id: "tenant_1234"
8
9
  * }
9
10
  */
10
11
  export interface UploadVerifyProcessingRequest {
@@ -1,5 +1,4 @@
1
- export { type BodyUploadDocumentIngestionUploadDocumentPost } from "./BodyUploadDocumentIngestionUploadDocumentPost.js";
2
- export { type BodyUploadAppIngestionUploadAppPost } from "./BodyUploadAppIngestionUploadAppPost.js";
1
+ export { type BodyUploadKnowledgeIngestionUploadKnowledgePost } from "./BodyUploadKnowledgeIngestionUploadKnowledgePost.js";
3
2
  export { type UploadVerifyProcessingRequest } from "./UploadVerifyProcessingRequest.js";
4
3
  export { type BodyAddMemoryMemoriesAddMemoryPost } from "./BodyAddMemoryMemoriesAddMemoryPost.js";
5
4
  export { type UploadDeleteMemoryRequest } from "./UploadDeleteMemoryRequest.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface ForcefulRelationsPayload {
5
+ /** Cortex source IDs to forcefully relate to the uploaded source. */
6
+ cortex_source_ids?: string[];
7
+ /** Optional properties to attach to the forceful relation. */
8
+ properties?: Record<string, unknown>;
9
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type ListContentKind = "knowledge" | "memories";
5
+ export declare const ListContentKind: {
6
+ readonly Knowledge: "knowledge";
7
+ readonly Memories: "memories";
8
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ListContentKind = void 0;
7
+ exports.ListContentKind = {
8
+ Knowledge: "knowledge",
9
+ Memories: "memories",
10
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as CortexAI from "../index.js";
5
+ /**
6
+ * Response model for listing all user memories.
7
+ */
8
+ export interface ListUserMemoriesResponse {
9
+ /** Indicates whether the memory listing operation was successful */
10
+ success?: boolean;
11
+ /** Array of all user memories associated with your tenant */
12
+ user_memories?: CortexAI.UserMemory[];
13
+ }
@@ -17,7 +17,7 @@ export interface MemoryItem {
17
17
  user_assistant_pairs?: CortexAI.UserAssistantPair[];
18
18
  /** Whether the text is markdown formatted. */
19
19
  is_markdown?: boolean;
20
- /** If true, process and extract additional insights/inferences from the content before indexing. Useful for extracting implicit information from conversations. */
20
+ /** If true, process and extract additional insights/inferences from the contentbefore indexingUseful for extracting implicit information from conversations */
21
21
  infer?: boolean;
22
22
  /** Custom instructions to guide inference processing. */
23
23
  custom_instructions?: string;
@@ -38,4 +38,6 @@ export interface MemoryItem {
38
38
  *
39
39
  */
40
40
  document_metadata?: string;
41
+ /** Forcefully connect 2 sources based on cortex source ids or common properties. */
42
+ relations?: CortexAI.ForcefulRelationsPayload;
41
43
  }
@@ -8,4 +8,6 @@ import * as CortexAI from "../index.js";
8
8
  export interface RetrievalResult {
9
9
  chunks?: CortexAI.VectorStoreChunk[];
10
10
  graph_context?: CortexAI.GraphContext;
11
+ /** Map of chunk_uuid to VectorStoreChunk for extra context from forcefully related sources. Use chunk.extra_context_ids to look up chunks: extra_context[id] for id in chunk.extra_context_ids. */
12
+ additional_context?: Record<string, CortexAI.VectorStoreChunk>;
11
13
  }
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type RetrieveMode = "fast" | "accurate";
4
+ export type RetrieveMode = "fast" | "thinking";
5
5
  export declare const RetrieveMode: {
6
6
  readonly Fast: "fast";
7
- readonly Accurate: "accurate";
7
+ readonly Thinking: "thinking";
8
8
  };
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.RetrieveMode = void 0;
7
7
  exports.RetrieveMode = {
8
8
  Fast: "fast",
9
- Accurate: "accurate",
9
+ Thinking: "thinking",
10
10
  };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Represents a user memory stored in the system.
6
+ */
7
+ export interface UserMemory {
8
+ /** Unique identifier for the user memory */
9
+ memory_id: string;
10
+ /** The actual memory content text that was stored */
11
+ memory_content: string;
12
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -24,4 +24,6 @@ export interface VectorStoreChunk {
24
24
  document_metadata?: Record<string, unknown>;
25
25
  /** Custom metadata associated with your tenant */
26
26
  tenant_metadata?: Record<string, unknown>;
27
+ /** IDs of related chunks providing extra context (from forceful relations). Only present in accurate mode when sources have forceful relations. */
28
+ extra_context_ids?: string[];
27
29
  }
@@ -1,7 +1,6 @@
1
1
  export * from "./ActualErrorResponse.js";
2
2
  export * from "./AddMemoryResponse.js";
3
3
  export * from "./ApiKeyInfo.js";
4
- export * from "./AppSourcesUploadData.js";
5
4
  export * from "./AttachmentModel.js";
6
5
  export * from "./Bm25OperatorType.js";
7
6
  export * from "./CollectionStats.js";
@@ -15,10 +14,13 @@ export * from "./DeleteUserMemoryResponse.js";
15
14
  export * from "./Entity.js";
16
15
  export * from "./ErrorResponse.js";
17
16
  export * from "./FetchMode.js";
17
+ export * from "./ForcefulRelationsPayload.js";
18
18
  export * from "./GraphContext.js";
19
19
  export * from "./HttpValidationError.js";
20
20
  export * from "./Infra.js";
21
21
  export * from "./InsertResult.js";
22
+ export * from "./ListContentKind.js";
23
+ export * from "./ListUserMemoriesResponse.js";
22
24
  export * from "./MemoryItem.js";
23
25
  export * from "./MemoryResultItem.js";
24
26
  export * from "./MilvusDataType.js";
@@ -49,5 +51,6 @@ export * from "./TenantMetadataSchemaInfo.js";
49
51
  export * from "./TenantStatsResponse.js";
50
52
  export * from "./TripletWithEvidence.js";
51
53
  export * from "./UserAssistantPair.js";
54
+ export * from "./UserMemory.js";
52
55
  export * from "./ValidationError.js";
53
56
  export * from "./VectorStoreChunk.js";
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ActualErrorResponse.js"), exports);
18
18
  __exportStar(require("./AddMemoryResponse.js"), exports);
19
19
  __exportStar(require("./ApiKeyInfo.js"), exports);
20
- __exportStar(require("./AppSourcesUploadData.js"), exports);
21
20
  __exportStar(require("./AttachmentModel.js"), exports);
22
21
  __exportStar(require("./Bm25OperatorType.js"), exports);
23
22
  __exportStar(require("./CollectionStats.js"), exports);
@@ -31,10 +30,13 @@ __exportStar(require("./DeleteUserMemoryResponse.js"), exports);
31
30
  __exportStar(require("./Entity.js"), exports);
32
31
  __exportStar(require("./ErrorResponse.js"), exports);
33
32
  __exportStar(require("./FetchMode.js"), exports);
33
+ __exportStar(require("./ForcefulRelationsPayload.js"), exports);
34
34
  __exportStar(require("./GraphContext.js"), exports);
35
35
  __exportStar(require("./HttpValidationError.js"), exports);
36
36
  __exportStar(require("./Infra.js"), exports);
37
37
  __exportStar(require("./InsertResult.js"), exports);
38
+ __exportStar(require("./ListContentKind.js"), exports);
39
+ __exportStar(require("./ListUserMemoriesResponse.js"), exports);
38
40
  __exportStar(require("./MemoryItem.js"), exports);
39
41
  __exportStar(require("./MemoryResultItem.js"), exports);
40
42
  __exportStar(require("./MilvusDataType.js"), exports);
@@ -65,5 +67,6 @@ __exportStar(require("./TenantMetadataSchemaInfo.js"), exports);
65
67
  __exportStar(require("./TenantStatsResponse.js"), exports);
66
68
  __exportStar(require("./TripletWithEvidence.js"), exports);
67
69
  __exportStar(require("./UserAssistantPair.js"), exports);
70
+ __exportStar(require("./UserMemory.js"), exports);
68
71
  __exportStar(require("./ValidationError.js"), exports);
69
72
  __exportStar(require("./VectorStoreChunk.js"), exports);
package/package.json CHANGED
@@ -1,31 +1,34 @@
1
1
  {
2
- "name": "@usecortex_ai/node",
3
- "version": "0.4.0",
4
- "description": "The official TypeScript SDK for the Cortex AI platform.",
5
- "author": "Nishkarsh Shrivastava <nishkarsh@usecortex.ai>",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "files": [
9
- "dist"
10
- ],
11
- "keywords": [
12
- "cortex",
13
- "cortex-ai",
14
- "cortex-ai-sdk",
15
- "cortex-ai-typescript-sdk",
16
- "rag", "gen-ai", "memory", "ai"
17
- ],
18
- "scripts": {
19
- "build": "tsc",
20
- "prepublishOnly": "npm run build"
21
- },
22
- "dependencies": {
23
- "form-data": "^4.0.0",
24
- "node-fetch": "2.7.0"
25
- },
26
- "devDependencies": {
27
- "@types/node": "^18.19.3",
28
- "@types/node-fetch": "2.6.9",
29
- "typescript": "5.3.3"
30
- }
31
- }
2
+ "name": "@usecortex_ai/node",
3
+ "version": "0.5.1",
4
+ "description": "The official TypeScript SDK for the Cortex AI platform.",
5
+ "author": "Nishkarsh Shrivastava <nishkarsh@usecortex.ai>",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "keywords": [
12
+ "cortex",
13
+ "cortex-ai",
14
+ "cortex-ai-sdk",
15
+ "cortex-ai-typescript-sdk",
16
+ "rag",
17
+ "gen-ai",
18
+ "memory",
19
+ "ai"
20
+ ],
21
+ "scripts": {
22
+ "build": "tsc",
23
+ "prepublishOnly": "npm run build"
24
+ },
25
+ "dependencies": {
26
+ "form-data": "^4.0.0",
27
+ "node-fetch": "2.7.0"
28
+ },
29
+ "devDependencies": {
30
+ "@types/node": "^18.19.3",
31
+ "@types/node-fetch": "2.6.9",
32
+ "typescript": "5.3.3"
33
+ }
34
+ }
@@ -1,15 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- /**
5
- * @example
6
- * {
7
- * tenant_id: "tenant_id"
8
- * }
9
- */
10
- export interface FetchSourcesRequest {
11
- /** Unique identifier for the tenant/organization */
12
- tenant_id: string;
13
- /** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
14
- sub_tenant_id?: string;
15
- }
@@ -1,18 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- /**
5
- * @example
6
- * {
7
- * source_ids: ["source_ids"],
8
- * tenant_id: "tenant_id"
9
- * }
10
- */
11
- export interface ListSourcesByIdRequest {
12
- /** List of source IDs to fetch. */
13
- source_ids: string[];
14
- /** Tenant ID */
15
- tenant_id: string;
16
- /** Sub-tenant ID */
17
- sub_tenant_id?: string;
18
- }
@@ -1,31 +0,0 @@
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
- * app_sources: {
9
- * id: "id",
10
- * tenant_id: "tenant_id",
11
- * sub_tenant_id: "sub_tenant_id"
12
- * },
13
- * tenant_id: "tenant_id"
14
- * }
15
- */
16
- export interface BodyUploadAppIngestionUploadAppPost {
17
- /** Single source object or list of structured source objects containing app-generated data to be indexed */
18
- app_sources: BodyUploadAppIngestionUploadAppPost.AppSources;
19
- /** Unique identifier for the tenant/organization */
20
- tenant_id: string;
21
- /** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
22
- sub_tenant_id?: string;
23
- /** If true, update existing sources with the same source_id. Defaults to True. */
24
- upsert?: boolean;
25
- }
26
- export declare namespace BodyUploadAppIngestionUploadAppPost {
27
- /**
28
- * Single source object or list of structured source objects containing app-generated data to be indexed
29
- */
30
- type AppSources = CortexAI.SourceModel | CortexAI.SourceModel[];
31
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as CortexAI from "../index.js";
5
- /**
6
- * Response model for uploads of app-generated sources.
7
- */
8
- export interface AppSourcesUploadData {
9
- success?: boolean;
10
- message?: string;
11
- /** List of upload results for each source. */
12
- results?: CortexAI.SourceUploadResultItem[];
13
- /** Number of sources successfully queued. */
14
- success_count?: number;
15
- /** Number of sources that failed to upload. */
16
- failed_count?: number;
17
- }