@pairsystems/goodmem-client 1.0.1-beta.3 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/dist/api/APIKeysApi.js +8 -8
- package/dist/api/EmbeddersApi.js +12 -12
- package/dist/api/MemoriesApi.js +103 -19
- package/dist/api/RerankersApi.js +12 -12
- package/dist/api/SpacesApi.js +18 -18
- package/dist/api/UsersApi.js +82 -15
- package/dist/client.js +15 -0
- package/dist/index.js +69 -0
- package/dist/model/BinaryContent.js +129 -0
- package/dist/model/ChunkReference.js +9 -6
- package/dist/model/ContextItem.js +136 -0
- package/dist/model/DistributionType.js +58 -0
- package/dist/model/EmbedderCreationRequest.js +15 -4
- package/dist/model/EmbedderResponse.js +15 -4
- package/dist/model/EmbedderWeight.js +125 -0
- package/dist/model/Memory.js +2 -6
- package/dist/model/MemoryChunkResponse.js +240 -0
- package/dist/model/PostProcessor.js +125 -0
- package/dist/model/ProviderType.js +5 -0
- package/dist/model/RetrieveMemoryEvent.js +8 -5
- package/dist/model/RetrieveMemoryRequest.js +219 -0
- package/dist/model/RetrievedItem.js +8 -5
- package/dist/model/SpaceKey.js +145 -0
- package/dist/streaming.js +649 -0
- package/package.json +3 -7
package/dist/api/SpacesApi.js
CHANGED
|
@@ -47,7 +47,7 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Create a new Space
|
|
50
|
-
* Creates a new space with the provided name, labels, and embedder configuration. A space is a container for organizing related memories.
|
|
50
|
+
* Creates a new space with the provided name, labels, and embedder configuration. A space is a container for organizing related memories. OWNER DEFAULTS: Owner defaults to authenticated user unless owner_id is provided (requires CREATE_SPACE_ANY if differs). EMBEDDER DEFAULTS: If no embedders are specified, a system-default embedder is attached. DUPLICATE DETECTION: Returns ALREADY_EXISTS if another space exists with identical {owner_id, name} (case-sensitive). Requires CREATE_SPACE_OWN permission (or CREATE_SPACE_ANY for admin users). This operation is NOT idempotent.
|
|
51
51
|
* @param {module:model/SpaceCreationRequest} spaceCreationRequest Space configuration details
|
|
52
52
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Space} and HTTP response
|
|
53
53
|
*/
|
|
@@ -72,7 +72,7 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Create a new Space
|
|
75
|
-
* Creates a new space with the provided name, labels, and embedder configuration. A space is a container for organizing related memories.
|
|
75
|
+
* Creates a new space with the provided name, labels, and embedder configuration. A space is a container for organizing related memories. OWNER DEFAULTS: Owner defaults to authenticated user unless owner_id is provided (requires CREATE_SPACE_ANY if differs). EMBEDDER DEFAULTS: If no embedders are specified, a system-default embedder is attached. DUPLICATE DETECTION: Returns ALREADY_EXISTS if another space exists with identical {owner_id, name} (case-sensitive). Requires CREATE_SPACE_OWN permission (or CREATE_SPACE_ANY for admin users). This operation is NOT idempotent.
|
|
76
76
|
* @param {module:model/SpaceCreationRequest} spaceCreationRequest Space configuration details
|
|
77
77
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Space}
|
|
78
78
|
*/
|
|
@@ -86,7 +86,7 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
88
|
* Delete a space
|
|
89
|
-
*
|
|
89
|
+
* Permanently deletes a space and all associated content. This operation cannot be undone. CASCADE DELETION: Removes the space record and cascades deletion to associated memories, chunks, and embedder associations. Requires DELETE_SPACE_OWN permission for spaces you own (or DELETE_SPACE_ANY for admin users). This operation is safe to retry - may return NOT_FOUND if already deleted.
|
|
90
90
|
* @param {String} id The unique identifier of the space to delete
|
|
91
91
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
|
92
92
|
*/
|
|
@@ -113,7 +113,7 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
115
|
* Delete a space
|
|
116
|
-
*
|
|
116
|
+
* Permanently deletes a space and all associated content. This operation cannot be undone. CASCADE DELETION: Removes the space record and cascades deletion to associated memories, chunks, and embedder associations. Requires DELETE_SPACE_OWN permission for spaces you own (or DELETE_SPACE_ANY for admin users). This operation is safe to retry - may return NOT_FOUND if already deleted.
|
|
117
117
|
* @param {String} id The unique identifier of the space to delete
|
|
118
118
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
|
119
119
|
*/
|
|
@@ -127,7 +127,7 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* Get a space by ID
|
|
130
|
-
* Retrieves a specific space by its unique identifier. Returns the complete space information, including name, labels, embedder configuration, and metadata.
|
|
130
|
+
* Retrieves a specific space by its unique identifier. Returns the complete space information, including name, labels, embedder configuration, and metadata. PUBLIC SPACE ACCESS: When public_read=true, any authenticated user can retrieve the space metadata, bypassing ownership checks. Otherwise, requires ownership or DISPLAY_SPACE_ANY permission. Requires DISPLAY_SPACE_OWN permission for owned spaces (or DISPLAY_SPACE_ANY for admin users to view any space). This is a read-only operation safe to retry.
|
|
131
131
|
* @param {String} id The unique identifier of the space to retrieve
|
|
132
132
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Space} and HTTP response
|
|
133
133
|
*/
|
|
@@ -154,7 +154,7 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* Get a space by ID
|
|
157
|
-
* Retrieves a specific space by its unique identifier. Returns the complete space information, including name, labels, embedder configuration, and metadata.
|
|
157
|
+
* Retrieves a specific space by its unique identifier. Returns the complete space information, including name, labels, embedder configuration, and metadata. PUBLIC SPACE ACCESS: When public_read=true, any authenticated user can retrieve the space metadata, bypassing ownership checks. Otherwise, requires ownership or DISPLAY_SPACE_ANY permission. Requires DISPLAY_SPACE_OWN permission for owned spaces (or DISPLAY_SPACE_ANY for admin users to view any space). This is a read-only operation safe to retry.
|
|
158
158
|
* @param {String} id The unique identifier of the space to retrieve
|
|
159
159
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Space}
|
|
160
160
|
*/
|
|
@@ -168,14 +168,14 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
168
168
|
|
|
169
169
|
/**
|
|
170
170
|
* List spaces
|
|
171
|
-
* Retrieves a list of spaces accessible to the caller, with optional filtering by owner, labels, and name. Results are paginated with a maximum number of spaces per response.
|
|
171
|
+
* Retrieves a list of spaces accessible to the caller, with optional filtering by owner, labels, and name. Results are paginated with a maximum number of spaces per response. PERMISSION-BASED FILTERING: With LIST_SPACE_ANY and owner_id omitted, returns all visible spaces; otherwise returns caller-owned spaces only. DEFAULT SORT: Results ordered by created_at DESCENDING unless specified otherwise. MAX_RESULTS CLAMPING: max_results defaults to 50 and is clamped to [1, 1000] range. Requires LIST_SPACE_OWN or LIST_SPACE_ANY permission.
|
|
172
172
|
* @param {Object} opts Optional parameters
|
|
173
|
-
* @param {String} [ownerId] Filter spaces by owner ID.
|
|
173
|
+
* @param {String} [ownerId] Filter spaces by owner ID. With LIST_SPACE_ANY permission and owner_id omitted, returns all visible spaces. Otherwise returns caller-owned spaces only. Specifying owner_id without LIST_SPACE_ANY returns PERMISSION_DENIED.
|
|
174
174
|
* @param {String} [nameFilter] Filter spaces by name using glob pattern matching
|
|
175
|
-
* @param {Number} [maxResults] Maximum number of results to return in a single page
|
|
175
|
+
* @param {Number} [maxResults] Maximum number of results to return in a single page (defaults to 50, clamped to [1, 1000])
|
|
176
176
|
* @param {String} [nextToken] Pagination token for retrieving the next set of results
|
|
177
|
-
* @param {String} [sortBy] Field to sort by.
|
|
178
|
-
* @param {String} [sortOrder] Sort order (ASCENDING or DESCENDING)
|
|
177
|
+
* @param {String} [sortBy] Field to sort by: 'created_at' or 'name' (default: 'created_at'). Unsupported values return INVALID_ARGUMENT.
|
|
178
|
+
* @param {String} [sortOrder] Sort order (ASCENDING or DESCENDING, default: DESCENDING)
|
|
179
179
|
* @param {String} [label] Filter by label value. Multiple label filters can be specified (e.g., ?label.project=AI&label.team=NLP)
|
|
180
180
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListSpacesResponse} and HTTP response
|
|
181
181
|
*/
|
|
@@ -205,14 +205,14 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
207
|
* List spaces
|
|
208
|
-
* Retrieves a list of spaces accessible to the caller, with optional filtering by owner, labels, and name. Results are paginated with a maximum number of spaces per response.
|
|
208
|
+
* Retrieves a list of spaces accessible to the caller, with optional filtering by owner, labels, and name. Results are paginated with a maximum number of spaces per response. PERMISSION-BASED FILTERING: With LIST_SPACE_ANY and owner_id omitted, returns all visible spaces; otherwise returns caller-owned spaces only. DEFAULT SORT: Results ordered by created_at DESCENDING unless specified otherwise. MAX_RESULTS CLAMPING: max_results defaults to 50 and is clamped to [1, 1000] range. Requires LIST_SPACE_OWN or LIST_SPACE_ANY permission.
|
|
209
209
|
* @param {Object} opts Optional parameters
|
|
210
|
-
* @param {String} opts.ownerId Filter spaces by owner ID.
|
|
210
|
+
* @param {String} opts.ownerId Filter spaces by owner ID. With LIST_SPACE_ANY permission and owner_id omitted, returns all visible spaces. Otherwise returns caller-owned spaces only. Specifying owner_id without LIST_SPACE_ANY returns PERMISSION_DENIED.
|
|
211
211
|
* @param {String} opts.nameFilter Filter spaces by name using glob pattern matching
|
|
212
|
-
* @param {Number} opts.maxResults Maximum number of results to return in a single page
|
|
212
|
+
* @param {Number} opts.maxResults Maximum number of results to return in a single page (defaults to 50, clamped to [1, 1000])
|
|
213
213
|
* @param {String} opts.nextToken Pagination token for retrieving the next set of results
|
|
214
|
-
* @param {String} opts.sortBy Field to sort by.
|
|
215
|
-
* @param {String} opts.sortOrder Sort order (ASCENDING or DESCENDING)
|
|
214
|
+
* @param {String} opts.sortBy Field to sort by: 'created_at' or 'name' (default: 'created_at'). Unsupported values return INVALID_ARGUMENT.
|
|
215
|
+
* @param {String} opts.sortOrder Sort order (ASCENDING or DESCENDING, default: DESCENDING)
|
|
216
216
|
* @param {String} opts.label Filter by label value. Multiple label filters can be specified (e.g., ?label.project=AI&label.team=NLP)
|
|
217
217
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListSpacesResponse}
|
|
218
218
|
*/
|
|
@@ -226,7 +226,7 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
226
226
|
|
|
227
227
|
/**
|
|
228
228
|
* Update a space
|
|
229
|
-
* Updates an existing space with new values for the specified fields. Fields not included in the request remain unchanged.
|
|
229
|
+
* Updates an existing space with new values for the specified fields. Only name, publicRead, and labels can be updated. Fields not included in the request remain unchanged. IMMUTABLE FIELDS: space_embedders, default_chunking_config, and owner_id cannot be modified after creation. NAME UNIQUENESS: Name must be unique per owner - returns ALREADY_EXISTS if name conflicts with existing space. Requires UPDATE_SPACE_OWN permission for spaces you own (or UPDATE_SPACE_ANY for admin users). This operation is idempotent.
|
|
230
230
|
* @param {String} id The unique identifier of the space to update
|
|
231
231
|
* @param {module:model/UpdateSpaceRequest} updateSpaceRequest Space update details
|
|
232
232
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Space} and HTTP response
|
|
@@ -258,7 +258,7 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
258
258
|
|
|
259
259
|
/**
|
|
260
260
|
* Update a space
|
|
261
|
-
* Updates an existing space with new values for the specified fields. Fields not included in the request remain unchanged.
|
|
261
|
+
* Updates an existing space with new values for the specified fields. Only name, publicRead, and labels can be updated. Fields not included in the request remain unchanged. IMMUTABLE FIELDS: space_embedders, default_chunking_config, and owner_id cannot be modified after creation. NAME UNIQUENESS: Name must be unique per owner - returns ALREADY_EXISTS if name conflicts with existing space. Requires UPDATE_SPACE_OWN permission for spaces you own (or UPDATE_SPACE_ANY for admin users). This operation is idempotent.
|
|
262
262
|
* @param {String} id The unique identifier of the space to update
|
|
263
263
|
* @param {module:model/UpdateSpaceRequest} updateSpaceRequest Space update details
|
|
264
264
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Space}
|
package/dist/api/UsersApi.js
CHANGED
|
@@ -43,17 +43,47 @@ var UsersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* Get
|
|
47
|
-
* Retrieves
|
|
48
|
-
* @param {String} id The unique identifier of the user to retrieve
|
|
49
|
-
* @param {Object} opts Optional parameters
|
|
50
|
-
* @param {String} [email] Alternative lookup by email address (if ID is not specified)
|
|
46
|
+
* Get current user profile
|
|
47
|
+
* Retrieves the authenticated user's profile information including email, display name, and creation time. This endpoint does not require any parameters as it automatically returns the caller's information.
|
|
51
48
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UserResponse} and HTTP response
|
|
52
49
|
*/
|
|
53
50
|
return _createClass(UsersApi, [{
|
|
51
|
+
key: "getCurrentUserWithHttpInfo",
|
|
52
|
+
value: function getCurrentUserWithHttpInfo() {
|
|
53
|
+
var postBody = null;
|
|
54
|
+
var pathParams = {};
|
|
55
|
+
var queryParams = {};
|
|
56
|
+
var headerParams = {};
|
|
57
|
+
var formParams = {};
|
|
58
|
+
var authNames = [];
|
|
59
|
+
var contentTypes = [];
|
|
60
|
+
var accepts = ['application/json'];
|
|
61
|
+
var returnType = _UserResponse["default"];
|
|
62
|
+
return this.apiClient.callApi('/v1/users/me', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Get current user profile
|
|
67
|
+
* Retrieves the authenticated user's profile information including email, display name, and creation time. This endpoint does not require any parameters as it automatically returns the caller's information.
|
|
68
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UserResponse}
|
|
69
|
+
*/
|
|
70
|
+
}, {
|
|
71
|
+
key: "getCurrentUser",
|
|
72
|
+
value: function getCurrentUser() {
|
|
73
|
+
return this.getCurrentUserWithHttpInfo().then(function (response_and_data) {
|
|
74
|
+
return response_and_data.data;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Get a user by ID
|
|
80
|
+
* Retrieves a specific user by their unique identifier. This endpoint only accepts user IDs - for email-based lookup, use GET /v1/users/email/{email}. For getting your own profile, use GET /v1/users/me.
|
|
81
|
+
* @param {String} id The unique identifier of the user to retrieve
|
|
82
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UserResponse} and HTTP response
|
|
83
|
+
*/
|
|
84
|
+
}, {
|
|
54
85
|
key: "getUserWithHttpInfo",
|
|
55
|
-
value: function getUserWithHttpInfo(id
|
|
56
|
-
opts = opts || {};
|
|
86
|
+
value: function getUserWithHttpInfo(id) {
|
|
57
87
|
var postBody = null;
|
|
58
88
|
// verify the required parameter 'id' is set
|
|
59
89
|
if (id === undefined || id === null) {
|
|
@@ -62,9 +92,7 @@ var UsersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
62
92
|
var pathParams = {
|
|
63
93
|
'id': id
|
|
64
94
|
};
|
|
65
|
-
var queryParams = {
|
|
66
|
-
'email': opts['email']
|
|
67
|
-
};
|
|
95
|
+
var queryParams = {};
|
|
68
96
|
var headerParams = {};
|
|
69
97
|
var formParams = {};
|
|
70
98
|
var authNames = [];
|
|
@@ -76,16 +104,55 @@ var UsersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
76
104
|
|
|
77
105
|
/**
|
|
78
106
|
* Get a user by ID
|
|
79
|
-
* Retrieves a specific user by their unique identifier.
|
|
107
|
+
* Retrieves a specific user by their unique identifier. This endpoint only accepts user IDs - for email-based lookup, use GET /v1/users/email/{email}. For getting your own profile, use GET /v1/users/me.
|
|
80
108
|
* @param {String} id The unique identifier of the user to retrieve
|
|
81
|
-
* @param {Object} opts Optional parameters
|
|
82
|
-
* @param {String} opts.email Alternative lookup by email address (if ID is not specified)
|
|
83
109
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UserResponse}
|
|
84
110
|
*/
|
|
85
111
|
}, {
|
|
86
112
|
key: "getUser",
|
|
87
|
-
value: function getUser(id
|
|
88
|
-
return this.getUserWithHttpInfo(id
|
|
113
|
+
value: function getUser(id) {
|
|
114
|
+
return this.getUserWithHttpInfo(id).then(function (response_and_data) {
|
|
115
|
+
return response_and_data.data;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Get user by email address
|
|
121
|
+
* Retrieves a user by their email address. The email must be URL-encoded if it contains special characters.
|
|
122
|
+
* @param {String} email The email address of the user to retrieve
|
|
123
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UserResponse} and HTTP response
|
|
124
|
+
*/
|
|
125
|
+
}, {
|
|
126
|
+
key: "getUserByEmailWithHttpInfo",
|
|
127
|
+
value: function getUserByEmailWithHttpInfo(email) {
|
|
128
|
+
var postBody = null;
|
|
129
|
+
// verify the required parameter 'email' is set
|
|
130
|
+
if (email === undefined || email === null) {
|
|
131
|
+
throw new Error("Missing the required parameter 'email' when calling getUserByEmail");
|
|
132
|
+
}
|
|
133
|
+
var pathParams = {
|
|
134
|
+
'email': email
|
|
135
|
+
};
|
|
136
|
+
var queryParams = {};
|
|
137
|
+
var headerParams = {};
|
|
138
|
+
var formParams = {};
|
|
139
|
+
var authNames = [];
|
|
140
|
+
var contentTypes = [];
|
|
141
|
+
var accepts = ['application/json'];
|
|
142
|
+
var returnType = _UserResponse["default"];
|
|
143
|
+
return this.apiClient.callApi('/v1/users/email/{email}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Get user by email address
|
|
148
|
+
* Retrieves a user by their email address. The email must be URL-encoded if it contains special characters.
|
|
149
|
+
* @param {String} email The email address of the user to retrieve
|
|
150
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UserResponse}
|
|
151
|
+
*/
|
|
152
|
+
}, {
|
|
153
|
+
key: "getUserByEmail",
|
|
154
|
+
value: function getUserByEmail(email) {
|
|
155
|
+
return this.getUserByEmailWithHttpInfo(email).then(function (response_and_data) {
|
|
89
156
|
return response_and_data.data;
|
|
90
157
|
});
|
|
91
158
|
}
|
package/dist/client.js
CHANGED
|
@@ -11,6 +11,7 @@ var _MemoriesApi = _interopRequireDefault(require("./api/MemoriesApi.js"));
|
|
|
11
11
|
var _SpacesApi = _interopRequireDefault(require("./api/SpacesApi.js"));
|
|
12
12
|
var _SystemApi = _interopRequireDefault(require("./api/SystemApi.js"));
|
|
13
13
|
var _UsersApi = _interopRequireDefault(require("./api/UsersApi.js"));
|
|
14
|
+
var _streaming = require("./streaming.js");
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
16
|
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); }
|
|
16
17
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -44,6 +45,9 @@ var Client = exports.Client = /*#__PURE__*/function () {
|
|
|
44
45
|
this._spacesApi = new _SpacesApi["default"](this._apiClient);
|
|
45
46
|
this._systemApi = new _SystemApi["default"](this._apiClient);
|
|
46
47
|
this._usersApi = new _UsersApi["default"](this._apiClient);
|
|
48
|
+
|
|
49
|
+
// Initialize streaming client
|
|
50
|
+
this._streamingClient = new _streaming.StreamingClient(this._apiClient);
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
/**
|
|
@@ -156,5 +160,16 @@ var Client = exports.Client = /*#__PURE__*/function () {
|
|
|
156
160
|
value: function getUsersApi() {
|
|
157
161
|
return this._usersApi;
|
|
158
162
|
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Gets the Streaming Client for memory streaming operations.
|
|
166
|
+
*
|
|
167
|
+
* @returns {StreamingClient} The StreamingClient instance
|
|
168
|
+
*/
|
|
169
|
+
}, {
|
|
170
|
+
key: "getStreamingClient",
|
|
171
|
+
value: function getStreamingClient() {
|
|
172
|
+
return this._streamingClient;
|
|
173
|
+
}
|
|
159
174
|
}]);
|
|
160
175
|
}();
|
package/dist/index.js
CHANGED
|
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "BatchMemoryRetrievalRequest", {
|
|
|
45
45
|
return _BatchMemoryRetrievalRequest["default"];
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "BinaryContent", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _BinaryContent["default"];
|
|
52
|
+
}
|
|
53
|
+
});
|
|
48
54
|
Object.defineProperty(exports, "ChunkReference", {
|
|
49
55
|
enumerable: true,
|
|
50
56
|
get: function get() {
|
|
@@ -57,6 +63,12 @@ Object.defineProperty(exports, "ChunkingConfiguration", {
|
|
|
57
63
|
return _ChunkingConfiguration["default"];
|
|
58
64
|
}
|
|
59
65
|
});
|
|
66
|
+
Object.defineProperty(exports, "ContextItem", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function get() {
|
|
69
|
+
return _ContextItem["default"];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
60
72
|
Object.defineProperty(exports, "CreateApiKeyRequest", {
|
|
61
73
|
enumerable: true,
|
|
62
74
|
get: function get() {
|
|
@@ -69,6 +81,12 @@ Object.defineProperty(exports, "CreateApiKeyResponse", {
|
|
|
69
81
|
return _CreateApiKeyResponse["default"];
|
|
70
82
|
}
|
|
71
83
|
});
|
|
84
|
+
Object.defineProperty(exports, "DistributionType", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function get() {
|
|
87
|
+
return _DistributionType["default"];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
72
90
|
Object.defineProperty(exports, "EmbedderCreationRequest", {
|
|
73
91
|
enumerable: true,
|
|
74
92
|
get: function get() {
|
|
@@ -81,6 +99,12 @@ Object.defineProperty(exports, "EmbedderResponse", {
|
|
|
81
99
|
return _EmbedderResponse["default"];
|
|
82
100
|
}
|
|
83
101
|
});
|
|
102
|
+
Object.defineProperty(exports, "EmbedderWeight", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function get() {
|
|
105
|
+
return _EmbedderWeight["default"];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
84
108
|
Object.defineProperty(exports, "EmbeddersApi", {
|
|
85
109
|
enumerable: true,
|
|
86
110
|
get: function get() {
|
|
@@ -135,6 +159,12 @@ Object.defineProperty(exports, "Memory", {
|
|
|
135
159
|
return _Memory["default"];
|
|
136
160
|
}
|
|
137
161
|
});
|
|
162
|
+
Object.defineProperty(exports, "MemoryChunkResponse", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function get() {
|
|
165
|
+
return _MemoryChunkResponse["default"];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
138
168
|
Object.defineProperty(exports, "MemoryCreationRequest", {
|
|
139
169
|
enumerable: true,
|
|
140
170
|
get: function get() {
|
|
@@ -153,6 +183,12 @@ Object.defineProperty(exports, "Modality", {
|
|
|
153
183
|
return _Modality["default"];
|
|
154
184
|
}
|
|
155
185
|
});
|
|
186
|
+
Object.defineProperty(exports, "PostProcessor", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function get() {
|
|
189
|
+
return _PostProcessor["default"];
|
|
190
|
+
}
|
|
191
|
+
});
|
|
156
192
|
Object.defineProperty(exports, "ProviderType", {
|
|
157
193
|
enumerable: true,
|
|
158
194
|
get: function get() {
|
|
@@ -195,6 +231,12 @@ Object.defineProperty(exports, "RetrieveMemoryEvent", {
|
|
|
195
231
|
return _RetrieveMemoryEvent["default"];
|
|
196
232
|
}
|
|
197
233
|
});
|
|
234
|
+
Object.defineProperty(exports, "RetrieveMemoryRequest", {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function get() {
|
|
237
|
+
return _RetrieveMemoryRequest["default"];
|
|
238
|
+
}
|
|
239
|
+
});
|
|
198
240
|
Object.defineProperty(exports, "RetrievedItem", {
|
|
199
241
|
enumerable: true,
|
|
200
242
|
get: function get() {
|
|
@@ -237,12 +279,30 @@ Object.defineProperty(exports, "SpaceEmbedderConfig", {
|
|
|
237
279
|
return _SpaceEmbedderConfig["default"];
|
|
238
280
|
}
|
|
239
281
|
});
|
|
282
|
+
Object.defineProperty(exports, "SpaceKey", {
|
|
283
|
+
enumerable: true,
|
|
284
|
+
get: function get() {
|
|
285
|
+
return _SpaceKey["default"];
|
|
286
|
+
}
|
|
287
|
+
});
|
|
240
288
|
Object.defineProperty(exports, "SpacesApi", {
|
|
241
289
|
enumerable: true,
|
|
242
290
|
get: function get() {
|
|
243
291
|
return _SpacesApi["default"];
|
|
244
292
|
}
|
|
245
293
|
});
|
|
294
|
+
Object.defineProperty(exports, "StreamError", {
|
|
295
|
+
enumerable: true,
|
|
296
|
+
get: function get() {
|
|
297
|
+
return _streaming.StreamError;
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
Object.defineProperty(exports, "StreamingClient", {
|
|
301
|
+
enumerable: true,
|
|
302
|
+
get: function get() {
|
|
303
|
+
return _streaming.StreamingClient;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
246
306
|
Object.defineProperty(exports, "SystemApi", {
|
|
247
307
|
enumerable: true,
|
|
248
308
|
get: function get() {
|
|
@@ -297,12 +357,16 @@ var _ApiKeyResponse = _interopRequireDefault(require("./model/ApiKeyResponse"));
|
|
|
297
357
|
var _BatchMemoryCreationRequest = _interopRequireDefault(require("./model/BatchMemoryCreationRequest"));
|
|
298
358
|
var _BatchMemoryDeletionRequest = _interopRequireDefault(require("./model/BatchMemoryDeletionRequest"));
|
|
299
359
|
var _BatchMemoryRetrievalRequest = _interopRequireDefault(require("./model/BatchMemoryRetrievalRequest"));
|
|
360
|
+
var _BinaryContent = _interopRequireDefault(require("./model/BinaryContent"));
|
|
300
361
|
var _ChunkReference = _interopRequireDefault(require("./model/ChunkReference"));
|
|
301
362
|
var _ChunkingConfiguration = _interopRequireDefault(require("./model/ChunkingConfiguration"));
|
|
363
|
+
var _ContextItem = _interopRequireDefault(require("./model/ContextItem"));
|
|
302
364
|
var _CreateApiKeyRequest = _interopRequireDefault(require("./model/CreateApiKeyRequest"));
|
|
303
365
|
var _CreateApiKeyResponse = _interopRequireDefault(require("./model/CreateApiKeyResponse"));
|
|
366
|
+
var _DistributionType = _interopRequireDefault(require("./model/DistributionType"));
|
|
304
367
|
var _EmbedderCreationRequest = _interopRequireDefault(require("./model/EmbedderCreationRequest"));
|
|
305
368
|
var _EmbedderResponse = _interopRequireDefault(require("./model/EmbedderResponse"));
|
|
369
|
+
var _EmbedderWeight = _interopRequireDefault(require("./model/EmbedderWeight"));
|
|
306
370
|
var _GoodMemStatus = _interopRequireDefault(require("./model/GoodMemStatus"));
|
|
307
371
|
var _LengthMeasurement = _interopRequireDefault(require("./model/LengthMeasurement"));
|
|
308
372
|
var _ListApiKeysResponse = _interopRequireDefault(require("./model/ListApiKeysResponse"));
|
|
@@ -310,15 +374,18 @@ var _ListEmbeddersResponse = _interopRequireDefault(require("./model/ListEmbedde
|
|
|
310
374
|
var _ListRerankersResponse = _interopRequireDefault(require("./model/ListRerankersResponse"));
|
|
311
375
|
var _ListSpacesResponse = _interopRequireDefault(require("./model/ListSpacesResponse"));
|
|
312
376
|
var _Memory = _interopRequireDefault(require("./model/Memory"));
|
|
377
|
+
var _MemoryChunkResponse = _interopRequireDefault(require("./model/MemoryChunkResponse"));
|
|
313
378
|
var _MemoryCreationRequest = _interopRequireDefault(require("./model/MemoryCreationRequest"));
|
|
314
379
|
var _MemoryListResponse = _interopRequireDefault(require("./model/MemoryListResponse"));
|
|
315
380
|
var _Modality = _interopRequireDefault(require("./model/Modality"));
|
|
381
|
+
var _PostProcessor = _interopRequireDefault(require("./model/PostProcessor"));
|
|
316
382
|
var _ProviderType = _interopRequireDefault(require("./model/ProviderType"));
|
|
317
383
|
var _RecursiveChunkingConfiguration = _interopRequireDefault(require("./model/RecursiveChunkingConfiguration"));
|
|
318
384
|
var _RerankerCreationRequest = _interopRequireDefault(require("./model/RerankerCreationRequest"));
|
|
319
385
|
var _RerankerResponse = _interopRequireDefault(require("./model/RerankerResponse"));
|
|
320
386
|
var _ResultSetBoundary = _interopRequireDefault(require("./model/ResultSetBoundary"));
|
|
321
387
|
var _RetrieveMemoryEvent = _interopRequireDefault(require("./model/RetrieveMemoryEvent"));
|
|
388
|
+
var _RetrieveMemoryRequest = _interopRequireDefault(require("./model/RetrieveMemoryRequest"));
|
|
322
389
|
var _RetrievedItem = _interopRequireDefault(require("./model/RetrievedItem"));
|
|
323
390
|
var _SentenceChunkingConfiguration = _interopRequireDefault(require("./model/SentenceChunkingConfiguration"));
|
|
324
391
|
var _SeparatorKeepStrategy = _interopRequireDefault(require("./model/SeparatorKeepStrategy"));
|
|
@@ -326,6 +393,7 @@ var _Space = _interopRequireDefault(require("./model/Space"));
|
|
|
326
393
|
var _SpaceCreationRequest = _interopRequireDefault(require("./model/SpaceCreationRequest"));
|
|
327
394
|
var _SpaceEmbedder = _interopRequireDefault(require("./model/SpaceEmbedder"));
|
|
328
395
|
var _SpaceEmbedderConfig = _interopRequireDefault(require("./model/SpaceEmbedderConfig"));
|
|
396
|
+
var _SpaceKey = _interopRequireDefault(require("./model/SpaceKey"));
|
|
329
397
|
var _SystemInitResponse = _interopRequireDefault(require("./model/SystemInitResponse"));
|
|
330
398
|
var _UpdateApiKeyRequest = _interopRequireDefault(require("./model/UpdateApiKeyRequest"));
|
|
331
399
|
var _UpdateEmbedderRequest = _interopRequireDefault(require("./model/UpdateEmbedderRequest"));
|
|
@@ -339,4 +407,5 @@ var _RerankersApi = _interopRequireDefault(require("./api/RerankersApi"));
|
|
|
339
407
|
var _SpacesApi = _interopRequireDefault(require("./api/SpacesApi"));
|
|
340
408
|
var _SystemApi = _interopRequireDefault(require("./api/SystemApi"));
|
|
341
409
|
var _UsersApi = _interopRequireDefault(require("./api/UsersApi"));
|
|
410
|
+
var _streaming = require("./streaming.js");
|
|
342
411
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -0,0 +1,129 @@
|
|
|
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 BinaryContent model module.
|
|
31
|
+
* @module model/BinaryContent
|
|
32
|
+
* @version 1.0.0
|
|
33
|
+
*/
|
|
34
|
+
var BinaryContent = /*#__PURE__*/function () {
|
|
35
|
+
/**
|
|
36
|
+
* Constructs a new <code>BinaryContent</code>.
|
|
37
|
+
* Binary content with MIME type for context items.
|
|
38
|
+
* @alias module:model/BinaryContent
|
|
39
|
+
* @param contentType {String} MIME type of the binary content.
|
|
40
|
+
* @param data {String} Base64-encoded binary data.
|
|
41
|
+
*/
|
|
42
|
+
function BinaryContent(contentType, data) {
|
|
43
|
+
_classCallCheck(this, BinaryContent);
|
|
44
|
+
BinaryContent.initialize(this, contentType, data);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
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.
|
|
51
|
+
*/
|
|
52
|
+
return _createClass(BinaryContent, null, [{
|
|
53
|
+
key: "initialize",
|
|
54
|
+
value: function initialize(obj, contentType, data) {
|
|
55
|
+
obj['contentType'] = contentType;
|
|
56
|
+
obj['data'] = data;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Constructs a <code>BinaryContent</code> from a plain JavaScript object, optionally creating a new instance.
|
|
61
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
62
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
63
|
+
* @param {module:model/BinaryContent} obj Optional instance to populate.
|
|
64
|
+
* @return {module:model/BinaryContent} The populated <code>BinaryContent</code> instance.
|
|
65
|
+
*/
|
|
66
|
+
}, {
|
|
67
|
+
key: "constructFromObject",
|
|
68
|
+
value: function constructFromObject(data, obj) {
|
|
69
|
+
if (data) {
|
|
70
|
+
obj = obj || new BinaryContent();
|
|
71
|
+
if (data.hasOwnProperty('contentType')) {
|
|
72
|
+
obj['contentType'] = _ApiClient["default"].convertToType(data['contentType'], 'String');
|
|
73
|
+
}
|
|
74
|
+
if (data.hasOwnProperty('data')) {
|
|
75
|
+
obj['data'] = _ApiClient["default"].convertToType(data['data'], 'String');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return obj;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Validates the JSON data with respect to <code>BinaryContent</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>BinaryContent</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(BinaryContent.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['contentType'] && !(typeof data['contentType'] === 'string' || data['contentType'] instanceof String)) {
|
|
106
|
+
throw new Error("Expected the field `contentType` to be a primitive type in the JSON string but got " + data['contentType']);
|
|
107
|
+
}
|
|
108
|
+
// ensure the json data is a string
|
|
109
|
+
if (data['data'] && !(typeof data['data'] === 'string' || data['data'] instanceof String)) {
|
|
110
|
+
throw new Error("Expected the field `data` to be a primitive type in the JSON string but got " + data['data']);
|
|
111
|
+
}
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
}]);
|
|
115
|
+
}();
|
|
116
|
+
BinaryContent.RequiredProperties = ["contentType", "data"];
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* MIME type of the binary content.
|
|
120
|
+
* @member {String} contentType
|
|
121
|
+
*/
|
|
122
|
+
BinaryContent.prototype['contentType'] = undefined;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Base64-encoded binary data.
|
|
126
|
+
* @member {String} data
|
|
127
|
+
*/
|
|
128
|
+
BinaryContent.prototype['data'] = undefined;
|
|
129
|
+
var _default = exports["default"] = BinaryContent;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _MemoryChunkResponse = _interopRequireDefault(require("./MemoryChunkResponse"));
|
|
8
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
10
|
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
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; } } }; }
|
|
@@ -37,7 +38,7 @@ var ChunkReference = /*#__PURE__*/function () {
|
|
|
37
38
|
* Reference to a memory chunk with pointer to its parent memory
|
|
38
39
|
* @alias module:model/ChunkReference
|
|
39
40
|
* @param resultSetId {String} Result set ID that produced this chunk
|
|
40
|
-
* @param chunk {
|
|
41
|
+
* @param chunk {module:model/MemoryChunkResponse}
|
|
41
42
|
* @param memoryIndex {Number} Index of the chunk's memory in the client's memories array
|
|
42
43
|
* @param relevanceScore {Number} Relevance score for this chunk (0.0 to 1.0)
|
|
43
44
|
*/
|
|
@@ -76,9 +77,7 @@ var ChunkReference = /*#__PURE__*/function () {
|
|
|
76
77
|
obj['resultSetId'] = _ApiClient["default"].convertToType(data['resultSetId'], 'String');
|
|
77
78
|
}
|
|
78
79
|
if (data.hasOwnProperty('chunk')) {
|
|
79
|
-
obj['chunk'] =
|
|
80
|
-
'String': Object
|
|
81
|
-
});
|
|
80
|
+
obj['chunk'] = _MemoryChunkResponse["default"].constructFromObject(data['chunk']);
|
|
82
81
|
}
|
|
83
82
|
if (data.hasOwnProperty('memoryIndex')) {
|
|
84
83
|
obj['memoryIndex'] = _ApiClient["default"].convertToType(data['memoryIndex'], 'Number');
|
|
@@ -117,6 +116,11 @@ var ChunkReference = /*#__PURE__*/function () {
|
|
|
117
116
|
if (data['resultSetId'] && !(typeof data['resultSetId'] === 'string' || data['resultSetId'] instanceof String)) {
|
|
118
117
|
throw new Error("Expected the field `resultSetId` to be a primitive type in the JSON string but got " + data['resultSetId']);
|
|
119
118
|
}
|
|
119
|
+
// validate the optional field `chunk`
|
|
120
|
+
if (data['chunk']) {
|
|
121
|
+
// data not null
|
|
122
|
+
_MemoryChunkResponse["default"].validateJSON(data['chunk']);
|
|
123
|
+
}
|
|
120
124
|
return true;
|
|
121
125
|
}
|
|
122
126
|
}]);
|
|
@@ -130,8 +134,7 @@ ChunkReference.RequiredProperties = ["resultSetId", "chunk", "memoryIndex", "rel
|
|
|
130
134
|
ChunkReference.prototype['resultSetId'] = undefined;
|
|
131
135
|
|
|
132
136
|
/**
|
|
133
|
-
*
|
|
134
|
-
* @member {Object.<String, Object>} chunk
|
|
137
|
+
* @member {module:model/MemoryChunkResponse} chunk
|
|
135
138
|
*/
|
|
136
139
|
ChunkReference.prototype['chunk'] = undefined;
|
|
137
140
|
|