@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/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.
|
|
1
|
+
export declare const SDK_VERSION = "3.15.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -14,8 +14,8 @@ export class ZepClient {
|
|
|
14
14
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
15
15
|
"X-Fern-Language": "JavaScript",
|
|
16
16
|
"X-Fern-SDK-Name": "zep-cloud",
|
|
17
|
-
"X-Fern-SDK-Version": "3.
|
|
18
|
-
"User-Agent": "zep-cloud/3.
|
|
17
|
+
"X-Fern-SDK-Version": "3.15.0",
|
|
18
|
+
"User-Agent": "zep-cloud/3.15.0",
|
|
19
19
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
20
20
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
21
21
|
}, _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>;
|
|
@@ -35,6 +35,278 @@ export class Graph {
|
|
|
35
35
|
var _a;
|
|
36
36
|
return ((_a = this._node) !== null && _a !== void 0 ? _a : (this._node = new Node(this._options)));
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Lists all custom instructions for a project, user, or graph.
|
|
40
|
+
*
|
|
41
|
+
* @param {Zep.GraphListCustomInstructionsRequest} request
|
|
42
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
|
+
*
|
|
44
|
+
* @throws {@link Zep.BadRequestError}
|
|
45
|
+
* @throws {@link Zep.InternalServerError}
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* await client.graph.listCustomInstructions({
|
|
49
|
+
* userId: "user_id",
|
|
50
|
+
* graphId: "graph_id"
|
|
51
|
+
* })
|
|
52
|
+
*/
|
|
53
|
+
listCustomInstructions(request = {}, requestOptions) {
|
|
54
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomInstructions(request, requestOptions));
|
|
55
|
+
}
|
|
56
|
+
__listCustomInstructions() {
|
|
57
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
58
|
+
var _a, _b, _c, _d;
|
|
59
|
+
const { userId, graphId } = request;
|
|
60
|
+
const _queryParams = {};
|
|
61
|
+
if (userId != null) {
|
|
62
|
+
_queryParams["user_id"] = userId;
|
|
63
|
+
}
|
|
64
|
+
if (graphId != null) {
|
|
65
|
+
_queryParams["graph_id"] = graphId;
|
|
66
|
+
}
|
|
67
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
68
|
+
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"),
|
|
69
|
+
method: "GET",
|
|
70
|
+
headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
71
|
+
queryParameters: _queryParams,
|
|
72
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
73
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
74
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
75
|
+
});
|
|
76
|
+
if (_response.ok) {
|
|
77
|
+
return {
|
|
78
|
+
data: serializers.ListCustomInstructionsResponse.parseOrThrow(_response.body, {
|
|
79
|
+
unrecognizedObjectKeys: "passthrough",
|
|
80
|
+
allowUnrecognizedUnionMembers: true,
|
|
81
|
+
allowUnrecognizedEnumValues: true,
|
|
82
|
+
skipValidation: true,
|
|
83
|
+
breadcrumbsPrefix: ["response"],
|
|
84
|
+
}),
|
|
85
|
+
rawResponse: _response.rawResponse,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (_response.error.reason === "status-code") {
|
|
89
|
+
switch (_response.error.statusCode) {
|
|
90
|
+
case 400:
|
|
91
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
92
|
+
unrecognizedObjectKeys: "passthrough",
|
|
93
|
+
allowUnrecognizedUnionMembers: true,
|
|
94
|
+
allowUnrecognizedEnumValues: true,
|
|
95
|
+
skipValidation: true,
|
|
96
|
+
breadcrumbsPrefix: ["response"],
|
|
97
|
+
}), _response.rawResponse);
|
|
98
|
+
case 500:
|
|
99
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
100
|
+
unrecognizedObjectKeys: "passthrough",
|
|
101
|
+
allowUnrecognizedUnionMembers: true,
|
|
102
|
+
allowUnrecognizedEnumValues: true,
|
|
103
|
+
skipValidation: true,
|
|
104
|
+
breadcrumbsPrefix: ["response"],
|
|
105
|
+
}), _response.rawResponse);
|
|
106
|
+
default:
|
|
107
|
+
throw new errors.ZepError({
|
|
108
|
+
statusCode: _response.error.statusCode,
|
|
109
|
+
body: _response.error.body,
|
|
110
|
+
rawResponse: _response.rawResponse,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
switch (_response.error.reason) {
|
|
115
|
+
case "non-json":
|
|
116
|
+
throw new errors.ZepError({
|
|
117
|
+
statusCode: _response.error.statusCode,
|
|
118
|
+
body: _response.error.rawBody,
|
|
119
|
+
rawResponse: _response.rawResponse,
|
|
120
|
+
});
|
|
121
|
+
case "timeout":
|
|
122
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /custom-instructions.");
|
|
123
|
+
case "unknown":
|
|
124
|
+
throw new errors.ZepError({
|
|
125
|
+
message: _response.error.errorMessage,
|
|
126
|
+
rawResponse: _response.rawResponse,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Adds new custom instructions for graphs without removing existing ones. If user_ids or graph_ids is empty, adds to project-wide default instructions.
|
|
133
|
+
*
|
|
134
|
+
* @param {Zep.AddCustomInstructionsRequest} request
|
|
135
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
136
|
+
*
|
|
137
|
+
* @throws {@link Zep.BadRequestError}
|
|
138
|
+
* @throws {@link Zep.InternalServerError}
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* await client.graph.addCustomInstructions({
|
|
142
|
+
* instructions: [{
|
|
143
|
+
* name: "name",
|
|
144
|
+
* text: "text"
|
|
145
|
+
* }]
|
|
146
|
+
* })
|
|
147
|
+
*/
|
|
148
|
+
addCustomInstructions(request, requestOptions) {
|
|
149
|
+
return core.HttpResponsePromise.fromPromise(this.__addCustomInstructions(request, requestOptions));
|
|
150
|
+
}
|
|
151
|
+
__addCustomInstructions(request, requestOptions) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
var _a, _b, _c, _d;
|
|
154
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
155
|
+
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"),
|
|
156
|
+
method: "POST",
|
|
157
|
+
headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
158
|
+
contentType: "application/json",
|
|
159
|
+
requestType: "json",
|
|
160
|
+
body: serializers.AddCustomInstructionsRequest.jsonOrThrow(request, {
|
|
161
|
+
unrecognizedObjectKeys: "strip",
|
|
162
|
+
omitUndefined: true,
|
|
163
|
+
}),
|
|
164
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
165
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
166
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
167
|
+
});
|
|
168
|
+
if (_response.ok) {
|
|
169
|
+
return {
|
|
170
|
+
data: serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
171
|
+
unrecognizedObjectKeys: "passthrough",
|
|
172
|
+
allowUnrecognizedUnionMembers: true,
|
|
173
|
+
allowUnrecognizedEnumValues: true,
|
|
174
|
+
skipValidation: true,
|
|
175
|
+
breadcrumbsPrefix: ["response"],
|
|
176
|
+
}),
|
|
177
|
+
rawResponse: _response.rawResponse,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
if (_response.error.reason === "status-code") {
|
|
181
|
+
switch (_response.error.statusCode) {
|
|
182
|
+
case 400:
|
|
183
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
184
|
+
unrecognizedObjectKeys: "passthrough",
|
|
185
|
+
allowUnrecognizedUnionMembers: true,
|
|
186
|
+
allowUnrecognizedEnumValues: true,
|
|
187
|
+
skipValidation: true,
|
|
188
|
+
breadcrumbsPrefix: ["response"],
|
|
189
|
+
}), _response.rawResponse);
|
|
190
|
+
case 500:
|
|
191
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
192
|
+
unrecognizedObjectKeys: "passthrough",
|
|
193
|
+
allowUnrecognizedUnionMembers: true,
|
|
194
|
+
allowUnrecognizedEnumValues: true,
|
|
195
|
+
skipValidation: true,
|
|
196
|
+
breadcrumbsPrefix: ["response"],
|
|
197
|
+
}), _response.rawResponse);
|
|
198
|
+
default:
|
|
199
|
+
throw new errors.ZepError({
|
|
200
|
+
statusCode: _response.error.statusCode,
|
|
201
|
+
body: _response.error.body,
|
|
202
|
+
rawResponse: _response.rawResponse,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
switch (_response.error.reason) {
|
|
207
|
+
case "non-json":
|
|
208
|
+
throw new errors.ZepError({
|
|
209
|
+
statusCode: _response.error.statusCode,
|
|
210
|
+
body: _response.error.rawBody,
|
|
211
|
+
rawResponse: _response.rawResponse,
|
|
212
|
+
});
|
|
213
|
+
case "timeout":
|
|
214
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /custom-instructions.");
|
|
215
|
+
case "unknown":
|
|
216
|
+
throw new errors.ZepError({
|
|
217
|
+
message: _response.error.errorMessage,
|
|
218
|
+
rawResponse: _response.rawResponse,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Deletes custom instructions for graphs or project wide defaults.
|
|
225
|
+
*
|
|
226
|
+
* @param {Zep.DeleteCustomInstructionsRequest} request
|
|
227
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
228
|
+
*
|
|
229
|
+
* @throws {@link Zep.BadRequestError}
|
|
230
|
+
* @throws {@link Zep.InternalServerError}
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* await client.graph.deleteCustomInstructions()
|
|
234
|
+
*/
|
|
235
|
+
deleteCustomInstructions(request = {}, requestOptions) {
|
|
236
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomInstructions(request, requestOptions));
|
|
237
|
+
}
|
|
238
|
+
__deleteCustomInstructions() {
|
|
239
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
240
|
+
var _a, _b, _c, _d;
|
|
241
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
242
|
+
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"),
|
|
243
|
+
method: "DELETE",
|
|
244
|
+
headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
245
|
+
contentType: "application/json",
|
|
246
|
+
requestType: "json",
|
|
247
|
+
body: serializers.DeleteCustomInstructionsRequest.jsonOrThrow(request, {
|
|
248
|
+
unrecognizedObjectKeys: "strip",
|
|
249
|
+
omitUndefined: true,
|
|
250
|
+
}),
|
|
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 {
|
|
257
|
+
data: serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
258
|
+
unrecognizedObjectKeys: "passthrough",
|
|
259
|
+
allowUnrecognizedUnionMembers: true,
|
|
260
|
+
allowUnrecognizedEnumValues: true,
|
|
261
|
+
skipValidation: true,
|
|
262
|
+
breadcrumbsPrefix: ["response"],
|
|
263
|
+
}),
|
|
264
|
+
rawResponse: _response.rawResponse,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
if (_response.error.reason === "status-code") {
|
|
268
|
+
switch (_response.error.statusCode) {
|
|
269
|
+
case 400:
|
|
270
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
271
|
+
unrecognizedObjectKeys: "passthrough",
|
|
272
|
+
allowUnrecognizedUnionMembers: true,
|
|
273
|
+
allowUnrecognizedEnumValues: true,
|
|
274
|
+
skipValidation: true,
|
|
275
|
+
breadcrumbsPrefix: ["response"],
|
|
276
|
+
}), _response.rawResponse);
|
|
277
|
+
case 500:
|
|
278
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
279
|
+
unrecognizedObjectKeys: "passthrough",
|
|
280
|
+
allowUnrecognizedUnionMembers: true,
|
|
281
|
+
allowUnrecognizedEnumValues: true,
|
|
282
|
+
skipValidation: true,
|
|
283
|
+
breadcrumbsPrefix: ["response"],
|
|
284
|
+
}), _response.rawResponse);
|
|
285
|
+
default:
|
|
286
|
+
throw new errors.ZepError({
|
|
287
|
+
statusCode: _response.error.statusCode,
|
|
288
|
+
body: _response.error.body,
|
|
289
|
+
rawResponse: _response.rawResponse,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
switch (_response.error.reason) {
|
|
294
|
+
case "non-json":
|
|
295
|
+
throw new errors.ZepError({
|
|
296
|
+
statusCode: _response.error.statusCode,
|
|
297
|
+
body: _response.error.rawBody,
|
|
298
|
+
rawResponse: _response.rawResponse,
|
|
299
|
+
});
|
|
300
|
+
case "timeout":
|
|
301
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /custom-instructions.");
|
|
302
|
+
case "unknown":
|
|
303
|
+
throw new errors.ZepError({
|
|
304
|
+
message: _response.error.errorMessage,
|
|
305
|
+
rawResponse: _response.rawResponse,
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
}
|
|
38
310
|
/**
|
|
39
311
|
* Returns all entity types for a project, user, or graph.
|
|
40
312
|
*
|
|
@@ -418,9 +690,7 @@ export class Graph {
|
|
|
418
690
|
* @example
|
|
419
691
|
* await client.graph.addFactTriple({
|
|
420
692
|
* fact: "fact",
|
|
421
|
-
* factName: "fact_name"
|
|
422
|
-
* sourceNodeName: "source_node_name",
|
|
423
|
-
* targetNodeName: "target_node_name"
|
|
693
|
+
* factName: "fact_name"
|
|
424
694
|
* })
|
|
425
695
|
*/
|
|
426
696
|
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.mjs";
|
|
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.mjs";
|
|
2
|
+
export { type AddCustomInstructionsRequest } from "./AddCustomInstructionsRequest.mjs";
|
|
3
|
+
export { type DeleteCustomInstructionsRequest } from "./DeleteCustomInstructionsRequest.mjs";
|
|
1
4
|
export { type GraphListEntityTypesRequest } from "./GraphListEntityTypesRequest.mjs";
|
|
2
5
|
export { type EntityTypeRequest } from "./EntityTypeRequest.mjs";
|
|
3
6
|
export { type AddDataRequest } from "./AddDataRequest.mjs";
|
|
@@ -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
|
}>;
|
|
@@ -448,6 +448,87 @@ export class Node {
|
|
|
448
448
|
}
|
|
449
449
|
});
|
|
450
450
|
}
|
|
451
|
+
/**
|
|
452
|
+
* Deletes a node by UUID.
|
|
453
|
+
*
|
|
454
|
+
* @param {string} uuid - Node UUID
|
|
455
|
+
* @param {Node.RequestOptions} requestOptions - Request-specific configuration.
|
|
456
|
+
*
|
|
457
|
+
* @throws {@link Zep.BadRequestError}
|
|
458
|
+
* @throws {@link Zep.InternalServerError}
|
|
459
|
+
*
|
|
460
|
+
* @example
|
|
461
|
+
* await client.graph.node.delete("uuid")
|
|
462
|
+
*/
|
|
463
|
+
delete(uuid, requestOptions) {
|
|
464
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(uuid, requestOptions));
|
|
465
|
+
}
|
|
466
|
+
__delete(uuid, requestOptions) {
|
|
467
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
468
|
+
var _a, _b, _c, _d;
|
|
469
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
470
|
+
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)}`),
|
|
471
|
+
method: "DELETE",
|
|
472
|
+
headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
473
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
474
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
475
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
476
|
+
});
|
|
477
|
+
if (_response.ok) {
|
|
478
|
+
return {
|
|
479
|
+
data: serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
480
|
+
unrecognizedObjectKeys: "passthrough",
|
|
481
|
+
allowUnrecognizedUnionMembers: true,
|
|
482
|
+
allowUnrecognizedEnumValues: true,
|
|
483
|
+
skipValidation: true,
|
|
484
|
+
breadcrumbsPrefix: ["response"],
|
|
485
|
+
}),
|
|
486
|
+
rawResponse: _response.rawResponse,
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
if (_response.error.reason === "status-code") {
|
|
490
|
+
switch (_response.error.statusCode) {
|
|
491
|
+
case 400:
|
|
492
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
493
|
+
unrecognizedObjectKeys: "passthrough",
|
|
494
|
+
allowUnrecognizedUnionMembers: true,
|
|
495
|
+
allowUnrecognizedEnumValues: true,
|
|
496
|
+
skipValidation: true,
|
|
497
|
+
breadcrumbsPrefix: ["response"],
|
|
498
|
+
}), _response.rawResponse);
|
|
499
|
+
case 500:
|
|
500
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
501
|
+
unrecognizedObjectKeys: "passthrough",
|
|
502
|
+
allowUnrecognizedUnionMembers: true,
|
|
503
|
+
allowUnrecognizedEnumValues: true,
|
|
504
|
+
skipValidation: true,
|
|
505
|
+
breadcrumbsPrefix: ["response"],
|
|
506
|
+
}), _response.rawResponse);
|
|
507
|
+
default:
|
|
508
|
+
throw new errors.ZepError({
|
|
509
|
+
statusCode: _response.error.statusCode,
|
|
510
|
+
body: _response.error.body,
|
|
511
|
+
rawResponse: _response.rawResponse,
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
switch (_response.error.reason) {
|
|
516
|
+
case "non-json":
|
|
517
|
+
throw new errors.ZepError({
|
|
518
|
+
statusCode: _response.error.statusCode,
|
|
519
|
+
body: _response.error.rawBody,
|
|
520
|
+
rawResponse: _response.rawResponse,
|
|
521
|
+
});
|
|
522
|
+
case "timeout":
|
|
523
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /graph/node/{uuid}.");
|
|
524
|
+
case "unknown":
|
|
525
|
+
throw new errors.ZepError({
|
|
526
|
+
message: _response.error.errorMessage,
|
|
527
|
+
rawResponse: _response.rawResponse,
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
}
|
|
451
532
|
_getCustomAuthorizationHeaders() {
|
|
452
533
|
return __awaiter(this, void 0, void 0, function* () {
|
|
453
534
|
var _a;
|
|
@@ -12,7 +12,7 @@ import * as Zep from "../../../../index.mjs";
|
|
|
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
|
/**
|
|
@@ -13,7 +13,7 @@ export interface CreateUserRequest {
|
|
|
13
13
|
disableDefaultOntology?: boolean;
|
|
14
14
|
/** The email address of the user. */
|
|
15
15
|
email?: string;
|
|
16
|
-
/** Optional instruction to use for fact rating. */
|
|
16
|
+
/** Deprecated: this field will be removed in a future release. Optional instruction to use for fact rating. */
|
|
17
17
|
factRatingInstruction?: Zep.FactRatingInstruction;
|
|
18
18
|
/** The first name of the user. */
|
|
19
19
|
firstName?: string;
|
|
@@ -11,7 +11,7 @@ export interface UpdateUserRequest {
|
|
|
11
11
|
disableDefaultOntology?: boolean;
|
|
12
12
|
/** The email address of the user. */
|
|
13
13
|
email?: string;
|
|
14
|
-
/** Optional instruction to use for fact rating. */
|
|
14
|
+
/** Deprecated: this field will be removed in a future release. Optional instruction to use for fact rating. */
|
|
15
15
|
factRatingInstruction?: Zep.FactRatingInstruction;
|
|
16
16
|
/** The first name of the user. */
|
|
17
17
|
firstName?: string;
|