@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.
- package/api/resources/document/client/Client.js +13 -13
- package/api/resources/graph/client/Client.js +6 -6
- package/api/resources/graph/client/requests/EntityTypeRequest.d.ts +1 -0
- package/api/resources/graph/resources/edge/client/Client.js +4 -4
- package/api/resources/graph/resources/episode/client/Client.d.ts +1 -1
- package/api/resources/graph/resources/episode/client/Client.js +6 -6
- package/api/resources/graph/resources/node/client/Client.js +5 -5
- package/api/resources/group/client/Client.js +6 -6
- package/api/resources/memory/client/Client.js +22 -22
- package/api/resources/user/client/Client.js +8 -8
- package/api/types/EdgeType.d.ts +10 -0
- package/api/types/EdgeType.js +5 -0
- package/api/types/EntityEdge.d.ts +2 -0
- package/api/types/EntityEdgeSourceTarget.d.ts +9 -0
- package/api/types/EntityEdgeSourceTarget.js +5 -0
- package/api/types/EntityTypeResponse.d.ts +1 -0
- package/api/types/Episode.d.ts +4 -0
- package/api/types/EpisodeMentions.d.ts +8 -0
- package/api/types/EpisodeMentions.js +5 -0
- package/api/types/GraphSearchResults.d.ts +1 -0
- package/api/types/GraphSearchScope.d.ts +2 -1
- package/api/types/GraphSearchScope.js +1 -0
- package/api/types/SearchFilters.d.ts +2 -0
- package/api/types/index.d.ts +4 -1
- package/api/types/index.js +4 -1
- package/dist/api/resources/document/client/Client.js +13 -13
- package/dist/api/resources/graph/client/Client.js +6 -6
- package/dist/api/resources/graph/client/requests/EntityTypeRequest.d.ts +1 -0
- package/dist/api/resources/graph/resources/edge/client/Client.js +4 -4
- package/dist/api/resources/graph/resources/episode/client/Client.d.ts +1 -1
- package/dist/api/resources/graph/resources/episode/client/Client.js +6 -6
- package/dist/api/resources/graph/resources/node/client/Client.js +5 -5
- package/dist/api/resources/group/client/Client.js +6 -6
- package/dist/api/resources/memory/client/Client.js +22 -22
- package/dist/api/resources/user/client/Client.js +8 -8
- package/dist/api/types/EdgeType.d.ts +10 -0
- package/dist/api/types/EdgeType.js +5 -0
- package/dist/api/types/EntityEdge.d.ts +2 -0
- package/dist/api/types/EntityEdgeSourceTarget.d.ts +9 -0
- package/dist/api/types/EntityEdgeSourceTarget.js +5 -0
- package/dist/api/types/EntityTypeResponse.d.ts +1 -0
- package/dist/api/types/Episode.d.ts +4 -0
- package/dist/api/types/EpisodeMentions.d.ts +8 -0
- package/dist/api/types/EpisodeMentions.js +5 -0
- package/dist/api/types/GraphSearchResults.d.ts +1 -0
- package/dist/api/types/GraphSearchScope.d.ts +2 -1
- package/dist/api/types/GraphSearchScope.js +1 -0
- package/dist/api/types/SearchFilters.d.ts +2 -0
- package/dist/api/types/index.d.ts +4 -1
- package/dist/api/types/index.js +4 -1
- package/dist/serialization/resources/graph/client/requests/EntityTypeRequest.d.ts +2 -0
- package/dist/serialization/resources/graph/client/requests/EntityTypeRequest.js +2 -0
- package/dist/serialization/types/EdgeType.d.ts +17 -0
- package/dist/serialization/types/EdgeType.js +48 -0
- package/dist/serialization/types/EntityEdge.d.ts +1 -0
- package/dist/serialization/types/EntityEdge.js +1 -0
- package/dist/serialization/types/EntityEdgeSourceTarget.d.ts +13 -0
- package/dist/serialization/types/EntityEdgeSourceTarget.js +44 -0
- package/dist/serialization/types/EntityTypeResponse.d.ts +2 -0
- package/dist/serialization/types/EntityTypeResponse.js +2 -0
- package/dist/serialization/types/Episode.d.ts +3 -0
- package/dist/serialization/types/Episode.js +3 -0
- package/dist/serialization/types/EpisodeMentions.d.ts +15 -0
- package/dist/serialization/types/EpisodeMentions.js +46 -0
- package/dist/serialization/types/GraphSearchResults.d.ts +2 -0
- package/dist/serialization/types/GraphSearchResults.js +2 -0
- package/dist/serialization/types/GraphSearchScope.d.ts +1 -1
- package/dist/serialization/types/GraphSearchScope.js +1 -1
- package/dist/serialization/types/SearchFilters.d.ts +1 -0
- package/dist/serialization/types/SearchFilters.js +1 -0
- package/dist/serialization/types/index.d.ts +4 -1
- package/dist/serialization/types/index.js +4 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/graph.d.ts +40 -2
- package/dist/wrapper/graph.js +45 -3
- package/dist/wrapper/ontology.d.ts +124 -0
- package/dist/wrapper/ontology.js +21 -1
- package/examples/graph/entity_type_example.ts +24 -20
- package/package.json +1 -1
- package/reference.md +1 -1
- package/serialization/resources/graph/client/requests/EntityTypeRequest.d.ts +2 -0
- package/serialization/resources/graph/client/requests/EntityTypeRequest.js +2 -0
- package/serialization/types/EdgeType.d.ts +17 -0
- package/serialization/types/EdgeType.js +48 -0
- package/serialization/types/EntityEdge.d.ts +1 -0
- package/serialization/types/EntityEdge.js +1 -0
- package/serialization/types/EntityEdgeSourceTarget.d.ts +13 -0
- package/serialization/types/EntityEdgeSourceTarget.js +44 -0
- package/serialization/types/EntityTypeResponse.d.ts +2 -0
- package/serialization/types/EntityTypeResponse.js +2 -0
- package/serialization/types/Episode.d.ts +3 -0
- package/serialization/types/Episode.js +3 -0
- package/serialization/types/EpisodeMentions.d.ts +15 -0
- package/serialization/types/EpisodeMentions.js +46 -0
- package/serialization/types/GraphSearchResults.d.ts +2 -0
- package/serialization/types/GraphSearchResults.js +2 -0
- package/serialization/types/GraphSearchScope.d.ts +1 -1
- package/serialization/types/GraphSearchScope.js +1 -1
- package/serialization/types/SearchFilters.d.ts +1 -0
- package/serialization/types/SearchFilters.js +1 -0
- package/serialization/types/index.d.ts +4 -1
- package/serialization/types/index.js +4 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/graph.d.ts +40 -2
- package/wrapper/graph.js +45 -3
- package/wrapper/ontology.d.ts +124 -0
- package/wrapper/ontology.js +21 -1
package/wrapper/ontology.d.ts
CHANGED
|
@@ -297,12 +297,135 @@ export declare const EntityTypeSchema: z.ZodObject<{
|
|
|
297
297
|
}>;
|
|
298
298
|
description?: string | undefined;
|
|
299
299
|
}>;
|
|
300
|
+
export declare const EdgeTypeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
301
|
+
description: z.ZodDefault<z.ZodString>;
|
|
302
|
+
fields: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
|
|
303
|
+
type: z.ZodNativeEnum<typeof EntityPropertyType>;
|
|
304
|
+
description: z.ZodString;
|
|
305
|
+
}, {
|
|
306
|
+
type: z.ZodLiteral<EntityPropertyType.Text>;
|
|
307
|
+
value: z.ZodOptional<z.ZodString>;
|
|
308
|
+
}>, "strip", z.ZodTypeAny, {
|
|
309
|
+
type: EntityPropertyType.Text;
|
|
310
|
+
description: string;
|
|
311
|
+
value?: string | undefined;
|
|
312
|
+
}, {
|
|
313
|
+
type: EntityPropertyType.Text;
|
|
314
|
+
description: string;
|
|
315
|
+
value?: string | undefined;
|
|
316
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
317
|
+
type: z.ZodNativeEnum<typeof EntityPropertyType>;
|
|
318
|
+
description: z.ZodString;
|
|
319
|
+
}, {
|
|
320
|
+
type: z.ZodLiteral<EntityPropertyType.Int>;
|
|
321
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
322
|
+
}>, "strip", z.ZodTypeAny, {
|
|
323
|
+
type: EntityPropertyType.Int;
|
|
324
|
+
description: string;
|
|
325
|
+
value?: number | undefined;
|
|
326
|
+
}, {
|
|
327
|
+
type: EntityPropertyType.Int;
|
|
328
|
+
description: string;
|
|
329
|
+
value?: number | undefined;
|
|
330
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
331
|
+
type: z.ZodNativeEnum<typeof EntityPropertyType>;
|
|
332
|
+
description: z.ZodString;
|
|
333
|
+
}, {
|
|
334
|
+
type: z.ZodLiteral<EntityPropertyType.Float>;
|
|
335
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
336
|
+
}>, "strip", z.ZodTypeAny, {
|
|
337
|
+
type: EntityPropertyType.Float;
|
|
338
|
+
description: string;
|
|
339
|
+
value?: number | undefined;
|
|
340
|
+
}, {
|
|
341
|
+
type: EntityPropertyType.Float;
|
|
342
|
+
description: string;
|
|
343
|
+
value?: number | undefined;
|
|
344
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
345
|
+
type: z.ZodNativeEnum<typeof EntityPropertyType>;
|
|
346
|
+
description: z.ZodString;
|
|
347
|
+
}, {
|
|
348
|
+
type: z.ZodLiteral<EntityPropertyType.Boolean>;
|
|
349
|
+
value: z.ZodOptional<z.ZodBoolean>;
|
|
350
|
+
}>, "strip", z.ZodTypeAny, {
|
|
351
|
+
type: EntityPropertyType.Boolean;
|
|
352
|
+
description: string;
|
|
353
|
+
value?: boolean | undefined;
|
|
354
|
+
}, {
|
|
355
|
+
type: EntityPropertyType.Boolean;
|
|
356
|
+
description: string;
|
|
357
|
+
value?: boolean | undefined;
|
|
358
|
+
}>]>>;
|
|
359
|
+
}, {
|
|
360
|
+
sourceTargets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
361
|
+
source: z.ZodOptional<z.ZodString>;
|
|
362
|
+
target: z.ZodOptional<z.ZodString>;
|
|
363
|
+
}, "strip", z.ZodTypeAny, {
|
|
364
|
+
source?: string | undefined;
|
|
365
|
+
target?: string | undefined;
|
|
366
|
+
}, {
|
|
367
|
+
source?: string | undefined;
|
|
368
|
+
target?: string | undefined;
|
|
369
|
+
}>, "many">>;
|
|
370
|
+
}>, "strip", z.ZodTypeAny, {
|
|
371
|
+
description: string;
|
|
372
|
+
fields: Record<string, {
|
|
373
|
+
type: EntityPropertyType.Text;
|
|
374
|
+
description: string;
|
|
375
|
+
value?: string | undefined;
|
|
376
|
+
} | {
|
|
377
|
+
type: EntityPropertyType.Int;
|
|
378
|
+
description: string;
|
|
379
|
+
value?: number | undefined;
|
|
380
|
+
} | {
|
|
381
|
+
type: EntityPropertyType.Float;
|
|
382
|
+
description: string;
|
|
383
|
+
value?: number | undefined;
|
|
384
|
+
} | {
|
|
385
|
+
type: EntityPropertyType.Boolean;
|
|
386
|
+
description: string;
|
|
387
|
+
value?: boolean | undefined;
|
|
388
|
+
}>;
|
|
389
|
+
sourceTargets?: {
|
|
390
|
+
source?: string | undefined;
|
|
391
|
+
target?: string | undefined;
|
|
392
|
+
}[] | undefined;
|
|
393
|
+
}, {
|
|
394
|
+
fields: Record<string, {
|
|
395
|
+
type: EntityPropertyType.Text;
|
|
396
|
+
description: string;
|
|
397
|
+
value?: string | undefined;
|
|
398
|
+
} | {
|
|
399
|
+
type: EntityPropertyType.Int;
|
|
400
|
+
description: string;
|
|
401
|
+
value?: number | undefined;
|
|
402
|
+
} | {
|
|
403
|
+
type: EntityPropertyType.Float;
|
|
404
|
+
description: string;
|
|
405
|
+
value?: number | undefined;
|
|
406
|
+
} | {
|
|
407
|
+
type: EntityPropertyType.Boolean;
|
|
408
|
+
description: string;
|
|
409
|
+
value?: boolean | undefined;
|
|
410
|
+
}>;
|
|
411
|
+
description?: string | undefined;
|
|
412
|
+
sourceTargets?: {
|
|
413
|
+
source?: string | undefined;
|
|
414
|
+
target?: string | undefined;
|
|
415
|
+
}[] | undefined;
|
|
416
|
+
}>;
|
|
300
417
|
export type EntityType = z.infer<typeof EntityTypeSchema>;
|
|
418
|
+
export type EdgeType = z.infer<typeof EdgeTypeSchema>;
|
|
301
419
|
export type EntityData<T extends EntityType> = {
|
|
302
420
|
[P in keyof T["fields"]]: T["fields"][P] extends {
|
|
303
421
|
value?: infer V;
|
|
304
422
|
} ? V : never;
|
|
305
423
|
};
|
|
424
|
+
export type EdgeData<T extends EdgeType> = {
|
|
425
|
+
[P in keyof T["fields"]]: T["fields"][P] extends {
|
|
426
|
+
value?: infer V;
|
|
427
|
+
} ? V : never;
|
|
428
|
+
};
|
|
306
429
|
export declare const entityFields: {
|
|
307
430
|
text: (description: string) => EntityTextField;
|
|
308
431
|
integer: (description: string) => EntityIntField;
|
|
@@ -310,3 +433,4 @@ export declare const entityFields: {
|
|
|
310
433
|
boolean: (description: string) => EntityBooleanField;
|
|
311
434
|
};
|
|
312
435
|
export declare function entityModelToAPISchema(entityType: EntityType, name: string): Zep.EntityType;
|
|
436
|
+
export declare function edgeModelToAPISchema(entityType: EdgeType, name: string): Zep.EdgeType;
|
package/wrapper/ontology.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.entityFields = exports.EntityTypeSchema = exports.EntityFields = exports.EntityTypeFieldSchema = exports.EntityTypeBooleanFieldSchema = exports.EntityTypeFloatFieldSchema = exports.EntityTypeIntFieldSchema = exports.EntityTypeTextFieldSchema = exports.EntityTypeBaseField = exports.EntityPropertyType = void 0;
|
|
3
|
+
exports.entityFields = exports.EdgeTypeSchema = exports.EntityTypeSchema = exports.EntityFields = exports.EntityTypeFieldSchema = exports.EntityTypeBooleanFieldSchema = exports.EntityTypeFloatFieldSchema = exports.EntityTypeIntFieldSchema = exports.EntityTypeTextFieldSchema = exports.EntityTypeBaseField = exports.EntityPropertyType = void 0;
|
|
4
4
|
exports.entityModelToAPISchema = entityModelToAPISchema;
|
|
5
|
+
exports.edgeModelToAPISchema = edgeModelToAPISchema;
|
|
5
6
|
const zod_1 = require("zod");
|
|
6
7
|
var EntityPropertyType;
|
|
7
8
|
(function (EntityPropertyType) {
|
|
@@ -41,6 +42,13 @@ exports.EntityTypeSchema = zod_1.z.object({
|
|
|
41
42
|
description: zod_1.z.string().default(""),
|
|
42
43
|
fields: zod_1.z.record(exports.EntityTypeFieldSchema),
|
|
43
44
|
});
|
|
45
|
+
const EdgeSourceTarget = zod_1.z.object({
|
|
46
|
+
source: zod_1.z.string().optional(),
|
|
47
|
+
target: zod_1.z.string().optional(),
|
|
48
|
+
});
|
|
49
|
+
exports.EdgeTypeSchema = exports.EntityTypeSchema.extend({
|
|
50
|
+
sourceTargets: zod_1.z.array(EdgeSourceTarget).optional(),
|
|
51
|
+
});
|
|
44
52
|
exports.entityFields = {
|
|
45
53
|
text: (description) => {
|
|
46
54
|
return exports.EntityTypeTextFieldSchema.parse({
|
|
@@ -78,3 +86,15 @@ function entityModelToAPISchema(entityType, name) {
|
|
|
78
86
|
})),
|
|
79
87
|
};
|
|
80
88
|
}
|
|
89
|
+
function edgeModelToAPISchema(entityType, name) {
|
|
90
|
+
return {
|
|
91
|
+
name,
|
|
92
|
+
description: entityType.description,
|
|
93
|
+
sourceTargets: entityType.sourceTargets,
|
|
94
|
+
properties: Object.entries(entityType.fields).map(([fieldName, fieldDef]) => ({
|
|
95
|
+
name: fieldName,
|
|
96
|
+
type: fieldDef.type,
|
|
97
|
+
description: fieldDef.description,
|
|
98
|
+
})),
|
|
99
|
+
};
|
|
100
|
+
}
|