@getzep/zep-cloud 3.10.0 → 3.13.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/dist/cjs/Client.d.ts +6 -0
- package/dist/cjs/Client.js +20 -10
- package/dist/cjs/api/errors/index.d.ts +1 -1
- package/dist/cjs/api/errors/index.js +1 -1
- package/dist/cjs/api/resources/context/client/Client.d.ts +112 -0
- package/dist/cjs/api/resources/context/client/Client.js +516 -0
- package/dist/cjs/api/resources/context/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/context/client/index.js +17 -0
- package/dist/cjs/api/resources/context/client/requests/CreateContextTemplateRequest.d.ts +16 -0
- package/dist/cjs/api/resources/context/client/requests/CreateContextTemplateRequest.js +5 -0
- package/dist/cjs/api/resources/context/client/requests/UpdateContextTemplateRequest.d.ts +13 -0
- package/dist/cjs/api/resources/context/client/requests/UpdateContextTemplateRequest.js +5 -0
- package/dist/cjs/api/resources/context/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/context/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/context/index.d.ts +1 -0
- package/dist/cjs/api/resources/context/index.js +17 -0
- package/dist/cjs/api/resources/graph/client/Client.d.ts +9 -2
- package/dist/cjs/api/resources/graph/client/Client.js +9 -2
- package/dist/cjs/api/resources/graph/client/requests/AddTripleRequest.d.ts +2 -1
- package/dist/cjs/api/resources/graph/client/requests/GraphListAllRequest.d.ts +4 -1
- package/dist/cjs/api/resources/graph/client/requests/GraphListEntityTypesRequest.d.ts +4 -1
- package/dist/cjs/api/resources/graph/resources/episode/client/Client.d.ts +6 -2
- package/dist/cjs/api/resources/graph/resources/episode/client/Client.js +6 -2
- package/dist/cjs/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.d.ts +3 -1
- package/dist/cjs/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.d.ts +3 -1
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +4 -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/Client.d.ts +16 -3
- package/dist/cjs/api/resources/thread/client/Client.js +20 -4
- package/dist/cjs/api/resources/thread/client/requests/ThreadGetRequest.d.ts +5 -1
- package/dist/cjs/api/resources/thread/client/requests/ThreadGetUserContextRequest.d.ts +10 -2
- package/dist/cjs/api/resources/thread/client/requests/ThreadListAllRequest.d.ts +6 -1
- package/dist/cjs/api/resources/user/client/Client.d.ts +7 -2
- package/dist/cjs/api/resources/user/client/Client.js +7 -2
- package/dist/cjs/api/resources/user/client/requests/UserListOrderedRequest.d.ts +4 -1
- package/dist/cjs/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.d.ts +3 -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/ContextTemplateResponse.d.ts +11 -0
- package/dist/cjs/api/types/ContextTemplateResponse.js +5 -0
- 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/ListContextTemplatesResponse.d.ts +7 -0
- package/dist/cjs/api/types/ListContextTemplatesResponse.js +5 -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 +5 -0
- package/dist/cjs/api/types/index.js +5 -0
- package/dist/cjs/serialization/resources/context/client/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/context/client/index.js +17 -0
- package/dist/cjs/serialization/resources/context/client/requests/CreateContextTemplateRequest.d.ts +13 -0
- package/dist/cjs/serialization/resources/context/client/requests/CreateContextTemplateRequest.js +44 -0
- package/dist/cjs/serialization/resources/context/client/requests/UpdateContextTemplateRequest.d.ts +12 -0
- package/dist/cjs/serialization/resources/context/client/requests/UpdateContextTemplateRequest.js +43 -0
- package/dist/cjs/serialization/resources/context/client/requests/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/context/client/requests/index.js +7 -0
- package/dist/cjs/serialization/resources/context/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/context/index.js +17 -0
- package/dist/cjs/serialization/resources/graph/client/requests/AddTripleRequest.d.ts +1 -1
- package/dist/cjs/serialization/resources/graph/client/requests/AddTripleRequest.js +1 -1
- package/dist/cjs/serialization/resources/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/index.js +3 -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/ContextTemplateResponse.d.ts +14 -0
- package/dist/cjs/serialization/types/ContextTemplateResponse.js +45 -0
- 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/ListContextTemplatesResponse.d.ts +13 -0
- package/dist/cjs/serialization/types/ListContextTemplatesResponse.js +44 -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 +5 -0
- package/dist/cjs/serialization/types/index.js +5 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +6 -0
- package/dist/esm/Client.mjs +12 -2
- package/dist/esm/api/errors/index.d.mts +1 -1
- package/dist/esm/api/errors/index.mjs +1 -1
- package/dist/esm/api/resources/context/client/Client.d.mts +112 -0
- package/dist/esm/api/resources/context/client/Client.mjs +479 -0
- package/dist/esm/api/resources/context/client/index.d.mts +2 -0
- package/dist/esm/api/resources/context/client/index.mjs +1 -0
- package/dist/esm/api/resources/context/client/requests/CreateContextTemplateRequest.d.mts +16 -0
- package/dist/esm/api/resources/context/client/requests/CreateContextTemplateRequest.mjs +4 -0
- package/dist/esm/api/resources/context/client/requests/UpdateContextTemplateRequest.d.mts +13 -0
- package/dist/esm/api/resources/context/client/requests/UpdateContextTemplateRequest.mjs +4 -0
- package/dist/esm/api/resources/context/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/context/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/context/index.d.mts +1 -0
- package/dist/esm/api/resources/context/index.mjs +1 -0
- package/dist/esm/api/resources/graph/client/Client.d.mts +9 -2
- package/dist/esm/api/resources/graph/client/Client.mjs +9 -2
- package/dist/esm/api/resources/graph/client/requests/AddTripleRequest.d.mts +2 -1
- package/dist/esm/api/resources/graph/client/requests/GraphListAllRequest.d.mts +4 -1
- package/dist/esm/api/resources/graph/client/requests/GraphListEntityTypesRequest.d.mts +4 -1
- package/dist/esm/api/resources/graph/resources/episode/client/Client.d.mts +6 -2
- package/dist/esm/api/resources/graph/resources/episode/client/Client.mjs +6 -2
- package/dist/esm/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.d.mts +3 -1
- package/dist/esm/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.d.mts +3 -1
- package/dist/esm/api/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/index.mjs +3 -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/Client.d.mts +16 -3
- package/dist/esm/api/resources/thread/client/Client.mjs +20 -4
- package/dist/esm/api/resources/thread/client/requests/ThreadGetRequest.d.mts +5 -1
- package/dist/esm/api/resources/thread/client/requests/ThreadGetUserContextRequest.d.mts +10 -2
- package/dist/esm/api/resources/thread/client/requests/ThreadListAllRequest.d.mts +6 -1
- package/dist/esm/api/resources/user/client/Client.d.mts +7 -2
- package/dist/esm/api/resources/user/client/Client.mjs +7 -2
- package/dist/esm/api/resources/user/client/requests/UserListOrderedRequest.d.mts +4 -1
- package/dist/esm/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.d.mts +3 -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/ContextTemplateResponse.d.mts +11 -0
- package/dist/esm/api/types/ContextTemplateResponse.mjs +4 -0
- 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/ListContextTemplatesResponse.d.mts +7 -0
- package/dist/esm/api/types/ListContextTemplatesResponse.mjs +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 +5 -0
- package/dist/esm/api/types/index.mjs +5 -0
- package/dist/esm/serialization/resources/context/client/index.d.mts +1 -0
- package/dist/esm/serialization/resources/context/client/index.mjs +1 -0
- package/dist/esm/serialization/resources/context/client/requests/CreateContextTemplateRequest.d.mts +13 -0
- package/dist/esm/serialization/resources/context/client/requests/CreateContextTemplateRequest.mjs +8 -0
- package/dist/esm/serialization/resources/context/client/requests/UpdateContextTemplateRequest.d.mts +12 -0
- package/dist/esm/serialization/resources/context/client/requests/UpdateContextTemplateRequest.mjs +7 -0
- package/dist/esm/serialization/resources/context/client/requests/index.d.mts +2 -0
- package/dist/esm/serialization/resources/context/client/requests/index.mjs +2 -0
- package/dist/esm/serialization/resources/context/index.d.mts +1 -0
- package/dist/esm/serialization/resources/context/index.mjs +1 -0
- package/dist/esm/serialization/resources/graph/client/requests/AddTripleRequest.d.mts +1 -1
- package/dist/esm/serialization/resources/graph/client/requests/AddTripleRequest.mjs +1 -1
- package/dist/esm/serialization/resources/index.d.mts +2 -0
- package/dist/esm/serialization/resources/index.mjs +2 -0
- 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/ContextTemplateResponse.d.mts +14 -0
- package/dist/esm/serialization/types/ContextTemplateResponse.mjs +9 -0
- 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/ListContextTemplatesResponse.d.mts +13 -0
- package/dist/esm/serialization/types/ListContextTemplatesResponse.mjs +8 -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 +5 -0
- package/dist/esm/serialization/types/index.mjs +5 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +425 -9
|
@@ -82,7 +82,10 @@ class Graph {
|
|
|
82
82
|
* @throws {@link Zep.InternalServerError}
|
|
83
83
|
*
|
|
84
84
|
* @example
|
|
85
|
-
* await client.graph.listEntityTypes(
|
|
85
|
+
* await client.graph.listEntityTypes({
|
|
86
|
+
* userId: "user_id",
|
|
87
|
+
* graphId: "graph_id"
|
|
88
|
+
* })
|
|
86
89
|
*/
|
|
87
90
|
listEntityTypes(request = {}, requestOptions) {
|
|
88
91
|
return core.HttpResponsePromise.fromPromise(this.__listEntityTypes(request, requestOptions));
|
|
@@ -452,6 +455,7 @@ class Graph {
|
|
|
452
455
|
* await client.graph.addFactTriple({
|
|
453
456
|
* fact: "fact",
|
|
454
457
|
* factName: "fact_name",
|
|
458
|
+
* sourceNodeName: "source_node_name",
|
|
455
459
|
* targetNodeName: "target_node_name"
|
|
456
460
|
* })
|
|
457
461
|
*/
|
|
@@ -716,7 +720,10 @@ class Graph {
|
|
|
716
720
|
* @throws {@link Zep.InternalServerError}
|
|
717
721
|
*
|
|
718
722
|
* @example
|
|
719
|
-
* await client.graph.listAll(
|
|
723
|
+
* await client.graph.listAll({
|
|
724
|
+
* pageNumber: 1,
|
|
725
|
+
* pageSize: 1
|
|
726
|
+
* })
|
|
720
727
|
*/
|
|
721
728
|
listAll(request = {}, requestOptions) {
|
|
722
729
|
return core.HttpResponsePromise.fromPromise(this.__listAll(request, requestOptions));
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* {
|
|
7
7
|
* fact: "fact",
|
|
8
8
|
* factName: "fact_name",
|
|
9
|
+
* sourceNodeName: "source_node_name",
|
|
9
10
|
* targetNodeName: "target_node_name"
|
|
10
11
|
* }
|
|
11
12
|
*/
|
|
@@ -24,7 +25,7 @@ export interface AddTripleRequest {
|
|
|
24
25
|
/** The time (if any) at which the fact stops being true */
|
|
25
26
|
invalidAt?: string;
|
|
26
27
|
/** The name of the source node to add */
|
|
27
|
-
sourceNodeName
|
|
28
|
+
sourceNodeName: string;
|
|
28
29
|
/** The summary of the source node to add */
|
|
29
30
|
sourceNodeSummary?: string;
|
|
30
31
|
/** The source node uuid */
|
|
@@ -39,7 +39,9 @@ export declare class Episode {
|
|
|
39
39
|
* @throws {@link Zep.InternalServerError}
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
|
-
* await client.graph.episode.getByGraphId("graph_id"
|
|
42
|
+
* await client.graph.episode.getByGraphId("graph_id", {
|
|
43
|
+
* lastn: 1
|
|
44
|
+
* })
|
|
43
45
|
*/
|
|
44
46
|
getByGraphId(graphId: string, request?: Zep.graph.EpisodeGetByGraphIdRequest, requestOptions?: Episode.RequestOptions): core.HttpResponsePromise<Zep.EpisodeResponse>;
|
|
45
47
|
private __getByGraphId;
|
|
@@ -54,7 +56,9 @@ export declare class Episode {
|
|
|
54
56
|
* @throws {@link Zep.InternalServerError}
|
|
55
57
|
*
|
|
56
58
|
* @example
|
|
57
|
-
* await client.graph.episode.getByUserId("user_id"
|
|
59
|
+
* await client.graph.episode.getByUserId("user_id", {
|
|
60
|
+
* lastn: 1
|
|
61
|
+
* })
|
|
58
62
|
*/
|
|
59
63
|
getByUserId(userId: string, request?: Zep.graph.EpisodeGetByUserIdRequest, requestOptions?: Episode.RequestOptions): core.HttpResponsePromise<Zep.EpisodeResponse>;
|
|
60
64
|
private __getByUserId;
|
|
@@ -67,7 +67,9 @@ class Episode {
|
|
|
67
67
|
* @throws {@link Zep.InternalServerError}
|
|
68
68
|
*
|
|
69
69
|
* @example
|
|
70
|
-
* await client.graph.episode.getByGraphId("graph_id"
|
|
70
|
+
* await client.graph.episode.getByGraphId("graph_id", {
|
|
71
|
+
* lastn: 1
|
|
72
|
+
* })
|
|
71
73
|
*/
|
|
72
74
|
getByGraphId(graphId, request = {}, requestOptions) {
|
|
73
75
|
return core.HttpResponsePromise.fromPromise(this.__getByGraphId(graphId, request, requestOptions));
|
|
@@ -155,7 +157,9 @@ class Episode {
|
|
|
155
157
|
* @throws {@link Zep.InternalServerError}
|
|
156
158
|
*
|
|
157
159
|
* @example
|
|
158
|
-
* await client.graph.episode.getByUserId("user_id"
|
|
160
|
+
* await client.graph.episode.getByUserId("user_id", {
|
|
161
|
+
* lastn: 1
|
|
162
|
+
* })
|
|
159
163
|
*/
|
|
160
164
|
getByUserId(userId, request = {}, requestOptions) {
|
|
161
165
|
return core.HttpResponsePromise.fromPromise(this.__getByUserId(userId, request, requestOptions));
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export * as thread from "./thread/index.js";
|
|
2
2
|
export * from "./thread/types/index.js";
|
|
3
|
+
export * as context from "./context/index.js";
|
|
3
4
|
export * as graph from "./graph/index.js";
|
|
4
5
|
export * as project from "./project/index.js";
|
|
6
|
+
export * as task from "./task/index.js";
|
|
5
7
|
export * as user from "./user/index.js";
|
|
8
|
+
export * from "./context/client/requests/index.js";
|
|
6
9
|
export * from "./graph/client/requests/index.js";
|
|
7
10
|
export * from "./thread/client/requests/index.js";
|
|
8
11
|
export * from "./user/client/requests/index.js";
|
|
@@ -36,12 +36,15 @@ 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.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
|
+
exports.context = __importStar(require("./context/index.js"));
|
|
42
43
|
exports.graph = __importStar(require("./graph/index.js"));
|
|
43
44
|
exports.project = __importStar(require("./project/index.js"));
|
|
45
|
+
exports.task = __importStar(require("./task/index.js"));
|
|
44
46
|
exports.user = __importStar(require("./user/index.js"));
|
|
47
|
+
__exportStar(require("./context/client/requests/index.js"), exports);
|
|
45
48
|
__exportStar(require("./graph/client/requests/index.js"), exports);
|
|
46
49
|
__exportStar(require("./thread/client/requests/index.js"), exports);
|
|
47
50
|
__exportStar(require("./user/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);
|
|
@@ -41,7 +41,12 @@ export declare class Thread {
|
|
|
41
41
|
* @throws {@link Zep.InternalServerError}
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
|
-
* await client.thread.listAll(
|
|
44
|
+
* await client.thread.listAll({
|
|
45
|
+
* pageNumber: 1,
|
|
46
|
+
* pageSize: 1,
|
|
47
|
+
* orderBy: "order_by",
|
|
48
|
+
* asc: true
|
|
49
|
+
* })
|
|
45
50
|
*/
|
|
46
51
|
listAll(request?: Zep.ThreadListAllRequest, requestOptions?: Thread.RequestOptions): core.HttpResponsePromise<Zep.ThreadListResponse>;
|
|
47
52
|
private __listAll;
|
|
@@ -87,7 +92,11 @@ export declare class Thread {
|
|
|
87
92
|
* @throws {@link Zep.InternalServerError}
|
|
88
93
|
*
|
|
89
94
|
* @example
|
|
90
|
-
* await client.thread.getUserContext("threadId"
|
|
95
|
+
* await client.thread.getUserContext("threadId", {
|
|
96
|
+
* minRating: 1.1,
|
|
97
|
+
* templateId: "template_id",
|
|
98
|
+
* mode: "basic"
|
|
99
|
+
* })
|
|
91
100
|
*/
|
|
92
101
|
getUserContext(threadId: string, request?: Zep.ThreadGetUserContextRequest, requestOptions?: Thread.RequestOptions): core.HttpResponsePromise<Zep.ThreadContextResponse>;
|
|
93
102
|
private __getUserContext;
|
|
@@ -102,7 +111,11 @@ export declare class Thread {
|
|
|
102
111
|
* @throws {@link Zep.InternalServerError}
|
|
103
112
|
*
|
|
104
113
|
* @example
|
|
105
|
-
* await client.thread.get("threadId"
|
|
114
|
+
* await client.thread.get("threadId", {
|
|
115
|
+
* limit: 1,
|
|
116
|
+
* cursor: 1,
|
|
117
|
+
* lastn: 1
|
|
118
|
+
* })
|
|
106
119
|
*/
|
|
107
120
|
get(threadId: string, request?: Zep.ThreadGetRequest, requestOptions?: Thread.RequestOptions): core.HttpResponsePromise<Zep.MessageListResponse>;
|
|
108
121
|
private __get;
|
|
@@ -71,7 +71,12 @@ class Thread {
|
|
|
71
71
|
* @throws {@link Zep.InternalServerError}
|
|
72
72
|
*
|
|
73
73
|
* @example
|
|
74
|
-
* await client.thread.listAll(
|
|
74
|
+
* await client.thread.listAll({
|
|
75
|
+
* pageNumber: 1,
|
|
76
|
+
* pageSize: 1,
|
|
77
|
+
* orderBy: "order_by",
|
|
78
|
+
* asc: true
|
|
79
|
+
* })
|
|
75
80
|
*/
|
|
76
81
|
listAll(request = {}, requestOptions) {
|
|
77
82
|
return core.HttpResponsePromise.fromPromise(this.__listAll(request, requestOptions));
|
|
@@ -339,7 +344,11 @@ class Thread {
|
|
|
339
344
|
* @throws {@link Zep.InternalServerError}
|
|
340
345
|
*
|
|
341
346
|
* @example
|
|
342
|
-
* await client.thread.getUserContext("threadId"
|
|
347
|
+
* await client.thread.getUserContext("threadId", {
|
|
348
|
+
* minRating: 1.1,
|
|
349
|
+
* templateId: "template_id",
|
|
350
|
+
* mode: "basic"
|
|
351
|
+
* })
|
|
343
352
|
*/
|
|
344
353
|
getUserContext(threadId, request = {}, requestOptions) {
|
|
345
354
|
return core.HttpResponsePromise.fromPromise(this.__getUserContext(threadId, request, requestOptions));
|
|
@@ -347,11 +356,14 @@ class Thread {
|
|
|
347
356
|
__getUserContext(threadId_1) {
|
|
348
357
|
return __awaiter(this, arguments, void 0, function* (threadId, request = {}, requestOptions) {
|
|
349
358
|
var _a, _b, _c, _d;
|
|
350
|
-
const { minRating, mode } = request;
|
|
359
|
+
const { minRating, templateId, mode } = request;
|
|
351
360
|
const _queryParams = {};
|
|
352
361
|
if (minRating != null) {
|
|
353
362
|
_queryParams["minRating"] = minRating.toString();
|
|
354
363
|
}
|
|
364
|
+
if (templateId != null) {
|
|
365
|
+
_queryParams["template_id"] = templateId;
|
|
366
|
+
}
|
|
355
367
|
if (mode != null) {
|
|
356
368
|
_queryParams["mode"] = serializers.ThreadGetUserContextRequestMode.jsonOrThrow(mode, {
|
|
357
369
|
unrecognizedObjectKeys: "strip",
|
|
@@ -433,7 +445,11 @@ class Thread {
|
|
|
433
445
|
* @throws {@link Zep.InternalServerError}
|
|
434
446
|
*
|
|
435
447
|
* @example
|
|
436
|
-
* await client.thread.get("threadId"
|
|
448
|
+
* await client.thread.get("threadId", {
|
|
449
|
+
* limit: 1,
|
|
450
|
+
* cursor: 1,
|
|
451
|
+
* lastn: 1
|
|
452
|
+
* })
|
|
437
453
|
*/
|
|
438
454
|
get(threadId, request = {}, requestOptions) {
|
|
439
455
|
return core.HttpResponsePromise.fromPromise(this.__get(threadId, request, requestOptions));
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
import * as Zep from "../../../../index.js";
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
|
-
* {
|
|
7
|
+
* {
|
|
8
|
+
* minRating: 1.1,
|
|
9
|
+
* templateId: "template_id",
|
|
10
|
+
* mode: "basic"
|
|
11
|
+
* }
|
|
8
12
|
*/
|
|
9
13
|
export interface ThreadGetUserContextRequest {
|
|
10
14
|
/**
|
|
@@ -12,7 +16,11 @@ export interface ThreadGetUserContextRequest {
|
|
|
12
16
|
*/
|
|
13
17
|
minRating?: number;
|
|
14
18
|
/**
|
|
15
|
-
*
|
|
19
|
+
* Optional template ID to use for custom context rendering.
|
|
20
|
+
*/
|
|
21
|
+
templateId?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Deprecated, this field will be removed in a future release. Defaults to summary mode. Use basic for lower latency
|
|
16
24
|
*/
|
|
17
25
|
mode?: Zep.ThreadGetUserContextRequestMode;
|
|
18
26
|
}
|
|
@@ -38,7 +38,9 @@ export declare class User {
|
|
|
38
38
|
* @throws {@link Zep.InternalServerError}
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
|
-
* await client.user.listUserSummaryInstructions(
|
|
41
|
+
* await client.user.listUserSummaryInstructions({
|
|
42
|
+
* userId: "user_id"
|
|
43
|
+
* })
|
|
42
44
|
*/
|
|
43
45
|
listUserSummaryInstructions(request?: Zep.UserListUserSummaryInstructionsRequest, requestOptions?: User.RequestOptions): core.HttpResponsePromise<Zep.ListUserInstructionsResponse>;
|
|
44
46
|
private __listUserSummaryInstructions;
|
|
@@ -101,7 +103,10 @@ export declare class User {
|
|
|
101
103
|
* @throws {@link Zep.InternalServerError}
|
|
102
104
|
*
|
|
103
105
|
* @example
|
|
104
|
-
* await client.user.listOrdered(
|
|
106
|
+
* await client.user.listOrdered({
|
|
107
|
+
* pageNumber: 1,
|
|
108
|
+
* pageSize: 1
|
|
109
|
+
* })
|
|
105
110
|
*/
|
|
106
111
|
listOrdered(request?: Zep.UserListOrderedRequest, requestOptions?: User.RequestOptions): core.HttpResponsePromise<Zep.UserListResponse>;
|
|
107
112
|
private __listOrdered;
|
|
@@ -66,7 +66,9 @@ class User {
|
|
|
66
66
|
* @throws {@link Zep.InternalServerError}
|
|
67
67
|
*
|
|
68
68
|
* @example
|
|
69
|
-
* await client.user.listUserSummaryInstructions(
|
|
69
|
+
* await client.user.listUserSummaryInstructions({
|
|
70
|
+
* userId: "user_id"
|
|
71
|
+
* })
|
|
70
72
|
*/
|
|
71
73
|
listUserSummaryInstructions(request = {}, requestOptions) {
|
|
72
74
|
return core.HttpResponsePromise.fromPromise(this.__listUserSummaryInstructions(request, requestOptions));
|
|
@@ -421,7 +423,10 @@ class User {
|
|
|
421
423
|
* @throws {@link Zep.InternalServerError}
|
|
422
424
|
*
|
|
423
425
|
* @example
|
|
424
|
-
* await client.user.listOrdered(
|
|
426
|
+
* await client.user.listOrdered({
|
|
427
|
+
* pageNumber: 1,
|
|
428
|
+
* pageSize: 1
|
|
429
|
+
* })
|
|
425
430
|
*/
|
|
426
431
|
listOrdered(request = {}, requestOptions) {
|
|
427
432
|
return core.HttpResponsePromise.fromPromise(this.__listOrdered(request, requestOptions));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface ContextTemplateResponse {
|
|
5
|
+
/** The template content. */
|
|
6
|
+
template?: string;
|
|
7
|
+
/** Unique identifier for the template (max 100 characters). */
|
|
8
|
+
templateId?: string;
|
|
9
|
+
/** Unique identifier for the template. */
|
|
10
|
+
uuid?: string;
|
|
11
|
+
}
|