@getzep/zep-cloud 3.12.0 → 3.14.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.d.ts +3 -0
- package/dist/cjs/Client.js +11 -6
- package/dist/cjs/api/resources/graph/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/graph/client/Client.js +1 -2
- package/dist/cjs/api/resources/graph/client/requests/AddTripleRequest.d.ts +17 -3
- 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/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.js +2 -1
- package/dist/cjs/api/resources/task/client/Client.d.ts +48 -0
- package/dist/cjs/api/resources/task/client/Client.js +148 -0
- package/dist/cjs/api/resources/task/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/task/client/index.js +2 -0
- package/dist/cjs/api/resources/task/index.d.ts +1 -0
- package/dist/cjs/api/resources/task/index.js +17 -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/AddThreadMessagesResponse.d.ts +1 -0
- package/dist/cjs/api/types/AddTripleResponse.d.ts +2 -0
- package/dist/cjs/api/types/CloneGraphResponse.d.ts +2 -0
- package/dist/cjs/api/types/DateFilter.d.ts +5 -2
- package/dist/cjs/api/types/Episode.d.ts +2 -0
- package/dist/cjs/api/types/GetTaskResponse.d.ts +15 -0
- package/dist/cjs/api/types/GetTaskResponse.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/TaskErrorResponse.d.ts +8 -0
- package/dist/cjs/api/types/TaskErrorResponse.js +5 -0
- package/dist/cjs/api/types/TaskProgress.d.ts +7 -0
- package/dist/cjs/api/types/TaskProgress.js +5 -0
- package/dist/cjs/api/types/index.d.ts +4 -0
- package/dist/cjs/api/types/index.js +4 -0
- package/dist/cjs/serialization/resources/graph/client/requests/AddTripleRequest.d.ts +4 -1
- package/dist/cjs/serialization/resources/graph/client/requests/AddTripleRequest.js +4 -1
- package/dist/cjs/serialization/types/AddThreadMessagesResponse.d.ts +1 -0
- package/dist/cjs/serialization/types/AddThreadMessagesResponse.js +1 -0
- package/dist/cjs/serialization/types/AddTripleResponse.d.ts +1 -0
- package/dist/cjs/serialization/types/AddTripleResponse.js +1 -0
- package/dist/cjs/serialization/types/CloneGraphResponse.d.ts +1 -0
- package/dist/cjs/serialization/types/CloneGraphResponse.js +1 -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/Episode.d.ts +1 -0
- package/dist/cjs/serialization/types/Episode.js +1 -0
- package/dist/cjs/serialization/types/GetTaskResponse.d.ts +22 -0
- package/dist/cjs/serialization/types/GetTaskResponse.js +53 -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/TaskErrorResponse.d.ts +14 -0
- package/dist/cjs/serialization/types/TaskErrorResponse.js +45 -0
- package/dist/cjs/serialization/types/TaskProgress.d.ts +13 -0
- package/dist/cjs/serialization/types/TaskProgress.js +44 -0
- package/dist/cjs/serialization/types/index.d.ts +4 -0
- package/dist/cjs/serialization/types/index.js +4 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +7 -2
- package/dist/esm/api/resources/graph/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/graph/client/Client.mjs +1 -2
- package/dist/esm/api/resources/graph/client/requests/AddTripleRequest.d.mts +17 -3
- 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/index.d.mts +1 -0
- package/dist/esm/api/resources/index.mjs +1 -0
- package/dist/esm/api/resources/task/client/Client.d.mts +48 -0
- package/dist/esm/api/resources/task/client/Client.mjs +111 -0
- package/dist/esm/api/resources/task/client/index.d.mts +1 -0
- package/dist/esm/api/resources/task/client/index.mjs +1 -0
- package/dist/esm/api/resources/task/index.d.mts +1 -0
- package/dist/esm/api/resources/task/index.mjs +1 -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/AddThreadMessagesResponse.d.mts +1 -0
- package/dist/esm/api/types/AddTripleResponse.d.mts +2 -0
- package/dist/esm/api/types/CloneGraphResponse.d.mts +2 -0
- package/dist/esm/api/types/DateFilter.d.mts +5 -2
- package/dist/esm/api/types/Episode.d.mts +2 -0
- package/dist/esm/api/types/GetTaskResponse.d.mts +15 -0
- package/dist/esm/api/types/GetTaskResponse.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/TaskErrorResponse.d.mts +8 -0
- package/dist/esm/api/types/TaskErrorResponse.mjs +4 -0
- package/dist/esm/api/types/TaskProgress.d.mts +7 -0
- package/dist/esm/api/types/TaskProgress.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +4 -0
- package/dist/esm/api/types/index.mjs +4 -0
- package/dist/esm/serialization/resources/graph/client/requests/AddTripleRequest.d.mts +4 -1
- package/dist/esm/serialization/resources/graph/client/requests/AddTripleRequest.mjs +4 -1
- package/dist/esm/serialization/types/AddThreadMessagesResponse.d.mts +1 -0
- package/dist/esm/serialization/types/AddThreadMessagesResponse.mjs +1 -0
- package/dist/esm/serialization/types/AddTripleResponse.d.mts +1 -0
- package/dist/esm/serialization/types/AddTripleResponse.mjs +1 -0
- package/dist/esm/serialization/types/CloneGraphResponse.d.mts +1 -0
- package/dist/esm/serialization/types/CloneGraphResponse.mjs +1 -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/Episode.d.mts +1 -0
- package/dist/esm/serialization/types/Episode.mjs +1 -0
- package/dist/esm/serialization/types/GetTaskResponse.d.mts +22 -0
- package/dist/esm/serialization/types/GetTaskResponse.mjs +17 -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/TaskErrorResponse.d.mts +14 -0
- package/dist/esm/serialization/types/TaskErrorResponse.mjs +9 -0
- package/dist/esm/serialization/types/TaskProgress.d.mts +13 -0
- package/dist/esm/serialization/types/TaskProgress.mjs +8 -0
- package/dist/esm/serialization/types/index.d.mts +4 -0
- package/dist/esm/serialization/types/index.mjs +4 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +128 -1
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.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import * as core from "./core/index.js";
|
|
|
6
6
|
import { Context } from "./api/resources/context/client/Client.js";
|
|
7
7
|
import { Graph } from "./api/resources/graph/client/Client.js";
|
|
8
8
|
import { Project } from "./api/resources/project/client/Client.js";
|
|
9
|
+
import { Task } from "./api/resources/task/client/Client.js";
|
|
9
10
|
import { Thread } from "./api/resources/thread/client/Client.js";
|
|
10
11
|
import { User } from "./api/resources/user/client/Client.js";
|
|
11
12
|
export declare namespace ZepClient {
|
|
@@ -34,12 +35,14 @@ export declare class ZepClient {
|
|
|
34
35
|
protected _context: Context | undefined;
|
|
35
36
|
protected _graph: Graph | undefined;
|
|
36
37
|
protected _project: Project | undefined;
|
|
38
|
+
protected _task: Task | undefined;
|
|
37
39
|
protected _thread: Thread | undefined;
|
|
38
40
|
protected _user: User | undefined;
|
|
39
41
|
constructor(_options?: ZepClient.Options);
|
|
40
42
|
get context(): Context;
|
|
41
43
|
get graph(): Graph;
|
|
42
44
|
get project(): Project;
|
|
45
|
+
get task(): Task;
|
|
43
46
|
get thread(): Thread;
|
|
44
47
|
get user(): User;
|
|
45
48
|
}
|
package/dist/cjs/Client.js
CHANGED
|
@@ -42,15 +42,16 @@ const headers_js_1 = require("./core/headers.js");
|
|
|
42
42
|
const Client_js_1 = require("./api/resources/context/client/Client.js");
|
|
43
43
|
const Client_js_2 = require("./api/resources/graph/client/Client.js");
|
|
44
44
|
const Client_js_3 = require("./api/resources/project/client/Client.js");
|
|
45
|
-
const Client_js_4 = require("./api/resources/
|
|
46
|
-
const Client_js_5 = require("./api/resources/
|
|
45
|
+
const Client_js_4 = require("./api/resources/task/client/Client.js");
|
|
46
|
+
const Client_js_5 = require("./api/resources/thread/client/Client.js");
|
|
47
|
+
const Client_js_6 = require("./api/resources/user/client/Client.js");
|
|
47
48
|
class ZepClient {
|
|
48
49
|
constructor(_options = {}) {
|
|
49
50
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
50
51
|
"X-Fern-Language": "JavaScript",
|
|
51
52
|
"X-Fern-SDK-Name": "zep-cloud",
|
|
52
|
-
"X-Fern-SDK-Version": "3.
|
|
53
|
-
"User-Agent": "zep-cloud/3.
|
|
53
|
+
"X-Fern-SDK-Version": "3.14.0",
|
|
54
|
+
"User-Agent": "zep-cloud/3.14.0",
|
|
54
55
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
55
56
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
56
57
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -67,13 +68,17 @@ class ZepClient {
|
|
|
67
68
|
var _a;
|
|
68
69
|
return ((_a = this._project) !== null && _a !== void 0 ? _a : (this._project = new Client_js_3.Project(this._options)));
|
|
69
70
|
}
|
|
71
|
+
get task() {
|
|
72
|
+
var _a;
|
|
73
|
+
return ((_a = this._task) !== null && _a !== void 0 ? _a : (this._task = new Client_js_4.Task(this._options)));
|
|
74
|
+
}
|
|
70
75
|
get thread() {
|
|
71
76
|
var _a;
|
|
72
|
-
return ((_a = this._thread) !== null && _a !== void 0 ? _a : (this._thread = new
|
|
77
|
+
return ((_a = this._thread) !== null && _a !== void 0 ? _a : (this._thread = new Client_js_5.Thread(this._options)));
|
|
73
78
|
}
|
|
74
79
|
get user() {
|
|
75
80
|
var _a;
|
|
76
|
-
return ((_a = this._user) !== null && _a !== void 0 ? _a : (this._user = new
|
|
81
|
+
return ((_a = this._user) !== null && _a !== void 0 ? _a : (this._user = new Client_js_6.User(this._options)));
|
|
77
82
|
}
|
|
78
83
|
}
|
|
79
84
|
exports.ZepClient = ZepClient;
|
|
@@ -117,8 +117,7 @@ export declare class Graph {
|
|
|
117
117
|
* @example
|
|
118
118
|
* await client.graph.addFactTriple({
|
|
119
119
|
* fact: "fact",
|
|
120
|
-
* factName: "fact_name"
|
|
121
|
-
* targetNodeName: "target_node_name"
|
|
120
|
+
* factName: "fact_name"
|
|
122
121
|
* })
|
|
123
122
|
*/
|
|
124
123
|
addFactTriple(request: Zep.AddTripleRequest, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.AddTripleResponse>;
|
|
@@ -5,13 +5,17 @@
|
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
7
|
* fact: "fact",
|
|
8
|
-
* factName: "fact_name"
|
|
9
|
-
* targetNodeName: "target_node_name"
|
|
8
|
+
* factName: "fact_name"
|
|
10
9
|
* }
|
|
11
10
|
*/
|
|
12
11
|
export interface AddTripleRequest {
|
|
13
12
|
/** The timestamp of the message */
|
|
14
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>;
|
|
15
19
|
/** The time (if any) at which the edge expires */
|
|
16
20
|
expiredAt?: string;
|
|
17
21
|
/** The fact relating the two nodes that this edge represents */
|
|
@@ -23,14 +27,24 @@ export interface AddTripleRequest {
|
|
|
23
27
|
graphId?: string;
|
|
24
28
|
/** The time (if any) at which the fact stops being true */
|
|
25
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>;
|
|
26
35
|
/** The name of the source node to add */
|
|
27
36
|
sourceNodeName?: string;
|
|
28
37
|
/** The summary of the source node to add */
|
|
29
38
|
sourceNodeSummary?: string;
|
|
30
39
|
/** The source node uuid */
|
|
31
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>;
|
|
32
46
|
/** The name of the target node to add */
|
|
33
|
-
targetNodeName
|
|
47
|
+
targetNodeName?: string;
|
|
34
48
|
/** The summary of the target node to add */
|
|
35
49
|
targetNodeSummary?: string;
|
|
36
50
|
/** The target node uuid */
|
|
@@ -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;
|
|
@@ -3,6 +3,7 @@ export * from "./thread/types/index.js";
|
|
|
3
3
|
export * as context from "./context/index.js";
|
|
4
4
|
export * as graph from "./graph/index.js";
|
|
5
5
|
export * as project from "./project/index.js";
|
|
6
|
+
export * as task from "./task/index.js";
|
|
6
7
|
export * as user from "./user/index.js";
|
|
7
8
|
export * from "./context/client/requests/index.js";
|
|
8
9
|
export * from "./graph/client/requests/index.js";
|
|
@@ -36,12 +36,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.user = exports.project = exports.graph = exports.context = exports.thread = void 0;
|
|
39
|
+
exports.user = exports.task = exports.project = exports.graph = exports.context = exports.thread = void 0;
|
|
40
40
|
exports.thread = __importStar(require("./thread/index.js"));
|
|
41
41
|
__exportStar(require("./thread/types/index.js"), exports);
|
|
42
42
|
exports.context = __importStar(require("./context/index.js"));
|
|
43
43
|
exports.graph = __importStar(require("./graph/index.js"));
|
|
44
44
|
exports.project = __importStar(require("./project/index.js"));
|
|
45
|
+
exports.task = __importStar(require("./task/index.js"));
|
|
45
46
|
exports.user = __importStar(require("./user/index.js"));
|
|
46
47
|
__exportStar(require("./context/client/requests/index.js"), exports);
|
|
47
48
|
__exportStar(require("./graph/client/requests/index.js"), exports);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments.js";
|
|
5
|
+
import * as core from "../../../../core/index.js";
|
|
6
|
+
import * as Zep from "../../../index.js";
|
|
7
|
+
export declare namespace Task {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.ZepEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
15
|
+
fetcher?: core.FetchFunction;
|
|
16
|
+
}
|
|
17
|
+
interface RequestOptions {
|
|
18
|
+
/** The maximum time to wait for a response in seconds. */
|
|
19
|
+
timeoutInSeconds?: number;
|
|
20
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
21
|
+
maxRetries?: number;
|
|
22
|
+
/** A hook to abort the request. */
|
|
23
|
+
abortSignal?: AbortSignal;
|
|
24
|
+
/** Additional headers to include in the request. */
|
|
25
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export declare class Task {
|
|
29
|
+
protected readonly _options: Task.Options;
|
|
30
|
+
constructor(_options?: Task.Options);
|
|
31
|
+
/**
|
|
32
|
+
* Gets a task by its ID
|
|
33
|
+
*
|
|
34
|
+
* @param {string} taskId - Task ID
|
|
35
|
+
* @param {Task.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
+
*
|
|
37
|
+
* @throws {@link Zep.NotFoundError}
|
|
38
|
+
* @throws {@link Zep.InternalServerError}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* await client.task.get("task_id")
|
|
42
|
+
*/
|
|
43
|
+
get(taskId: string, requestOptions?: Task.RequestOptions): core.HttpResponsePromise<Zep.GetTaskResponse>;
|
|
44
|
+
private __get;
|
|
45
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
46
|
+
Authorization: string;
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.Task = void 0;
|
|
49
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
50
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
51
|
+
const Zep = __importStar(require("../../../index.js"));
|
|
52
|
+
const headers_js_1 = require("../../../../core/headers.js");
|
|
53
|
+
const serializers = __importStar(require("../../../../serialization/index.js"));
|
|
54
|
+
const errors = __importStar(require("../../../../errors/index.js"));
|
|
55
|
+
class Task {
|
|
56
|
+
constructor(_options = {}) {
|
|
57
|
+
this._options = _options;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Gets a task by its ID
|
|
61
|
+
*
|
|
62
|
+
* @param {string} taskId - Task ID
|
|
63
|
+
* @param {Task.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link Zep.NotFoundError}
|
|
66
|
+
* @throws {@link Zep.InternalServerError}
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* await client.task.get("task_id")
|
|
70
|
+
*/
|
|
71
|
+
get(taskId, requestOptions) {
|
|
72
|
+
return core.HttpResponsePromise.fromPromise(this.__get(taskId, requestOptions));
|
|
73
|
+
}
|
|
74
|
+
__get(taskId, requestOptions) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
var _a, _b, _c, _d;
|
|
77
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
78
|
+
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, `tasks/${encodeURIComponent(taskId)}`),
|
|
79
|
+
method: "GET",
|
|
80
|
+
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),
|
|
81
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
82
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
83
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
84
|
+
});
|
|
85
|
+
if (_response.ok) {
|
|
86
|
+
return {
|
|
87
|
+
data: serializers.GetTaskResponse.parseOrThrow(_response.body, {
|
|
88
|
+
unrecognizedObjectKeys: "passthrough",
|
|
89
|
+
allowUnrecognizedUnionMembers: true,
|
|
90
|
+
allowUnrecognizedEnumValues: true,
|
|
91
|
+
skipValidation: true,
|
|
92
|
+
breadcrumbsPrefix: ["response"],
|
|
93
|
+
}),
|
|
94
|
+
rawResponse: _response.rawResponse,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (_response.error.reason === "status-code") {
|
|
98
|
+
switch (_response.error.statusCode) {
|
|
99
|
+
case 404:
|
|
100
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
101
|
+
unrecognizedObjectKeys: "passthrough",
|
|
102
|
+
allowUnrecognizedUnionMembers: true,
|
|
103
|
+
allowUnrecognizedEnumValues: true,
|
|
104
|
+
skipValidation: true,
|
|
105
|
+
breadcrumbsPrefix: ["response"],
|
|
106
|
+
}), _response.rawResponse);
|
|
107
|
+
case 500:
|
|
108
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
109
|
+
unrecognizedObjectKeys: "passthrough",
|
|
110
|
+
allowUnrecognizedUnionMembers: true,
|
|
111
|
+
allowUnrecognizedEnumValues: true,
|
|
112
|
+
skipValidation: true,
|
|
113
|
+
breadcrumbsPrefix: ["response"],
|
|
114
|
+
}), _response.rawResponse);
|
|
115
|
+
default:
|
|
116
|
+
throw new errors.ZepError({
|
|
117
|
+
statusCode: _response.error.statusCode,
|
|
118
|
+
body: _response.error.body,
|
|
119
|
+
rawResponse: _response.rawResponse,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
switch (_response.error.reason) {
|
|
124
|
+
case "non-json":
|
|
125
|
+
throw new errors.ZepError({
|
|
126
|
+
statusCode: _response.error.statusCode,
|
|
127
|
+
body: _response.error.rawBody,
|
|
128
|
+
rawResponse: _response.rawResponse,
|
|
129
|
+
});
|
|
130
|
+
case "timeout":
|
|
131
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /tasks/{task_id}.");
|
|
132
|
+
case "unknown":
|
|
133
|
+
throw new errors.ZepError({
|
|
134
|
+
message: _response.error.errorMessage,
|
|
135
|
+
rawResponse: _response.rawResponse,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
_getCustomAuthorizationHeaders() {
|
|
141
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
142
|
+
var _a;
|
|
143
|
+
const apiKeyValue = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["ZEP_API_KEY"];
|
|
144
|
+
return { Authorization: `Api-Key ${apiKeyValue}` };
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.Task = Task;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -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
|
/**
|
|
@@ -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;
|
|
@@ -5,6 +5,9 @@ import * as Zep from "../index.js";
|
|
|
5
5
|
export interface DateFilter {
|
|
6
6
|
/** Comparison operator for date filter */
|
|
7
7
|
comparisonOperator: Zep.ComparisonOperator;
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Date to filter on. Required for non-null operators (=, <>, >, <, >=, <=).
|
|
10
|
+
* Should be omitted for IS NULL and IS NOT NULL operators.
|
|
11
|
+
*/
|
|
12
|
+
date?: string;
|
|
10
13
|
}
|
|
@@ -20,6 +20,8 @@ export interface Episode {
|
|
|
20
20
|
score?: number;
|
|
21
21
|
source?: Zep.GraphDataType;
|
|
22
22
|
sourceDescription?: string;
|
|
23
|
+
/** Optional task ID to poll episode processing status. Currently only available for batch ingestion. */
|
|
24
|
+
taskId?: string;
|
|
23
25
|
/** Optional thread ID, will be present if the episode is part of a thread */
|
|
24
26
|
threadId?: string;
|
|
25
27
|
uuid: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Zep from "../index.js";
|
|
5
|
+
export interface GetTaskResponse {
|
|
6
|
+
completedAt?: string;
|
|
7
|
+
createdAt?: string;
|
|
8
|
+
error?: Zep.TaskErrorResponse;
|
|
9
|
+
progress?: Zep.TaskProgress;
|
|
10
|
+
startedAt?: string;
|
|
11
|
+
status?: string;
|
|
12
|
+
taskId?: string;
|
|
13
|
+
type?: string;
|
|
14
|
+
updatedAt?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Zep from "../index.js";
|
|
5
|
+
export interface PropertyFilter {
|
|
6
|
+
/** Comparison operator for property filter */
|
|
7
|
+
comparisonOperator: Zep.ComparisonOperator;
|
|
8
|
+
/** Property name to filter on */
|
|
9
|
+
propertyName: string;
|
|
10
|
+
/**
|
|
11
|
+
* Property value to match on. Accepted types: string, int, float64, bool, or nil.
|
|
12
|
+
* Invalid types (e.g., arrays, objects) will be rejected by validation.
|
|
13
|
+
* Must be non-nil for non-null operators (=, <>, >, <, >=, <=).
|
|
14
|
+
*/
|
|
15
|
+
propertyValue?: unknown;
|
|
16
|
+
}
|