@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
@@ -38,7 +38,7 @@ var BackgroundJobSummary = /*#__PURE__*/function () {
38
38
  * @alias module:model/BackgroundJobSummary
39
39
  * @param jobId {Number} Database identifier of the background job
40
40
  * @param jobType {String} Logical job type dispatched by the background job framework
41
- * @param status {String} Current status of the background job
41
+ * @param status {module:model/BackgroundJobSummary.StatusEnum} Current status of the background job
42
42
  * @param attempts {Number} Number of attempts started so far
43
43
  * @param maxAttempts {Number} Maximum number of attempts allowed for this job
44
44
  */
@@ -167,7 +167,7 @@ BackgroundJobSummary.prototype['jobType'] = undefined;
167
167
 
168
168
  /**
169
169
  * Current status of the background job
170
- * @member {String} status
170
+ * @member {module:model/BackgroundJobSummary.StatusEnum} status
171
171
  */
172
172
  BackgroundJobSummary.prototype['status'] = undefined;
173
173
 
@@ -212,4 +212,37 @@ BackgroundJobSummary.prototype['lastError'] = undefined;
212
212
  * @member {Number} updatedAt
213
213
  */
214
214
  BackgroundJobSummary.prototype['updatedAt'] = undefined;
215
+
216
+ /**
217
+ * Allowed values for the <code>status</code> property.
218
+ * @enum {String}
219
+ * @readonly
220
+ */
221
+ BackgroundJobSummary['StatusEnum'] = {
222
+ /**
223
+ * value: "BACKGROUND_JOB_PENDING"
224
+ * @const
225
+ */
226
+ "BACKGROUND_JOB_PENDING": "BACKGROUND_JOB_PENDING",
227
+ /**
228
+ * value: "BACKGROUND_JOB_RUNNING"
229
+ * @const
230
+ */
231
+ "BACKGROUND_JOB_RUNNING": "BACKGROUND_JOB_RUNNING",
232
+ /**
233
+ * value: "BACKGROUND_JOB_SUCCEEDED"
234
+ * @const
235
+ */
236
+ "BACKGROUND_JOB_SUCCEEDED": "BACKGROUND_JOB_SUCCEEDED",
237
+ /**
238
+ * value: "BACKGROUND_JOB_FAILED"
239
+ * @const
240
+ */
241
+ "BACKGROUND_JOB_FAILED": "BACKGROUND_JOB_FAILED",
242
+ /**
243
+ * value: "BACKGROUND_JOB_CANCELED"
244
+ * @const
245
+ */
246
+ "BACKGROUND_JOB_CANCELED": "BACKGROUND_JOB_CANCELED"
247
+ };
215
248
  var _default = exports["default"] = BackgroundJobSummary;
@@ -65,7 +65,7 @@ var BatchDeleteMemorySelectorRequest = /*#__PURE__*/function () {
65
65
  obj['memoryId'] = _ApiClient["default"].convertToType(data['memoryId'], 'String');
66
66
  }
67
67
  if (data.hasOwnProperty('filterSelector')) {
68
- obj['filterSelector'] = _FilteredDeleteMemorySelectorRequest["default"].constructFromObject(data['filterSelector']);
68
+ obj['filterSelector'] = _ApiClient["default"].convertToType(data['filterSelector'], _FilteredDeleteMemorySelectorRequest["default"]);
69
69
  }
70
70
  }
71
71
  return obj;
@@ -99,6 +99,7 @@ var BatchDeleteMemorySelectorRequest = /*#__PURE__*/function () {
99
99
  BatchDeleteMemorySelectorRequest.prototype['memoryId'] = undefined;
100
100
 
101
101
  /**
102
+ * Deletes a filtered set of memories within a specific space
102
103
  * @member {module:model/FilteredDeleteMemorySelectorRequest} filterSelector
103
104
  */
104
105
  BatchDeleteMemorySelectorRequest.prototype['filterSelector'] = undefined;
@@ -75,10 +75,10 @@ var BatchMemoryResult = /*#__PURE__*/function () {
75
75
  obj['memoryId'] = _ApiClient["default"].convertToType(data['memoryId'], 'String');
76
76
  }
77
77
  if (data.hasOwnProperty('memory')) {
78
- obj['memory'] = _Memory["default"].constructFromObject(data['memory']);
78
+ obj['memory'] = _ApiClient["default"].convertToType(data['memory'], _Memory["default"]);
79
79
  }
80
80
  if (data.hasOwnProperty('error')) {
81
- obj['error'] = _ErrorDetail["default"].constructFromObject(data['error']);
81
+ obj['error'] = _ApiClient["default"].convertToType(data['error'], _ErrorDetail["default"]);
82
82
  }
83
83
  }
84
84
  return obj;
@@ -140,11 +140,13 @@ BatchMemoryResult.prototype['success'] = undefined;
140
140
  BatchMemoryResult.prototype['memoryId'] = undefined;
141
141
 
142
142
  /**
143
+ * Created or retrieved memory (present when the operation returns a memory on success)
143
144
  * @member {module:model/Memory} memory
144
145
  */
145
146
  BatchMemoryResult.prototype['memory'] = undefined;
146
147
 
147
148
  /**
149
+ * Error details when success is false
148
150
  * @member {module:model/ErrorDetail} error
149
151
  */
150
152
  BatchMemoryResult.prototype['error'] = undefined;
@@ -38,7 +38,7 @@ var ChunkReference = /*#__PURE__*/function () {
38
38
  * Reference to a memory chunk with pointer to its parent memory
39
39
  * @alias module:model/ChunkReference
40
40
  * @param resultSetId {String} Result set ID that produced this chunk
41
- * @param chunk {module:model/MemoryChunkResponse}
41
+ * @param chunk {module:model/MemoryChunkResponse} The memory chunk data
42
42
  * @param memoryIndex {Number} Index of the chunk's memory in the client's memories array
43
43
  * @param relevanceScore {Number} Relevance score for this chunk (0.0 to 1.0)
44
44
  */
@@ -77,7 +77,7 @@ var ChunkReference = /*#__PURE__*/function () {
77
77
  obj['resultSetId'] = _ApiClient["default"].convertToType(data['resultSetId'], 'String');
78
78
  }
79
79
  if (data.hasOwnProperty('chunk')) {
80
- obj['chunk'] = _MemoryChunkResponse["default"].constructFromObject(data['chunk']);
80
+ obj['chunk'] = _ApiClient["default"].convertToType(data['chunk'], _MemoryChunkResponse["default"]);
81
81
  }
82
82
  if (data.hasOwnProperty('memoryIndex')) {
83
83
  obj['memoryIndex'] = _ApiClient["default"].convertToType(data['memoryIndex'], 'Number');
@@ -134,6 +134,7 @@ ChunkReference.RequiredProperties = ["resultSetId", "chunk", "memoryIndex", "rel
134
134
  ChunkReference.prototype['resultSetId'] = undefined;
135
135
 
136
136
  /**
137
+ * The memory chunk data
137
138
  * @member {module:model/MemoryChunkResponse} chunk
138
139
  */
139
140
  ChunkReference.prototype['chunk'] = undefined;
@@ -5,13 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _ChunkingConfigurationOneOf = _interopRequireDefault(require("./ChunkingConfigurationOneOf"));
9
+ var _ChunkingConfigurationOneOf2 = _interopRequireDefault(require("./ChunkingConfigurationOneOf1"));
10
+ var _ChunkingConfigurationOneOf3 = _interopRequireDefault(require("./ChunkingConfigurationOneOf2"));
8
11
  var _RecursiveChunkingConfiguration = _interopRequireDefault(require("./RecursiveChunkingConfiguration"));
9
12
  var _SentenceChunkingConfiguration = _interopRequireDefault(require("./SentenceChunkingConfiguration"));
13
+ var _ChunkingConfiguration;
10
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
15
  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
16
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13
17
  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); } }
14
18
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
19
+ 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; }
15
20
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16
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); } /**
17
22
  *
@@ -33,83 +38,140 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
33
38
  var ChunkingConfiguration = /*#__PURE__*/function () {
34
39
  /**
35
40
  * Constructs a new <code>ChunkingConfiguration</code>.
36
- * Configuration for text chunking strategy used when processing content
41
+ * Configuration for text chunking strategy used when processing content. Exactly one of none, recursive, or sentence must be provided.
37
42
  * @alias module:model/ChunkingConfiguration
43
+ * @param {(module:model/ChunkingConfigurationOneOf|module:model/ChunkingConfigurationOneOf1|module:model/ChunkingConfigurationOneOf2)} instance The actual instance to initialize ChunkingConfiguration.
38
44
  */
39
45
  function ChunkingConfiguration() {
46
+ var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
40
47
  _classCallCheck(this, ChunkingConfiguration);
41
- ChunkingConfiguration.initialize(this);
48
+ /**
49
+ * Returns the JSON representation of the actual instance.
50
+ * @return {string}
51
+ */
52
+ _defineProperty(this, "toJSON", function () {
53
+ return this.getActualInstance();
54
+ });
55
+ if (instance === null) {
56
+ this.actualInstance = null;
57
+ return;
58
+ }
59
+ var match = 0;
60
+ var errorMessages = [];
61
+ try {
62
+ if (instance instanceof _ChunkingConfigurationOneOf["default"]) {
63
+ this.actualInstance = instance;
64
+ } else {
65
+ // plain JS object
66
+ // validate the object
67
+ _ChunkingConfigurationOneOf["default"].validateJSON(instance); // throw an exception if no match
68
+ // create ChunkingConfigurationOneOf from JS object
69
+ this.actualInstance = _ChunkingConfigurationOneOf["default"].constructFromObject(instance);
70
+ }
71
+ match++;
72
+ } catch (err) {
73
+ // json data failed to deserialize into ChunkingConfigurationOneOf
74
+ errorMessages.push("Failed to construct ChunkingConfigurationOneOf: " + err);
75
+ }
76
+ try {
77
+ if (instance instanceof _ChunkingConfigurationOneOf2["default"]) {
78
+ this.actualInstance = instance;
79
+ } else {
80
+ // plain JS object
81
+ // validate the object
82
+ _ChunkingConfigurationOneOf2["default"].validateJSON(instance); // throw an exception if no match
83
+ // create ChunkingConfigurationOneOf1 from JS object
84
+ this.actualInstance = _ChunkingConfigurationOneOf2["default"].constructFromObject(instance);
85
+ }
86
+ match++;
87
+ } catch (err) {
88
+ // json data failed to deserialize into ChunkingConfigurationOneOf1
89
+ errorMessages.push("Failed to construct ChunkingConfigurationOneOf1: " + err);
90
+ }
91
+ try {
92
+ if (instance instanceof _ChunkingConfigurationOneOf3["default"]) {
93
+ this.actualInstance = instance;
94
+ } else {
95
+ // plain JS object
96
+ // validate the object
97
+ _ChunkingConfigurationOneOf3["default"].validateJSON(instance); // throw an exception if no match
98
+ // create ChunkingConfigurationOneOf2 from JS object
99
+ this.actualInstance = _ChunkingConfigurationOneOf3["default"].constructFromObject(instance);
100
+ }
101
+ match++;
102
+ } catch (err) {
103
+ // json data failed to deserialize into ChunkingConfigurationOneOf2
104
+ errorMessages.push("Failed to construct ChunkingConfigurationOneOf2: " + err);
105
+ }
106
+ if (match > 1) {
107
+ throw new Error("Multiple matches found constructing `ChunkingConfiguration` with oneOf schemas ChunkingConfigurationOneOf, ChunkingConfigurationOneOf1, ChunkingConfigurationOneOf2. Input: " + JSON.stringify(instance));
108
+ } else if (match === 0) {
109
+ this.actualInstance = null; // clear the actual instance in case there are multiple matches
110
+ throw new Error("No match found constructing `ChunkingConfiguration` with oneOf schemas ChunkingConfigurationOneOf, ChunkingConfigurationOneOf1, ChunkingConfigurationOneOf2. Details: " + errorMessages.join(", "));
111
+ } else {// only 1 match
112
+ // the input is valid
113
+ }
42
114
  }
43
115
 
44
116
  /**
45
- * Initializes the fields of this object.
46
- * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
47
- * Only for internal use.
117
+ * Constructs a <code>ChunkingConfiguration</code> from a plain JavaScript object, optionally creating a new instance.
118
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
119
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
120
+ * @param {module:model/ChunkingConfiguration} obj Optional instance to populate.
121
+ * @return {module:model/ChunkingConfiguration} The populated <code>ChunkingConfiguration</code> instance.
48
122
  */
49
- return _createClass(ChunkingConfiguration, null, [{
50
- key: "initialize",
51
- value: function initialize(obj) {}
52
-
123
+ return _createClass(ChunkingConfiguration, [{
124
+ key: "getActualInstance",
125
+ value:
53
126
  /**
54
- * Constructs a <code>ChunkingConfiguration</code> from a plain JavaScript object, optionally creating a new instance.
55
- * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
56
- * @param {Object} data The plain JavaScript object bearing properties of interest.
57
- * @param {module:model/ChunkingConfiguration} obj Optional instance to populate.
58
- * @return {module:model/ChunkingConfiguration} The populated <code>ChunkingConfiguration</code> instance.
127
+ * Gets the actual instance, which can be <code>ChunkingConfigurationOneOf</code>, <code>ChunkingConfigurationOneOf1</code>, <code>ChunkingConfigurationOneOf2</code>.
128
+ * @return {(module:model/ChunkingConfigurationOneOf|module:model/ChunkingConfigurationOneOf1|module:model/ChunkingConfigurationOneOf2)} The actual instance.
59
129
  */
60
- }, {
61
- key: "constructFromObject",
62
- value: function constructFromObject(data, obj) {
63
- if (data) {
64
- obj = obj || new ChunkingConfiguration();
65
- if (data.hasOwnProperty('none')) {
66
- obj['none'] = _ApiClient["default"].convertToType(data['none'], Object);
67
- }
68
- if (data.hasOwnProperty('recursive')) {
69
- obj['recursive'] = _RecursiveChunkingConfiguration["default"].constructFromObject(data['recursive']);
70
- }
71
- if (data.hasOwnProperty('sentence')) {
72
- obj['sentence'] = _SentenceChunkingConfiguration["default"].constructFromObject(data['sentence']);
73
- }
74
- }
75
- return obj;
130
+ function getActualInstance() {
131
+ return this.actualInstance;
76
132
  }
77
133
 
78
134
  /**
79
- * Validates the JSON data with respect to <code>ChunkingConfiguration</code>.
80
- * @param {Object} data The plain JavaScript object bearing properties of interest.
81
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ChunkingConfiguration</code>.
135
+ * Sets the actual instance, which can be <code>ChunkingConfigurationOneOf</code>, <code>ChunkingConfigurationOneOf1</code>, <code>ChunkingConfigurationOneOf2</code>.
136
+ * @param {(module:model/ChunkingConfigurationOneOf|module:model/ChunkingConfigurationOneOf1|module:model/ChunkingConfigurationOneOf2)} obj The actual instance.
82
137
  */
83
138
  }, {
84
- key: "validateJSON",
85
- value: function validateJSON(data) {
86
- // validate the optional field `recursive`
87
- if (data['recursive']) {
88
- // data not null
89
- _RecursiveChunkingConfiguration["default"].validateJSON(data['recursive']);
90
- }
91
- // validate the optional field `sentence`
92
- if (data['sentence']) {
93
- // data not null
94
- _SentenceChunkingConfiguration["default"].validateJSON(data['sentence']);
95
- }
96
- return true;
139
+ key: "setActualInstance",
140
+ value: function setActualInstance(obj) {
141
+ this.actualInstance = ChunkingConfiguration.constructFromObject(obj).getActualInstance();
142
+ }
143
+ }], [{
144
+ key: "constructFromObject",
145
+ value: function constructFromObject(data, obj) {
146
+ return new ChunkingConfiguration(data);
97
147
  }
98
148
  }]);
99
149
  }();
100
150
  /**
101
- * No chunking strategy - preserves original content as a single unit
151
+ * No chunking strategy - preserve original content as single unit
102
152
  * @member {Object} none
103
153
  */
154
+ _ChunkingConfiguration = ChunkingConfiguration;
155
+ /**
156
+ * Create an instance of ChunkingConfiguration from a JSON string.
157
+ * @param {string} json_string JSON string.
158
+ * @return {module:model/ChunkingConfiguration} An instance of ChunkingConfiguration.
159
+ */
160
+ _defineProperty(ChunkingConfiguration, "fromJSON", function (json_string) {
161
+ return _ChunkingConfiguration.constructFromObject(JSON.parse(json_string));
162
+ });
104
163
  ChunkingConfiguration.prototype['none'] = undefined;
105
164
 
106
165
  /**
166
+ * Recursive hierarchical chunking strategy with configurable separators
107
167
  * @member {module:model/RecursiveChunkingConfiguration} recursive
108
168
  */
109
169
  ChunkingConfiguration.prototype['recursive'] = undefined;
110
170
 
111
171
  /**
172
+ * Sentence-based chunking strategy with language detection
112
173
  * @member {module:model/SentenceChunkingConfiguration} sentence
113
174
  */
114
175
  ChunkingConfiguration.prototype['sentence'] = undefined;
176
+ ChunkingConfiguration.OneOf = ["ChunkingConfigurationOneOf", "ChunkingConfigurationOneOf1", "ChunkingConfigurationOneOf2"];
115
177
  var _default = exports["default"] = ChunkingConfiguration;
@@ -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 ChunkingConfigurationOneOf model module.
31
+ * @module model/ChunkingConfigurationOneOf
32
+ * @version 1.0.0
33
+ */
34
+ var ChunkingConfigurationOneOf = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>ChunkingConfigurationOneOf</code>.
37
+ * @alias module:model/ChunkingConfigurationOneOf
38
+ * @param none {Object}
39
+ */
40
+ function ChunkingConfigurationOneOf(none) {
41
+ _classCallCheck(this, ChunkingConfigurationOneOf);
42
+ ChunkingConfigurationOneOf.initialize(this, none);
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(ChunkingConfigurationOneOf, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, none) {
53
+ obj['none'] = none;
54
+ }
55
+
56
+ /**
57
+ * Constructs a <code>ChunkingConfigurationOneOf</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/ChunkingConfigurationOneOf} obj Optional instance to populate.
61
+ * @return {module:model/ChunkingConfigurationOneOf} The populated <code>ChunkingConfigurationOneOf</code> instance.
62
+ */
63
+ }, {
64
+ key: "constructFromObject",
65
+ value: function constructFromObject(data, obj) {
66
+ if (data) {
67
+ obj = obj || new ChunkingConfigurationOneOf();
68
+ if (data.hasOwnProperty('none')) {
69
+ obj['none'] = _ApiClient["default"].convertToType(data['none'], Object);
70
+ }
71
+ }
72
+ return obj;
73
+ }
74
+
75
+ /**
76
+ * Validates the JSON data with respect to <code>ChunkingConfigurationOneOf</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>ChunkingConfigurationOneOf</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(ChunkingConfigurationOneOf.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
+ ChunkingConfigurationOneOf.RequiredProperties = ["none"];
104
+
105
+ /**
106
+ * @member {Object} none
107
+ */
108
+ ChunkingConfigurationOneOf.prototype['none'] = undefined;
109
+ var _default = exports["default"] = ChunkingConfigurationOneOf;
@@ -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 ChunkingConfigurationOneOf1 model module.
31
+ * @module model/ChunkingConfigurationOneOf1
32
+ * @version 1.0.0
33
+ */
34
+ var ChunkingConfigurationOneOf1 = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>ChunkingConfigurationOneOf1</code>.
37
+ * @alias module:model/ChunkingConfigurationOneOf1
38
+ * @param recursive {Object}
39
+ */
40
+ function ChunkingConfigurationOneOf1(recursive) {
41
+ _classCallCheck(this, ChunkingConfigurationOneOf1);
42
+ ChunkingConfigurationOneOf1.initialize(this, recursive);
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(ChunkingConfigurationOneOf1, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, recursive) {
53
+ obj['recursive'] = recursive;
54
+ }
55
+
56
+ /**
57
+ * Constructs a <code>ChunkingConfigurationOneOf1</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/ChunkingConfigurationOneOf1} obj Optional instance to populate.
61
+ * @return {module:model/ChunkingConfigurationOneOf1} The populated <code>ChunkingConfigurationOneOf1</code> instance.
62
+ */
63
+ }, {
64
+ key: "constructFromObject",
65
+ value: function constructFromObject(data, obj) {
66
+ if (data) {
67
+ obj = obj || new ChunkingConfigurationOneOf1();
68
+ if (data.hasOwnProperty('recursive')) {
69
+ obj['recursive'] = _ApiClient["default"].convertToType(data['recursive'], Object);
70
+ }
71
+ }
72
+ return obj;
73
+ }
74
+
75
+ /**
76
+ * Validates the JSON data with respect to <code>ChunkingConfigurationOneOf1</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>ChunkingConfigurationOneOf1</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(ChunkingConfigurationOneOf1.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
+ ChunkingConfigurationOneOf1.RequiredProperties = ["recursive"];
104
+
105
+ /**
106
+ * @member {Object} recursive
107
+ */
108
+ ChunkingConfigurationOneOf1.prototype['recursive'] = undefined;
109
+ var _default = exports["default"] = ChunkingConfigurationOneOf1;