@pairsystems/goodmem-client 1.0.2 → 1.0.4
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/README.md +191 -3
- package/dist/api/APIKeysApi.js +8 -8
- package/dist/api/EmbeddersApi.js +12 -12
- package/dist/api/LLMsApi.js +263 -0
- package/dist/api/MemoriesApi.js +104 -20
- package/dist/api/RerankersApi.js +12 -12
- package/dist/api/SpacesApi.js +18 -18
- package/dist/api/UsersApi.js +82 -15
- package/dist/index.js +131 -0
- package/dist/model/BinaryContent.js +129 -0
- package/dist/model/ChunkReference.js +9 -6
- package/dist/model/ContextItem.js +136 -0
- package/dist/model/CreateLLMResponse.js +146 -0
- package/dist/model/DistributionType.js +58 -0
- package/dist/model/EmbedderCreationRequest.js +15 -4
- package/dist/model/EmbedderResponse.js +15 -4
- package/dist/model/EmbedderWeight.js +125 -0
- package/dist/model/LLMCapabilities.js +132 -0
- package/dist/model/LLMCreationRequest.js +318 -0
- package/dist/model/LLMProviderType.js +83 -0
- package/dist/model/LLMResponse.js +366 -0
- package/dist/model/LLMSamplingParams.js +145 -0
- package/dist/model/LLMUpdateRequest.js +274 -0
- package/dist/model/ListLLMsResponse.js +132 -0
- package/dist/model/Memory.js +2 -6
- package/dist/model/MemoryChunkResponse.js +240 -0
- package/dist/model/PostProcessor.js +125 -0
- package/dist/model/ProviderType.js +5 -0
- package/dist/model/RetrieveMemoryEvent.js +8 -5
- package/dist/model/RetrieveMemoryRequest.js +219 -0
- package/dist/model/RetrievedItem.js +8 -5
- package/dist/model/SpaceKey.js +145 -0
- package/dist/streaming.js +249 -46
- package/package.json +3 -7
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-g
|
|
|
6
6
|
|
|
7
7
|
- API version:
|
|
8
8
|
- Package version: 1.0.0
|
|
9
|
-
- Generator version: 7.
|
|
9
|
+
- Generator version: 7.17.0-SNAPSHOT
|
|
10
10
|
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
@@ -101,6 +101,17 @@ Please follow the [installation](#installation) instruction and execute the foll
|
|
|
101
101
|
```javascript
|
|
102
102
|
var GoodMemClient = require('@pairsystems/goodmem-client');
|
|
103
103
|
|
|
104
|
+
// Configure the API client
|
|
105
|
+
var defaultClient = GoodMemClient.ApiClient.instance;
|
|
106
|
+
defaultClient.basePath = "http://localhost:8080"; // Use your server URL
|
|
107
|
+
|
|
108
|
+
// Configure API key authentication: X-API-Key header
|
|
109
|
+
defaultClient.defaultHeaders = {
|
|
110
|
+
"X-API-Key": "your-api-key-here",
|
|
111
|
+
"Content-Type": "application/json",
|
|
112
|
+
"Accept": "application/json"
|
|
113
|
+
};
|
|
114
|
+
|
|
104
115
|
|
|
105
116
|
var api = new GoodMemClient.APIKeysApi()
|
|
106
117
|
var createApiKeyRequest = {
|
|
@@ -120,6 +131,159 @@ api.createApiKey(createApiKeyRequest).then(function(data) {
|
|
|
120
131
|
|
|
121
132
|
```
|
|
122
133
|
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
## Streaming Memory Retrieval
|
|
137
|
+
|
|
138
|
+
The GoodMem JavaScript client provides a `StreamingClient` class for real-time streaming memory retrieval. This is the **recommended approach** for memory retrieval operations.
|
|
139
|
+
|
|
140
|
+
### Supported Formats
|
|
141
|
+
|
|
142
|
+
The StreamingClient supports two streaming formats:
|
|
143
|
+
|
|
144
|
+
- **NDJSON** (`application/x-ndjson`) - Newline-delimited JSON (default, recommended)
|
|
145
|
+
- **SSE** (`text/event-stream`) - Server-Sent Events
|
|
146
|
+
|
|
147
|
+
### Basic Streaming with ChatPostProcessor
|
|
148
|
+
|
|
149
|
+
Use `retrieveMemoryStreamChat()` for streaming with automatic ChatPostProcessor configuration:
|
|
150
|
+
|
|
151
|
+
```javascript
|
|
152
|
+
const GoodMemClient = require('@pairsystems/goodmem-client');
|
|
153
|
+
const { StreamingClient } = GoodMemClient;
|
|
154
|
+
|
|
155
|
+
// Configure client
|
|
156
|
+
const defaultClient = GoodMemClient.ApiClient.instance;
|
|
157
|
+
defaultClient.basePath = 'http://localhost:8080';
|
|
158
|
+
defaultClient.defaultHeaders = {
|
|
159
|
+
'X-API-Key': 'your-api-key'
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// Create streaming client
|
|
163
|
+
const streamingClient = new StreamingClient(defaultClient);
|
|
164
|
+
|
|
165
|
+
// Create abort controller
|
|
166
|
+
const controller = new AbortController();
|
|
167
|
+
|
|
168
|
+
// Stream with ChatPostProcessor (NDJSON format)
|
|
169
|
+
streamingClient.retrieveMemoryStreamChat(
|
|
170
|
+
controller.signal,
|
|
171
|
+
'your search query',
|
|
172
|
+
['space-uuid'],
|
|
173
|
+
10, // requested size
|
|
174
|
+
true, // fetch memory
|
|
175
|
+
false, // fetch memory content
|
|
176
|
+
'ndjson', // format (ndjson or sse)
|
|
177
|
+
'llm-uuid', // LLM ID
|
|
178
|
+
'reranker-uuid', // reranker ID
|
|
179
|
+
0.5, // relevance threshold
|
|
180
|
+
0.3, // LLM temperature
|
|
181
|
+
10, // max results
|
|
182
|
+
true // chronological resort
|
|
183
|
+
).then(async (stream) => {
|
|
184
|
+
for await (const event of stream) {
|
|
185
|
+
if (event.abstractReply) {
|
|
186
|
+
console.log('Abstract:', event.abstractReply.text);
|
|
187
|
+
} else if (event.retrievedItem && event.retrievedItem.memory) {
|
|
188
|
+
console.log('Memory:', event.retrievedItem.memory);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}).catch(error => {
|
|
192
|
+
console.error('Streaming error:', error);
|
|
193
|
+
});
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Advanced Streaming with Custom Post-Processor
|
|
197
|
+
|
|
198
|
+
Use `retrieveMemoryStreamAdvanced()` for custom post-processor configuration:
|
|
199
|
+
|
|
200
|
+
```javascript
|
|
201
|
+
// Create advanced request
|
|
202
|
+
const request = {
|
|
203
|
+
message: 'your search query',
|
|
204
|
+
spaceIds: ['space-uuid'],
|
|
205
|
+
requestedSize: 10,
|
|
206
|
+
fetchMemory: true,
|
|
207
|
+
fetchMemoryContent: false,
|
|
208
|
+
format: 'ndjson', // or 'sse'
|
|
209
|
+
postProcessorName: 'com.goodmem.retrieval.postprocess.ChatPostProcessorFactory',
|
|
210
|
+
postProcessorConfig: {
|
|
211
|
+
llm_id: 'llm-uuid',
|
|
212
|
+
reranker_id: 'reranker-uuid',
|
|
213
|
+
relevance_threshold: 0.5,
|
|
214
|
+
llm_temp: 0.3,
|
|
215
|
+
max_results: 10,
|
|
216
|
+
chronological_resort: true
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
// Execute advanced streaming
|
|
221
|
+
streamingClient.retrieveMemoryStreamAdvanced(controller.signal, request)
|
|
222
|
+
.then(async (stream) => {
|
|
223
|
+
for await (const event of stream) {
|
|
224
|
+
if (event.abstractReply) {
|
|
225
|
+
console.log('Abstract:', event.abstractReply.text);
|
|
226
|
+
} else if (event.retrievedItem) {
|
|
227
|
+
console.log('Retrieved:', event.retrievedItem);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}).catch(error => {
|
|
231
|
+
console.error('Streaming error:', error);
|
|
232
|
+
});
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Choosing Between NDJSON and SSE
|
|
236
|
+
|
|
237
|
+
- **NDJSON** (recommended): Simpler parsing, better for most use cases
|
|
238
|
+
- **SSE**: Standard browser EventSource API compatible, useful for web applications
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
## Authentication
|
|
242
|
+
|
|
243
|
+
Configure API key authentication by setting the X-API-Key header:
|
|
244
|
+
|
|
245
|
+
```javascript
|
|
246
|
+
var GoodMemClient = require("@pairsystems/goodmem-client");
|
|
247
|
+
|
|
248
|
+
// Configure the API client
|
|
249
|
+
var defaultClient = GoodMemClient.ApiClient.instance;
|
|
250
|
+
defaultClient.basePath = "http://localhost:8080"; // Use your server URL
|
|
251
|
+
|
|
252
|
+
// Configure API key authentication
|
|
253
|
+
defaultClient.defaultHeaders = {
|
|
254
|
+
"X-API-Key": "your-api-key-here",
|
|
255
|
+
"Content-Type": "application/json",
|
|
256
|
+
"Accept": "application/json"
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
// Create API instances
|
|
260
|
+
var apiKeysApi = new GoodMemClient.APIKeysApi();
|
|
261
|
+
var spacesApi = new GoodMemClient.SpacesApi();
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Getting an API Key
|
|
265
|
+
|
|
266
|
+
You can create an API key using the APIKeysApi:
|
|
267
|
+
|
|
268
|
+
```javascript
|
|
269
|
+
var createRequest = {
|
|
270
|
+
labels: {
|
|
271
|
+
"environment": "development",
|
|
272
|
+
"service": "your-app-name"
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
apiKeysApi.createApiKey(createRequest).then(function(response) {
|
|
277
|
+
console.log("API Key created successfully:");
|
|
278
|
+
console.log("Key ID:", response.apiKeyMetadata.apiKeyId);
|
|
279
|
+
console.log("Raw API Key:", response.rawApiKey);
|
|
280
|
+
console.log("Key Prefix:", response.apiKeyMetadata.keyPrefix);
|
|
281
|
+
}, function(error) {
|
|
282
|
+
console.error("Error creating API key:", error);
|
|
283
|
+
});
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
|
|
123
287
|
## Documentation for API Endpoints
|
|
124
288
|
|
|
125
289
|
All URIs are relative to *http://localhost*
|
|
@@ -135,6 +299,11 @@ Class | Method | HTTP request | Description
|
|
|
135
299
|
*GoodMemClient.EmbeddersApi* | [**getEmbedder**](docs/EmbeddersApi.md#getEmbedder) | **GET** /v1/embedders/{id} | Get an embedder by ID
|
|
136
300
|
*GoodMemClient.EmbeddersApi* | [**listEmbedders**](docs/EmbeddersApi.md#listEmbedders) | **GET** /v1/embedders | List embedders
|
|
137
301
|
*GoodMemClient.EmbeddersApi* | [**updateEmbedder**](docs/EmbeddersApi.md#updateEmbedder) | **PUT** /v1/embedders/{id} | Update an embedder
|
|
302
|
+
*GoodMemClient.LLMsApi* | [**createLLM**](docs/LLMsApi.md#createLLM) | **POST** /v1/llms | Create a new LLM
|
|
303
|
+
*GoodMemClient.LLMsApi* | [**deleteLLM**](docs/LLMsApi.md#deleteLLM) | **DELETE** /v1/llms/{id} | Delete an LLM
|
|
304
|
+
*GoodMemClient.LLMsApi* | [**getLLM**](docs/LLMsApi.md#getLLM) | **GET** /v1/llms/{id} | Get an LLM by ID
|
|
305
|
+
*GoodMemClient.LLMsApi* | [**listLLMs**](docs/LLMsApi.md#listLLMs) | **GET** /v1/llms | List LLMs
|
|
306
|
+
*GoodMemClient.LLMsApi* | [**updateLLM**](docs/LLMsApi.md#updateLLM) | **PUT** /v1/llms/{id} | Update an LLM
|
|
138
307
|
*GoodMemClient.MemoriesApi* | [**batchCreateMemory**](docs/MemoriesApi.md#batchCreateMemory) | **POST** /v1/memories/batch | Create multiple memories in a batch
|
|
139
308
|
*GoodMemClient.MemoriesApi* | [**batchDeleteMemory**](docs/MemoriesApi.md#batchDeleteMemory) | **POST** /v1/memories/batch/delete | Delete multiple memories by ID
|
|
140
309
|
*GoodMemClient.MemoriesApi* | [**batchGetMemory**](docs/MemoriesApi.md#batchGetMemory) | **POST** /v1/memories/batch/get | Get multiple memories by ID
|
|
@@ -142,7 +311,8 @@ Class | Method | HTTP request | Description
|
|
|
142
311
|
*GoodMemClient.MemoriesApi* | [**deleteMemory**](docs/MemoriesApi.md#deleteMemory) | **DELETE** /v1/memories/{id} | Delete a memory
|
|
143
312
|
*GoodMemClient.MemoriesApi* | [**getMemory**](docs/MemoriesApi.md#getMemory) | **GET** /v1/memories/{id} | Get a memory by ID
|
|
144
313
|
*GoodMemClient.MemoriesApi* | [**listMemories**](docs/MemoriesApi.md#listMemories) | **GET** /v1/spaces/{spaceId}/memories | List memories in a space
|
|
145
|
-
*GoodMemClient.MemoriesApi* | [**retrieveMemory**](docs/MemoriesApi.md#retrieveMemory) | **GET** /v1/memories
|
|
314
|
+
*GoodMemClient.MemoriesApi* | [**retrieveMemory**](docs/MemoriesApi.md#retrieveMemory) | **GET** /v1/memories:retrieve | Stream semantic memory retrieval
|
|
315
|
+
*GoodMemClient.MemoriesApi* | [**retrieveMemoryAdvanced**](docs/MemoriesApi.md#retrieveMemoryAdvanced) | **POST** /v1/memories:retrieve | Advanced semantic memory retrieval with JSON
|
|
146
316
|
*GoodMemClient.RerankersApi* | [**createReranker**](docs/RerankersApi.md#createReranker) | **POST** /v1/rerankers | Create a new reranker
|
|
147
317
|
*GoodMemClient.RerankersApi* | [**deleteReranker**](docs/RerankersApi.md#deleteReranker) | **DELETE** /v1/rerankers/{id} | Delete a reranker
|
|
148
318
|
*GoodMemClient.RerankersApi* | [**getReranker**](docs/RerankersApi.md#getReranker) | **GET** /v1/rerankers/{id} | Get a reranker by ID
|
|
@@ -154,7 +324,9 @@ Class | Method | HTTP request | Description
|
|
|
154
324
|
*GoodMemClient.SpacesApi* | [**listSpaces**](docs/SpacesApi.md#listSpaces) | **GET** /v1/spaces | List spaces
|
|
155
325
|
*GoodMemClient.SpacesApi* | [**updateSpace**](docs/SpacesApi.md#updateSpace) | **PUT** /v1/spaces/{id} | Update a space
|
|
156
326
|
*GoodMemClient.SystemApi* | [**initializeSystem**](docs/SystemApi.md#initializeSystem) | **POST** /v1/system/init | Initialize the system
|
|
327
|
+
*GoodMemClient.UsersApi* | [**getCurrentUser**](docs/UsersApi.md#getCurrentUser) | **GET** /v1/users/me | Get current user profile
|
|
157
328
|
*GoodMemClient.UsersApi* | [**getUser**](docs/UsersApi.md#getUser) | **GET** /v1/users/{id} | Get a user by ID
|
|
329
|
+
*GoodMemClient.UsersApi* | [**getUserByEmail**](docs/UsersApi.md#getUserByEmail) | **GET** /v1/users/email/{email} | Get user by email address
|
|
158
330
|
|
|
159
331
|
|
|
160
332
|
## Documentation for Models
|
|
@@ -164,28 +336,43 @@ Class | Method | HTTP request | Description
|
|
|
164
336
|
- [GoodMemClient.BatchMemoryCreationRequest](docs/BatchMemoryCreationRequest.md)
|
|
165
337
|
- [GoodMemClient.BatchMemoryDeletionRequest](docs/BatchMemoryDeletionRequest.md)
|
|
166
338
|
- [GoodMemClient.BatchMemoryRetrievalRequest](docs/BatchMemoryRetrievalRequest.md)
|
|
339
|
+
- [GoodMemClient.BinaryContent](docs/BinaryContent.md)
|
|
167
340
|
- [GoodMemClient.ChunkReference](docs/ChunkReference.md)
|
|
168
341
|
- [GoodMemClient.ChunkingConfiguration](docs/ChunkingConfiguration.md)
|
|
342
|
+
- [GoodMemClient.ContextItem](docs/ContextItem.md)
|
|
169
343
|
- [GoodMemClient.CreateApiKeyRequest](docs/CreateApiKeyRequest.md)
|
|
170
344
|
- [GoodMemClient.CreateApiKeyResponse](docs/CreateApiKeyResponse.md)
|
|
345
|
+
- [GoodMemClient.CreateLLMResponse](docs/CreateLLMResponse.md)
|
|
346
|
+
- [GoodMemClient.DistributionType](docs/DistributionType.md)
|
|
171
347
|
- [GoodMemClient.EmbedderCreationRequest](docs/EmbedderCreationRequest.md)
|
|
172
348
|
- [GoodMemClient.EmbedderResponse](docs/EmbedderResponse.md)
|
|
349
|
+
- [GoodMemClient.EmbedderWeight](docs/EmbedderWeight.md)
|
|
173
350
|
- [GoodMemClient.GoodMemStatus](docs/GoodMemStatus.md)
|
|
351
|
+
- [GoodMemClient.LLMCapabilities](docs/LLMCapabilities.md)
|
|
352
|
+
- [GoodMemClient.LLMCreationRequest](docs/LLMCreationRequest.md)
|
|
353
|
+
- [GoodMemClient.LLMProviderType](docs/LLMProviderType.md)
|
|
354
|
+
- [GoodMemClient.LLMResponse](docs/LLMResponse.md)
|
|
355
|
+
- [GoodMemClient.LLMSamplingParams](docs/LLMSamplingParams.md)
|
|
356
|
+
- [GoodMemClient.LLMUpdateRequest](docs/LLMUpdateRequest.md)
|
|
174
357
|
- [GoodMemClient.LengthMeasurement](docs/LengthMeasurement.md)
|
|
175
358
|
- [GoodMemClient.ListApiKeysResponse](docs/ListApiKeysResponse.md)
|
|
176
359
|
- [GoodMemClient.ListEmbeddersResponse](docs/ListEmbeddersResponse.md)
|
|
360
|
+
- [GoodMemClient.ListLLMsResponse](docs/ListLLMsResponse.md)
|
|
177
361
|
- [GoodMemClient.ListRerankersResponse](docs/ListRerankersResponse.md)
|
|
178
362
|
- [GoodMemClient.ListSpacesResponse](docs/ListSpacesResponse.md)
|
|
179
363
|
- [GoodMemClient.Memory](docs/Memory.md)
|
|
364
|
+
- [GoodMemClient.MemoryChunkResponse](docs/MemoryChunkResponse.md)
|
|
180
365
|
- [GoodMemClient.MemoryCreationRequest](docs/MemoryCreationRequest.md)
|
|
181
366
|
- [GoodMemClient.MemoryListResponse](docs/MemoryListResponse.md)
|
|
182
367
|
- [GoodMemClient.Modality](docs/Modality.md)
|
|
368
|
+
- [GoodMemClient.PostProcessor](docs/PostProcessor.md)
|
|
183
369
|
- [GoodMemClient.ProviderType](docs/ProviderType.md)
|
|
184
370
|
- [GoodMemClient.RecursiveChunkingConfiguration](docs/RecursiveChunkingConfiguration.md)
|
|
185
371
|
- [GoodMemClient.RerankerCreationRequest](docs/RerankerCreationRequest.md)
|
|
186
372
|
- [GoodMemClient.RerankerResponse](docs/RerankerResponse.md)
|
|
187
373
|
- [GoodMemClient.ResultSetBoundary](docs/ResultSetBoundary.md)
|
|
188
374
|
- [GoodMemClient.RetrieveMemoryEvent](docs/RetrieveMemoryEvent.md)
|
|
375
|
+
- [GoodMemClient.RetrieveMemoryRequest](docs/RetrieveMemoryRequest.md)
|
|
189
376
|
- [GoodMemClient.RetrievedItem](docs/RetrievedItem.md)
|
|
190
377
|
- [GoodMemClient.SentenceChunkingConfiguration](docs/SentenceChunkingConfiguration.md)
|
|
191
378
|
- [GoodMemClient.SeparatorKeepStrategy](docs/SeparatorKeepStrategy.md)
|
|
@@ -193,6 +380,7 @@ Class | Method | HTTP request | Description
|
|
|
193
380
|
- [GoodMemClient.SpaceCreationRequest](docs/SpaceCreationRequest.md)
|
|
194
381
|
- [GoodMemClient.SpaceEmbedder](docs/SpaceEmbedder.md)
|
|
195
382
|
- [GoodMemClient.SpaceEmbedderConfig](docs/SpaceEmbedderConfig.md)
|
|
383
|
+
- [GoodMemClient.SpaceKey](docs/SpaceKey.md)
|
|
196
384
|
- [GoodMemClient.SystemInitResponse](docs/SystemInitResponse.md)
|
|
197
385
|
- [GoodMemClient.UpdateApiKeyRequest](docs/UpdateApiKeyRequest.md)
|
|
198
386
|
- [GoodMemClient.UpdateEmbedderRequest](docs/UpdateEmbedderRequest.md)
|
|
@@ -203,5 +391,5 @@ Class | Method | HTTP request | Description
|
|
|
203
391
|
|
|
204
392
|
## Documentation for Authorization
|
|
205
393
|
|
|
206
|
-
|
|
394
|
+
Authentication required - see configuration below.
|
|
207
395
|
|
package/dist/api/APIKeysApi.js
CHANGED
|
@@ -48,7 +48,7 @@ var APIKeysApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Create a new API key
|
|
51
|
-
* Creates a new API key for authenticating with the API. The response includes the one-time raw API key value which will not be retrievable later.
|
|
51
|
+
* Creates a new API key for authenticating with the API. New keys start in ACTIVE status and can be used immediately for authentication. The response includes the one-time raw API key value which will not be retrievable later - clients must save this value as it cannot be recovered. Requires CREATE_APIKEY_OWN permission (or CREATE_APIKEY_ANY for admin users). Side effects include generating cryptographically secure key material, recording creation timestamp, and tracking creator ID. Returns INVALID_ARGUMENT if expires_at is set to a time in the past.
|
|
52
52
|
* @param {module:model/CreateApiKeyRequest} createApiKeyRequest API key configuration
|
|
53
53
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CreateApiKeyResponse} and HTTP response
|
|
54
54
|
*/
|
|
@@ -73,7 +73,7 @@ var APIKeysApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
75
|
* Create a new API key
|
|
76
|
-
* Creates a new API key for authenticating with the API. The response includes the one-time raw API key value which will not be retrievable later.
|
|
76
|
+
* Creates a new API key for authenticating with the API. New keys start in ACTIVE status and can be used immediately for authentication. The response includes the one-time raw API key value which will not be retrievable later - clients must save this value as it cannot be recovered. Requires CREATE_APIKEY_OWN permission (or CREATE_APIKEY_ANY for admin users). Side effects include generating cryptographically secure key material, recording creation timestamp, and tracking creator ID. Returns INVALID_ARGUMENT if expires_at is set to a time in the past.
|
|
77
77
|
* @param {module:model/CreateApiKeyRequest} createApiKeyRequest API key configuration
|
|
78
78
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CreateApiKeyResponse}
|
|
79
79
|
*/
|
|
@@ -87,7 +87,7 @@ var APIKeysApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
89
|
* Delete an API key
|
|
90
|
-
*
|
|
90
|
+
* Permanently deletes an API key. This operation cannot be undone and immediately invalidates the key for all future authentication attempts. TIP: For reversible deactivation, use PUT /v1/apikeys/{id} with status=INACTIVE instead. Requires DELETE_APIKEY_OWN permission for keys you own (or DELETE_APIKEY_ANY for admin users to delete any user's keys). Side effects include permanently removing the key record from the database and immediate authentication invalidation.
|
|
91
91
|
* @param {String} id The unique identifier of the API key to delete
|
|
92
92
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
|
93
93
|
*/
|
|
@@ -114,7 +114,7 @@ var APIKeysApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
116
|
* Delete an API key
|
|
117
|
-
*
|
|
117
|
+
* Permanently deletes an API key. This operation cannot be undone and immediately invalidates the key for all future authentication attempts. TIP: For reversible deactivation, use PUT /v1/apikeys/{id} with status=INACTIVE instead. Requires DELETE_APIKEY_OWN permission for keys you own (or DELETE_APIKEY_ANY for admin users to delete any user's keys). Side effects include permanently removing the key record from the database and immediate authentication invalidation.
|
|
118
118
|
* @param {String} id The unique identifier of the API key to delete
|
|
119
119
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
|
120
120
|
*/
|
|
@@ -128,7 +128,7 @@ var APIKeysApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
130
|
* List API keys
|
|
131
|
-
* Retrieves a list of API keys belonging to the authenticated user. The list includes metadata about each key but not the actual key values.
|
|
131
|
+
* Retrieves a list of API keys belonging to the authenticated user. The list includes metadata about each key but not the actual key values or key hashes for security reasons. Requires LIST_APIKEY_OWN permission (or LIST_APIKEY_ANY for admin users to view keys from any user). This is a read-only operation with no side effects.
|
|
132
132
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListApiKeysResponse} and HTTP response
|
|
133
133
|
*/
|
|
134
134
|
}, {
|
|
@@ -148,7 +148,7 @@ var APIKeysApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
150
|
* List API keys
|
|
151
|
-
* Retrieves a list of API keys belonging to the authenticated user. The list includes metadata about each key but not the actual key values.
|
|
151
|
+
* Retrieves a list of API keys belonging to the authenticated user. The list includes metadata about each key but not the actual key values or key hashes for security reasons. Requires LIST_APIKEY_OWN permission (or LIST_APIKEY_ANY for admin users to view keys from any user). This is a read-only operation with no side effects.
|
|
152
152
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListApiKeysResponse}
|
|
153
153
|
*/
|
|
154
154
|
}, {
|
|
@@ -161,7 +161,7 @@ var APIKeysApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
161
161
|
|
|
162
162
|
/**
|
|
163
163
|
* Update an API key
|
|
164
|
-
* Updates an existing API key with new values for status or labels.
|
|
164
|
+
* Updates an existing API key with new values for status or labels. IMPORTANT: Key ID, user ownership, key material, and audit fields cannot be modified - only status (ACTIVE/INACTIVE) and labels are mutable. Requires UPDATE_APIKEY_OWN permission for keys you own (or UPDATE_APIKEY_ANY for admin users to modify any user's keys). Side effects include updating the updated_at timestamp and recording the updater's user ID. This operation is idempotent - repeated identical requests have no additional effect.
|
|
165
165
|
* @param {String} id The unique identifier of the API key to update
|
|
166
166
|
* @param {module:model/UpdateApiKeyRequest} updateApiKeyRequest API key update details
|
|
167
167
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiKeyResponse} and HTTP response
|
|
@@ -193,7 +193,7 @@ var APIKeysApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
193
193
|
|
|
194
194
|
/**
|
|
195
195
|
* Update an API key
|
|
196
|
-
* Updates an existing API key with new values for status or labels.
|
|
196
|
+
* Updates an existing API key with new values for status or labels. IMPORTANT: Key ID, user ownership, key material, and audit fields cannot be modified - only status (ACTIVE/INACTIVE) and labels are mutable. Requires UPDATE_APIKEY_OWN permission for keys you own (or UPDATE_APIKEY_ANY for admin users to modify any user's keys). Side effects include updating the updated_at timestamp and recording the updater's user ID. This operation is idempotent - repeated identical requests have no additional effect.
|
|
197
197
|
* @param {String} id The unique identifier of the API key to update
|
|
198
198
|
* @param {module:model/UpdateApiKeyRequest} updateApiKeyRequest API key update details
|
|
199
199
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiKeyResponse}
|
package/dist/api/EmbeddersApi.js
CHANGED
|
@@ -47,7 +47,7 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Create a new embedder
|
|
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.
|
|
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).
|
|
51
51
|
* @param {module:model/EmbedderCreationRequest} embedderCreationRequest Embedder configuration details
|
|
52
52
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/EmbedderResponse} and HTTP response
|
|
53
53
|
*/
|
|
@@ -72,7 +72,7 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
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.
|
|
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
76
|
* @param {module:model/EmbedderCreationRequest} embedderCreationRequest Embedder configuration details
|
|
77
77
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/EmbedderResponse}
|
|
78
78
|
*/
|
|
@@ -86,7 +86,7 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
88
|
* Delete an embedder
|
|
89
|
-
*
|
|
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).
|
|
90
90
|
* @param {String} id The unique identifier of the embedder to delete
|
|
91
91
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
|
92
92
|
*/
|
|
@@ -113,7 +113,7 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
115
|
* Delete an embedder
|
|
116
|
-
*
|
|
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
117
|
* @param {String} id The unique identifier of the embedder to delete
|
|
118
118
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
|
119
119
|
*/
|
|
@@ -127,7 +127,7 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* Get an embedder by ID
|
|
130
|
-
* 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.
|
|
131
131
|
* @param {String} id The unique identifier of the embedder to retrieve
|
|
132
132
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/EmbedderResponse} and HTTP response
|
|
133
133
|
*/
|
|
@@ -154,7 +154,7 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* Get an embedder by ID
|
|
157
|
-
* Retrieves the details of a specific embedder configuration by its unique identifier.
|
|
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
158
|
* @param {String} id The unique identifier of the embedder to retrieve
|
|
159
159
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/EmbedderResponse}
|
|
160
160
|
*/
|
|
@@ -168,9 +168,9 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
168
168
|
|
|
169
169
|
/**
|
|
170
170
|
* List embedders
|
|
171
|
-
* 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.
|
|
172
172
|
* @param {Object} opts Optional parameters
|
|
173
|
-
* @param {String} [ownerId] Filter embedders by owner ID.
|
|
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.
|
|
174
174
|
* @param {String} [providerType] Filter embedders by provider type (e.g., OPENAI, OPENAI_COMPATIBLE, COHERE, etc.)
|
|
175
175
|
* @param {String} [label] Filter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=nlp)
|
|
176
176
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListEmbeddersResponse} and HTTP response
|
|
@@ -197,9 +197,9 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
197
197
|
|
|
198
198
|
/**
|
|
199
199
|
* List embedders
|
|
200
|
-
* Retrieves a list of embedder configurations accessible to the caller, with optional filtering.
|
|
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
201
|
* @param {Object} opts Optional parameters
|
|
202
|
-
* @param {String} opts.ownerId Filter embedders by owner ID.
|
|
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
203
|
* @param {String} opts.providerType Filter embedders by provider type (e.g., OPENAI, OPENAI_COMPATIBLE, COHERE, etc.)
|
|
204
204
|
* @param {String} opts.label Filter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=nlp)
|
|
205
205
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListEmbeddersResponse}
|
|
@@ -214,7 +214,7 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
214
214
|
|
|
215
215
|
/**
|
|
216
216
|
* Update an embedder
|
|
217
|
-
* Updates an existing embedder configuration
|
|
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).
|
|
218
218
|
* @param {String} id The unique identifier of the embedder to update
|
|
219
219
|
* @param {module:model/UpdateEmbedderRequest} updateEmbedderRequest Embedder update details
|
|
220
220
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/EmbedderResponse} and HTTP response
|
|
@@ -246,7 +246,7 @@ var EmbeddersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
246
246
|
|
|
247
247
|
/**
|
|
248
248
|
* Update an embedder
|
|
249
|
-
* Updates an existing embedder configuration
|
|
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
250
|
* @param {String} id The unique identifier of the embedder to update
|
|
251
251
|
* @param {module:model/UpdateEmbedderRequest} updateEmbedderRequest Embedder update details
|
|
252
252
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/EmbedderResponse}
|