@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
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
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); }
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
|
+
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); } }
|
|
12
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
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); } /**
|
|
16
|
+
*
|
|
17
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
18
|
+
*
|
|
19
|
+
* The version of the OpenAPI document:
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
23
|
+
* https://openapi-generator.tech
|
|
24
|
+
* Do not edit the class manually.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Enum class LLMProviderType.
|
|
29
|
+
* @enum {}
|
|
30
|
+
* @readonly
|
|
31
|
+
*/
|
|
32
|
+
var LLMProviderType = exports["default"] = /*#__PURE__*/function () {
|
|
33
|
+
function LLMProviderType() {
|
|
34
|
+
_classCallCheck(this, LLMProviderType);
|
|
35
|
+
/**
|
|
36
|
+
* value: "OPENAI"
|
|
37
|
+
* @const
|
|
38
|
+
*/
|
|
39
|
+
_defineProperty(this, "OPENAI", "OPENAI");
|
|
40
|
+
/**
|
|
41
|
+
* value: "LITELLM_PROXY"
|
|
42
|
+
* @const
|
|
43
|
+
*/
|
|
44
|
+
_defineProperty(this, "LITELLM_PROXY", "LITELLM_PROXY");
|
|
45
|
+
/**
|
|
46
|
+
* value: "OPEN_ROUTER"
|
|
47
|
+
* @const
|
|
48
|
+
*/
|
|
49
|
+
_defineProperty(this, "OPEN_ROUTER", "OPEN_ROUTER");
|
|
50
|
+
/**
|
|
51
|
+
* value: "VLLM"
|
|
52
|
+
* @const
|
|
53
|
+
*/
|
|
54
|
+
_defineProperty(this, "VLLM", "VLLM");
|
|
55
|
+
/**
|
|
56
|
+
* value: "OLLAMA"
|
|
57
|
+
* @const
|
|
58
|
+
*/
|
|
59
|
+
_defineProperty(this, "OLLAMA", "OLLAMA");
|
|
60
|
+
/**
|
|
61
|
+
* value: "LLAMA_CPP"
|
|
62
|
+
* @const
|
|
63
|
+
*/
|
|
64
|
+
_defineProperty(this, "LLAMA_CPP", "LLAMA_CPP");
|
|
65
|
+
/**
|
|
66
|
+
* value: "CUSTOM_OPENAI_COMPATIBLE"
|
|
67
|
+
* @const
|
|
68
|
+
*/
|
|
69
|
+
_defineProperty(this, "CUSTOM_OPENAI_COMPATIBLE", "CUSTOM_OPENAI_COMPATIBLE");
|
|
70
|
+
}
|
|
71
|
+
return _createClass(LLMProviderType, null, [{
|
|
72
|
+
key: "constructFromObject",
|
|
73
|
+
value:
|
|
74
|
+
/**
|
|
75
|
+
* Returns a <code>LLMProviderType</code> enum value from a Javascript object name.
|
|
76
|
+
* @param {Object} data The plain JavaScript object containing the name of the enum value.
|
|
77
|
+
* @return {module:model/LLMProviderType} The enum <code>LLMProviderType</code> value.
|
|
78
|
+
*/
|
|
79
|
+
function constructFromObject(object) {
|
|
80
|
+
return object;
|
|
81
|
+
}
|
|
82
|
+
}]);
|
|
83
|
+
}();
|
|
@@ -0,0 +1,366 @@
|
|
|
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 _LLMProviderType = _interopRequireDefault(require("./LLMProviderType"));
|
|
10
|
+
var _LLMSamplingParams = _interopRequireDefault(require("./LLMSamplingParams"));
|
|
11
|
+
var _Modality = _interopRequireDefault(require("./Modality"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
|
+
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); }
|
|
14
|
+
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; } } }; }
|
|
15
|
+
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; } }
|
|
16
|
+
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; }
|
|
17
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
18
|
+
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); } }
|
|
19
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
21
|
+
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); } /**
|
|
22
|
+
*
|
|
23
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
24
|
+
*
|
|
25
|
+
* The version of the OpenAPI document:
|
|
26
|
+
*
|
|
27
|
+
*
|
|
28
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
29
|
+
* https://openapi-generator.tech
|
|
30
|
+
* Do not edit the class manually.
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* The LLMResponse model module.
|
|
35
|
+
* @module model/LLMResponse
|
|
36
|
+
* @version 1.0.0
|
|
37
|
+
*/
|
|
38
|
+
var LLMResponse = /*#__PURE__*/function () {
|
|
39
|
+
/**
|
|
40
|
+
* Constructs a new <code>LLMResponse</code>.
|
|
41
|
+
* LLM configuration information
|
|
42
|
+
* @alias module:model/LLMResponse
|
|
43
|
+
* @param llmId {String} Unique identifier of the LLM
|
|
44
|
+
* @param displayName {String} User-facing name of the LLM
|
|
45
|
+
* @param providerType {module:model/LLMProviderType}
|
|
46
|
+
* @param endpointUrl {String} API endpoint URL
|
|
47
|
+
* @param apiPath {String} API path for chat/completions request
|
|
48
|
+
* @param modelIdentifier {String} Model identifier
|
|
49
|
+
* @param capabilities {module:model/LLMCapabilities}
|
|
50
|
+
* @param ownerId {String} Owner ID of the LLM
|
|
51
|
+
* @param createdAt {Number} Creation timestamp (milliseconds since epoch)
|
|
52
|
+
* @param updatedAt {Number} Last update timestamp (milliseconds since epoch)
|
|
53
|
+
* @param createdById {String} ID of the user who created the LLM
|
|
54
|
+
* @param updatedById {String} ID of the user who last updated the LLM
|
|
55
|
+
*/
|
|
56
|
+
function LLMResponse(llmId, displayName, providerType, endpointUrl, apiPath, modelIdentifier, capabilities, ownerId, createdAt, updatedAt, createdById, updatedById) {
|
|
57
|
+
_classCallCheck(this, LLMResponse);
|
|
58
|
+
LLMResponse.initialize(this, llmId, displayName, providerType, endpointUrl, apiPath, modelIdentifier, capabilities, ownerId, createdAt, updatedAt, createdById, updatedById);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Initializes the fields of this object.
|
|
63
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
64
|
+
* Only for internal use.
|
|
65
|
+
*/
|
|
66
|
+
return _createClass(LLMResponse, null, [{
|
|
67
|
+
key: "initialize",
|
|
68
|
+
value: function initialize(obj, llmId, displayName, providerType, endpointUrl, apiPath, modelIdentifier, capabilities, ownerId, createdAt, updatedAt, createdById, updatedById) {
|
|
69
|
+
obj['llmId'] = llmId;
|
|
70
|
+
obj['displayName'] = displayName;
|
|
71
|
+
obj['providerType'] = providerType;
|
|
72
|
+
obj['endpointUrl'] = endpointUrl;
|
|
73
|
+
obj['apiPath'] = apiPath;
|
|
74
|
+
obj['modelIdentifier'] = modelIdentifier;
|
|
75
|
+
obj['capabilities'] = capabilities;
|
|
76
|
+
obj['ownerId'] = ownerId;
|
|
77
|
+
obj['createdAt'] = createdAt;
|
|
78
|
+
obj['updatedAt'] = updatedAt;
|
|
79
|
+
obj['createdById'] = createdById;
|
|
80
|
+
obj['updatedById'] = updatedById;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Constructs a <code>LLMResponse</code> from a plain JavaScript object, optionally creating a new instance.
|
|
85
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
86
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
87
|
+
* @param {module:model/LLMResponse} obj Optional instance to populate.
|
|
88
|
+
* @return {module:model/LLMResponse} The populated <code>LLMResponse</code> instance.
|
|
89
|
+
*/
|
|
90
|
+
}, {
|
|
91
|
+
key: "constructFromObject",
|
|
92
|
+
value: function constructFromObject(data, obj) {
|
|
93
|
+
if (data) {
|
|
94
|
+
obj = obj || new LLMResponse();
|
|
95
|
+
if (data.hasOwnProperty('llmId')) {
|
|
96
|
+
obj['llmId'] = _ApiClient["default"].convertToType(data['llmId'], 'String');
|
|
97
|
+
}
|
|
98
|
+
if (data.hasOwnProperty('displayName')) {
|
|
99
|
+
obj['displayName'] = _ApiClient["default"].convertToType(data['displayName'], 'String');
|
|
100
|
+
}
|
|
101
|
+
if (data.hasOwnProperty('description')) {
|
|
102
|
+
obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
|
|
103
|
+
}
|
|
104
|
+
if (data.hasOwnProperty('providerType')) {
|
|
105
|
+
obj['providerType'] = _LLMProviderType["default"].constructFromObject(data['providerType']);
|
|
106
|
+
}
|
|
107
|
+
if (data.hasOwnProperty('endpointUrl')) {
|
|
108
|
+
obj['endpointUrl'] = _ApiClient["default"].convertToType(data['endpointUrl'], 'String');
|
|
109
|
+
}
|
|
110
|
+
if (data.hasOwnProperty('apiPath')) {
|
|
111
|
+
obj['apiPath'] = _ApiClient["default"].convertToType(data['apiPath'], 'String');
|
|
112
|
+
}
|
|
113
|
+
if (data.hasOwnProperty('modelIdentifier')) {
|
|
114
|
+
obj['modelIdentifier'] = _ApiClient["default"].convertToType(data['modelIdentifier'], 'String');
|
|
115
|
+
}
|
|
116
|
+
if (data.hasOwnProperty('supportedModalities')) {
|
|
117
|
+
obj['supportedModalities'] = _ApiClient["default"].convertToType(data['supportedModalities'], [_Modality["default"]]);
|
|
118
|
+
}
|
|
119
|
+
if (data.hasOwnProperty('labels')) {
|
|
120
|
+
obj['labels'] = _ApiClient["default"].convertToType(data['labels'], {
|
|
121
|
+
'String': 'String'
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if (data.hasOwnProperty('version')) {
|
|
125
|
+
obj['version'] = _ApiClient["default"].convertToType(data['version'], 'String');
|
|
126
|
+
}
|
|
127
|
+
if (data.hasOwnProperty('monitoringEndpoint')) {
|
|
128
|
+
obj['monitoringEndpoint'] = _ApiClient["default"].convertToType(data['monitoringEndpoint'], 'String');
|
|
129
|
+
}
|
|
130
|
+
if (data.hasOwnProperty('capabilities')) {
|
|
131
|
+
obj['capabilities'] = _LLMCapabilities["default"].constructFromObject(data['capabilities']);
|
|
132
|
+
}
|
|
133
|
+
if (data.hasOwnProperty('defaultSamplingParams')) {
|
|
134
|
+
obj['defaultSamplingParams'] = _LLMSamplingParams["default"].constructFromObject(data['defaultSamplingParams']);
|
|
135
|
+
}
|
|
136
|
+
if (data.hasOwnProperty('maxContextLength')) {
|
|
137
|
+
obj['maxContextLength'] = _ApiClient["default"].convertToType(data['maxContextLength'], 'Number');
|
|
138
|
+
}
|
|
139
|
+
if (data.hasOwnProperty('clientConfig')) {
|
|
140
|
+
obj['clientConfig'] = _ApiClient["default"].convertToType(data['clientConfig'], {
|
|
141
|
+
'String': Object
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
if (data.hasOwnProperty('ownerId')) {
|
|
145
|
+
obj['ownerId'] = _ApiClient["default"].convertToType(data['ownerId'], 'String');
|
|
146
|
+
}
|
|
147
|
+
if (data.hasOwnProperty('createdAt')) {
|
|
148
|
+
obj['createdAt'] = _ApiClient["default"].convertToType(data['createdAt'], 'Number');
|
|
149
|
+
}
|
|
150
|
+
if (data.hasOwnProperty('updatedAt')) {
|
|
151
|
+
obj['updatedAt'] = _ApiClient["default"].convertToType(data['updatedAt'], 'Number');
|
|
152
|
+
}
|
|
153
|
+
if (data.hasOwnProperty('createdById')) {
|
|
154
|
+
obj['createdById'] = _ApiClient["default"].convertToType(data['createdById'], 'String');
|
|
155
|
+
}
|
|
156
|
+
if (data.hasOwnProperty('updatedById')) {
|
|
157
|
+
obj['updatedById'] = _ApiClient["default"].convertToType(data['updatedById'], 'String');
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return obj;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Validates the JSON data with respect to <code>LLMResponse</code>.
|
|
165
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
166
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>LLMResponse</code>.
|
|
167
|
+
*/
|
|
168
|
+
}, {
|
|
169
|
+
key: "validateJSON",
|
|
170
|
+
value: function validateJSON(data) {
|
|
171
|
+
// check to make sure all required properties are present in the JSON string
|
|
172
|
+
var _iterator = _createForOfIteratorHelper(LLMResponse.RequiredProperties),
|
|
173
|
+
_step;
|
|
174
|
+
try {
|
|
175
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
176
|
+
var property = _step.value;
|
|
177
|
+
if (!data.hasOwnProperty(property)) {
|
|
178
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// ensure the json data is a string
|
|
182
|
+
} catch (err) {
|
|
183
|
+
_iterator.e(err);
|
|
184
|
+
} finally {
|
|
185
|
+
_iterator.f();
|
|
186
|
+
}
|
|
187
|
+
if (data['llmId'] && !(typeof data['llmId'] === 'string' || data['llmId'] instanceof String)) {
|
|
188
|
+
throw new Error("Expected the field `llmId` to be a primitive type in the JSON string but got " + data['llmId']);
|
|
189
|
+
}
|
|
190
|
+
// ensure the json data is a string
|
|
191
|
+
if (data['displayName'] && !(typeof data['displayName'] === 'string' || data['displayName'] instanceof String)) {
|
|
192
|
+
throw new Error("Expected the field `displayName` to be a primitive type in the JSON string but got " + data['displayName']);
|
|
193
|
+
}
|
|
194
|
+
// ensure the json data is a string
|
|
195
|
+
if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
|
|
196
|
+
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
|
|
197
|
+
}
|
|
198
|
+
// ensure the json data is a string
|
|
199
|
+
if (data['endpointUrl'] && !(typeof data['endpointUrl'] === 'string' || data['endpointUrl'] instanceof String)) {
|
|
200
|
+
throw new Error("Expected the field `endpointUrl` to be a primitive type in the JSON string but got " + data['endpointUrl']);
|
|
201
|
+
}
|
|
202
|
+
// ensure the json data is a string
|
|
203
|
+
if (data['apiPath'] && !(typeof data['apiPath'] === 'string' || data['apiPath'] instanceof String)) {
|
|
204
|
+
throw new Error("Expected the field `apiPath` to be a primitive type in the JSON string but got " + data['apiPath']);
|
|
205
|
+
}
|
|
206
|
+
// ensure the json data is a string
|
|
207
|
+
if (data['modelIdentifier'] && !(typeof data['modelIdentifier'] === 'string' || data['modelIdentifier'] instanceof String)) {
|
|
208
|
+
throw new Error("Expected the field `modelIdentifier` to be a primitive type in the JSON string but got " + data['modelIdentifier']);
|
|
209
|
+
}
|
|
210
|
+
// ensure the json data is an array
|
|
211
|
+
if (!Array.isArray(data['supportedModalities'])) {
|
|
212
|
+
throw new Error("Expected the field `supportedModalities` to be an array in the JSON data but got " + data['supportedModalities']);
|
|
213
|
+
}
|
|
214
|
+
// ensure the json data is a string
|
|
215
|
+
if (data['version'] && !(typeof data['version'] === 'string' || data['version'] instanceof String)) {
|
|
216
|
+
throw new Error("Expected the field `version` to be a primitive type in the JSON string but got " + data['version']);
|
|
217
|
+
}
|
|
218
|
+
// ensure the json data is a string
|
|
219
|
+
if (data['monitoringEndpoint'] && !(typeof data['monitoringEndpoint'] === 'string' || data['monitoringEndpoint'] instanceof String)) {
|
|
220
|
+
throw new Error("Expected the field `monitoringEndpoint` to be a primitive type in the JSON string but got " + data['monitoringEndpoint']);
|
|
221
|
+
}
|
|
222
|
+
// validate the optional field `capabilities`
|
|
223
|
+
if (data['capabilities']) {
|
|
224
|
+
// data not null
|
|
225
|
+
_LLMCapabilities["default"].validateJSON(data['capabilities']);
|
|
226
|
+
}
|
|
227
|
+
// validate the optional field `defaultSamplingParams`
|
|
228
|
+
if (data['defaultSamplingParams']) {
|
|
229
|
+
// data not null
|
|
230
|
+
_LLMSamplingParams["default"].validateJSON(data['defaultSamplingParams']);
|
|
231
|
+
}
|
|
232
|
+
// ensure the json data is a string
|
|
233
|
+
if (data['ownerId'] && !(typeof data['ownerId'] === 'string' || data['ownerId'] instanceof String)) {
|
|
234
|
+
throw new Error("Expected the field `ownerId` to be a primitive type in the JSON string but got " + data['ownerId']);
|
|
235
|
+
}
|
|
236
|
+
// ensure the json data is a string
|
|
237
|
+
if (data['createdById'] && !(typeof data['createdById'] === 'string' || data['createdById'] instanceof String)) {
|
|
238
|
+
throw new Error("Expected the field `createdById` to be a primitive type in the JSON string but got " + data['createdById']);
|
|
239
|
+
}
|
|
240
|
+
// ensure the json data is a string
|
|
241
|
+
if (data['updatedById'] && !(typeof data['updatedById'] === 'string' || data['updatedById'] instanceof String)) {
|
|
242
|
+
throw new Error("Expected the field `updatedById` to be a primitive type in the JSON string but got " + data['updatedById']);
|
|
243
|
+
}
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
}]);
|
|
247
|
+
}();
|
|
248
|
+
LLMResponse.RequiredProperties = ["llmId", "displayName", "providerType", "endpointUrl", "apiPath", "modelIdentifier", "capabilities", "ownerId", "createdAt", "updatedAt", "createdById", "updatedById"];
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Unique identifier of the LLM
|
|
252
|
+
* @member {String} llmId
|
|
253
|
+
*/
|
|
254
|
+
LLMResponse.prototype['llmId'] = undefined;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* User-facing name of the LLM
|
|
258
|
+
* @member {String} displayName
|
|
259
|
+
*/
|
|
260
|
+
LLMResponse.prototype['displayName'] = undefined;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Description of the LLM
|
|
264
|
+
* @member {String} description
|
|
265
|
+
*/
|
|
266
|
+
LLMResponse.prototype['description'] = undefined;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* @member {module:model/LLMProviderType} providerType
|
|
270
|
+
*/
|
|
271
|
+
LLMResponse.prototype['providerType'] = undefined;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* API endpoint URL
|
|
275
|
+
* @member {String} endpointUrl
|
|
276
|
+
*/
|
|
277
|
+
LLMResponse.prototype['endpointUrl'] = undefined;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* API path for chat/completions request
|
|
281
|
+
* @member {String} apiPath
|
|
282
|
+
*/
|
|
283
|
+
LLMResponse.prototype['apiPath'] = undefined;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Model identifier
|
|
287
|
+
* @member {String} modelIdentifier
|
|
288
|
+
*/
|
|
289
|
+
LLMResponse.prototype['modelIdentifier'] = undefined;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Supported content modalities
|
|
293
|
+
* @member {Array.<module:model/Modality>} supportedModalities
|
|
294
|
+
*/
|
|
295
|
+
LLMResponse.prototype['supportedModalities'] = undefined;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* User-defined labels for categorization
|
|
299
|
+
* @member {Object.<String, String>} labels
|
|
300
|
+
*/
|
|
301
|
+
LLMResponse.prototype['labels'] = undefined;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Version information
|
|
305
|
+
* @member {String} version
|
|
306
|
+
*/
|
|
307
|
+
LLMResponse.prototype['version'] = undefined;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Monitoring endpoint URL
|
|
311
|
+
* @member {String} monitoringEndpoint
|
|
312
|
+
*/
|
|
313
|
+
LLMResponse.prototype['monitoringEndpoint'] = undefined;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* @member {module:model/LLMCapabilities} capabilities
|
|
317
|
+
*/
|
|
318
|
+
LLMResponse.prototype['capabilities'] = undefined;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* @member {module:model/LLMSamplingParams} defaultSamplingParams
|
|
322
|
+
*/
|
|
323
|
+
LLMResponse.prototype['defaultSamplingParams'] = undefined;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Maximum context window size in tokens
|
|
327
|
+
* @member {Number} maxContextLength
|
|
328
|
+
*/
|
|
329
|
+
LLMResponse.prototype['maxContextLength'] = undefined;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Provider-specific client configuration
|
|
333
|
+
* @member {Object.<String, Object>} clientConfig
|
|
334
|
+
*/
|
|
335
|
+
LLMResponse.prototype['clientConfig'] = undefined;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Owner ID of the LLM
|
|
339
|
+
* @member {String} ownerId
|
|
340
|
+
*/
|
|
341
|
+
LLMResponse.prototype['ownerId'] = undefined;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Creation timestamp (milliseconds since epoch)
|
|
345
|
+
* @member {Number} createdAt
|
|
346
|
+
*/
|
|
347
|
+
LLMResponse.prototype['createdAt'] = undefined;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Last update timestamp (milliseconds since epoch)
|
|
351
|
+
* @member {Number} updatedAt
|
|
352
|
+
*/
|
|
353
|
+
LLMResponse.prototype['updatedAt'] = undefined;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* ID of the user who created the LLM
|
|
357
|
+
* @member {String} createdById
|
|
358
|
+
*/
|
|
359
|
+
LLMResponse.prototype['createdById'] = undefined;
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* ID of the user who last updated the LLM
|
|
363
|
+
* @member {String} updatedById
|
|
364
|
+
*/
|
|
365
|
+
LLMResponse.prototype['updatedById'] = undefined;
|
|
366
|
+
var _default = exports["default"] = LLMResponse;
|
|
@@ -0,0 +1,145 @@
|
|
|
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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
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); }
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
|
+
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); } }
|
|
12
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
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); } /**
|
|
15
|
+
*
|
|
16
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
17
|
+
*
|
|
18
|
+
* The version of the OpenAPI document:
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
22
|
+
* https://openapi-generator.tech
|
|
23
|
+
* Do not edit the class manually.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The LLMSamplingParams model module.
|
|
28
|
+
* @module model/LLMSamplingParams
|
|
29
|
+
* @version 1.0.0
|
|
30
|
+
*/
|
|
31
|
+
var LLMSamplingParams = /*#__PURE__*/function () {
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new <code>LLMSamplingParams</code>.
|
|
34
|
+
* Sampling and generation parameters for controlling LLM text output
|
|
35
|
+
* @alias module:model/LLMSamplingParams
|
|
36
|
+
*/
|
|
37
|
+
function LLMSamplingParams() {
|
|
38
|
+
_classCallCheck(this, LLMSamplingParams);
|
|
39
|
+
LLMSamplingParams.initialize(this);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Initializes the fields of this object.
|
|
44
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
45
|
+
* Only for internal use.
|
|
46
|
+
*/
|
|
47
|
+
return _createClass(LLMSamplingParams, null, [{
|
|
48
|
+
key: "initialize",
|
|
49
|
+
value: function initialize(obj) {}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Constructs a <code>LLMSamplingParams</code> from a plain JavaScript object, optionally creating a new instance.
|
|
53
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
54
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
55
|
+
* @param {module:model/LLMSamplingParams} obj Optional instance to populate.
|
|
56
|
+
* @return {module:model/LLMSamplingParams} The populated <code>LLMSamplingParams</code> instance.
|
|
57
|
+
*/
|
|
58
|
+
}, {
|
|
59
|
+
key: "constructFromObject",
|
|
60
|
+
value: function constructFromObject(data, obj) {
|
|
61
|
+
if (data) {
|
|
62
|
+
obj = obj || new LLMSamplingParams();
|
|
63
|
+
if (data.hasOwnProperty('maxTokens')) {
|
|
64
|
+
obj['maxTokens'] = _ApiClient["default"].convertToType(data['maxTokens'], 'Number');
|
|
65
|
+
}
|
|
66
|
+
if (data.hasOwnProperty('temperature')) {
|
|
67
|
+
obj['temperature'] = _ApiClient["default"].convertToType(data['temperature'], 'Number');
|
|
68
|
+
}
|
|
69
|
+
if (data.hasOwnProperty('topP')) {
|
|
70
|
+
obj['topP'] = _ApiClient["default"].convertToType(data['topP'], 'Number');
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('topK')) {
|
|
73
|
+
obj['topK'] = _ApiClient["default"].convertToType(data['topK'], 'Number');
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('frequencyPenalty')) {
|
|
76
|
+
obj['frequencyPenalty'] = _ApiClient["default"].convertToType(data['frequencyPenalty'], 'Number');
|
|
77
|
+
}
|
|
78
|
+
if (data.hasOwnProperty('presencePenalty')) {
|
|
79
|
+
obj['presencePenalty'] = _ApiClient["default"].convertToType(data['presencePenalty'], 'Number');
|
|
80
|
+
}
|
|
81
|
+
if (data.hasOwnProperty('stopSequences')) {
|
|
82
|
+
obj['stopSequences'] = _ApiClient["default"].convertToType(data['stopSequences'], ['String']);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return obj;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Validates the JSON data with respect to <code>LLMSamplingParams</code>.
|
|
90
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
91
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>LLMSamplingParams</code>.
|
|
92
|
+
*/
|
|
93
|
+
}, {
|
|
94
|
+
key: "validateJSON",
|
|
95
|
+
value: function validateJSON(data) {
|
|
96
|
+
// ensure the json data is an array
|
|
97
|
+
if (!Array.isArray(data['stopSequences'])) {
|
|
98
|
+
throw new Error("Expected the field `stopSequences` to be an array in the JSON data but got " + data['stopSequences']);
|
|
99
|
+
}
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
}]);
|
|
103
|
+
}();
|
|
104
|
+
/**
|
|
105
|
+
* Maximum tokens to generate (>0 if set; provider-dependent limits apply)
|
|
106
|
+
* @member {Number} maxTokens
|
|
107
|
+
*/
|
|
108
|
+
LLMSamplingParams.prototype['maxTokens'] = undefined;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Sampling temperature 0.0-2.0 (0.0=deterministic, 2.0=highly random)
|
|
112
|
+
* @member {Number} temperature
|
|
113
|
+
*/
|
|
114
|
+
LLMSamplingParams.prototype['temperature'] = undefined;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Nucleus sampling threshold 0.0-1.0 (smaller values focus on higher probability tokens)
|
|
118
|
+
* @member {Number} topP
|
|
119
|
+
*/
|
|
120
|
+
LLMSamplingParams.prototype['topP'] = undefined;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Top-k sampling limit (>0 if set; primarily for local/open-source models)
|
|
124
|
+
* @member {Number} topK
|
|
125
|
+
*/
|
|
126
|
+
LLMSamplingParams.prototype['topK'] = undefined;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Frequency penalty -2.0 to 2.0 (positive values reduce repetition based on frequency)
|
|
130
|
+
* @member {Number} frequencyPenalty
|
|
131
|
+
*/
|
|
132
|
+
LLMSamplingParams.prototype['frequencyPenalty'] = undefined;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Presence penalty -2.0 to 2.0 (positive values encourage topic diversity)
|
|
136
|
+
* @member {Number} presencePenalty
|
|
137
|
+
*/
|
|
138
|
+
LLMSamplingParams.prototype['presencePenalty'] = undefined;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Generation stop sequences (≤10 sequences; each ≤100 chars; generation halts on exact match)
|
|
142
|
+
* @member {Array.<String>} stopSequences
|
|
143
|
+
*/
|
|
144
|
+
LLMSamplingParams.prototype['stopSequences'] = undefined;
|
|
145
|
+
var _default = exports["default"] = LLMSamplingParams;
|