@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,146 @@
|
|
|
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 _GoodMemStatus = _interopRequireDefault(require("./GoodMemStatus"));
|
|
9
|
+
var _LLMResponse = _interopRequireDefault(require("./LLMResponse"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
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); }
|
|
12
|
+
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; } } }; }
|
|
13
|
+
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; } }
|
|
14
|
+
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; }
|
|
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
|
+
* The CreateLLMResponse model module.
|
|
33
|
+
* @module model/CreateLLMResponse
|
|
34
|
+
* @version 1.0.0
|
|
35
|
+
*/
|
|
36
|
+
var CreateLLMResponse = /*#__PURE__*/function () {
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a new <code>CreateLLMResponse</code>.
|
|
39
|
+
* Response containing the created LLM and any informational status messages
|
|
40
|
+
* @alias module:model/CreateLLMResponse
|
|
41
|
+
* @param llm {module:model/LLMResponse}
|
|
42
|
+
*/
|
|
43
|
+
function CreateLLMResponse(llm) {
|
|
44
|
+
_classCallCheck(this, CreateLLMResponse);
|
|
45
|
+
CreateLLMResponse.initialize(this, llm);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Initializes the fields of this object.
|
|
50
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
51
|
+
* Only for internal use.
|
|
52
|
+
*/
|
|
53
|
+
return _createClass(CreateLLMResponse, null, [{
|
|
54
|
+
key: "initialize",
|
|
55
|
+
value: function initialize(obj, llm) {
|
|
56
|
+
obj['llm'] = llm;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Constructs a <code>CreateLLMResponse</code> from a plain JavaScript object, optionally creating a new instance.
|
|
61
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
62
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
63
|
+
* @param {module:model/CreateLLMResponse} obj Optional instance to populate.
|
|
64
|
+
* @return {module:model/CreateLLMResponse} The populated <code>CreateLLMResponse</code> instance.
|
|
65
|
+
*/
|
|
66
|
+
}, {
|
|
67
|
+
key: "constructFromObject",
|
|
68
|
+
value: function constructFromObject(data, obj) {
|
|
69
|
+
if (data) {
|
|
70
|
+
obj = obj || new CreateLLMResponse();
|
|
71
|
+
if (data.hasOwnProperty('llm')) {
|
|
72
|
+
obj['llm'] = _LLMResponse["default"].constructFromObject(data['llm']);
|
|
73
|
+
}
|
|
74
|
+
if (data.hasOwnProperty('statuses')) {
|
|
75
|
+
obj['statuses'] = _ApiClient["default"].convertToType(data['statuses'], [_GoodMemStatus["default"]]);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return obj;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Validates the JSON data with respect to <code>CreateLLMResponse</code>.
|
|
83
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
84
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateLLMResponse</code>.
|
|
85
|
+
*/
|
|
86
|
+
}, {
|
|
87
|
+
key: "validateJSON",
|
|
88
|
+
value: function validateJSON(data) {
|
|
89
|
+
// check to make sure all required properties are present in the JSON string
|
|
90
|
+
var _iterator = _createForOfIteratorHelper(CreateLLMResponse.RequiredProperties),
|
|
91
|
+
_step;
|
|
92
|
+
try {
|
|
93
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
94
|
+
var property = _step.value;
|
|
95
|
+
if (!data.hasOwnProperty(property)) {
|
|
96
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// validate the optional field `llm`
|
|
100
|
+
} catch (err) {
|
|
101
|
+
_iterator.e(err);
|
|
102
|
+
} finally {
|
|
103
|
+
_iterator.f();
|
|
104
|
+
}
|
|
105
|
+
if (data['llm']) {
|
|
106
|
+
// data not null
|
|
107
|
+
_LLMResponse["default"].validateJSON(data['llm']);
|
|
108
|
+
}
|
|
109
|
+
if (data['statuses']) {
|
|
110
|
+
// data not null
|
|
111
|
+
// ensure the json data is an array
|
|
112
|
+
if (!Array.isArray(data['statuses'])) {
|
|
113
|
+
throw new Error("Expected the field `statuses` to be an array in the JSON data but got " + data['statuses']);
|
|
114
|
+
}
|
|
115
|
+
// validate the optional field `statuses` (array)
|
|
116
|
+
var _iterator2 = _createForOfIteratorHelper(data['statuses']),
|
|
117
|
+
_step2;
|
|
118
|
+
try {
|
|
119
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
120
|
+
var item = _step2.value;
|
|
121
|
+
_GoodMemStatus["default"].validateJSON(item);
|
|
122
|
+
}
|
|
123
|
+
} catch (err) {
|
|
124
|
+
_iterator2.e(err);
|
|
125
|
+
} finally {
|
|
126
|
+
_iterator2.f();
|
|
127
|
+
}
|
|
128
|
+
;
|
|
129
|
+
}
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
}]);
|
|
133
|
+
}();
|
|
134
|
+
CreateLLMResponse.RequiredProperties = ["llm"];
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @member {module:model/LLMResponse} llm
|
|
138
|
+
*/
|
|
139
|
+
CreateLLMResponse.prototype['llm'] = undefined;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Optional status messages providing information about server-side operations performed during creation, such as capability inference results
|
|
143
|
+
* @member {Array.<module:model/GoodMemStatus>} statuses
|
|
144
|
+
*/
|
|
145
|
+
CreateLLMResponse.prototype['statuses'] = undefined;
|
|
146
|
+
var _default = exports["default"] = CreateLLMResponse;
|
|
@@ -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
|
+
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 LLMCapabilities model module.
|
|
28
|
+
* @module model/LLMCapabilities
|
|
29
|
+
* @version 1.0.0
|
|
30
|
+
*/
|
|
31
|
+
var LLMCapabilities = /*#__PURE__*/function () {
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new <code>LLMCapabilities</code>.
|
|
34
|
+
* Capabilities and features supported by an LLM service
|
|
35
|
+
* @alias module:model/LLMCapabilities
|
|
36
|
+
*/
|
|
37
|
+
function LLMCapabilities() {
|
|
38
|
+
_classCallCheck(this, LLMCapabilities);
|
|
39
|
+
LLMCapabilities.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(LLMCapabilities, null, [{
|
|
48
|
+
key: "initialize",
|
|
49
|
+
value: function initialize(obj) {}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Constructs a <code>LLMCapabilities</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/LLMCapabilities} obj Optional instance to populate.
|
|
56
|
+
* @return {module:model/LLMCapabilities} The populated <code>LLMCapabilities</code> instance.
|
|
57
|
+
*/
|
|
58
|
+
}, {
|
|
59
|
+
key: "constructFromObject",
|
|
60
|
+
value: function constructFromObject(data, obj) {
|
|
61
|
+
if (data) {
|
|
62
|
+
obj = obj || new LLMCapabilities();
|
|
63
|
+
if (data.hasOwnProperty('supportsChat')) {
|
|
64
|
+
obj['supportsChat'] = _ApiClient["default"].convertToType(data['supportsChat'], 'Boolean');
|
|
65
|
+
}
|
|
66
|
+
if (data.hasOwnProperty('supportsCompletion')) {
|
|
67
|
+
obj['supportsCompletion'] = _ApiClient["default"].convertToType(data['supportsCompletion'], 'Boolean');
|
|
68
|
+
}
|
|
69
|
+
if (data.hasOwnProperty('supportsFunctionCalling')) {
|
|
70
|
+
obj['supportsFunctionCalling'] = _ApiClient["default"].convertToType(data['supportsFunctionCalling'], 'Boolean');
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('supportsSystemMessages')) {
|
|
73
|
+
obj['supportsSystemMessages'] = _ApiClient["default"].convertToType(data['supportsSystemMessages'], 'Boolean');
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('supportsStreaming')) {
|
|
76
|
+
obj['supportsStreaming'] = _ApiClient["default"].convertToType(data['supportsStreaming'], 'Boolean');
|
|
77
|
+
}
|
|
78
|
+
if (data.hasOwnProperty('supportsSamplingParameters')) {
|
|
79
|
+
obj['supportsSamplingParameters'] = _ApiClient["default"].convertToType(data['supportsSamplingParameters'], 'Boolean');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return obj;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Validates the JSON data with respect to <code>LLMCapabilities</code>.
|
|
87
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
88
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>LLMCapabilities</code>.
|
|
89
|
+
*/
|
|
90
|
+
}, {
|
|
91
|
+
key: "validateJSON",
|
|
92
|
+
value: function validateJSON(data) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
}]);
|
|
96
|
+
}();
|
|
97
|
+
/**
|
|
98
|
+
* Supports conversational/chat completion format with message roles
|
|
99
|
+
* @member {Boolean} supportsChat
|
|
100
|
+
*/
|
|
101
|
+
LLMCapabilities.prototype['supportsChat'] = undefined;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Supports raw text completion with prompt continuation
|
|
105
|
+
* @member {Boolean} supportsCompletion
|
|
106
|
+
*/
|
|
107
|
+
LLMCapabilities.prototype['supportsCompletion'] = undefined;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Supports function/tool calling with structured responses
|
|
111
|
+
* @member {Boolean} supportsFunctionCalling
|
|
112
|
+
*/
|
|
113
|
+
LLMCapabilities.prototype['supportsFunctionCalling'] = undefined;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Supports system prompts to define model behavior and context
|
|
117
|
+
* @member {Boolean} supportsSystemMessages
|
|
118
|
+
*/
|
|
119
|
+
LLMCapabilities.prototype['supportsSystemMessages'] = undefined;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Supports real-time token streaming during generation
|
|
123
|
+
* @member {Boolean} supportsStreaming
|
|
124
|
+
*/
|
|
125
|
+
LLMCapabilities.prototype['supportsStreaming'] = undefined;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Supports sampling parameters like temperature, top_p, and top_k for generation control
|
|
129
|
+
* @member {Boolean} supportsSamplingParameters
|
|
130
|
+
*/
|
|
131
|
+
LLMCapabilities.prototype['supportsSamplingParameters'] = undefined;
|
|
132
|
+
var _default = exports["default"] = LLMCapabilities;
|
|
@@ -0,0 +1,318 @@
|
|
|
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 LLMCreationRequest model module.
|
|
35
|
+
* @module model/LLMCreationRequest
|
|
36
|
+
* @version 1.0.0
|
|
37
|
+
*/
|
|
38
|
+
var LLMCreationRequest = /*#__PURE__*/function () {
|
|
39
|
+
/**
|
|
40
|
+
* Constructs a new <code>LLMCreationRequest</code>.
|
|
41
|
+
* Request body for creating a new LLM. An LLM represents a configuration for text generation services.
|
|
42
|
+
* @alias module:model/LLMCreationRequest
|
|
43
|
+
* @param displayName {String} User-facing name of the LLM
|
|
44
|
+
* @param providerType {module:model/LLMProviderType}
|
|
45
|
+
* @param endpointUrl {String} API endpoint URL
|
|
46
|
+
* @param modelIdentifier {String} Model identifier
|
|
47
|
+
* @param credentials {String} API credentials (empty allowed for local services)
|
|
48
|
+
* @param capabilities {module:model/LLMCapabilities}
|
|
49
|
+
*/
|
|
50
|
+
function LLMCreationRequest(displayName, providerType, endpointUrl, modelIdentifier, credentials, capabilities) {
|
|
51
|
+
_classCallCheck(this, LLMCreationRequest);
|
|
52
|
+
LLMCreationRequest.initialize(this, displayName, providerType, endpointUrl, modelIdentifier, credentials, capabilities);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Initializes the fields of this object.
|
|
57
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
58
|
+
* Only for internal use.
|
|
59
|
+
*/
|
|
60
|
+
return _createClass(LLMCreationRequest, null, [{
|
|
61
|
+
key: "initialize",
|
|
62
|
+
value: function initialize(obj, displayName, providerType, endpointUrl, modelIdentifier, credentials, capabilities) {
|
|
63
|
+
obj['displayName'] = displayName;
|
|
64
|
+
obj['providerType'] = providerType;
|
|
65
|
+
obj['endpointUrl'] = endpointUrl;
|
|
66
|
+
obj['modelIdentifier'] = modelIdentifier;
|
|
67
|
+
obj['credentials'] = credentials;
|
|
68
|
+
obj['capabilities'] = capabilities;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Constructs a <code>LLMCreationRequest</code> from a plain JavaScript object, optionally creating a new instance.
|
|
73
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
74
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
75
|
+
* @param {module:model/LLMCreationRequest} obj Optional instance to populate.
|
|
76
|
+
* @return {module:model/LLMCreationRequest} The populated <code>LLMCreationRequest</code> instance.
|
|
77
|
+
*/
|
|
78
|
+
}, {
|
|
79
|
+
key: "constructFromObject",
|
|
80
|
+
value: function constructFromObject(data, obj) {
|
|
81
|
+
if (data) {
|
|
82
|
+
obj = obj || new LLMCreationRequest();
|
|
83
|
+
if (data.hasOwnProperty('validate')) {
|
|
84
|
+
obj['validate'] = _ApiClient["default"].convertToType(data['validate'], Object);
|
|
85
|
+
}
|
|
86
|
+
if (data.hasOwnProperty('displayName')) {
|
|
87
|
+
obj['displayName'] = _ApiClient["default"].convertToType(data['displayName'], 'String');
|
|
88
|
+
}
|
|
89
|
+
if (data.hasOwnProperty('description')) {
|
|
90
|
+
obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
|
|
91
|
+
}
|
|
92
|
+
if (data.hasOwnProperty('providerType')) {
|
|
93
|
+
obj['providerType'] = _LLMProviderType["default"].constructFromObject(data['providerType']);
|
|
94
|
+
}
|
|
95
|
+
if (data.hasOwnProperty('endpointUrl')) {
|
|
96
|
+
obj['endpointUrl'] = _ApiClient["default"].convertToType(data['endpointUrl'], 'String');
|
|
97
|
+
}
|
|
98
|
+
if (data.hasOwnProperty('apiPath')) {
|
|
99
|
+
obj['apiPath'] = _ApiClient["default"].convertToType(data['apiPath'], 'String');
|
|
100
|
+
}
|
|
101
|
+
if (data.hasOwnProperty('modelIdentifier')) {
|
|
102
|
+
obj['modelIdentifier'] = _ApiClient["default"].convertToType(data['modelIdentifier'], 'String');
|
|
103
|
+
}
|
|
104
|
+
if (data.hasOwnProperty('supportedModalities')) {
|
|
105
|
+
obj['supportedModalities'] = _ApiClient["default"].convertToType(data['supportedModalities'], [_Modality["default"]]);
|
|
106
|
+
}
|
|
107
|
+
if (data.hasOwnProperty('credentials')) {
|
|
108
|
+
obj['credentials'] = _ApiClient["default"].convertToType(data['credentials'], 'String');
|
|
109
|
+
}
|
|
110
|
+
if (data.hasOwnProperty('labels')) {
|
|
111
|
+
obj['labels'] = _ApiClient["default"].convertToType(data['labels'], {
|
|
112
|
+
'String': 'String'
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
if (data.hasOwnProperty('version')) {
|
|
116
|
+
obj['version'] = _ApiClient["default"].convertToType(data['version'], 'String');
|
|
117
|
+
}
|
|
118
|
+
if (data.hasOwnProperty('monitoringEndpoint')) {
|
|
119
|
+
obj['monitoringEndpoint'] = _ApiClient["default"].convertToType(data['monitoringEndpoint'], 'String');
|
|
120
|
+
}
|
|
121
|
+
if (data.hasOwnProperty('capabilities')) {
|
|
122
|
+
obj['capabilities'] = _LLMCapabilities["default"].constructFromObject(data['capabilities']);
|
|
123
|
+
}
|
|
124
|
+
if (data.hasOwnProperty('defaultSamplingParams')) {
|
|
125
|
+
obj['defaultSamplingParams'] = _LLMSamplingParams["default"].constructFromObject(data['defaultSamplingParams']);
|
|
126
|
+
}
|
|
127
|
+
if (data.hasOwnProperty('maxContextLength')) {
|
|
128
|
+
obj['maxContextLength'] = _ApiClient["default"].convertToType(data['maxContextLength'], 'Number');
|
|
129
|
+
}
|
|
130
|
+
if (data.hasOwnProperty('clientConfig')) {
|
|
131
|
+
obj['clientConfig'] = _ApiClient["default"].convertToType(data['clientConfig'], {
|
|
132
|
+
'String': Object
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
if (data.hasOwnProperty('ownerId')) {
|
|
136
|
+
obj['ownerId'] = _ApiClient["default"].convertToType(data['ownerId'], 'String');
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return obj;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Validates the JSON data with respect to <code>LLMCreationRequest</code>.
|
|
144
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
145
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>LLMCreationRequest</code>.
|
|
146
|
+
*/
|
|
147
|
+
}, {
|
|
148
|
+
key: "validateJSON",
|
|
149
|
+
value: function validateJSON(data) {
|
|
150
|
+
// check to make sure all required properties are present in the JSON string
|
|
151
|
+
var _iterator = _createForOfIteratorHelper(LLMCreationRequest.RequiredProperties),
|
|
152
|
+
_step;
|
|
153
|
+
try {
|
|
154
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
155
|
+
var property = _step.value;
|
|
156
|
+
if (!data.hasOwnProperty(property)) {
|
|
157
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// ensure the json data is a string
|
|
161
|
+
} catch (err) {
|
|
162
|
+
_iterator.e(err);
|
|
163
|
+
} finally {
|
|
164
|
+
_iterator.f();
|
|
165
|
+
}
|
|
166
|
+
if (data['displayName'] && !(typeof data['displayName'] === 'string' || data['displayName'] instanceof String)) {
|
|
167
|
+
throw new Error("Expected the field `displayName` to be a primitive type in the JSON string but got " + data['displayName']);
|
|
168
|
+
}
|
|
169
|
+
// ensure the json data is a string
|
|
170
|
+
if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
|
|
171
|
+
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
|
|
172
|
+
}
|
|
173
|
+
// ensure the json data is a string
|
|
174
|
+
if (data['endpointUrl'] && !(typeof data['endpointUrl'] === 'string' || data['endpointUrl'] instanceof String)) {
|
|
175
|
+
throw new Error("Expected the field `endpointUrl` to be a primitive type in the JSON string but got " + data['endpointUrl']);
|
|
176
|
+
}
|
|
177
|
+
// ensure the json data is a string
|
|
178
|
+
if (data['apiPath'] && !(typeof data['apiPath'] === 'string' || data['apiPath'] instanceof String)) {
|
|
179
|
+
throw new Error("Expected the field `apiPath` to be a primitive type in the JSON string but got " + data['apiPath']);
|
|
180
|
+
}
|
|
181
|
+
// ensure the json data is a string
|
|
182
|
+
if (data['modelIdentifier'] && !(typeof data['modelIdentifier'] === 'string' || data['modelIdentifier'] instanceof String)) {
|
|
183
|
+
throw new Error("Expected the field `modelIdentifier` to be a primitive type in the JSON string but got " + data['modelIdentifier']);
|
|
184
|
+
}
|
|
185
|
+
// ensure the json data is an array
|
|
186
|
+
if (!Array.isArray(data['supportedModalities'])) {
|
|
187
|
+
throw new Error("Expected the field `supportedModalities` to be an array in the JSON data but got " + data['supportedModalities']);
|
|
188
|
+
}
|
|
189
|
+
// ensure the json data is a string
|
|
190
|
+
if (data['credentials'] && !(typeof data['credentials'] === 'string' || data['credentials'] instanceof String)) {
|
|
191
|
+
throw new Error("Expected the field `credentials` to be a primitive type in the JSON string but got " + data['credentials']);
|
|
192
|
+
}
|
|
193
|
+
// ensure the json data is a string
|
|
194
|
+
if (data['version'] && !(typeof data['version'] === 'string' || data['version'] instanceof String)) {
|
|
195
|
+
throw new Error("Expected the field `version` to be a primitive type in the JSON string but got " + data['version']);
|
|
196
|
+
}
|
|
197
|
+
// ensure the json data is a string
|
|
198
|
+
if (data['monitoringEndpoint'] && !(typeof data['monitoringEndpoint'] === 'string' || data['monitoringEndpoint'] instanceof String)) {
|
|
199
|
+
throw new Error("Expected the field `monitoringEndpoint` to be a primitive type in the JSON string but got " + data['monitoringEndpoint']);
|
|
200
|
+
}
|
|
201
|
+
// validate the optional field `capabilities`
|
|
202
|
+
if (data['capabilities']) {
|
|
203
|
+
// data not null
|
|
204
|
+
_LLMCapabilities["default"].validateJSON(data['capabilities']);
|
|
205
|
+
}
|
|
206
|
+
// validate the optional field `defaultSamplingParams`
|
|
207
|
+
if (data['defaultSamplingParams']) {
|
|
208
|
+
// data not null
|
|
209
|
+
_LLMSamplingParams["default"].validateJSON(data['defaultSamplingParams']);
|
|
210
|
+
}
|
|
211
|
+
// ensure the json data is a string
|
|
212
|
+
if (data['ownerId'] && !(typeof data['ownerId'] === 'string' || data['ownerId'] instanceof String)) {
|
|
213
|
+
throw new Error("Expected the field `ownerId` to be a primitive type in the JSON string but got " + data['ownerId']);
|
|
214
|
+
}
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
}]);
|
|
218
|
+
}();
|
|
219
|
+
LLMCreationRequest.RequiredProperties = ["displayName", "providerType", "endpointUrl", "modelIdentifier", "credentials", "capabilities"];
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @member {Object} validate
|
|
223
|
+
*/
|
|
224
|
+
LLMCreationRequest.prototype['validate'] = undefined;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* User-facing name of the LLM
|
|
228
|
+
* @member {String} displayName
|
|
229
|
+
*/
|
|
230
|
+
LLMCreationRequest.prototype['displayName'] = undefined;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Description of the LLM
|
|
234
|
+
* @member {String} description
|
|
235
|
+
*/
|
|
236
|
+
LLMCreationRequest.prototype['description'] = undefined;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @member {module:model/LLMProviderType} providerType
|
|
240
|
+
*/
|
|
241
|
+
LLMCreationRequest.prototype['providerType'] = undefined;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* API endpoint URL
|
|
245
|
+
* @member {String} endpointUrl
|
|
246
|
+
*/
|
|
247
|
+
LLMCreationRequest.prototype['endpointUrl'] = undefined;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* API path for chat/completions request (defaults to /v1/chat/completions if not provided)
|
|
251
|
+
* @member {String} apiPath
|
|
252
|
+
*/
|
|
253
|
+
LLMCreationRequest.prototype['apiPath'] = undefined;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Model identifier
|
|
257
|
+
* @member {String} modelIdentifier
|
|
258
|
+
*/
|
|
259
|
+
LLMCreationRequest.prototype['modelIdentifier'] = undefined;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Supported content modalities (defaults to TEXT if not provided)
|
|
263
|
+
* @member {Array.<module:model/Modality>} supportedModalities
|
|
264
|
+
*/
|
|
265
|
+
LLMCreationRequest.prototype['supportedModalities'] = undefined;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* API credentials (empty allowed for local services)
|
|
269
|
+
* @member {String} credentials
|
|
270
|
+
*/
|
|
271
|
+
LLMCreationRequest.prototype['credentials'] = undefined;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* User-defined labels for categorization
|
|
275
|
+
* @member {Object.<String, String>} labels
|
|
276
|
+
*/
|
|
277
|
+
LLMCreationRequest.prototype['labels'] = undefined;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Version information
|
|
281
|
+
* @member {String} version
|
|
282
|
+
*/
|
|
283
|
+
LLMCreationRequest.prototype['version'] = undefined;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Monitoring endpoint URL
|
|
287
|
+
* @member {String} monitoringEndpoint
|
|
288
|
+
*/
|
|
289
|
+
LLMCreationRequest.prototype['monitoringEndpoint'] = undefined;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @member {module:model/LLMCapabilities} capabilities
|
|
293
|
+
*/
|
|
294
|
+
LLMCreationRequest.prototype['capabilities'] = undefined;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* @member {module:model/LLMSamplingParams} defaultSamplingParams
|
|
298
|
+
*/
|
|
299
|
+
LLMCreationRequest.prototype['defaultSamplingParams'] = undefined;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Maximum context window size in tokens
|
|
303
|
+
* @member {Number} maxContextLength
|
|
304
|
+
*/
|
|
305
|
+
LLMCreationRequest.prototype['maxContextLength'] = undefined;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Provider-specific client configuration as flexible JSON structure
|
|
309
|
+
* @member {Object.<String, Object>} clientConfig
|
|
310
|
+
*/
|
|
311
|
+
LLMCreationRequest.prototype['clientConfig'] = undefined;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Optional owner ID. If not provided, derived from the authentication context. Requires CREATE_LLM_ANY permission if specified.
|
|
315
|
+
* @member {String} ownerId
|
|
316
|
+
*/
|
|
317
|
+
LLMCreationRequest.prototype['ownerId'] = undefined;
|
|
318
|
+
var _default = exports["default"] = LLMCreationRequest;
|