@pairsystems/goodmem-client 1.0.0-beta.1 → 1.0.0-dev.cb052d6

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 (61) hide show
  1. package/README.md +100 -82
  2. package/dist/ApiClient.js +33 -52
  3. package/dist/api/APIKeysApi.js +72 -51
  4. package/dist/api/EmbeddersApi.js +93 -63
  5. package/dist/api/MemoriesApi.js +263 -80
  6. package/dist/api/RerankersApi.js +262 -0
  7. package/dist/api/SpacesApi.js +100 -66
  8. package/dist/api/SystemApi.js +24 -18
  9. package/dist/api/UsersApi.js +100 -26
  10. package/dist/client.js +26 -1
  11. package/dist/index.js +181 -0
  12. package/dist/model/AbstractReply.js +138 -0
  13. package/dist/model/ApiKeyResponse.js +5 -5
  14. package/dist/model/BatchMemoryCreationRequest.js +5 -5
  15. package/dist/model/BatchMemoryDeletionRequest.js +5 -5
  16. package/dist/model/BatchMemoryRetrievalRequest.js +5 -5
  17. package/dist/model/BinaryContent.js +129 -0
  18. package/dist/model/ChunkReference.js +152 -0
  19. package/dist/model/ChunkingConfiguration.js +115 -0
  20. package/dist/model/ContextItem.js +136 -0
  21. package/dist/model/CreateApiKeyRequest.js +5 -5
  22. package/dist/model/CreateApiKeyResponse.js +5 -5
  23. package/dist/model/DistributionType.js +58 -0
  24. package/dist/model/EmbedderCreationRequest.js +20 -9
  25. package/dist/model/EmbedderResponse.js +20 -9
  26. package/dist/model/EmbedderWeight.js +125 -0
  27. package/dist/model/GoodMemStatus.js +129 -0
  28. package/dist/model/LengthMeasurement.js +63 -0
  29. package/dist/model/ListApiKeysResponse.js +5 -5
  30. package/dist/model/ListEmbeddersResponse.js +5 -5
  31. package/dist/model/ListRerankersResponse.js +132 -0
  32. package/dist/model/ListSpacesResponse.js +5 -5
  33. package/dist/model/Memory.js +23 -15
  34. package/dist/model/MemoryChunkResponse.js +240 -0
  35. package/dist/model/MemoryCreationRequest.js +21 -9
  36. package/dist/model/MemoryListResponse.js +5 -5
  37. package/dist/model/Modality.js +4 -4
  38. package/dist/model/PostProcessor.js +125 -0
  39. package/dist/model/ProviderType.js +9 -4
  40. package/dist/model/RecursiveChunkingConfiguration.js +165 -0
  41. package/dist/model/RerankerCreationRequest.js +266 -0
  42. package/dist/model/RerankerResponse.js +316 -0
  43. package/dist/model/ResultSetBoundary.js +153 -0
  44. package/dist/model/RetrieveMemoryEvent.js +148 -0
  45. package/dist/model/RetrieveMemoryRequest.js +219 -0
  46. package/dist/model/RetrievedItem.js +106 -0
  47. package/dist/model/SentenceChunkingConfiguration.js +141 -0
  48. package/dist/model/SeparatorKeepStrategy.js +63 -0
  49. package/dist/model/Space.js +19 -5
  50. package/dist/model/SpaceCreationRequest.js +19 -5
  51. package/dist/model/SpaceEmbedder.js +5 -5
  52. package/dist/model/SpaceEmbedderConfig.js +5 -5
  53. package/dist/model/SpaceKey.js +145 -0
  54. package/dist/model/SystemInitResponse.js +5 -5
  55. package/dist/model/UpdateApiKeyRequest.js +5 -5
  56. package/dist/model/UpdateEmbedderRequest.js +5 -5
  57. package/dist/model/UpdateRerankerRequest.js +226 -0
  58. package/dist/model/UpdateSpaceRequest.js +22 -44
  59. package/dist/model/UserResponse.js +5 -5
  60. package/dist/streaming.js +649 -0
  61. package/package.json +4 -36
@@ -16,11 +16,11 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
16
16
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
18
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19
- * GoodMem API
20
- * API for interacting with the GoodMem service, providing vector-based memory storage and retrieval with multiple embedder support. The service enables creation of memory spaces, storing memories with vector representations, and efficient similarity-based retrieval.
19
+ *
20
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
21
21
  *
22
- * The version of the OpenAPI document: v1
23
- * Contact: support@goodmem.io
22
+ * The version of the OpenAPI document:
23
+ *
24
24
  *
25
25
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
26
  * https://openapi-generator.tech
@@ -30,7 +30,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
30
30
  /**
31
31
  * Embedders service.
32
32
  * @module api/EmbeddersApi
33
- * @version v1
33
+ * @version 1.0.0
34
34
  */
35
35
  var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
36
36
  /**
@@ -45,24 +45,15 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
45
45
  this.apiClient = apiClient || _ApiClient["default"].instance;
46
46
  }
47
47
 
48
- /**
49
- * Callback function to receive the result of the createEmbedder operation.
50
- * @callback module:api/EmbeddersApi~createEmbedderCallback
51
- * @param {String} error Error message, if any.
52
- * @param {module:model/EmbedderResponse} data The data returned by the service call.
53
- * @param {String} response The complete HTTP response.
54
- */
55
-
56
48
  /**
57
49
  * Create a new embedder
58
- * Creates a new embedder configuration for vectorizing content. Embedders represent connections to different embedding API services (like OpenAI, vLLM, etc.) and include all the necessary configuration to use them with memory spaces.
50
+ * Creates a new embedder configuration for vectorizing content. Embedders represent connections to different embedding API services (like OpenAI, vLLM, etc.) and include all the necessary configuration to use them with memory spaces. DUPLICATE DETECTION: Returns ALREADY_EXISTS if another embedder exists with identical {owner_id, provider_type, endpoint_url, api_path, model_identifier, credentials_fingerprint} after URL canonicalization. Uniqueness is enforced per-owner, allowing different users to have identical configurations. Credentials are hashed (SHA-256) for uniqueness while remaining encrypted. The api_path field defaults to '/embeddings' if omitted. Requires CREATE_EMBEDDER_OWN permission (or CREATE_EMBEDDER_ANY for admin users).
59
51
  * @param {module:model/EmbedderCreationRequest} embedderCreationRequest Embedder configuration details
60
- * @param {module:api/EmbeddersApi~createEmbedderCallback} callback The callback function, accepting three arguments: error, data, response
61
- * data is of type: {@link module:model/EmbedderResponse}
52
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/EmbedderResponse} and HTTP response
62
53
  */
63
54
  return _createClass(EmbeddersApi, [{
64
- key: "createEmbedder",
65
- value: function createEmbedder(embedderCreationRequest, callback) {
55
+ key: "createEmbedderWithHttpInfo",
56
+ value: function createEmbedderWithHttpInfo(embedderCreationRequest) {
66
57
  var postBody = embedderCreationRequest;
67
58
  // verify the required parameter 'embedderCreationRequest' is set
68
59
  if (embedderCreationRequest === undefined || embedderCreationRequest === null) {
@@ -76,26 +67,32 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
76
67
  var contentTypes = ['application/json'];
77
68
  var accepts = ['application/json'];
78
69
  var returnType = _EmbedderResponse["default"];
79
- return this.apiClient.callApi('/v1/embedders', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
70
+ return this.apiClient.callApi('/v1/embedders', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
80
71
  }
81
72
 
82
73
  /**
83
- * Callback function to receive the result of the deleteEmbedder operation.
84
- * @callback module:api/EmbeddersApi~deleteEmbedderCallback
85
- * @param {String} error Error message, if any.
86
- * @param data This operation does not return a value.
87
- * @param {String} response The complete HTTP response.
74
+ * Create a new embedder
75
+ * Creates a new embedder configuration for vectorizing content. Embedders represent connections to different embedding API services (like OpenAI, vLLM, etc.) and include all the necessary configuration to use them with memory spaces. DUPLICATE DETECTION: Returns ALREADY_EXISTS if another embedder exists with identical {owner_id, provider_type, endpoint_url, api_path, model_identifier, credentials_fingerprint} after URL canonicalization. Uniqueness is enforced per-owner, allowing different users to have identical configurations. Credentials are hashed (SHA-256) for uniqueness while remaining encrypted. The api_path field defaults to '/embeddings' if omitted. Requires CREATE_EMBEDDER_OWN permission (or CREATE_EMBEDDER_ANY for admin users).
76
+ * @param {module:model/EmbedderCreationRequest} embedderCreationRequest Embedder configuration details
77
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/EmbedderResponse}
88
78
  */
79
+ }, {
80
+ key: "createEmbedder",
81
+ value: function createEmbedder(embedderCreationRequest) {
82
+ return this.createEmbedderWithHttpInfo(embedderCreationRequest).then(function (response_and_data) {
83
+ return response_and_data.data;
84
+ });
85
+ }
89
86
 
90
87
  /**
91
88
  * Delete an embedder
92
- * Deletes an embedder configuration. This operation cannot be undone.
89
+ * Permanently deletes an embedder configuration. This operation cannot be undone and removes the embedder record and securely deletes stored credentials. IMPORTANT: This does NOT invalidate or delete embeddings previously created with this embedder - existing embeddings remain accessible. Requires DELETE_EMBEDDER_OWN permission for embedders you own (or DELETE_EMBEDDER_ANY for admin users).
93
90
  * @param {String} id The unique identifier of the embedder to delete
94
- * @param {module:api/EmbeddersApi~deleteEmbedderCallback} callback The callback function, accepting three arguments: error, data, response
91
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
95
92
  */
96
93
  }, {
97
- key: "deleteEmbedder",
98
- value: function deleteEmbedder(id, callback) {
94
+ key: "deleteEmbedderWithHttpInfo",
95
+ value: function deleteEmbedderWithHttpInfo(id) {
99
96
  var postBody = null;
100
97
  // verify the required parameter 'id' is set
101
98
  if (id === undefined || id === null) {
@@ -111,27 +108,32 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
111
108
  var contentTypes = [];
112
109
  var accepts = [];
113
110
  var returnType = null;
114
- return this.apiClient.callApi('/v1/embedders/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
111
+ return this.apiClient.callApi('/v1/embedders/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
115
112
  }
116
113
 
117
114
  /**
118
- * Callback function to receive the result of the getEmbedder operation.
119
- * @callback module:api/EmbeddersApi~getEmbedderCallback
120
- * @param {String} error Error message, if any.
121
- * @param {module:model/EmbedderResponse} data The data returned by the service call.
122
- * @param {String} response The complete HTTP response.
115
+ * Delete an embedder
116
+ * Permanently deletes an embedder configuration. This operation cannot be undone and removes the embedder record and securely deletes stored credentials. IMPORTANT: This does NOT invalidate or delete embeddings previously created with this embedder - existing embeddings remain accessible. Requires DELETE_EMBEDDER_OWN permission for embedders you own (or DELETE_EMBEDDER_ANY for admin users).
117
+ * @param {String} id The unique identifier of the embedder to delete
118
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
123
119
  */
120
+ }, {
121
+ key: "deleteEmbedder",
122
+ value: function deleteEmbedder(id) {
123
+ return this.deleteEmbedderWithHttpInfo(id).then(function (response_and_data) {
124
+ return response_and_data.data;
125
+ });
126
+ }
124
127
 
125
128
  /**
126
129
  * Get an embedder by ID
127
- * Retrieves the details of a specific embedder configuration by its unique identifier.
130
+ * Retrieves the details of a specific embedder configuration by its unique identifier. Requires READ_EMBEDDER_OWN permission for embedders you own (or READ_EMBEDDER_ANY for admin users to view any user's embedders). This is a read-only operation with no side effects.
128
131
  * @param {String} id The unique identifier of the embedder to retrieve
129
- * @param {module:api/EmbeddersApi~getEmbedderCallback} callback The callback function, accepting three arguments: error, data, response
130
- * data is of type: {@link module:model/EmbedderResponse}
132
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/EmbedderResponse} and HTTP response
131
133
  */
132
134
  }, {
133
- key: "getEmbedder",
134
- value: function getEmbedder(id, callback) {
135
+ key: "getEmbedderWithHttpInfo",
136
+ value: function getEmbedderWithHttpInfo(id) {
135
137
  var postBody = null;
136
138
  // verify the required parameter 'id' is set
137
139
  if (id === undefined || id === null) {
@@ -147,30 +149,35 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
147
149
  var contentTypes = [];
148
150
  var accepts = ['application/json'];
149
151
  var returnType = _EmbedderResponse["default"];
150
- return this.apiClient.callApi('/v1/embedders/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
152
+ return this.apiClient.callApi('/v1/embedders/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
151
153
  }
152
154
 
153
155
  /**
154
- * Callback function to receive the result of the listEmbedders operation.
155
- * @callback module:api/EmbeddersApi~listEmbeddersCallback
156
- * @param {String} error Error message, if any.
157
- * @param {module:model/ListEmbeddersResponse} data The data returned by the service call.
158
- * @param {String} response The complete HTTP response.
156
+ * Get an embedder by ID
157
+ * Retrieves the details of a specific embedder configuration by its unique identifier. Requires READ_EMBEDDER_OWN permission for embedders you own (or READ_EMBEDDER_ANY for admin users to view any user's embedders). This is a read-only operation with no side effects.
158
+ * @param {String} id The unique identifier of the embedder to retrieve
159
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/EmbedderResponse}
159
160
  */
161
+ }, {
162
+ key: "getEmbedder",
163
+ value: function getEmbedder(id) {
164
+ return this.getEmbedderWithHttpInfo(id).then(function (response_and_data) {
165
+ return response_and_data.data;
166
+ });
167
+ }
160
168
 
161
169
  /**
162
170
  * List embedders
163
- * Retrieves a list of embedder configurations accessible to the caller, with optional filtering.
171
+ * Retrieves a list of embedder configurations accessible to the caller, with optional filtering. PERMISSION-BASED FILTERING: With LIST_EMBEDDER_OWN permission, you can only see your own embedders (owner_id filter is ignored if set to another user). With LIST_EMBEDDER_ANY permission, you can see all embedders or filter by any owner_id. This is a read-only operation with no side effects.
164
172
  * @param {Object} opts Optional parameters
165
- * @param {String} [ownerId] Filter embedders by owner ID. If not provided, shows embedders based on permissions.
173
+ * @param {String} [ownerId] Filter embedders by owner ID. With LIST_EMBEDDER_ANY permission, omitting this shows all accessible embedders; providing it filters by that owner. With LIST_EMBEDDER_OWN permission, only your own embedders are shown regardless of this parameter.
166
174
  * @param {String} [providerType] Filter embedders by provider type (e.g., OPENAI, OPENAI_COMPATIBLE, COHERE, etc.)
167
175
  * @param {String} [label] Filter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=nlp)
168
- * @param {module:api/EmbeddersApi~listEmbeddersCallback} callback The callback function, accepting three arguments: error, data, response
169
- * data is of type: {@link module:model/ListEmbeddersResponse}
176
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListEmbeddersResponse} and HTTP response
170
177
  */
171
178
  }, {
172
- key: "listEmbedders",
173
- value: function listEmbedders(opts, callback) {
179
+ key: "listEmbeddersWithHttpInfo",
180
+ value: function listEmbeddersWithHttpInfo(opts) {
174
181
  opts = opts || {};
175
182
  var postBody = null;
176
183
  var pathParams = {};
@@ -185,28 +192,36 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
185
192
  var contentTypes = [];
186
193
  var accepts = ['application/json'];
187
194
  var returnType = _ListEmbeddersResponse["default"];
188
- return this.apiClient.callApi('/v1/embedders', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
195
+ return this.apiClient.callApi('/v1/embedders', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
189
196
  }
190
197
 
191
198
  /**
192
- * Callback function to receive the result of the updateEmbedder operation.
193
- * @callback module:api/EmbeddersApi~updateEmbedderCallback
194
- * @param {String} error Error message, if any.
195
- * @param {module:model/EmbedderResponse} data The data returned by the service call.
196
- * @param {String} response The complete HTTP response.
199
+ * List embedders
200
+ * Retrieves a list of embedder configurations accessible to the caller, with optional filtering. PERMISSION-BASED FILTERING: With LIST_EMBEDDER_OWN permission, you can only see your own embedders (owner_id filter is ignored if set to another user). With LIST_EMBEDDER_ANY permission, you can see all embedders or filter by any owner_id. This is a read-only operation with no side effects.
201
+ * @param {Object} opts Optional parameters
202
+ * @param {String} opts.ownerId Filter embedders by owner ID. With LIST_EMBEDDER_ANY permission, omitting this shows all accessible embedders; providing it filters by that owner. With LIST_EMBEDDER_OWN permission, only your own embedders are shown regardless of this parameter.
203
+ * @param {String} opts.providerType Filter embedders by provider type (e.g., OPENAI, OPENAI_COMPATIBLE, COHERE, etc.)
204
+ * @param {String} opts.label Filter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=nlp)
205
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListEmbeddersResponse}
197
206
  */
207
+ }, {
208
+ key: "listEmbedders",
209
+ value: function listEmbedders(opts) {
210
+ return this.listEmbeddersWithHttpInfo(opts).then(function (response_and_data) {
211
+ return response_and_data.data;
212
+ });
213
+ }
198
214
 
199
215
  /**
200
216
  * Update an embedder
201
- * Updates an existing embedder configuration with new values for the specified fields.
217
+ * Updates an existing embedder configuration including display information, endpoint configuration, model parameters, credentials, and labels. All fields are optional - only specified fields will be updated. IMPORTANT: provider_type is IMMUTABLE after creation and cannot be changed. CRITICAL: Returns FAILED_PRECONDITION if attempting to update core fields (dimensionality, distribution_type, model_identifier) while the embedder is actively referenced by spaces or ingestion jobs. Requires UPDATE_EMBEDDER_OWN permission for embedders you own (or UPDATE_EMBEDDER_ANY for admin users).
202
218
  * @param {String} id The unique identifier of the embedder to update
203
219
  * @param {module:model/UpdateEmbedderRequest} updateEmbedderRequest Embedder update details
204
- * @param {module:api/EmbeddersApi~updateEmbedderCallback} callback The callback function, accepting three arguments: error, data, response
205
- * data is of type: {@link module:model/EmbedderResponse}
220
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/EmbedderResponse} and HTTP response
206
221
  */
207
222
  }, {
208
- key: "updateEmbedder",
209
- value: function updateEmbedder(id, updateEmbedderRequest, callback) {
223
+ key: "updateEmbedderWithHttpInfo",
224
+ value: function updateEmbedderWithHttpInfo(id, updateEmbedderRequest) {
210
225
  var postBody = updateEmbedderRequest;
211
226
  // verify the required parameter 'id' is set
212
227
  if (id === undefined || id === null) {
@@ -226,7 +241,22 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
226
241
  var contentTypes = ['application/json'];
227
242
  var accepts = ['application/json'];
228
243
  var returnType = _EmbedderResponse["default"];
229
- return this.apiClient.callApi('/v1/embedders/{id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
244
+ return this.apiClient.callApi('/v1/embedders/{id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
245
+ }
246
+
247
+ /**
248
+ * Update an embedder
249
+ * Updates an existing embedder configuration including display information, endpoint configuration, model parameters, credentials, and labels. All fields are optional - only specified fields will be updated. IMPORTANT: provider_type is IMMUTABLE after creation and cannot be changed. CRITICAL: Returns FAILED_PRECONDITION if attempting to update core fields (dimensionality, distribution_type, model_identifier) while the embedder is actively referenced by spaces or ingestion jobs. Requires UPDATE_EMBEDDER_OWN permission for embedders you own (or UPDATE_EMBEDDER_ANY for admin users).
250
+ * @param {String} id The unique identifier of the embedder to update
251
+ * @param {module:model/UpdateEmbedderRequest} updateEmbedderRequest Embedder update details
252
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/EmbedderResponse}
253
+ */
254
+ }, {
255
+ key: "updateEmbedder",
256
+ value: function updateEmbedder(id, updateEmbedderRequest) {
257
+ return this.updateEmbedderWithHttpInfo(id, updateEmbedderRequest).then(function (response_and_data) {
258
+ return response_and_data.data;
259
+ });
230
260
  }
231
261
  }]);
232
262
  }();