mem0ai 2.4.6 → 3.0.0-beta.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.
- package/dist/index.d.mts +94 -120
- package/dist/index.d.ts +94 -120
- package/dist/index.js +125 -169
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +125 -169
- package/dist/index.mjs.map +1 -1
- package/dist/oss/index.d.mts +96 -127
- package/dist/oss/index.d.ts +96 -127
- package/dist/oss/index.js +2686 -1370
- package/dist/oss/index.js.map +1 -1
- package/dist/oss/index.mjs +2686 -1363
- package/dist/oss/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
interface
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
user_id?: string;
|
|
9
|
-
agent_id?: string;
|
|
10
|
-
app_id?: string;
|
|
11
|
-
run_id?: string;
|
|
1
|
+
interface EntityOptions {
|
|
2
|
+
userId?: string;
|
|
3
|
+
agentId?: string;
|
|
4
|
+
appId?: string;
|
|
5
|
+
runId?: string;
|
|
6
|
+
}
|
|
7
|
+
interface AddMemoryOptions extends EntityOptions {
|
|
12
8
|
metadata?: Record<string, any>;
|
|
13
|
-
filters?: Record<string, any>;
|
|
14
|
-
org_name?: string | null;
|
|
15
|
-
project_name?: string | null;
|
|
16
|
-
org_id?: string | number | null;
|
|
17
|
-
project_id?: string | number | null;
|
|
18
9
|
infer?: boolean;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
includes?: string;
|
|
22
|
-
excludes?: string;
|
|
23
|
-
enable_graph?: boolean;
|
|
24
|
-
start_date?: string;
|
|
25
|
-
end_date?: string;
|
|
26
|
-
custom_categories?: custom_categories[];
|
|
27
|
-
custom_instructions?: string;
|
|
10
|
+
customCategories?: custom_categories[];
|
|
11
|
+
customInstructions?: string;
|
|
28
12
|
timestamp?: number;
|
|
29
|
-
|
|
30
|
-
async_mode?: boolean;
|
|
31
|
-
filter_memories?: boolean;
|
|
32
|
-
immutable?: boolean;
|
|
33
|
-
structured_data_schema?: Record<string, any>;
|
|
13
|
+
structuredDataSchema?: Record<string, any>;
|
|
34
14
|
}
|
|
35
|
-
interface
|
|
15
|
+
interface SearchMemoryOptions {
|
|
16
|
+
filters?: Record<string, any>;
|
|
17
|
+
metadata?: Record<string, any>;
|
|
18
|
+
topK?: number;
|
|
19
|
+
threshold?: number;
|
|
20
|
+
rerank?: boolean;
|
|
36
21
|
fields?: string[];
|
|
22
|
+
categories?: string[];
|
|
37
23
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
interface GetAllMemoryOptions {
|
|
25
|
+
filters?: Record<string, any>;
|
|
26
|
+
page?: number;
|
|
27
|
+
pageSize?: number;
|
|
28
|
+
startDate?: string;
|
|
29
|
+
endDate?: string;
|
|
30
|
+
categories?: string[];
|
|
41
31
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
interface DeleteAllMemoryOptions extends EntityOptions {
|
|
33
|
+
}
|
|
34
|
+
interface ProjectOptions {
|
|
35
|
+
fields?: string[];
|
|
36
|
+
}
|
|
37
|
+
interface PromptUpdatePayload {
|
|
38
|
+
customInstructions?: string;
|
|
39
|
+
customCategories?: custom_categories[];
|
|
40
|
+
retrievalCriteria?: any[];
|
|
41
|
+
version?: string;
|
|
42
|
+
memoryDepth?: string | null;
|
|
43
|
+
usecaseSetting?: string | number;
|
|
44
|
+
multilingual?: boolean;
|
|
45
|
+
[key: string]: any;
|
|
45
46
|
}
|
|
46
47
|
declare enum Feedback {
|
|
47
48
|
POSITIVE = "POSITIVE",
|
|
@@ -60,29 +61,8 @@ interface Messages {
|
|
|
60
61
|
}
|
|
61
62
|
interface Message extends Messages {
|
|
62
63
|
}
|
|
63
|
-
interface
|
|
64
|
-
|
|
65
|
-
memory_id: string;
|
|
66
|
-
input: Array<Messages>;
|
|
67
|
-
old_memory: string | null;
|
|
68
|
-
new_memory: string | null;
|
|
69
|
-
user_id: string;
|
|
70
|
-
categories: Array<string>;
|
|
71
|
-
event: Event | string;
|
|
72
|
-
created_at: Date;
|
|
73
|
-
updated_at: Date;
|
|
74
|
-
}
|
|
75
|
-
interface SearchOptions extends MemoryOptions {
|
|
76
|
-
api_version?: API_VERSION | string;
|
|
77
|
-
limit?: number;
|
|
78
|
-
enable_graph?: boolean;
|
|
79
|
-
threshold?: number;
|
|
80
|
-
top_k?: number;
|
|
81
|
-
only_metadata_based_search?: boolean;
|
|
82
|
-
keyword_search?: boolean;
|
|
83
|
-
fields?: string[];
|
|
84
|
-
categories?: string[];
|
|
85
|
-
rerank?: boolean;
|
|
64
|
+
interface MemoryData {
|
|
65
|
+
memory: string;
|
|
86
66
|
}
|
|
87
67
|
declare enum Event {
|
|
88
68
|
ADD = "ADD",
|
|
@@ -90,27 +70,36 @@ declare enum Event {
|
|
|
90
70
|
DELETE = "DELETE",
|
|
91
71
|
NOOP = "NOOP"
|
|
92
72
|
}
|
|
93
|
-
interface MemoryData {
|
|
94
|
-
memory: string;
|
|
95
|
-
}
|
|
96
73
|
interface Memory {
|
|
97
74
|
id: string;
|
|
98
75
|
messages?: Array<Messages>;
|
|
99
76
|
event?: Event | string;
|
|
100
77
|
data?: MemoryData | null;
|
|
101
78
|
memory?: string;
|
|
102
|
-
|
|
79
|
+
userId?: string;
|
|
103
80
|
hash?: string;
|
|
104
81
|
categories?: Array<string>;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
82
|
+
createdAt?: Date;
|
|
83
|
+
updatedAt?: Date;
|
|
84
|
+
memoryType?: string;
|
|
108
85
|
score?: number;
|
|
109
86
|
metadata?: any | null;
|
|
110
87
|
owner?: string | null;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
88
|
+
agentId?: string | null;
|
|
89
|
+
appId?: string | null;
|
|
90
|
+
runId?: string | null;
|
|
91
|
+
}
|
|
92
|
+
interface MemoryHistory {
|
|
93
|
+
id: string;
|
|
94
|
+
memoryId: string;
|
|
95
|
+
input: Array<Messages>;
|
|
96
|
+
oldMemory: string | null;
|
|
97
|
+
newMemory: string | null;
|
|
98
|
+
userId: string;
|
|
99
|
+
categories: Array<string>;
|
|
100
|
+
event: Event | string;
|
|
101
|
+
createdAt: Date;
|
|
102
|
+
updatedAt: Date;
|
|
114
103
|
}
|
|
115
104
|
interface MemoryUpdateBody {
|
|
116
105
|
memoryId: string;
|
|
@@ -119,9 +108,9 @@ interface MemoryUpdateBody {
|
|
|
119
108
|
interface User {
|
|
120
109
|
id: string;
|
|
121
110
|
name: string;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
111
|
+
createdAt: Date;
|
|
112
|
+
updatedAt: Date;
|
|
113
|
+
totalMemories: number;
|
|
125
114
|
owner: string;
|
|
126
115
|
type: string;
|
|
127
116
|
}
|
|
@@ -132,26 +121,13 @@ interface AllUsers {
|
|
|
132
121
|
previous: any;
|
|
133
122
|
}
|
|
134
123
|
interface ProjectResponse {
|
|
135
|
-
|
|
136
|
-
|
|
124
|
+
customInstructions?: string;
|
|
125
|
+
customCategories?: string[];
|
|
137
126
|
[key: string]: any;
|
|
138
127
|
}
|
|
139
128
|
interface custom_categories {
|
|
140
129
|
[key: string]: any;
|
|
141
130
|
}
|
|
142
|
-
interface PromptUpdatePayload {
|
|
143
|
-
custom_instructions?: string;
|
|
144
|
-
custom_categories?: custom_categories[];
|
|
145
|
-
retrieval_criteria?: any[];
|
|
146
|
-
enable_graph?: boolean;
|
|
147
|
-
version?: string;
|
|
148
|
-
inclusion_prompt?: string;
|
|
149
|
-
exclusion_prompt?: string;
|
|
150
|
-
memory_depth?: string | null;
|
|
151
|
-
usecase_setting?: string | number;
|
|
152
|
-
multilingual?: boolean;
|
|
153
|
-
[key: string]: any;
|
|
154
|
-
}
|
|
155
131
|
declare enum WebhookEvent {
|
|
156
132
|
MEMORY_ADDED = "memory_add",
|
|
157
133
|
MEMORY_UPDATED = "memory_update",
|
|
@@ -159,14 +135,14 @@ declare enum WebhookEvent {
|
|
|
159
135
|
MEMORY_CATEGORIZED = "memory_categorize"
|
|
160
136
|
}
|
|
161
137
|
interface Webhook {
|
|
162
|
-
|
|
138
|
+
webhookId?: string;
|
|
163
139
|
name: string;
|
|
164
140
|
url: string;
|
|
165
141
|
project?: string;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
142
|
+
createdAt?: Date;
|
|
143
|
+
updatedAt?: Date;
|
|
144
|
+
isActive?: boolean;
|
|
145
|
+
eventTypes?: WebhookEvent[];
|
|
170
146
|
}
|
|
171
147
|
interface WebhookCreatePayload {
|
|
172
148
|
name: string;
|
|
@@ -180,64 +156,62 @@ interface WebhookUpdatePayload {
|
|
|
180
156
|
eventTypes?: WebhookEvent[];
|
|
181
157
|
}
|
|
182
158
|
interface FeedbackPayload {
|
|
183
|
-
|
|
159
|
+
memoryId: string;
|
|
184
160
|
feedback?: Feedback | null;
|
|
185
|
-
|
|
161
|
+
feedbackReason?: string | null;
|
|
186
162
|
}
|
|
187
|
-
interface CreateMemoryExportPayload
|
|
163
|
+
interface CreateMemoryExportPayload {
|
|
188
164
|
schema: Record<string, any>;
|
|
189
165
|
filters: Record<string, any>;
|
|
190
|
-
|
|
166
|
+
exportInstructions?: string;
|
|
191
167
|
}
|
|
192
|
-
interface GetMemoryExportPayload
|
|
168
|
+
interface GetMemoryExportPayload {
|
|
193
169
|
filters?: Record<string, any>;
|
|
194
|
-
|
|
170
|
+
memoryExportId?: string;
|
|
195
171
|
}
|
|
196
172
|
|
|
197
173
|
interface ClientOptions {
|
|
198
174
|
apiKey: string;
|
|
199
175
|
host?: string;
|
|
200
|
-
organizationName?: string;
|
|
201
|
-
projectName?: string;
|
|
202
|
-
organizationId?: string;
|
|
203
|
-
projectId?: string;
|
|
204
176
|
}
|
|
205
177
|
declare class MemoryClient {
|
|
206
178
|
apiKey: string;
|
|
207
179
|
host: string;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
organizationId: string | number | null;
|
|
211
|
-
projectId: string | number | null;
|
|
180
|
+
private organizationId;
|
|
181
|
+
private projectId;
|
|
212
182
|
headers: Record<string, string>;
|
|
213
183
|
client: any;
|
|
214
184
|
telemetryId: string;
|
|
215
185
|
_validateApiKey(): any;
|
|
216
|
-
_validateOrgProject(): void;
|
|
217
186
|
constructor(options: ClientOptions);
|
|
218
187
|
private _initializeClient;
|
|
219
188
|
private _captureEvent;
|
|
220
189
|
_fetchWithErrorHandling(url: string, options: any): Promise<any>;
|
|
221
|
-
_preparePayload(messages: Array<Message>, options:
|
|
222
|
-
_prepareParams(options:
|
|
190
|
+
_preparePayload(messages: Array<Message>, options: Record<string, any>): object;
|
|
191
|
+
_prepareParams(options: Record<string, any>): object;
|
|
223
192
|
ping(): Promise<void>;
|
|
224
|
-
add(messages: Array<Message>, options?:
|
|
193
|
+
add(messages: Array<Message>, options?: AddMemoryOptions & Record<string, any>): Promise<Array<Memory>>;
|
|
225
194
|
update(memoryId: string, { text, metadata, timestamp, }: {
|
|
226
195
|
text?: string;
|
|
227
196
|
metadata?: Record<string, any>;
|
|
228
197
|
timestamp?: number | string;
|
|
229
198
|
}): Promise<Array<Memory>>;
|
|
230
199
|
get(memoryId: string): Promise<Memory>;
|
|
231
|
-
getAll(options?:
|
|
232
|
-
search(query: string, options?:
|
|
200
|
+
getAll(options?: GetAllMemoryOptions): Promise<Array<Memory>>;
|
|
201
|
+
search(query: string, options?: SearchMemoryOptions): Promise<{
|
|
202
|
+
results: Array<Memory>;
|
|
203
|
+
}>;
|
|
233
204
|
delete(memoryId: string): Promise<{
|
|
234
205
|
message: string;
|
|
235
206
|
}>;
|
|
236
|
-
deleteAll(options?:
|
|
207
|
+
deleteAll(options?: DeleteAllMemoryOptions): Promise<{
|
|
237
208
|
message: string;
|
|
238
209
|
}>;
|
|
239
210
|
history(memoryId: string): Promise<Array<MemoryHistory>>;
|
|
240
|
-
users(
|
|
211
|
+
users(options?: {
|
|
212
|
+
page?: number;
|
|
213
|
+
pageSize?: number;
|
|
214
|
+
}): Promise<AllUsers>;
|
|
241
215
|
/**
|
|
242
216
|
* @deprecated The method should not be used, use `deleteUsers` instead. This will be removed in version 2.2.0.
|
|
243
217
|
*/
|
|
@@ -248,10 +222,10 @@ declare class MemoryClient {
|
|
|
248
222
|
message: string;
|
|
249
223
|
}>;
|
|
250
224
|
deleteUsers(params?: {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
225
|
+
userId?: string;
|
|
226
|
+
agentId?: string;
|
|
227
|
+
appId?: string;
|
|
228
|
+
runId?: string;
|
|
255
229
|
}): Promise<{
|
|
256
230
|
message: string;
|
|
257
231
|
}>;
|
|
@@ -361,4 +335,4 @@ declare class MemoryQuotaExceededError extends MemoryError {
|
|
|
361
335
|
*/
|
|
362
336
|
declare function createExceptionFromResponse(statusCode: number, responseText: string, options?: Omit<MemoryErrorOptions, "suggestion">): MemoryError;
|
|
363
337
|
|
|
364
|
-
export { type AllUsers, AuthenticationError, ConfigurationError, Feedback, type FeedbackPayload, type Memory, MemoryClient, MemoryError, type MemoryErrorOptions, type MemoryHistory, MemoryNotFoundError,
|
|
338
|
+
export { type AddMemoryOptions, type AllUsers, AuthenticationError, ConfigurationError, type CreateMemoryExportPayload, type DeleteAllMemoryOptions, Feedback, type FeedbackPayload, type GetAllMemoryOptions, type GetMemoryExportPayload, type Memory, MemoryClient, MemoryError, type MemoryErrorOptions, type MemoryHistory, MemoryNotFoundError, MemoryQuotaExceededError, type MemoryUpdateBody, type Message, type Messages, NetworkError, type ProjectOptions, type ProjectResponse, type PromptUpdatePayload, RateLimitError, type SearchMemoryOptions, type User, ValidationError, type Webhook, type WebhookCreatePayload, WebhookEvent, type WebhookUpdatePayload, createExceptionFromResponse, MemoryClient as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
interface
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
user_id?: string;
|
|
9
|
-
agent_id?: string;
|
|
10
|
-
app_id?: string;
|
|
11
|
-
run_id?: string;
|
|
1
|
+
interface EntityOptions {
|
|
2
|
+
userId?: string;
|
|
3
|
+
agentId?: string;
|
|
4
|
+
appId?: string;
|
|
5
|
+
runId?: string;
|
|
6
|
+
}
|
|
7
|
+
interface AddMemoryOptions extends EntityOptions {
|
|
12
8
|
metadata?: Record<string, any>;
|
|
13
|
-
filters?: Record<string, any>;
|
|
14
|
-
org_name?: string | null;
|
|
15
|
-
project_name?: string | null;
|
|
16
|
-
org_id?: string | number | null;
|
|
17
|
-
project_id?: string | number | null;
|
|
18
9
|
infer?: boolean;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
includes?: string;
|
|
22
|
-
excludes?: string;
|
|
23
|
-
enable_graph?: boolean;
|
|
24
|
-
start_date?: string;
|
|
25
|
-
end_date?: string;
|
|
26
|
-
custom_categories?: custom_categories[];
|
|
27
|
-
custom_instructions?: string;
|
|
10
|
+
customCategories?: custom_categories[];
|
|
11
|
+
customInstructions?: string;
|
|
28
12
|
timestamp?: number;
|
|
29
|
-
|
|
30
|
-
async_mode?: boolean;
|
|
31
|
-
filter_memories?: boolean;
|
|
32
|
-
immutable?: boolean;
|
|
33
|
-
structured_data_schema?: Record<string, any>;
|
|
13
|
+
structuredDataSchema?: Record<string, any>;
|
|
34
14
|
}
|
|
35
|
-
interface
|
|
15
|
+
interface SearchMemoryOptions {
|
|
16
|
+
filters?: Record<string, any>;
|
|
17
|
+
metadata?: Record<string, any>;
|
|
18
|
+
topK?: number;
|
|
19
|
+
threshold?: number;
|
|
20
|
+
rerank?: boolean;
|
|
36
21
|
fields?: string[];
|
|
22
|
+
categories?: string[];
|
|
37
23
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
interface GetAllMemoryOptions {
|
|
25
|
+
filters?: Record<string, any>;
|
|
26
|
+
page?: number;
|
|
27
|
+
pageSize?: number;
|
|
28
|
+
startDate?: string;
|
|
29
|
+
endDate?: string;
|
|
30
|
+
categories?: string[];
|
|
41
31
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
interface DeleteAllMemoryOptions extends EntityOptions {
|
|
33
|
+
}
|
|
34
|
+
interface ProjectOptions {
|
|
35
|
+
fields?: string[];
|
|
36
|
+
}
|
|
37
|
+
interface PromptUpdatePayload {
|
|
38
|
+
customInstructions?: string;
|
|
39
|
+
customCategories?: custom_categories[];
|
|
40
|
+
retrievalCriteria?: any[];
|
|
41
|
+
version?: string;
|
|
42
|
+
memoryDepth?: string | null;
|
|
43
|
+
usecaseSetting?: string | number;
|
|
44
|
+
multilingual?: boolean;
|
|
45
|
+
[key: string]: any;
|
|
45
46
|
}
|
|
46
47
|
declare enum Feedback {
|
|
47
48
|
POSITIVE = "POSITIVE",
|
|
@@ -60,29 +61,8 @@ interface Messages {
|
|
|
60
61
|
}
|
|
61
62
|
interface Message extends Messages {
|
|
62
63
|
}
|
|
63
|
-
interface
|
|
64
|
-
|
|
65
|
-
memory_id: string;
|
|
66
|
-
input: Array<Messages>;
|
|
67
|
-
old_memory: string | null;
|
|
68
|
-
new_memory: string | null;
|
|
69
|
-
user_id: string;
|
|
70
|
-
categories: Array<string>;
|
|
71
|
-
event: Event | string;
|
|
72
|
-
created_at: Date;
|
|
73
|
-
updated_at: Date;
|
|
74
|
-
}
|
|
75
|
-
interface SearchOptions extends MemoryOptions {
|
|
76
|
-
api_version?: API_VERSION | string;
|
|
77
|
-
limit?: number;
|
|
78
|
-
enable_graph?: boolean;
|
|
79
|
-
threshold?: number;
|
|
80
|
-
top_k?: number;
|
|
81
|
-
only_metadata_based_search?: boolean;
|
|
82
|
-
keyword_search?: boolean;
|
|
83
|
-
fields?: string[];
|
|
84
|
-
categories?: string[];
|
|
85
|
-
rerank?: boolean;
|
|
64
|
+
interface MemoryData {
|
|
65
|
+
memory: string;
|
|
86
66
|
}
|
|
87
67
|
declare enum Event {
|
|
88
68
|
ADD = "ADD",
|
|
@@ -90,27 +70,36 @@ declare enum Event {
|
|
|
90
70
|
DELETE = "DELETE",
|
|
91
71
|
NOOP = "NOOP"
|
|
92
72
|
}
|
|
93
|
-
interface MemoryData {
|
|
94
|
-
memory: string;
|
|
95
|
-
}
|
|
96
73
|
interface Memory {
|
|
97
74
|
id: string;
|
|
98
75
|
messages?: Array<Messages>;
|
|
99
76
|
event?: Event | string;
|
|
100
77
|
data?: MemoryData | null;
|
|
101
78
|
memory?: string;
|
|
102
|
-
|
|
79
|
+
userId?: string;
|
|
103
80
|
hash?: string;
|
|
104
81
|
categories?: Array<string>;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
82
|
+
createdAt?: Date;
|
|
83
|
+
updatedAt?: Date;
|
|
84
|
+
memoryType?: string;
|
|
108
85
|
score?: number;
|
|
109
86
|
metadata?: any | null;
|
|
110
87
|
owner?: string | null;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
88
|
+
agentId?: string | null;
|
|
89
|
+
appId?: string | null;
|
|
90
|
+
runId?: string | null;
|
|
91
|
+
}
|
|
92
|
+
interface MemoryHistory {
|
|
93
|
+
id: string;
|
|
94
|
+
memoryId: string;
|
|
95
|
+
input: Array<Messages>;
|
|
96
|
+
oldMemory: string | null;
|
|
97
|
+
newMemory: string | null;
|
|
98
|
+
userId: string;
|
|
99
|
+
categories: Array<string>;
|
|
100
|
+
event: Event | string;
|
|
101
|
+
createdAt: Date;
|
|
102
|
+
updatedAt: Date;
|
|
114
103
|
}
|
|
115
104
|
interface MemoryUpdateBody {
|
|
116
105
|
memoryId: string;
|
|
@@ -119,9 +108,9 @@ interface MemoryUpdateBody {
|
|
|
119
108
|
interface User {
|
|
120
109
|
id: string;
|
|
121
110
|
name: string;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
111
|
+
createdAt: Date;
|
|
112
|
+
updatedAt: Date;
|
|
113
|
+
totalMemories: number;
|
|
125
114
|
owner: string;
|
|
126
115
|
type: string;
|
|
127
116
|
}
|
|
@@ -132,26 +121,13 @@ interface AllUsers {
|
|
|
132
121
|
previous: any;
|
|
133
122
|
}
|
|
134
123
|
interface ProjectResponse {
|
|
135
|
-
|
|
136
|
-
|
|
124
|
+
customInstructions?: string;
|
|
125
|
+
customCategories?: string[];
|
|
137
126
|
[key: string]: any;
|
|
138
127
|
}
|
|
139
128
|
interface custom_categories {
|
|
140
129
|
[key: string]: any;
|
|
141
130
|
}
|
|
142
|
-
interface PromptUpdatePayload {
|
|
143
|
-
custom_instructions?: string;
|
|
144
|
-
custom_categories?: custom_categories[];
|
|
145
|
-
retrieval_criteria?: any[];
|
|
146
|
-
enable_graph?: boolean;
|
|
147
|
-
version?: string;
|
|
148
|
-
inclusion_prompt?: string;
|
|
149
|
-
exclusion_prompt?: string;
|
|
150
|
-
memory_depth?: string | null;
|
|
151
|
-
usecase_setting?: string | number;
|
|
152
|
-
multilingual?: boolean;
|
|
153
|
-
[key: string]: any;
|
|
154
|
-
}
|
|
155
131
|
declare enum WebhookEvent {
|
|
156
132
|
MEMORY_ADDED = "memory_add",
|
|
157
133
|
MEMORY_UPDATED = "memory_update",
|
|
@@ -159,14 +135,14 @@ declare enum WebhookEvent {
|
|
|
159
135
|
MEMORY_CATEGORIZED = "memory_categorize"
|
|
160
136
|
}
|
|
161
137
|
interface Webhook {
|
|
162
|
-
|
|
138
|
+
webhookId?: string;
|
|
163
139
|
name: string;
|
|
164
140
|
url: string;
|
|
165
141
|
project?: string;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
142
|
+
createdAt?: Date;
|
|
143
|
+
updatedAt?: Date;
|
|
144
|
+
isActive?: boolean;
|
|
145
|
+
eventTypes?: WebhookEvent[];
|
|
170
146
|
}
|
|
171
147
|
interface WebhookCreatePayload {
|
|
172
148
|
name: string;
|
|
@@ -180,64 +156,62 @@ interface WebhookUpdatePayload {
|
|
|
180
156
|
eventTypes?: WebhookEvent[];
|
|
181
157
|
}
|
|
182
158
|
interface FeedbackPayload {
|
|
183
|
-
|
|
159
|
+
memoryId: string;
|
|
184
160
|
feedback?: Feedback | null;
|
|
185
|
-
|
|
161
|
+
feedbackReason?: string | null;
|
|
186
162
|
}
|
|
187
|
-
interface CreateMemoryExportPayload
|
|
163
|
+
interface CreateMemoryExportPayload {
|
|
188
164
|
schema: Record<string, any>;
|
|
189
165
|
filters: Record<string, any>;
|
|
190
|
-
|
|
166
|
+
exportInstructions?: string;
|
|
191
167
|
}
|
|
192
|
-
interface GetMemoryExportPayload
|
|
168
|
+
interface GetMemoryExportPayload {
|
|
193
169
|
filters?: Record<string, any>;
|
|
194
|
-
|
|
170
|
+
memoryExportId?: string;
|
|
195
171
|
}
|
|
196
172
|
|
|
197
173
|
interface ClientOptions {
|
|
198
174
|
apiKey: string;
|
|
199
175
|
host?: string;
|
|
200
|
-
organizationName?: string;
|
|
201
|
-
projectName?: string;
|
|
202
|
-
organizationId?: string;
|
|
203
|
-
projectId?: string;
|
|
204
176
|
}
|
|
205
177
|
declare class MemoryClient {
|
|
206
178
|
apiKey: string;
|
|
207
179
|
host: string;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
organizationId: string | number | null;
|
|
211
|
-
projectId: string | number | null;
|
|
180
|
+
private organizationId;
|
|
181
|
+
private projectId;
|
|
212
182
|
headers: Record<string, string>;
|
|
213
183
|
client: any;
|
|
214
184
|
telemetryId: string;
|
|
215
185
|
_validateApiKey(): any;
|
|
216
|
-
_validateOrgProject(): void;
|
|
217
186
|
constructor(options: ClientOptions);
|
|
218
187
|
private _initializeClient;
|
|
219
188
|
private _captureEvent;
|
|
220
189
|
_fetchWithErrorHandling(url: string, options: any): Promise<any>;
|
|
221
|
-
_preparePayload(messages: Array<Message>, options:
|
|
222
|
-
_prepareParams(options:
|
|
190
|
+
_preparePayload(messages: Array<Message>, options: Record<string, any>): object;
|
|
191
|
+
_prepareParams(options: Record<string, any>): object;
|
|
223
192
|
ping(): Promise<void>;
|
|
224
|
-
add(messages: Array<Message>, options?:
|
|
193
|
+
add(messages: Array<Message>, options?: AddMemoryOptions & Record<string, any>): Promise<Array<Memory>>;
|
|
225
194
|
update(memoryId: string, { text, metadata, timestamp, }: {
|
|
226
195
|
text?: string;
|
|
227
196
|
metadata?: Record<string, any>;
|
|
228
197
|
timestamp?: number | string;
|
|
229
198
|
}): Promise<Array<Memory>>;
|
|
230
199
|
get(memoryId: string): Promise<Memory>;
|
|
231
|
-
getAll(options?:
|
|
232
|
-
search(query: string, options?:
|
|
200
|
+
getAll(options?: GetAllMemoryOptions): Promise<Array<Memory>>;
|
|
201
|
+
search(query: string, options?: SearchMemoryOptions): Promise<{
|
|
202
|
+
results: Array<Memory>;
|
|
203
|
+
}>;
|
|
233
204
|
delete(memoryId: string): Promise<{
|
|
234
205
|
message: string;
|
|
235
206
|
}>;
|
|
236
|
-
deleteAll(options?:
|
|
207
|
+
deleteAll(options?: DeleteAllMemoryOptions): Promise<{
|
|
237
208
|
message: string;
|
|
238
209
|
}>;
|
|
239
210
|
history(memoryId: string): Promise<Array<MemoryHistory>>;
|
|
240
|
-
users(
|
|
211
|
+
users(options?: {
|
|
212
|
+
page?: number;
|
|
213
|
+
pageSize?: number;
|
|
214
|
+
}): Promise<AllUsers>;
|
|
241
215
|
/**
|
|
242
216
|
* @deprecated The method should not be used, use `deleteUsers` instead. This will be removed in version 2.2.0.
|
|
243
217
|
*/
|
|
@@ -248,10 +222,10 @@ declare class MemoryClient {
|
|
|
248
222
|
message: string;
|
|
249
223
|
}>;
|
|
250
224
|
deleteUsers(params?: {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
225
|
+
userId?: string;
|
|
226
|
+
agentId?: string;
|
|
227
|
+
appId?: string;
|
|
228
|
+
runId?: string;
|
|
255
229
|
}): Promise<{
|
|
256
230
|
message: string;
|
|
257
231
|
}>;
|
|
@@ -361,4 +335,4 @@ declare class MemoryQuotaExceededError extends MemoryError {
|
|
|
361
335
|
*/
|
|
362
336
|
declare function createExceptionFromResponse(statusCode: number, responseText: string, options?: Omit<MemoryErrorOptions, "suggestion">): MemoryError;
|
|
363
337
|
|
|
364
|
-
export { type AllUsers, AuthenticationError, ConfigurationError, Feedback, type FeedbackPayload, type Memory, MemoryClient, MemoryError, type MemoryErrorOptions, type MemoryHistory, MemoryNotFoundError,
|
|
338
|
+
export { type AddMemoryOptions, type AllUsers, AuthenticationError, ConfigurationError, type CreateMemoryExportPayload, type DeleteAllMemoryOptions, Feedback, type FeedbackPayload, type GetAllMemoryOptions, type GetMemoryExportPayload, type Memory, MemoryClient, MemoryError, type MemoryErrorOptions, type MemoryHistory, MemoryNotFoundError, MemoryQuotaExceededError, type MemoryUpdateBody, type Message, type Messages, NetworkError, type ProjectOptions, type ProjectResponse, type PromptUpdatePayload, RateLimitError, type SearchMemoryOptions, type User, ValidationError, type Webhook, type WebhookCreatePayload, WebhookEvent, type WebhookUpdatePayload, createExceptionFromResponse, MemoryClient as default };
|