@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.
Files changed (138) hide show
  1. package/Client.d.ts +1 -0
  2. package/api/errors/ConflictError.d.ts +8 -0
  3. package/api/errors/ConflictError.js +41 -0
  4. package/api/errors/index.d.ts +1 -0
  5. package/api/errors/index.js +1 -0
  6. package/api/resources/document/client/Client.d.ts +4 -1
  7. package/api/resources/document/client/Client.js +29 -14
  8. package/api/resources/memory/client/Client.d.ts +32 -17
  9. package/api/resources/memory/client/Client.js +177 -64
  10. package/api/resources/memory/client/requests/EndSessionRequest.d.ts +2 -0
  11. package/api/resources/memory/client/requests/EndSessionsRequest.d.ts +13 -0
  12. package/api/resources/memory/client/requests/SessionSearchQuery.d.ts +24 -0
  13. package/api/resources/memory/client/requests/index.d.ts +2 -2
  14. package/api/resources/user/client/Client.d.ts +1 -0
  15. package/api/resources/user/client/Client.js +12 -6
  16. package/api/{resources/memory/client/requests → types}/ClassifySessionRequest.d.ts +0 -7
  17. package/api/types/CreateDocumentRequest.d.ts +1 -2
  18. package/api/types/EndSessionResponse.d.ts +8 -0
  19. package/api/types/EndSessionsResponse.d.ts +7 -0
  20. package/api/types/Memory.d.ts +2 -0
  21. package/api/types/MemorySearchResult.d.ts +0 -1
  22. package/api/types/SessionSearchResponse.d.ts +7 -0
  23. package/api/types/SessionSearchResult.d.ts +10 -0
  24. package/api/types/SessionSearchResult.js +5 -0
  25. package/api/types/index.d.ts +5 -1
  26. package/api/types/index.js +5 -1
  27. package/core/fetcher/Fetcher.d.ts +1 -0
  28. package/core/fetcher/Fetcher.js +81 -15
  29. package/dist/Client.d.ts +1 -0
  30. package/dist/api/errors/ConflictError.d.ts +8 -0
  31. package/dist/api/errors/ConflictError.js +41 -0
  32. package/dist/api/errors/index.d.ts +1 -0
  33. package/dist/api/errors/index.js +1 -0
  34. package/dist/api/resources/document/client/Client.d.ts +4 -1
  35. package/dist/api/resources/document/client/Client.js +29 -14
  36. package/dist/api/resources/memory/client/Client.d.ts +32 -17
  37. package/dist/api/resources/memory/client/Client.js +177 -64
  38. package/dist/api/resources/memory/client/requests/EndSessionRequest.d.ts +2 -0
  39. package/dist/api/resources/memory/client/requests/EndSessionsRequest.d.ts +13 -0
  40. package/dist/api/resources/memory/client/requests/EndSessionsRequest.js +5 -0
  41. package/dist/api/resources/memory/client/requests/SessionSearchQuery.d.ts +24 -0
  42. package/dist/api/resources/memory/client/requests/SessionSearchQuery.js +5 -0
  43. package/dist/api/resources/memory/client/requests/index.d.ts +2 -2
  44. package/dist/api/resources/user/client/Client.d.ts +1 -0
  45. package/dist/api/resources/user/client/Client.js +12 -6
  46. package/dist/api/{resources/memory/client/requests → types}/ClassifySessionRequest.d.ts +0 -7
  47. package/dist/api/types/ClassifySessionRequest.js +5 -0
  48. package/dist/api/types/CreateDocumentRequest.d.ts +1 -2
  49. package/dist/api/types/EndSessionResponse.d.ts +8 -0
  50. package/dist/api/types/EndSessionResponse.js +5 -0
  51. package/dist/api/types/EndSessionsResponse.d.ts +7 -0
  52. package/dist/api/types/EndSessionsResponse.js +5 -0
  53. package/dist/api/types/Memory.d.ts +2 -0
  54. package/dist/api/types/MemorySearchResult.d.ts +0 -1
  55. package/dist/api/types/SessionSearchResponse.d.ts +7 -0
  56. package/dist/api/types/SessionSearchResponse.js +5 -0
  57. package/dist/api/types/SessionSearchResult.d.ts +10 -0
  58. package/dist/api/types/SessionSearchResult.js +5 -0
  59. package/dist/api/types/index.d.ts +5 -1
  60. package/dist/api/types/index.js +5 -1
  61. package/dist/core/fetcher/Fetcher.d.ts +1 -0
  62. package/dist/core/fetcher/Fetcher.js +81 -15
  63. package/dist/langchain/vector_store.js +0 -1
  64. package/dist/serialization/resources/memory/client/index.d.ts +0 -1
  65. package/dist/serialization/resources/memory/client/index.js +1 -2
  66. package/dist/serialization/resources/memory/client/requests/EndSessionRequest.d.ts +2 -0
  67. package/dist/serialization/resources/memory/client/requests/EndSessionRequest.js +2 -0
  68. package/dist/serialization/resources/memory/client/requests/EndSessionsRequest.d.ts +13 -0
  69. package/dist/serialization/resources/memory/client/requests/EndSessionsRequest.js +34 -0
  70. package/dist/serialization/resources/memory/client/requests/SessionSearchQuery.d.ts +21 -0
  71. package/dist/serialization/resources/memory/client/requests/{ModelsExtractDataRequest.js → SessionSearchQuery.js} +12 -5
  72. package/dist/serialization/resources/memory/client/requests/index.d.ts +2 -2
  73. package/dist/serialization/resources/memory/client/requests/index.js +5 -5
  74. package/dist/serialization/{resources/memory/client/requests → types}/ClassifySessionRequest.d.ts +4 -4
  75. package/{serialization/resources/memory/client/requests → dist/serialization/types}/ClassifySessionRequest.js +1 -1
  76. package/dist/serialization/types/CreateDocumentRequest.d.ts +1 -2
  77. package/dist/serialization/types/CreateDocumentRequest.js +1 -2
  78. package/dist/serialization/types/EndSessionResponse.d.ts +15 -0
  79. package/dist/serialization/types/EndSessionResponse.js +36 -0
  80. package/dist/serialization/types/EndSessionsResponse.d.ts +13 -0
  81. package/dist/serialization/types/{ModelsZepDataClass.js → EndSessionsResponse.js} +4 -5
  82. package/dist/serialization/types/Memory.d.ts +1 -0
  83. package/dist/serialization/types/Memory.js +1 -0
  84. package/dist/serialization/types/MemorySearchResult.d.ts +0 -1
  85. package/dist/serialization/types/MemorySearchResult.js +0 -1
  86. package/dist/serialization/types/SessionSearchResponse.d.ts +13 -0
  87. package/dist/serialization/{resources/memory/client/extractSessionData.js → types/SessionSearchResponse.js} +6 -3
  88. package/dist/serialization/types/SessionSearchResult.d.ts +17 -0
  89. package/dist/serialization/types/SessionSearchResult.js +38 -0
  90. package/dist/serialization/types/index.d.ts +5 -1
  91. package/dist/serialization/types/index.js +5 -1
  92. package/examples/memory/memory_example.ts +2 -0
  93. package/langchain/vector_store.js +0 -1
  94. package/package.json +1 -1
  95. package/serialization/resources/memory/client/index.d.ts +0 -1
  96. package/serialization/resources/memory/client/index.js +1 -2
  97. package/serialization/resources/memory/client/requests/EndSessionRequest.d.ts +2 -0
  98. package/serialization/resources/memory/client/requests/EndSessionRequest.js +2 -0
  99. package/serialization/resources/memory/client/requests/EndSessionsRequest.d.ts +13 -0
  100. package/serialization/resources/memory/client/requests/EndSessionsRequest.js +34 -0
  101. package/serialization/resources/memory/client/requests/SessionSearchQuery.d.ts +21 -0
  102. package/serialization/resources/memory/client/requests/{ModelsExtractDataRequest.js → SessionSearchQuery.js} +12 -5
  103. package/serialization/resources/memory/client/requests/index.d.ts +2 -2
  104. package/serialization/resources/memory/client/requests/index.js +5 -5
  105. package/serialization/{resources/memory/client/requests → types}/ClassifySessionRequest.d.ts +4 -4
  106. package/{dist/serialization/resources/memory/client/requests → serialization/types}/ClassifySessionRequest.js +1 -1
  107. package/serialization/types/CreateDocumentRequest.d.ts +1 -2
  108. package/serialization/types/CreateDocumentRequest.js +1 -2
  109. package/serialization/types/EndSessionResponse.d.ts +15 -0
  110. package/serialization/types/EndSessionResponse.js +36 -0
  111. package/serialization/types/EndSessionsResponse.d.ts +13 -0
  112. package/serialization/types/{ModelsZepDataClass.js → EndSessionsResponse.js} +4 -5
  113. package/serialization/types/Memory.d.ts +1 -0
  114. package/serialization/types/Memory.js +1 -0
  115. package/serialization/types/MemorySearchResult.d.ts +0 -1
  116. package/serialization/types/MemorySearchResult.js +0 -1
  117. package/serialization/types/SessionSearchResponse.d.ts +13 -0
  118. package/serialization/{resources/memory/client/extractSessionData.js → types/SessionSearchResponse.js} +6 -3
  119. package/serialization/types/SessionSearchResult.d.ts +17 -0
  120. package/serialization/types/SessionSearchResult.js +38 -0
  121. package/serialization/types/index.d.ts +5 -1
  122. package/serialization/types/index.js +5 -1
  123. package/api/resources/memory/client/requests/ModelsExtractDataRequest.d.ts +0 -14
  124. package/api/types/ModelsZepDataClass.d.ts +0 -8
  125. package/dist/api/resources/memory/client/requests/ModelsExtractDataRequest.d.ts +0 -14
  126. package/dist/api/types/ModelsZepDataClass.d.ts +0 -8
  127. package/dist/serialization/resources/memory/client/extractSessionData.d.ts +0 -9
  128. package/dist/serialization/resources/memory/client/requests/ModelsExtractDataRequest.d.ts +0 -14
  129. package/dist/serialization/types/ModelsZepDataClass.d.ts +0 -14
  130. package/serialization/resources/memory/client/extractSessionData.d.ts +0 -9
  131. package/serialization/resources/memory/client/requests/ModelsExtractDataRequest.d.ts +0 -14
  132. package/serialization/types/ModelsZepDataClass.d.ts +0 -14
  133. /package/api/resources/memory/client/requests/{ClassifySessionRequest.js → EndSessionsRequest.js} +0 -0
  134. /package/api/resources/memory/client/requests/{ModelsExtractDataRequest.js → SessionSearchQuery.js} +0 -0
  135. /package/{dist/api/resources/memory/client/requests → api/types}/ClassifySessionRequest.js +0 -0
  136. /package/api/types/{ModelsZepDataClass.js → EndSessionResponse.js} +0 -0
  137. /package/{dist/api/resources/memory/client/requests/ModelsExtractDataRequest.js → api/types/EndSessionsResponse.js} +0 -0
  138. /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.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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
- * get session by id
228
+ * End multiple sessions by their IDs
227
229
  *
228
- * @param {string} sessionId - Session ID
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.getSession("sessionId")
238
+ * await zep.memory.endSessions({
239
+ * sessionIds: ["session_ids"]
240
+ * })
236
241
  */
237
- getSession(sessionId, requestOptions) {
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, `sessions/${encodeURIComponent(sessionId)}`),
242
- method: "GET",
243
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.Session.parseOrThrow(_response.body, {
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
- * Update Session Metadata
313
+ * Search sessions for the specified query.
299
314
  *
300
- * @param {string} sessionId - Session ID
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.updateSession("sessionId", {
310
- * metadata: {}
311
- * })
321
+ * await zep.memory.searchSessions()
312
322
  */
313
- updateSession(sessionId, request, requestOptions) {
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, `sessions/${encodeURIComponent(sessionId)}`),
318
- method: "PATCH",
319
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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
- body: yield serializers.UpdateSessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
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.Session.parseOrThrow(_response.body, {
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 400:
337
- throw new Zep.BadRequestError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
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
- * classify a session by session id
457
+ * Update Session Metadata
384
458
  *
385
459
  * @param {string} sessionId - Session ID
386
- * @param {Zep.ClassifySessionRequest} request
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.classifySession("sessionId", {
394
- * classes: ["classes"],
395
- * name: "name"
469
+ * await zep.memory.updateSession("sessionId", {
470
+ * metadata: {}
396
471
  * })
397
472
  */
398
- classifySession(sessionId, request, requestOptions) {
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)}/classify`),
403
- method: "POST",
404
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.ClassifySessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
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.ClassifySessionResponse.parseOrThrow(_response.body, {
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
- * End a session by ID
552
+ * classify a session by session id
461
553
  *
462
554
  * @param {string} sessionId - Session ID
463
- * @param {Zep.EndSessionRequest} request
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.endSession("sessionId")
562
+ * await zep.memory.classifySession("sessionId", {
563
+ * classes: ["classes"],
564
+ * name: "name"
565
+ * })
471
566
  */
472
- endSession(sessionId, request = {}, requestOptions) {
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)}/end`),
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.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.EndSessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
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.Session.parseOrThrow(_response.body, {
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
- * extract data from a session by session id
630
+ * End a session by ID
535
631
  *
536
632
  * @param {string} sessionId - Session ID
537
- * @param {Zep.ModelsExtractDataRequest} request
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.extractSessionData("sessionId", {
545
- * zepDataClasses: [{}]
546
- * })
641
+ * await zep.memory.endSession("sessionId")
547
642
  */
548
- extractSessionData(sessionId, request, requestOptions) {
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)}/extract`),
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.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.ModelsExtractDataRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
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.memory.extractSessionData.Response.parseOrThrow(_response.body, {
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.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * sessionIds: ["session_ids"]
8
+ * }
9
+ */
10
+ export interface EndSessionsRequest {
11
+ instruction?: string;
12
+ sessionIds: string[];
13
+ }
@@ -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";
@@ -13,6 +13,7 @@ export declare namespace User {
13
13
  interface RequestOptions {
14
14
  timeoutInSeconds?: number;
15
15
  maxRetries?: number;
16
+ abortSignal?: AbortSignal;
16
17
  }
17
18
  }
18
19
  export declare class User {