@getzep/zep-cloud 1.0.3 → 1.0.5
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 +38 -5
- package/api/resources/memory/client/Client.js +223 -23
- 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/ExtractDataRequest.d.ts +23 -0
- package/api/resources/memory/client/requests/SessionSearchQuery.d.ts +24 -0
- package/api/resources/memory/client/requests/index.d.ts +3 -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/Fact.d.ts +8 -0
- package/api/types/Fact.js +5 -0
- package/api/types/MemorySearchResult.d.ts +0 -1
- package/api/types/SearchScope.d.ts +2 -1
- package/api/types/SearchScope.js +1 -0
- package/api/types/Session.d.ts +1 -0
- package/api/types/SessionSearchResponse.d.ts +7 -0
- package/api/types/SessionSearchResponse.js +5 -0
- package/api/types/SessionSearchResult.d.ts +11 -0
- package/api/types/SessionSearchResult.js +5 -0
- package/api/types/index.d.ts +6 -1
- package/api/types/index.js +6 -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 +38 -5
- package/dist/api/resources/memory/client/Client.js +223 -23
- 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/ExtractDataRequest.d.ts +23 -0
- package/dist/api/resources/memory/client/requests/ExtractDataRequest.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 +3 -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/Fact.d.ts +8 -0
- package/dist/api/types/Fact.js +5 -0
- package/dist/api/types/MemorySearchResult.d.ts +0 -1
- package/dist/api/types/SearchScope.d.ts +2 -1
- package/dist/api/types/SearchScope.js +1 -0
- package/dist/api/types/Session.d.ts +1 -0
- package/dist/api/types/SessionSearchResponse.d.ts +7 -0
- package/dist/api/types/SessionSearchResponse.js +5 -0
- package/dist/api/types/SessionSearchResult.d.ts +11 -0
- package/dist/api/types/SessionSearchResult.js +5 -0
- package/dist/api/types/index.d.ts +6 -1
- package/dist/api/types/index.js +6 -1
- package/dist/core/fetcher/Fetcher.d.ts +1 -0
- package/dist/core/fetcher/Fetcher.js +81 -15
- package/dist/extractor/base.d.ts +22 -0
- package/dist/extractor/base.js +20 -0
- package/dist/extractor/date.d.ts +24 -0
- package/dist/extractor/date.js +29 -0
- package/dist/extractor/index.d.ts +281 -0
- package/dist/extractor/index.js +31 -0
- package/dist/extractor/number.d.ts +27 -0
- package/dist/extractor/number.js +37 -0
- package/dist/extractor/regex.d.ts +30 -0
- package/dist/extractor/regex.js +29 -0
- package/dist/extractor/text.d.ts +29 -0
- package/dist/extractor/text.js +43 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/langchain/vector_store.js +0 -1
- package/dist/serialization/resources/memory/client/{extractSessionData.d.ts → extractData.d.ts} +1 -1
- package/dist/serialization/resources/memory/client/index.d.ts +1 -1
- package/dist/serialization/resources/memory/client/index.js +2 -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/ExtractDataRequest.d.ts +15 -0
- package/dist/serialization/resources/memory/client/requests/{ModelsExtractDataRequest.js → ExtractDataRequest.js} +6 -5
- package/dist/serialization/resources/memory/client/requests/SessionSearchQuery.d.ts +21 -0
- package/dist/serialization/resources/memory/client/requests/SessionSearchQuery.js +42 -0
- package/dist/serialization/resources/memory/client/requests/index.d.ts +3 -2
- package/dist/serialization/resources/memory/client/requests/index.js +7 -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/Fact.d.ts +14 -0
- package/dist/serialization/types/Fact.js +35 -0
- package/dist/serialization/types/MemorySearchResult.d.ts +0 -1
- package/dist/serialization/types/MemorySearchResult.js +0 -1
- package/dist/serialization/types/SearchScope.d.ts +1 -1
- package/dist/serialization/types/SearchScope.js +1 -1
- package/dist/serialization/types/Session.d.ts +1 -0
- package/dist/serialization/types/Session.js +1 -0
- package/dist/serialization/types/SessionSearchResponse.d.ts +13 -0
- package/dist/serialization/types/SessionSearchResponse.js +34 -0
- package/dist/serialization/types/SessionSearchResult.d.ts +19 -0
- package/dist/serialization/types/SessionSearchResult.js +40 -0
- package/dist/serialization/types/index.d.ts +6 -1
- package/dist/serialization/types/index.js +6 -1
- package/dist/wrapper/index.d.ts +2 -0
- package/dist/wrapper/index.js +4 -0
- package/dist/wrapper/memory.d.ts +35 -0
- package/dist/wrapper/memory.js +59 -0
- package/examples/memory/memory_example.ts +29 -8
- package/examples/memory/structured_data_extraction_example.ts +34 -0
- package/extractor/base.d.ts +22 -0
- package/extractor/base.js +20 -0
- package/extractor/date.d.ts +24 -0
- package/extractor/date.js +29 -0
- package/extractor/index.d.ts +281 -0
- package/extractor/index.js +31 -0
- package/extractor/number.d.ts +27 -0
- package/extractor/number.js +37 -0
- package/extractor/regex.d.ts +30 -0
- package/extractor/regex.js +29 -0
- package/extractor/text.d.ts +29 -0
- package/extractor/text.js +43 -0
- package/index.d.ts +1 -0
- package/index.js +3 -1
- package/langchain/vector_store.js +0 -1
- package/package.json +11 -5
- package/serialization/resources/memory/client/{extractSessionData.d.ts → extractData.d.ts} +1 -1
- package/serialization/resources/memory/client/index.d.ts +1 -1
- package/serialization/resources/memory/client/index.js +2 -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/ExtractDataRequest.d.ts +15 -0
- package/serialization/resources/memory/client/requests/{ModelsExtractDataRequest.js → ExtractDataRequest.js} +6 -5
- package/serialization/resources/memory/client/requests/SessionSearchQuery.d.ts +21 -0
- package/serialization/resources/memory/client/requests/SessionSearchQuery.js +42 -0
- package/serialization/resources/memory/client/requests/index.d.ts +3 -2
- package/serialization/resources/memory/client/requests/index.js +7 -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/Fact.d.ts +14 -0
- package/serialization/types/Fact.js +35 -0
- package/serialization/types/MemorySearchResult.d.ts +0 -1
- package/serialization/types/MemorySearchResult.js +0 -1
- package/serialization/types/SearchScope.d.ts +1 -1
- package/serialization/types/SearchScope.js +1 -1
- package/serialization/types/Session.d.ts +1 -0
- package/serialization/types/Session.js +1 -0
- package/serialization/types/SessionSearchResponse.d.ts +13 -0
- package/serialization/types/SessionSearchResponse.js +34 -0
- package/serialization/types/SessionSearchResult.d.ts +19 -0
- package/serialization/types/SessionSearchResult.js +40 -0
- package/serialization/types/index.d.ts +6 -1
- package/serialization/types/index.js +6 -1
- package/wrapper/index.d.ts +2 -0
- package/wrapper/index.js +4 -0
- package/wrapper/memory.d.ts +35 -0
- package/wrapper/memory.js +59 -0
- 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/requests/ModelsExtractDataRequest.d.ts +0 -14
- package/dist/serialization/types/ModelsZepDataClass.d.ts +0 -14
- 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 → ExtractDataRequest.js} +0 -0
- /package/api/{types/ModelsZepDataClass.js → resources/memory/client/requests/SessionSearchQuery.js} +0 -0
- /package/{dist/api/resources/memory/client/requests → api/types}/ClassifySessionRequest.js +0 -0
- /package/{dist/api/resources/memory/client/requests/ModelsExtractDataRequest.js → api/types/EndSessionResponse.js} +0 -0
- /package/{dist/api/types/ModelsZepDataClass.js → api/types/EndSessionsResponse.js} +0 -0
- /package/dist/serialization/resources/memory/client/{extractSessionData.js → extractData.js} +0 -0
- /package/serialization/resources/memory/client/{extractSessionData.js → extractData.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.5", "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.5", "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, {
|
|
@@ -222,6 +224,162 @@ class Memory {
|
|
|
222
224
|
}
|
|
223
225
|
});
|
|
224
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* End multiple sessions by their IDs
|
|
229
|
+
*
|
|
230
|
+
* @param {Zep.EndSessionsRequest} request
|
|
231
|
+
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
|
|
232
|
+
*
|
|
233
|
+
* @throws {@link Zep.BadRequestError}
|
|
234
|
+
* @throws {@link Zep.NotFoundError}
|
|
235
|
+
* @throws {@link Zep.InternalServerError}
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* await zep.memory.endSessions({
|
|
239
|
+
* sessionIds: ["session_ids"]
|
|
240
|
+
* })
|
|
241
|
+
*/
|
|
242
|
+
endSessions(request, requestOptions) {
|
|
243
|
+
var _a, _b;
|
|
244
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
245
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
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.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
249
|
+
contentType: "application/json",
|
|
250
|
+
body: yield serializers.EndSessionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
251
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
252
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
253
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
254
|
+
});
|
|
255
|
+
if (_response.ok) {
|
|
256
|
+
return yield serializers.EndSessionsResponse.parseOrThrow(_response.body, {
|
|
257
|
+
unrecognizedObjectKeys: "passthrough",
|
|
258
|
+
allowUnrecognizedUnionMembers: true,
|
|
259
|
+
allowUnrecognizedEnumValues: true,
|
|
260
|
+
skipValidation: true,
|
|
261
|
+
breadcrumbsPrefix: ["response"],
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
if (_response.error.reason === "status-code") {
|
|
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
|
+
}));
|
|
274
|
+
case 404:
|
|
275
|
+
throw new Zep.NotFoundError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
276
|
+
unrecognizedObjectKeys: "passthrough",
|
|
277
|
+
allowUnrecognizedUnionMembers: true,
|
|
278
|
+
allowUnrecognizedEnumValues: true,
|
|
279
|
+
skipValidation: true,
|
|
280
|
+
breadcrumbsPrefix: ["response"],
|
|
281
|
+
}));
|
|
282
|
+
case 500:
|
|
283
|
+
throw new Zep.InternalServerError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
284
|
+
unrecognizedObjectKeys: "passthrough",
|
|
285
|
+
allowUnrecognizedUnionMembers: true,
|
|
286
|
+
allowUnrecognizedEnumValues: true,
|
|
287
|
+
skipValidation: true,
|
|
288
|
+
breadcrumbsPrefix: ["response"],
|
|
289
|
+
}));
|
|
290
|
+
default:
|
|
291
|
+
throw new errors.ZepError({
|
|
292
|
+
statusCode: _response.error.statusCode,
|
|
293
|
+
body: _response.error.body,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
switch (_response.error.reason) {
|
|
298
|
+
case "non-json":
|
|
299
|
+
throw new errors.ZepError({
|
|
300
|
+
statusCode: _response.error.statusCode,
|
|
301
|
+
body: _response.error.rawBody,
|
|
302
|
+
});
|
|
303
|
+
case "timeout":
|
|
304
|
+
throw new errors.ZepTimeoutError();
|
|
305
|
+
case "unknown":
|
|
306
|
+
throw new errors.ZepError({
|
|
307
|
+
message: _response.error.errorMessage,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Search sessions for the specified query.
|
|
314
|
+
*
|
|
315
|
+
* @param {Zep.SessionSearchQuery} request
|
|
316
|
+
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
|
|
317
|
+
*
|
|
318
|
+
* @throws {@link Zep.InternalServerError}
|
|
319
|
+
*
|
|
320
|
+
* @example
|
|
321
|
+
* await zep.memory.searchSessions()
|
|
322
|
+
*/
|
|
323
|
+
searchSessions(request = {}, requestOptions) {
|
|
324
|
+
var _a, _b;
|
|
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
|
+
}
|
|
331
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
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.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
335
|
+
contentType: "application/json",
|
|
336
|
+
queryParameters: _queryParams,
|
|
337
|
+
body: yield serializers.SessionSearchQuery.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
338
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
339
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
340
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
341
|
+
});
|
|
342
|
+
if (_response.ok) {
|
|
343
|
+
return yield serializers.SessionSearchResponse.parseOrThrow(_response.body, {
|
|
344
|
+
unrecognizedObjectKeys: "passthrough",
|
|
345
|
+
allowUnrecognizedUnionMembers: true,
|
|
346
|
+
allowUnrecognizedEnumValues: true,
|
|
347
|
+
skipValidation: true,
|
|
348
|
+
breadcrumbsPrefix: ["response"],
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
if (_response.error.reason === "status-code") {
|
|
352
|
+
switch (_response.error.statusCode) {
|
|
353
|
+
case 500:
|
|
354
|
+
throw new Zep.InternalServerError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
355
|
+
unrecognizedObjectKeys: "passthrough",
|
|
356
|
+
allowUnrecognizedUnionMembers: true,
|
|
357
|
+
allowUnrecognizedEnumValues: true,
|
|
358
|
+
skipValidation: true,
|
|
359
|
+
breadcrumbsPrefix: ["response"],
|
|
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
|
+
}
|
|
225
383
|
/**
|
|
226
384
|
* get session by id
|
|
227
385
|
*
|
|
@@ -240,10 +398,11 @@ class Memory {
|
|
|
240
398
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
241
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)}`),
|
|
242
400
|
method: "GET",
|
|
243
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
401
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
244
402
|
contentType: "application/json",
|
|
245
403
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
246
404
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
405
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
247
406
|
});
|
|
248
407
|
if (_response.ok) {
|
|
249
408
|
return yield serializers.Session.parseOrThrow(_response.body, {
|
|
@@ -303,6 +462,7 @@ class Memory {
|
|
|
303
462
|
*
|
|
304
463
|
* @throws {@link Zep.BadRequestError}
|
|
305
464
|
* @throws {@link Zep.NotFoundError}
|
|
465
|
+
* @throws {@link Zep.ConflictError}
|
|
306
466
|
* @throws {@link Zep.InternalServerError}
|
|
307
467
|
*
|
|
308
468
|
* @example
|
|
@@ -316,11 +476,12 @@ class Memory {
|
|
|
316
476
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
317
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)}`),
|
|
318
478
|
method: "PATCH",
|
|
319
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
479
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
320
480
|
contentType: "application/json",
|
|
321
481
|
body: yield serializers.UpdateSessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
322
482
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
323
483
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
484
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
324
485
|
});
|
|
325
486
|
if (_response.ok) {
|
|
326
487
|
return yield serializers.Session.parseOrThrow(_response.body, {
|
|
@@ -349,6 +510,14 @@ class Memory {
|
|
|
349
510
|
skipValidation: true,
|
|
350
511
|
breadcrumbsPrefix: ["response"],
|
|
351
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
|
+
}));
|
|
352
521
|
case 500:
|
|
353
522
|
throw new Zep.InternalServerError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
354
523
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -401,11 +570,12 @@ class Memory {
|
|
|
401
570
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
402
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`),
|
|
403
572
|
method: "POST",
|
|
404
|
-
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.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
405
574
|
contentType: "application/json",
|
|
406
575
|
body: yield serializers.ClassifySessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
407
576
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
408
577
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
578
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
409
579
|
});
|
|
410
580
|
if (_response.ok) {
|
|
411
581
|
return yield serializers.ClassifySessionResponse.parseOrThrow(_response.body, {
|
|
@@ -463,6 +633,7 @@ class Memory {
|
|
|
463
633
|
* @param {Zep.EndSessionRequest} request
|
|
464
634
|
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
|
|
465
635
|
*
|
|
636
|
+
* @throws {@link Zep.BadRequestError}
|
|
466
637
|
* @throws {@link Zep.NotFoundError}
|
|
467
638
|
* @throws {@link Zep.InternalServerError}
|
|
468
639
|
*
|
|
@@ -475,14 +646,15 @@ class Memory {
|
|
|
475
646
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
476
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`),
|
|
477
648
|
method: "POST",
|
|
478
|
-
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.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
479
650
|
contentType: "application/json",
|
|
480
651
|
body: yield serializers.EndSessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
481
652
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
482
653
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
654
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
483
655
|
});
|
|
484
656
|
if (_response.ok) {
|
|
485
|
-
return yield serializers.
|
|
657
|
+
return yield serializers.EndSessionResponse.parseOrThrow(_response.body, {
|
|
486
658
|
unrecognizedObjectKeys: "passthrough",
|
|
487
659
|
allowUnrecognizedUnionMembers: true,
|
|
488
660
|
allowUnrecognizedEnumValues: true,
|
|
@@ -492,6 +664,14 @@ class Memory {
|
|
|
492
664
|
}
|
|
493
665
|
if (_response.error.reason === "status-code") {
|
|
494
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
|
+
}));
|
|
495
675
|
case 404:
|
|
496
676
|
throw new Zep.NotFoundError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
497
677
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -534,31 +714,34 @@ class Memory {
|
|
|
534
714
|
* extract data from a session by session id
|
|
535
715
|
*
|
|
536
716
|
* @param {string} sessionId - Session ID
|
|
537
|
-
* @param {Zep.
|
|
717
|
+
* @param {Zep.ExtractDataRequest} request
|
|
538
718
|
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
|
|
539
719
|
*
|
|
720
|
+
* @throws {@link Zep.BadRequestError}
|
|
540
721
|
* @throws {@link Zep.NotFoundError}
|
|
541
722
|
* @throws {@link Zep.InternalServerError}
|
|
542
723
|
*
|
|
543
724
|
* @example
|
|
544
|
-
* await zep.memory.
|
|
545
|
-
*
|
|
725
|
+
* await zep.memory.extractData("sessionId", {
|
|
726
|
+
* lastN: 1,
|
|
727
|
+
* modelSchema: "model_schema"
|
|
546
728
|
* })
|
|
547
729
|
*/
|
|
548
|
-
|
|
730
|
+
extractData(sessionId, request, requestOptions) {
|
|
549
731
|
var _a, _b;
|
|
550
732
|
return __awaiter(this, void 0, void 0, function* () {
|
|
551
733
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
552
734
|
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`),
|
|
553
735
|
method: "POST",
|
|
554
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
736
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
555
737
|
contentType: "application/json",
|
|
556
|
-
body: yield serializers.
|
|
738
|
+
body: yield serializers.ExtractDataRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
557
739
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
558
740
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
741
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
559
742
|
});
|
|
560
743
|
if (_response.ok) {
|
|
561
|
-
return yield serializers.memory.
|
|
744
|
+
return yield serializers.memory.extractData.Response.parseOrThrow(_response.body, {
|
|
562
745
|
unrecognizedObjectKeys: "passthrough",
|
|
563
746
|
allowUnrecognizedUnionMembers: true,
|
|
564
747
|
allowUnrecognizedEnumValues: true,
|
|
@@ -568,6 +751,14 @@ class Memory {
|
|
|
568
751
|
}
|
|
569
752
|
if (_response.error.reason === "status-code") {
|
|
570
753
|
switch (_response.error.statusCode) {
|
|
754
|
+
case 400:
|
|
755
|
+
throw new Zep.BadRequestError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
756
|
+
unrecognizedObjectKeys: "passthrough",
|
|
757
|
+
allowUnrecognizedUnionMembers: true,
|
|
758
|
+
allowUnrecognizedEnumValues: true,
|
|
759
|
+
skipValidation: true,
|
|
760
|
+
breadcrumbsPrefix: ["response"],
|
|
761
|
+
}));
|
|
571
762
|
case 404:
|
|
572
763
|
throw new Zep.NotFoundError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
573
764
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -633,11 +824,12 @@ class Memory {
|
|
|
633
824
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
634
825
|
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
826
|
method: "GET",
|
|
636
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
827
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
637
828
|
contentType: "application/json",
|
|
638
829
|
queryParameters: _queryParams,
|
|
639
830
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
640
831
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
832
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
641
833
|
});
|
|
642
834
|
if (_response.ok) {
|
|
643
835
|
return yield serializers.Memory.parseOrThrow(_response.body, {
|
|
@@ -708,11 +900,12 @@ class Memory {
|
|
|
708
900
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
709
901
|
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
902
|
method: "POST",
|
|
711
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
903
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
712
904
|
contentType: "application/json",
|
|
713
905
|
body: yield serializers.AddMemoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
714
906
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
715
907
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
908
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
716
909
|
});
|
|
717
910
|
if (_response.ok) {
|
|
718
911
|
return yield serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
@@ -773,10 +966,11 @@ class Memory {
|
|
|
773
966
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
774
967
|
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
968
|
method: "DELETE",
|
|
776
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
969
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
777
970
|
contentType: "application/json",
|
|
778
971
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
779
972
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
973
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
780
974
|
});
|
|
781
975
|
if (_response.ok) {
|
|
782
976
|
return yield serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
@@ -854,11 +1048,12 @@ class Memory {
|
|
|
854
1048
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
855
1049
|
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
1050
|
method: "GET",
|
|
857
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1051
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
858
1052
|
contentType: "application/json",
|
|
859
1053
|
queryParameters: _queryParams,
|
|
860
1054
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
861
1055
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1056
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
862
1057
|
});
|
|
863
1058
|
if (_response.ok) {
|
|
864
1059
|
return yield serializers.MessageListResponse.parseOrThrow(_response.body, {
|
|
@@ -928,10 +1123,11 @@ class Memory {
|
|
|
928
1123
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
929
1124
|
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
1125
|
method: "GET",
|
|
931
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1126
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
932
1127
|
contentType: "application/json",
|
|
933
1128
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
934
1129
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1130
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
935
1131
|
});
|
|
936
1132
|
if (_response.ok) {
|
|
937
1133
|
return yield serializers.Message.parseOrThrow(_response.body, {
|
|
@@ -1004,13 +1200,14 @@ class Memory {
|
|
|
1004
1200
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1005
1201
|
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
1202
|
method: "PATCH",
|
|
1007
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1203
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1008
1204
|
contentType: "application/json",
|
|
1009
1205
|
body: yield serializers.ModelsMessageMetadataUpdate.jsonOrThrow(request, {
|
|
1010
1206
|
unrecognizedObjectKeys: "strip",
|
|
1011
1207
|
}),
|
|
1012
1208
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1013
1209
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1210
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1014
1211
|
});
|
|
1015
1212
|
if (_response.ok) {
|
|
1016
1213
|
return yield serializers.Message.parseOrThrow(_response.body, {
|
|
@@ -1085,12 +1282,13 @@ class Memory {
|
|
|
1085
1282
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1086
1283
|
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
1284
|
method: "POST",
|
|
1088
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1285
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1089
1286
|
contentType: "application/json",
|
|
1090
1287
|
queryParameters: _queryParams,
|
|
1091
1288
|
body: yield serializers.MemorySearchPayload.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
1092
1289
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1093
1290
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1291
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1094
1292
|
});
|
|
1095
1293
|
if (_response.ok) {
|
|
1096
1294
|
return yield serializers.memory.search.Response.parseOrThrow(_response.body, {
|
|
@@ -1159,10 +1357,11 @@ class Memory {
|
|
|
1159
1357
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1160
1358
|
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
1359
|
method: "GET",
|
|
1162
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1360
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1163
1361
|
contentType: "application/json",
|
|
1164
1362
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1165
1363
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1364
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1166
1365
|
});
|
|
1167
1366
|
if (_response.ok) {
|
|
1168
1367
|
return yield serializers.SummaryListResponse.parseOrThrow(_response.body, {
|
|
@@ -1237,11 +1436,12 @@ class Memory {
|
|
|
1237
1436
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1238
1437
|
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
1438
|
method: "GET",
|
|
1240
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1439
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1241
1440
|
contentType: "application/json",
|
|
1242
1441
|
queryParameters: _queryParams,
|
|
1243
1442
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1244
1443
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1444
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1245
1445
|
});
|
|
1246
1446
|
if (_response.ok) {
|
|
1247
1447
|
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,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* lastN: 1,
|
|
8
|
+
* modelSchema: "model_schema"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface ExtractDataRequest {
|
|
12
|
+
/** Your current date and time in ISO 8601 format including timezone. This is used for determining relative dates. */
|
|
13
|
+
currentDateTime?: string;
|
|
14
|
+
/** The number of messages in the chat history from which to extract data */
|
|
15
|
+
lastN: number;
|
|
16
|
+
/** The schema describing the data to be extracted. See Zep's SDKs for more details. */
|
|
17
|
+
modelSchema: string;
|
|
18
|
+
/**
|
|
19
|
+
* Validate that the extracted data is present in the dialog and correct per the field description.
|
|
20
|
+
* Mitigates hallucination, but is slower and may result in false negatives.
|
|
21
|
+
*/
|
|
22
|
+
validate?: boolean;
|
|
23
|
+
}
|
|
@@ -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,10 @@
|
|
|
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
|
|
7
|
+
export { type ExtractDataRequest } from "./ExtractDataRequest";
|
|
7
8
|
export { type MemoryGetRequest } from "./MemoryGetRequest";
|
|
8
9
|
export { type AddMemoryRequest } from "./AddMemoryRequest";
|
|
9
10
|
export { type MemoryGetSessionMessagesRequest } from "./MemoryGetSessionMessagesRequest";
|