@getzep/zep-cloud 2.12.3 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/api/resources/document/client/Client.js +13 -13
  2. package/api/resources/graph/client/Client.js +6 -6
  3. package/api/resources/graph/client/requests/EntityTypeRequest.d.ts +1 -0
  4. package/api/resources/graph/resources/edge/client/Client.js +4 -4
  5. package/api/resources/graph/resources/episode/client/Client.d.ts +1 -1
  6. package/api/resources/graph/resources/episode/client/Client.js +6 -6
  7. package/api/resources/graph/resources/node/client/Client.js +5 -5
  8. package/api/resources/group/client/Client.js +6 -6
  9. package/api/resources/memory/client/Client.js +22 -22
  10. package/api/resources/user/client/Client.js +8 -8
  11. package/api/types/EdgeType.d.ts +10 -0
  12. package/api/types/EdgeType.js +5 -0
  13. package/api/types/EntityEdge.d.ts +2 -0
  14. package/api/types/EntityEdgeSourceTarget.d.ts +9 -0
  15. package/api/types/EntityEdgeSourceTarget.js +5 -0
  16. package/api/types/EntityTypeResponse.d.ts +1 -0
  17. package/api/types/Episode.d.ts +4 -0
  18. package/api/types/EpisodeMentions.d.ts +8 -0
  19. package/api/types/EpisodeMentions.js +5 -0
  20. package/api/types/GraphSearchResults.d.ts +1 -0
  21. package/api/types/GraphSearchScope.d.ts +2 -1
  22. package/api/types/GraphSearchScope.js +1 -0
  23. package/api/types/SearchFilters.d.ts +2 -0
  24. package/api/types/index.d.ts +4 -1
  25. package/api/types/index.js +4 -1
  26. package/dist/api/resources/document/client/Client.js +13 -13
  27. package/dist/api/resources/graph/client/Client.js +6 -6
  28. package/dist/api/resources/graph/client/requests/EntityTypeRequest.d.ts +1 -0
  29. package/dist/api/resources/graph/resources/edge/client/Client.js +4 -4
  30. package/dist/api/resources/graph/resources/episode/client/Client.d.ts +1 -1
  31. package/dist/api/resources/graph/resources/episode/client/Client.js +6 -6
  32. package/dist/api/resources/graph/resources/node/client/Client.js +5 -5
  33. package/dist/api/resources/group/client/Client.js +6 -6
  34. package/dist/api/resources/memory/client/Client.js +22 -22
  35. package/dist/api/resources/user/client/Client.js +8 -8
  36. package/dist/api/types/EdgeType.d.ts +10 -0
  37. package/dist/api/types/EdgeType.js +5 -0
  38. package/dist/api/types/EntityEdge.d.ts +2 -0
  39. package/dist/api/types/EntityEdgeSourceTarget.d.ts +9 -0
  40. package/dist/api/types/EntityEdgeSourceTarget.js +5 -0
  41. package/dist/api/types/EntityTypeResponse.d.ts +1 -0
  42. package/dist/api/types/Episode.d.ts +4 -0
  43. package/dist/api/types/EpisodeMentions.d.ts +8 -0
  44. package/dist/api/types/EpisodeMentions.js +5 -0
  45. package/dist/api/types/GraphSearchResults.d.ts +1 -0
  46. package/dist/api/types/GraphSearchScope.d.ts +2 -1
  47. package/dist/api/types/GraphSearchScope.js +1 -0
  48. package/dist/api/types/SearchFilters.d.ts +2 -0
  49. package/dist/api/types/index.d.ts +4 -1
  50. package/dist/api/types/index.js +4 -1
  51. package/dist/serialization/resources/graph/client/requests/EntityTypeRequest.d.ts +2 -0
  52. package/dist/serialization/resources/graph/client/requests/EntityTypeRequest.js +2 -0
  53. package/dist/serialization/types/EdgeType.d.ts +17 -0
  54. package/dist/serialization/types/EdgeType.js +48 -0
  55. package/dist/serialization/types/EntityEdge.d.ts +1 -0
  56. package/dist/serialization/types/EntityEdge.js +1 -0
  57. package/dist/serialization/types/EntityEdgeSourceTarget.d.ts +13 -0
  58. package/dist/serialization/types/EntityEdgeSourceTarget.js +44 -0
  59. package/dist/serialization/types/EntityTypeResponse.d.ts +2 -0
  60. package/dist/serialization/types/EntityTypeResponse.js +2 -0
  61. package/dist/serialization/types/Episode.d.ts +3 -0
  62. package/dist/serialization/types/Episode.js +3 -0
  63. package/dist/serialization/types/EpisodeMentions.d.ts +15 -0
  64. package/dist/serialization/types/EpisodeMentions.js +46 -0
  65. package/dist/serialization/types/GraphSearchResults.d.ts +2 -0
  66. package/dist/serialization/types/GraphSearchResults.js +2 -0
  67. package/dist/serialization/types/GraphSearchScope.d.ts +1 -1
  68. package/dist/serialization/types/GraphSearchScope.js +1 -1
  69. package/dist/serialization/types/SearchFilters.d.ts +1 -0
  70. package/dist/serialization/types/SearchFilters.js +1 -0
  71. package/dist/serialization/types/index.d.ts +4 -1
  72. package/dist/serialization/types/index.js +4 -1
  73. package/dist/version.d.ts +1 -1
  74. package/dist/version.js +1 -1
  75. package/dist/wrapper/graph.d.ts +40 -2
  76. package/dist/wrapper/graph.js +45 -3
  77. package/dist/wrapper/ontology.d.ts +124 -0
  78. package/dist/wrapper/ontology.js +21 -1
  79. package/examples/graph/entity_type_example.ts +24 -20
  80. package/package.json +1 -1
  81. package/reference.md +1 -1
  82. package/serialization/resources/graph/client/requests/EntityTypeRequest.d.ts +2 -0
  83. package/serialization/resources/graph/client/requests/EntityTypeRequest.js +2 -0
  84. package/serialization/types/EdgeType.d.ts +17 -0
  85. package/serialization/types/EdgeType.js +48 -0
  86. package/serialization/types/EntityEdge.d.ts +1 -0
  87. package/serialization/types/EntityEdge.js +1 -0
  88. package/serialization/types/EntityEdgeSourceTarget.d.ts +13 -0
  89. package/serialization/types/EntityEdgeSourceTarget.js +44 -0
  90. package/serialization/types/EntityTypeResponse.d.ts +2 -0
  91. package/serialization/types/EntityTypeResponse.js +2 -0
  92. package/serialization/types/Episode.d.ts +3 -0
  93. package/serialization/types/Episode.js +3 -0
  94. package/serialization/types/EpisodeMentions.d.ts +15 -0
  95. package/serialization/types/EpisodeMentions.js +46 -0
  96. package/serialization/types/GraphSearchResults.d.ts +2 -0
  97. package/serialization/types/GraphSearchResults.js +2 -0
  98. package/serialization/types/GraphSearchScope.d.ts +1 -1
  99. package/serialization/types/GraphSearchScope.js +1 -1
  100. package/serialization/types/SearchFilters.d.ts +1 -0
  101. package/serialization/types/SearchFilters.js +1 -0
  102. package/serialization/types/index.d.ts +4 -1
  103. package/serialization/types/index.js +4 -1
  104. package/version.d.ts +1 -1
  105. package/version.js +1 -1
  106. package/wrapper/graph.d.ts +40 -2
  107. package/wrapper/graph.js +45 -3
  108. package/wrapper/ontology.d.ts +124 -0
  109. package/wrapper/ontology.js +21 -1
@@ -1,5 +1,5 @@
1
1
  import { ZepClient } from "../../src";
2
- import { EntityData, entityFields, EntityType } from "../../src/wrapper/ontology";
2
+ import { EntityData, entityFields, EntityType, EdgeType } from "../../src/wrapper/ontology";
3
3
 
4
4
  const API_KEY = process.env.ZEP_API_KEY;
5
5
 
@@ -8,33 +8,37 @@ async function main() {
8
8
  apiKey: API_KEY,
9
9
  });
10
10
 
11
- const purchaseSchema: EntityType = {
12
- description: "A purchase",
11
+ const travelDestinationSchema: EntityType = {
12
+ description: "A travel destination entity",
13
13
  fields: {
14
- product: entityFields.text("The product purchased"),
15
- quantity: entityFields.integer("The quantity purchased"),
16
- price: entityFields.float("The price of the product"),
14
+ destination_name: entityFields.text("The name of travel destination"),
17
15
  },
18
16
  };
19
17
 
20
- type Purchase = EntityData<typeof purchaseSchema>;
18
+ type TravelDestination = EntityData<typeof travelDestinationSchema>;
21
19
 
22
- await client.graph.setEntityTypes({
23
- Purchase: purchaseSchema,
24
- });
25
-
26
- const { nodes } = await client.graph.search({
27
- userId: "<user_id>",
28
- scope: "nodes",
29
- query: "ticket purchases",
30
- searchFilters: {
31
- nodeLabels: ["Purchase"],
20
+ const isTravelingTo: EdgeType = {
21
+ description: "An edge representing a traveler going to a destination.",
22
+ fields: {
23
+ travel_date: entityFields.text("The date of the travel"),
24
+ purpose: entityFields.text("The purpose of the travel"),
32
25
  },
33
- });
26
+ sourceTargets: [
27
+ {
28
+ source: "User",
29
+ target: "TravelDestination",
30
+ }
31
+ ]
32
+ }
34
33
 
35
- const purchases: Purchase[] = nodes?.map((node) => node.attributes as Purchase) ?? [];
34
+ await client.graph.setEntityTypes({
35
+ TravelDestination: travelDestinationSchema,
36
+ }, {
37
+ IS_TRAVELING_TO: isTravelingTo,
38
+ });
36
39
 
37
- console.log(purchases);
40
+ const customTypes = await client.graph.listEntityTypes();
41
+ console.log(JSON.stringify(customTypes, null, 2));
38
42
  }
39
43
 
40
44
  main().catch(console.error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getzep/zep-cloud",
3
- "version": "2.12.3",
3
+ "version": "2.14.0",
4
4
  "private": false,
5
5
  "repository": "https://github.com/getzep/zep-js",
6
6
  "description": "Zep: Fast, scalable building blocks for production LLM apps",
package/reference.md CHANGED
@@ -4262,7 +4262,7 @@ await client.graph.episode.delete("uuid");
4262
4262
  </dl>
4263
4263
  </details>
4264
4264
 
4265
- <details><summary><code>client.graph.episode.<a href="/src/api/resources/graph/resources/episode/client/Client.ts">getNodesAndEdges</a>(uuid) -> Zep.GraphSearchResults</code></summary>
4265
+ <details><summary><code>client.graph.episode.<a href="/src/api/resources/graph/resources/episode/client/Client.ts">getNodesAndEdges</a>(uuid) -> Zep.EpisodeMentions</code></summary>
4266
4266
  <dl>
4267
4267
  <dd>
4268
4268
 
@@ -4,10 +4,12 @@
4
4
  import * as serializers from "../../../../index";
5
5
  import * as Zep from "../../../../../api/index";
6
6
  import * as core from "../../../../../core";
7
+ import { EdgeType } from "../../../../types/EdgeType";
7
8
  import { EntityType } from "../../../../types/EntityType";
8
9
  export declare const EntityTypeRequest: core.serialization.Schema<serializers.EntityTypeRequest.Raw, Zep.EntityTypeRequest>;
9
10
  export declare namespace EntityTypeRequest {
10
11
  interface Raw {
12
+ edge_types?: EdgeType.Raw[] | null;
11
13
  entity_types?: EntityType.Raw[] | null;
12
14
  }
13
15
  }
@@ -38,7 +38,9 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.EntityTypeRequest = void 0;
40
40
  const core = __importStar(require("../../../../../core"));
41
+ const EdgeType_1 = require("../../../../types/EdgeType");
41
42
  const EntityType_1 = require("../../../../types/EntityType");
42
43
  exports.EntityTypeRequest = core.serialization.object({
44
+ edgeTypes: core.serialization.property("edge_types", core.serialization.list(EdgeType_1.EdgeType).optional()),
43
45
  entityTypes: core.serialization.property("entity_types", core.serialization.list(EntityType_1.EntityType).optional()),
44
46
  });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as Zep from "../../api/index";
6
+ import * as core from "../../core";
7
+ import { EntityProperty } from "./EntityProperty";
8
+ import { EntityEdgeSourceTarget } from "./EntityEdgeSourceTarget";
9
+ export declare const EdgeType: core.serialization.ObjectSchema<serializers.EdgeType.Raw, Zep.EdgeType>;
10
+ export declare namespace EdgeType {
11
+ interface Raw {
12
+ description: string;
13
+ name: string;
14
+ properties?: EntityProperty.Raw[] | null;
15
+ source_targets?: EntityEdgeSourceTarget.Raw[] | null;
16
+ }
17
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.EdgeType = void 0;
40
+ const core = __importStar(require("../../core"));
41
+ const EntityProperty_1 = require("./EntityProperty");
42
+ const EntityEdgeSourceTarget_1 = require("./EntityEdgeSourceTarget");
43
+ exports.EdgeType = core.serialization.object({
44
+ description: core.serialization.string(),
45
+ name: core.serialization.string(),
46
+ properties: core.serialization.list(EntityProperty_1.EntityProperty).optional(),
47
+ sourceTargets: core.serialization.property("source_targets", core.serialization.list(EntityEdgeSourceTarget_1.EntityEdgeSourceTarget).optional()),
48
+ });
@@ -7,6 +7,7 @@ import * as core from "../../core";
7
7
  export declare const EntityEdge: core.serialization.ObjectSchema<serializers.EntityEdge.Raw, Zep.EntityEdge>;
8
8
  export declare namespace EntityEdge {
9
9
  interface Raw {
10
+ attributes?: Record<string, unknown> | null;
10
11
  created_at: string;
11
12
  episodes?: string[] | null;
12
13
  expired_at?: string | null;
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.EntityEdge = void 0;
40
40
  const core = __importStar(require("../../core"));
41
41
  exports.EntityEdge = core.serialization.object({
42
+ attributes: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
42
43
  createdAt: core.serialization.property("created_at", core.serialization.string()),
43
44
  episodes: core.serialization.list(core.serialization.string()).optional(),
44
45
  expiredAt: core.serialization.property("expired_at", core.serialization.string().optional()),
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as Zep from "../../api/index";
6
+ import * as core from "../../core";
7
+ export declare const EntityEdgeSourceTarget: core.serialization.ObjectSchema<serializers.EntityEdgeSourceTarget.Raw, Zep.EntityEdgeSourceTarget>;
8
+ export declare namespace EntityEdgeSourceTarget {
9
+ interface Raw {
10
+ source?: string | null;
11
+ target?: string | null;
12
+ }
13
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.EntityEdgeSourceTarget = void 0;
40
+ const core = __importStar(require("../../core"));
41
+ exports.EntityEdgeSourceTarget = core.serialization.object({
42
+ source: core.serialization.string().optional(),
43
+ target: core.serialization.string().optional(),
44
+ });
@@ -4,10 +4,12 @@
4
4
  import * as serializers from "../index";
5
5
  import * as Zep from "../../api/index";
6
6
  import * as core from "../../core";
7
+ import { EdgeType } from "./EdgeType";
7
8
  import { EntityType } from "./EntityType";
8
9
  export declare const EntityTypeResponse: core.serialization.ObjectSchema<serializers.EntityTypeResponse.Raw, Zep.EntityTypeResponse>;
9
10
  export declare namespace EntityTypeResponse {
10
11
  interface Raw {
12
+ edge_types?: EdgeType.Raw[] | null;
11
13
  entity_types?: EntityType.Raw[] | null;
12
14
  }
13
15
  }
@@ -38,7 +38,9 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.EntityTypeResponse = void 0;
40
40
  const core = __importStar(require("../../core"));
41
+ const EdgeType_1 = require("./EdgeType");
41
42
  const EntityType_1 = require("./EntityType");
42
43
  exports.EntityTypeResponse = core.serialization.object({
44
+ edgeTypes: core.serialization.property("edge_types", core.serialization.list(EdgeType_1.EdgeType).optional()),
43
45
  entityTypes: core.serialization.property("entity_types", core.serialization.list(EntityType_1.EntityType).optional()),
44
46
  });
@@ -4,6 +4,7 @@
4
4
  import * as serializers from "../index";
5
5
  import * as Zep from "../../api/index";
6
6
  import * as core from "../../core";
7
+ import { RoleType } from "./RoleType";
7
8
  import { GraphDataType } from "./GraphDataType";
8
9
  export declare const Episode: core.serialization.ObjectSchema<serializers.Episode.Raw, Zep.Episode>;
9
10
  export declare namespace Episode {
@@ -11,6 +12,8 @@ export declare namespace Episode {
11
12
  content: string;
12
13
  created_at: string;
13
14
  processed?: boolean | null;
15
+ role?: string | null;
16
+ role_type?: RoleType.Raw | null;
14
17
  session_id?: string | null;
15
18
  source?: GraphDataType.Raw | null;
16
19
  source_description?: string | null;
@@ -38,11 +38,14 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.Episode = void 0;
40
40
  const core = __importStar(require("../../core"));
41
+ const RoleType_1 = require("./RoleType");
41
42
  const GraphDataType_1 = require("./GraphDataType");
42
43
  exports.Episode = core.serialization.object({
43
44
  content: core.serialization.string(),
44
45
  createdAt: core.serialization.property("created_at", core.serialization.string()),
45
46
  processed: core.serialization.boolean().optional(),
47
+ role: core.serialization.string().optional(),
48
+ roleType: core.serialization.property("role_type", RoleType_1.RoleType.optional()),
46
49
  sessionId: core.serialization.property("session_id", core.serialization.string().optional()),
47
50
  source: GraphDataType_1.GraphDataType.optional(),
48
51
  sourceDescription: core.serialization.property("source_description", core.serialization.string().optional()),
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as Zep from "../../api/index";
6
+ import * as core from "../../core";
7
+ import { EntityEdge } from "./EntityEdge";
8
+ import { EntityNode } from "./EntityNode";
9
+ export declare const EpisodeMentions: core.serialization.ObjectSchema<serializers.EpisodeMentions.Raw, Zep.EpisodeMentions>;
10
+ export declare namespace EpisodeMentions {
11
+ interface Raw {
12
+ edges?: EntityEdge.Raw[] | null;
13
+ nodes?: EntityNode.Raw[] | null;
14
+ }
15
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.EpisodeMentions = void 0;
40
+ const core = __importStar(require("../../core"));
41
+ const EntityEdge_1 = require("./EntityEdge");
42
+ const EntityNode_1 = require("./EntityNode");
43
+ exports.EpisodeMentions = core.serialization.object({
44
+ edges: core.serialization.list(EntityEdge_1.EntityEdge).optional(),
45
+ nodes: core.serialization.list(EntityNode_1.EntityNode).optional(),
46
+ });
@@ -5,11 +5,13 @@ import * as serializers from "../index";
5
5
  import * as Zep from "../../api/index";
6
6
  import * as core from "../../core";
7
7
  import { EntityEdge } from "./EntityEdge";
8
+ import { Episode } from "./Episode";
8
9
  import { EntityNode } from "./EntityNode";
9
10
  export declare const GraphSearchResults: core.serialization.ObjectSchema<serializers.GraphSearchResults.Raw, Zep.GraphSearchResults>;
10
11
  export declare namespace GraphSearchResults {
11
12
  interface Raw {
12
13
  edges?: EntityEdge.Raw[] | null;
14
+ episodes?: Episode.Raw[] | null;
13
15
  nodes?: EntityNode.Raw[] | null;
14
16
  }
15
17
  }
@@ -39,8 +39,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.GraphSearchResults = void 0;
40
40
  const core = __importStar(require("../../core"));
41
41
  const EntityEdge_1 = require("./EntityEdge");
42
+ const Episode_1 = require("./Episode");
42
43
  const EntityNode_1 = require("./EntityNode");
43
44
  exports.GraphSearchResults = core.serialization.object({
44
45
  edges: core.serialization.list(EntityEdge_1.EntityEdge).optional(),
46
+ episodes: core.serialization.list(Episode_1.Episode).optional(),
45
47
  nodes: core.serialization.list(EntityNode_1.EntityNode).optional(),
46
48
  });
@@ -6,5 +6,5 @@ import * as Zep from "../../api/index";
6
6
  import * as core from "../../core";
7
7
  export declare const GraphSearchScope: core.serialization.Schema<serializers.GraphSearchScope.Raw, Zep.GraphSearchScope>;
8
8
  export declare namespace GraphSearchScope {
9
- type Raw = "edges" | "nodes";
9
+ type Raw = "edges" | "nodes" | "episodes";
10
10
  }
@@ -38,4 +38,4 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.GraphSearchScope = void 0;
40
40
  const core = __importStar(require("../../core"));
41
- exports.GraphSearchScope = core.serialization.enum_(["edges", "nodes"]);
41
+ exports.GraphSearchScope = core.serialization.enum_(["edges", "nodes", "episodes"]);
@@ -7,6 +7,7 @@ import * as core from "../../core";
7
7
  export declare const SearchFilters: core.serialization.ObjectSchema<serializers.SearchFilters.Raw, Zep.SearchFilters>;
8
8
  export declare namespace SearchFilters {
9
9
  interface Raw {
10
+ edge_types?: string[] | null;
10
11
  node_labels?: string[] | null;
11
12
  }
12
13
  }
@@ -39,5 +39,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.SearchFilters = void 0;
40
40
  const core = __importStar(require("../../core"));
41
41
  exports.SearchFilters = core.serialization.object({
42
+ edgeTypes: core.serialization.property("edge_types", core.serialization.list(core.serialization.string()).optional()),
42
43
  nodeLabels: core.serialization.property("node_labels", core.serialization.list(core.serialization.string()).optional()),
43
44
  });
@@ -4,12 +4,15 @@ export * from "./ApidataDocument";
4
4
  export * from "./ApidataDocumentCollection";
5
5
  export * from "./ApidataDocumentSearchResponse";
6
6
  export * from "./ApidataDocumentWithScore";
7
+ export * from "./EdgeType";
7
8
  export * from "./EndSessionResponse";
8
9
  export * from "./EndSessionsResponse";
10
+ export * from "./EntityEdgeSourceTarget";
9
11
  export * from "./EntityProperty";
10
12
  export * from "./EntityType";
11
13
  export * from "./EntityTypeResponse";
12
14
  export * from "./EpisodeData";
15
+ export * from "./EpisodeMentions";
13
16
  export * from "./Fact";
14
17
  export * from "./FactRatingInstruction";
15
18
  export * from "./FactResponse";
@@ -18,6 +21,7 @@ export * from "./GraphEdgesRequest";
18
21
  export * from "./Episode";
19
22
  export * from "./EpisodeResponse";
20
23
  export * from "./GraphNodesRequest";
24
+ export * from "./GraphSearchResults";
21
25
  export * from "./Group";
22
26
  export * from "./GroupListResponse";
23
27
  export * from "./Memory";
@@ -41,7 +45,6 @@ export * from "./UserNodeResponse";
41
45
  export * from "./AddTripleResponse";
42
46
  export * from "./EntityEdge";
43
47
  export * from "./EntityNode";
44
- export * from "./GraphSearchResults";
45
48
  export * from "./GraphSearchScope";
46
49
  export * from "./Reranker";
47
50
  export * from "./SearchFilters";
@@ -20,12 +20,15 @@ __exportStar(require("./ApidataDocument"), exports);
20
20
  __exportStar(require("./ApidataDocumentCollection"), exports);
21
21
  __exportStar(require("./ApidataDocumentSearchResponse"), exports);
22
22
  __exportStar(require("./ApidataDocumentWithScore"), exports);
23
+ __exportStar(require("./EdgeType"), exports);
23
24
  __exportStar(require("./EndSessionResponse"), exports);
24
25
  __exportStar(require("./EndSessionsResponse"), exports);
26
+ __exportStar(require("./EntityEdgeSourceTarget"), exports);
25
27
  __exportStar(require("./EntityProperty"), exports);
26
28
  __exportStar(require("./EntityType"), exports);
27
29
  __exportStar(require("./EntityTypeResponse"), exports);
28
30
  __exportStar(require("./EpisodeData"), exports);
31
+ __exportStar(require("./EpisodeMentions"), exports);
29
32
  __exportStar(require("./Fact"), exports);
30
33
  __exportStar(require("./FactRatingInstruction"), exports);
31
34
  __exportStar(require("./FactResponse"), exports);
@@ -34,6 +37,7 @@ __exportStar(require("./GraphEdgesRequest"), exports);
34
37
  __exportStar(require("./Episode"), exports);
35
38
  __exportStar(require("./EpisodeResponse"), exports);
36
39
  __exportStar(require("./GraphNodesRequest"), exports);
40
+ __exportStar(require("./GraphSearchResults"), exports);
37
41
  __exportStar(require("./Group"), exports);
38
42
  __exportStar(require("./GroupListResponse"), exports);
39
43
  __exportStar(require("./Memory"), exports);
@@ -57,7 +61,6 @@ __exportStar(require("./UserNodeResponse"), exports);
57
61
  __exportStar(require("./AddTripleResponse"), exports);
58
62
  __exportStar(require("./EntityEdge"), exports);
59
63
  __exportStar(require("./EntityNode"), exports);
60
- __exportStar(require("./GraphSearchResults"), exports);
61
64
  __exportStar(require("./GraphSearchScope"), exports);
62
65
  __exportStar(require("./Reranker"), exports);
63
66
  __exportStar(require("./SearchFilters"), exports);
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.12.3";
1
+ export declare const SDK_VERSION = "2.14.0";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.12.3";
4
+ exports.SDK_VERSION = "2.14.0";
@@ -1,6 +1,44 @@
1
1
  import { Graph as BaseGraph } from "../api/resources/graph/client/Client";
2
2
  import { Zep } from "../index";
3
- import { EntityType } from "./ontology";
3
+ import { EdgeType, EntityType } from "./ontology";
4
4
  export declare class Graph extends BaseGraph {
5
- setEntityTypes(entityTypes: Record<string, EntityType>, requestOptions?: BaseGraph.RequestOptions): Promise<Zep.SuccessResponse>;
5
+ /**
6
+ * Sets the entity and edge types for a project, replacing any existing ones.
7
+ *
8
+ * @param {Record<string, EntityType>} entityTypes
9
+ * @param {Record<string, EdgeType>} edgeTypes
10
+ * @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
11
+ *
12
+ * @throws {@link Zep.BadRequestError}
13
+ * @throws {@link Zep.InternalServerError}
14
+ *
15
+ * @example
16
+ * const travelDestinationSchema: EntityType = {
17
+ * description: "A travel destination entity",
18
+ * fields: {
19
+ * destination_name: entityFields.text("The name of travel destination"),
20
+ * },
21
+ * };
22
+ *
23
+ * const isTravelingTo: EdgeType = {
24
+ * description: "An edge representing a traveler going to a destination.",
25
+ * fields: {
26
+ * travel_date: entityFields.text("The date of the travel"),
27
+ * purpose: entityFields.text("The purpose of the travel"),
28
+ * },
29
+ * sourceTargets: [
30
+ * {
31
+ * source: "User",
32
+ * target: "TravelDestination",
33
+ * }
34
+ * ]
35
+ * }
36
+ *
37
+ * await client.graph.setEntityTypes({
38
+ * TravelDestination: travelDestinationSchema,
39
+ * }, {
40
+ * IS_TRAVELING_TO: isTravelingTo,
41
+ * });
42
+ */
43
+ setEntityTypes(entityTypes: Record<string, EntityType>, edgeTypes: Record<string, EdgeType>, requestOptions?: BaseGraph.RequestOptions): Promise<Zep.SuccessResponse>;
6
44
  }
package/wrapper/graph.js CHANGED
@@ -13,15 +13,57 @@ exports.Graph = void 0;
13
13
  const Client_1 = require("../api/resources/graph/client/Client");
14
14
  const ontology_1 = require("./ontology");
15
15
  class Graph extends Client_1.Graph {
16
- setEntityTypes(entityTypes, requestOptions) {
16
+ /**
17
+ * Sets the entity and edge types for a project, replacing any existing ones.
18
+ *
19
+ * @param {Record<string, EntityType>} entityTypes
20
+ * @param {Record<string, EdgeType>} edgeTypes
21
+ * @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
22
+ *
23
+ * @throws {@link Zep.BadRequestError}
24
+ * @throws {@link Zep.InternalServerError}
25
+ *
26
+ * @example
27
+ * const travelDestinationSchema: EntityType = {
28
+ * description: "A travel destination entity",
29
+ * fields: {
30
+ * destination_name: entityFields.text("The name of travel destination"),
31
+ * },
32
+ * };
33
+ *
34
+ * const isTravelingTo: EdgeType = {
35
+ * description: "An edge representing a traveler going to a destination.",
36
+ * fields: {
37
+ * travel_date: entityFields.text("The date of the travel"),
38
+ * purpose: entityFields.text("The purpose of the travel"),
39
+ * },
40
+ * sourceTargets: [
41
+ * {
42
+ * source: "User",
43
+ * target: "TravelDestination",
44
+ * }
45
+ * ]
46
+ * }
47
+ *
48
+ * await client.graph.setEntityTypes({
49
+ * TravelDestination: travelDestinationSchema,
50
+ * }, {
51
+ * IS_TRAVELING_TO: isTravelingTo,
52
+ * });
53
+ */
54
+ setEntityTypes(entityTypes, edgeTypes, requestOptions) {
17
55
  return __awaiter(this, void 0, void 0, function* () {
18
56
  const validatedEntityTypes = Object.keys(entityTypes).map((key) => {
19
57
  const schema = entityTypes[key];
20
- const entityType = (0, ontology_1.entityModelToAPISchema)(schema, key);
21
- return entityType;
58
+ return (0, ontology_1.entityModelToAPISchema)(schema, key);
59
+ });
60
+ const validatedEdgeTypes = Object.keys(edgeTypes).map((key) => {
61
+ const schema = edgeTypes[key];
62
+ return (0, ontology_1.edgeModelToAPISchema)(schema, key);
22
63
  });
23
64
  return this.setEntityTypesInternal({
24
65
  entityTypes: validatedEntityTypes,
66
+ edgeTypes: validatedEdgeTypes,
25
67
  }, requestOptions);
26
68
  });
27
69
  }