@getzep/zep-cloud 3.13.0 → 3.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/graph/client/Client.d.ts +51 -3
- package/dist/cjs/api/resources/graph/client/Client.js +273 -3
- package/dist/cjs/api/resources/graph/client/requests/AddCustomInstructionsRequest.d.ts +21 -0
- package/dist/cjs/api/resources/graph/client/requests/AddCustomInstructionsRequest.js +5 -0
- package/dist/cjs/api/resources/graph/client/requests/AddTripleRequest.d.ts +18 -5
- package/dist/cjs/api/resources/graph/client/requests/DeleteCustomInstructionsRequest.d.ts +15 -0
- package/dist/cjs/api/resources/graph/client/requests/DeleteCustomInstructionsRequest.js +5 -0
- package/dist/cjs/api/resources/graph/client/requests/GraphListCustomInstructionsRequest.d.ts +20 -0
- package/dist/cjs/api/resources/graph/client/requests/GraphListCustomInstructionsRequest.js +5 -0
- package/dist/cjs/api/resources/graph/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/graph/resources/node/client/Client.d.ts +14 -0
- package/dist/cjs/api/resources/graph/resources/node/client/Client.js +81 -0
- package/dist/cjs/api/resources/thread/client/requests/ThreadGetUserContextRequest.d.ts +1 -1
- package/dist/cjs/api/resources/user/client/requests/CreateUserRequest.d.ts +1 -1
- package/dist/cjs/api/resources/user/client/requests/UpdateUserRequest.d.ts +1 -1
- package/dist/cjs/api/types/CustomInstruction.d.ts +7 -0
- package/dist/cjs/api/types/CustomInstruction.js +5 -0
- package/dist/cjs/api/types/DateFilter.d.ts +5 -2
- package/dist/cjs/api/types/ListCustomInstructionsResponse.d.ts +7 -0
- package/dist/cjs/api/types/ListCustomInstructionsResponse.js +5 -0
- package/dist/cjs/api/types/PropertyFilter.d.ts +16 -0
- package/dist/cjs/api/types/PropertyFilter.js +5 -0
- package/dist/cjs/api/types/SearchFilters.d.ts +4 -0
- package/dist/cjs/api/types/index.d.ts +3 -0
- package/dist/cjs/api/types/index.js +3 -0
- package/dist/cjs/serialization/resources/graph/client/requests/AddCustomInstructionsRequest.d.ts +15 -0
- package/dist/cjs/serialization/resources/graph/client/requests/AddCustomInstructionsRequest.js +46 -0
- package/dist/cjs/serialization/resources/graph/client/requests/AddTripleRequest.d.ts +5 -2
- package/dist/cjs/serialization/resources/graph/client/requests/AddTripleRequest.js +5 -2
- package/dist/cjs/serialization/resources/graph/client/requests/DeleteCustomInstructionsRequest.d.ts +14 -0
- package/dist/cjs/serialization/resources/graph/client/requests/DeleteCustomInstructionsRequest.js +45 -0
- package/dist/cjs/serialization/resources/graph/client/requests/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/graph/client/requests/index.js +5 -1
- package/dist/cjs/serialization/types/CustomInstruction.d.ts +13 -0
- package/dist/cjs/serialization/types/CustomInstruction.js +44 -0
- package/dist/cjs/serialization/types/DateFilter.d.ts +1 -1
- package/dist/cjs/serialization/types/DateFilter.js +1 -1
- package/dist/cjs/serialization/types/ListCustomInstructionsResponse.d.ts +13 -0
- package/dist/cjs/serialization/types/ListCustomInstructionsResponse.js +44 -0
- package/dist/cjs/serialization/types/PropertyFilter.d.ts +15 -0
- package/dist/cjs/serialization/types/PropertyFilter.js +46 -0
- package/dist/cjs/serialization/types/SearchFilters.d.ts +3 -0
- package/dist/cjs/serialization/types/SearchFilters.js +3 -0
- package/dist/cjs/serialization/types/index.d.ts +3 -0
- package/dist/cjs/serialization/types/index.js +3 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/graph/client/Client.d.mts +51 -3
- package/dist/esm/api/resources/graph/client/Client.mjs +273 -3
- package/dist/esm/api/resources/graph/client/requests/AddCustomInstructionsRequest.d.mts +21 -0
- package/dist/esm/api/resources/graph/client/requests/AddCustomInstructionsRequest.mjs +4 -0
- package/dist/esm/api/resources/graph/client/requests/AddTripleRequest.d.mts +18 -5
- package/dist/esm/api/resources/graph/client/requests/DeleteCustomInstructionsRequest.d.mts +15 -0
- package/dist/esm/api/resources/graph/client/requests/DeleteCustomInstructionsRequest.mjs +4 -0
- package/dist/esm/api/resources/graph/client/requests/GraphListCustomInstructionsRequest.d.mts +20 -0
- package/dist/esm/api/resources/graph/client/requests/GraphListCustomInstructionsRequest.mjs +4 -0
- package/dist/esm/api/resources/graph/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/graph/resources/node/client/Client.d.mts +14 -0
- package/dist/esm/api/resources/graph/resources/node/client/Client.mjs +81 -0
- package/dist/esm/api/resources/thread/client/requests/ThreadGetUserContextRequest.d.mts +1 -1
- package/dist/esm/api/resources/user/client/requests/CreateUserRequest.d.mts +1 -1
- package/dist/esm/api/resources/user/client/requests/UpdateUserRequest.d.mts +1 -1
- package/dist/esm/api/types/CustomInstruction.d.mts +7 -0
- package/dist/esm/api/types/CustomInstruction.mjs +4 -0
- package/dist/esm/api/types/DateFilter.d.mts +5 -2
- package/dist/esm/api/types/ListCustomInstructionsResponse.d.mts +7 -0
- package/dist/esm/api/types/ListCustomInstructionsResponse.mjs +4 -0
- package/dist/esm/api/types/PropertyFilter.d.mts +16 -0
- package/dist/esm/api/types/PropertyFilter.mjs +4 -0
- package/dist/esm/api/types/SearchFilters.d.mts +4 -0
- package/dist/esm/api/types/index.d.mts +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/serialization/resources/graph/client/requests/AddCustomInstructionsRequest.d.mts +15 -0
- package/dist/esm/serialization/resources/graph/client/requests/AddCustomInstructionsRequest.mjs +10 -0
- package/dist/esm/serialization/resources/graph/client/requests/AddTripleRequest.d.mts +5 -2
- package/dist/esm/serialization/resources/graph/client/requests/AddTripleRequest.mjs +5 -2
- package/dist/esm/serialization/resources/graph/client/requests/DeleteCustomInstructionsRequest.d.mts +14 -0
- package/dist/esm/serialization/resources/graph/client/requests/DeleteCustomInstructionsRequest.mjs +9 -0
- package/dist/esm/serialization/resources/graph/client/requests/index.d.mts +2 -0
- package/dist/esm/serialization/resources/graph/client/requests/index.mjs +2 -0
- package/dist/esm/serialization/types/CustomInstruction.d.mts +13 -0
- package/dist/esm/serialization/types/CustomInstruction.mjs +8 -0
- package/dist/esm/serialization/types/DateFilter.d.mts +1 -1
- package/dist/esm/serialization/types/DateFilter.mjs +1 -1
- package/dist/esm/serialization/types/ListCustomInstructionsResponse.d.mts +13 -0
- package/dist/esm/serialization/types/ListCustomInstructionsResponse.mjs +8 -0
- package/dist/esm/serialization/types/PropertyFilter.d.mts +15 -0
- package/dist/esm/serialization/types/PropertyFilter.mjs +10 -0
- package/dist/esm/serialization/types/SearchFilters.d.mts +3 -0
- package/dist/esm/serialization/types/SearchFilters.mjs +3 -0
- package/dist/esm/serialization/types/index.d.mts +3 -0
- package/dist/esm/serialization/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +262 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
10
|
<h1 align="center">
|
|
11
|
-
Zep:
|
|
11
|
+
Zep: Context Engineering for AI Assistants.
|
|
12
12
|
</h1>
|
|
13
13
|
<h2 align="center">Recall, understand, and extract data from chat histories. Power personalized AI experiences.</h2>
|
|
14
14
|
<br />
|
|
@@ -21,7 +21,7 @@ Zep: Long-Term Memory for AI Assistants.
|
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
23
|
## What is Zep? 💬
|
|
24
|
-
Zep is a
|
|
24
|
+
Zep is a context engineering platform for AI Assistant apps. With Zep, you can provide AI assistants with the right context from past conversations, no matter how distant, while also reducing hallucinations, latency, and cost.
|
|
25
25
|
|
|
26
26
|
### Cloud Installation
|
|
27
27
|
You can install the Zep Cloud SDK by running:
|
|
@@ -50,7 +50,7 @@ npm install @getzep/zep-js@^0.10.0
|
|
|
50
50
|
|
|
51
51
|
Zep persists and recalls chat histories, and automatically generates summaries and other artifacts from these chat histories. It also embeds messages and summaries, enabling you to search Zep for relevant context from past conversations. Zep does all of this asynchronously, ensuring these operations don't impact your user's chat experience. Data is persisted to database, allowing you to scale out when growth demands.
|
|
52
52
|
|
|
53
|
-
Zep also provides a simple, easy to use abstraction for document vector search called Document Collections. This is designed to complement Zep's core
|
|
53
|
+
Zep also provides a simple, easy to use abstraction for document vector search called Document Collections. This is designed to complement Zep's core context features, but is not designed to be a general purpose vector database.
|
|
54
54
|
|
|
55
55
|
Zep allows you to be more intentional about constructing your prompt:
|
|
56
56
|
1. automatically adding a few recent messages, with the number customized for your app;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -50,8 +50,8 @@ class ZepClient {
|
|
|
50
50
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
51
51
|
"X-Fern-Language": "JavaScript",
|
|
52
52
|
"X-Fern-SDK-Name": "zep-cloud",
|
|
53
|
-
"X-Fern-SDK-Version": "3.
|
|
54
|
-
"User-Agent": "zep-cloud/3.
|
|
53
|
+
"X-Fern-SDK-Version": "3.15.0",
|
|
54
|
+
"User-Agent": "zep-cloud/3.15.0",
|
|
55
55
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
56
56
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
57
57
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -37,6 +37,56 @@ export declare class Graph {
|
|
|
37
37
|
get edge(): Edge;
|
|
38
38
|
get episode(): Episode;
|
|
39
39
|
get node(): Node;
|
|
40
|
+
/**
|
|
41
|
+
* Lists all custom instructions for a project, user, or graph.
|
|
42
|
+
*
|
|
43
|
+
* @param {Zep.GraphListCustomInstructionsRequest} request
|
|
44
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
45
|
+
*
|
|
46
|
+
* @throws {@link Zep.BadRequestError}
|
|
47
|
+
* @throws {@link Zep.InternalServerError}
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* await client.graph.listCustomInstructions({
|
|
51
|
+
* userId: "user_id",
|
|
52
|
+
* graphId: "graph_id"
|
|
53
|
+
* })
|
|
54
|
+
*/
|
|
55
|
+
listCustomInstructions(request?: Zep.GraphListCustomInstructionsRequest, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.ListCustomInstructionsResponse>;
|
|
56
|
+
private __listCustomInstructions;
|
|
57
|
+
/**
|
|
58
|
+
* Adds new custom instructions for graphs without removing existing ones. If user_ids or graph_ids is empty, adds to project-wide default instructions.
|
|
59
|
+
*
|
|
60
|
+
* @param {Zep.AddCustomInstructionsRequest} request
|
|
61
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
|
+
*
|
|
63
|
+
* @throws {@link Zep.BadRequestError}
|
|
64
|
+
* @throws {@link Zep.InternalServerError}
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.graph.addCustomInstructions({
|
|
68
|
+
* instructions: [{
|
|
69
|
+
* name: "name",
|
|
70
|
+
* text: "text"
|
|
71
|
+
* }]
|
|
72
|
+
* })
|
|
73
|
+
*/
|
|
74
|
+
addCustomInstructions(request: Zep.AddCustomInstructionsRequest, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.SuccessResponse>;
|
|
75
|
+
private __addCustomInstructions;
|
|
76
|
+
/**
|
|
77
|
+
* Deletes custom instructions for graphs or project wide defaults.
|
|
78
|
+
*
|
|
79
|
+
* @param {Zep.DeleteCustomInstructionsRequest} request
|
|
80
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
81
|
+
*
|
|
82
|
+
* @throws {@link Zep.BadRequestError}
|
|
83
|
+
* @throws {@link Zep.InternalServerError}
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* await client.graph.deleteCustomInstructions()
|
|
87
|
+
*/
|
|
88
|
+
deleteCustomInstructions(request?: Zep.DeleteCustomInstructionsRequest, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.SuccessResponse>;
|
|
89
|
+
private __deleteCustomInstructions;
|
|
40
90
|
/**
|
|
41
91
|
* Returns all entity types for a project, user, or graph.
|
|
42
92
|
*
|
|
@@ -117,9 +167,7 @@ export declare class Graph {
|
|
|
117
167
|
* @example
|
|
118
168
|
* await client.graph.addFactTriple({
|
|
119
169
|
* fact: "fact",
|
|
120
|
-
* factName: "fact_name"
|
|
121
|
-
* sourceNodeName: "source_node_name",
|
|
122
|
-
* targetNodeName: "target_node_name"
|
|
170
|
+
* factName: "fact_name"
|
|
123
171
|
* })
|
|
124
172
|
*/
|
|
125
173
|
addFactTriple(request: Zep.AddTripleRequest, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.AddTripleResponse>;
|
|
@@ -71,6 +71,278 @@ class Graph {
|
|
|
71
71
|
var _a;
|
|
72
72
|
return ((_a = this._node) !== null && _a !== void 0 ? _a : (this._node = new Client_js_3.Node(this._options)));
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Lists all custom instructions for a project, user, or graph.
|
|
76
|
+
*
|
|
77
|
+
* @param {Zep.GraphListCustomInstructionsRequest} request
|
|
78
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
79
|
+
*
|
|
80
|
+
* @throws {@link Zep.BadRequestError}
|
|
81
|
+
* @throws {@link Zep.InternalServerError}
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* await client.graph.listCustomInstructions({
|
|
85
|
+
* userId: "user_id",
|
|
86
|
+
* graphId: "graph_id"
|
|
87
|
+
* })
|
|
88
|
+
*/
|
|
89
|
+
listCustomInstructions(request = {}, requestOptions) {
|
|
90
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomInstructions(request, requestOptions));
|
|
91
|
+
}
|
|
92
|
+
__listCustomInstructions() {
|
|
93
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
94
|
+
var _a, _b, _c, _d;
|
|
95
|
+
const { userId, graphId } = request;
|
|
96
|
+
const _queryParams = {};
|
|
97
|
+
if (userId != null) {
|
|
98
|
+
_queryParams["user_id"] = userId;
|
|
99
|
+
}
|
|
100
|
+
if (graphId != null) {
|
|
101
|
+
_queryParams["graph_id"] = graphId;
|
|
102
|
+
}
|
|
103
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
104
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, "custom-instructions"),
|
|
105
|
+
method: "GET",
|
|
106
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
107
|
+
queryParameters: _queryParams,
|
|
108
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
109
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
110
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
111
|
+
});
|
|
112
|
+
if (_response.ok) {
|
|
113
|
+
return {
|
|
114
|
+
data: serializers.ListCustomInstructionsResponse.parseOrThrow(_response.body, {
|
|
115
|
+
unrecognizedObjectKeys: "passthrough",
|
|
116
|
+
allowUnrecognizedUnionMembers: true,
|
|
117
|
+
allowUnrecognizedEnumValues: true,
|
|
118
|
+
skipValidation: true,
|
|
119
|
+
breadcrumbsPrefix: ["response"],
|
|
120
|
+
}),
|
|
121
|
+
rawResponse: _response.rawResponse,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
if (_response.error.reason === "status-code") {
|
|
125
|
+
switch (_response.error.statusCode) {
|
|
126
|
+
case 400:
|
|
127
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
128
|
+
unrecognizedObjectKeys: "passthrough",
|
|
129
|
+
allowUnrecognizedUnionMembers: true,
|
|
130
|
+
allowUnrecognizedEnumValues: true,
|
|
131
|
+
skipValidation: true,
|
|
132
|
+
breadcrumbsPrefix: ["response"],
|
|
133
|
+
}), _response.rawResponse);
|
|
134
|
+
case 500:
|
|
135
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
136
|
+
unrecognizedObjectKeys: "passthrough",
|
|
137
|
+
allowUnrecognizedUnionMembers: true,
|
|
138
|
+
allowUnrecognizedEnumValues: true,
|
|
139
|
+
skipValidation: true,
|
|
140
|
+
breadcrumbsPrefix: ["response"],
|
|
141
|
+
}), _response.rawResponse);
|
|
142
|
+
default:
|
|
143
|
+
throw new errors.ZepError({
|
|
144
|
+
statusCode: _response.error.statusCode,
|
|
145
|
+
body: _response.error.body,
|
|
146
|
+
rawResponse: _response.rawResponse,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
switch (_response.error.reason) {
|
|
151
|
+
case "non-json":
|
|
152
|
+
throw new errors.ZepError({
|
|
153
|
+
statusCode: _response.error.statusCode,
|
|
154
|
+
body: _response.error.rawBody,
|
|
155
|
+
rawResponse: _response.rawResponse,
|
|
156
|
+
});
|
|
157
|
+
case "timeout":
|
|
158
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /custom-instructions.");
|
|
159
|
+
case "unknown":
|
|
160
|
+
throw new errors.ZepError({
|
|
161
|
+
message: _response.error.errorMessage,
|
|
162
|
+
rawResponse: _response.rawResponse,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Adds new custom instructions for graphs without removing existing ones. If user_ids or graph_ids is empty, adds to project-wide default instructions.
|
|
169
|
+
*
|
|
170
|
+
* @param {Zep.AddCustomInstructionsRequest} request
|
|
171
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
172
|
+
*
|
|
173
|
+
* @throws {@link Zep.BadRequestError}
|
|
174
|
+
* @throws {@link Zep.InternalServerError}
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* await client.graph.addCustomInstructions({
|
|
178
|
+
* instructions: [{
|
|
179
|
+
* name: "name",
|
|
180
|
+
* text: "text"
|
|
181
|
+
* }]
|
|
182
|
+
* })
|
|
183
|
+
*/
|
|
184
|
+
addCustomInstructions(request, requestOptions) {
|
|
185
|
+
return core.HttpResponsePromise.fromPromise(this.__addCustomInstructions(request, requestOptions));
|
|
186
|
+
}
|
|
187
|
+
__addCustomInstructions(request, requestOptions) {
|
|
188
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
189
|
+
var _a, _b, _c, _d;
|
|
190
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
191
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, "custom-instructions"),
|
|
192
|
+
method: "POST",
|
|
193
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
194
|
+
contentType: "application/json",
|
|
195
|
+
requestType: "json",
|
|
196
|
+
body: serializers.AddCustomInstructionsRequest.jsonOrThrow(request, {
|
|
197
|
+
unrecognizedObjectKeys: "strip",
|
|
198
|
+
omitUndefined: true,
|
|
199
|
+
}),
|
|
200
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
201
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
202
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
203
|
+
});
|
|
204
|
+
if (_response.ok) {
|
|
205
|
+
return {
|
|
206
|
+
data: serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
207
|
+
unrecognizedObjectKeys: "passthrough",
|
|
208
|
+
allowUnrecognizedUnionMembers: true,
|
|
209
|
+
allowUnrecognizedEnumValues: true,
|
|
210
|
+
skipValidation: true,
|
|
211
|
+
breadcrumbsPrefix: ["response"],
|
|
212
|
+
}),
|
|
213
|
+
rawResponse: _response.rawResponse,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
if (_response.error.reason === "status-code") {
|
|
217
|
+
switch (_response.error.statusCode) {
|
|
218
|
+
case 400:
|
|
219
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
220
|
+
unrecognizedObjectKeys: "passthrough",
|
|
221
|
+
allowUnrecognizedUnionMembers: true,
|
|
222
|
+
allowUnrecognizedEnumValues: true,
|
|
223
|
+
skipValidation: true,
|
|
224
|
+
breadcrumbsPrefix: ["response"],
|
|
225
|
+
}), _response.rawResponse);
|
|
226
|
+
case 500:
|
|
227
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
228
|
+
unrecognizedObjectKeys: "passthrough",
|
|
229
|
+
allowUnrecognizedUnionMembers: true,
|
|
230
|
+
allowUnrecognizedEnumValues: true,
|
|
231
|
+
skipValidation: true,
|
|
232
|
+
breadcrumbsPrefix: ["response"],
|
|
233
|
+
}), _response.rawResponse);
|
|
234
|
+
default:
|
|
235
|
+
throw new errors.ZepError({
|
|
236
|
+
statusCode: _response.error.statusCode,
|
|
237
|
+
body: _response.error.body,
|
|
238
|
+
rawResponse: _response.rawResponse,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
switch (_response.error.reason) {
|
|
243
|
+
case "non-json":
|
|
244
|
+
throw new errors.ZepError({
|
|
245
|
+
statusCode: _response.error.statusCode,
|
|
246
|
+
body: _response.error.rawBody,
|
|
247
|
+
rawResponse: _response.rawResponse,
|
|
248
|
+
});
|
|
249
|
+
case "timeout":
|
|
250
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /custom-instructions.");
|
|
251
|
+
case "unknown":
|
|
252
|
+
throw new errors.ZepError({
|
|
253
|
+
message: _response.error.errorMessage,
|
|
254
|
+
rawResponse: _response.rawResponse,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Deletes custom instructions for graphs or project wide defaults.
|
|
261
|
+
*
|
|
262
|
+
* @param {Zep.DeleteCustomInstructionsRequest} request
|
|
263
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
264
|
+
*
|
|
265
|
+
* @throws {@link Zep.BadRequestError}
|
|
266
|
+
* @throws {@link Zep.InternalServerError}
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* await client.graph.deleteCustomInstructions()
|
|
270
|
+
*/
|
|
271
|
+
deleteCustomInstructions(request = {}, requestOptions) {
|
|
272
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomInstructions(request, requestOptions));
|
|
273
|
+
}
|
|
274
|
+
__deleteCustomInstructions() {
|
|
275
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
276
|
+
var _a, _b, _c, _d;
|
|
277
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
278
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, "custom-instructions"),
|
|
279
|
+
method: "DELETE",
|
|
280
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
281
|
+
contentType: "application/json",
|
|
282
|
+
requestType: "json",
|
|
283
|
+
body: serializers.DeleteCustomInstructionsRequest.jsonOrThrow(request, {
|
|
284
|
+
unrecognizedObjectKeys: "strip",
|
|
285
|
+
omitUndefined: true,
|
|
286
|
+
}),
|
|
287
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
288
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
289
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
290
|
+
});
|
|
291
|
+
if (_response.ok) {
|
|
292
|
+
return {
|
|
293
|
+
data: serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
294
|
+
unrecognizedObjectKeys: "passthrough",
|
|
295
|
+
allowUnrecognizedUnionMembers: true,
|
|
296
|
+
allowUnrecognizedEnumValues: true,
|
|
297
|
+
skipValidation: true,
|
|
298
|
+
breadcrumbsPrefix: ["response"],
|
|
299
|
+
}),
|
|
300
|
+
rawResponse: _response.rawResponse,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
if (_response.error.reason === "status-code") {
|
|
304
|
+
switch (_response.error.statusCode) {
|
|
305
|
+
case 400:
|
|
306
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
307
|
+
unrecognizedObjectKeys: "passthrough",
|
|
308
|
+
allowUnrecognizedUnionMembers: true,
|
|
309
|
+
allowUnrecognizedEnumValues: true,
|
|
310
|
+
skipValidation: true,
|
|
311
|
+
breadcrumbsPrefix: ["response"],
|
|
312
|
+
}), _response.rawResponse);
|
|
313
|
+
case 500:
|
|
314
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
315
|
+
unrecognizedObjectKeys: "passthrough",
|
|
316
|
+
allowUnrecognizedUnionMembers: true,
|
|
317
|
+
allowUnrecognizedEnumValues: true,
|
|
318
|
+
skipValidation: true,
|
|
319
|
+
breadcrumbsPrefix: ["response"],
|
|
320
|
+
}), _response.rawResponse);
|
|
321
|
+
default:
|
|
322
|
+
throw new errors.ZepError({
|
|
323
|
+
statusCode: _response.error.statusCode,
|
|
324
|
+
body: _response.error.body,
|
|
325
|
+
rawResponse: _response.rawResponse,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
switch (_response.error.reason) {
|
|
330
|
+
case "non-json":
|
|
331
|
+
throw new errors.ZepError({
|
|
332
|
+
statusCode: _response.error.statusCode,
|
|
333
|
+
body: _response.error.rawBody,
|
|
334
|
+
rawResponse: _response.rawResponse,
|
|
335
|
+
});
|
|
336
|
+
case "timeout":
|
|
337
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /custom-instructions.");
|
|
338
|
+
case "unknown":
|
|
339
|
+
throw new errors.ZepError({
|
|
340
|
+
message: _response.error.errorMessage,
|
|
341
|
+
rawResponse: _response.rawResponse,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
74
346
|
/**
|
|
75
347
|
* Returns all entity types for a project, user, or graph.
|
|
76
348
|
*
|
|
@@ -454,9 +726,7 @@ class Graph {
|
|
|
454
726
|
* @example
|
|
455
727
|
* await client.graph.addFactTriple({
|
|
456
728
|
* fact: "fact",
|
|
457
|
-
* factName: "fact_name"
|
|
458
|
-
* sourceNodeName: "source_node_name",
|
|
459
|
-
* targetNodeName: "target_node_name"
|
|
729
|
+
* factName: "fact_name"
|
|
460
730
|
* })
|
|
461
731
|
*/
|
|
462
732
|
addFactTriple(request, requestOptions) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Zep from "../../../../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* instructions: [{
|
|
9
|
+
* name: "name",
|
|
10
|
+
* text: "text"
|
|
11
|
+
* }]
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
export interface AddCustomInstructionsRequest {
|
|
15
|
+
/** Graph IDs to add the instructions to. If empty, the instructions are added to the project-wide default. */
|
|
16
|
+
graphIds?: string[];
|
|
17
|
+
/** Instructions to add to the graph. */
|
|
18
|
+
instructions: Zep.CustomInstruction[];
|
|
19
|
+
/** User IDs to add the instructions to. If empty, the instructions are added to the project-wide default. */
|
|
20
|
+
userIds?: string[];
|
|
21
|
+
}
|
|
@@ -5,14 +5,17 @@
|
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
7
|
* fact: "fact",
|
|
8
|
-
* factName: "fact_name"
|
|
9
|
-
* sourceNodeName: "source_node_name",
|
|
10
|
-
* targetNodeName: "target_node_name"
|
|
8
|
+
* factName: "fact_name"
|
|
11
9
|
* }
|
|
12
10
|
*/
|
|
13
11
|
export interface AddTripleRequest {
|
|
14
12
|
/** The timestamp of the message */
|
|
15
13
|
createdAt?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Additional attributes of the edge. Values must be scalar types (string, number, boolean, or null).
|
|
16
|
+
* Nested objects and arrays are not allowed.
|
|
17
|
+
*/
|
|
18
|
+
edgeAttributes?: Record<string, unknown>;
|
|
16
19
|
/** The time (if any) at which the edge expires */
|
|
17
20
|
expiredAt?: string;
|
|
18
21
|
/** The fact relating the two nodes that this edge represents */
|
|
@@ -24,14 +27,24 @@ export interface AddTripleRequest {
|
|
|
24
27
|
graphId?: string;
|
|
25
28
|
/** The time (if any) at which the fact stops being true */
|
|
26
29
|
invalidAt?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Additional attributes of the source node. Values must be scalar types (string, number, boolean, or null).
|
|
32
|
+
* Nested objects and arrays are not allowed.
|
|
33
|
+
*/
|
|
34
|
+
sourceNodeAttributes?: Record<string, unknown>;
|
|
27
35
|
/** The name of the source node to add */
|
|
28
|
-
sourceNodeName
|
|
36
|
+
sourceNodeName?: string;
|
|
29
37
|
/** The summary of the source node to add */
|
|
30
38
|
sourceNodeSummary?: string;
|
|
31
39
|
/** The source node uuid */
|
|
32
40
|
sourceNodeUuid?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Additional attributes of the target node. Values must be scalar types (string, number, boolean, or null).
|
|
43
|
+
* Nested objects and arrays are not allowed.
|
|
44
|
+
*/
|
|
45
|
+
targetNodeAttributes?: Record<string, unknown>;
|
|
33
46
|
/** The name of the target node to add */
|
|
34
|
-
targetNodeName
|
|
47
|
+
targetNodeName?: string;
|
|
35
48
|
/** The summary of the target node to add */
|
|
36
49
|
targetNodeSummary?: string;
|
|
37
50
|
/** The target node uuid */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {}
|
|
7
|
+
*/
|
|
8
|
+
export interface DeleteCustomInstructionsRequest {
|
|
9
|
+
/** Determines which group graphs will have their custom instructions deleted. If no graphs are provided, the project-wide custom instructions will be affected. */
|
|
10
|
+
graphIds?: string[];
|
|
11
|
+
/** Unique identifier for the instructions to be deleted. If empty deletes all instructions. */
|
|
12
|
+
instructionNames?: string[];
|
|
13
|
+
/** Determines which user graphs will have their custom instructions deleted. If no users are provided, the project-wide custom instructions will be affected. */
|
|
14
|
+
userIds?: string[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* userId: "user_id",
|
|
8
|
+
* graphId: "graph_id"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface GraphListCustomInstructionsRequest {
|
|
12
|
+
/**
|
|
13
|
+
* User ID to get user-specific instructions
|
|
14
|
+
*/
|
|
15
|
+
userId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Graph ID to get graph-specific instructions
|
|
18
|
+
*/
|
|
19
|
+
graphId?: string;
|
|
20
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { type GraphListCustomInstructionsRequest } from "./GraphListCustomInstructionsRequest.js";
|
|
2
|
+
export { type AddCustomInstructionsRequest } from "./AddCustomInstructionsRequest.js";
|
|
3
|
+
export { type DeleteCustomInstructionsRequest } from "./DeleteCustomInstructionsRequest.js";
|
|
1
4
|
export { type GraphListEntityTypesRequest } from "./GraphListEntityTypesRequest.js";
|
|
2
5
|
export { type EntityTypeRequest } from "./EntityTypeRequest.js";
|
|
3
6
|
export { type AddDataRequest } from "./AddDataRequest.js";
|
|
@@ -101,6 +101,20 @@ export declare class Node {
|
|
|
101
101
|
*/
|
|
102
102
|
get(uuid: string, requestOptions?: Node.RequestOptions): core.HttpResponsePromise<Zep.EntityNode>;
|
|
103
103
|
private __get;
|
|
104
|
+
/**
|
|
105
|
+
* Deletes a node by UUID.
|
|
106
|
+
*
|
|
107
|
+
* @param {string} uuid - Node UUID
|
|
108
|
+
* @param {Node.RequestOptions} requestOptions - Request-specific configuration.
|
|
109
|
+
*
|
|
110
|
+
* @throws {@link Zep.BadRequestError}
|
|
111
|
+
* @throws {@link Zep.InternalServerError}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* await client.graph.node.delete("uuid")
|
|
115
|
+
*/
|
|
116
|
+
delete(uuid: string, requestOptions?: Node.RequestOptions): core.HttpResponsePromise<Zep.SuccessResponse>;
|
|
117
|
+
private __delete;
|
|
104
118
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
105
119
|
Authorization: string;
|
|
106
120
|
}>;
|
|
@@ -484,6 +484,87 @@ class Node {
|
|
|
484
484
|
}
|
|
485
485
|
});
|
|
486
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* Deletes a node by UUID.
|
|
489
|
+
*
|
|
490
|
+
* @param {string} uuid - Node UUID
|
|
491
|
+
* @param {Node.RequestOptions} requestOptions - Request-specific configuration.
|
|
492
|
+
*
|
|
493
|
+
* @throws {@link Zep.BadRequestError}
|
|
494
|
+
* @throws {@link Zep.InternalServerError}
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* await client.graph.node.delete("uuid")
|
|
498
|
+
*/
|
|
499
|
+
delete(uuid, requestOptions) {
|
|
500
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(uuid, requestOptions));
|
|
501
|
+
}
|
|
502
|
+
__delete(uuid, requestOptions) {
|
|
503
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
504
|
+
var _a, _b, _c, _d;
|
|
505
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
506
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, `graph/node/${encodeURIComponent(uuid)}`),
|
|
507
|
+
method: "DELETE",
|
|
508
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
509
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
510
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
511
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
512
|
+
});
|
|
513
|
+
if (_response.ok) {
|
|
514
|
+
return {
|
|
515
|
+
data: serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
516
|
+
unrecognizedObjectKeys: "passthrough",
|
|
517
|
+
allowUnrecognizedUnionMembers: true,
|
|
518
|
+
allowUnrecognizedEnumValues: true,
|
|
519
|
+
skipValidation: true,
|
|
520
|
+
breadcrumbsPrefix: ["response"],
|
|
521
|
+
}),
|
|
522
|
+
rawResponse: _response.rawResponse,
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
if (_response.error.reason === "status-code") {
|
|
526
|
+
switch (_response.error.statusCode) {
|
|
527
|
+
case 400:
|
|
528
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
529
|
+
unrecognizedObjectKeys: "passthrough",
|
|
530
|
+
allowUnrecognizedUnionMembers: true,
|
|
531
|
+
allowUnrecognizedEnumValues: true,
|
|
532
|
+
skipValidation: true,
|
|
533
|
+
breadcrumbsPrefix: ["response"],
|
|
534
|
+
}), _response.rawResponse);
|
|
535
|
+
case 500:
|
|
536
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
537
|
+
unrecognizedObjectKeys: "passthrough",
|
|
538
|
+
allowUnrecognizedUnionMembers: true,
|
|
539
|
+
allowUnrecognizedEnumValues: true,
|
|
540
|
+
skipValidation: true,
|
|
541
|
+
breadcrumbsPrefix: ["response"],
|
|
542
|
+
}), _response.rawResponse);
|
|
543
|
+
default:
|
|
544
|
+
throw new errors.ZepError({
|
|
545
|
+
statusCode: _response.error.statusCode,
|
|
546
|
+
body: _response.error.body,
|
|
547
|
+
rawResponse: _response.rawResponse,
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
switch (_response.error.reason) {
|
|
552
|
+
case "non-json":
|
|
553
|
+
throw new errors.ZepError({
|
|
554
|
+
statusCode: _response.error.statusCode,
|
|
555
|
+
body: _response.error.rawBody,
|
|
556
|
+
rawResponse: _response.rawResponse,
|
|
557
|
+
});
|
|
558
|
+
case "timeout":
|
|
559
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /graph/node/{uuid}.");
|
|
560
|
+
case "unknown":
|
|
561
|
+
throw new errors.ZepError({
|
|
562
|
+
message: _response.error.errorMessage,
|
|
563
|
+
rawResponse: _response.rawResponse,
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
}
|
|
487
568
|
_getCustomAuthorizationHeaders() {
|
|
488
569
|
return __awaiter(this, void 0, void 0, function* () {
|
|
489
570
|
var _a;
|
|
@@ -12,7 +12,7 @@ import * as Zep from "../../../../index.js";
|
|
|
12
12
|
*/
|
|
13
13
|
export interface ThreadGetUserContextRequest {
|
|
14
14
|
/**
|
|
15
|
-
* The minimum rating by which to filter relevant facts.
|
|
15
|
+
* Deprecated, this field will be removed in a future release. The minimum rating by which to filter relevant facts.
|
|
16
16
|
*/
|
|
17
17
|
minRating?: number;
|
|
18
18
|
/**
|