@pairsystems/goodmem-client 1.0.0-beta.1 → 1.0.0-dev.cb052d6

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 (61) hide show
  1. package/README.md +100 -82
  2. package/dist/ApiClient.js +33 -52
  3. package/dist/api/APIKeysApi.js +72 -51
  4. package/dist/api/EmbeddersApi.js +93 -63
  5. package/dist/api/MemoriesApi.js +263 -80
  6. package/dist/api/RerankersApi.js +262 -0
  7. package/dist/api/SpacesApi.js +100 -66
  8. package/dist/api/SystemApi.js +24 -18
  9. package/dist/api/UsersApi.js +100 -26
  10. package/dist/client.js +26 -1
  11. package/dist/index.js +181 -0
  12. package/dist/model/AbstractReply.js +138 -0
  13. package/dist/model/ApiKeyResponse.js +5 -5
  14. package/dist/model/BatchMemoryCreationRequest.js +5 -5
  15. package/dist/model/BatchMemoryDeletionRequest.js +5 -5
  16. package/dist/model/BatchMemoryRetrievalRequest.js +5 -5
  17. package/dist/model/BinaryContent.js +129 -0
  18. package/dist/model/ChunkReference.js +152 -0
  19. package/dist/model/ChunkingConfiguration.js +115 -0
  20. package/dist/model/ContextItem.js +136 -0
  21. package/dist/model/CreateApiKeyRequest.js +5 -5
  22. package/dist/model/CreateApiKeyResponse.js +5 -5
  23. package/dist/model/DistributionType.js +58 -0
  24. package/dist/model/EmbedderCreationRequest.js +20 -9
  25. package/dist/model/EmbedderResponse.js +20 -9
  26. package/dist/model/EmbedderWeight.js +125 -0
  27. package/dist/model/GoodMemStatus.js +129 -0
  28. package/dist/model/LengthMeasurement.js +63 -0
  29. package/dist/model/ListApiKeysResponse.js +5 -5
  30. package/dist/model/ListEmbeddersResponse.js +5 -5
  31. package/dist/model/ListRerankersResponse.js +132 -0
  32. package/dist/model/ListSpacesResponse.js +5 -5
  33. package/dist/model/Memory.js +23 -15
  34. package/dist/model/MemoryChunkResponse.js +240 -0
  35. package/dist/model/MemoryCreationRequest.js +21 -9
  36. package/dist/model/MemoryListResponse.js +5 -5
  37. package/dist/model/Modality.js +4 -4
  38. package/dist/model/PostProcessor.js +125 -0
  39. package/dist/model/ProviderType.js +9 -4
  40. package/dist/model/RecursiveChunkingConfiguration.js +165 -0
  41. package/dist/model/RerankerCreationRequest.js +266 -0
  42. package/dist/model/RerankerResponse.js +316 -0
  43. package/dist/model/ResultSetBoundary.js +153 -0
  44. package/dist/model/RetrieveMemoryEvent.js +148 -0
  45. package/dist/model/RetrieveMemoryRequest.js +219 -0
  46. package/dist/model/RetrievedItem.js +106 -0
  47. package/dist/model/SentenceChunkingConfiguration.js +141 -0
  48. package/dist/model/SeparatorKeepStrategy.js +63 -0
  49. package/dist/model/Space.js +19 -5
  50. package/dist/model/SpaceCreationRequest.js +19 -5
  51. package/dist/model/SpaceEmbedder.js +5 -5
  52. package/dist/model/SpaceEmbedderConfig.js +5 -5
  53. package/dist/model/SpaceKey.js +145 -0
  54. package/dist/model/SystemInitResponse.js +5 -5
  55. package/dist/model/UpdateApiKeyRequest.js +5 -5
  56. package/dist/model/UpdateEmbedderRequest.js +5 -5
  57. package/dist/model/UpdateRerankerRequest.js +226 -0
  58. package/dist/model/UpdateSpaceRequest.js +22 -44
  59. package/dist/model/UserResponse.js +5 -5
  60. package/dist/streaming.js +649 -0
  61. package/package.json +4 -36
@@ -13,11 +13,11 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
13
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
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
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
- * GoodMem API
17
- * API for interacting with the GoodMem service, providing vector-based memory storage and retrieval with multiple embedder support. The service enables creation of memory spaces, storing memories with vector representations, and efficient similarity-based retrieval.
16
+ *
17
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
18
18
  *
19
- * The version of the OpenAPI document: v1
20
- * Contact: support@goodmem.io
19
+ * The version of the OpenAPI document:
20
+ *
21
21
  *
22
22
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23
23
  * https://openapi-generator.tech
@@ -0,0 +1,125 @@
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 PostProcessor model module.
31
+ * @module model/PostProcessor
32
+ * @version 1.0.0
33
+ */
34
+ var PostProcessor = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>PostProcessor</code>.
37
+ * Post-processor configuration for transforming retrieval results.
38
+ * @alias module:model/PostProcessor
39
+ * @param name {String} Name of the post-processor to apply.
40
+ */
41
+ function PostProcessor(name) {
42
+ _classCallCheck(this, PostProcessor);
43
+ PostProcessor.initialize(this, name);
44
+ }
45
+
46
+ /**
47
+ * Initializes the fields of this object.
48
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
49
+ * Only for internal use.
50
+ */
51
+ return _createClass(PostProcessor, null, [{
52
+ key: "initialize",
53
+ value: function initialize(obj, name) {
54
+ obj['name'] = name;
55
+ }
56
+
57
+ /**
58
+ * Constructs a <code>PostProcessor</code> from a plain JavaScript object, optionally creating a new instance.
59
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
60
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
61
+ * @param {module:model/PostProcessor} obj Optional instance to populate.
62
+ * @return {module:model/PostProcessor} The populated <code>PostProcessor</code> instance.
63
+ */
64
+ }, {
65
+ key: "constructFromObject",
66
+ value: function constructFromObject(data, obj) {
67
+ if (data) {
68
+ obj = obj || new PostProcessor();
69
+ if (data.hasOwnProperty('name')) {
70
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
71
+ }
72
+ if (data.hasOwnProperty('config')) {
73
+ obj['config'] = _ApiClient["default"].convertToType(data['config'], {
74
+ 'String': Object
75
+ });
76
+ }
77
+ }
78
+ return obj;
79
+ }
80
+
81
+ /**
82
+ * Validates the JSON data with respect to <code>PostProcessor</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>PostProcessor</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(PostProcessor.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
+ // ensure the json data is a string
100
+ } catch (err) {
101
+ _iterator.e(err);
102
+ } finally {
103
+ _iterator.f();
104
+ }
105
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
106
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
107
+ }
108
+ return true;
109
+ }
110
+ }]);
111
+ }();
112
+ PostProcessor.RequiredProperties = ["name"];
113
+
114
+ /**
115
+ * Name of the post-processor to apply.
116
+ * @member {String} name
117
+ */
118
+ PostProcessor.prototype['name'] = undefined;
119
+
120
+ /**
121
+ * Configuration parameters for the post-processor.
122
+ * @member {Object.<String, Object>} config
123
+ */
124
+ PostProcessor.prototype['config'] = undefined;
125
+ var _default = exports["default"] = PostProcessor;
@@ -13,11 +13,11 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
13
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
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
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
- * GoodMem API
17
- * API for interacting with the GoodMem service, providing vector-based memory storage and retrieval with multiple embedder support. The service enables creation of memory spaces, storing memories with vector representations, and efficient similarity-based retrieval.
16
+ *
17
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
18
18
  *
19
- * The version of the OpenAPI document: v1
20
- * Contact: support@goodmem.io
19
+ * The version of the OpenAPI document:
20
+ *
21
21
  *
22
22
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23
23
  * https://openapi-generator.tech
@@ -47,6 +47,11 @@ var ProviderType = exports["default"] = /*#__PURE__*/function () {
47
47
  * @const
48
48
  */
49
49
  _defineProperty(this, "TEI", "TEI");
50
+ /**
51
+ * value: "LLAMA_CPP"
52
+ * @const
53
+ */
54
+ _defineProperty(this, "LLAMA_CPP", "LLAMA_CPP");
50
55
  }
51
56
  return _createClass(ProviderType, null, [{
52
57
  key: "constructFromObject",
@@ -0,0 +1,165 @@
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 _LengthMeasurement = _interopRequireDefault(require("./LengthMeasurement"));
9
+ var _SeparatorKeepStrategy = _interopRequireDefault(require("./SeparatorKeepStrategy"));
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 RecursiveChunkingConfiguration model module.
33
+ * @module model/RecursiveChunkingConfiguration
34
+ * @version 1.0.0
35
+ */
36
+ var RecursiveChunkingConfiguration = /*#__PURE__*/function () {
37
+ /**
38
+ * Constructs a new <code>RecursiveChunkingConfiguration</code>.
39
+ * Recursive hierarchical chunking strategy with configurable separators and overlap
40
+ * @alias module:model/RecursiveChunkingConfiguration
41
+ * @param chunkSize {Number} Maximum size of a chunk (should be ≤ context window)
42
+ * @param chunkOverlap {Number} Sliding overlap between chunks
43
+ * @param keepStrategy {module:model/SeparatorKeepStrategy}
44
+ * @param lengthMeasurement {module:model/LengthMeasurement}
45
+ */
46
+ function RecursiveChunkingConfiguration(chunkSize, chunkOverlap, keepStrategy, lengthMeasurement) {
47
+ _classCallCheck(this, RecursiveChunkingConfiguration);
48
+ RecursiveChunkingConfiguration.initialize(this, chunkSize, chunkOverlap, keepStrategy, lengthMeasurement);
49
+ }
50
+
51
+ /**
52
+ * Initializes the fields of this object.
53
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
54
+ * Only for internal use.
55
+ */
56
+ return _createClass(RecursiveChunkingConfiguration, null, [{
57
+ key: "initialize",
58
+ value: function initialize(obj, chunkSize, chunkOverlap, keepStrategy, lengthMeasurement) {
59
+ obj['chunkSize'] = chunkSize;
60
+ obj['chunkOverlap'] = chunkOverlap;
61
+ obj['keepStrategy'] = keepStrategy;
62
+ obj['lengthMeasurement'] = lengthMeasurement;
63
+ }
64
+
65
+ /**
66
+ * Constructs a <code>RecursiveChunkingConfiguration</code> from a plain JavaScript object, optionally creating a new instance.
67
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
68
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
69
+ * @param {module:model/RecursiveChunkingConfiguration} obj Optional instance to populate.
70
+ * @return {module:model/RecursiveChunkingConfiguration} The populated <code>RecursiveChunkingConfiguration</code> instance.
71
+ */
72
+ }, {
73
+ key: "constructFromObject",
74
+ value: function constructFromObject(data, obj) {
75
+ if (data) {
76
+ obj = obj || new RecursiveChunkingConfiguration();
77
+ if (data.hasOwnProperty('chunkSize')) {
78
+ obj['chunkSize'] = _ApiClient["default"].convertToType(data['chunkSize'], 'Number');
79
+ }
80
+ if (data.hasOwnProperty('chunkOverlap')) {
81
+ obj['chunkOverlap'] = _ApiClient["default"].convertToType(data['chunkOverlap'], 'Number');
82
+ }
83
+ if (data.hasOwnProperty('separators')) {
84
+ obj['separators'] = _ApiClient["default"].convertToType(data['separators'], ['String']);
85
+ }
86
+ if (data.hasOwnProperty('keepStrategy')) {
87
+ obj['keepStrategy'] = _SeparatorKeepStrategy["default"].constructFromObject(data['keepStrategy']);
88
+ }
89
+ if (data.hasOwnProperty('separatorIsRegex')) {
90
+ obj['separatorIsRegex'] = _ApiClient["default"].convertToType(data['separatorIsRegex'], 'Boolean');
91
+ }
92
+ if (data.hasOwnProperty('lengthMeasurement')) {
93
+ obj['lengthMeasurement'] = _LengthMeasurement["default"].constructFromObject(data['lengthMeasurement']);
94
+ }
95
+ }
96
+ return obj;
97
+ }
98
+
99
+ /**
100
+ * Validates the JSON data with respect to <code>RecursiveChunkingConfiguration</code>.
101
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
102
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>RecursiveChunkingConfiguration</code>.
103
+ */
104
+ }, {
105
+ key: "validateJSON",
106
+ value: function validateJSON(data) {
107
+ // check to make sure all required properties are present in the JSON string
108
+ var _iterator = _createForOfIteratorHelper(RecursiveChunkingConfiguration.RequiredProperties),
109
+ _step;
110
+ try {
111
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
112
+ var property = _step.value;
113
+ if (!data.hasOwnProperty(property)) {
114
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
115
+ }
116
+ }
117
+ // ensure the json data is an array
118
+ } catch (err) {
119
+ _iterator.e(err);
120
+ } finally {
121
+ _iterator.f();
122
+ }
123
+ if (!Array.isArray(data['separators'])) {
124
+ throw new Error("Expected the field `separators` to be an array in the JSON data but got " + data['separators']);
125
+ }
126
+ return true;
127
+ }
128
+ }]);
129
+ }();
130
+ RecursiveChunkingConfiguration.RequiredProperties = ["chunkSize", "chunkOverlap", "keepStrategy", "lengthMeasurement"];
131
+
132
+ /**
133
+ * Maximum size of a chunk (should be ≤ context window)
134
+ * @member {Number} chunkSize
135
+ */
136
+ RecursiveChunkingConfiguration.prototype['chunkSize'] = undefined;
137
+
138
+ /**
139
+ * Sliding overlap between chunks
140
+ * @member {Number} chunkOverlap
141
+ */
142
+ RecursiveChunkingConfiguration.prototype['chunkOverlap'] = undefined;
143
+
144
+ /**
145
+ * Hierarchical separator list (order = preference)
146
+ * @member {Array.<String>} separators
147
+ */
148
+ RecursiveChunkingConfiguration.prototype['separators'] = undefined;
149
+
150
+ /**
151
+ * @member {module:model/SeparatorKeepStrategy} keepStrategy
152
+ */
153
+ RecursiveChunkingConfiguration.prototype['keepStrategy'] = undefined;
154
+
155
+ /**
156
+ * Whether separators are regex patterns
157
+ * @member {Boolean} separatorIsRegex
158
+ */
159
+ RecursiveChunkingConfiguration.prototype['separatorIsRegex'] = undefined;
160
+
161
+ /**
162
+ * @member {module:model/LengthMeasurement} lengthMeasurement
163
+ */
164
+ RecursiveChunkingConfiguration.prototype['lengthMeasurement'] = undefined;
165
+ var _default = exports["default"] = RecursiveChunkingConfiguration;
@@ -0,0 +1,266 @@
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 _Modality = _interopRequireDefault(require("./Modality"));
9
+ var _ProviderType = _interopRequireDefault(require("./ProviderType"));
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 RerankerCreationRequest model module.
33
+ * @module model/RerankerCreationRequest
34
+ * @version 1.0.0
35
+ */
36
+ var RerankerCreationRequest = /*#__PURE__*/function () {
37
+ /**
38
+ * Constructs a new <code>RerankerCreationRequest</code>.
39
+ * Request body for creating a new Reranker. A Reranker represents a configuration for reranking search results.
40
+ * @alias module:model/RerankerCreationRequest
41
+ * @param displayName {String} User-facing name of the reranker
42
+ * @param providerType {module:model/ProviderType}
43
+ * @param endpointUrl {String} API endpoint URL
44
+ * @param modelIdentifier {String} Model identifier
45
+ */
46
+ function RerankerCreationRequest(displayName, providerType, endpointUrl, modelIdentifier) {
47
+ _classCallCheck(this, RerankerCreationRequest);
48
+ RerankerCreationRequest.initialize(this, displayName, providerType, endpointUrl, modelIdentifier);
49
+ }
50
+
51
+ /**
52
+ * Initializes the fields of this object.
53
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
54
+ * Only for internal use.
55
+ */
56
+ return _createClass(RerankerCreationRequest, null, [{
57
+ key: "initialize",
58
+ value: function initialize(obj, displayName, providerType, endpointUrl, modelIdentifier) {
59
+ obj['displayName'] = displayName;
60
+ obj['providerType'] = providerType;
61
+ obj['endpointUrl'] = endpointUrl;
62
+ obj['modelIdentifier'] = modelIdentifier;
63
+ }
64
+
65
+ /**
66
+ * Constructs a <code>RerankerCreationRequest</code> from a plain JavaScript object, optionally creating a new instance.
67
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
68
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
69
+ * @param {module:model/RerankerCreationRequest} obj Optional instance to populate.
70
+ * @return {module:model/RerankerCreationRequest} The populated <code>RerankerCreationRequest</code> instance.
71
+ */
72
+ }, {
73
+ key: "constructFromObject",
74
+ value: function constructFromObject(data, obj) {
75
+ if (data) {
76
+ obj = obj || new RerankerCreationRequest();
77
+ if (data.hasOwnProperty('validate')) {
78
+ obj['validate'] = _ApiClient["default"].convertToType(data['validate'], Object);
79
+ }
80
+ if (data.hasOwnProperty('displayName')) {
81
+ obj['displayName'] = _ApiClient["default"].convertToType(data['displayName'], 'String');
82
+ }
83
+ if (data.hasOwnProperty('description')) {
84
+ obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
85
+ }
86
+ if (data.hasOwnProperty('providerType')) {
87
+ obj['providerType'] = _ProviderType["default"].constructFromObject(data['providerType']);
88
+ }
89
+ if (data.hasOwnProperty('endpointUrl')) {
90
+ obj['endpointUrl'] = _ApiClient["default"].convertToType(data['endpointUrl'], 'String');
91
+ }
92
+ if (data.hasOwnProperty('apiPath')) {
93
+ obj['apiPath'] = _ApiClient["default"].convertToType(data['apiPath'], 'String');
94
+ }
95
+ if (data.hasOwnProperty('modelIdentifier')) {
96
+ obj['modelIdentifier'] = _ApiClient["default"].convertToType(data['modelIdentifier'], 'String');
97
+ }
98
+ if (data.hasOwnProperty('supportedModalities')) {
99
+ obj['supportedModalities'] = _ApiClient["default"].convertToType(data['supportedModalities'], [_Modality["default"]]);
100
+ }
101
+ if (data.hasOwnProperty('credentials')) {
102
+ obj['credentials'] = _ApiClient["default"].convertToType(data['credentials'], 'String');
103
+ }
104
+ if (data.hasOwnProperty('labels')) {
105
+ obj['labels'] = _ApiClient["default"].convertToType(data['labels'], {
106
+ 'String': 'String'
107
+ });
108
+ }
109
+ if (data.hasOwnProperty('version')) {
110
+ obj['version'] = _ApiClient["default"].convertToType(data['version'], 'String');
111
+ }
112
+ if (data.hasOwnProperty('monitoringEndpoint')) {
113
+ obj['monitoringEndpoint'] = _ApiClient["default"].convertToType(data['monitoringEndpoint'], 'String');
114
+ }
115
+ if (data.hasOwnProperty('ownerId')) {
116
+ obj['ownerId'] = _ApiClient["default"].convertToType(data['ownerId'], 'String');
117
+ }
118
+ }
119
+ return obj;
120
+ }
121
+
122
+ /**
123
+ * Validates the JSON data with respect to <code>RerankerCreationRequest</code>.
124
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
125
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>RerankerCreationRequest</code>.
126
+ */
127
+ }, {
128
+ key: "validateJSON",
129
+ value: function validateJSON(data) {
130
+ // check to make sure all required properties are present in the JSON string
131
+ var _iterator = _createForOfIteratorHelper(RerankerCreationRequest.RequiredProperties),
132
+ _step;
133
+ try {
134
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
135
+ var property = _step.value;
136
+ if (!data.hasOwnProperty(property)) {
137
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
138
+ }
139
+ }
140
+ // ensure the json data is a string
141
+ } catch (err) {
142
+ _iterator.e(err);
143
+ } finally {
144
+ _iterator.f();
145
+ }
146
+ if (data['displayName'] && !(typeof data['displayName'] === 'string' || data['displayName'] instanceof String)) {
147
+ throw new Error("Expected the field `displayName` to be a primitive type in the JSON string but got " + data['displayName']);
148
+ }
149
+ // ensure the json data is a string
150
+ if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
151
+ throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
152
+ }
153
+ // ensure the json data is a string
154
+ if (data['endpointUrl'] && !(typeof data['endpointUrl'] === 'string' || data['endpointUrl'] instanceof String)) {
155
+ throw new Error("Expected the field `endpointUrl` to be a primitive type in the JSON string but got " + data['endpointUrl']);
156
+ }
157
+ // ensure the json data is a string
158
+ if (data['apiPath'] && !(typeof data['apiPath'] === 'string' || data['apiPath'] instanceof String)) {
159
+ throw new Error("Expected the field `apiPath` to be a primitive type in the JSON string but got " + data['apiPath']);
160
+ }
161
+ // ensure the json data is a string
162
+ if (data['modelIdentifier'] && !(typeof data['modelIdentifier'] === 'string' || data['modelIdentifier'] instanceof String)) {
163
+ throw new Error("Expected the field `modelIdentifier` to be a primitive type in the JSON string but got " + data['modelIdentifier']);
164
+ }
165
+ // ensure the json data is an array
166
+ if (!Array.isArray(data['supportedModalities'])) {
167
+ throw new Error("Expected the field `supportedModalities` to be an array in the JSON data but got " + data['supportedModalities']);
168
+ }
169
+ // ensure the json data is a string
170
+ if (data['credentials'] && !(typeof data['credentials'] === 'string' || data['credentials'] instanceof String)) {
171
+ throw new Error("Expected the field `credentials` to be a primitive type in the JSON string but got " + data['credentials']);
172
+ }
173
+ // ensure the json data is a string
174
+ if (data['version'] && !(typeof data['version'] === 'string' || data['version'] instanceof String)) {
175
+ throw new Error("Expected the field `version` to be a primitive type in the JSON string but got " + data['version']);
176
+ }
177
+ // ensure the json data is a string
178
+ if (data['monitoringEndpoint'] && !(typeof data['monitoringEndpoint'] === 'string' || data['monitoringEndpoint'] instanceof String)) {
179
+ throw new Error("Expected the field `monitoringEndpoint` to be a primitive type in the JSON string but got " + data['monitoringEndpoint']);
180
+ }
181
+ // ensure the json data is a string
182
+ if (data['ownerId'] && !(typeof data['ownerId'] === 'string' || data['ownerId'] instanceof String)) {
183
+ throw new Error("Expected the field `ownerId` to be a primitive type in the JSON string but got " + data['ownerId']);
184
+ }
185
+ return true;
186
+ }
187
+ }]);
188
+ }();
189
+ RerankerCreationRequest.RequiredProperties = ["displayName", "providerType", "endpointUrl", "modelIdentifier"];
190
+
191
+ /**
192
+ * @member {Object} validate
193
+ */
194
+ RerankerCreationRequest.prototype['validate'] = undefined;
195
+
196
+ /**
197
+ * User-facing name of the reranker
198
+ * @member {String} displayName
199
+ */
200
+ RerankerCreationRequest.prototype['displayName'] = undefined;
201
+
202
+ /**
203
+ * Description of the reranker
204
+ * @member {String} description
205
+ */
206
+ RerankerCreationRequest.prototype['description'] = undefined;
207
+
208
+ /**
209
+ * @member {module:model/ProviderType} providerType
210
+ */
211
+ RerankerCreationRequest.prototype['providerType'] = undefined;
212
+
213
+ /**
214
+ * API endpoint URL
215
+ * @member {String} endpointUrl
216
+ */
217
+ RerankerCreationRequest.prototype['endpointUrl'] = undefined;
218
+
219
+ /**
220
+ * API path for reranking request (defaults to /rerank if not provided)
221
+ * @member {String} apiPath
222
+ */
223
+ RerankerCreationRequest.prototype['apiPath'] = undefined;
224
+
225
+ /**
226
+ * Model identifier
227
+ * @member {String} modelIdentifier
228
+ */
229
+ RerankerCreationRequest.prototype['modelIdentifier'] = undefined;
230
+
231
+ /**
232
+ * Supported content modalities (defaults to TEXT if not provided)
233
+ * @member {Array.<module:model/Modality>} supportedModalities
234
+ */
235
+ RerankerCreationRequest.prototype['supportedModalities'] = undefined;
236
+
237
+ /**
238
+ * API credentials (optional for local services)
239
+ * @member {String} credentials
240
+ */
241
+ RerankerCreationRequest.prototype['credentials'] = undefined;
242
+
243
+ /**
244
+ * User-defined labels for categorization
245
+ * @member {Object.<String, String>} labels
246
+ */
247
+ RerankerCreationRequest.prototype['labels'] = undefined;
248
+
249
+ /**
250
+ * Version information
251
+ * @member {String} version
252
+ */
253
+ RerankerCreationRequest.prototype['version'] = undefined;
254
+
255
+ /**
256
+ * Monitoring endpoint URL
257
+ * @member {String} monitoringEndpoint
258
+ */
259
+ RerankerCreationRequest.prototype['monitoringEndpoint'] = undefined;
260
+
261
+ /**
262
+ * Optional owner ID. If not provided, derived from the authentication context. Requires CREATE_RERANKER_ANY permission if specified.
263
+ * @member {String} ownerId
264
+ */
265
+ RerankerCreationRequest.prototype['ownerId'] = undefined;
266
+ var _default = exports["default"] = RerankerCreationRequest;