mem0ai 1.0.8 → 1.0.9

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +11 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mem0ai",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "The Memory layer for your AI apps",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -74,7 +74,6 @@ class MemoryClient {
74
74
  this.deleteAll = apiErrorHandler(this.deleteAll.bind(this));
75
75
  this.history = apiErrorHandler(this.history.bind(this));
76
76
  this.deleteUsers = apiErrorHandler(this.deleteUsers.bind(this));
77
- this.deleteUserMemories = apiErrorHandler(this.deleteUserMemories.bind(this));
78
77
  }
79
78
 
80
79
  async _validateApiKey() {
@@ -110,9 +109,17 @@ class MemoryClient {
110
109
  * @returns {Promise<{results: Memory[]}>}
111
110
  */
112
111
  async getAll(options = {}) {
113
- const params = this._prepareParams(options);
114
- const response = await this.client.get('/v1/memories/', { params });
115
- return response.data;
112
+ const { api_version, ...otherOptions } = options;
113
+ const endpoint = api_version === 'v2' ? '/v2/memories/' : '/v1/memories/';
114
+
115
+ if (api_version === 'v2') {
116
+ const response = await this.client.post(endpoint, otherOptions);
117
+ return response.data;
118
+ } else {
119
+ const params = this._prepareParams(otherOptions);
120
+ const response = await this.client.get(endpoint, { params });
121
+ return response.data;
122
+ }
116
123
  }
117
124
 
118
125
  /**