@getzep/zep-cloud 1.0.2 → 1.0.4
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/Client.d.ts +1 -0
- package/api/errors/ConflictError.d.ts +8 -0
- package/api/errors/ConflictError.js +41 -0
- package/api/errors/index.d.ts +1 -0
- package/api/errors/index.js +1 -0
- package/api/resources/document/client/Client.d.ts +4 -1
- package/api/resources/document/client/Client.js +29 -14
- package/api/resources/memory/client/Client.d.ts +32 -17
- package/api/resources/memory/client/Client.js +177 -64
- package/api/resources/memory/client/requests/EndSessionRequest.d.ts +2 -0
- package/api/resources/memory/client/requests/EndSessionsRequest.d.ts +13 -0
- package/api/resources/memory/client/requests/SessionSearchQuery.d.ts +24 -0
- package/api/resources/memory/client/requests/index.d.ts +2 -2
- package/api/resources/user/client/Client.d.ts +1 -0
- package/api/resources/user/client/Client.js +12 -6
- package/api/{resources/memory/client/requests → types}/ClassifySessionRequest.d.ts +0 -7
- package/api/types/CreateDocumentRequest.d.ts +1 -2
- package/api/types/EndSessionResponse.d.ts +8 -0
- package/api/types/EndSessionsResponse.d.ts +7 -0
- package/api/types/Memory.d.ts +2 -0
- package/api/types/MemorySearchResult.d.ts +0 -1
- package/api/types/SessionSearchResponse.d.ts +7 -0
- package/api/types/SessionSearchResult.d.ts +10 -0
- package/api/types/SessionSearchResult.js +5 -0
- package/api/types/index.d.ts +5 -1
- package/api/types/index.js +5 -1
- package/core/fetcher/Fetcher.d.ts +1 -0
- package/core/fetcher/Fetcher.js +81 -15
- package/dist/Client.d.ts +1 -0
- package/dist/api/errors/ConflictError.d.ts +8 -0
- package/dist/api/errors/ConflictError.js +41 -0
- package/dist/api/errors/index.d.ts +1 -0
- package/dist/api/errors/index.js +1 -0
- package/dist/api/resources/document/client/Client.d.ts +4 -1
- package/dist/api/resources/document/client/Client.js +29 -14
- package/dist/api/resources/memory/client/Client.d.ts +32 -17
- package/dist/api/resources/memory/client/Client.js +177 -64
- package/dist/api/resources/memory/client/requests/EndSessionRequest.d.ts +2 -0
- package/dist/api/resources/memory/client/requests/EndSessionsRequest.d.ts +13 -0
- package/dist/api/resources/memory/client/requests/EndSessionsRequest.js +5 -0
- package/dist/api/resources/memory/client/requests/SessionSearchQuery.d.ts +24 -0
- package/dist/api/resources/memory/client/requests/SessionSearchQuery.js +5 -0
- package/dist/api/resources/memory/client/requests/index.d.ts +2 -2
- package/dist/api/resources/user/client/Client.d.ts +1 -0
- package/dist/api/resources/user/client/Client.js +12 -6
- package/dist/api/{resources/memory/client/requests → types}/ClassifySessionRequest.d.ts +0 -7
- package/dist/api/types/ClassifySessionRequest.js +5 -0
- package/dist/api/types/CreateDocumentRequest.d.ts +1 -2
- package/dist/api/types/EndSessionResponse.d.ts +8 -0
- package/dist/api/types/EndSessionResponse.js +5 -0
- package/dist/api/types/EndSessionsResponse.d.ts +7 -0
- package/dist/api/types/EndSessionsResponse.js +5 -0
- package/dist/api/types/Memory.d.ts +2 -0
- package/dist/api/types/MemorySearchResult.d.ts +0 -1
- package/dist/api/types/SessionSearchResponse.d.ts +7 -0
- package/dist/api/types/SessionSearchResponse.js +5 -0
- package/dist/api/types/SessionSearchResult.d.ts +10 -0
- package/dist/api/types/SessionSearchResult.js +5 -0
- package/dist/api/types/index.d.ts +5 -1
- package/dist/api/types/index.js +5 -1
- package/dist/core/fetcher/Fetcher.d.ts +1 -0
- package/dist/core/fetcher/Fetcher.js +81 -15
- package/dist/langchain/vector_store.js +0 -1
- package/dist/serialization/resources/memory/client/index.d.ts +0 -1
- package/dist/serialization/resources/memory/client/index.js +1 -2
- package/dist/serialization/resources/memory/client/requests/EndSessionRequest.d.ts +2 -0
- package/dist/serialization/resources/memory/client/requests/EndSessionRequest.js +2 -0
- package/dist/serialization/resources/memory/client/requests/EndSessionsRequest.d.ts +13 -0
- package/dist/serialization/resources/memory/client/requests/EndSessionsRequest.js +34 -0
- package/dist/serialization/resources/memory/client/requests/SessionSearchQuery.d.ts +21 -0
- package/dist/serialization/resources/memory/client/requests/{ModelsExtractDataRequest.js → SessionSearchQuery.js} +12 -5
- package/dist/serialization/resources/memory/client/requests/index.d.ts +2 -2
- package/dist/serialization/resources/memory/client/requests/index.js +5 -5
- package/dist/serialization/{resources/memory/client/requests → types}/ClassifySessionRequest.d.ts +4 -4
- package/{serialization/resources/memory/client/requests → dist/serialization/types}/ClassifySessionRequest.js +1 -1
- package/dist/serialization/types/CreateDocumentRequest.d.ts +1 -2
- package/dist/serialization/types/CreateDocumentRequest.js +1 -2
- package/dist/serialization/types/EndSessionResponse.d.ts +15 -0
- package/dist/serialization/types/EndSessionResponse.js +36 -0
- package/dist/serialization/types/EndSessionsResponse.d.ts +13 -0
- package/dist/serialization/types/{ModelsZepDataClass.js → EndSessionsResponse.js} +4 -5
- package/dist/serialization/types/Memory.d.ts +1 -0
- package/dist/serialization/types/Memory.js +1 -0
- package/dist/serialization/types/MemorySearchResult.d.ts +0 -1
- package/dist/serialization/types/MemorySearchResult.js +0 -1
- package/dist/serialization/types/SessionSearchResponse.d.ts +13 -0
- package/dist/serialization/{resources/memory/client/extractSessionData.js → types/SessionSearchResponse.js} +6 -3
- package/dist/serialization/types/SessionSearchResult.d.ts +17 -0
- package/dist/serialization/types/SessionSearchResult.js +38 -0
- package/dist/serialization/types/index.d.ts +5 -1
- package/dist/serialization/types/index.js +5 -1
- package/examples/memory/memory_example.ts +2 -0
- package/langchain/vector_store.js +0 -1
- package/package.json +1 -1
- package/serialization/resources/memory/client/index.d.ts +0 -1
- package/serialization/resources/memory/client/index.js +1 -2
- package/serialization/resources/memory/client/requests/EndSessionRequest.d.ts +2 -0
- package/serialization/resources/memory/client/requests/EndSessionRequest.js +2 -0
- package/serialization/resources/memory/client/requests/EndSessionsRequest.d.ts +13 -0
- package/serialization/resources/memory/client/requests/EndSessionsRequest.js +34 -0
- package/serialization/resources/memory/client/requests/SessionSearchQuery.d.ts +21 -0
- package/serialization/resources/memory/client/requests/{ModelsExtractDataRequest.js → SessionSearchQuery.js} +12 -5
- package/serialization/resources/memory/client/requests/index.d.ts +2 -2
- package/serialization/resources/memory/client/requests/index.js +5 -5
- package/serialization/{resources/memory/client/requests → types}/ClassifySessionRequest.d.ts +4 -4
- package/{dist/serialization/resources/memory/client/requests → serialization/types}/ClassifySessionRequest.js +1 -1
- package/serialization/types/CreateDocumentRequest.d.ts +1 -2
- package/serialization/types/CreateDocumentRequest.js +1 -2
- package/serialization/types/EndSessionResponse.d.ts +15 -0
- package/serialization/types/EndSessionResponse.js +36 -0
- package/serialization/types/EndSessionsResponse.d.ts +13 -0
- package/serialization/types/{ModelsZepDataClass.js → EndSessionsResponse.js} +4 -5
- package/serialization/types/Memory.d.ts +1 -0
- package/serialization/types/Memory.js +1 -0
- package/serialization/types/MemorySearchResult.d.ts +0 -1
- package/serialization/types/MemorySearchResult.js +0 -1
- package/serialization/types/SessionSearchResponse.d.ts +13 -0
- package/serialization/{resources/memory/client/extractSessionData.js → types/SessionSearchResponse.js} +6 -3
- package/serialization/types/SessionSearchResult.d.ts +17 -0
- package/serialization/types/SessionSearchResult.js +38 -0
- package/serialization/types/index.d.ts +5 -1
- package/serialization/types/index.js +5 -1
- package/api/resources/memory/client/requests/ModelsExtractDataRequest.d.ts +0 -14
- package/api/types/ModelsZepDataClass.d.ts +0 -8
- package/dist/api/resources/memory/client/requests/ModelsExtractDataRequest.d.ts +0 -14
- package/dist/api/types/ModelsZepDataClass.d.ts +0 -8
- package/dist/serialization/resources/memory/client/extractSessionData.d.ts +0 -9
- package/dist/serialization/resources/memory/client/requests/ModelsExtractDataRequest.d.ts +0 -14
- package/dist/serialization/types/ModelsZepDataClass.d.ts +0 -14
- package/serialization/resources/memory/client/extractSessionData.d.ts +0 -9
- package/serialization/resources/memory/client/requests/ModelsExtractDataRequest.d.ts +0 -14
- package/serialization/types/ModelsZepDataClass.d.ts +0 -14
- /package/api/resources/memory/client/requests/{ClassifySessionRequest.js → EndSessionsRequest.js} +0 -0
- /package/api/resources/memory/client/requests/{ModelsExtractDataRequest.js → SessionSearchQuery.js} +0 -0
- /package/{dist/api/resources/memory/client/requests → api/types}/ClassifySessionRequest.js +0 -0
- /package/api/types/{ModelsZepDataClass.js → EndSessionResponse.js} +0 -0
- /package/{dist/api/resources/memory/client/requests/ModelsExtractDataRequest.js → api/types/EndSessionsResponse.js} +0 -0
- /package/{dist/api/types/ModelsZepDataClass.js → api/types/SessionSearchResponse.js} +0 -0
|
@@ -80,11 +80,12 @@ class Memory {
|
|
|
80
80
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
81
81
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "sessions"),
|
|
82
82
|
method: "POST",
|
|
83
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
83
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
84
84
|
contentType: "application/json",
|
|
85
85
|
body: yield serializers.CreateSessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
86
86
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
87
87
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
88
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
88
89
|
});
|
|
89
90
|
if (_response.ok) {
|
|
90
91
|
return yield serializers.Session.parseOrThrow(_response.body, {
|
|
@@ -167,11 +168,12 @@ class Memory {
|
|
|
167
168
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
168
169
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "sessions-ordered"),
|
|
169
170
|
method: "GET",
|
|
170
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
171
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
171
172
|
contentType: "application/json",
|
|
172
173
|
queryParameters: _queryParams,
|
|
173
174
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
174
175
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
176
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
175
177
|
});
|
|
176
178
|
if (_response.ok) {
|
|
177
179
|
return yield serializers.SessionListResponse.parseOrThrow(_response.body, {
|
|
@@ -223,30 +225,35 @@ class Memory {
|
|
|
223
225
|
});
|
|
224
226
|
}
|
|
225
227
|
/**
|
|
226
|
-
*
|
|
228
|
+
* End multiple sessions by their IDs
|
|
227
229
|
*
|
|
228
|
-
* @param {
|
|
230
|
+
* @param {Zep.EndSessionsRequest} request
|
|
229
231
|
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
|
|
230
232
|
*
|
|
233
|
+
* @throws {@link Zep.BadRequestError}
|
|
231
234
|
* @throws {@link Zep.NotFoundError}
|
|
232
235
|
* @throws {@link Zep.InternalServerError}
|
|
233
236
|
*
|
|
234
237
|
* @example
|
|
235
|
-
* await zep.memory.
|
|
238
|
+
* await zep.memory.endSessions({
|
|
239
|
+
* sessionIds: ["session_ids"]
|
|
240
|
+
* })
|
|
236
241
|
*/
|
|
237
|
-
|
|
242
|
+
endSessions(request, requestOptions) {
|
|
238
243
|
var _a, _b;
|
|
239
244
|
return __awaiter(this, void 0, void 0, function* () {
|
|
240
245
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
241
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default,
|
|
242
|
-
method: "
|
|
243
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
246
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "sessions/end"),
|
|
247
|
+
method: "POST",
|
|
248
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
244
249
|
contentType: "application/json",
|
|
250
|
+
body: yield serializers.EndSessionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
245
251
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
246
252
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
253
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
247
254
|
});
|
|
248
255
|
if (_response.ok) {
|
|
249
|
-
return yield serializers.
|
|
256
|
+
return yield serializers.EndSessionsResponse.parseOrThrow(_response.body, {
|
|
250
257
|
unrecognizedObjectKeys: "passthrough",
|
|
251
258
|
allowUnrecognizedUnionMembers: true,
|
|
252
259
|
allowUnrecognizedEnumValues: true,
|
|
@@ -256,6 +263,14 @@ class Memory {
|
|
|
256
263
|
}
|
|
257
264
|
if (_response.error.reason === "status-code") {
|
|
258
265
|
switch (_response.error.statusCode) {
|
|
266
|
+
case 400:
|
|
267
|
+
throw new Zep.BadRequestError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
268
|
+
unrecognizedObjectKeys: "passthrough",
|
|
269
|
+
allowUnrecognizedUnionMembers: true,
|
|
270
|
+
allowUnrecognizedEnumValues: true,
|
|
271
|
+
skipValidation: true,
|
|
272
|
+
breadcrumbsPrefix: ["response"],
|
|
273
|
+
}));
|
|
259
274
|
case 404:
|
|
260
275
|
throw new Zep.NotFoundError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
261
276
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -295,35 +310,37 @@ class Memory {
|
|
|
295
310
|
});
|
|
296
311
|
}
|
|
297
312
|
/**
|
|
298
|
-
*
|
|
313
|
+
* Search sessions for the specified query.
|
|
299
314
|
*
|
|
300
|
-
* @param {
|
|
301
|
-
* @param {Zep.UpdateSessionRequest} request
|
|
315
|
+
* @param {Zep.SessionSearchQuery} request
|
|
302
316
|
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
|
|
303
317
|
*
|
|
304
|
-
* @throws {@link Zep.BadRequestError}
|
|
305
|
-
* @throws {@link Zep.NotFoundError}
|
|
306
318
|
* @throws {@link Zep.InternalServerError}
|
|
307
319
|
*
|
|
308
320
|
* @example
|
|
309
|
-
* await zep.memory.
|
|
310
|
-
* metadata: {}
|
|
311
|
-
* })
|
|
321
|
+
* await zep.memory.searchSessions()
|
|
312
322
|
*/
|
|
313
|
-
|
|
323
|
+
searchSessions(request = {}, requestOptions) {
|
|
314
324
|
var _a, _b;
|
|
315
325
|
return __awaiter(this, void 0, void 0, function* () {
|
|
326
|
+
const { limit } = request, _body = __rest(request, ["limit"]);
|
|
327
|
+
const _queryParams = {};
|
|
328
|
+
if (limit != null) {
|
|
329
|
+
_queryParams["limit"] = limit.toString();
|
|
330
|
+
}
|
|
316
331
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
317
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default,
|
|
318
|
-
method: "
|
|
319
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
332
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "sessions/search"),
|
|
333
|
+
method: "POST",
|
|
334
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
320
335
|
contentType: "application/json",
|
|
321
|
-
|
|
336
|
+
queryParameters: _queryParams,
|
|
337
|
+
body: yield serializers.SessionSearchQuery.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
322
338
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
323
339
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
340
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
324
341
|
});
|
|
325
342
|
if (_response.ok) {
|
|
326
|
-
return yield serializers.
|
|
343
|
+
return yield serializers.SessionSearchResponse.parseOrThrow(_response.body, {
|
|
327
344
|
unrecognizedObjectKeys: "passthrough",
|
|
328
345
|
allowUnrecognizedUnionMembers: true,
|
|
329
346
|
allowUnrecognizedEnumValues: true,
|
|
@@ -333,14 +350,71 @@ class Memory {
|
|
|
333
350
|
}
|
|
334
351
|
if (_response.error.reason === "status-code") {
|
|
335
352
|
switch (_response.error.statusCode) {
|
|
336
|
-
case
|
|
337
|
-
throw new Zep.
|
|
353
|
+
case 500:
|
|
354
|
+
throw new Zep.InternalServerError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
338
355
|
unrecognizedObjectKeys: "passthrough",
|
|
339
356
|
allowUnrecognizedUnionMembers: true,
|
|
340
357
|
allowUnrecognizedEnumValues: true,
|
|
341
358
|
skipValidation: true,
|
|
342
359
|
breadcrumbsPrefix: ["response"],
|
|
343
360
|
}));
|
|
361
|
+
default:
|
|
362
|
+
throw new errors.ZepError({
|
|
363
|
+
statusCode: _response.error.statusCode,
|
|
364
|
+
body: _response.error.body,
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
switch (_response.error.reason) {
|
|
369
|
+
case "non-json":
|
|
370
|
+
throw new errors.ZepError({
|
|
371
|
+
statusCode: _response.error.statusCode,
|
|
372
|
+
body: _response.error.rawBody,
|
|
373
|
+
});
|
|
374
|
+
case "timeout":
|
|
375
|
+
throw new errors.ZepTimeoutError();
|
|
376
|
+
case "unknown":
|
|
377
|
+
throw new errors.ZepError({
|
|
378
|
+
message: _response.error.errorMessage,
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* get session by id
|
|
385
|
+
*
|
|
386
|
+
* @param {string} sessionId - Session ID
|
|
387
|
+
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
|
|
388
|
+
*
|
|
389
|
+
* @throws {@link Zep.NotFoundError}
|
|
390
|
+
* @throws {@link Zep.InternalServerError}
|
|
391
|
+
*
|
|
392
|
+
* @example
|
|
393
|
+
* await zep.memory.getSession("sessionId")
|
|
394
|
+
*/
|
|
395
|
+
getSession(sessionId, requestOptions) {
|
|
396
|
+
var _a, _b;
|
|
397
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
398
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
399
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}`),
|
|
400
|
+
method: "GET",
|
|
401
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
402
|
+
contentType: "application/json",
|
|
403
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
404
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
405
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
406
|
+
});
|
|
407
|
+
if (_response.ok) {
|
|
408
|
+
return yield serializers.Session.parseOrThrow(_response.body, {
|
|
409
|
+
unrecognizedObjectKeys: "passthrough",
|
|
410
|
+
allowUnrecognizedUnionMembers: true,
|
|
411
|
+
allowUnrecognizedEnumValues: true,
|
|
412
|
+
skipValidation: true,
|
|
413
|
+
breadcrumbsPrefix: ["response"],
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
if (_response.error.reason === "status-code") {
|
|
417
|
+
switch (_response.error.statusCode) {
|
|
344
418
|
case 404:
|
|
345
419
|
throw new Zep.NotFoundError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
346
420
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -380,35 +454,37 @@ class Memory {
|
|
|
380
454
|
});
|
|
381
455
|
}
|
|
382
456
|
/**
|
|
383
|
-
*
|
|
457
|
+
* Update Session Metadata
|
|
384
458
|
*
|
|
385
459
|
* @param {string} sessionId - Session ID
|
|
386
|
-
* @param {Zep.
|
|
460
|
+
* @param {Zep.UpdateSessionRequest} request
|
|
387
461
|
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
|
|
388
462
|
*
|
|
463
|
+
* @throws {@link Zep.BadRequestError}
|
|
389
464
|
* @throws {@link Zep.NotFoundError}
|
|
465
|
+
* @throws {@link Zep.ConflictError}
|
|
390
466
|
* @throws {@link Zep.InternalServerError}
|
|
391
467
|
*
|
|
392
468
|
* @example
|
|
393
|
-
* await zep.memory.
|
|
394
|
-
*
|
|
395
|
-
* name: "name"
|
|
469
|
+
* await zep.memory.updateSession("sessionId", {
|
|
470
|
+
* metadata: {}
|
|
396
471
|
* })
|
|
397
472
|
*/
|
|
398
|
-
|
|
473
|
+
updateSession(sessionId, request, requestOptions) {
|
|
399
474
|
var _a, _b;
|
|
400
475
|
return __awaiter(this, void 0, void 0, function* () {
|
|
401
476
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
402
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}
|
|
403
|
-
method: "
|
|
404
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
477
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}`),
|
|
478
|
+
method: "PATCH",
|
|
479
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
405
480
|
contentType: "application/json",
|
|
406
|
-
body: yield serializers.
|
|
481
|
+
body: yield serializers.UpdateSessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
407
482
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
408
483
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
484
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
409
485
|
});
|
|
410
486
|
if (_response.ok) {
|
|
411
|
-
return yield serializers.
|
|
487
|
+
return yield serializers.Session.parseOrThrow(_response.body, {
|
|
412
488
|
unrecognizedObjectKeys: "passthrough",
|
|
413
489
|
allowUnrecognizedUnionMembers: true,
|
|
414
490
|
allowUnrecognizedEnumValues: true,
|
|
@@ -418,6 +494,14 @@ class Memory {
|
|
|
418
494
|
}
|
|
419
495
|
if (_response.error.reason === "status-code") {
|
|
420
496
|
switch (_response.error.statusCode) {
|
|
497
|
+
case 400:
|
|
498
|
+
throw new Zep.BadRequestError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
499
|
+
unrecognizedObjectKeys: "passthrough",
|
|
500
|
+
allowUnrecognizedUnionMembers: true,
|
|
501
|
+
allowUnrecognizedEnumValues: true,
|
|
502
|
+
skipValidation: true,
|
|
503
|
+
breadcrumbsPrefix: ["response"],
|
|
504
|
+
}));
|
|
421
505
|
case 404:
|
|
422
506
|
throw new Zep.NotFoundError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
423
507
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -426,6 +510,14 @@ class Memory {
|
|
|
426
510
|
skipValidation: true,
|
|
427
511
|
breadcrumbsPrefix: ["response"],
|
|
428
512
|
}));
|
|
513
|
+
case 409:
|
|
514
|
+
throw new Zep.ConflictError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
515
|
+
unrecognizedObjectKeys: "passthrough",
|
|
516
|
+
allowUnrecognizedUnionMembers: true,
|
|
517
|
+
allowUnrecognizedEnumValues: true,
|
|
518
|
+
skipValidation: true,
|
|
519
|
+
breadcrumbsPrefix: ["response"],
|
|
520
|
+
}));
|
|
429
521
|
case 500:
|
|
430
522
|
throw new Zep.InternalServerError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
431
523
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -457,32 +549,36 @@ class Memory {
|
|
|
457
549
|
});
|
|
458
550
|
}
|
|
459
551
|
/**
|
|
460
|
-
*
|
|
552
|
+
* classify a session by session id
|
|
461
553
|
*
|
|
462
554
|
* @param {string} sessionId - Session ID
|
|
463
|
-
* @param {Zep.
|
|
555
|
+
* @param {Zep.ClassifySessionRequest} request
|
|
464
556
|
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
|
|
465
557
|
*
|
|
466
558
|
* @throws {@link Zep.NotFoundError}
|
|
467
559
|
* @throws {@link Zep.InternalServerError}
|
|
468
560
|
*
|
|
469
561
|
* @example
|
|
470
|
-
* await zep.memory.
|
|
562
|
+
* await zep.memory.classifySession("sessionId", {
|
|
563
|
+
* classes: ["classes"],
|
|
564
|
+
* name: "name"
|
|
565
|
+
* })
|
|
471
566
|
*/
|
|
472
|
-
|
|
567
|
+
classifySession(sessionId, request, requestOptions) {
|
|
473
568
|
var _a, _b;
|
|
474
569
|
return __awaiter(this, void 0, void 0, function* () {
|
|
475
570
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
476
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/
|
|
571
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/classify`),
|
|
477
572
|
method: "POST",
|
|
478
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
573
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
479
574
|
contentType: "application/json",
|
|
480
|
-
body: yield serializers.
|
|
575
|
+
body: yield serializers.ClassifySessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
481
576
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
482
577
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
578
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
483
579
|
});
|
|
484
580
|
if (_response.ok) {
|
|
485
|
-
return yield serializers.
|
|
581
|
+
return yield serializers.ClassifySessionResponse.parseOrThrow(_response.body, {
|
|
486
582
|
unrecognizedObjectKeys: "passthrough",
|
|
487
583
|
allowUnrecognizedUnionMembers: true,
|
|
488
584
|
allowUnrecognizedEnumValues: true,
|
|
@@ -531,34 +627,34 @@ class Memory {
|
|
|
531
627
|
});
|
|
532
628
|
}
|
|
533
629
|
/**
|
|
534
|
-
*
|
|
630
|
+
* End a session by ID
|
|
535
631
|
*
|
|
536
632
|
* @param {string} sessionId - Session ID
|
|
537
|
-
* @param {Zep.
|
|
633
|
+
* @param {Zep.EndSessionRequest} request
|
|
538
634
|
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
|
|
539
635
|
*
|
|
636
|
+
* @throws {@link Zep.BadRequestError}
|
|
540
637
|
* @throws {@link Zep.NotFoundError}
|
|
541
638
|
* @throws {@link Zep.InternalServerError}
|
|
542
639
|
*
|
|
543
640
|
* @example
|
|
544
|
-
* await zep.memory.
|
|
545
|
-
* zepDataClasses: [{}]
|
|
546
|
-
* })
|
|
641
|
+
* await zep.memory.endSession("sessionId")
|
|
547
642
|
*/
|
|
548
|
-
|
|
643
|
+
endSession(sessionId, request = {}, requestOptions) {
|
|
549
644
|
var _a, _b;
|
|
550
645
|
return __awaiter(this, void 0, void 0, function* () {
|
|
551
646
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
552
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/
|
|
647
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/end`),
|
|
553
648
|
method: "POST",
|
|
554
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
649
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
555
650
|
contentType: "application/json",
|
|
556
|
-
body: yield serializers.
|
|
651
|
+
body: yield serializers.EndSessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
557
652
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
558
653
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
654
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
559
655
|
});
|
|
560
656
|
if (_response.ok) {
|
|
561
|
-
return yield serializers.
|
|
657
|
+
return yield serializers.EndSessionResponse.parseOrThrow(_response.body, {
|
|
562
658
|
unrecognizedObjectKeys: "passthrough",
|
|
563
659
|
allowUnrecognizedUnionMembers: true,
|
|
564
660
|
allowUnrecognizedEnumValues: true,
|
|
@@ -568,6 +664,14 @@ class Memory {
|
|
|
568
664
|
}
|
|
569
665
|
if (_response.error.reason === "status-code") {
|
|
570
666
|
switch (_response.error.statusCode) {
|
|
667
|
+
case 400:
|
|
668
|
+
throw new Zep.BadRequestError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
669
|
+
unrecognizedObjectKeys: "passthrough",
|
|
670
|
+
allowUnrecognizedUnionMembers: true,
|
|
671
|
+
allowUnrecognizedEnumValues: true,
|
|
672
|
+
skipValidation: true,
|
|
673
|
+
breadcrumbsPrefix: ["response"],
|
|
674
|
+
}));
|
|
571
675
|
case 404:
|
|
572
676
|
throw new Zep.NotFoundError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
573
677
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -633,11 +737,12 @@ class Memory {
|
|
|
633
737
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
634
738
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/memory`),
|
|
635
739
|
method: "GET",
|
|
636
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
740
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
637
741
|
contentType: "application/json",
|
|
638
742
|
queryParameters: _queryParams,
|
|
639
743
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
640
744
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
745
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
641
746
|
});
|
|
642
747
|
if (_response.ok) {
|
|
643
748
|
return yield serializers.Memory.parseOrThrow(_response.body, {
|
|
@@ -708,11 +813,12 @@ class Memory {
|
|
|
708
813
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
709
814
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/memory`),
|
|
710
815
|
method: "POST",
|
|
711
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
816
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
712
817
|
contentType: "application/json",
|
|
713
818
|
body: yield serializers.AddMemoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
714
819
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
715
820
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
821
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
716
822
|
});
|
|
717
823
|
if (_response.ok) {
|
|
718
824
|
return yield serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
@@ -773,10 +879,11 @@ class Memory {
|
|
|
773
879
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
774
880
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/memory`),
|
|
775
881
|
method: "DELETE",
|
|
776
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
882
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
777
883
|
contentType: "application/json",
|
|
778
884
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
779
885
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
886
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
780
887
|
});
|
|
781
888
|
if (_response.ok) {
|
|
782
889
|
return yield serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
@@ -854,11 +961,12 @@ class Memory {
|
|
|
854
961
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
855
962
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/messages`),
|
|
856
963
|
method: "GET",
|
|
857
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
964
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
858
965
|
contentType: "application/json",
|
|
859
966
|
queryParameters: _queryParams,
|
|
860
967
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
861
968
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
969
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
862
970
|
});
|
|
863
971
|
if (_response.ok) {
|
|
864
972
|
return yield serializers.MessageListResponse.parseOrThrow(_response.body, {
|
|
@@ -928,10 +1036,11 @@ class Memory {
|
|
|
928
1036
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
929
1037
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/messages/${encodeURIComponent(messageUuid)}`),
|
|
930
1038
|
method: "GET",
|
|
931
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1039
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
932
1040
|
contentType: "application/json",
|
|
933
1041
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
934
1042
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1043
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
935
1044
|
});
|
|
936
1045
|
if (_response.ok) {
|
|
937
1046
|
return yield serializers.Message.parseOrThrow(_response.body, {
|
|
@@ -1004,13 +1113,14 @@ class Memory {
|
|
|
1004
1113
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1005
1114
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/messages/${encodeURIComponent(messageUuid)}`),
|
|
1006
1115
|
method: "PATCH",
|
|
1007
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1116
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1008
1117
|
contentType: "application/json",
|
|
1009
1118
|
body: yield serializers.ModelsMessageMetadataUpdate.jsonOrThrow(request, {
|
|
1010
1119
|
unrecognizedObjectKeys: "strip",
|
|
1011
1120
|
}),
|
|
1012
1121
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1013
1122
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1123
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1014
1124
|
});
|
|
1015
1125
|
if (_response.ok) {
|
|
1016
1126
|
return yield serializers.Message.parseOrThrow(_response.body, {
|
|
@@ -1085,12 +1195,13 @@ class Memory {
|
|
|
1085
1195
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1086
1196
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/search`),
|
|
1087
1197
|
method: "POST",
|
|
1088
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1198
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1089
1199
|
contentType: "application/json",
|
|
1090
1200
|
queryParameters: _queryParams,
|
|
1091
1201
|
body: yield serializers.MemorySearchPayload.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
1092
1202
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1093
1203
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1204
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1094
1205
|
});
|
|
1095
1206
|
if (_response.ok) {
|
|
1096
1207
|
return yield serializers.memory.search.Response.parseOrThrow(_response.body, {
|
|
@@ -1159,10 +1270,11 @@ class Memory {
|
|
|
1159
1270
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1160
1271
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/summary`),
|
|
1161
1272
|
method: "GET",
|
|
1162
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1273
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1163
1274
|
contentType: "application/json",
|
|
1164
1275
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1165
1276
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1277
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1166
1278
|
});
|
|
1167
1279
|
if (_response.ok) {
|
|
1168
1280
|
return yield serializers.SummaryListResponse.parseOrThrow(_response.body, {
|
|
@@ -1237,11 +1349,12 @@ class Memory {
|
|
|
1237
1349
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1238
1350
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/synthesize_question`),
|
|
1239
1351
|
method: "GET",
|
|
1240
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1352
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1241
1353
|
contentType: "application/json",
|
|
1242
1354
|
queryParameters: _queryParams,
|
|
1243
1355
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1244
1356
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1357
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1245
1358
|
});
|
|
1246
1359
|
if (_response.ok) {
|
|
1247
1360
|
return yield serializers.Question.parseOrThrow(_response.body, {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Zep from "../../../../index";
|
|
4
5
|
/**
|
|
5
6
|
* @example
|
|
6
7
|
* {}
|
|
7
8
|
*/
|
|
8
9
|
export interface EndSessionRequest {
|
|
10
|
+
classify?: Zep.ClassifySessionRequest;
|
|
9
11
|
instruction?: string;
|
|
10
12
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Zep from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {}
|
|
8
|
+
*/
|
|
9
|
+
export interface SessionSearchQuery {
|
|
10
|
+
/**
|
|
11
|
+
* The maximum number of search results to return. Defaults to None (no limit).
|
|
12
|
+
*/
|
|
13
|
+
limit?: number;
|
|
14
|
+
minScore?: number;
|
|
15
|
+
mmrLambda?: number;
|
|
16
|
+
/** filter on the metadata */
|
|
17
|
+
recordFilter?: Record<string, unknown>;
|
|
18
|
+
searchScope?: Zep.SearchScope;
|
|
19
|
+
searchType?: Zep.SearchType;
|
|
20
|
+
/** the session ids to search */
|
|
21
|
+
sessionIds?: string[];
|
|
22
|
+
text?: string;
|
|
23
|
+
userId?: string;
|
|
24
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { type CreateSessionRequest } from "./CreateSessionRequest";
|
|
2
2
|
export { type MemoryListSessionsRequest } from "./MemoryListSessionsRequest";
|
|
3
|
+
export { type EndSessionsRequest } from "./EndSessionsRequest";
|
|
4
|
+
export { type SessionSearchQuery } from "./SessionSearchQuery";
|
|
3
5
|
export { type UpdateSessionRequest } from "./UpdateSessionRequest";
|
|
4
|
-
export { type ClassifySessionRequest } from "./ClassifySessionRequest";
|
|
5
6
|
export { type EndSessionRequest } from "./EndSessionRequest";
|
|
6
|
-
export { type ModelsExtractDataRequest } from "./ModelsExtractDataRequest";
|
|
7
7
|
export { type MemoryGetRequest } from "./MemoryGetRequest";
|
|
8
8
|
export { type AddMemoryRequest } from "./AddMemoryRequest";
|
|
9
9
|
export { type MemoryGetSessionMessagesRequest } from "./MemoryGetSessionMessagesRequest";
|