@pairsystems/goodmem-client 1.0.0-dev.cb052d6 → 1.0.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/README.md +181 -4
- package/dist/api/LLMsApi.js +263 -0
- package/dist/api/MemoriesApi.js +2 -2
- package/dist/index.js +63 -0
- package/dist/model/CreateLLMResponse.js +146 -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/streaming.js +246 -43
- package/package.json +1 -1
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,8 +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
|
|
146
|
-
*GoodMemClient.MemoriesApi* | [**retrieveMemoryAdvanced**](docs/MemoriesApi.md#retrieveMemoryAdvanced) | **POST** /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
|
|
147
316
|
*GoodMemClient.RerankersApi* | [**createReranker**](docs/RerankersApi.md#createReranker) | **POST** /v1/rerankers | Create a new reranker
|
|
148
317
|
*GoodMemClient.RerankersApi* | [**deleteReranker**](docs/RerankersApi.md#deleteReranker) | **DELETE** /v1/rerankers/{id} | Delete a reranker
|
|
149
318
|
*GoodMemClient.RerankersApi* | [**getReranker**](docs/RerankersApi.md#getReranker) | **GET** /v1/rerankers/{id} | Get a reranker by ID
|
|
@@ -173,14 +342,22 @@ Class | Method | HTTP request | Description
|
|
|
173
342
|
- [GoodMemClient.ContextItem](docs/ContextItem.md)
|
|
174
343
|
- [GoodMemClient.CreateApiKeyRequest](docs/CreateApiKeyRequest.md)
|
|
175
344
|
- [GoodMemClient.CreateApiKeyResponse](docs/CreateApiKeyResponse.md)
|
|
345
|
+
- [GoodMemClient.CreateLLMResponse](docs/CreateLLMResponse.md)
|
|
176
346
|
- [GoodMemClient.DistributionType](docs/DistributionType.md)
|
|
177
347
|
- [GoodMemClient.EmbedderCreationRequest](docs/EmbedderCreationRequest.md)
|
|
178
348
|
- [GoodMemClient.EmbedderResponse](docs/EmbedderResponse.md)
|
|
179
349
|
- [GoodMemClient.EmbedderWeight](docs/EmbedderWeight.md)
|
|
180
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)
|
|
181
357
|
- [GoodMemClient.LengthMeasurement](docs/LengthMeasurement.md)
|
|
182
358
|
- [GoodMemClient.ListApiKeysResponse](docs/ListApiKeysResponse.md)
|
|
183
359
|
- [GoodMemClient.ListEmbeddersResponse](docs/ListEmbeddersResponse.md)
|
|
360
|
+
- [GoodMemClient.ListLLMsResponse](docs/ListLLMsResponse.md)
|
|
184
361
|
- [GoodMemClient.ListRerankersResponse](docs/ListRerankersResponse.md)
|
|
185
362
|
- [GoodMemClient.ListSpacesResponse](docs/ListSpacesResponse.md)
|
|
186
363
|
- [GoodMemClient.Memory](docs/Memory.md)
|
|
@@ -214,5 +391,5 @@ Class | Method | HTTP request | Description
|
|
|
214
391
|
|
|
215
392
|
## Documentation for Authorization
|
|
216
393
|
|
|
217
|
-
|
|
394
|
+
Authentication required - see configuration below.
|
|
218
395
|
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _CreateLLMResponse = _interopRequireDefault(require("../model/CreateLLMResponse"));
|
|
9
|
+
var _LLMCreationRequest = _interopRequireDefault(require("../model/LLMCreationRequest"));
|
|
10
|
+
var _LLMResponse = _interopRequireDefault(require("../model/LLMResponse"));
|
|
11
|
+
var _LLMUpdateRequest = _interopRequireDefault(require("../model/LLMUpdateRequest"));
|
|
12
|
+
var _ListLLMsResponse = _interopRequireDefault(require("../model/ListLLMsResponse"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
+
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); } /**
|
|
20
|
+
*
|
|
21
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
22
|
+
*
|
|
23
|
+
* The version of the OpenAPI document:
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
27
|
+
* https://openapi-generator.tech
|
|
28
|
+
* Do not edit the class manually.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* LLMs service.
|
|
33
|
+
* @module api/LLMsApi
|
|
34
|
+
* @version 1.0.0
|
|
35
|
+
*/
|
|
36
|
+
var LLMsApi = exports["default"] = /*#__PURE__*/function () {
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a new LLMsApi.
|
|
39
|
+
* @alias module:api/LLMsApi
|
|
40
|
+
* @class
|
|
41
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
|
42
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
|
43
|
+
*/
|
|
44
|
+
function LLMsApi(apiClient) {
|
|
45
|
+
_classCallCheck(this, LLMsApi);
|
|
46
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Create a new LLM
|
|
51
|
+
* Creates a new LLM configuration for text generation services. LLMs represent connections to different language model API services (like OpenAI, vLLM, etc.) and include all the necessary configuration to use them for text generation. DUPLICATE DETECTION: Returns ALREADY_EXISTS if another LLM exists with identical {endpoint_url, api_path, model_identifier} after URL canonicalization. The api_path field defaults to '/v1/chat/completions' if omitted. Requires CREATE_LLM_OWN permission (or CREATE_LLM_ANY for admin users).
|
|
52
|
+
* @param {module:model/LLMCreationRequest} lLMCreationRequest LLM configuration details
|
|
53
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CreateLLMResponse} and HTTP response
|
|
54
|
+
*/
|
|
55
|
+
return _createClass(LLMsApi, [{
|
|
56
|
+
key: "createLLMWithHttpInfo",
|
|
57
|
+
value: function createLLMWithHttpInfo(lLMCreationRequest) {
|
|
58
|
+
var postBody = lLMCreationRequest;
|
|
59
|
+
// verify the required parameter 'lLMCreationRequest' is set
|
|
60
|
+
if (lLMCreationRequest === undefined || lLMCreationRequest === null) {
|
|
61
|
+
throw new Error("Missing the required parameter 'lLMCreationRequest' when calling createLLM");
|
|
62
|
+
}
|
|
63
|
+
var pathParams = {};
|
|
64
|
+
var queryParams = {};
|
|
65
|
+
var headerParams = {};
|
|
66
|
+
var formParams = {};
|
|
67
|
+
var authNames = [];
|
|
68
|
+
var contentTypes = ['application/json'];
|
|
69
|
+
var accepts = ['application/json'];
|
|
70
|
+
var returnType = _CreateLLMResponse["default"];
|
|
71
|
+
return this.apiClient.callApi('/v1/llms', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Create a new LLM
|
|
76
|
+
* Creates a new LLM configuration for text generation services. LLMs represent connections to different language model API services (like OpenAI, vLLM, etc.) and include all the necessary configuration to use them for text generation. DUPLICATE DETECTION: Returns ALREADY_EXISTS if another LLM exists with identical {endpoint_url, api_path, model_identifier} after URL canonicalization. The api_path field defaults to '/v1/chat/completions' if omitted. Requires CREATE_LLM_OWN permission (or CREATE_LLM_ANY for admin users).
|
|
77
|
+
* @param {module:model/LLMCreationRequest} lLMCreationRequest LLM configuration details
|
|
78
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CreateLLMResponse}
|
|
79
|
+
*/
|
|
80
|
+
}, {
|
|
81
|
+
key: "createLLM",
|
|
82
|
+
value: function createLLM(lLMCreationRequest) {
|
|
83
|
+
return this.createLLMWithHttpInfo(lLMCreationRequest).then(function (response_and_data) {
|
|
84
|
+
return response_and_data.data;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Delete an LLM
|
|
90
|
+
* Permanently deletes an LLM configuration. This operation cannot be undone and removes the LLM record and securely deletes stored credentials. IMPORTANT: This does NOT invalidate or delete any previously generated content using this LLM - existing generations remain accessible. Requires DELETE_LLM_OWN permission for LLMs you own (or DELETE_LLM_ANY for admin users).
|
|
91
|
+
* @param {String} id The unique identifier of the LLM to delete
|
|
92
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
|
93
|
+
*/
|
|
94
|
+
}, {
|
|
95
|
+
key: "deleteLLMWithHttpInfo",
|
|
96
|
+
value: function deleteLLMWithHttpInfo(id) {
|
|
97
|
+
var postBody = null;
|
|
98
|
+
// verify the required parameter 'id' is set
|
|
99
|
+
if (id === undefined || id === null) {
|
|
100
|
+
throw new Error("Missing the required parameter 'id' when calling deleteLLM");
|
|
101
|
+
}
|
|
102
|
+
var pathParams = {
|
|
103
|
+
'id': id
|
|
104
|
+
};
|
|
105
|
+
var queryParams = {};
|
|
106
|
+
var headerParams = {};
|
|
107
|
+
var formParams = {};
|
|
108
|
+
var authNames = [];
|
|
109
|
+
var contentTypes = [];
|
|
110
|
+
var accepts = [];
|
|
111
|
+
var returnType = null;
|
|
112
|
+
return this.apiClient.callApi('/v1/llms/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Delete an LLM
|
|
117
|
+
* Permanently deletes an LLM configuration. This operation cannot be undone and removes the LLM record and securely deletes stored credentials. IMPORTANT: This does NOT invalidate or delete any previously generated content using this LLM - existing generations remain accessible. Requires DELETE_LLM_OWN permission for LLMs you own (or DELETE_LLM_ANY for admin users).
|
|
118
|
+
* @param {String} id The unique identifier of the LLM to delete
|
|
119
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
|
120
|
+
*/
|
|
121
|
+
}, {
|
|
122
|
+
key: "deleteLLM",
|
|
123
|
+
value: function deleteLLM(id) {
|
|
124
|
+
return this.deleteLLMWithHttpInfo(id).then(function (response_and_data) {
|
|
125
|
+
return response_and_data.data;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Get an LLM by ID
|
|
131
|
+
* Retrieves the details of a specific LLM configuration by its unique identifier. Requires READ_LLM_OWN permission for LLMs you own (or READ_LLM_ANY for admin users to view any user's LLMs). This is a read-only operation with no side effects.
|
|
132
|
+
* @param {String} id The unique identifier of the LLM to retrieve
|
|
133
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/LLMResponse} and HTTP response
|
|
134
|
+
*/
|
|
135
|
+
}, {
|
|
136
|
+
key: "getLLMWithHttpInfo",
|
|
137
|
+
value: function getLLMWithHttpInfo(id) {
|
|
138
|
+
var postBody = null;
|
|
139
|
+
// verify the required parameter 'id' is set
|
|
140
|
+
if (id === undefined || id === null) {
|
|
141
|
+
throw new Error("Missing the required parameter 'id' when calling getLLM");
|
|
142
|
+
}
|
|
143
|
+
var pathParams = {
|
|
144
|
+
'id': id
|
|
145
|
+
};
|
|
146
|
+
var queryParams = {};
|
|
147
|
+
var headerParams = {};
|
|
148
|
+
var formParams = {};
|
|
149
|
+
var authNames = [];
|
|
150
|
+
var contentTypes = [];
|
|
151
|
+
var accepts = ['application/json'];
|
|
152
|
+
var returnType = _LLMResponse["default"];
|
|
153
|
+
return this.apiClient.callApi('/v1/llms/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Get an LLM by ID
|
|
158
|
+
* Retrieves the details of a specific LLM configuration by its unique identifier. Requires READ_LLM_OWN permission for LLMs you own (or READ_LLM_ANY for admin users to view any user's LLMs). This is a read-only operation with no side effects.
|
|
159
|
+
* @param {String} id The unique identifier of the LLM to retrieve
|
|
160
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/LLMResponse}
|
|
161
|
+
*/
|
|
162
|
+
}, {
|
|
163
|
+
key: "getLLM",
|
|
164
|
+
value: function getLLM(id) {
|
|
165
|
+
return this.getLLMWithHttpInfo(id).then(function (response_and_data) {
|
|
166
|
+
return response_and_data.data;
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* List LLMs
|
|
172
|
+
* Retrieves a list of LLM configurations accessible to the caller, with optional filtering. PERMISSION-BASED FILTERING: With LIST_LLM_OWN permission, you can only see your own LLMs (owner_id filter is ignored if set to another user). With LIST_LLM_ANY permission, you can see all LLMs or filter by any owner_id. This is a read-only operation with no side effects.
|
|
173
|
+
* @param {Object} opts Optional parameters
|
|
174
|
+
* @param {String} [ownerId] Filter LLMs by owner ID. With LIST_LLM_ANY permission, omitting this shows all accessible LLMs; providing it filters by that owner. With LIST_LLM_OWN permission, only your own LLMs are shown regardless of this parameter.
|
|
175
|
+
* @param {String} [providerType] Filter LLMs by provider type (e.g., OPENAI, VLLM, OLLAMA, etc.)
|
|
176
|
+
* @param {String} [label] Filter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=ai)
|
|
177
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListLLMsResponse} and HTTP response
|
|
178
|
+
*/
|
|
179
|
+
}, {
|
|
180
|
+
key: "listLLMsWithHttpInfo",
|
|
181
|
+
value: function listLLMsWithHttpInfo(opts) {
|
|
182
|
+
opts = opts || {};
|
|
183
|
+
var postBody = null;
|
|
184
|
+
var pathParams = {};
|
|
185
|
+
var queryParams = {
|
|
186
|
+
'owner_id': opts['ownerId'],
|
|
187
|
+
'provider_type': opts['providerType'],
|
|
188
|
+
'label.*': opts['label']
|
|
189
|
+
};
|
|
190
|
+
var headerParams = {};
|
|
191
|
+
var formParams = {};
|
|
192
|
+
var authNames = [];
|
|
193
|
+
var contentTypes = [];
|
|
194
|
+
var accepts = ['application/json'];
|
|
195
|
+
var returnType = _ListLLMsResponse["default"];
|
|
196
|
+
return this.apiClient.callApi('/v1/llms', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* List LLMs
|
|
201
|
+
* Retrieves a list of LLM configurations accessible to the caller, with optional filtering. PERMISSION-BASED FILTERING: With LIST_LLM_OWN permission, you can only see your own LLMs (owner_id filter is ignored if set to another user). With LIST_LLM_ANY permission, you can see all LLMs or filter by any owner_id. This is a read-only operation with no side effects.
|
|
202
|
+
* @param {Object} opts Optional parameters
|
|
203
|
+
* @param {String} opts.ownerId Filter LLMs by owner ID. With LIST_LLM_ANY permission, omitting this shows all accessible LLMs; providing it filters by that owner. With LIST_LLM_OWN permission, only your own LLMs are shown regardless of this parameter.
|
|
204
|
+
* @param {String} opts.providerType Filter LLMs by provider type (e.g., OPENAI, VLLM, OLLAMA, etc.)
|
|
205
|
+
* @param {String} opts.label Filter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=ai)
|
|
206
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListLLMsResponse}
|
|
207
|
+
*/
|
|
208
|
+
}, {
|
|
209
|
+
key: "listLLMs",
|
|
210
|
+
value: function listLLMs(opts) {
|
|
211
|
+
return this.listLLMsWithHttpInfo(opts).then(function (response_and_data) {
|
|
212
|
+
return response_and_data.data;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Update an LLM
|
|
218
|
+
* Updates an existing LLM 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. Requires UPDATE_LLM_OWN permission for LLMs you own (or UPDATE_LLM_ANY for admin users).
|
|
219
|
+
* @param {String} id The unique identifier of the LLM to update
|
|
220
|
+
* @param {module:model/LLMUpdateRequest} lLMUpdateRequest LLM update details
|
|
221
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/LLMResponse} and HTTP response
|
|
222
|
+
*/
|
|
223
|
+
}, {
|
|
224
|
+
key: "updateLLMWithHttpInfo",
|
|
225
|
+
value: function updateLLMWithHttpInfo(id, lLMUpdateRequest) {
|
|
226
|
+
var postBody = lLMUpdateRequest;
|
|
227
|
+
// verify the required parameter 'id' is set
|
|
228
|
+
if (id === undefined || id === null) {
|
|
229
|
+
throw new Error("Missing the required parameter 'id' when calling updateLLM");
|
|
230
|
+
}
|
|
231
|
+
// verify the required parameter 'lLMUpdateRequest' is set
|
|
232
|
+
if (lLMUpdateRequest === undefined || lLMUpdateRequest === null) {
|
|
233
|
+
throw new Error("Missing the required parameter 'lLMUpdateRequest' when calling updateLLM");
|
|
234
|
+
}
|
|
235
|
+
var pathParams = {
|
|
236
|
+
'id': id
|
|
237
|
+
};
|
|
238
|
+
var queryParams = {};
|
|
239
|
+
var headerParams = {};
|
|
240
|
+
var formParams = {};
|
|
241
|
+
var authNames = [];
|
|
242
|
+
var contentTypes = ['application/json'];
|
|
243
|
+
var accepts = ['application/json'];
|
|
244
|
+
var returnType = _LLMResponse["default"];
|
|
245
|
+
return this.apiClient.callApi('/v1/llms/{id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Update an LLM
|
|
250
|
+
* Updates an existing LLM 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. Requires UPDATE_LLM_OWN permission for LLMs you own (or UPDATE_LLM_ANY for admin users).
|
|
251
|
+
* @param {String} id The unique identifier of the LLM to update
|
|
252
|
+
* @param {module:model/LLMUpdateRequest} lLMUpdateRequest LLM update details
|
|
253
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/LLMResponse}
|
|
254
|
+
*/
|
|
255
|
+
}, {
|
|
256
|
+
key: "updateLLM",
|
|
257
|
+
value: function updateLLM(id, lLMUpdateRequest) {
|
|
258
|
+
return this.updateLLMWithHttpInfo(id, lLMUpdateRequest).then(function (response_and_data) {
|
|
259
|
+
return response_and_data.data;
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}]);
|
|
263
|
+
}();
|
package/dist/api/MemoriesApi.js
CHANGED
|
@@ -403,7 +403,7 @@ var MemoriesApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
403
403
|
var contentTypes = [];
|
|
404
404
|
var accepts = ['application/json'];
|
|
405
405
|
var returnType = _RetrieveMemoryEvent["default"];
|
|
406
|
-
return this.apiClient.callApi('/v1/memories
|
|
406
|
+
return this.apiClient.callApi('/v1/memories:retrieve', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
/**
|
|
@@ -453,7 +453,7 @@ var MemoriesApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
453
453
|
var contentTypes = ['application/json'];
|
|
454
454
|
var accepts = ['application/x-ndjson', 'text/event-stream'];
|
|
455
455
|
var returnType = null;
|
|
456
|
-
return this.apiClient.callApi('/v1/memories
|
|
456
|
+
return this.apiClient.callApi('/v1/memories:retrieve', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
457
457
|
}
|
|
458
458
|
|
|
459
459
|
/**
|
package/dist/index.js
CHANGED
|
@@ -81,6 +81,12 @@ Object.defineProperty(exports, "CreateApiKeyResponse", {
|
|
|
81
81
|
return _CreateApiKeyResponse["default"];
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
+
Object.defineProperty(exports, "CreateLLMResponse", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function get() {
|
|
87
|
+
return _CreateLLMResponse["default"];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
84
90
|
Object.defineProperty(exports, "DistributionType", {
|
|
85
91
|
enumerable: true,
|
|
86
92
|
get: function get() {
|
|
@@ -117,6 +123,48 @@ Object.defineProperty(exports, "GoodMemStatus", {
|
|
|
117
123
|
return _GoodMemStatus["default"];
|
|
118
124
|
}
|
|
119
125
|
});
|
|
126
|
+
Object.defineProperty(exports, "LLMCapabilities", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function get() {
|
|
129
|
+
return _LLMCapabilities["default"];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "LLMCreationRequest", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function get() {
|
|
135
|
+
return _LLMCreationRequest["default"];
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "LLMProviderType", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function get() {
|
|
141
|
+
return _LLMProviderType["default"];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "LLMResponse", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function get() {
|
|
147
|
+
return _LLMResponse["default"];
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "LLMSamplingParams", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function get() {
|
|
153
|
+
return _LLMSamplingParams["default"];
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "LLMUpdateRequest", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function get() {
|
|
159
|
+
return _LLMUpdateRequest["default"];
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "LLMsApi", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function get() {
|
|
165
|
+
return _LLMsApi["default"];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
120
168
|
Object.defineProperty(exports, "LengthMeasurement", {
|
|
121
169
|
enumerable: true,
|
|
122
170
|
get: function get() {
|
|
@@ -135,6 +183,12 @@ Object.defineProperty(exports, "ListEmbeddersResponse", {
|
|
|
135
183
|
return _ListEmbeddersResponse["default"];
|
|
136
184
|
}
|
|
137
185
|
});
|
|
186
|
+
Object.defineProperty(exports, "ListLLMsResponse", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function get() {
|
|
189
|
+
return _ListLLMsResponse["default"];
|
|
190
|
+
}
|
|
191
|
+
});
|
|
138
192
|
Object.defineProperty(exports, "ListRerankersResponse", {
|
|
139
193
|
enumerable: true,
|
|
140
194
|
get: function get() {
|
|
@@ -363,14 +417,22 @@ var _ChunkingConfiguration = _interopRequireDefault(require("./model/ChunkingCon
|
|
|
363
417
|
var _ContextItem = _interopRequireDefault(require("./model/ContextItem"));
|
|
364
418
|
var _CreateApiKeyRequest = _interopRequireDefault(require("./model/CreateApiKeyRequest"));
|
|
365
419
|
var _CreateApiKeyResponse = _interopRequireDefault(require("./model/CreateApiKeyResponse"));
|
|
420
|
+
var _CreateLLMResponse = _interopRequireDefault(require("./model/CreateLLMResponse"));
|
|
366
421
|
var _DistributionType = _interopRequireDefault(require("./model/DistributionType"));
|
|
367
422
|
var _EmbedderCreationRequest = _interopRequireDefault(require("./model/EmbedderCreationRequest"));
|
|
368
423
|
var _EmbedderResponse = _interopRequireDefault(require("./model/EmbedderResponse"));
|
|
369
424
|
var _EmbedderWeight = _interopRequireDefault(require("./model/EmbedderWeight"));
|
|
370
425
|
var _GoodMemStatus = _interopRequireDefault(require("./model/GoodMemStatus"));
|
|
426
|
+
var _LLMCapabilities = _interopRequireDefault(require("./model/LLMCapabilities"));
|
|
427
|
+
var _LLMCreationRequest = _interopRequireDefault(require("./model/LLMCreationRequest"));
|
|
428
|
+
var _LLMProviderType = _interopRequireDefault(require("./model/LLMProviderType"));
|
|
429
|
+
var _LLMResponse = _interopRequireDefault(require("./model/LLMResponse"));
|
|
430
|
+
var _LLMSamplingParams = _interopRequireDefault(require("./model/LLMSamplingParams"));
|
|
431
|
+
var _LLMUpdateRequest = _interopRequireDefault(require("./model/LLMUpdateRequest"));
|
|
371
432
|
var _LengthMeasurement = _interopRequireDefault(require("./model/LengthMeasurement"));
|
|
372
433
|
var _ListApiKeysResponse = _interopRequireDefault(require("./model/ListApiKeysResponse"));
|
|
373
434
|
var _ListEmbeddersResponse = _interopRequireDefault(require("./model/ListEmbeddersResponse"));
|
|
435
|
+
var _ListLLMsResponse = _interopRequireDefault(require("./model/ListLLMsResponse"));
|
|
374
436
|
var _ListRerankersResponse = _interopRequireDefault(require("./model/ListRerankersResponse"));
|
|
375
437
|
var _ListSpacesResponse = _interopRequireDefault(require("./model/ListSpacesResponse"));
|
|
376
438
|
var _Memory = _interopRequireDefault(require("./model/Memory"));
|
|
@@ -402,6 +464,7 @@ var _UpdateSpaceRequest = _interopRequireDefault(require("./model/UpdateSpaceReq
|
|
|
402
464
|
var _UserResponse = _interopRequireDefault(require("./model/UserResponse"));
|
|
403
465
|
var _APIKeysApi = _interopRequireDefault(require("./api/APIKeysApi"));
|
|
404
466
|
var _EmbeddersApi = _interopRequireDefault(require("./api/EmbeddersApi"));
|
|
467
|
+
var _LLMsApi = _interopRequireDefault(require("./api/LLMsApi"));
|
|
405
468
|
var _MemoriesApi = _interopRequireDefault(require("./api/MemoriesApi"));
|
|
406
469
|
var _RerankersApi = _interopRequireDefault(require("./api/RerankersApi"));
|
|
407
470
|
var _SpacesApi = _interopRequireDefault(require("./api/SpacesApi"));
|