-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
36 lines (31 loc) · 1 KB
/
types.ts
File metadata and controls
36 lines (31 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { z } from 'zod';
import type { Pool } from 'pg';
export interface ServerContext extends Record<string, unknown> {
pgPool: Pool;
schema: string;
}
export const zSource = z
.string()
.min(0)
.nullable()
.describe(
'The source or origin of this memory. A deep URI to the origin of the fact is preferred (e.g., a specific URL, file path, or reference).',
);
export const zMemory = z.object({
id: z.string().describe('The unique identifier of this memory.'),
content: z.string().describe('The content of this memory.'),
source: zSource,
created_at: z
.date()
.describe('The date and time when this memory was created.'),
updated_at: z
.date()
.describe('The date and time when this memory was last updated.'),
});
export type Memory = z.infer<typeof zMemory>;
export const zKey = z
.string()
.min(1)
.describe(
'A unique identifier for the target set of memories. Can be any combination of user and application ids, as needed for scoping and personalization.',
);