@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/dist/esm/Client.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { mergeHeaders } from "./core/headers.mjs";
|
|
|
6
6
|
import { Context } from "./api/resources/context/client/Client.mjs";
|
|
7
7
|
import { Graph } from "./api/resources/graph/client/Client.mjs";
|
|
8
8
|
import { Project } from "./api/resources/project/client/Client.mjs";
|
|
9
|
+
import { Task } from "./api/resources/task/client/Client.mjs";
|
|
9
10
|
import { Thread } from "./api/resources/thread/client/Client.mjs";
|
|
10
11
|
import { User } from "./api/resources/user/client/Client.mjs";
|
|
11
12
|
export class ZepClient {
|
|
@@ -13,8 +14,8 @@ export class ZepClient {
|
|
|
13
14
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
14
15
|
"X-Fern-Language": "JavaScript",
|
|
15
16
|
"X-Fern-SDK-Name": "zep-cloud",
|
|
16
|
-
"X-Fern-SDK-Version": "3.
|
|
17
|
-
"User-Agent": "zep-cloud/3.
|
|
17
|
+
"X-Fern-SDK-Version": "3.14.0",
|
|
18
|
+
"User-Agent": "zep-cloud/3.14.0",
|
|
18
19
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
19
20
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
20
21
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -31,6 +32,10 @@ export class ZepClient {
|
|
|
31
32
|
var _a;
|
|
32
33
|
return ((_a = this._project) !== null && _a !== void 0 ? _a : (this._project = new Project(this._options)));
|
|
33
34
|
}
|
|
35
|
+
get task() {
|
|
36
|
+
var _a;
|
|
37
|
+
return ((_a = this._task) !== null && _a !== void 0 ? _a : (this._task = new Task(this._options)));
|
|
38
|
+
}
|
|
34
39
|
get thread() {
|
|
35
40
|
var _a;
|
|
36
41
|
return ((_a = this._thread) !== null && _a !== void 0 ? _a : (this._thread = new Thread(this._options)));
|
|
@@ -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>;
|
|
@@ -418,8 +418,7 @@ export class Graph {
|
|
|
418
418
|
* @example
|
|
419
419
|
* await client.graph.addFactTriple({
|
|
420
420
|
* fact: "fact",
|
|
421
|
-
* factName: "fact_name"
|
|
422
|
-
* targetNodeName: "target_node_name"
|
|
421
|
+
* factName: "fact_name"
|
|
423
422
|
* })
|
|
424
423
|
*/
|
|
425
424
|
addFactTriple(request, requestOptions) {
|
|
@@ -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
|
}>;
|
|
@@ -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;
|
|
@@ -3,6 +3,7 @@ export * from "./thread/types/index.mjs";
|
|
|
3
3
|
export * as context from "./context/index.mjs";
|
|
4
4
|
export * as graph from "./graph/index.mjs";
|
|
5
5
|
export * as project from "./project/index.mjs";
|
|
6
|
+
export * as task from "./task/index.mjs";
|
|
6
7
|
export * as user from "./user/index.mjs";
|
|
7
8
|
export * from "./context/client/requests/index.mjs";
|
|
8
9
|
export * from "./graph/client/requests/index.mjs";
|
|
@@ -3,6 +3,7 @@ export * from "./thread/types/index.mjs";
|
|
|
3
3
|
export * as context from "./context/index.mjs";
|
|
4
4
|
export * as graph from "./graph/index.mjs";
|
|
5
5
|
export * as project from "./project/index.mjs";
|
|
6
|
+
export * as task from "./task/index.mjs";
|
|
6
7
|
export * as user from "./user/index.mjs";
|
|
7
8
|
export * from "./context/client/requests/index.mjs";
|
|
8
9
|
export * from "./graph/client/requests/index.mjs";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments.mjs";
|
|
5
|
+
import * as core from "../../../../core/index.mjs";
|
|
6
|
+
import * as Zep from "../../../index.mjs";
|
|
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,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import * as environments from "../../../../environments.mjs";
|
|
14
|
+
import * as core from "../../../../core/index.mjs";
|
|
15
|
+
import * as Zep from "../../../index.mjs";
|
|
16
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
17
|
+
import * as serializers from "../../../../serialization/index.mjs";
|
|
18
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
19
|
+
export class Task {
|
|
20
|
+
constructor(_options = {}) {
|
|
21
|
+
this._options = _options;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Gets a task by its ID
|
|
25
|
+
*
|
|
26
|
+
* @param {string} taskId - Task ID
|
|
27
|
+
* @param {Task.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
|
+
*
|
|
29
|
+
* @throws {@link Zep.NotFoundError}
|
|
30
|
+
* @throws {@link Zep.InternalServerError}
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* await client.task.get("task_id")
|
|
34
|
+
*/
|
|
35
|
+
get(taskId, requestOptions) {
|
|
36
|
+
return core.HttpResponsePromise.fromPromise(this.__get(taskId, requestOptions));
|
|
37
|
+
}
|
|
38
|
+
__get(taskId, requestOptions) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
var _a, _b, _c, _d;
|
|
41
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
42
|
+
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)}`),
|
|
43
|
+
method: "GET",
|
|
44
|
+
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),
|
|
45
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
46
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
47
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
48
|
+
});
|
|
49
|
+
if (_response.ok) {
|
|
50
|
+
return {
|
|
51
|
+
data: serializers.GetTaskResponse.parseOrThrow(_response.body, {
|
|
52
|
+
unrecognizedObjectKeys: "passthrough",
|
|
53
|
+
allowUnrecognizedUnionMembers: true,
|
|
54
|
+
allowUnrecognizedEnumValues: true,
|
|
55
|
+
skipValidation: true,
|
|
56
|
+
breadcrumbsPrefix: ["response"],
|
|
57
|
+
}),
|
|
58
|
+
rawResponse: _response.rawResponse,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (_response.error.reason === "status-code") {
|
|
62
|
+
switch (_response.error.statusCode) {
|
|
63
|
+
case 404:
|
|
64
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
65
|
+
unrecognizedObjectKeys: "passthrough",
|
|
66
|
+
allowUnrecognizedUnionMembers: true,
|
|
67
|
+
allowUnrecognizedEnumValues: true,
|
|
68
|
+
skipValidation: true,
|
|
69
|
+
breadcrumbsPrefix: ["response"],
|
|
70
|
+
}), _response.rawResponse);
|
|
71
|
+
case 500:
|
|
72
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
73
|
+
unrecognizedObjectKeys: "passthrough",
|
|
74
|
+
allowUnrecognizedUnionMembers: true,
|
|
75
|
+
allowUnrecognizedEnumValues: true,
|
|
76
|
+
skipValidation: true,
|
|
77
|
+
breadcrumbsPrefix: ["response"],
|
|
78
|
+
}), _response.rawResponse);
|
|
79
|
+
default:
|
|
80
|
+
throw new errors.ZepError({
|
|
81
|
+
statusCode: _response.error.statusCode,
|
|
82
|
+
body: _response.error.body,
|
|
83
|
+
rawResponse: _response.rawResponse,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
switch (_response.error.reason) {
|
|
88
|
+
case "non-json":
|
|
89
|
+
throw new errors.ZepError({
|
|
90
|
+
statusCode: _response.error.statusCode,
|
|
91
|
+
body: _response.error.rawBody,
|
|
92
|
+
rawResponse: _response.rawResponse,
|
|
93
|
+
});
|
|
94
|
+
case "timeout":
|
|
95
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /tasks/{task_id}.");
|
|
96
|
+
case "unknown":
|
|
97
|
+
throw new errors.ZepError({
|
|
98
|
+
message: _response.error.errorMessage,
|
|
99
|
+
rawResponse: _response.rawResponse,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
_getCustomAuthorizationHeaders() {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
var _a;
|
|
107
|
+
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"];
|
|
108
|
+
return { Authorization: `Api-Key ${apiKeyValue}` };
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -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;
|
|
@@ -5,6 +5,9 @@ import * as Zep from "../index.mjs";
|
|
|
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.mjs";
|
|
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.mjs";
|
|
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
|
+
}
|
|
@@ -13,6 +13,8 @@ export interface SearchFilters {
|
|
|
13
13
|
createdAt?: Zep.DateFilter[][];
|
|
14
14
|
/** List of edge types to filter on */
|
|
15
15
|
edgeTypes?: string[];
|
|
16
|
+
/** List of edge UUIDs to filter on */
|
|
17
|
+
edgeUuids?: string[];
|
|
16
18
|
/** List of edge types to exclude from results */
|
|
17
19
|
excludeEdgeTypes?: string[];
|
|
18
20
|
/** List of node labels to exclude from results */
|
|
@@ -35,6 +37,8 @@ export interface SearchFilters {
|
|
|
35
37
|
invalidAt?: Zep.DateFilter[][];
|
|
36
38
|
/** List of node labels to filter on */
|
|
37
39
|
nodeLabels?: string[];
|
|
40
|
+
/** List of property filters to apply to nodes and edges */
|
|
41
|
+
propertyFilters?: Zep.PropertyFilter[];
|
|
38
42
|
/**
|
|
39
43
|
* 2D array of date filters for the valid_at field.
|
|
40
44
|
* The outer array elements are combined with OR logic.
|
|
@@ -12,6 +12,7 @@ export * from "./EpisodeData.mjs";
|
|
|
12
12
|
export * from "./EpisodeMentions.mjs";
|
|
13
13
|
export * from "./FactRatingExamples.mjs";
|
|
14
14
|
export * from "./FactRatingInstruction.mjs";
|
|
15
|
+
export * from "./GetTaskResponse.mjs";
|
|
15
16
|
export * from "./Graph.mjs";
|
|
16
17
|
export * from "./GraphEdgesRequest.mjs";
|
|
17
18
|
export * from "./Episode.mjs";
|
|
@@ -25,6 +26,8 @@ export * from "./ProjectInfo.mjs";
|
|
|
25
26
|
export * from "./ProjectInfoResponse.mjs";
|
|
26
27
|
export * from "./RoleType.mjs";
|
|
27
28
|
export * from "./SuccessResponse.mjs";
|
|
29
|
+
export * from "./TaskErrorResponse.mjs";
|
|
30
|
+
export * from "./TaskProgress.mjs";
|
|
28
31
|
export * from "./Thread.mjs";
|
|
29
32
|
export * from "./ThreadContextResponse.mjs";
|
|
30
33
|
export * from "./ThreadListResponse.mjs";
|
|
@@ -40,6 +43,7 @@ export * from "./DateFilter.mjs";
|
|
|
40
43
|
export * from "./EntityEdge.mjs";
|
|
41
44
|
export * from "./EntityNode.mjs";
|
|
42
45
|
export * from "./GraphSearchScope.mjs";
|
|
46
|
+
export * from "./PropertyFilter.mjs";
|
|
43
47
|
export * from "./Reranker.mjs";
|
|
44
48
|
export * from "./SearchFilters.mjs";
|
|
45
49
|
export * from "./EntityPropertyType.mjs";
|
|
@@ -12,6 +12,7 @@ export * from "./EpisodeData.mjs";
|
|
|
12
12
|
export * from "./EpisodeMentions.mjs";
|
|
13
13
|
export * from "./FactRatingExamples.mjs";
|
|
14
14
|
export * from "./FactRatingInstruction.mjs";
|
|
15
|
+
export * from "./GetTaskResponse.mjs";
|
|
15
16
|
export * from "./Graph.mjs";
|
|
16
17
|
export * from "./GraphEdgesRequest.mjs";
|
|
17
18
|
export * from "./Episode.mjs";
|
|
@@ -25,6 +26,8 @@ export * from "./ProjectInfo.mjs";
|
|
|
25
26
|
export * from "./ProjectInfoResponse.mjs";
|
|
26
27
|
export * from "./RoleType.mjs";
|
|
27
28
|
export * from "./SuccessResponse.mjs";
|
|
29
|
+
export * from "./TaskErrorResponse.mjs";
|
|
30
|
+
export * from "./TaskProgress.mjs";
|
|
28
31
|
export * from "./Thread.mjs";
|
|
29
32
|
export * from "./ThreadContextResponse.mjs";
|
|
30
33
|
export * from "./ThreadListResponse.mjs";
|
|
@@ -40,6 +43,7 @@ export * from "./DateFilter.mjs";
|
|
|
40
43
|
export * from "./EntityEdge.mjs";
|
|
41
44
|
export * from "./EntityNode.mjs";
|
|
42
45
|
export * from "./GraphSearchScope.mjs";
|
|
46
|
+
export * from "./PropertyFilter.mjs";
|
|
43
47
|
export * from "./Reranker.mjs";
|
|
44
48
|
export * from "./SearchFilters.mjs";
|
|
45
49
|
export * from "./EntityPropertyType.mjs";
|
|
@@ -8,16 +8,19 @@ export declare const AddTripleRequest: core.serialization.Schema<serializers.Add
|
|
|
8
8
|
export declare namespace AddTripleRequest {
|
|
9
9
|
interface Raw {
|
|
10
10
|
created_at?: string | null;
|
|
11
|
+
edge_attributes?: Record<string, unknown> | null;
|
|
11
12
|
expired_at?: string | null;
|
|
12
13
|
fact: string;
|
|
13
14
|
fact_name: string;
|
|
14
15
|
fact_uuid?: string | null;
|
|
15
16
|
graph_id?: string | null;
|
|
16
17
|
invalid_at?: string | null;
|
|
18
|
+
source_node_attributes?: Record<string, unknown> | null;
|
|
17
19
|
source_node_name?: string | null;
|
|
18
20
|
source_node_summary?: string | null;
|
|
19
21
|
source_node_uuid?: string | null;
|
|
20
|
-
|
|
22
|
+
target_node_attributes?: Record<string, unknown> | null;
|
|
23
|
+
target_node_name?: string | null;
|
|
21
24
|
target_node_summary?: string | null;
|
|
22
25
|
target_node_uuid?: string | null;
|
|
23
26
|
user_id?: string | null;
|