@getzep/zep-cloud 3.14.0 → 3.16.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.js +2 -2
- package/dist/cjs/api/resources/graph/client/Client.d.ts +50 -0
- package/dist/cjs/api/resources/graph/client/Client.js +272 -0
- package/dist/cjs/api/resources/graph/client/requests/AddCustomInstructionsRequest.d.ts +21 -0
- package/dist/cjs/api/resources/graph/client/requests/AddCustomInstructionsRequest.js +5 -0
- package/dist/cjs/api/resources/graph/client/requests/DeleteCustomInstructionsRequest.d.ts +15 -0
- package/dist/cjs/api/resources/graph/client/requests/DeleteCustomInstructionsRequest.js +5 -0
- package/dist/cjs/api/resources/graph/client/requests/GraphListCustomInstructionsRequest.d.ts +20 -0
- package/dist/cjs/api/resources/graph/client/requests/GraphListCustomInstructionsRequest.js +5 -0
- package/dist/cjs/api/resources/graph/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/types/CustomInstruction.d.ts +7 -0
- package/dist/cjs/api/types/CustomInstruction.js +5 -0
- package/dist/cjs/api/types/GetTaskResponse.d.ts +1 -0
- package/dist/cjs/api/types/ListCustomInstructionsResponse.d.ts +7 -0
- package/dist/cjs/api/types/ListCustomInstructionsResponse.js +5 -0
- package/dist/cjs/api/types/MessageListResponse.d.ts +2 -0
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/serialization/resources/graph/client/requests/AddCustomInstructionsRequest.d.ts +15 -0
- package/dist/cjs/serialization/resources/graph/client/requests/AddCustomInstructionsRequest.js +46 -0
- package/dist/cjs/serialization/resources/graph/client/requests/DeleteCustomInstructionsRequest.d.ts +14 -0
- package/dist/cjs/serialization/resources/graph/client/requests/DeleteCustomInstructionsRequest.js +45 -0
- package/dist/cjs/serialization/resources/graph/client/requests/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/graph/client/requests/index.js +5 -1
- package/dist/cjs/serialization/types/CustomInstruction.d.ts +13 -0
- package/dist/cjs/serialization/types/CustomInstruction.js +44 -0
- package/dist/cjs/serialization/types/GetTaskResponse.d.ts +1 -0
- package/dist/cjs/serialization/types/GetTaskResponse.js +1 -0
- package/dist/cjs/serialization/types/ListCustomInstructionsResponse.d.ts +13 -0
- package/dist/cjs/serialization/types/ListCustomInstructionsResponse.js +44 -0
- package/dist/cjs/serialization/types/MessageListResponse.d.ts +1 -0
- package/dist/cjs/serialization/types/MessageListResponse.js +1 -0
- package/dist/cjs/serialization/types/index.d.ts +2 -0
- package/dist/cjs/serialization/types/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/graph/client/Client.d.mts +50 -0
- package/dist/esm/api/resources/graph/client/Client.mjs +272 -0
- package/dist/esm/api/resources/graph/client/requests/AddCustomInstructionsRequest.d.mts +21 -0
- package/dist/esm/api/resources/graph/client/requests/AddCustomInstructionsRequest.mjs +4 -0
- package/dist/esm/api/resources/graph/client/requests/DeleteCustomInstructionsRequest.d.mts +15 -0
- package/dist/esm/api/resources/graph/client/requests/DeleteCustomInstructionsRequest.mjs +4 -0
- package/dist/esm/api/resources/graph/client/requests/GraphListCustomInstructionsRequest.d.mts +20 -0
- package/dist/esm/api/resources/graph/client/requests/GraphListCustomInstructionsRequest.mjs +4 -0
- package/dist/esm/api/resources/graph/client/requests/index.d.mts +3 -0
- package/dist/esm/api/types/CustomInstruction.d.mts +7 -0
- package/dist/esm/api/types/CustomInstruction.mjs +4 -0
- package/dist/esm/api/types/GetTaskResponse.d.mts +1 -0
- package/dist/esm/api/types/ListCustomInstructionsResponse.d.mts +7 -0
- package/dist/esm/api/types/ListCustomInstructionsResponse.mjs +4 -0
- package/dist/esm/api/types/MessageListResponse.d.mts +2 -0
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/serialization/resources/graph/client/requests/AddCustomInstructionsRequest.d.mts +15 -0
- package/dist/esm/serialization/resources/graph/client/requests/AddCustomInstructionsRequest.mjs +10 -0
- package/dist/esm/serialization/resources/graph/client/requests/DeleteCustomInstructionsRequest.d.mts +14 -0
- package/dist/esm/serialization/resources/graph/client/requests/DeleteCustomInstructionsRequest.mjs +9 -0
- package/dist/esm/serialization/resources/graph/client/requests/index.d.mts +2 -0
- package/dist/esm/serialization/resources/graph/client/requests/index.mjs +2 -0
- package/dist/esm/serialization/types/CustomInstruction.d.mts +13 -0
- package/dist/esm/serialization/types/CustomInstruction.mjs +8 -0
- package/dist/esm/serialization/types/GetTaskResponse.d.mts +1 -0
- package/dist/esm/serialization/types/GetTaskResponse.mjs +1 -0
- package/dist/esm/serialization/types/ListCustomInstructionsResponse.d.mts +13 -0
- package/dist/esm/serialization/types/ListCustomInstructionsResponse.mjs +8 -0
- package/dist/esm/serialization/types/MessageListResponse.d.mts +1 -0
- package/dist/esm/serialization/types/MessageListResponse.mjs +1 -0
- package/dist/esm/serialization/types/index.d.mts +2 -0
- package/dist/esm/serialization/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +199 -0
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateGraphRequest = exports.GraphSearchQuery = exports.CreateGraphRequest = exports.CloneGraphRequest = exports.AddTripleRequest = exports.AddDataBatchRequest = exports.AddDataRequest = exports.EntityTypeRequest = void 0;
|
|
3
|
+
exports.UpdateGraphRequest = exports.GraphSearchQuery = exports.CreateGraphRequest = exports.CloneGraphRequest = exports.AddTripleRequest = exports.AddDataBatchRequest = exports.AddDataRequest = exports.EntityTypeRequest = exports.DeleteCustomInstructionsRequest = exports.AddCustomInstructionsRequest = void 0;
|
|
4
|
+
var AddCustomInstructionsRequest_js_1 = require("./AddCustomInstructionsRequest.js");
|
|
5
|
+
Object.defineProperty(exports, "AddCustomInstructionsRequest", { enumerable: true, get: function () { return AddCustomInstructionsRequest_js_1.AddCustomInstructionsRequest; } });
|
|
6
|
+
var DeleteCustomInstructionsRequest_js_1 = require("./DeleteCustomInstructionsRequest.js");
|
|
7
|
+
Object.defineProperty(exports, "DeleteCustomInstructionsRequest", { enumerable: true, get: function () { return DeleteCustomInstructionsRequest_js_1.DeleteCustomInstructionsRequest; } });
|
|
4
8
|
var EntityTypeRequest_js_1 = require("./EntityTypeRequest.js");
|
|
5
9
|
Object.defineProperty(exports, "EntityTypeRequest", { enumerable: true, get: function () { return EntityTypeRequest_js_1.EntityTypeRequest; } });
|
|
6
10
|
var AddDataRequest_js_1 = require("./AddDataRequest.js");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../index.js";
|
|
5
|
+
import * as Zep from "../../api/index.js";
|
|
6
|
+
import * as core from "../../core/index.js";
|
|
7
|
+
export declare const CustomInstruction: core.serialization.ObjectSchema<serializers.CustomInstruction.Raw, Zep.CustomInstruction>;
|
|
8
|
+
export declare namespace CustomInstruction {
|
|
9
|
+
interface Raw {
|
|
10
|
+
name: string;
|
|
11
|
+
text: string;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.CustomInstruction = void 0;
|
|
40
|
+
const core = __importStar(require("../../core/index.js"));
|
|
41
|
+
exports.CustomInstruction = core.serialization.object({
|
|
42
|
+
name: core.serialization.string(),
|
|
43
|
+
text: core.serialization.string(),
|
|
44
|
+
});
|
|
@@ -12,6 +12,7 @@ export declare namespace GetTaskResponse {
|
|
|
12
12
|
completed_at?: string | null;
|
|
13
13
|
created_at?: string | null;
|
|
14
14
|
error?: TaskErrorResponse.Raw | null;
|
|
15
|
+
params?: Record<string, unknown> | null;
|
|
15
16
|
progress?: TaskProgress.Raw | null;
|
|
16
17
|
started_at?: string | null;
|
|
17
18
|
status?: string | null;
|
|
@@ -44,6 +44,7 @@ exports.GetTaskResponse = core.serialization.object({
|
|
|
44
44
|
completedAt: core.serialization.property("completed_at", core.serialization.string().optional()),
|
|
45
45
|
createdAt: core.serialization.property("created_at", core.serialization.string().optional()),
|
|
46
46
|
error: TaskErrorResponse_js_1.TaskErrorResponse.optional(),
|
|
47
|
+
params: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
|
|
47
48
|
progress: TaskProgress_js_1.TaskProgress.optional(),
|
|
48
49
|
startedAt: core.serialization.property("started_at", core.serialization.string().optional()),
|
|
49
50
|
status: core.serialization.string().optional(),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../index.js";
|
|
5
|
+
import * as Zep from "../../api/index.js";
|
|
6
|
+
import * as core from "../../core/index.js";
|
|
7
|
+
import { CustomInstruction } from "./CustomInstruction.js";
|
|
8
|
+
export declare const ListCustomInstructionsResponse: core.serialization.ObjectSchema<serializers.ListCustomInstructionsResponse.Raw, Zep.ListCustomInstructionsResponse>;
|
|
9
|
+
export declare namespace ListCustomInstructionsResponse {
|
|
10
|
+
interface Raw {
|
|
11
|
+
instructions?: CustomInstruction.Raw[] | null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ListCustomInstructionsResponse = void 0;
|
|
40
|
+
const core = __importStar(require("../../core/index.js"));
|
|
41
|
+
const CustomInstruction_js_1 = require("./CustomInstruction.js");
|
|
42
|
+
exports.ListCustomInstructionsResponse = core.serialization.object({
|
|
43
|
+
instructions: core.serialization.list(CustomInstruction_js_1.CustomInstruction).optional(),
|
|
44
|
+
});
|
|
@@ -43,4 +43,5 @@ exports.MessageListResponse = core.serialization.object({
|
|
|
43
43
|
messages: core.serialization.list(Message_js_1.Message).optional(),
|
|
44
44
|
rowCount: core.serialization.property("row_count", core.serialization.number().optional()),
|
|
45
45
|
totalCount: core.serialization.property("total_count", core.serialization.number().optional()),
|
|
46
|
+
userId: core.serialization.property("user_id", core.serialization.string().optional()),
|
|
46
47
|
});
|
|
@@ -3,6 +3,7 @@ export * from "./AddThreadMessagesRequest.js";
|
|
|
3
3
|
export * from "./AddThreadMessagesResponse.js";
|
|
4
4
|
export * from "./CloneGraphResponse.js";
|
|
5
5
|
export * from "./ContextTemplateResponse.js";
|
|
6
|
+
export * from "./CustomInstruction.js";
|
|
6
7
|
export * from "./EdgeType.js";
|
|
7
8
|
export * from "./EntityEdgeSourceTarget.js";
|
|
8
9
|
export * from "./EntityProperty.js";
|
|
@@ -21,6 +22,7 @@ export * from "./GraphListResponse.js";
|
|
|
21
22
|
export * from "./GraphNodesRequest.js";
|
|
22
23
|
export * from "./GraphSearchResults.js";
|
|
23
24
|
export * from "./ListContextTemplatesResponse.js";
|
|
25
|
+
export * from "./ListCustomInstructionsResponse.js";
|
|
24
26
|
export * from "./ListUserInstructionsResponse.js";
|
|
25
27
|
export * from "./ProjectInfo.js";
|
|
26
28
|
export * from "./ProjectInfoResponse.js";
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./AddThreadMessagesRequest.js"), exports);
|
|
|
19
19
|
__exportStar(require("./AddThreadMessagesResponse.js"), exports);
|
|
20
20
|
__exportStar(require("./CloneGraphResponse.js"), exports);
|
|
21
21
|
__exportStar(require("./ContextTemplateResponse.js"), exports);
|
|
22
|
+
__exportStar(require("./CustomInstruction.js"), exports);
|
|
22
23
|
__exportStar(require("./EdgeType.js"), exports);
|
|
23
24
|
__exportStar(require("./EntityEdgeSourceTarget.js"), exports);
|
|
24
25
|
__exportStar(require("./EntityProperty.js"), exports);
|
|
@@ -37,6 +38,7 @@ __exportStar(require("./GraphListResponse.js"), exports);
|
|
|
37
38
|
__exportStar(require("./GraphNodesRequest.js"), exports);
|
|
38
39
|
__exportStar(require("./GraphSearchResults.js"), exports);
|
|
39
40
|
__exportStar(require("./ListContextTemplatesResponse.js"), exports);
|
|
41
|
+
__exportStar(require("./ListCustomInstructionsResponse.js"), exports);
|
|
40
42
|
__exportStar(require("./ListUserInstructionsResponse.js"), exports);
|
|
41
43
|
__exportStar(require("./ProjectInfo.js"), exports);
|
|
42
44
|
__exportStar(require("./ProjectInfoResponse.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.
|
|
1
|
+
export declare const SDK_VERSION = "3.16.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -14,8 +14,8 @@ export class ZepClient {
|
|
|
14
14
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
15
15
|
"X-Fern-Language": "JavaScript",
|
|
16
16
|
"X-Fern-SDK-Name": "zep-cloud",
|
|
17
|
-
"X-Fern-SDK-Version": "3.
|
|
18
|
-
"User-Agent": "zep-cloud/3.
|
|
17
|
+
"X-Fern-SDK-Version": "3.16.0",
|
|
18
|
+
"User-Agent": "zep-cloud/3.16.0",
|
|
19
19
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
20
20
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
21
21
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -37,6 +37,56 @@ export declare class Graph {
|
|
|
37
37
|
get edge(): Edge;
|
|
38
38
|
get episode(): Episode;
|
|
39
39
|
get node(): Node;
|
|
40
|
+
/**
|
|
41
|
+
* Lists all custom instructions for a project, user, or graph.
|
|
42
|
+
*
|
|
43
|
+
* @param {Zep.GraphListCustomInstructionsRequest} request
|
|
44
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
45
|
+
*
|
|
46
|
+
* @throws {@link Zep.BadRequestError}
|
|
47
|
+
* @throws {@link Zep.InternalServerError}
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* await client.graph.listCustomInstructions({
|
|
51
|
+
* userId: "user_id",
|
|
52
|
+
* graphId: "graph_id"
|
|
53
|
+
* })
|
|
54
|
+
*/
|
|
55
|
+
listCustomInstructions(request?: Zep.GraphListCustomInstructionsRequest, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.ListCustomInstructionsResponse>;
|
|
56
|
+
private __listCustomInstructions;
|
|
57
|
+
/**
|
|
58
|
+
* Adds new custom instructions for graphs without removing existing ones. If user_ids or graph_ids is empty, adds to project-wide default instructions.
|
|
59
|
+
*
|
|
60
|
+
* @param {Zep.AddCustomInstructionsRequest} request
|
|
61
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
|
+
*
|
|
63
|
+
* @throws {@link Zep.BadRequestError}
|
|
64
|
+
* @throws {@link Zep.InternalServerError}
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.graph.addCustomInstructions({
|
|
68
|
+
* instructions: [{
|
|
69
|
+
* name: "name",
|
|
70
|
+
* text: "text"
|
|
71
|
+
* }]
|
|
72
|
+
* })
|
|
73
|
+
*/
|
|
74
|
+
addCustomInstructions(request: Zep.AddCustomInstructionsRequest, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.SuccessResponse>;
|
|
75
|
+
private __addCustomInstructions;
|
|
76
|
+
/**
|
|
77
|
+
* Deletes custom instructions for graphs or project wide defaults.
|
|
78
|
+
*
|
|
79
|
+
* @param {Zep.DeleteCustomInstructionsRequest} request
|
|
80
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
81
|
+
*
|
|
82
|
+
* @throws {@link Zep.BadRequestError}
|
|
83
|
+
* @throws {@link Zep.InternalServerError}
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* await client.graph.deleteCustomInstructions()
|
|
87
|
+
*/
|
|
88
|
+
deleteCustomInstructions(request?: Zep.DeleteCustomInstructionsRequest, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.SuccessResponse>;
|
|
89
|
+
private __deleteCustomInstructions;
|
|
40
90
|
/**
|
|
41
91
|
* Returns all entity types for a project, user, or graph.
|
|
42
92
|
*
|
|
@@ -35,6 +35,278 @@ export class Graph {
|
|
|
35
35
|
var _a;
|
|
36
36
|
return ((_a = this._node) !== null && _a !== void 0 ? _a : (this._node = new Node(this._options)));
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Lists all custom instructions for a project, user, or graph.
|
|
40
|
+
*
|
|
41
|
+
* @param {Zep.GraphListCustomInstructionsRequest} request
|
|
42
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
|
+
*
|
|
44
|
+
* @throws {@link Zep.BadRequestError}
|
|
45
|
+
* @throws {@link Zep.InternalServerError}
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* await client.graph.listCustomInstructions({
|
|
49
|
+
* userId: "user_id",
|
|
50
|
+
* graphId: "graph_id"
|
|
51
|
+
* })
|
|
52
|
+
*/
|
|
53
|
+
listCustomInstructions(request = {}, requestOptions) {
|
|
54
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomInstructions(request, requestOptions));
|
|
55
|
+
}
|
|
56
|
+
__listCustomInstructions() {
|
|
57
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
58
|
+
var _a, _b, _c, _d;
|
|
59
|
+
const { userId, graphId } = request;
|
|
60
|
+
const _queryParams = {};
|
|
61
|
+
if (userId != null) {
|
|
62
|
+
_queryParams["user_id"] = userId;
|
|
63
|
+
}
|
|
64
|
+
if (graphId != null) {
|
|
65
|
+
_queryParams["graph_id"] = graphId;
|
|
66
|
+
}
|
|
67
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
68
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, "custom-instructions"),
|
|
69
|
+
method: "GET",
|
|
70
|
+
headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
71
|
+
queryParameters: _queryParams,
|
|
72
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
73
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
74
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
75
|
+
});
|
|
76
|
+
if (_response.ok) {
|
|
77
|
+
return {
|
|
78
|
+
data: serializers.ListCustomInstructionsResponse.parseOrThrow(_response.body, {
|
|
79
|
+
unrecognizedObjectKeys: "passthrough",
|
|
80
|
+
allowUnrecognizedUnionMembers: true,
|
|
81
|
+
allowUnrecognizedEnumValues: true,
|
|
82
|
+
skipValidation: true,
|
|
83
|
+
breadcrumbsPrefix: ["response"],
|
|
84
|
+
}),
|
|
85
|
+
rawResponse: _response.rawResponse,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (_response.error.reason === "status-code") {
|
|
89
|
+
switch (_response.error.statusCode) {
|
|
90
|
+
case 400:
|
|
91
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
92
|
+
unrecognizedObjectKeys: "passthrough",
|
|
93
|
+
allowUnrecognizedUnionMembers: true,
|
|
94
|
+
allowUnrecognizedEnumValues: true,
|
|
95
|
+
skipValidation: true,
|
|
96
|
+
breadcrumbsPrefix: ["response"],
|
|
97
|
+
}), _response.rawResponse);
|
|
98
|
+
case 500:
|
|
99
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
100
|
+
unrecognizedObjectKeys: "passthrough",
|
|
101
|
+
allowUnrecognizedUnionMembers: true,
|
|
102
|
+
allowUnrecognizedEnumValues: true,
|
|
103
|
+
skipValidation: true,
|
|
104
|
+
breadcrumbsPrefix: ["response"],
|
|
105
|
+
}), _response.rawResponse);
|
|
106
|
+
default:
|
|
107
|
+
throw new errors.ZepError({
|
|
108
|
+
statusCode: _response.error.statusCode,
|
|
109
|
+
body: _response.error.body,
|
|
110
|
+
rawResponse: _response.rawResponse,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
switch (_response.error.reason) {
|
|
115
|
+
case "non-json":
|
|
116
|
+
throw new errors.ZepError({
|
|
117
|
+
statusCode: _response.error.statusCode,
|
|
118
|
+
body: _response.error.rawBody,
|
|
119
|
+
rawResponse: _response.rawResponse,
|
|
120
|
+
});
|
|
121
|
+
case "timeout":
|
|
122
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /custom-instructions.");
|
|
123
|
+
case "unknown":
|
|
124
|
+
throw new errors.ZepError({
|
|
125
|
+
message: _response.error.errorMessage,
|
|
126
|
+
rawResponse: _response.rawResponse,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Adds new custom instructions for graphs without removing existing ones. If user_ids or graph_ids is empty, adds to project-wide default instructions.
|
|
133
|
+
*
|
|
134
|
+
* @param {Zep.AddCustomInstructionsRequest} request
|
|
135
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
136
|
+
*
|
|
137
|
+
* @throws {@link Zep.BadRequestError}
|
|
138
|
+
* @throws {@link Zep.InternalServerError}
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* await client.graph.addCustomInstructions({
|
|
142
|
+
* instructions: [{
|
|
143
|
+
* name: "name",
|
|
144
|
+
* text: "text"
|
|
145
|
+
* }]
|
|
146
|
+
* })
|
|
147
|
+
*/
|
|
148
|
+
addCustomInstructions(request, requestOptions) {
|
|
149
|
+
return core.HttpResponsePromise.fromPromise(this.__addCustomInstructions(request, requestOptions));
|
|
150
|
+
}
|
|
151
|
+
__addCustomInstructions(request, requestOptions) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
var _a, _b, _c, _d;
|
|
154
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
155
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, "custom-instructions"),
|
|
156
|
+
method: "POST",
|
|
157
|
+
headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
158
|
+
contentType: "application/json",
|
|
159
|
+
requestType: "json",
|
|
160
|
+
body: serializers.AddCustomInstructionsRequest.jsonOrThrow(request, {
|
|
161
|
+
unrecognizedObjectKeys: "strip",
|
|
162
|
+
omitUndefined: true,
|
|
163
|
+
}),
|
|
164
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
165
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
166
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
167
|
+
});
|
|
168
|
+
if (_response.ok) {
|
|
169
|
+
return {
|
|
170
|
+
data: serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
171
|
+
unrecognizedObjectKeys: "passthrough",
|
|
172
|
+
allowUnrecognizedUnionMembers: true,
|
|
173
|
+
allowUnrecognizedEnumValues: true,
|
|
174
|
+
skipValidation: true,
|
|
175
|
+
breadcrumbsPrefix: ["response"],
|
|
176
|
+
}),
|
|
177
|
+
rawResponse: _response.rawResponse,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
if (_response.error.reason === "status-code") {
|
|
181
|
+
switch (_response.error.statusCode) {
|
|
182
|
+
case 400:
|
|
183
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
184
|
+
unrecognizedObjectKeys: "passthrough",
|
|
185
|
+
allowUnrecognizedUnionMembers: true,
|
|
186
|
+
allowUnrecognizedEnumValues: true,
|
|
187
|
+
skipValidation: true,
|
|
188
|
+
breadcrumbsPrefix: ["response"],
|
|
189
|
+
}), _response.rawResponse);
|
|
190
|
+
case 500:
|
|
191
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
192
|
+
unrecognizedObjectKeys: "passthrough",
|
|
193
|
+
allowUnrecognizedUnionMembers: true,
|
|
194
|
+
allowUnrecognizedEnumValues: true,
|
|
195
|
+
skipValidation: true,
|
|
196
|
+
breadcrumbsPrefix: ["response"],
|
|
197
|
+
}), _response.rawResponse);
|
|
198
|
+
default:
|
|
199
|
+
throw new errors.ZepError({
|
|
200
|
+
statusCode: _response.error.statusCode,
|
|
201
|
+
body: _response.error.body,
|
|
202
|
+
rawResponse: _response.rawResponse,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
switch (_response.error.reason) {
|
|
207
|
+
case "non-json":
|
|
208
|
+
throw new errors.ZepError({
|
|
209
|
+
statusCode: _response.error.statusCode,
|
|
210
|
+
body: _response.error.rawBody,
|
|
211
|
+
rawResponse: _response.rawResponse,
|
|
212
|
+
});
|
|
213
|
+
case "timeout":
|
|
214
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /custom-instructions.");
|
|
215
|
+
case "unknown":
|
|
216
|
+
throw new errors.ZepError({
|
|
217
|
+
message: _response.error.errorMessage,
|
|
218
|
+
rawResponse: _response.rawResponse,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Deletes custom instructions for graphs or project wide defaults.
|
|
225
|
+
*
|
|
226
|
+
* @param {Zep.DeleteCustomInstructionsRequest} request
|
|
227
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
228
|
+
*
|
|
229
|
+
* @throws {@link Zep.BadRequestError}
|
|
230
|
+
* @throws {@link Zep.InternalServerError}
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* await client.graph.deleteCustomInstructions()
|
|
234
|
+
*/
|
|
235
|
+
deleteCustomInstructions(request = {}, requestOptions) {
|
|
236
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomInstructions(request, requestOptions));
|
|
237
|
+
}
|
|
238
|
+
__deleteCustomInstructions() {
|
|
239
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
240
|
+
var _a, _b, _c, _d;
|
|
241
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
242
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, "custom-instructions"),
|
|
243
|
+
method: "DELETE",
|
|
244
|
+
headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
245
|
+
contentType: "application/json",
|
|
246
|
+
requestType: "json",
|
|
247
|
+
body: serializers.DeleteCustomInstructionsRequest.jsonOrThrow(request, {
|
|
248
|
+
unrecognizedObjectKeys: "strip",
|
|
249
|
+
omitUndefined: true,
|
|
250
|
+
}),
|
|
251
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
252
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
253
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
254
|
+
});
|
|
255
|
+
if (_response.ok) {
|
|
256
|
+
return {
|
|
257
|
+
data: serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
258
|
+
unrecognizedObjectKeys: "passthrough",
|
|
259
|
+
allowUnrecognizedUnionMembers: true,
|
|
260
|
+
allowUnrecognizedEnumValues: true,
|
|
261
|
+
skipValidation: true,
|
|
262
|
+
breadcrumbsPrefix: ["response"],
|
|
263
|
+
}),
|
|
264
|
+
rawResponse: _response.rawResponse,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
if (_response.error.reason === "status-code") {
|
|
268
|
+
switch (_response.error.statusCode) {
|
|
269
|
+
case 400:
|
|
270
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
271
|
+
unrecognizedObjectKeys: "passthrough",
|
|
272
|
+
allowUnrecognizedUnionMembers: true,
|
|
273
|
+
allowUnrecognizedEnumValues: true,
|
|
274
|
+
skipValidation: true,
|
|
275
|
+
breadcrumbsPrefix: ["response"],
|
|
276
|
+
}), _response.rawResponse);
|
|
277
|
+
case 500:
|
|
278
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
279
|
+
unrecognizedObjectKeys: "passthrough",
|
|
280
|
+
allowUnrecognizedUnionMembers: true,
|
|
281
|
+
allowUnrecognizedEnumValues: true,
|
|
282
|
+
skipValidation: true,
|
|
283
|
+
breadcrumbsPrefix: ["response"],
|
|
284
|
+
}), _response.rawResponse);
|
|
285
|
+
default:
|
|
286
|
+
throw new errors.ZepError({
|
|
287
|
+
statusCode: _response.error.statusCode,
|
|
288
|
+
body: _response.error.body,
|
|
289
|
+
rawResponse: _response.rawResponse,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
switch (_response.error.reason) {
|
|
294
|
+
case "non-json":
|
|
295
|
+
throw new errors.ZepError({
|
|
296
|
+
statusCode: _response.error.statusCode,
|
|
297
|
+
body: _response.error.rawBody,
|
|
298
|
+
rawResponse: _response.rawResponse,
|
|
299
|
+
});
|
|
300
|
+
case "timeout":
|
|
301
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /custom-instructions.");
|
|
302
|
+
case "unknown":
|
|
303
|
+
throw new errors.ZepError({
|
|
304
|
+
message: _response.error.errorMessage,
|
|
305
|
+
rawResponse: _response.rawResponse,
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
}
|
|
38
310
|
/**
|
|
39
311
|
* Returns all entity types for a project, user, or graph.
|
|
40
312
|
*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Zep from "../../../../index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* instructions: [{
|
|
9
|
+
* name: "name",
|
|
10
|
+
* text: "text"
|
|
11
|
+
* }]
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
export interface AddCustomInstructionsRequest {
|
|
15
|
+
/** Graph IDs to add the instructions to. If empty, the instructions are added to the project-wide default. */
|
|
16
|
+
graphIds?: string[];
|
|
17
|
+
/** Instructions to add to the graph. */
|
|
18
|
+
instructions: Zep.CustomInstruction[];
|
|
19
|
+
/** User IDs to add the instructions to. If empty, the instructions are added to the project-wide default. */
|
|
20
|
+
userIds?: string[];
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {}
|
|
7
|
+
*/
|
|
8
|
+
export interface DeleteCustomInstructionsRequest {
|
|
9
|
+
/** Determines which group graphs will have their custom instructions deleted. If no graphs are provided, the project-wide custom instructions will be affected. */
|
|
10
|
+
graphIds?: string[];
|
|
11
|
+
/** Unique identifier for the instructions to be deleted. If empty deletes all instructions. */
|
|
12
|
+
instructionNames?: string[];
|
|
13
|
+
/** Determines which user graphs will have their custom instructions deleted. If no users are provided, the project-wide custom instructions will be affected. */
|
|
14
|
+
userIds?: string[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* userId: "user_id",
|
|
8
|
+
* graphId: "graph_id"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface GraphListCustomInstructionsRequest {
|
|
12
|
+
/**
|
|
13
|
+
* User ID to get user-specific instructions
|
|
14
|
+
*/
|
|
15
|
+
userId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Graph ID to get graph-specific instructions
|
|
18
|
+
*/
|
|
19
|
+
graphId?: string;
|
|
20
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { type GraphListCustomInstructionsRequest } from "./GraphListCustomInstructionsRequest.mjs";
|
|
2
|
+
export { type AddCustomInstructionsRequest } from "./AddCustomInstructionsRequest.mjs";
|
|
3
|
+
export { type DeleteCustomInstructionsRequest } from "./DeleteCustomInstructionsRequest.mjs";
|
|
1
4
|
export { type GraphListEntityTypesRequest } from "./GraphListEntityTypesRequest.mjs";
|
|
2
5
|
export { type EntityTypeRequest } from "./EntityTypeRequest.mjs";
|
|
3
6
|
export { type AddDataRequest } from "./AddDataRequest.mjs";
|