@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.
@@ -0,0 +1,274 @@
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 _LLMCapabilities = _interopRequireDefault(require("./LLMCapabilities"));
9
+ var _LLMSamplingParams = _interopRequireDefault(require("./LLMSamplingParams"));
10
+ var _Modality = _interopRequireDefault(require("./Modality"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12
+ 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); }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ 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); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ 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); } /**
18
+ *
19
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
20
+ *
21
+ * The version of the OpenAPI document:
22
+ *
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The LLMUpdateRequest model module.
31
+ * @module model/LLMUpdateRequest
32
+ * @version 1.0.0
33
+ */
34
+ var LLMUpdateRequest = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>LLMUpdateRequest</code>.
37
+ * Request body for updating an existing LLM. All fields are optional - only specified fields will be updated.
38
+ * @alias module:model/LLMUpdateRequest
39
+ */
40
+ function LLMUpdateRequest() {
41
+ _classCallCheck(this, LLMUpdateRequest);
42
+ LLMUpdateRequest.initialize(this);
43
+ }
44
+
45
+ /**
46
+ * Initializes the fields of this object.
47
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
48
+ * Only for internal use.
49
+ */
50
+ return _createClass(LLMUpdateRequest, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj) {}
53
+
54
+ /**
55
+ * Constructs a <code>LLMUpdateRequest</code> from a plain JavaScript object, optionally creating a new instance.
56
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
57
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
58
+ * @param {module:model/LLMUpdateRequest} obj Optional instance to populate.
59
+ * @return {module:model/LLMUpdateRequest} The populated <code>LLMUpdateRequest</code> instance.
60
+ */
61
+ }, {
62
+ key: "constructFromObject",
63
+ value: function constructFromObject(data, obj) {
64
+ if (data) {
65
+ obj = obj || new LLMUpdateRequest();
66
+ if (data.hasOwnProperty('validate')) {
67
+ obj['validate'] = _ApiClient["default"].convertToType(data['validate'], Object);
68
+ }
69
+ if (data.hasOwnProperty('displayName')) {
70
+ obj['displayName'] = _ApiClient["default"].convertToType(data['displayName'], 'String');
71
+ }
72
+ if (data.hasOwnProperty('description')) {
73
+ obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
74
+ }
75
+ if (data.hasOwnProperty('endpointUrl')) {
76
+ obj['endpointUrl'] = _ApiClient["default"].convertToType(data['endpointUrl'], 'String');
77
+ }
78
+ if (data.hasOwnProperty('apiPath')) {
79
+ obj['apiPath'] = _ApiClient["default"].convertToType(data['apiPath'], 'String');
80
+ }
81
+ if (data.hasOwnProperty('modelIdentifier')) {
82
+ obj['modelIdentifier'] = _ApiClient["default"].convertToType(data['modelIdentifier'], 'String');
83
+ }
84
+ if (data.hasOwnProperty('supportedModalities')) {
85
+ obj['supportedModalities'] = _ApiClient["default"].convertToType(data['supportedModalities'], [_Modality["default"]]);
86
+ }
87
+ if (data.hasOwnProperty('credentials')) {
88
+ obj['credentials'] = _ApiClient["default"].convertToType(data['credentials'], 'String');
89
+ }
90
+ if (data.hasOwnProperty('version')) {
91
+ obj['version'] = _ApiClient["default"].convertToType(data['version'], 'String');
92
+ }
93
+ if (data.hasOwnProperty('monitoringEndpoint')) {
94
+ obj['monitoringEndpoint'] = _ApiClient["default"].convertToType(data['monitoringEndpoint'], 'String');
95
+ }
96
+ if (data.hasOwnProperty('capabilities')) {
97
+ obj['capabilities'] = _LLMCapabilities["default"].constructFromObject(data['capabilities']);
98
+ }
99
+ if (data.hasOwnProperty('defaultSamplingParams')) {
100
+ obj['defaultSamplingParams'] = _LLMSamplingParams["default"].constructFromObject(data['defaultSamplingParams']);
101
+ }
102
+ if (data.hasOwnProperty('maxContextLength')) {
103
+ obj['maxContextLength'] = _ApiClient["default"].convertToType(data['maxContextLength'], 'Number');
104
+ }
105
+ if (data.hasOwnProperty('clientConfig')) {
106
+ obj['clientConfig'] = _ApiClient["default"].convertToType(data['clientConfig'], {
107
+ 'String': Object
108
+ });
109
+ }
110
+ if (data.hasOwnProperty('replaceLabels')) {
111
+ obj['replaceLabels'] = _ApiClient["default"].convertToType(data['replaceLabels'], {
112
+ 'String': 'String'
113
+ });
114
+ }
115
+ if (data.hasOwnProperty('mergeLabels')) {
116
+ obj['mergeLabels'] = _ApiClient["default"].convertToType(data['mergeLabels'], {
117
+ 'String': 'String'
118
+ });
119
+ }
120
+ }
121
+ return obj;
122
+ }
123
+
124
+ /**
125
+ * Validates the JSON data with respect to <code>LLMUpdateRequest</code>.
126
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
127
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>LLMUpdateRequest</code>.
128
+ */
129
+ }, {
130
+ key: "validateJSON",
131
+ value: function validateJSON(data) {
132
+ // ensure the json data is a string
133
+ if (data['displayName'] && !(typeof data['displayName'] === 'string' || data['displayName'] instanceof String)) {
134
+ throw new Error("Expected the field `displayName` to be a primitive type in the JSON string but got " + data['displayName']);
135
+ }
136
+ // ensure the json data is a string
137
+ if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
138
+ throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
139
+ }
140
+ // ensure the json data is a string
141
+ if (data['endpointUrl'] && !(typeof data['endpointUrl'] === 'string' || data['endpointUrl'] instanceof String)) {
142
+ throw new Error("Expected the field `endpointUrl` to be a primitive type in the JSON string but got " + data['endpointUrl']);
143
+ }
144
+ // ensure the json data is a string
145
+ if (data['apiPath'] && !(typeof data['apiPath'] === 'string' || data['apiPath'] instanceof String)) {
146
+ throw new Error("Expected the field `apiPath` to be a primitive type in the JSON string but got " + data['apiPath']);
147
+ }
148
+ // ensure the json data is a string
149
+ if (data['modelIdentifier'] && !(typeof data['modelIdentifier'] === 'string' || data['modelIdentifier'] instanceof String)) {
150
+ throw new Error("Expected the field `modelIdentifier` to be a primitive type in the JSON string but got " + data['modelIdentifier']);
151
+ }
152
+ // ensure the json data is an array
153
+ if (!Array.isArray(data['supportedModalities'])) {
154
+ throw new Error("Expected the field `supportedModalities` to be an array in the JSON data but got " + data['supportedModalities']);
155
+ }
156
+ // ensure the json data is a string
157
+ if (data['credentials'] && !(typeof data['credentials'] === 'string' || data['credentials'] instanceof String)) {
158
+ throw new Error("Expected the field `credentials` to be a primitive type in the JSON string but got " + data['credentials']);
159
+ }
160
+ // ensure the json data is a string
161
+ if (data['version'] && !(typeof data['version'] === 'string' || data['version'] instanceof String)) {
162
+ throw new Error("Expected the field `version` to be a primitive type in the JSON string but got " + data['version']);
163
+ }
164
+ // ensure the json data is a string
165
+ if (data['monitoringEndpoint'] && !(typeof data['monitoringEndpoint'] === 'string' || data['monitoringEndpoint'] instanceof String)) {
166
+ throw new Error("Expected the field `monitoringEndpoint` to be a primitive type in the JSON string but got " + data['monitoringEndpoint']);
167
+ }
168
+ // validate the optional field `capabilities`
169
+ if (data['capabilities']) {
170
+ // data not null
171
+ _LLMCapabilities["default"].validateJSON(data['capabilities']);
172
+ }
173
+ // validate the optional field `defaultSamplingParams`
174
+ if (data['defaultSamplingParams']) {
175
+ // data not null
176
+ _LLMSamplingParams["default"].validateJSON(data['defaultSamplingParams']);
177
+ }
178
+ return true;
179
+ }
180
+ }]);
181
+ }();
182
+ /**
183
+ * @member {Object} validate
184
+ */
185
+ LLMUpdateRequest.prototype['validate'] = undefined;
186
+
187
+ /**
188
+ * Update display name
189
+ * @member {String} displayName
190
+ */
191
+ LLMUpdateRequest.prototype['displayName'] = undefined;
192
+
193
+ /**
194
+ * Update description
195
+ * @member {String} description
196
+ */
197
+ LLMUpdateRequest.prototype['description'] = undefined;
198
+
199
+ /**
200
+ * Update endpoint URL (must be valid HTTP/HTTPS URL)
201
+ * @member {String} endpointUrl
202
+ */
203
+ LLMUpdateRequest.prototype['endpointUrl'] = undefined;
204
+
205
+ /**
206
+ * Update API path
207
+ * @member {String} apiPath
208
+ */
209
+ LLMUpdateRequest.prototype['apiPath'] = undefined;
210
+
211
+ /**
212
+ * Update model identifier (cannot be empty)
213
+ * @member {String} modelIdentifier
214
+ */
215
+ LLMUpdateRequest.prototype['modelIdentifier'] = undefined;
216
+
217
+ /**
218
+ * Update supported modalities (if array contains ≥1 elements, replaces stored set; if empty or omitted, no change)
219
+ * @member {Array.<module:model/Modality>} supportedModalities
220
+ */
221
+ LLMUpdateRequest.prototype['supportedModalities'] = undefined;
222
+
223
+ /**
224
+ * Update credentials (will be encrypted at rest)
225
+ * @member {String} credentials
226
+ */
227
+ LLMUpdateRequest.prototype['credentials'] = undefined;
228
+
229
+ /**
230
+ * Update version information
231
+ * @member {String} version
232
+ */
233
+ LLMUpdateRequest.prototype['version'] = undefined;
234
+
235
+ /**
236
+ * Update monitoring endpoint URL
237
+ * @member {String} monitoringEndpoint
238
+ */
239
+ LLMUpdateRequest.prototype['monitoringEndpoint'] = undefined;
240
+
241
+ /**
242
+ * @member {module:model/LLMCapabilities} capabilities
243
+ */
244
+ LLMUpdateRequest.prototype['capabilities'] = undefined;
245
+
246
+ /**
247
+ * @member {module:model/LLMSamplingParams} defaultSamplingParams
248
+ */
249
+ LLMUpdateRequest.prototype['defaultSamplingParams'] = undefined;
250
+
251
+ /**
252
+ * Update maximum context window size in tokens
253
+ * @member {Number} maxContextLength
254
+ */
255
+ LLMUpdateRequest.prototype['maxContextLength'] = undefined;
256
+
257
+ /**
258
+ * Update provider-specific client configuration (replaces entire config; no merging)
259
+ * @member {Object.<String, Object>} clientConfig
260
+ */
261
+ LLMUpdateRequest.prototype['clientConfig'] = undefined;
262
+
263
+ /**
264
+ * Replace all existing labels with this set. Empty map clears all labels. Cannot be used with mergeLabels.
265
+ * @member {Object.<String, String>} replaceLabels
266
+ */
267
+ LLMUpdateRequest.prototype['replaceLabels'] = undefined;
268
+
269
+ /**
270
+ * Merge with existing labels: upserts with overwrite. Labels not mentioned are preserved. Cannot be used with replaceLabels.
271
+ * @member {Object.<String, String>} mergeLabels
272
+ */
273
+ LLMUpdateRequest.prototype['mergeLabels'] = undefined;
274
+ var _default = exports["default"] = LLMUpdateRequest;
@@ -0,0 +1,132 @@
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 _LLMResponse = _interopRequireDefault(require("./LLMResponse"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ 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); }
11
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ 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); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
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
+ *
20
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
21
+ *
22
+ * The version of the OpenAPI document:
23
+ *
24
+ *
25
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
+ * https://openapi-generator.tech
27
+ * Do not edit the class manually.
28
+ *
29
+ */
30
+ /**
31
+ * The ListLLMsResponse model module.
32
+ * @module model/ListLLMsResponse
33
+ * @version 1.0.0
34
+ */
35
+ var ListLLMsResponse = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new <code>ListLLMsResponse</code>.
38
+ * Response containing a list of LLM configurations
39
+ * @alias module:model/ListLLMsResponse
40
+ * @param llms {Array.<module:model/LLMResponse>} List of LLM configurations matching the request filters
41
+ */
42
+ function ListLLMsResponse(llms) {
43
+ _classCallCheck(this, ListLLMsResponse);
44
+ ListLLMsResponse.initialize(this, llms);
45
+ }
46
+
47
+ /**
48
+ * Initializes the fields of this object.
49
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
50
+ * Only for internal use.
51
+ */
52
+ return _createClass(ListLLMsResponse, null, [{
53
+ key: "initialize",
54
+ value: function initialize(obj, llms) {
55
+ obj['llms'] = llms;
56
+ }
57
+
58
+ /**
59
+ * Constructs a <code>ListLLMsResponse</code> from a plain JavaScript object, optionally creating a new instance.
60
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
61
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
62
+ * @param {module:model/ListLLMsResponse} obj Optional instance to populate.
63
+ * @return {module:model/ListLLMsResponse} The populated <code>ListLLMsResponse</code> instance.
64
+ */
65
+ }, {
66
+ key: "constructFromObject",
67
+ value: function constructFromObject(data, obj) {
68
+ if (data) {
69
+ obj = obj || new ListLLMsResponse();
70
+ if (data.hasOwnProperty('llms')) {
71
+ obj['llms'] = _ApiClient["default"].convertToType(data['llms'], [_LLMResponse["default"]]);
72
+ }
73
+ }
74
+ return obj;
75
+ }
76
+
77
+ /**
78
+ * Validates the JSON data with respect to <code>ListLLMsResponse</code>.
79
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
80
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ListLLMsResponse</code>.
81
+ */
82
+ }, {
83
+ key: "validateJSON",
84
+ value: function validateJSON(data) {
85
+ // check to make sure all required properties are present in the JSON string
86
+ var _iterator = _createForOfIteratorHelper(ListLLMsResponse.RequiredProperties),
87
+ _step;
88
+ try {
89
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
90
+ var property = _step.value;
91
+ if (!data.hasOwnProperty(property)) {
92
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
93
+ }
94
+ }
95
+ } catch (err) {
96
+ _iterator.e(err);
97
+ } finally {
98
+ _iterator.f();
99
+ }
100
+ if (data['llms']) {
101
+ // data not null
102
+ // ensure the json data is an array
103
+ if (!Array.isArray(data['llms'])) {
104
+ throw new Error("Expected the field `llms` to be an array in the JSON data but got " + data['llms']);
105
+ }
106
+ // validate the optional field `llms` (array)
107
+ var _iterator2 = _createForOfIteratorHelper(data['llms']),
108
+ _step2;
109
+ try {
110
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
111
+ var item = _step2.value;
112
+ _LLMResponse["default"].validateJSON(item);
113
+ }
114
+ } catch (err) {
115
+ _iterator2.e(err);
116
+ } finally {
117
+ _iterator2.f();
118
+ }
119
+ ;
120
+ }
121
+ return true;
122
+ }
123
+ }]);
124
+ }();
125
+ ListLLMsResponse.RequiredProperties = ["llms"];
126
+
127
+ /**
128
+ * List of LLM configurations matching the request filters
129
+ * @member {Array.<module:model/LLMResponse>} llms
130
+ */
131
+ ListLLMsResponse.prototype['llms'] = undefined;
132
+ var _default = exports["default"] = ListLLMsResponse;