mem0ai 2.4.5 → 3.0.0-beta.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/dist/index.d.mts +92 -119
- package/dist/index.d.ts +92 -119
- package/dist/index.js +93 -169
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +93 -169
- package/dist/index.mjs.map +1 -1
- package/dist/oss/index.d.mts +31 -36
- package/dist/oss/index.d.ts +31 -36
- package/dist/oss/index.js +114 -74
- package/dist/oss/index.js.map +1 -1
- package/dist/oss/index.mjs +114 -74
- package/dist/oss/index.mjs.map +1 -1
- package/package.json +6 -1
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[];
|
|
23
|
+
}
|
|
24
|
+
interface GetAllMemoryOptions {
|
|
25
|
+
filters?: Record<string, any>;
|
|
26
|
+
page?: number;
|
|
27
|
+
pageSize?: number;
|
|
28
|
+
startDate?: string;
|
|
29
|
+
endDate?: string;
|
|
30
|
+
categories?: string[];
|
|
31
|
+
}
|
|
32
|
+
interface DeleteAllMemoryOptions extends EntityOptions {
|
|
37
33
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
V1_1 = "v1.1"
|
|
34
|
+
interface ProjectOptions {
|
|
35
|
+
fields?: string[];
|
|
41
36
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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,25 +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
|
-
[key: string]: any;
|
|
153
|
-
}
|
|
154
131
|
declare enum WebhookEvent {
|
|
155
132
|
MEMORY_ADDED = "memory_add",
|
|
156
133
|
MEMORY_UPDATED = "memory_update",
|
|
@@ -158,14 +135,14 @@ declare enum WebhookEvent {
|
|
|
158
135
|
MEMORY_CATEGORIZED = "memory_categorize"
|
|
159
136
|
}
|
|
160
137
|
interface Webhook {
|
|
161
|
-
|
|
138
|
+
webhookId?: string;
|
|
162
139
|
name: string;
|
|
163
140
|
url: string;
|
|
164
141
|
project?: string;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
142
|
+
createdAt?: Date;
|
|
143
|
+
updatedAt?: Date;
|
|
144
|
+
isActive?: boolean;
|
|
145
|
+
eventTypes?: WebhookEvent[];
|
|
169
146
|
}
|
|
170
147
|
interface WebhookCreatePayload {
|
|
171
148
|
name: string;
|
|
@@ -179,64 +156,60 @@ interface WebhookUpdatePayload {
|
|
|
179
156
|
eventTypes?: WebhookEvent[];
|
|
180
157
|
}
|
|
181
158
|
interface FeedbackPayload {
|
|
182
|
-
|
|
159
|
+
memoryId: string;
|
|
183
160
|
feedback?: Feedback | null;
|
|
184
|
-
|
|
161
|
+
feedbackReason?: string | null;
|
|
185
162
|
}
|
|
186
|
-
interface CreateMemoryExportPayload
|
|
163
|
+
interface CreateMemoryExportPayload {
|
|
187
164
|
schema: Record<string, any>;
|
|
188
165
|
filters: Record<string, any>;
|
|
189
|
-
|
|
166
|
+
exportInstructions?: string;
|
|
190
167
|
}
|
|
191
|
-
interface GetMemoryExportPayload
|
|
168
|
+
interface GetMemoryExportPayload {
|
|
192
169
|
filters?: Record<string, any>;
|
|
193
|
-
|
|
170
|
+
memoryExportId?: string;
|
|
194
171
|
}
|
|
195
172
|
|
|
196
173
|
interface ClientOptions {
|
|
197
174
|
apiKey: string;
|
|
198
175
|
host?: string;
|
|
199
|
-
organizationName?: string;
|
|
200
|
-
projectName?: string;
|
|
201
|
-
organizationId?: string;
|
|
202
|
-
projectId?: string;
|
|
203
176
|
}
|
|
204
177
|
declare class MemoryClient {
|
|
205
178
|
apiKey: string;
|
|
206
179
|
host: string;
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
organizationId: string | number | null;
|
|
210
|
-
projectId: string | number | null;
|
|
180
|
+
private organizationId;
|
|
181
|
+
private projectId;
|
|
211
182
|
headers: Record<string, string>;
|
|
212
183
|
client: any;
|
|
213
184
|
telemetryId: string;
|
|
214
185
|
_validateApiKey(): any;
|
|
215
|
-
_validateOrgProject(): void;
|
|
216
186
|
constructor(options: ClientOptions);
|
|
217
187
|
private _initializeClient;
|
|
218
188
|
private _captureEvent;
|
|
219
189
|
_fetchWithErrorHandling(url: string, options: any): Promise<any>;
|
|
220
|
-
_preparePayload(messages: Array<Message>, options:
|
|
221
|
-
_prepareParams(options:
|
|
190
|
+
_preparePayload(messages: Array<Message>, options: Record<string, any>): object;
|
|
191
|
+
_prepareParams(options: Record<string, any>): object;
|
|
222
192
|
ping(): Promise<void>;
|
|
223
|
-
add(messages: Array<Message>, options?:
|
|
193
|
+
add(messages: Array<Message>, options?: AddMemoryOptions & Record<string, any>): Promise<Array<Memory>>;
|
|
224
194
|
update(memoryId: string, { text, metadata, timestamp, }: {
|
|
225
195
|
text?: string;
|
|
226
196
|
metadata?: Record<string, any>;
|
|
227
197
|
timestamp?: number | string;
|
|
228
198
|
}): Promise<Array<Memory>>;
|
|
229
199
|
get(memoryId: string): Promise<Memory>;
|
|
230
|
-
getAll(options?:
|
|
231
|
-
search(query: string, options?:
|
|
200
|
+
getAll(options?: GetAllMemoryOptions): Promise<Array<Memory>>;
|
|
201
|
+
search(query: string, options?: SearchMemoryOptions): Promise<Array<Memory>>;
|
|
232
202
|
delete(memoryId: string): Promise<{
|
|
233
203
|
message: string;
|
|
234
204
|
}>;
|
|
235
|
-
deleteAll(options?:
|
|
205
|
+
deleteAll(options?: DeleteAllMemoryOptions): Promise<{
|
|
236
206
|
message: string;
|
|
237
207
|
}>;
|
|
238
208
|
history(memoryId: string): Promise<Array<MemoryHistory>>;
|
|
239
|
-
users(
|
|
209
|
+
users(options?: {
|
|
210
|
+
page?: number;
|
|
211
|
+
pageSize?: number;
|
|
212
|
+
}): Promise<AllUsers>;
|
|
240
213
|
/**
|
|
241
214
|
* @deprecated The method should not be used, use `deleteUsers` instead. This will be removed in version 2.2.0.
|
|
242
215
|
*/
|
|
@@ -247,10 +220,10 @@ declare class MemoryClient {
|
|
|
247
220
|
message: string;
|
|
248
221
|
}>;
|
|
249
222
|
deleteUsers(params?: {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
223
|
+
userId?: string;
|
|
224
|
+
agentId?: string;
|
|
225
|
+
appId?: string;
|
|
226
|
+
runId?: string;
|
|
254
227
|
}): Promise<{
|
|
255
228
|
message: string;
|
|
256
229
|
}>;
|
|
@@ -360,4 +333,4 @@ declare class MemoryQuotaExceededError extends MemoryError {
|
|
|
360
333
|
*/
|
|
361
334
|
declare function createExceptionFromResponse(statusCode: number, responseText: string, options?: Omit<MemoryErrorOptions, "suggestion">): MemoryError;
|
|
362
335
|
|
|
363
|
-
export { type AllUsers, AuthenticationError, ConfigurationError, Feedback, type FeedbackPayload, type Memory, MemoryClient, MemoryError, type MemoryErrorOptions, type MemoryHistory, MemoryNotFoundError,
|
|
336
|
+
export { type AddMemoryOptions, type AllUsers, AuthenticationError, ConfigurationError, type CreateMemoryExportPayload, type DeleteAllMemoryOptions, type EntityOptions, 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[];
|
|
23
|
+
}
|
|
24
|
+
interface GetAllMemoryOptions {
|
|
25
|
+
filters?: Record<string, any>;
|
|
26
|
+
page?: number;
|
|
27
|
+
pageSize?: number;
|
|
28
|
+
startDate?: string;
|
|
29
|
+
endDate?: string;
|
|
30
|
+
categories?: string[];
|
|
31
|
+
}
|
|
32
|
+
interface DeleteAllMemoryOptions extends EntityOptions {
|
|
37
33
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
V1_1 = "v1.1"
|
|
34
|
+
interface ProjectOptions {
|
|
35
|
+
fields?: string[];
|
|
41
36
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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,25 +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
|
-
[key: string]: any;
|
|
153
|
-
}
|
|
154
131
|
declare enum WebhookEvent {
|
|
155
132
|
MEMORY_ADDED = "memory_add",
|
|
156
133
|
MEMORY_UPDATED = "memory_update",
|
|
@@ -158,14 +135,14 @@ declare enum WebhookEvent {
|
|
|
158
135
|
MEMORY_CATEGORIZED = "memory_categorize"
|
|
159
136
|
}
|
|
160
137
|
interface Webhook {
|
|
161
|
-
|
|
138
|
+
webhookId?: string;
|
|
162
139
|
name: string;
|
|
163
140
|
url: string;
|
|
164
141
|
project?: string;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
142
|
+
createdAt?: Date;
|
|
143
|
+
updatedAt?: Date;
|
|
144
|
+
isActive?: boolean;
|
|
145
|
+
eventTypes?: WebhookEvent[];
|
|
169
146
|
}
|
|
170
147
|
interface WebhookCreatePayload {
|
|
171
148
|
name: string;
|
|
@@ -179,64 +156,60 @@ interface WebhookUpdatePayload {
|
|
|
179
156
|
eventTypes?: WebhookEvent[];
|
|
180
157
|
}
|
|
181
158
|
interface FeedbackPayload {
|
|
182
|
-
|
|
159
|
+
memoryId: string;
|
|
183
160
|
feedback?: Feedback | null;
|
|
184
|
-
|
|
161
|
+
feedbackReason?: string | null;
|
|
185
162
|
}
|
|
186
|
-
interface CreateMemoryExportPayload
|
|
163
|
+
interface CreateMemoryExportPayload {
|
|
187
164
|
schema: Record<string, any>;
|
|
188
165
|
filters: Record<string, any>;
|
|
189
|
-
|
|
166
|
+
exportInstructions?: string;
|
|
190
167
|
}
|
|
191
|
-
interface GetMemoryExportPayload
|
|
168
|
+
interface GetMemoryExportPayload {
|
|
192
169
|
filters?: Record<string, any>;
|
|
193
|
-
|
|
170
|
+
memoryExportId?: string;
|
|
194
171
|
}
|
|
195
172
|
|
|
196
173
|
interface ClientOptions {
|
|
197
174
|
apiKey: string;
|
|
198
175
|
host?: string;
|
|
199
|
-
organizationName?: string;
|
|
200
|
-
projectName?: string;
|
|
201
|
-
organizationId?: string;
|
|
202
|
-
projectId?: string;
|
|
203
176
|
}
|
|
204
177
|
declare class MemoryClient {
|
|
205
178
|
apiKey: string;
|
|
206
179
|
host: string;
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
organizationId: string | number | null;
|
|
210
|
-
projectId: string | number | null;
|
|
180
|
+
private organizationId;
|
|
181
|
+
private projectId;
|
|
211
182
|
headers: Record<string, string>;
|
|
212
183
|
client: any;
|
|
213
184
|
telemetryId: string;
|
|
214
185
|
_validateApiKey(): any;
|
|
215
|
-
_validateOrgProject(): void;
|
|
216
186
|
constructor(options: ClientOptions);
|
|
217
187
|
private _initializeClient;
|
|
218
188
|
private _captureEvent;
|
|
219
189
|
_fetchWithErrorHandling(url: string, options: any): Promise<any>;
|
|
220
|
-
_preparePayload(messages: Array<Message>, options:
|
|
221
|
-
_prepareParams(options:
|
|
190
|
+
_preparePayload(messages: Array<Message>, options: Record<string, any>): object;
|
|
191
|
+
_prepareParams(options: Record<string, any>): object;
|
|
222
192
|
ping(): Promise<void>;
|
|
223
|
-
add(messages: Array<Message>, options?:
|
|
193
|
+
add(messages: Array<Message>, options?: AddMemoryOptions & Record<string, any>): Promise<Array<Memory>>;
|
|
224
194
|
update(memoryId: string, { text, metadata, timestamp, }: {
|
|
225
195
|
text?: string;
|
|
226
196
|
metadata?: Record<string, any>;
|
|
227
197
|
timestamp?: number | string;
|
|
228
198
|
}): Promise<Array<Memory>>;
|
|
229
199
|
get(memoryId: string): Promise<Memory>;
|
|
230
|
-
getAll(options?:
|
|
231
|
-
search(query: string, options?:
|
|
200
|
+
getAll(options?: GetAllMemoryOptions): Promise<Array<Memory>>;
|
|
201
|
+
search(query: string, options?: SearchMemoryOptions): Promise<Array<Memory>>;
|
|
232
202
|
delete(memoryId: string): Promise<{
|
|
233
203
|
message: string;
|
|
234
204
|
}>;
|
|
235
|
-
deleteAll(options?:
|
|
205
|
+
deleteAll(options?: DeleteAllMemoryOptions): Promise<{
|
|
236
206
|
message: string;
|
|
237
207
|
}>;
|
|
238
208
|
history(memoryId: string): Promise<Array<MemoryHistory>>;
|
|
239
|
-
users(
|
|
209
|
+
users(options?: {
|
|
210
|
+
page?: number;
|
|
211
|
+
pageSize?: number;
|
|
212
|
+
}): Promise<AllUsers>;
|
|
240
213
|
/**
|
|
241
214
|
* @deprecated The method should not be used, use `deleteUsers` instead. This will be removed in version 2.2.0.
|
|
242
215
|
*/
|
|
@@ -247,10 +220,10 @@ declare class MemoryClient {
|
|
|
247
220
|
message: string;
|
|
248
221
|
}>;
|
|
249
222
|
deleteUsers(params?: {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
223
|
+
userId?: string;
|
|
224
|
+
agentId?: string;
|
|
225
|
+
appId?: string;
|
|
226
|
+
runId?: string;
|
|
254
227
|
}): Promise<{
|
|
255
228
|
message: string;
|
|
256
229
|
}>;
|
|
@@ -360,4 +333,4 @@ declare class MemoryQuotaExceededError extends MemoryError {
|
|
|
360
333
|
*/
|
|
361
334
|
declare function createExceptionFromResponse(statusCode: number, responseText: string, options?: Omit<MemoryErrorOptions, "suggestion">): MemoryError;
|
|
362
335
|
|
|
363
|
-
export { type AllUsers, AuthenticationError, ConfigurationError, Feedback, type FeedbackPayload, type Memory, MemoryClient, MemoryError, type MemoryErrorOptions, type MemoryHistory, MemoryNotFoundError,
|
|
336
|
+
export { type AddMemoryOptions, type AllUsers, AuthenticationError, ConfigurationError, type CreateMemoryExportPayload, type DeleteAllMemoryOptions, type EntityOptions, 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 };
|