@pairsystems/goodmem-client 1.0.10 → 1.0.11

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.
Files changed (84) hide show
  1. package/README.md +24 -4
  2. package/dist/api/EmbeddersApi.js +25 -10
  3. package/dist/api/LLMsApi.js +25 -10
  4. package/dist/api/MemoriesApi.js +186 -61
  5. package/dist/api/RerankersApi.js +25 -10
  6. package/dist/api/SpacesApi.js +31 -16
  7. package/dist/index.js +133 -7
  8. package/dist/model/ActiveLicenseMetadata.js +5 -1
  9. package/dist/model/AdminDrainRequest.js +3 -0
  10. package/dist/model/AdminDrainResponse.js +33 -2
  11. package/dist/model/AdminPurgeJobsRequest.js +4 -0
  12. package/dist/model/AdminPurgeJobsResponse.js +8 -4
  13. package/dist/model/AdminReloadLicenseResponse.js +4 -1
  14. package/dist/model/ApiKeyAuth.js +7 -3
  15. package/dist/model/ApiKeyResponse.js +67 -5
  16. package/dist/model/BackgroundJobSummary.js +35 -2
  17. package/dist/model/BatchDeleteMemorySelectorRequest.js +2 -1
  18. package/dist/model/BatchMemoryResult.js +4 -2
  19. package/dist/model/ChunkReference.js +3 -2
  20. package/dist/model/ChunkingConfiguration.js +109 -47
  21. package/dist/model/ChunkingConfigurationOneOf.js +109 -0
  22. package/dist/model/ChunkingConfigurationOneOf1.js +109 -0
  23. package/dist/model/ChunkingConfigurationOneOf2.js +109 -0
  24. package/dist/model/ContextItem.js +91 -73
  25. package/dist/model/ContextItemOneOf.js +109 -0
  26. package/dist/model/ContextItemOneOf1.js +109 -0
  27. package/dist/model/CreateApiKeyResponse.js +2 -1
  28. package/dist/model/CreateLLMResponse.js +3 -2
  29. package/dist/model/EmbedderCreationRequest.js +8 -5
  30. package/dist/model/EmbedderResponse.js +16 -11
  31. package/dist/model/EndpointAuthentication.js +7 -4
  32. package/dist/model/HnswOptions.js +2 -1
  33. package/dist/model/JsonBatchMemoryCreationRequest.js +132 -0
  34. package/dist/model/JsonMemoryCreationContentRequirement.js +151 -0
  35. package/dist/model/JsonMemoryCreationContentRequirementOneOf.js +109 -0
  36. package/dist/model/JsonMemoryCreationContentRequirementOneOf1.js +109 -0
  37. package/dist/model/JsonMemoryCreationRequest.js +289 -0
  38. package/dist/model/LLMCreationRequest.js +12 -6
  39. package/dist/model/LLMResponse.js +18 -12
  40. package/dist/model/LLMUpdateRequest.js +6 -3
  41. package/dist/model/LLMUpdateRequestNot.js +118 -0
  42. package/dist/model/ListApiKeysResponse.js +29 -9
  43. package/dist/model/ListMemoryPageImagesResponse.js +145 -0
  44. package/dist/model/ListSpacesResponse.js +29 -9
  45. package/dist/model/Memory.js +106 -10
  46. package/dist/model/MemoryChunkResponse.js +30 -2
  47. package/dist/model/MemoryCreationRequest.js +15 -3
  48. package/dist/model/MemoryPageImage.js +225 -0
  49. package/dist/model/OcrCell.js +5 -3
  50. package/dist/model/OcrDocumentRequest.js +2 -1
  51. package/dist/model/OcrDocumentResponse.js +6 -4
  52. package/dist/model/OcrPage.js +9 -6
  53. package/dist/model/OcrPageResult.js +4 -2
  54. package/dist/model/PingEndpointInfo.js +3 -2
  55. package/dist/model/PingEvent.js +108 -50
  56. package/dist/model/PingEventOneOf.js +109 -0
  57. package/dist/model/PingEventOneOf1.js +109 -0
  58. package/dist/model/PingEventOneOf2.js +109 -0
  59. package/dist/model/PingOnceRequest.js +4 -2
  60. package/dist/model/PingResult.js +6 -4
  61. package/dist/model/PingStreamRequest.js +7 -3
  62. package/dist/model/PingSummary.js +3 -2
  63. package/dist/model/ProcessingHistory.js +2 -1
  64. package/dist/model/RecursiveChunkingConfiguration.js +6 -4
  65. package/dist/model/RerankerCreationRequest.js +5 -3
  66. package/dist/model/RerankerResponse.js +13 -9
  67. package/dist/model/ResultSetBoundary.js +20 -2
  68. package/dist/model/RetrieveMemoryEvent.js +10 -5
  69. package/dist/model/RetrieveMemoryRequest.js +12 -6
  70. package/dist/model/RetrievedItem.js +91 -42
  71. package/dist/model/RetrievedItemOneOf.js +109 -0
  72. package/dist/model/RetrievedItemOneOf1.js +109 -0
  73. package/dist/model/SecretReference.js +27 -4
  74. package/dist/model/SentenceChunkingConfiguration.js +3 -2
  75. package/dist/model/SortOrder.js +63 -0
  76. package/dist/model/Space.js +8 -5
  77. package/dist/model/SpaceCreationRequest.js +13 -8
  78. package/dist/model/SpaceEmbedderConfig.js +3 -1
  79. package/dist/model/SystemInfoResponse.js +13 -4
  80. package/dist/model/UpdateApiKeyRequest.js +19 -9
  81. package/dist/model/UpdateEmbedderRequest.js +2 -9
  82. package/dist/model/UpdateRerankerRequest.js +2 -9
  83. package/dist/model/UpdateSpaceRequest.js +0 -22
  84. package/package.json +1 -1
@@ -0,0 +1,109 @@
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 _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; } } }; }
11
+ 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; } }
12
+ 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; }
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 ChunkingConfigurationOneOf2 model module.
31
+ * @module model/ChunkingConfigurationOneOf2
32
+ * @version 1.0.0
33
+ */
34
+ var ChunkingConfigurationOneOf2 = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>ChunkingConfigurationOneOf2</code>.
37
+ * @alias module:model/ChunkingConfigurationOneOf2
38
+ * @param sentence {Object}
39
+ */
40
+ function ChunkingConfigurationOneOf2(sentence) {
41
+ _classCallCheck(this, ChunkingConfigurationOneOf2);
42
+ ChunkingConfigurationOneOf2.initialize(this, sentence);
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(ChunkingConfigurationOneOf2, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, sentence) {
53
+ obj['sentence'] = sentence;
54
+ }
55
+
56
+ /**
57
+ * Constructs a <code>ChunkingConfigurationOneOf2</code> from a plain JavaScript object, optionally creating a new instance.
58
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
59
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
60
+ * @param {module:model/ChunkingConfigurationOneOf2} obj Optional instance to populate.
61
+ * @return {module:model/ChunkingConfigurationOneOf2} The populated <code>ChunkingConfigurationOneOf2</code> instance.
62
+ */
63
+ }, {
64
+ key: "constructFromObject",
65
+ value: function constructFromObject(data, obj) {
66
+ if (data) {
67
+ obj = obj || new ChunkingConfigurationOneOf2();
68
+ if (data.hasOwnProperty('sentence')) {
69
+ obj['sentence'] = _ApiClient["default"].convertToType(data['sentence'], Object);
70
+ }
71
+ }
72
+ return obj;
73
+ }
74
+
75
+ /**
76
+ * Validates the JSON data with respect to <code>ChunkingConfigurationOneOf2</code>.
77
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
78
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ChunkingConfigurationOneOf2</code>.
79
+ */
80
+ }, {
81
+ key: "validateJSON",
82
+ value: function validateJSON(data) {
83
+ // check to make sure all required properties are present in the JSON string
84
+ var _iterator = _createForOfIteratorHelper(ChunkingConfigurationOneOf2.RequiredProperties),
85
+ _step;
86
+ try {
87
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
88
+ var property = _step.value;
89
+ // null-value check for oneOf discrimination (see build.sh)
90
+ if (!data.hasOwnProperty(property) || data[property] === null || data[property] === undefined) {
91
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
92
+ }
93
+ }
94
+ } catch (err) {
95
+ _iterator.e(err);
96
+ } finally {
97
+ _iterator.f();
98
+ }
99
+ return true;
100
+ }
101
+ }]);
102
+ }();
103
+ ChunkingConfigurationOneOf2.RequiredProperties = ["sentence"];
104
+
105
+ /**
106
+ * @member {Object} sentence
107
+ */
108
+ ChunkingConfigurationOneOf2.prototype['sentence'] = undefined;
109
+ var _default = exports["default"] = ChunkingConfigurationOneOf2;
@@ -6,14 +6,15 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _BinaryContent = _interopRequireDefault(require("./BinaryContent"));
9
+ var _ContextItemOneOf = _interopRequireDefault(require("./ContextItemOneOf"));
10
+ var _ContextItemOneOf2 = _interopRequireDefault(require("./ContextItemOneOf1"));
11
+ var _ContextItem;
9
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
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); }
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
14
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
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
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 _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; }
17
18
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
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); } /**
19
20
  *
@@ -37,100 +38,117 @@ var ContextItem = /*#__PURE__*/function () {
37
38
  * Constructs a new <code>ContextItem</code>.
38
39
  * Context item with either text or binary content.
39
40
  * @alias module:model/ContextItem
40
- * @param isValid {Boolean}
41
+ * @param {(module:model/ContextItemOneOf|module:model/ContextItemOneOf1)} instance The actual instance to initialize ContextItem.
41
42
  */
42
- function ContextItem(isValid) {
43
+ function ContextItem() {
44
+ var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
43
45
  _classCallCheck(this, ContextItem);
44
- ContextItem.initialize(this, isValid);
46
+ /**
47
+ * Returns the JSON representation of the actual instance.
48
+ * @return {string}
49
+ */
50
+ _defineProperty(this, "toJSON", function () {
51
+ return this.getActualInstance();
52
+ });
53
+ if (instance === null) {
54
+ this.actualInstance = null;
55
+ return;
56
+ }
57
+ var match = 0;
58
+ var errorMessages = [];
59
+ try {
60
+ if (instance instanceof _ContextItemOneOf["default"]) {
61
+ this.actualInstance = instance;
62
+ } else {
63
+ // plain JS object
64
+ // validate the object
65
+ _ContextItemOneOf["default"].validateJSON(instance); // throw an exception if no match
66
+ // create ContextItemOneOf from JS object
67
+ this.actualInstance = _ContextItemOneOf["default"].constructFromObject(instance);
68
+ }
69
+ match++;
70
+ } catch (err) {
71
+ // json data failed to deserialize into ContextItemOneOf
72
+ errorMessages.push("Failed to construct ContextItemOneOf: " + err);
73
+ }
74
+ try {
75
+ if (instance instanceof _ContextItemOneOf2["default"]) {
76
+ this.actualInstance = instance;
77
+ } else {
78
+ // plain JS object
79
+ // validate the object
80
+ _ContextItemOneOf2["default"].validateJSON(instance); // throw an exception if no match
81
+ // create ContextItemOneOf1 from JS object
82
+ this.actualInstance = _ContextItemOneOf2["default"].constructFromObject(instance);
83
+ }
84
+ match++;
85
+ } catch (err) {
86
+ // json data failed to deserialize into ContextItemOneOf1
87
+ errorMessages.push("Failed to construct ContextItemOneOf1: " + err);
88
+ }
89
+ if (match > 1) {
90
+ throw new Error("Multiple matches found constructing `ContextItem` with oneOf schemas ContextItemOneOf, ContextItemOneOf1. Input: " + JSON.stringify(instance));
91
+ } else if (match === 0) {
92
+ this.actualInstance = null; // clear the actual instance in case there are multiple matches
93
+ throw new Error("No match found constructing `ContextItem` with oneOf schemas ContextItemOneOf, ContextItemOneOf1. Details: " + errorMessages.join(", "));
94
+ } else {// only 1 match
95
+ // the input is valid
96
+ }
45
97
  }
46
98
 
47
99
  /**
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.
100
+ * Constructs a <code>ContextItem</code> from a plain JavaScript object, optionally creating a new instance.
101
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
102
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
103
+ * @param {module:model/ContextItem} obj Optional instance to populate.
104
+ * @return {module:model/ContextItem} The populated <code>ContextItem</code> instance.
51
105
  */
52
- return _createClass(ContextItem, null, [{
53
- key: "initialize",
54
- value: function initialize(obj, isValid) {
55
- obj['isValid'] = isValid;
56
- }
57
-
106
+ return _createClass(ContextItem, [{
107
+ key: "getActualInstance",
108
+ value:
58
109
  /**
59
- * Constructs a <code>ContextItem</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/ContextItem} obj Optional instance to populate.
63
- * @return {module:model/ContextItem} The populated <code>ContextItem</code> instance.
110
+ * Gets the actual instance, which can be <code>ContextItemOneOf</code>, <code>ContextItemOneOf1</code>.
111
+ * @return {(module:model/ContextItemOneOf|module:model/ContextItemOneOf1)} The actual instance.
64
112
  */
65
- }, {
66
- key: "constructFromObject",
67
- value: function constructFromObject(data, obj) {
68
- if (data) {
69
- obj = obj || new ContextItem();
70
- if (data.hasOwnProperty('isValid')) {
71
- obj['isValid'] = _ApiClient["default"].convertToType(data['isValid'], 'Boolean');
72
- }
73
- if (data.hasOwnProperty('text')) {
74
- obj['text'] = _ApiClient["default"].convertToType(data['text'], 'String');
75
- }
76
- if (data.hasOwnProperty('binary')) {
77
- obj['binary'] = _BinaryContent["default"].constructFromObject(data['binary']);
78
- }
79
- }
80
- return obj;
113
+ function getActualInstance() {
114
+ return this.actualInstance;
81
115
  }
82
116
 
83
117
  /**
84
- * Validates the JSON data with respect to <code>ContextItem</code>.
85
- * @param {Object} data The plain JavaScript object bearing properties of interest.
86
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ContextItem</code>.
118
+ * Sets the actual instance, which can be <code>ContextItemOneOf</code>, <code>ContextItemOneOf1</code>.
119
+ * @param {(module:model/ContextItemOneOf|module:model/ContextItemOneOf1)} obj The actual instance.
87
120
  */
88
121
  }, {
89
- key: "validateJSON",
90
- value: function validateJSON(data) {
91
- // check to make sure all required properties are present in the JSON string
92
- var _iterator = _createForOfIteratorHelper(ContextItem.RequiredProperties),
93
- _step;
94
- try {
95
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
96
- var property = _step.value;
97
- if (!data.hasOwnProperty(property)) {
98
- throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
99
- }
100
- }
101
- // ensure the json data is a string
102
- } catch (err) {
103
- _iterator.e(err);
104
- } finally {
105
- _iterator.f();
106
- }
107
- if (data['text'] && !(typeof data['text'] === 'string' || data['text'] instanceof String)) {
108
- throw new Error("Expected the field `text` to be a primitive type in the JSON string but got " + data['text']);
109
- }
110
- // validate the optional field `binary`
111
- if (data['binary']) {
112
- // data not null
113
- _BinaryContent["default"].validateJSON(data['binary']);
114
- }
115
- return true;
122
+ key: "setActualInstance",
123
+ value: function setActualInstance(obj) {
124
+ this.actualInstance = ContextItem.constructFromObject(obj).getActualInstance();
125
+ }
126
+ }], [{
127
+ key: "constructFromObject",
128
+ value: function constructFromObject(data, obj) {
129
+ return new ContextItem(data);
116
130
  }
117
131
  }]);
118
132
  }();
119
- ContextItem.RequiredProperties = ["isValid"];
120
-
121
- /**
122
- * @member {Boolean} isValid
123
- */
124
- ContextItem.prototype['isValid'] = undefined;
125
-
126
133
  /**
127
134
  * Text content for this context item.
128
135
  * @member {String} text
129
136
  */
137
+ _ContextItem = ContextItem;
138
+ /**
139
+ * Create an instance of ContextItem from a JSON string.
140
+ * @param {string} json_string JSON string.
141
+ * @return {module:model/ContextItem} An instance of ContextItem.
142
+ */
143
+ _defineProperty(ContextItem, "fromJSON", function (json_string) {
144
+ return _ContextItem.constructFromObject(JSON.parse(json_string));
145
+ });
130
146
  ContextItem.prototype['text'] = undefined;
131
147
 
132
148
  /**
149
+ * Binary content for this context item.
133
150
  * @member {module:model/BinaryContent} binary
134
151
  */
135
152
  ContextItem.prototype['binary'] = undefined;
153
+ ContextItem.OneOf = ["ContextItemOneOf", "ContextItemOneOf1"];
136
154
  var _default = exports["default"] = ContextItem;
@@ -0,0 +1,109 @@
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 _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; } } }; }
11
+ 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; } }
12
+ 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; }
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 ContextItemOneOf model module.
31
+ * @module model/ContextItemOneOf
32
+ * @version 1.0.0
33
+ */
34
+ var ContextItemOneOf = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>ContextItemOneOf</code>.
37
+ * @alias module:model/ContextItemOneOf
38
+ * @param text {Object}
39
+ */
40
+ function ContextItemOneOf(text) {
41
+ _classCallCheck(this, ContextItemOneOf);
42
+ ContextItemOneOf.initialize(this, text);
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(ContextItemOneOf, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, text) {
53
+ obj['text'] = text;
54
+ }
55
+
56
+ /**
57
+ * Constructs a <code>ContextItemOneOf</code> from a plain JavaScript object, optionally creating a new instance.
58
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
59
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
60
+ * @param {module:model/ContextItemOneOf} obj Optional instance to populate.
61
+ * @return {module:model/ContextItemOneOf} The populated <code>ContextItemOneOf</code> instance.
62
+ */
63
+ }, {
64
+ key: "constructFromObject",
65
+ value: function constructFromObject(data, obj) {
66
+ if (data) {
67
+ obj = obj || new ContextItemOneOf();
68
+ if (data.hasOwnProperty('text')) {
69
+ obj['text'] = _ApiClient["default"].convertToType(data['text'], Object);
70
+ }
71
+ }
72
+ return obj;
73
+ }
74
+
75
+ /**
76
+ * Validates the JSON data with respect to <code>ContextItemOneOf</code>.
77
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
78
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ContextItemOneOf</code>.
79
+ */
80
+ }, {
81
+ key: "validateJSON",
82
+ value: function validateJSON(data) {
83
+ // check to make sure all required properties are present in the JSON string
84
+ var _iterator = _createForOfIteratorHelper(ContextItemOneOf.RequiredProperties),
85
+ _step;
86
+ try {
87
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
88
+ var property = _step.value;
89
+ // null-value check for oneOf discrimination (see build.sh)
90
+ if (!data.hasOwnProperty(property) || data[property] === null || data[property] === undefined) {
91
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
92
+ }
93
+ }
94
+ } catch (err) {
95
+ _iterator.e(err);
96
+ } finally {
97
+ _iterator.f();
98
+ }
99
+ return true;
100
+ }
101
+ }]);
102
+ }();
103
+ ContextItemOneOf.RequiredProperties = ["text"];
104
+
105
+ /**
106
+ * @member {Object} text
107
+ */
108
+ ContextItemOneOf.prototype['text'] = undefined;
109
+ var _default = exports["default"] = ContextItemOneOf;
@@ -0,0 +1,109 @@
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 _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; } } }; }
11
+ 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; } }
12
+ 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; }
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 ContextItemOneOf1 model module.
31
+ * @module model/ContextItemOneOf1
32
+ * @version 1.0.0
33
+ */
34
+ var ContextItemOneOf1 = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>ContextItemOneOf1</code>.
37
+ * @alias module:model/ContextItemOneOf1
38
+ * @param binary {Object}
39
+ */
40
+ function ContextItemOneOf1(binary) {
41
+ _classCallCheck(this, ContextItemOneOf1);
42
+ ContextItemOneOf1.initialize(this, binary);
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(ContextItemOneOf1, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, binary) {
53
+ obj['binary'] = binary;
54
+ }
55
+
56
+ /**
57
+ * Constructs a <code>ContextItemOneOf1</code> from a plain JavaScript object, optionally creating a new instance.
58
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
59
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
60
+ * @param {module:model/ContextItemOneOf1} obj Optional instance to populate.
61
+ * @return {module:model/ContextItemOneOf1} The populated <code>ContextItemOneOf1</code> instance.
62
+ */
63
+ }, {
64
+ key: "constructFromObject",
65
+ value: function constructFromObject(data, obj) {
66
+ if (data) {
67
+ obj = obj || new ContextItemOneOf1();
68
+ if (data.hasOwnProperty('binary')) {
69
+ obj['binary'] = _ApiClient["default"].convertToType(data['binary'], Object);
70
+ }
71
+ }
72
+ return obj;
73
+ }
74
+
75
+ /**
76
+ * Validates the JSON data with respect to <code>ContextItemOneOf1</code>.
77
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
78
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ContextItemOneOf1</code>.
79
+ */
80
+ }, {
81
+ key: "validateJSON",
82
+ value: function validateJSON(data) {
83
+ // check to make sure all required properties are present in the JSON string
84
+ var _iterator = _createForOfIteratorHelper(ContextItemOneOf1.RequiredProperties),
85
+ _step;
86
+ try {
87
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
88
+ var property = _step.value;
89
+ // null-value check for oneOf discrimination (see build.sh)
90
+ if (!data.hasOwnProperty(property) || data[property] === null || data[property] === undefined) {
91
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
92
+ }
93
+ }
94
+ } catch (err) {
95
+ _iterator.e(err);
96
+ } finally {
97
+ _iterator.f();
98
+ }
99
+ return true;
100
+ }
101
+ }]);
102
+ }();
103
+ ContextItemOneOf1.RequiredProperties = ["binary"];
104
+
105
+ /**
106
+ * @member {Object} binary
107
+ */
108
+ ContextItemOneOf1.prototype['binary'] = undefined;
109
+ var _default = exports["default"] = ContextItemOneOf1;
@@ -62,7 +62,7 @@ var CreateApiKeyResponse = /*#__PURE__*/function () {
62
62
  if (data) {
63
63
  obj = obj || new CreateApiKeyResponse();
64
64
  if (data.hasOwnProperty('apiKeyMetadata')) {
65
- obj['apiKeyMetadata'] = _ApiKeyResponse["default"].constructFromObject(data['apiKeyMetadata']);
65
+ obj['apiKeyMetadata'] = _ApiClient["default"].convertToType(data['apiKeyMetadata'], _ApiKeyResponse["default"]);
66
66
  }
67
67
  if (data.hasOwnProperty('rawApiKey')) {
68
68
  obj['rawApiKey'] = _ApiClient["default"].convertToType(data['rawApiKey'], 'String');
@@ -93,6 +93,7 @@ var CreateApiKeyResponse = /*#__PURE__*/function () {
93
93
  }]);
94
94
  }();
95
95
  /**
96
+ * Metadata for the created API key.
96
97
  * @member {module:model/ApiKeyResponse} apiKeyMetadata
97
98
  */
98
99
  CreateApiKeyResponse.prototype['apiKeyMetadata'] = undefined;
@@ -38,7 +38,7 @@ var CreateLLMResponse = /*#__PURE__*/function () {
38
38
  * Constructs a new <code>CreateLLMResponse</code>.
39
39
  * Response containing the created LLM and any informational status messages
40
40
  * @alias module:model/CreateLLMResponse
41
- * @param llm {module:model/LLMResponse}
41
+ * @param llm {module:model/LLMResponse} The created LLM configuration
42
42
  */
43
43
  function CreateLLMResponse(llm) {
44
44
  _classCallCheck(this, CreateLLMResponse);
@@ -69,7 +69,7 @@ var CreateLLMResponse = /*#__PURE__*/function () {
69
69
  if (data) {
70
70
  obj = obj || new CreateLLMResponse();
71
71
  if (data.hasOwnProperty('llm')) {
72
- obj['llm'] = _LLMResponse["default"].constructFromObject(data['llm']);
72
+ obj['llm'] = _ApiClient["default"].convertToType(data['llm'], _LLMResponse["default"]);
73
73
  }
74
74
  if (data.hasOwnProperty('statuses')) {
75
75
  obj['statuses'] = _ApiClient["default"].convertToType(data['statuses'], [_GoodMemStatus["default"]]);
@@ -134,6 +134,7 @@ var CreateLLMResponse = /*#__PURE__*/function () {
134
134
  CreateLLMResponse.RequiredProperties = ["llm"];
135
135
 
136
136
  /**
137
+ * The created LLM configuration
137
138
  * @member {module:model/LLMResponse} llm
138
139
  */
139
140
  CreateLLMResponse.prototype['llm'] = undefined;
@@ -41,11 +41,11 @@ var EmbedderCreationRequest = /*#__PURE__*/function () {
41
41
  * Request body for creating a new Embedder. An Embedder represents a configuration for vectorizing content.
42
42
  * @alias module:model/EmbedderCreationRequest
43
43
  * @param displayName {String} User-facing name of the embedder
44
- * @param providerType {module:model/ProviderType}
44
+ * @param providerType {module:model/ProviderType} Type of embedding provider
45
45
  * @param endpointUrl {String} API endpoint URL
46
46
  * @param modelIdentifier {String} Model identifier
47
47
  * @param dimensionality {Number} Output vector dimensions
48
- * @param distributionType {module:model/DistributionType}
48
+ * @param distributionType {module:model/DistributionType} Type of embedding distribution (DENSE or SPARSE)
49
49
  */
50
50
  function EmbedderCreationRequest(displayName, providerType, endpointUrl, modelIdentifier, dimensionality, distributionType) {
51
51
  _classCallCheck(this, EmbedderCreationRequest);
@@ -87,7 +87,7 @@ var EmbedderCreationRequest = /*#__PURE__*/function () {
87
87
  obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
88
88
  }
89
89
  if (data.hasOwnProperty('providerType')) {
90
- obj['providerType'] = _ProviderType["default"].constructFromObject(data['providerType']);
90
+ obj['providerType'] = _ApiClient["default"].convertToType(data['providerType'], _ProviderType["default"]);
91
91
  }
92
92
  if (data.hasOwnProperty('endpointUrl')) {
93
93
  obj['endpointUrl'] = _ApiClient["default"].convertToType(data['endpointUrl'], 'String');
@@ -102,7 +102,7 @@ var EmbedderCreationRequest = /*#__PURE__*/function () {
102
102
  obj['dimensionality'] = _ApiClient["default"].convertToType(data['dimensionality'], 'Number');
103
103
  }
104
104
  if (data.hasOwnProperty('distributionType')) {
105
- obj['distributionType'] = _DistributionType["default"].constructFromObject(data['distributionType']);
105
+ obj['distributionType'] = _ApiClient["default"].convertToType(data['distributionType'], _DistributionType["default"]);
106
106
  }
107
107
  if (data.hasOwnProperty('maxSequenceLength')) {
108
108
  obj['maxSequenceLength'] = _ApiClient["default"].convertToType(data['maxSequenceLength'], 'Number');
@@ -111,7 +111,7 @@ var EmbedderCreationRequest = /*#__PURE__*/function () {
111
111
  obj['supportedModalities'] = _ApiClient["default"].convertToType(data['supportedModalities'], [_Modality["default"]]);
112
112
  }
113
113
  if (data.hasOwnProperty('credentials')) {
114
- obj['credentials'] = _EndpointAuthentication["default"].constructFromObject(data['credentials']);
114
+ obj['credentials'] = _ApiClient["default"].convertToType(data['credentials'], _EndpointAuthentication["default"]);
115
115
  }
116
116
  if (data.hasOwnProperty('labels')) {
117
117
  obj['labels'] = _ApiClient["default"].convertToType(data['labels'], {
@@ -221,6 +221,7 @@ EmbedderCreationRequest.prototype['displayName'] = undefined;
221
221
  EmbedderCreationRequest.prototype['description'] = undefined;
222
222
 
223
223
  /**
224
+ * Type of embedding provider
224
225
  * @member {module:model/ProviderType} providerType
225
226
  */
226
227
  EmbedderCreationRequest.prototype['providerType'] = undefined;
@@ -250,6 +251,7 @@ EmbedderCreationRequest.prototype['modelIdentifier'] = undefined;
250
251
  EmbedderCreationRequest.prototype['dimensionality'] = undefined;
251
252
 
252
253
  /**
254
+ * Type of embedding distribution (DENSE or SPARSE)
253
255
  * @member {module:model/DistributionType} distributionType
254
256
  */
255
257
  EmbedderCreationRequest.prototype['distributionType'] = undefined;
@@ -267,6 +269,7 @@ EmbedderCreationRequest.prototype['maxSequenceLength'] = undefined;
267
269
  EmbedderCreationRequest.prototype['supportedModalities'] = undefined;
268
270
 
269
271
  /**
272
+ * Structured credential payload describing how to authenticate with the provider. Required for SaaS providers such as COHERE, JINA, and VOYAGE; optional for local or proxy providers.
270
273
  * @member {module:model/EndpointAuthentication} credentials
271
274
  */
272
275
  EmbedderCreationRequest.prototype['credentials'] = undefined;