@getzep/zep-cloud 1.0.7 → 1.0.8
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/api/resources/document/client/Client.js +13 -13
- package/api/resources/memory/client/Client.d.ts +40 -0
- package/api/resources/memory/client/Client.js +249 -20
- package/api/resources/memory/client/requests/CreateSessionRequest.d.ts +3 -0
- package/api/resources/memory/client/requests/MemoryGetRequest.d.ts +4 -0
- package/api/resources/memory/client/requests/MemoryGetSessionFactsRequest.d.ts +13 -0
- package/api/resources/memory/client/requests/MemoryGetSessionFactsRequest.js +5 -0
- package/api/resources/memory/client/requests/MemorySearchPayload.d.ts +1 -0
- package/api/resources/memory/client/requests/SessionSearchQuery.d.ts +1 -0
- package/api/resources/memory/client/requests/UpdateSessionRequest.d.ts +6 -0
- package/api/resources/memory/client/requests/index.d.ts +1 -0
- package/api/resources/user/client/Client.js +6 -6
- package/api/types/Fact.d.ts +1 -0
- package/api/types/FactRatingExamples.d.ts +8 -0
- package/api/types/FactRatingExamples.js +5 -0
- package/api/types/FactRatingInstruction.d.ts +21 -0
- package/api/types/FactRatingInstruction.js +5 -0
- package/api/types/FactResponse.d.ts +7 -0
- package/api/types/FactResponse.js +5 -0
- package/api/types/FactsResponse.d.ts +7 -0
- package/api/types/FactsResponse.js +5 -0
- package/api/types/Session.d.ts +2 -0
- package/api/types/index.d.ts +4 -0
- package/api/types/index.js +4 -0
- package/dist/api/resources/document/client/Client.js +13 -13
- package/dist/api/resources/memory/client/Client.d.ts +40 -0
- package/dist/api/resources/memory/client/Client.js +249 -20
- package/dist/api/resources/memory/client/requests/CreateSessionRequest.d.ts +3 -0
- package/dist/api/resources/memory/client/requests/MemoryGetRequest.d.ts +4 -0
- package/dist/api/resources/memory/client/requests/MemoryGetSessionFactsRequest.d.ts +13 -0
- package/dist/api/resources/memory/client/requests/MemoryGetSessionFactsRequest.js +5 -0
- package/dist/api/resources/memory/client/requests/MemorySearchPayload.d.ts +1 -0
- package/dist/api/resources/memory/client/requests/SessionSearchQuery.d.ts +1 -0
- package/dist/api/resources/memory/client/requests/UpdateSessionRequest.d.ts +6 -0
- package/dist/api/resources/memory/client/requests/index.d.ts +1 -0
- package/dist/api/resources/user/client/Client.js +6 -6
- package/dist/api/types/Fact.d.ts +1 -0
- package/dist/api/types/FactRatingExamples.d.ts +8 -0
- package/dist/api/types/FactRatingExamples.js +5 -0
- package/dist/api/types/FactRatingInstruction.d.ts +21 -0
- package/dist/api/types/FactRatingInstruction.js +5 -0
- package/dist/api/types/FactResponse.d.ts +7 -0
- package/dist/api/types/FactResponse.js +5 -0
- package/dist/api/types/FactsResponse.d.ts +7 -0
- package/dist/api/types/FactsResponse.js +5 -0
- package/dist/api/types/Session.d.ts +2 -0
- package/dist/api/types/index.d.ts +4 -0
- package/dist/api/types/index.js +4 -0
- package/dist/serialization/resources/memory/client/deleteFact.d.ts +9 -0
- package/dist/serialization/resources/memory/client/deleteFact.js +31 -0
- package/dist/serialization/resources/memory/client/index.d.ts +1 -0
- package/dist/serialization/resources/memory/client/index.js +2 -1
- package/dist/serialization/resources/memory/client/requests/CreateSessionRequest.d.ts +2 -0
- package/dist/serialization/resources/memory/client/requests/CreateSessionRequest.js +2 -0
- package/dist/serialization/resources/memory/client/requests/MemorySearchPayload.d.ts +1 -0
- package/dist/serialization/resources/memory/client/requests/MemorySearchPayload.js +1 -0
- package/dist/serialization/resources/memory/client/requests/SessionSearchQuery.d.ts +1 -0
- package/dist/serialization/resources/memory/client/requests/SessionSearchQuery.js +1 -0
- package/dist/serialization/resources/memory/client/requests/UpdateSessionRequest.d.ts +2 -0
- package/dist/serialization/resources/memory/client/requests/UpdateSessionRequest.js +2 -0
- package/dist/serialization/types/Fact.d.ts +1 -0
- package/dist/serialization/types/Fact.js +1 -0
- package/dist/serialization/types/FactRatingExamples.d.ts +14 -0
- package/dist/serialization/types/FactRatingExamples.js +35 -0
- package/dist/serialization/types/FactRatingInstruction.d.ts +14 -0
- package/dist/serialization/types/FactRatingInstruction.js +35 -0
- package/dist/serialization/types/FactResponse.d.ts +13 -0
- package/dist/serialization/types/FactResponse.js +34 -0
- package/dist/serialization/types/FactsResponse.d.ts +13 -0
- package/dist/serialization/types/FactsResponse.js +34 -0
- package/dist/serialization/types/Session.d.ts +2 -0
- package/dist/serialization/types/Session.js +2 -0
- package/dist/serialization/types/index.d.ts +4 -0
- package/dist/serialization/types/index.js +4 -0
- package/package.json +1 -1
- package/serialization/resources/memory/client/deleteFact.d.ts +9 -0
- package/serialization/resources/memory/client/deleteFact.js +31 -0
- package/serialization/resources/memory/client/index.d.ts +1 -0
- package/serialization/resources/memory/client/index.js +2 -1
- package/serialization/resources/memory/client/requests/CreateSessionRequest.d.ts +2 -0
- package/serialization/resources/memory/client/requests/CreateSessionRequest.js +2 -0
- package/serialization/resources/memory/client/requests/MemorySearchPayload.d.ts +1 -0
- package/serialization/resources/memory/client/requests/MemorySearchPayload.js +1 -0
- package/serialization/resources/memory/client/requests/SessionSearchQuery.d.ts +1 -0
- package/serialization/resources/memory/client/requests/SessionSearchQuery.js +1 -0
- package/serialization/resources/memory/client/requests/UpdateSessionRequest.d.ts +2 -0
- package/serialization/resources/memory/client/requests/UpdateSessionRequest.js +2 -0
- package/serialization/types/Fact.d.ts +1 -0
- package/serialization/types/Fact.js +1 -0
- package/serialization/types/FactRatingExamples.d.ts +14 -0
- package/serialization/types/FactRatingExamples.js +35 -0
- package/serialization/types/FactRatingInstruction.d.ts +14 -0
- package/serialization/types/FactRatingInstruction.js +35 -0
- package/serialization/types/FactResponse.d.ts +13 -0
- package/serialization/types/FactResponse.js +34 -0
- package/serialization/types/FactsResponse.d.ts +13 -0
- package/serialization/types/FactsResponse.js +34 -0
- package/serialization/types/Session.d.ts +2 -0
- package/serialization/types/Session.js +2 -0
- package/serialization/types/index.d.ts +4 -0
- package/serialization/types/index.js +4 -0
|
@@ -53,13 +53,159 @@ exports.Memory = void 0;
|
|
|
53
53
|
const environments = __importStar(require("../../../../environments"));
|
|
54
54
|
const core = __importStar(require("../../../../core"));
|
|
55
55
|
const Zep = __importStar(require("../../../index"));
|
|
56
|
-
const serializers = __importStar(require("../../../../serialization/index"));
|
|
57
56
|
const url_join_1 = __importDefault(require("url-join"));
|
|
57
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
58
58
|
const errors = __importStar(require("../../../../errors/index"));
|
|
59
59
|
class Memory {
|
|
60
60
|
constructor(_options = {}) {
|
|
61
61
|
this._options = _options;
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* get fact by uuid
|
|
65
|
+
*
|
|
66
|
+
* @param {string} factUuid - Fact UUID
|
|
67
|
+
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
|
|
68
|
+
*
|
|
69
|
+
* @throws {@link Zep.NotFoundError}
|
|
70
|
+
* @throws {@link Zep.InternalServerError}
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* await zep.memory.getFact("factUUID")
|
|
74
|
+
*/
|
|
75
|
+
getFact(factUuid, requestOptions) {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
79
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `facts/${encodeURIComponent(factUuid)}`),
|
|
80
|
+
method: "GET",
|
|
81
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
82
|
+
contentType: "application/json",
|
|
83
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
84
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
85
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
86
|
+
});
|
|
87
|
+
if (_response.ok) {
|
|
88
|
+
return yield serializers.FactResponse.parseOrThrow(_response.body, {
|
|
89
|
+
unrecognizedObjectKeys: "passthrough",
|
|
90
|
+
allowUnrecognizedUnionMembers: true,
|
|
91
|
+
allowUnrecognizedEnumValues: true,
|
|
92
|
+
skipValidation: true,
|
|
93
|
+
breadcrumbsPrefix: ["response"],
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
if (_response.error.reason === "status-code") {
|
|
97
|
+
switch (_response.error.statusCode) {
|
|
98
|
+
case 404:
|
|
99
|
+
throw new Zep.NotFoundError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
100
|
+
unrecognizedObjectKeys: "passthrough",
|
|
101
|
+
allowUnrecognizedUnionMembers: true,
|
|
102
|
+
allowUnrecognizedEnumValues: true,
|
|
103
|
+
skipValidation: true,
|
|
104
|
+
breadcrumbsPrefix: ["response"],
|
|
105
|
+
}));
|
|
106
|
+
case 500:
|
|
107
|
+
throw new Zep.InternalServerError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
108
|
+
unrecognizedObjectKeys: "passthrough",
|
|
109
|
+
allowUnrecognizedUnionMembers: true,
|
|
110
|
+
allowUnrecognizedEnumValues: true,
|
|
111
|
+
skipValidation: true,
|
|
112
|
+
breadcrumbsPrefix: ["response"],
|
|
113
|
+
}));
|
|
114
|
+
default:
|
|
115
|
+
throw new errors.ZepError({
|
|
116
|
+
statusCode: _response.error.statusCode,
|
|
117
|
+
body: _response.error.body,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
switch (_response.error.reason) {
|
|
122
|
+
case "non-json":
|
|
123
|
+
throw new errors.ZepError({
|
|
124
|
+
statusCode: _response.error.statusCode,
|
|
125
|
+
body: _response.error.rawBody,
|
|
126
|
+
});
|
|
127
|
+
case "timeout":
|
|
128
|
+
throw new errors.ZepTimeoutError();
|
|
129
|
+
case "unknown":
|
|
130
|
+
throw new errors.ZepError({
|
|
131
|
+
message: _response.error.errorMessage,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* delete a fact
|
|
138
|
+
*
|
|
139
|
+
* @param {string} factUuid - Fact UUID
|
|
140
|
+
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
|
|
141
|
+
*
|
|
142
|
+
* @throws {@link Zep.NotFoundError}
|
|
143
|
+
* @throws {@link Zep.InternalServerError}
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* await zep.memory.deleteFact("factUUID")
|
|
147
|
+
*/
|
|
148
|
+
deleteFact(factUuid, requestOptions) {
|
|
149
|
+
var _a, _b;
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
152
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `facts/${encodeURIComponent(factUuid)}`),
|
|
153
|
+
method: "DELETE",
|
|
154
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
155
|
+
contentType: "application/json",
|
|
156
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
157
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
158
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
159
|
+
});
|
|
160
|
+
if (_response.ok) {
|
|
161
|
+
return yield serializers.memory.deleteFact.Response.parseOrThrow(_response.body, {
|
|
162
|
+
unrecognizedObjectKeys: "passthrough",
|
|
163
|
+
allowUnrecognizedUnionMembers: true,
|
|
164
|
+
allowUnrecognizedEnumValues: true,
|
|
165
|
+
skipValidation: true,
|
|
166
|
+
breadcrumbsPrefix: ["response"],
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
if (_response.error.reason === "status-code") {
|
|
170
|
+
switch (_response.error.statusCode) {
|
|
171
|
+
case 404:
|
|
172
|
+
throw new Zep.NotFoundError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
173
|
+
unrecognizedObjectKeys: "passthrough",
|
|
174
|
+
allowUnrecognizedUnionMembers: true,
|
|
175
|
+
allowUnrecognizedEnumValues: true,
|
|
176
|
+
skipValidation: true,
|
|
177
|
+
breadcrumbsPrefix: ["response"],
|
|
178
|
+
}));
|
|
179
|
+
case 500:
|
|
180
|
+
throw new Zep.InternalServerError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
181
|
+
unrecognizedObjectKeys: "passthrough",
|
|
182
|
+
allowUnrecognizedUnionMembers: true,
|
|
183
|
+
allowUnrecognizedEnumValues: true,
|
|
184
|
+
skipValidation: true,
|
|
185
|
+
breadcrumbsPrefix: ["response"],
|
|
186
|
+
}));
|
|
187
|
+
default:
|
|
188
|
+
throw new errors.ZepError({
|
|
189
|
+
statusCode: _response.error.statusCode,
|
|
190
|
+
body: _response.error.body,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
switch (_response.error.reason) {
|
|
195
|
+
case "non-json":
|
|
196
|
+
throw new errors.ZepError({
|
|
197
|
+
statusCode: _response.error.statusCode,
|
|
198
|
+
body: _response.error.rawBody,
|
|
199
|
+
});
|
|
200
|
+
case "timeout":
|
|
201
|
+
throw new errors.ZepTimeoutError();
|
|
202
|
+
case "unknown":
|
|
203
|
+
throw new errors.ZepError({
|
|
204
|
+
message: _response.error.errorMessage,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
63
209
|
/**
|
|
64
210
|
* Create New Session
|
|
65
211
|
*
|
|
@@ -80,7 +226,7 @@ class Memory {
|
|
|
80
226
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
81
227
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "sessions"),
|
|
82
228
|
method: "POST",
|
|
83
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
229
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
84
230
|
contentType: "application/json",
|
|
85
231
|
body: yield serializers.CreateSessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
86
232
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -168,7 +314,7 @@ class Memory {
|
|
|
168
314
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
169
315
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "sessions-ordered"),
|
|
170
316
|
method: "GET",
|
|
171
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
317
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
172
318
|
contentType: "application/json",
|
|
173
319
|
queryParameters: _queryParams,
|
|
174
320
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -245,7 +391,7 @@ class Memory {
|
|
|
245
391
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
246
392
|
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
393
|
method: "POST",
|
|
248
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
394
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
249
395
|
contentType: "application/json",
|
|
250
396
|
body: yield serializers.EndSessionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
251
397
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -331,7 +477,7 @@ class Memory {
|
|
|
331
477
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
332
478
|
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
479
|
method: "POST",
|
|
334
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
480
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
335
481
|
contentType: "application/json",
|
|
336
482
|
queryParameters: _queryParams,
|
|
337
483
|
body: yield serializers.SessionSearchQuery.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -398,7 +544,7 @@ class Memory {
|
|
|
398
544
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
399
545
|
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
546
|
method: "GET",
|
|
401
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
547
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
402
548
|
contentType: "application/json",
|
|
403
549
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
404
550
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -476,7 +622,7 @@ class Memory {
|
|
|
476
622
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
477
623
|
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
624
|
method: "PATCH",
|
|
479
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
625
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
480
626
|
contentType: "application/json",
|
|
481
627
|
body: yield serializers.UpdateSessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
482
628
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -570,7 +716,7 @@ class Memory {
|
|
|
570
716
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
571
717
|
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`),
|
|
572
718
|
method: "POST",
|
|
573
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
719
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
574
720
|
contentType: "application/json",
|
|
575
721
|
body: yield serializers.ClassifySessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
576
722
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -646,7 +792,7 @@ class Memory {
|
|
|
646
792
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
647
793
|
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`),
|
|
648
794
|
method: "POST",
|
|
649
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
795
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
650
796
|
contentType: "application/json",
|
|
651
797
|
body: yield serializers.EndSessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
652
798
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -733,7 +879,7 @@ class Memory {
|
|
|
733
879
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
734
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)}/extract`),
|
|
735
881
|
method: "POST",
|
|
736
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
882
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
737
883
|
contentType: "application/json",
|
|
738
884
|
body: yield serializers.ExtractDataRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
739
885
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -797,6 +943,86 @@ class Memory {
|
|
|
797
943
|
}
|
|
798
944
|
});
|
|
799
945
|
}
|
|
946
|
+
/**
|
|
947
|
+
* get facts for a session
|
|
948
|
+
*
|
|
949
|
+
* @param {string} sessionId - Session ID
|
|
950
|
+
* @param {Zep.MemoryGetSessionFactsRequest} request
|
|
951
|
+
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
|
|
952
|
+
*
|
|
953
|
+
* @throws {@link Zep.NotFoundError}
|
|
954
|
+
* @throws {@link Zep.InternalServerError}
|
|
955
|
+
*
|
|
956
|
+
* @example
|
|
957
|
+
* await zep.memory.getSessionFacts("sessionId")
|
|
958
|
+
*/
|
|
959
|
+
getSessionFacts(sessionId, request = {}, requestOptions) {
|
|
960
|
+
var _a, _b;
|
|
961
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
962
|
+
const { minRating } = request;
|
|
963
|
+
const _queryParams = {};
|
|
964
|
+
if (minRating != null) {
|
|
965
|
+
_queryParams["minRating"] = minRating.toString();
|
|
966
|
+
}
|
|
967
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
968
|
+
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)}/facts`),
|
|
969
|
+
method: "GET",
|
|
970
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
971
|
+
contentType: "application/json",
|
|
972
|
+
queryParameters: _queryParams,
|
|
973
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
974
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
975
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
976
|
+
});
|
|
977
|
+
if (_response.ok) {
|
|
978
|
+
return yield serializers.FactsResponse.parseOrThrow(_response.body, {
|
|
979
|
+
unrecognizedObjectKeys: "passthrough",
|
|
980
|
+
allowUnrecognizedUnionMembers: true,
|
|
981
|
+
allowUnrecognizedEnumValues: true,
|
|
982
|
+
skipValidation: true,
|
|
983
|
+
breadcrumbsPrefix: ["response"],
|
|
984
|
+
});
|
|
985
|
+
}
|
|
986
|
+
if (_response.error.reason === "status-code") {
|
|
987
|
+
switch (_response.error.statusCode) {
|
|
988
|
+
case 404:
|
|
989
|
+
throw new Zep.NotFoundError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
990
|
+
unrecognizedObjectKeys: "passthrough",
|
|
991
|
+
allowUnrecognizedUnionMembers: true,
|
|
992
|
+
allowUnrecognizedEnumValues: true,
|
|
993
|
+
skipValidation: true,
|
|
994
|
+
breadcrumbsPrefix: ["response"],
|
|
995
|
+
}));
|
|
996
|
+
case 500:
|
|
997
|
+
throw new Zep.InternalServerError(yield serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
998
|
+
unrecognizedObjectKeys: "passthrough",
|
|
999
|
+
allowUnrecognizedUnionMembers: true,
|
|
1000
|
+
allowUnrecognizedEnumValues: true,
|
|
1001
|
+
skipValidation: true,
|
|
1002
|
+
breadcrumbsPrefix: ["response"],
|
|
1003
|
+
}));
|
|
1004
|
+
default:
|
|
1005
|
+
throw new errors.ZepError({
|
|
1006
|
+
statusCode: _response.error.statusCode,
|
|
1007
|
+
body: _response.error.body,
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
switch (_response.error.reason) {
|
|
1012
|
+
case "non-json":
|
|
1013
|
+
throw new errors.ZepError({
|
|
1014
|
+
statusCode: _response.error.statusCode,
|
|
1015
|
+
body: _response.error.rawBody,
|
|
1016
|
+
});
|
|
1017
|
+
case "timeout":
|
|
1018
|
+
throw new errors.ZepTimeoutError();
|
|
1019
|
+
case "unknown":
|
|
1020
|
+
throw new errors.ZepError({
|
|
1021
|
+
message: _response.error.errorMessage,
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
800
1026
|
/**
|
|
801
1027
|
* Returns a memory (latest summary, list of messages and facts for models.MemoryTypePerpetual) for a given session
|
|
802
1028
|
*
|
|
@@ -813,7 +1039,7 @@ class Memory {
|
|
|
813
1039
|
get(sessionId, request = {}, requestOptions) {
|
|
814
1040
|
var _a, _b;
|
|
815
1041
|
return __awaiter(this, void 0, void 0, function* () {
|
|
816
|
-
const { memoryType, lastn } = request;
|
|
1042
|
+
const { memoryType, lastn, minRating } = request;
|
|
817
1043
|
const _queryParams = {};
|
|
818
1044
|
if (memoryType != null) {
|
|
819
1045
|
_queryParams["memoryType"] = memoryType;
|
|
@@ -821,10 +1047,13 @@ class Memory {
|
|
|
821
1047
|
if (lastn != null) {
|
|
822
1048
|
_queryParams["lastn"] = lastn.toString();
|
|
823
1049
|
}
|
|
1050
|
+
if (minRating != null) {
|
|
1051
|
+
_queryParams["minRating"] = minRating.toString();
|
|
1052
|
+
}
|
|
824
1053
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
825
1054
|
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`),
|
|
826
1055
|
method: "GET",
|
|
827
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1056
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
828
1057
|
contentType: "application/json",
|
|
829
1058
|
queryParameters: _queryParams,
|
|
830
1059
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -900,7 +1129,7 @@ class Memory {
|
|
|
900
1129
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
901
1130
|
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`),
|
|
902
1131
|
method: "POST",
|
|
903
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1132
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
904
1133
|
contentType: "application/json",
|
|
905
1134
|
body: yield serializers.AddMemoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
906
1135
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -966,7 +1195,7 @@ class Memory {
|
|
|
966
1195
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
967
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)}/memory`),
|
|
968
1197
|
method: "DELETE",
|
|
969
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1198
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
970
1199
|
contentType: "application/json",
|
|
971
1200
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
972
1201
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -1048,7 +1277,7 @@ class Memory {
|
|
|
1048
1277
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1049
1278
|
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`),
|
|
1050
1279
|
method: "GET",
|
|
1051
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1280
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1052
1281
|
contentType: "application/json",
|
|
1053
1282
|
queryParameters: _queryParams,
|
|
1054
1283
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1123,7 +1352,7 @@ class Memory {
|
|
|
1123
1352
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1124
1353
|
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)}`),
|
|
1125
1354
|
method: "GET",
|
|
1126
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1355
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1127
1356
|
contentType: "application/json",
|
|
1128
1357
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1129
1358
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -1200,7 +1429,7 @@ class Memory {
|
|
|
1200
1429
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1201
1430
|
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)}`),
|
|
1202
1431
|
method: "PATCH",
|
|
1203
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1432
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1204
1433
|
contentType: "application/json",
|
|
1205
1434
|
body: yield serializers.ModelsMessageMetadataUpdate.jsonOrThrow(request, {
|
|
1206
1435
|
unrecognizedObjectKeys: "strip",
|
|
@@ -1282,7 +1511,7 @@ class Memory {
|
|
|
1282
1511
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1283
1512
|
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`),
|
|
1284
1513
|
method: "POST",
|
|
1285
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1514
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1286
1515
|
contentType: "application/json",
|
|
1287
1516
|
queryParameters: _queryParams,
|
|
1288
1517
|
body: yield serializers.MemorySearchPayload.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -1357,7 +1586,7 @@ class Memory {
|
|
|
1357
1586
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1358
1587
|
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`),
|
|
1359
1588
|
method: "GET",
|
|
1360
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1589
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1361
1590
|
contentType: "application/json",
|
|
1362
1591
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1363
1592
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -1436,7 +1665,7 @@ class Memory {
|
|
|
1436
1665
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1437
1666
|
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`),
|
|
1438
1667
|
method: "GET",
|
|
1439
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
1668
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1440
1669
|
contentType: "application/json",
|
|
1441
1670
|
queryParameters: _queryParams,
|
|
1442
1671
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1,6 +1,7 @@
|
|
|
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
|
* {
|
|
@@ -8,6 +9,8 @@
|
|
|
8
9
|
* }
|
|
9
10
|
*/
|
|
10
11
|
export interface CreateSessionRequest {
|
|
12
|
+
/** Optional instruction to use for fact rating. */
|
|
13
|
+
factRatingInstruction?: Zep.FactRatingInstruction;
|
|
11
14
|
/** The metadata associated with the session. */
|
|
12
15
|
metadata?: Record<string, unknown>;
|
|
13
16
|
/** The unique identifier of the session. */
|
|
@@ -1,6 +1,7 @@
|
|
|
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
|
* {
|
|
@@ -8,6 +9,11 @@
|
|
|
8
9
|
* }
|
|
9
10
|
*/
|
|
10
11
|
export interface UpdateSessionRequest {
|
|
12
|
+
/**
|
|
13
|
+
* Optional instruction to use for fact rating.
|
|
14
|
+
* Fact rating instructions can not be unset.
|
|
15
|
+
*/
|
|
16
|
+
factRatingInstruction?: Zep.FactRatingInstruction;
|
|
11
17
|
/** The metadata to update */
|
|
12
18
|
metadata: Record<string, unknown>;
|
|
13
19
|
}
|
|
@@ -5,6 +5,7 @@ export { type SessionSearchQuery } from "./SessionSearchQuery";
|
|
|
5
5
|
export { type UpdateSessionRequest } from "./UpdateSessionRequest";
|
|
6
6
|
export { type EndSessionRequest } from "./EndSessionRequest";
|
|
7
7
|
export { type ExtractDataRequest } from "./ExtractDataRequest";
|
|
8
|
+
export { type MemoryGetSessionFactsRequest } from "./MemoryGetSessionFactsRequest";
|
|
8
9
|
export { type MemoryGetRequest } from "./MemoryGetRequest";
|
|
9
10
|
export { type AddMemoryRequest } from "./AddMemoryRequest";
|
|
10
11
|
export { type MemoryGetSessionMessagesRequest } from "./MemoryGetSessionMessagesRequest";
|
|
@@ -67,7 +67,7 @@ class User {
|
|
|
67
67
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
68
68
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "users"),
|
|
69
69
|
method: "POST",
|
|
70
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
70
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
71
71
|
contentType: "application/json",
|
|
72
72
|
body: yield serializers.CreateUserRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
73
73
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -149,7 +149,7 @@ class User {
|
|
|
149
149
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
150
150
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "users-ordered"),
|
|
151
151
|
method: "GET",
|
|
152
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
152
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
153
153
|
contentType: "application/json",
|
|
154
154
|
queryParameters: _queryParams,
|
|
155
155
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -223,7 +223,7 @@ class User {
|
|
|
223
223
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
224
224
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `users/${encodeURIComponent(userId)}`),
|
|
225
225
|
method: "GET",
|
|
226
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
226
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
227
227
|
contentType: "application/json",
|
|
228
228
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
229
229
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -296,7 +296,7 @@ class User {
|
|
|
296
296
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
297
297
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `users/${encodeURIComponent(userId)}`),
|
|
298
298
|
method: "DELETE",
|
|
299
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
299
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
300
300
|
contentType: "application/json",
|
|
301
301
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
302
302
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -371,7 +371,7 @@ class User {
|
|
|
371
371
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
372
372
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `users/${encodeURIComponent(userId)}`),
|
|
373
373
|
method: "PATCH",
|
|
374
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
374
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
375
375
|
contentType: "application/json",
|
|
376
376
|
body: yield serializers.UpdateUserRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
377
377
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -452,7 +452,7 @@ class User {
|
|
|
452
452
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
453
453
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `users/${encodeURIComponent(userId)}/sessions`),
|
|
454
454
|
method: "GET",
|
|
455
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.
|
|
455
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "1.0.8", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
456
456
|
contentType: "application/json",
|
|
457
457
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
458
458
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
package/dist/api/types/Fact.d.ts
CHANGED