mem0ai 1.0.14 → 1.0.15
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/package.json +1 -1
- package/src/index.js +7 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -17,7 +17,7 @@ class MemoryClient {
|
|
|
17
17
|
* @param {string} [organizationName]
|
|
18
18
|
* @param {string} [projectName]
|
|
19
19
|
*/
|
|
20
|
-
constructor(apiKey, host = 'https://api.mem0.ai', organizationName = null, projectName =
|
|
20
|
+
constructor(apiKey, host = 'https://api.mem0.ai', organizationName = null, projectName = "default-project") {
|
|
21
21
|
this.apiKey = apiKey;
|
|
22
22
|
this.host = host;
|
|
23
23
|
this.organizationName = organizationName;
|
|
@@ -49,7 +49,8 @@ class MemoryClient {
|
|
|
49
49
|
const errorData = await response.text();
|
|
50
50
|
throw new APIError(`API request failed: ${errorData}`);
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
const jsonResponse = await response.json();
|
|
53
|
+
return jsonResponse;
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
async add(messages, options = {}) {
|
|
@@ -123,9 +124,10 @@ class MemoryClient {
|
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
async history(memoryId) {
|
|
126
|
-
|
|
127
|
+
const response = await this._fetchWithErrorHandling(`${this.host}/v1/memories/${memoryId}/history/`, {
|
|
127
128
|
headers: this.headers
|
|
128
129
|
});
|
|
130
|
+
return response;
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
async users() {
|
|
@@ -133,9 +135,10 @@ class MemoryClient {
|
|
|
133
135
|
organization_name: this.organizationName,
|
|
134
136
|
project_name: this.projectName
|
|
135
137
|
});
|
|
136
|
-
|
|
138
|
+
const response = await this._fetchWithErrorHandling(`${this.host}/v1/entities/?${params}`, {
|
|
137
139
|
headers: this.headers
|
|
138
140
|
});
|
|
141
|
+
return response;
|
|
139
142
|
}
|
|
140
143
|
|
|
141
144
|
async deleteUsers() {
|