From 5861f6d9bc10f8066b02afa9561b7715fba69502 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 17:55:41 +0000 Subject: [PATCH 01/59] SDK regeneration --- reference.md | 30 +-- src/Client.ts | 4 +- src/api/resources/graph/client/Client.ts | 136 ++++++------- .../resources/graph/client/requests/index.ts | 2 +- .../resources/graph/client/requests/index.ts | 2 +- src/version.ts | 2 +- tests/wire/graph.test.ts | 180 +++++++++--------- tsconfig.json | 16 +- 8 files changed, 179 insertions(+), 193 deletions(-) diff --git a/reference.md b/reference.md index baf66410..c5d98e3c 100644 --- a/reference.md +++ b/reference.md @@ -386,7 +386,7 @@ await client.graph.clone(); -
client.graph.search({ ...params }) -> Zep.GraphSearchResults +
client.graph.create({ ...params }) -> Zep.Graph
@@ -398,7 +398,7 @@ await client.graph.clone();
-Perform a graph search query. +Creates a new graph.
@@ -414,8 +414,8 @@ Perform a graph search query.
```typescript -await client.graph.search({ - query: "query", +await client.graph.create({ + graphId: "graph_id", }); ``` @@ -432,7 +432,7 @@ await client.graph.search({
-**request:** `Zep.GraphSearchQuery` +**request:** `Zep.CreateGraphRequest`
@@ -451,7 +451,7 @@ await client.graph.search({
-
client.graph.create({ ...params }) -> Zep.Graph +
client.graph.listAll({ ...params }) -> Zep.GraphListResponse
@@ -463,7 +463,7 @@ await client.graph.search({
-Creates a new graph. +Returns all graphs.
@@ -479,9 +479,7 @@ Creates a new graph.
```typescript -await client.graph.create({ - graphId: "graph_id", -}); +await client.graph.listAll(); ```
@@ -497,7 +495,7 @@ await client.graph.create({
-**request:** `Zep.CreateGraphRequest` +**request:** `Zep.GraphListAllRequest`
@@ -516,7 +514,7 @@ await client.graph.create({
-
client.graph.listAll({ ...params }) -> Zep.GraphListResponse +
client.graph.search({ ...params }) -> Zep.GraphSearchResults
@@ -528,7 +526,7 @@ await client.graph.create({
-Returns all graphs. +Perform a graph search query.
@@ -544,7 +542,9 @@ Returns all graphs.
```typescript -await client.graph.listAll(); +await client.graph.search({ + query: "query", +}); ```
@@ -560,7 +560,7 @@ await client.graph.listAll();
-**request:** `Zep.GraphListAllRequest` +**request:** `Zep.GraphSearchQuery`
diff --git a/src/Client.ts b/src/Client.ts index 87bccf1c..695b00e3 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -45,8 +45,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.0.4", - "User-Agent": "zep-cloud/3.0.4", + "X-Fern-SDK-Version": "3.0.5", + "User-Agent": "zep-cloud/3.0.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index 4ac0004d..005f84fb 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -713,36 +713,36 @@ export class Graph { } /** - * Perform a graph search query. + * Creates a new graph. * - * @param {Zep.GraphSearchQuery} request + * @param {Zep.CreateGraphRequest} request * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.search({ - * query: "query" + * await client.graph.create({ + * graphId: "graph_id" * }) */ - public search( - request: Zep.GraphSearchQuery, + public create( + request: Zep.CreateGraphRequest, requestOptions?: Graph.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } - private async __search( - request: Zep.GraphSearchQuery, + private async __create( + request: Zep.CreateGraphRequest, requestOptions?: Graph.RequestOptions, - ): Promise> { + ): Promise> { const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.ZepEnvironment.Default, - "graph/search", + "graph/create", ), method: "POST", headers: mergeHeaders( @@ -752,7 +752,7 @@ export class Graph { ), contentType: "application/json", requestType: "json", - body: serializers.GraphSearchQuery.jsonOrThrow(request, { + body: serializers.CreateGraphRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -762,7 +762,7 @@ export class Graph { }); if (_response.ok) { return { - data: serializers.GraphSearchResults.parseOrThrow(_response.body, { + data: serializers.Graph.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -814,7 +814,7 @@ export class Graph { rawResponse: _response.rawResponse, }); case "timeout": - throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /graph/search."); + throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /graph/create."); case "unknown": throw new errors.ZepError({ message: _response.error.errorMessage, @@ -824,56 +824,59 @@ export class Graph { } /** - * Creates a new graph. + * Returns all graphs. * - * @param {Zep.CreateGraphRequest} request + * @param {Zep.GraphListAllRequest} request * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.create({ - * graphId: "graph_id" - * }) + * await client.graph.listAll() */ - public create( - request: Zep.CreateGraphRequest, + public listAll( + request: Zep.GraphListAllRequest = {}, requestOptions?: Graph.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__listAll(request, requestOptions)); } - private async __create( - request: Zep.CreateGraphRequest, + private async __listAll( + request: Zep.GraphListAllRequest = {}, requestOptions?: Graph.RequestOptions, - ): Promise> { + ): Promise> { + const { pageNumber, pageSize } = request; + const _queryParams: Record = {}; + if (pageNumber != null) { + _queryParams["pageNumber"] = pageNumber.toString(); + } + + if (pageSize != null) { + _queryParams["pageSize"] = pageSize.toString(); + } + const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.ZepEnvironment.Default, - "graphs", + "graph/list-all", ), - method: "POST", + method: "GET", headers: mergeHeaders( this._options?.headers, mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), requestOptions?.headers, ), - contentType: "application/json", - requestType: "json", - body: serializers.CreateGraphRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), + queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return { - data: serializers.Graph.parseOrThrow(_response.body, { + data: serializers.GraphListResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -925,7 +928,7 @@ export class Graph { rawResponse: _response.rawResponse, }); case "timeout": - throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /graphs."); + throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /graph/list-all."); case "unknown": throw new errors.ZepError({ message: _response.error.errorMessage, @@ -935,59 +938,56 @@ export class Graph { } /** - * Returns all graphs. + * Perform a graph search query. * - * @param {Zep.GraphListAllRequest} request + * @param {Zep.GraphSearchQuery} request * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.listAll() + * await client.graph.search({ + * query: "query" + * }) */ - public listAll( - request: Zep.GraphListAllRequest = {}, + public search( + request: Zep.GraphSearchQuery, requestOptions?: Graph.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__listAll(request, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } - private async __listAll( - request: Zep.GraphListAllRequest = {}, + private async __search( + request: Zep.GraphSearchQuery, requestOptions?: Graph.RequestOptions, - ): Promise> { - const { pageNumber, pageSize } = request; - const _queryParams: Record = {}; - if (pageNumber != null) { - _queryParams["pageNumber"] = pageNumber.toString(); - } - - if (pageSize != null) { - _queryParams["pageSize"] = pageSize.toString(); - } - + ): Promise> { const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.ZepEnvironment.Default, - "graphs/list-all", + "graph/search", ), - method: "GET", + method: "POST", headers: mergeHeaders( this._options?.headers, mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), requestOptions?.headers, ), - queryParameters: _queryParams, + contentType: "application/json", + requestType: "json", + body: serializers.GraphSearchQuery.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return { - data: serializers.GraphListResponse.parseOrThrow(_response.body, { + data: serializers.GraphSearchResults.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -1039,7 +1039,7 @@ export class Graph { rawResponse: _response.rawResponse, }); case "timeout": - throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /graphs/list-all."); + throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /graph/search."); case "unknown": throw new errors.ZepError({ message: _response.error.errorMessage, @@ -1073,7 +1073,7 @@ export class Graph { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.ZepEnvironment.Default, - `graphs/${encodeURIComponent(graphId)}`, + `graph/${encodeURIComponent(graphId)}`, ), method: "GET", headers: mergeHeaders( @@ -1139,7 +1139,7 @@ export class Graph { rawResponse: _response.rawResponse, }); case "timeout": - throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /graphs/{graphId}."); + throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /graph/{graphId}."); case "unknown": throw new errors.ZepError({ message: _response.error.errorMessage, @@ -1177,7 +1177,7 @@ export class Graph { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.ZepEnvironment.Default, - `graphs/${encodeURIComponent(graphId)}`, + `graph/${encodeURIComponent(graphId)}`, ), method: "DELETE", headers: mergeHeaders( @@ -1254,7 +1254,7 @@ export class Graph { rawResponse: _response.rawResponse, }); case "timeout": - throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /graphs/{graphId}."); + throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /graph/{graphId}."); case "unknown": throw new errors.ZepError({ message: _response.error.errorMessage, @@ -1295,7 +1295,7 @@ export class Graph { (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.ZepEnvironment.Default, - `graphs/${encodeURIComponent(graphId)}`, + `graph/${encodeURIComponent(graphId)}`, ), method: "PATCH", headers: mergeHeaders( @@ -1378,7 +1378,7 @@ export class Graph { rawResponse: _response.rawResponse, }); case "timeout": - throw new errors.ZepTimeoutError("Timeout exceeded when calling PATCH /graphs/{graphId}."); + throw new errors.ZepTimeoutError("Timeout exceeded when calling PATCH /graph/{graphId}."); case "unknown": throw new errors.ZepError({ message: _response.error.errorMessage, diff --git a/src/api/resources/graph/client/requests/index.ts b/src/api/resources/graph/client/requests/index.ts index 2f3b1be6..5be47d14 100644 --- a/src/api/resources/graph/client/requests/index.ts +++ b/src/api/resources/graph/client/requests/index.ts @@ -3,7 +3,7 @@ export { type AddDataRequest } from "./AddDataRequest.js"; export { type AddDataBatchRequest } from "./AddDataBatchRequest.js"; export { type AddTripleRequest } from "./AddTripleRequest.js"; export { type CloneGraphRequest } from "./CloneGraphRequest.js"; -export { type GraphSearchQuery } from "./GraphSearchQuery.js"; export { type CreateGraphRequest } from "./CreateGraphRequest.js"; export { type GraphListAllRequest } from "./GraphListAllRequest.js"; +export { type GraphSearchQuery } from "./GraphSearchQuery.js"; export { type UpdateGraphRequest } from "./UpdateGraphRequest.js"; diff --git a/src/serialization/resources/graph/client/requests/index.ts b/src/serialization/resources/graph/client/requests/index.ts index bb91cb9e..c0b93032 100644 --- a/src/serialization/resources/graph/client/requests/index.ts +++ b/src/serialization/resources/graph/client/requests/index.ts @@ -3,6 +3,6 @@ export { AddDataRequest } from "./AddDataRequest.js"; export { AddDataBatchRequest } from "./AddDataBatchRequest.js"; export { AddTripleRequest } from "./AddTripleRequest.js"; export { CloneGraphRequest } from "./CloneGraphRequest.js"; -export { GraphSearchQuery } from "./GraphSearchQuery.js"; export { CreateGraphRequest } from "./CreateGraphRequest.js"; +export { GraphSearchQuery } from "./GraphSearchQuery.js"; export { UpdateGraphRequest } from "./UpdateGraphRequest.js"; diff --git a/src/version.ts b/src/version.ts index 12c45b3c..509e7f0c 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.0.4"; +export const SDK_VERSION = "3.0.5"; diff --git a/tests/wire/graph.test.ts b/tests/wire/graph.test.ts index f5cab26c..ac17b746 100644 --- a/tests/wire/graph.test.ts +++ b/tests/wire/graph.test.ts @@ -290,6 +290,93 @@ describe("Graph", () => { }); }); + test("create", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { graph_id: "graph_id" }; + const rawResponseBody = { + created_at: "created_at", + description: "description", + fact_rating_instruction: { + examples: { high: "high", low: "low", medium: "medium" }, + instruction: "instruction", + }, + graph_id: "graph_id", + id: 1, + name: "name", + project_uuid: "project_uuid", + uuid: "uuid", + }; + server + .mockEndpoint() + .post("/graph/create") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.graph.create({ + graphId: "graph_id", + }); + expect(response).toEqual({ + createdAt: "created_at", + description: "description", + factRatingInstruction: { + examples: { + high: "high", + low: "low", + medium: "medium", + }, + instruction: "instruction", + }, + graphId: "graph_id", + id: 1, + name: "name", + projectUuid: "project_uuid", + uuid: "uuid", + }); + }); + + test("list_all", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + graphs: [ + { + created_at: "created_at", + description: "description", + graph_id: "graph_id", + id: 1, + name: "name", + project_uuid: "project_uuid", + uuid: "uuid", + }, + ], + row_count: 1, + total_count: 1, + }; + server.mockEndpoint().get("/graph/list-all").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.graph.listAll(); + expect(response).toEqual({ + graphs: [ + { + createdAt: "created_at", + description: "description", + graphId: "graph_id", + id: 1, + name: "name", + projectUuid: "project_uuid", + uuid: "uuid", + }, + ], + rowCount: 1, + totalCount: 1, + }); + }); + test("search", async () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); @@ -398,93 +485,6 @@ describe("Graph", () => { }); }); - test("create", async () => { - const server = mockServerPool.createServer(); - const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { graph_id: "graph_id" }; - const rawResponseBody = { - created_at: "created_at", - description: "description", - fact_rating_instruction: { - examples: { high: "high", low: "low", medium: "medium" }, - instruction: "instruction", - }, - graph_id: "graph_id", - id: 1, - name: "name", - project_uuid: "project_uuid", - uuid: "uuid", - }; - server - .mockEndpoint() - .post("/graphs") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.graph.create({ - graphId: "graph_id", - }); - expect(response).toEqual({ - createdAt: "created_at", - description: "description", - factRatingInstruction: { - examples: { - high: "high", - low: "low", - medium: "medium", - }, - instruction: "instruction", - }, - graphId: "graph_id", - id: 1, - name: "name", - projectUuid: "project_uuid", - uuid: "uuid", - }); - }); - - test("list_all", async () => { - const server = mockServerPool.createServer(); - const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { - graphs: [ - { - created_at: "created_at", - description: "description", - graph_id: "graph_id", - id: 1, - name: "name", - project_uuid: "project_uuid", - uuid: "uuid", - }, - ], - row_count: 1, - total_count: 1, - }; - server.mockEndpoint().get("/graphs/list-all").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - - const response = await client.graph.listAll(); - expect(response).toEqual({ - graphs: [ - { - createdAt: "created_at", - description: "description", - graphId: "graph_id", - id: 1, - name: "name", - projectUuid: "project_uuid", - uuid: "uuid", - }, - ], - rowCount: 1, - totalCount: 1, - }); - }); - test("get", async () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); @@ -502,7 +502,7 @@ describe("Graph", () => { project_uuid: "project_uuid", uuid: "uuid", }; - server.mockEndpoint().get("/graphs/graphId").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + server.mockEndpoint().get("/graph/graphId").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.graph.get("graphId"); expect(response).toEqual({ @@ -529,7 +529,7 @@ describe("Graph", () => { const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; - server.mockEndpoint().delete("/graphs/graphId").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + server.mockEndpoint().delete("/graph/graphId").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.graph.delete("graphId"); expect(response).toEqual({ @@ -556,7 +556,7 @@ describe("Graph", () => { }; server .mockEndpoint() - .patch("/graphs/graphId") + .patch("/graph/graphId") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) diff --git a/tsconfig.json b/tsconfig.json index 1ec87dd7..d77fdf00 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,17 +1,3 @@ { - "compilerOptions": { - "extendedDiagnostics": true, - "strict": true, - "target": "ES6", - "moduleResolution": "node", - "esModuleInterop": true, - "skipLibCheck": true, - "declaration": true, - "outDir": "dist", - "rootDir": "src", - "baseUrl": "src", - "module": "CommonJS" - }, - "include": ["src"], - "exclude": [] + "extends": "./tsconfig.cjs.json" } From 8b2101e73ce8973d62cd129c1ab7997c812cb31b Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Fri, 1 Aug 2025 13:56:37 -0400 Subject: [PATCH 02/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b9116247..10674da7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.0.4", + "version": "3.0.5", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From bfeadd1ddbfb6c3f3b07ff4f0e4be101b0b258f8 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Tue, 5 Aug 2025 17:59:19 -0400 Subject: [PATCH 03/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 10674da7..3d90945d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.0.5", + "version": "3.1.0", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From 8d1954111153948e1925efb461d845332c2bf9d1 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 22:03:07 +0000 Subject: [PATCH 04/59] SDK regeneration --- reference.md | 14 ++++++-- src/Client.ts | 4 +-- src/api/errors/index.ts | 2 +- src/api/resources/graph/client/Client.ts | 36 ++++++++++++++++--- .../client/requests/EntityTypeRequest.ts | 2 ++ .../requests/GraphListEntityTypesRequest.ts | 18 ++++++++++ .../resources/graph/client/requests/index.ts | 1 + .../client/requests/EntityTypeRequest.ts | 4 +++ src/version.ts | 2 +- 9 files changed, 72 insertions(+), 11 deletions(-) create mode 100644 src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts diff --git a/reference.md b/reference.md index c5d98e3c..f682994e 100644 --- a/reference.md +++ b/reference.md @@ -2,7 +2,7 @@ ## Graph -
client.graph.listEntityTypes() -> Zep.EntityTypeResponse +
client.graph.listEntityTypes({ ...params }) -> Zep.EntityTypeResponse
@@ -14,7 +14,7 @@
-Returns all entity types for a project. +Returns all entity types for a project, user, or graph.
@@ -46,6 +46,14 @@ await client.graph.listEntityTypes();
+**request:** `Zep.GraphListEntityTypesRequest` + +
+
+ +
+
+ **requestOptions:** `Graph.RequestOptions`
@@ -69,7 +77,7 @@ await client.graph.listEntityTypes();
-Sets the entity types for a project, replacing any existing ones. +Sets the entity types for a project, user, or graph, replacing any existing ones.
diff --git a/src/Client.ts b/src/Client.ts index 695b00e3..129771fe 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -45,8 +45,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.0.5", - "User-Agent": "zep-cloud/3.0.5", + "X-Fern-SDK-Version": "3.1.0", + "User-Agent": "zep-cloud/3.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts index 2e4a2ca7..70ff361a 100644 --- a/src/api/errors/index.ts +++ b/src/api/errors/index.ts @@ -1,3 +1,3 @@ +export * from "./BadRequestError.js"; export * from "./NotFoundError.js"; export * from "./InternalServerError.js"; -export * from "./BadRequestError.js"; diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index 005f84fb..a76b370b 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -58,23 +58,39 @@ export class Graph { } /** - * Returns all entity types for a project. + * Returns all entity types for a project, user, or graph. * + * @param {Zep.GraphListEntityTypesRequest} request * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Zep.BadRequestError} * @throws {@link Zep.NotFoundError} * @throws {@link Zep.InternalServerError} * * @example * await client.graph.listEntityTypes() */ - public listEntityTypes(requestOptions?: Graph.RequestOptions): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__listEntityTypes(requestOptions)); + public listEntityTypes( + request: Zep.GraphListEntityTypesRequest = {}, + requestOptions?: Graph.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__listEntityTypes(request, requestOptions)); } private async __listEntityTypes( + request: Zep.GraphListEntityTypesRequest = {}, requestOptions?: Graph.RequestOptions, ): Promise> { + const { userId, graphId } = request; + const _queryParams: Record = {}; + if (userId != null) { + _queryParams["user_id"] = userId; + } + + if (graphId != null) { + _queryParams["graph_id"] = graphId; + } + const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -88,6 +104,7 @@ export class Graph { mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), requestOptions?.headers, ), + queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -107,6 +124,17 @@ export class Graph { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { + case 400: + throw new Zep.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); case 404: throw new Zep.NotFoundError( serializers.ApiError.parseOrThrow(_response.error.body, { @@ -156,7 +184,7 @@ export class Graph { } /** - * Sets the entity types for a project, replacing any existing ones. + * Sets the entity types for a project, user, or graph, replacing any existing ones. * * @param {Zep.EntityTypeRequest} request * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/graph/client/requests/EntityTypeRequest.ts b/src/api/resources/graph/client/requests/EntityTypeRequest.ts index 0bef7a61..efb22f7d 100644 --- a/src/api/resources/graph/client/requests/EntityTypeRequest.ts +++ b/src/api/resources/graph/client/requests/EntityTypeRequest.ts @@ -11,4 +11,6 @@ import * as Zep from "../../../../index.js"; export interface EntityTypeRequest { edgeTypes?: Zep.EdgeType[]; entityTypes?: Zep.EntityType[]; + graphId?: string; + userId?: string; } diff --git a/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts b/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts new file mode 100644 index 00000000..3daa5808 --- /dev/null +++ b/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface GraphListEntityTypesRequest { + /** + * User ID to get user-specific entity types + */ + userId?: string; + /** + * Graph ID to get group-specific entity types + */ + graphId?: string; +} diff --git a/src/api/resources/graph/client/requests/index.ts b/src/api/resources/graph/client/requests/index.ts index 5be47d14..54bc4fac 100644 --- a/src/api/resources/graph/client/requests/index.ts +++ b/src/api/resources/graph/client/requests/index.ts @@ -1,3 +1,4 @@ +export { type GraphListEntityTypesRequest } from "./GraphListEntityTypesRequest.js"; export { type EntityTypeRequest } from "./EntityTypeRequest.js"; export { type AddDataRequest } from "./AddDataRequest.js"; export { type AddDataBatchRequest } from "./AddDataBatchRequest.js"; diff --git a/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts b/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts index 0af43f77..f6c331f1 100644 --- a/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts +++ b/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts @@ -12,11 +12,15 @@ export const EntityTypeRequest: core.serialization.Schema Date: Tue, 5 Aug 2025 18:06:23 -0400 Subject: [PATCH 05/59] wip --- src/wrapper/graph.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wrapper/graph.ts b/src/wrapper/graph.ts index b9d656ce..12f6278c 100644 --- a/src/wrapper/graph.ts +++ b/src/wrapper/graph.ts @@ -44,6 +44,8 @@ export class Graph extends BaseGraph { public async setEntityTypes( entityTypes: Record, edgeTypes: Record, + userId?: string, + graphId?: string, requestOptions?: BaseGraph.RequestOptions, ): Promise { const validatedEntityTypes: Zep.EntityType[] = Object.keys(entityTypes).map((key) => { @@ -70,6 +72,8 @@ export class Graph extends BaseGraph { * * @param {Record} entityTypes * @param {Record} edgeTypes + * @param {string} [userId] - The user ID for which to set the ontology. If None, sets for the entire project. + * @param {string} [graphId] - The graph ID for which to set the ontology. If None, sets for the entire project. * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} @@ -106,8 +110,10 @@ export class Graph extends BaseGraph { public async setOntology( entityTypes: Record, edgeTypes: Record, + userId?: string, + graphId?: string, requestOptions?: BaseGraph.RequestOptions, ): Promise { - return this.setEntityTypes(entityTypes, edgeTypes, requestOptions); + return this.setEntityTypes(entityTypes, edgeTypes, userId, graphId, requestOptions); } } From c3242a22624f68ce4e2b5c64e29dcdbfdcbcbf17 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Tue, 5 Aug 2025 18:06:50 -0400 Subject: [PATCH 06/59] chore: Add support for user and graph specific entity/edge types --- src/wrapper/graph.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wrapper/graph.ts b/src/wrapper/graph.ts index 12f6278c..ad65977d 100644 --- a/src/wrapper/graph.ts +++ b/src/wrapper/graph.ts @@ -62,6 +62,8 @@ export class Graph extends BaseGraph { { entityTypes: validatedEntityTypes, edgeTypes: validatedEdgeTypes, + userId, + graphId, }, requestOptions, ); From 0f572e6bdd1b4a522300aafa2ec94ea5d03072d1 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Tue, 5 Aug 2025 19:18:57 -0400 Subject: [PATCH 07/59] chore: Add support for ontology target --- src/wrapper/graph.ts | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/wrapper/graph.ts b/src/wrapper/graph.ts index ad65977d..659077e9 100644 --- a/src/wrapper/graph.ts +++ b/src/wrapper/graph.ts @@ -2,12 +2,20 @@ import { Graph as BaseGraph } from "../api/resources/graph/client/Client.js"; import { Zep } from "../index.js"; import { EdgeType, entityModelToAPISchema, edgeModelToAPISchema, EntityType } from "./ontology.js"; +interface OntologyTarget { + // The user ID for which to set the ontology. + userId?: string; + // The graph ID for which to set the ontology. + graphId?: string; +} + export class Graph extends BaseGraph { /** * Sets the entity and edge types for a project, replacing any existing ones. * * @param {Record} entityTypes * @param {Record} edgeTypes + * @param {OntologyTarget} [ontologyTarget] - The target for which to set the ontology. Can include userId or graphId. If none specified, sets for the entire project. * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} @@ -44,8 +52,7 @@ export class Graph extends BaseGraph { public async setEntityTypes( entityTypes: Record, edgeTypes: Record, - userId?: string, - graphId?: string, + ontologyTarget?: OntologyTarget, requestOptions?: BaseGraph.RequestOptions, ): Promise { const validatedEntityTypes: Zep.EntityType[] = Object.keys(entityTypes).map((key) => { @@ -62,8 +69,8 @@ export class Graph extends BaseGraph { { entityTypes: validatedEntityTypes, edgeTypes: validatedEdgeTypes, - userId, - graphId, + userId: ontologyTarget?.userId, + graphId: ontologyTarget?.graphId, }, requestOptions, ); @@ -74,8 +81,7 @@ export class Graph extends BaseGraph { * * @param {Record} entityTypes * @param {Record} edgeTypes - * @param {string} [userId] - The user ID for which to set the ontology. If None, sets for the entire project. - * @param {string} [graphId] - The graph ID for which to set the ontology. If None, sets for the entire project. + * @param {OntologyTarget} [ontologyTarget] - The target for which to set the ontology. Can include userId or graphId. If none specified, sets for the entire project. * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} @@ -112,10 +118,9 @@ export class Graph extends BaseGraph { public async setOntology( entityTypes: Record, edgeTypes: Record, - userId?: string, - graphId?: string, + ontologyTarget?: OntologyTarget, requestOptions?: BaseGraph.RequestOptions, ): Promise { - return this.setEntityTypes(entityTypes, edgeTypes, userId, graphId, requestOptions); + return this.setEntityTypes(entityTypes, edgeTypes, ontologyTarget, requestOptions); } } From 9930bb680de3349f74244f98ca423ab48c4bcb9d Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 23:21:22 +0000 Subject: [PATCH 08/59] SDK regeneration --- reference.md | 7 +++++-- src/api/resources/graph/client/Client.ts | 11 +++++++---- .../graph/client/requests/EntityTypeRequest.ts | 9 ++++++--- .../client/requests/GraphListEntityTypesRequest.ts | 2 +- .../graph/client/requests/EntityTypeRequest.ts | 8 ++++---- tests/wire/graph.test.ts | 7 +++++-- 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/reference.md b/reference.md index f682994e..4accc820 100644 --- a/reference.md +++ b/reference.md @@ -77,7 +77,7 @@ await client.graph.listEntityTypes();
-Sets the entity types for a project, user, or graph, replacing any existing ones. +Sets the entity types for multiple users and graphs, replacing any existing ones.
@@ -93,7 +93,10 @@ Sets the entity types for a project, user, or graph, replacing any existing ones
```typescript -await client.graph.setEntityTypesInternal(); +await client.graph.setEntityTypesInternal({ + graphIds: ["graph_ids"], + userIds: ["user_ids"], +}); ```
diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index a76b370b..adfad048 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -184,7 +184,7 @@ export class Graph { } /** - * Sets the entity types for a project, user, or graph, replacing any existing ones. + * Sets the entity types for multiple users and graphs, replacing any existing ones. * * @param {Zep.EntityTypeRequest} request * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. @@ -193,17 +193,20 @@ export class Graph { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.setEntityTypesInternal() + * await client.graph.setEntityTypesInternal({ + * graphIds: ["graph_ids"], + * userIds: ["user_ids"] + * }) */ public setEntityTypesInternal( - request: Zep.EntityTypeRequest = {}, + request: Zep.EntityTypeRequest, requestOptions?: Graph.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__setEntityTypesInternal(request, requestOptions)); } private async __setEntityTypesInternal( - request: Zep.EntityTypeRequest = {}, + request: Zep.EntityTypeRequest, requestOptions?: Graph.RequestOptions, ): Promise> { const _response = await (this._options.fetcher ?? core.fetcher)({ diff --git a/src/api/resources/graph/client/requests/EntityTypeRequest.ts b/src/api/resources/graph/client/requests/EntityTypeRequest.ts index efb22f7d..ceb20193 100644 --- a/src/api/resources/graph/client/requests/EntityTypeRequest.ts +++ b/src/api/resources/graph/client/requests/EntityTypeRequest.ts @@ -6,11 +6,14 @@ import * as Zep from "../../../../index.js"; /** * @example - * {} + * { + * graphIds: ["graph_ids"], + * userIds: ["user_ids"] + * } */ export interface EntityTypeRequest { edgeTypes?: Zep.EdgeType[]; entityTypes?: Zep.EntityType[]; - graphId?: string; - userId?: string; + graphIds: string[]; + userIds: string[]; } diff --git a/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts b/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts index 3daa5808..8fb0fdc2 100644 --- a/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts +++ b/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts @@ -12,7 +12,7 @@ export interface GraphListEntityTypesRequest { */ userId?: string; /** - * Graph ID to get group-specific entity types + * Graph ID to get graph-specific entity types */ graphId?: string; } diff --git a/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts b/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts index f6c331f1..f34718f4 100644 --- a/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts +++ b/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts @@ -12,15 +12,15 @@ export const EntityTypeRequest: core.serialization.Schema { test("set_entity_types_internal", async () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = {}; + const rawRequestBody = { graph_ids: ["graph_ids"], user_ids: ["user_ids"] }; const rawResponseBody = { message: "message" }; server .mockEndpoint() @@ -75,7 +75,10 @@ describe("Graph", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.graph.setEntityTypesInternal(); + const response = await client.graph.setEntityTypesInternal({ + graphIds: ["graph_ids"], + userIds: ["user_ids"], + }); expect(response).toEqual({ message: "message", }); From f38cf9de22dd7f2df509aca34063f5864cd92f57 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Tue, 5 Aug 2025 19:25:06 -0400 Subject: [PATCH 09/59] chore: Add support for multiple ontology targets --- src/wrapper/graph.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/wrapper/graph.ts b/src/wrapper/graph.ts index 659077e9..2194966f 100644 --- a/src/wrapper/graph.ts +++ b/src/wrapper/graph.ts @@ -2,11 +2,11 @@ import { Graph as BaseGraph } from "../api/resources/graph/client/Client.js"; import { Zep } from "../index.js"; import { EdgeType, entityModelToAPISchema, edgeModelToAPISchema, EntityType } from "./ontology.js"; -interface OntologyTarget { - // The user ID for which to set the ontology. - userId?: string; - // The graph ID for which to set the ontology. - graphId?: string; +interface OntologyTargets { + // The user identifiers for which to set the ontology. + userIds?: string[]; + // The graph identifiers for which to set the ontology. + graphIds?: string[]; } export class Graph extends BaseGraph { @@ -15,7 +15,7 @@ export class Graph extends BaseGraph { * * @param {Record} entityTypes * @param {Record} edgeTypes - * @param {OntologyTarget} [ontologyTarget] - The target for which to set the ontology. Can include userId or graphId. If none specified, sets for the entire project. + * @param {OntologyTargets} [ontologyTargets] - The targets for which to set the ontology. Can include userIds and graphIds. If none specified, sets for the entire project. * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} @@ -47,12 +47,12 @@ export class Graph extends BaseGraph { * TravelDestination: travelDestinationSchema, * }, { * IS_TRAVELING_TO: isTravelingTo, - * }); + * }, {userIds: ["user_1234]}); */ public async setEntityTypes( entityTypes: Record, edgeTypes: Record, - ontologyTarget?: OntologyTarget, + ontologyTargets?: OntologyTargets, requestOptions?: BaseGraph.RequestOptions, ): Promise { const validatedEntityTypes: Zep.EntityType[] = Object.keys(entityTypes).map((key) => { @@ -69,8 +69,8 @@ export class Graph extends BaseGraph { { entityTypes: validatedEntityTypes, edgeTypes: validatedEdgeTypes, - userId: ontologyTarget?.userId, - graphId: ontologyTarget?.graphId, + userIds: ontologyTargets?.userIds || [], + graphIds: ontologyTargets?.graphIds || [], }, requestOptions, ); @@ -81,7 +81,7 @@ export class Graph extends BaseGraph { * * @param {Record} entityTypes * @param {Record} edgeTypes - * @param {OntologyTarget} [ontologyTarget] - The target for which to set the ontology. Can include userId or graphId. If none specified, sets for the entire project. + * @param {OntologyTargets} [ontologyTargets] - The target for which to set the ontology. Can include userId or graphId. If none specified, sets for the entire project. * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} @@ -109,18 +109,18 @@ export class Graph extends BaseGraph { * ] * } * - * await client.graph.setOntology({ + * await client.graph.setEntityTypes({ * TravelDestination: travelDestinationSchema, * }, { * IS_TRAVELING_TO: isTravelingTo, - * }); + * }, {userIds: ["user_1234]}); */ public async setOntology( entityTypes: Record, edgeTypes: Record, - ontologyTarget?: OntologyTarget, + ontologyTargets?: OntologyTargets, requestOptions?: BaseGraph.RequestOptions, ): Promise { - return this.setEntityTypes(entityTypes, edgeTypes, ontologyTarget, requestOptions); + return this.setEntityTypes(entityTypes, edgeTypes, ontologyTargets, requestOptions); } } From 7a7f9a995ff959597e9d8ec2662fc6c4c9cb5edd Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 23:47:40 +0000 Subject: [PATCH 10/59] SDK regeneration --- reference.md | 5 +---- src/api/resources/graph/client/Client.ts | 9 +++------ .../graph/client/requests/EntityTypeRequest.ts | 9 +++------ .../graph/client/requests/EntityTypeRequest.ts | 14 ++++++++++---- tests/wire/graph.test.ts | 7 ++----- 5 files changed, 19 insertions(+), 25 deletions(-) diff --git a/reference.md b/reference.md index 4accc820..7a0d6a27 100644 --- a/reference.md +++ b/reference.md @@ -93,10 +93,7 @@ Sets the entity types for multiple users and graphs, replacing any existing ones
```typescript -await client.graph.setEntityTypesInternal({ - graphIds: ["graph_ids"], - userIds: ["user_ids"], -}); +await client.graph.setEntityTypesInternal(); ```
diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index adfad048..f3588f76 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -193,20 +193,17 @@ export class Graph { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.setEntityTypesInternal({ - * graphIds: ["graph_ids"], - * userIds: ["user_ids"] - * }) + * await client.graph.setEntityTypesInternal() */ public setEntityTypesInternal( - request: Zep.EntityTypeRequest, + request: Zep.EntityTypeRequest = {}, requestOptions?: Graph.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__setEntityTypesInternal(request, requestOptions)); } private async __setEntityTypesInternal( - request: Zep.EntityTypeRequest, + request: Zep.EntityTypeRequest = {}, requestOptions?: Graph.RequestOptions, ): Promise> { const _response = await (this._options.fetcher ?? core.fetcher)({ diff --git a/src/api/resources/graph/client/requests/EntityTypeRequest.ts b/src/api/resources/graph/client/requests/EntityTypeRequest.ts index ceb20193..261dfb2a 100644 --- a/src/api/resources/graph/client/requests/EntityTypeRequest.ts +++ b/src/api/resources/graph/client/requests/EntityTypeRequest.ts @@ -6,14 +6,11 @@ import * as Zep from "../../../../index.js"; /** * @example - * { - * graphIds: ["graph_ids"], - * userIds: ["user_ids"] - * } + * {} */ export interface EntityTypeRequest { edgeTypes?: Zep.EdgeType[]; entityTypes?: Zep.EntityType[]; - graphIds: string[]; - userIds: string[]; + graphIds?: string[]; + userIds?: string[]; } diff --git a/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts b/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts index f34718f4..9de951ea 100644 --- a/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts +++ b/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts @@ -12,15 +12,21 @@ export const EntityTypeRequest: core.serialization.Schema { test("set_entity_types_internal", async () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { graph_ids: ["graph_ids"], user_ids: ["user_ids"] }; + const rawRequestBody = {}; const rawResponseBody = { message: "message" }; server .mockEndpoint() @@ -75,10 +75,7 @@ describe("Graph", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.graph.setEntityTypesInternal({ - graphIds: ["graph_ids"], - userIds: ["user_ids"], - }); + const response = await client.graph.setEntityTypesInternal(); expect(response).toEqual({ message: "message", }); From 8302c4f86a3e500240bb293339136183f56f3801 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Tue, 5 Aug 2025 19:51:46 -0400 Subject: [PATCH 11/59] fix: redundant default to empty list --- src/wrapper/graph.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wrapper/graph.ts b/src/wrapper/graph.ts index 2194966f..cb6e9639 100644 --- a/src/wrapper/graph.ts +++ b/src/wrapper/graph.ts @@ -69,8 +69,8 @@ export class Graph extends BaseGraph { { entityTypes: validatedEntityTypes, edgeTypes: validatedEdgeTypes, - userIds: ontologyTargets?.userIds || [], - graphIds: ontologyTargets?.graphIds || [], + userIds: ontologyTargets?.userIds, + graphIds: ontologyTargets?.graphIds, }, requestOptions, ); From 3691cf01ee951af77d5b2e2ca0ad0b2657dcde69 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Tue, 5 Aug 2025 20:14:59 -0400 Subject: [PATCH 12/59] fix: comment --- src/wrapper/graph.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wrapper/graph.ts b/src/wrapper/graph.ts index cb6e9639..5eb5eeda 100644 --- a/src/wrapper/graph.ts +++ b/src/wrapper/graph.ts @@ -47,7 +47,7 @@ export class Graph extends BaseGraph { * TravelDestination: travelDestinationSchema, * }, { * IS_TRAVELING_TO: isTravelingTo, - * }, {userIds: ["user_1234]}); + * }, {userIds: ['user_1234']}); */ public async setEntityTypes( entityTypes: Record, @@ -113,7 +113,7 @@ export class Graph extends BaseGraph { * TravelDestination: travelDestinationSchema, * }, { * IS_TRAVELING_TO: isTravelingTo, - * }, {userIds: ["user_1234]}); + * }, {userIds: ['user_1234']}); */ public async setOntology( entityTypes: Record, From 86d940b3087b2a1061e88f5ca8efd88f57eb9e92 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Tue, 5 Aug 2025 21:16:18 -0400 Subject: [PATCH 13/59] fix: comment --- src/wrapper/graph.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wrapper/graph.ts b/src/wrapper/graph.ts index 5eb5eeda..cbc2bf7c 100644 --- a/src/wrapper/graph.ts +++ b/src/wrapper/graph.ts @@ -11,11 +11,11 @@ interface OntologyTargets { export class Graph extends BaseGraph { /** - * Sets the entity and edge types for a project, replacing any existing ones. + * Sets the entity and edge types for the specified targets, replacing any existing ones in those targets. If no targets are specified, it sets the ontology for the entire project. * * @param {Record} entityTypes * @param {Record} edgeTypes - * @param {OntologyTargets} [ontologyTargets] - The targets for which to set the ontology. Can include userIds and graphIds. If none specified, sets for the entire project. + * @param {OntologyTargets} [ontologyTargets] - The targets for which to set the ontology. Can include userIds or graphIds. If none specified, sets for the entire project. * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} @@ -77,11 +77,11 @@ export class Graph extends BaseGraph { } /** - * Sets the entity and edge types for a project, replacing any existing ones. + * Sets the entity and edge types for the specified targets, replacing any existing ones in those targets. If no targets are specified, it sets the ontology for the entire project. * * @param {Record} entityTypes * @param {Record} edgeTypes - * @param {OntologyTargets} [ontologyTargets] - The target for which to set the ontology. Can include userId or graphId. If none specified, sets for the entire project. + * @param {OntologyTargets} [ontologyTargets] - The targets for which to set the ontology. Can include userIds or graphIds. If none specified, sets for the entire project. * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} From 136f0b0ef28db41d0c8a807db2904306f2757535 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Fri, 8 Aug 2025 20:05:38 -0400 Subject: [PATCH 14/59] chore: Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3d90945d..78e353dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.1.0", + "version": "3.2.0", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From 959098bb0482d9f15616e4b8feee7a5aaa9e6407 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 00:07:53 +0000 Subject: [PATCH 15/59] SDK regeneration --- reference.md | 2 +- src/Client.ts | 4 ++-- src/api/resources/graph/client/Client.ts | 2 +- src/api/resources/thread/client/Client.ts | 6 +++++- .../resources/thread/client/requests/ThreadGetRequest.ts | 4 ++++ src/version.ts | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/reference.md b/reference.md index 7a0d6a27..7ad56789 100644 --- a/reference.md +++ b/reference.md @@ -471,7 +471,7 @@ await client.graph.create({
-Returns all graphs. +List all graphs. In order to list users, use user.list_ordered instead
diff --git a/src/Client.ts b/src/Client.ts index 129771fe..246b4706 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -45,8 +45,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.1.0", - "User-Agent": "zep-cloud/3.1.0", + "X-Fern-SDK-Version": "3.2.0", + "User-Agent": "zep-cloud/3.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index f3588f76..70327ed3 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -852,7 +852,7 @@ export class Graph { } /** - * Returns all graphs. + * List all graphs. In order to list users, use user.list_ordered instead * * @param {Zep.GraphListAllRequest} request * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/thread/client/Client.ts b/src/api/resources/thread/client/Client.ts index abef084a..0f535069 100644 --- a/src/api/resources/thread/client/Client.ts +++ b/src/api/resources/thread/client/Client.ts @@ -522,7 +522,7 @@ export class Thread { request: Zep.ThreadGetRequest = {}, requestOptions?: Thread.RequestOptions, ): Promise> { - const { limit, cursor } = request; + const { limit, cursor, lastn } = request; const _queryParams: Record = {}; if (limit != null) { _queryParams["limit"] = limit.toString(); @@ -532,6 +532,10 @@ export class Thread { _queryParams["cursor"] = cursor.toString(); } + if (lastn != null) { + _queryParams["lastn"] = lastn.toString(); + } + const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? diff --git a/src/api/resources/thread/client/requests/ThreadGetRequest.ts b/src/api/resources/thread/client/requests/ThreadGetRequest.ts index d99f08d8..d0e9a602 100644 --- a/src/api/resources/thread/client/requests/ThreadGetRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadGetRequest.ts @@ -15,4 +15,8 @@ export interface ThreadGetRequest { * Cursor for pagination */ cursor?: number; + /** + * Number of most recent messages to return (overrides limit and cursor) + */ + lastn?: number; } diff --git a/src/version.ts b/src/version.ts index 8bccdd42..09b986e7 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.1.0"; +export const SDK_VERSION = "3.2.0"; From a52e2b05e22e5a12d76dc41e545d48a6dee861e3 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Tue, 12 Aug 2025 15:05:43 -0400 Subject: [PATCH 16/59] feat: Update context string utility to include entity attributes and episodes --- .fernignore | 1 + src/contextString.ts | 83 ++++++++++++-- tests/unit/contextString.test.ts | 180 +++++++++++++++++++++++++++++++ 3 files changed, 254 insertions(+), 10 deletions(-) create mode 100644 tests/unit/contextString.test.ts diff --git a/.fernignore b/.fernignore index ada034ab..5760cec3 100644 --- a/.fernignore +++ b/.fernignore @@ -3,6 +3,7 @@ examples src/wrapper src/index.ts src/contextString.ts +tests/unit/contextString.test.ts package.json yarn.lock .github diff --git a/src/contextString.ts b/src/contextString.ts index d6e4c150..029b9248 100644 --- a/src/contextString.ts +++ b/src/contextString.ts @@ -1,7 +1,7 @@ -import { EntityEdge, EntityNode } from "./api/index.js"; +import { EntityEdge, EntityNode, Episode } from "./api/index.js"; const TEMPLATE_STRING = ` -FACTS and ENTITIES represent relevant context to the current conversation. +FACTS and ENTITIES%episodesHeader% represent relevant context to the current conversation. # These are the most relevant facts and their valid date ranges # format: FACT (Date range: from - to) @@ -10,10 +10,15 @@ FACTS and ENTITIES represent relevant context to the current conversation. # These are the most relevant entities -# ENTITY_NAME: entity summary +# Name: ENTITY_NAME +# Label: entity_label (if present) +# Attributes: (if present) +# attr_name: attr_value +# Summary: entity summary %entities% +%episodesSection% `; /** @@ -59,23 +64,81 @@ function formatDate(date: Date): string { } /** - * Compose a search context from entity edges and nodes. + * Compose a search context from entity edges, nodes, and episodes. * * @param edges - List of entity edges. * @param nodes - List of entity nodes. - * @returns A formatted string containing facts and entities. + * @param episodes - List of episodes. + * @returns A formatted string containing facts, entities, and episodes. */ -export function composeContextString(edges: EntityEdge[], nodes: EntityNode[]): string { +export function composeContextString(edges: EntityEdge[], nodes: EntityNode[], episodes: Episode[] = []): string { const facts = edges.map((edge) => { - return ` - ${edge.fact} (${formatEdgeDateRange(edge)})`; + return ` - ${edge.fact} (Date range: ${formatEdgeDateRange(edge)})`; }); const entities = nodes.map((node) => { - return ` - ${node.name}: ${node.summary}`; + const entityParts = [`Name: ${node.name}`]; + + if (node.labels && node.labels.length > 0) { + const labels = [...node.labels]; + const entityIndex = labels.indexOf('Entity'); + if (entityIndex > -1) { + labels.splice(entityIndex, 1); + } + if (labels.length > 0) { + entityParts.push(`Label: ${labels[0]}`); + } + } + + if (node.attributes && Object.keys(node.attributes).length > 0) { + const filteredAttributes = { ...node.attributes }; + delete filteredAttributes.labels; + if (Object.keys(filteredAttributes).length > 0) { + entityParts.push('Attributes:'); + Object.entries(filteredAttributes).forEach(([key, value]) => { + entityParts.push(` ${key}: ${value}`); + }); + } + } + + if (node.summary && node.summary.trim()) { + entityParts.push(`Summary: ${node.summary}`); + } + + return entityParts.join('\n'); }); + const episodesList: string[] = []; + if (episodes.length > 0) { + episodes.forEach((episode) => { + let rolePrefix = ""; + if (episode.role && episode.roleType) { + rolePrefix = `${episode.role} (${episode.roleType}): `; + } else if (episode.role) { + rolePrefix = `${episode.role}: `; + } else if (episode.roleType) { + rolePrefix = `(${episode.roleType}): `; + } + + const timestamp = formatDate(new Date(episode.createdAt)); + + const episodeStr = ` - ${rolePrefix}${episode.content} (${timestamp})`; + episodesList.push(episodeStr); + }); + } + const factsStr = facts.join("\n"); const entitiesStr = entities.join("\n"); - - return TEMPLATE_STRING.replace("%facts%", factsStr).replace("%entities%", entitiesStr); + const episodesStr = episodesList.join("\n"); + + const episodesHeader = episodes.length > 0 ? ", and EPISODES" : ""; + const episodesSection = episodes.length > 0 + ? `\n# These are the most relevant episodes\n\n${episodesStr}\n` + : ""; + + return TEMPLATE_STRING + .replace("%episodesHeader%", episodesHeader) + .replace("%facts%", factsStr) + .replace("%entities%", entitiesStr) + .replace("%episodesSection%", episodesSection); } diff --git a/tests/unit/contextString.test.ts b/tests/unit/contextString.test.ts new file mode 100644 index 00000000..f8a62963 --- /dev/null +++ b/tests/unit/contextString.test.ts @@ -0,0 +1,180 @@ +import { composeContextString, formatEdgeDateRange } from "../../src/contextString.js"; +import { EntityEdge, EntityNode, Episode, RoleType } from "../../src/api/index.js"; + +describe("contextString", () => { + const mockEdge: EntityEdge = { + fact: "John works at Acme Corp", + validAt: "2024-01-01T10:00:00Z", + invalidAt: "2024-12-31T23:59:59Z", + createdAt: "2024-01-01T10:00:00Z", + name: "works_at", + sourceNodeUuid: "source-uuid", + targetNodeUuid: "target-uuid", + uuid: "edge-uuid-1" + }; + + const mockNode: EntityNode = { + name: "John Doe", + summary: "Software engineer at Acme Corp", + createdAt: "2024-01-01T10:00:00Z", + labels: ["Person", "Employee"], + attributes: { + age: "30", + department: "Engineering", + labels: ["Person", "Employee"] // This should be filtered out + }, + uuid: "node-uuid-1" + }; + + const mockEpisode: Episode = { + content: "Hello, how are you?", + createdAt: "2024-01-15T14:30:00Z", + role: "user", + roleType: RoleType.UserRole, + uuid: "episode-uuid-1" + }; + + describe("formatEdgeDateRange", () => { + it("should format date range correctly", () => { + const result = formatEdgeDateRange(mockEdge); + expect(result).toMatch(/2024-01-01 \d{2}:\d{2}:\d{2} - 2024-12-31 \d{2}:\d{2}:\d{2}/); + }); + + it("should handle missing validAt", () => { + const edge = { ...mockEdge, validAt: undefined }; + const result = formatEdgeDateRange(edge); + expect(result).toMatch(/date unknown - 2024-12-31 \d{2}:\d{2}:\d{2}/); + }); + + it("should handle missing invalidAt", () => { + const edge = { ...mockEdge, invalidAt: undefined }; + const result = formatEdgeDateRange(edge); + expect(result).toMatch(/2024-01-01 \d{2}:\d{2}:\d{2} - present/); + }); + }); + + describe("composeContextString", () => { + it("should compose context string with only facts and entities", () => { + const result = composeContextString([mockEdge], [mockNode]); + + expect(result).toContain("FACTS and ENTITIES represent relevant context"); + expect(result).toMatch(/John works at Acme Corp \(Date range: 2024-01-01 \d{2}:\d{2}:\d{2} - 2024-12-31 \d{2}:\d{2}:\d{2}\)/); + expect(result).toContain("Name: John Doe"); + expect(result).toContain("Label: Person"); + expect(result).toContain("Attributes:"); + expect(result).toContain(" age: 30"); + expect(result).toContain(" department: Engineering"); + expect(result).toContain("Summary: Software engineer at Acme Corp"); + expect(result).not.toContain("EPISODES"); + }); + + it("should compose context string with facts, entities, and episodes", () => { + const result = composeContextString([mockEdge], [mockNode], [mockEpisode]); + + expect(result).toContain("FACTS and ENTITIES, and EPISODES represent relevant context"); + expect(result).toMatch(/John works at Acme Corp \(Date range: 2024-01-01 \d{2}:\d{2}:\d{2} - 2024-12-31 \d{2}:\d{2}:\d{2}\)/); + expect(result).toContain("Name: John Doe"); + expect(result).toMatch(/user \(user\): Hello, how are you\? \(2024-01-15 \d{2}:\d{2}:\d{2}\)/); + expect(result).toContain(""); + expect(result).toContain(""); + }); + + it("should handle entity without labels", () => { + const nodeWithoutLabels = { ...mockNode, labels: undefined }; + const result = composeContextString([], [nodeWithoutLabels]); + + expect(result).toContain("Name: John Doe"); + expect(result).not.toMatch(/^Label:/m); + expect(result).toContain("Summary: Software engineer at Acme Corp"); + }); + + it("should handle entity with only 'Entity' label", () => { + const nodeWithEntityLabel = { ...mockNode, labels: ["Entity"] }; + const result = composeContextString([], [nodeWithEntityLabel]); + + expect(result).toContain("Name: John Doe"); + expect(result).not.toMatch(/^Label:/m); + }); + + it("should handle entity without attributes", () => { + const nodeWithoutAttributes = { ...mockNode, attributes: undefined }; + const result = composeContextString([], [nodeWithoutAttributes]); + + expect(result).toContain("Name: John Doe"); + expect(result).not.toMatch(/^Attributes:/m); + }); + + it("should handle entity without summary", () => { + const nodeWithoutSummary = { ...mockNode, summary: "" }; + const result = composeContextString([], [nodeWithoutSummary]); + + expect(result).toContain("Name: John Doe"); + expect(result).not.toMatch(/^Summary:/m); + }); + + it("should handle episode with only role", () => { + const episodeWithOnlyRole = { ...mockEpisode, roleType: undefined }; + const result = composeContextString([], [], [episodeWithOnlyRole]); + + expect(result).toMatch(/user: Hello, how are you\? \(2024-01-15 \d{2}:\d{2}:\d{2}\)/); + }); + + it("should handle episode with only roleType", () => { + const episodeWithOnlyRoleType = { ...mockEpisode, role: undefined }; + const result = composeContextString([], [], [episodeWithOnlyRoleType]); + + expect(result).toMatch(/\(user\): Hello, how are you\? \(2024-01-15 \d{2}:\d{2}:\d{2}\)/); + }); + + it("should handle episode without role and roleType", () => { + const episodeWithoutRole = { ...mockEpisode, role: undefined, roleType: undefined }; + const result = composeContextString([], [], [episodeWithoutRole]); + + expect(result).toMatch(/Hello, how are you\? \(2024-01-15 \d{2}:\d{2}:\d{2}\)/); + }); + + it("should handle empty inputs", () => { + const result = composeContextString([], [], []); + + expect(result).toContain("FACTS and ENTITIES represent relevant context"); + expect(result).toContain(""); + expect(result).toContain(""); + expect(result).toContain(""); + expect(result).toContain(""); + expect(result).not.toContain("EPISODES"); + }); + + it("should filter out 'labels' attribute correctly", () => { + const result = composeContextString([], [mockNode]); + + expect(result).toContain("Attributes:"); + expect(result).toContain(" age: 30"); + expect(result).toContain(" department: Engineering"); + expect(result).not.toContain(" labels:"); + }); + + it("should handle multiple entities and episodes", () => { + const secondNode: EntityNode = { + name: "Jane Smith", + summary: "Product manager", + createdAt: "2024-01-01T10:00:00Z", + uuid: "node-uuid-2" + }; + + const secondEpisode: Episode = { + content: "I'm doing well, thanks!", + createdAt: "2024-01-15T14:31:00Z", + role: "assistant", + roleType: RoleType.AssistantRole, + uuid: "episode-uuid-2" + }; + + const result = composeContextString([mockEdge], [mockNode, secondNode], [mockEpisode, secondEpisode]); + + expect(result).toContain("Name: John Doe"); + expect(result).toContain("Name: Jane Smith"); + expect(result).toMatch(/user \(user\): Hello, how are you\?/); + expect(result).toMatch(/assistant \(assistant\): I'm doing well, thanks!/); + }); + }); +}); \ No newline at end of file From 0962eab74327cfe98f79f3453825c445c974bf5d Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 23:50:42 +0000 Subject: [PATCH 17/59] SDK regeneration --- reference.md | 80 ++++++++++++- src/Client.ts | 4 +- src/api/resources/graph/client/Client.ts | 2 +- src/api/resources/thread/client/Client.ts | 107 ++++++++++++++++++ .../resources/thread/client/requests/index.ts | 1 - .../AddThreadMessagesRequest.ts | 11 +- src/api/types/index.ts | 1 + .../resources/thread/client/requests/index.ts | 1 - .../AddThreadMessagesRequest.ts | 12 +- src/serialization/types/index.ts | 1 + src/version.ts | 2 +- tests/wire/thread.test.ts | 27 +++++ 12 files changed, 226 insertions(+), 23 deletions(-) rename src/api/{resources/thread/client/requests => types}/AddThreadMessagesRequest.ts (75%) rename src/serialization/{resources/thread/client/requests => types}/AddThreadMessagesRequest.ts (66%) diff --git a/reference.md b/reference.md index 7ad56789..6521e56a 100644 --- a/reference.md +++ b/reference.md @@ -471,7 +471,7 @@ await client.graph.create({
-List all graphs. In order to list users, use user.list_ordered instead +Returns all graphs. In order to list users, use user.list_ordered instead
@@ -1198,6 +1198,84 @@ await client.thread.addMessages("threadId", {
+
client.thread.addMessagesBatch(threadId, { ...params }) -> Zep.AddThreadMessagesResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Add messages to a thread in batch mode. This will process messages concurrently, which is useful for data migrations. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.thread.addMessagesBatch("threadId", { + messages: [ + { + content: "content", + role: "norole", + }, + ], +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**threadId:** `string` — The ID of the thread to which messages should be added. + +
+
+ +
+
+ +**request:** `Zep.AddThreadMessagesRequest` + +
+
+ +
+
+ +**requestOptions:** `Thread.RequestOptions` + +
+
+
+
+ +
+
+
+ ## User
client.user.add({ ...params }) -> Zep.User diff --git a/src/Client.ts b/src/Client.ts index 246b4706..fef78a5e 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -45,8 +45,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.2.0", - "User-Agent": "zep-cloud/3.2.0", + "X-Fern-SDK-Version": "3.4.0", + "User-Agent": "zep-cloud/3.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index 70327ed3..43dff1a3 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -852,7 +852,7 @@ export class Graph { } /** - * List all graphs. In order to list users, use user.list_ordered instead + * Returns all graphs. In order to list users, use user.list_ordered instead * * @param {Zep.GraphListAllRequest} request * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/thread/client/Client.ts b/src/api/resources/thread/client/Client.ts index 0f535069..129cf83a 100644 --- a/src/api/resources/thread/client/Client.ts +++ b/src/api/resources/thread/client/Client.ts @@ -722,6 +722,113 @@ export class Thread { } } + /** + * Add messages to a thread in batch mode. This will process messages concurrently, which is useful for data migrations. + * + * @param {string} threadId - The ID of the thread to which messages should be added. + * @param {Zep.AddThreadMessagesRequest} request + * @param {Thread.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.thread.addMessagesBatch("threadId", { + * messages: [{ + * content: "content", + * role: "norole" + * }] + * }) + */ + public addMessagesBatch( + threadId: string, + request: Zep.AddThreadMessagesRequest, + requestOptions?: Thread.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__addMessagesBatch(threadId, request, requestOptions)); + } + + private async __addMessagesBatch( + threadId: string, + request: Zep.AddThreadMessagesRequest, + requestOptions?: Thread.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + `threads/${encodeURIComponent(threadId)}/messages-batch`, + ), + method: "POST", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.AddThreadMessagesRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.AddThreadMessagesResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError( + "Timeout exceeded when calling POST /threads/{threadId}/messages-batch.", + ); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + protected async _getCustomAuthorizationHeaders() { const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["ZEP_API_KEY"]; return { Authorization: `Api-Key ${apiKeyValue}` }; diff --git a/src/api/resources/thread/client/requests/index.ts b/src/api/resources/thread/client/requests/index.ts index 7af16272..a9152893 100644 --- a/src/api/resources/thread/client/requests/index.ts +++ b/src/api/resources/thread/client/requests/index.ts @@ -2,4 +2,3 @@ export { type ThreadListAllRequest } from "./ThreadListAllRequest.js"; export { type CreateThreadRequest } from "./CreateThreadRequest.js"; export { type ThreadGetUserContextRequest } from "./ThreadGetUserContextRequest.js"; export { type ThreadGetRequest } from "./ThreadGetRequest.js"; -export { type AddThreadMessagesRequest } from "./AddThreadMessagesRequest.js"; diff --git a/src/api/resources/thread/client/requests/AddThreadMessagesRequest.ts b/src/api/types/AddThreadMessagesRequest.ts similarity index 75% rename from src/api/resources/thread/client/requests/AddThreadMessagesRequest.ts rename to src/api/types/AddThreadMessagesRequest.ts index 5173b77b..5d7919d1 100644 --- a/src/api/resources/thread/client/requests/AddThreadMessagesRequest.ts +++ b/src/api/types/AddThreadMessagesRequest.ts @@ -2,17 +2,8 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Zep from "../../../../index.js"; +import * as Zep from "../index.js"; -/** - * @example - * { - * messages: [{ - * content: "content", - * role: "norole" - * }] - * } - */ export interface AddThreadMessagesRequest { /** * Optional list of role types to ignore when adding messages to graph memory. diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 60443260..b6eaecfb 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,4 +1,5 @@ export * from "./ApiError.js"; +export * from "./AddThreadMessagesRequest.js"; export * from "./AddThreadMessagesResponse.js"; export * from "./CloneGraphResponse.js"; export * from "./EdgeType.js"; diff --git a/src/serialization/resources/thread/client/requests/index.ts b/src/serialization/resources/thread/client/requests/index.ts index 82233481..29bfd7e7 100644 --- a/src/serialization/resources/thread/client/requests/index.ts +++ b/src/serialization/resources/thread/client/requests/index.ts @@ -1,2 +1 @@ export { CreateThreadRequest } from "./CreateThreadRequest.js"; -export { AddThreadMessagesRequest } from "./AddThreadMessagesRequest.js"; diff --git a/src/serialization/resources/thread/client/requests/AddThreadMessagesRequest.ts b/src/serialization/types/AddThreadMessagesRequest.ts similarity index 66% rename from src/serialization/resources/thread/client/requests/AddThreadMessagesRequest.ts rename to src/serialization/types/AddThreadMessagesRequest.ts index 6f0fbe67..71dc56d1 100644 --- a/src/serialization/resources/thread/client/requests/AddThreadMessagesRequest.ts +++ b/src/serialization/types/AddThreadMessagesRequest.ts @@ -2,13 +2,13 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../../../index.js"; -import * as Zep from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; -import { RoleType } from "../../../../types/RoleType.js"; -import { Message } from "../../../../types/Message.js"; +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { RoleType } from "./RoleType.js"; +import { Message } from "./Message.js"; -export const AddThreadMessagesRequest: core.serialization.Schema< +export const AddThreadMessagesRequest: core.serialization.ObjectSchema< serializers.AddThreadMessagesRequest.Raw, Zep.AddThreadMessagesRequest > = core.serialization.object({ diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 60443260..b6eaecfb 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,4 +1,5 @@ export * from "./ApiError.js"; +export * from "./AddThreadMessagesRequest.js"; export * from "./AddThreadMessagesResponse.js"; export * from "./CloneGraphResponse.js"; export * from "./EdgeType.js"; diff --git a/src/version.ts b/src/version.ts index 09b986e7..c3fa33c1 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.2.0"; +export const SDK_VERSION = "3.4.0"; diff --git a/tests/wire/thread.test.ts b/tests/wire/thread.test.ts index 2c1f2ab9..234d61e9 100644 --- a/tests/wire/thread.test.ts +++ b/tests/wire/thread.test.ts @@ -181,4 +181,31 @@ describe("Thread", () => { context: "context", }); }); + + test("add_messages_batch", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { messages: [{ content: "content", role: "norole" }] }; + const rawResponseBody = { context: "context" }; + server + .mockEndpoint() + .post("/threads/threadId/messages-batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.thread.addMessagesBatch("threadId", { + messages: [ + { + content: "content", + role: "norole", + }, + ], + }); + expect(response).toEqual({ + context: "context", + }); + }); }); From 0d97c8db21f50243abf6bce672e19868a1d03e72 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Tue, 12 Aug 2025 19:53:52 -0400 Subject: [PATCH 18/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 78e353dd..93b941d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.2.0", + "version": "3.4.0", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From d408a170f96b718344fd5e75aff9786efb1685ab Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 14 Aug 2025 23:59:22 +0000 Subject: [PATCH 19/59] SDK regeneration --- src/api/types/AddThreadMessagesResponse.ts | 1 + src/serialization/types/AddThreadMessagesResponse.ts | 5 +++++ tests/wire/thread.test.ts | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/api/types/AddThreadMessagesResponse.ts b/src/api/types/AddThreadMessagesResponse.ts index 81b880be..ba83c288 100644 --- a/src/api/types/AddThreadMessagesResponse.ts +++ b/src/api/types/AddThreadMessagesResponse.ts @@ -4,4 +4,5 @@ export interface AddThreadMessagesResponse { context?: string; + messageUuids?: string[]; } diff --git a/src/serialization/types/AddThreadMessagesResponse.ts b/src/serialization/types/AddThreadMessagesResponse.ts index 2ef8717c..7563a684 100644 --- a/src/serialization/types/AddThreadMessagesResponse.ts +++ b/src/serialization/types/AddThreadMessagesResponse.ts @@ -11,10 +11,15 @@ export const AddThreadMessagesResponse: core.serialization.ObjectSchema< Zep.AddThreadMessagesResponse > = core.serialization.object({ context: core.serialization.string().optional(), + messageUuids: core.serialization.property( + "message_uuids", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace AddThreadMessagesResponse { export interface Raw { context?: string | null; + message_uuids?: string[] | null; } } diff --git a/tests/wire/thread.test.ts b/tests/wire/thread.test.ts index 234d61e9..7adf65af 100644 --- a/tests/wire/thread.test.ts +++ b/tests/wire/thread.test.ts @@ -159,7 +159,7 @@ describe("Thread", () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { messages: [{ content: "content", role: "norole" }] }; - const rawResponseBody = { context: "context" }; + const rawResponseBody = { context: "context", message_uuids: ["message_uuids"] }; server .mockEndpoint() .post("/threads/threadId/messages") @@ -179,6 +179,7 @@ describe("Thread", () => { }); expect(response).toEqual({ context: "context", + messageUuids: ["message_uuids"], }); }); @@ -186,7 +187,7 @@ describe("Thread", () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { messages: [{ content: "content", role: "norole" }] }; - const rawResponseBody = { context: "context" }; + const rawResponseBody = { context: "context", message_uuids: ["message_uuids"] }; server .mockEndpoint() .post("/threads/threadId/messages-batch") @@ -206,6 +207,7 @@ describe("Thread", () => { }); expect(response).toEqual({ context: "context", + messageUuids: ["message_uuids"], }); }); }); From c6db84d83196498d7d6951ded49c4c750b5f34bf Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Fri, 15 Aug 2025 22:57:02 -0400 Subject: [PATCH 20/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 93b941d6..b6ad056f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.4.0", + "version": "3.4.1", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From ab961a1cbf22f041016ff66bd6210da7d1092399 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Sat, 16 Aug 2025 02:59:20 +0000 Subject: [PATCH 21/59] SDK regeneration --- reference.md | 4 ++-- src/Client.ts | 4 ++-- src/api/resources/thread/client/Client.ts | 4 ++-- src/api/types/AddThreadMessagesRequest.ts | 2 +- src/api/types/ThreadContextResponse.ts | 2 +- src/version.ts | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/reference.md b/reference.md index 6521e56a..44625afa 100644 --- a/reference.md +++ b/reference.md @@ -990,7 +990,7 @@ await client.thread.delete("threadId");
-Returns most relevant context for a given thread. +Returns most relevant context from the user graph (including memory from any/all past threads) based on the content of the past few messages of the given thread.
@@ -1022,7 +1022,7 @@ await client.thread.getUserContext("threadId");
-**threadId:** `string` — The ID of the thread for which to retrieve context. +**threadId:** `string` — The ID of the current thread (for which context is being retrieved).
diff --git a/src/Client.ts b/src/Client.ts index fef78a5e..eb58293a 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -45,8 +45,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.4.0", - "User-Agent": "zep-cloud/3.4.0", + "X-Fern-SDK-Version": "3.4.1", + "User-Agent": "zep-cloud/3.4.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/thread/client/Client.ts b/src/api/resources/thread/client/Client.ts index 129cf83a..1e2c43de 100644 --- a/src/api/resources/thread/client/Client.ts +++ b/src/api/resources/thread/client/Client.ts @@ -377,9 +377,9 @@ export class Thread { } /** - * Returns most relevant context for a given thread. + * Returns most relevant context from the user graph (including memory from any/all past threads) based on the content of the past few messages of the given thread. * - * @param {string} threadId - The ID of the thread for which to retrieve context. + * @param {string} threadId - The ID of the current thread (for which context is being retrieved). * @param {Zep.ThreadGetUserContextRequest} request * @param {Thread.RequestOptions} requestOptions - Request-specific configuration. * diff --git a/src/api/types/AddThreadMessagesRequest.ts b/src/api/types/AddThreadMessagesRequest.ts index 5d7919d1..5a3a3d80 100644 --- a/src/api/types/AddThreadMessagesRequest.ts +++ b/src/api/types/AddThreadMessagesRequest.ts @@ -13,6 +13,6 @@ export interface AddThreadMessagesRequest { ignoreRoles?: Zep.RoleType[]; /** A list of message objects, where each message contains a role and content. */ messages: Zep.Message[]; - /** Optionally return memory context relevant to the most recent messages. */ + /** Optionally return context block relevant to the most recent messages. */ returnContext?: boolean; } diff --git a/src/api/types/ThreadContextResponse.ts b/src/api/types/ThreadContextResponse.ts index 1abc5c7f..838d258b 100644 --- a/src/api/types/ThreadContextResponse.ts +++ b/src/api/types/ThreadContextResponse.ts @@ -3,6 +3,6 @@ */ export interface ThreadContextResponse { - /** Memory context containing relevant facts and entities for the session. Can be put into the prompt directly. */ + /** Context block containing relevant facts, entities, and messages/episodes from the user graph. Meant to be replaced in the system prompt on every chat turn. */ context?: string; } diff --git a/src/version.ts b/src/version.ts index c3fa33c1..1f47391d 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.4.0"; +export const SDK_VERSION = "3.4.1"; From 6d1167ec56e3eeeee2888f9d5b3cd3a615663e86 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Fri, 3 Oct 2025 11:42:43 -0400 Subject: [PATCH 22/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b6ad056f..858691a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.4.1", + "version": "3.5.0", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From 625cc0b80b9f4154948562a90633a0cc7d802bd8 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:46:44 +0000 Subject: [PATCH 23/59] SDK regeneration --- reference.md | 63 +++++++++++++++ src/Client.ts | 4 +- src/api/resources/user/client/Client.ts | 103 ++++++++++++++++++++++++ src/version.ts | 2 +- tests/wire/user.test.ts | 13 +++ 5 files changed, 182 insertions(+), 3 deletions(-) diff --git a/reference.md b/reference.md index 44625afa..e9be508b 100644 --- a/reference.md +++ b/reference.md @@ -1729,6 +1729,69 @@ await client.user.getThreads("userId");
+
client.user.warmUserCache(userId) -> Zep.SuccessResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Hints TurboPuffer to warm cache for this user's graph namespaces for low-latency search + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.user.warmUserCache("userId"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**userId:** `string` — User ID + +
+
+ +
+
+ +**requestOptions:** `User.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Graph Edge
client.graph.edge.getByGraphId(graphId, { ...params }) -> Zep.EntityEdge[] diff --git a/src/Client.ts b/src/Client.ts index eb58293a..8db1a665 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -45,8 +45,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.4.1", - "User-Agent": "zep-cloud/3.4.1", + "X-Fern-SDK-Version": "3.5.0", + "User-Agent": "zep-cloud/3.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/user/client/Client.ts b/src/api/resources/user/client/Client.ts index 77920ae2..05e46547 100644 --- a/src/api/resources/user/client/Client.ts +++ b/src/api/resources/user/client/Client.ts @@ -776,6 +776,109 @@ export class User { } } + /** + * Hints TurboPuffer to warm cache for this user's graph namespaces for low-latency search + * + * @param {string} userId - User ID + * @param {User.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.NotFoundError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.user.warmUserCache("userId") + */ + public warmUserCache( + userId: string, + requestOptions?: User.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__warmUserCache(userId, requestOptions)); + } + + private async __warmUserCache( + userId: string, + requestOptions?: User.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + `users/${encodeURIComponent(userId)}/warm`, + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.SuccessResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 404: + throw new Zep.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /users/{userId}/warm."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + protected async _getCustomAuthorizationHeaders() { const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["ZEP_API_KEY"]; return { Authorization: `Api-Key ${apiKeyValue}` }; diff --git a/src/version.ts b/src/version.ts index 1f47391d..d865a807 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.4.1"; +export const SDK_VERSION = "3.5.0"; diff --git a/tests/wire/user.test.ts b/tests/wire/user.test.ts index 11d4328c..fc64cd3c 100644 --- a/tests/wire/user.test.ts +++ b/tests/wire/user.test.ts @@ -304,4 +304,17 @@ describe("User", () => { }, ]); }); + + test("warmUserCache", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server.mockEndpoint().get("/users/userId/warm").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.user.warmUserCache("userId"); + expect(response).toEqual({ + message: "message", + }); + }); }); From 08c30ced1d3f6f5b5d2e82690fd79d36740ef504 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 16:06:22 +0000 Subject: [PATCH 24/59] SDK regeneration --- reference.md | 6 +++--- src/api/resources/user/client/Client.ts | 13 +++++-------- tests/wire/user.test.ts | 4 ++-- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/reference.md b/reference.md index e9be508b..c30aa335 100644 --- a/reference.md +++ b/reference.md @@ -1729,7 +1729,7 @@ await client.user.getThreads("userId");
-
client.user.warmUserCache(userId) -> Zep.SuccessResponse +
client.user.warm(userId) -> Zep.SuccessResponse
@@ -1741,7 +1741,7 @@ await client.user.getThreads("userId");
-Hints TurboPuffer to warm cache for this user's graph namespaces for low-latency search +Hints Zep to warm a user's graph for low-latency search
@@ -1757,7 +1757,7 @@ Hints TurboPuffer to warm cache for this user's graph namespaces for low-latency
```typescript -await client.user.warmUserCache("userId"); +await client.user.warm("userId"); ```
diff --git a/src/api/resources/user/client/Client.ts b/src/api/resources/user/client/Client.ts index 05e46547..ee1811ca 100644 --- a/src/api/resources/user/client/Client.ts +++ b/src/api/resources/user/client/Client.ts @@ -777,7 +777,7 @@ export class User { } /** - * Hints TurboPuffer to warm cache for this user's graph namespaces for low-latency search + * Hints Zep to warm a user's graph for low-latency search * * @param {string} userId - User ID * @param {User.RequestOptions} requestOptions - Request-specific configuration. @@ -786,16 +786,13 @@ export class User { * @throws {@link Zep.InternalServerError} * * @example - * await client.user.warmUserCache("userId") + * await client.user.warm("userId") */ - public warmUserCache( - userId: string, - requestOptions?: User.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__warmUserCache(userId, requestOptions)); + public warm(userId: string, requestOptions?: User.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__warm(userId, requestOptions)); } - private async __warmUserCache( + private async __warm( userId: string, requestOptions?: User.RequestOptions, ): Promise> { diff --git a/tests/wire/user.test.ts b/tests/wire/user.test.ts index fc64cd3c..46b216f0 100644 --- a/tests/wire/user.test.ts +++ b/tests/wire/user.test.ts @@ -305,14 +305,14 @@ describe("User", () => { ]); }); - test("warmUserCache", async () => { + test("warm", async () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; server.mockEndpoint().get("/users/userId/warm").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.user.warmUserCache("userId"); + const response = await client.user.warm("userId"); expect(response).toEqual({ message: "message", }); From d03df86a93444e71612d6ec8e7a50c42d27854d2 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Mon, 20 Oct 2025 11:43:42 -0400 Subject: [PATCH 25/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 858691a9..e422cbb6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.5.0", + "version": "3.6.0", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From eaa31c79df45d6df23592daf26e3c96a12de42d0 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 15:45:11 +0000 Subject: [PATCH 26/59] SDK regeneration --- src/Client.ts | 4 ++-- src/api/types/EntityEdge.ts | 6 ++++++ src/api/types/EntityNode.ts | 6 ++++++ src/api/types/Episode.ts | 6 ++++++ src/serialization/types/EntityEdge.ts | 2 ++ src/serialization/types/EntityNode.ts | 2 ++ src/serialization/types/Episode.ts | 2 ++ src/version.ts | 2 +- tests/wire/graph.test.ts | 16 ++++++++++++++++ tests/wire/graph/edge.test.ts | 6 ++++++ tests/wire/graph/episode.test.ts | 10 ++++++++++ tests/wire/graph/node.test.ts | 10 ++++++++++ tests/wire/user.test.ts | 2 ++ 13 files changed, 71 insertions(+), 3 deletions(-) diff --git a/src/Client.ts b/src/Client.ts index 8db1a665..ebf339ae 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -45,8 +45,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.5.0", - "User-Agent": "zep-cloud/3.5.0", + "X-Fern-SDK-Version": "3.6.0", + "User-Agent": "zep-cloud/3.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/types/EntityEdge.ts b/src/api/types/EntityEdge.ts index 6dbab644..2b1dd973 100644 --- a/src/api/types/EntityEdge.ts +++ b/src/api/types/EntityEdge.ts @@ -17,6 +17,12 @@ export interface EntityEdge { invalidAt?: string; /** Name of the edge, relation name */ name: string; + /** + * Relevance is an experimental rank-aligned score in [0,1] derived from Score via logit transformation. + * Only populated when using cross_encoder reranker; omitted for other reranker types (e.g., RRF). + */ + relevance?: number; + /** Score is the reranker output: sigmoid-distributed logits [0,1] when using cross_encoder reranker, or RRF ordinal rank when using rrf reranker */ score?: number; /** UUID of the source node */ sourceNodeUuid: string; diff --git a/src/api/types/EntityNode.ts b/src/api/types/EntityNode.ts index 93d9ecbc..afb6243d 100644 --- a/src/api/types/EntityNode.ts +++ b/src/api/types/EntityNode.ts @@ -11,6 +11,12 @@ export interface EntityNode { labels?: string[]; /** Name of the node */ name: string; + /** + * Relevance is an experimental rank-aligned score in [0,1] derived from Score via logit transformation. + * Only populated when using cross_encoder reranker; omitted for other reranker types (e.g., RRF). + */ + relevance?: number; + /** Score is the reranker output: sigmoid-distributed logits [0,1] when using cross_encoder reranker, or RRF ordinal rank when using rrf reranker */ score?: number; /** Regional summary of surrounding edges */ summary: string; diff --git a/src/api/types/Episode.ts b/src/api/types/Episode.ts index db0817eb..70b9ee68 100644 --- a/src/api/types/Episode.ts +++ b/src/api/types/Episode.ts @@ -8,10 +8,16 @@ export interface Episode { content: string; createdAt: string; processed?: boolean; + /** + * Relevance is an experimental rank-aligned score in [0,1] derived from Score via logit transformation. + * Only populated when using cross_encoder reranker; omitted for other reranker types (e.g., RRF). + */ + relevance?: number; /** Optional role, will only be present if the episode was created using memory.add API */ role?: string; /** Optional role_type, will only be present if the episode was created using memory.add API */ roleType?: Zep.RoleType; + /** Score is the reranker output: sigmoid-distributed logits [0,1] when using cross_encoder reranker, or RRF ordinal rank when using rrf reranker */ score?: number; sessionId?: string; source?: Zep.GraphDataType; diff --git a/src/serialization/types/EntityEdge.ts b/src/serialization/types/EntityEdge.ts index e59b3eb5..d1cecad6 100644 --- a/src/serialization/types/EntityEdge.ts +++ b/src/serialization/types/EntityEdge.ts @@ -15,6 +15,7 @@ export const EntityEdge: core.serialization.ObjectSchema { content: "content", created_at: "created_at", processed: true, + relevance: 1.1, role: "role", role_type: "norole", score: 1.1, @@ -114,6 +115,7 @@ describe("Graph", () => { content: "content", createdAt: "created_at", processed: true, + relevance: 1.1, role: "role", roleType: "norole", score: 1.1, @@ -133,6 +135,7 @@ describe("Graph", () => { content: "content", created_at: "created_at", processed: true, + relevance: 1.1, role: "role", role_type: "norole", score: 1.1, @@ -164,6 +167,7 @@ describe("Graph", () => { content: "content", createdAt: "created_at", processed: true, + relevance: 1.1, role: "role", roleType: "norole", score: 1.1, @@ -188,6 +192,7 @@ describe("Graph", () => { fact: "fact", invalid_at: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, source_node_uuid: "source_node_uuid", target_node_uuid: "target_node_uuid", @@ -199,6 +204,7 @@ describe("Graph", () => { created_at: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", @@ -208,6 +214,7 @@ describe("Graph", () => { created_at: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", @@ -238,6 +245,7 @@ describe("Graph", () => { fact: "fact", invalidAt: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, sourceNodeUuid: "source_node_uuid", targetNodeUuid: "target_node_uuid", @@ -251,6 +259,7 @@ describe("Graph", () => { createdAt: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", @@ -262,6 +271,7 @@ describe("Graph", () => { createdAt: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", @@ -391,6 +401,7 @@ describe("Graph", () => { fact: "fact", invalid_at: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, source_node_uuid: "source_node_uuid", target_node_uuid: "target_node_uuid", @@ -403,6 +414,7 @@ describe("Graph", () => { content: "content", created_at: "created_at", processed: true, + relevance: 1.1, role: "role", role_type: "norole", score: 1.1, @@ -418,6 +430,7 @@ describe("Graph", () => { created_at: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", @@ -448,6 +461,7 @@ describe("Graph", () => { fact: "fact", invalidAt: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, sourceNodeUuid: "source_node_uuid", targetNodeUuid: "target_node_uuid", @@ -460,6 +474,7 @@ describe("Graph", () => { content: "content", createdAt: "created_at", processed: true, + relevance: 1.1, role: "role", roleType: "norole", score: 1.1, @@ -477,6 +492,7 @@ describe("Graph", () => { createdAt: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", diff --git a/tests/wire/graph/edge.test.ts b/tests/wire/graph/edge.test.ts index a7b55c0f..f71cff8c 100644 --- a/tests/wire/graph/edge.test.ts +++ b/tests/wire/graph/edge.test.ts @@ -20,6 +20,7 @@ describe("Edge", () => { fact: "fact", invalid_at: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, source_node_uuid: "source_node_uuid", target_node_uuid: "target_node_uuid", @@ -48,6 +49,7 @@ describe("Edge", () => { fact: "fact", invalidAt: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, sourceNodeUuid: "source_node_uuid", targetNodeUuid: "target_node_uuid", @@ -70,6 +72,7 @@ describe("Edge", () => { fact: "fact", invalid_at: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, source_node_uuid: "source_node_uuid", target_node_uuid: "target_node_uuid", @@ -98,6 +101,7 @@ describe("Edge", () => { fact: "fact", invalidAt: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, sourceNodeUuid: "source_node_uuid", targetNodeUuid: "target_node_uuid", @@ -119,6 +123,7 @@ describe("Edge", () => { fact: "fact", invalid_at: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, source_node_uuid: "source_node_uuid", target_node_uuid: "target_node_uuid", @@ -138,6 +143,7 @@ describe("Edge", () => { fact: "fact", invalidAt: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, sourceNodeUuid: "source_node_uuid", targetNodeUuid: "target_node_uuid", diff --git a/tests/wire/graph/episode.test.ts b/tests/wire/graph/episode.test.ts index f208d287..f3c3b008 100644 --- a/tests/wire/graph/episode.test.ts +++ b/tests/wire/graph/episode.test.ts @@ -16,6 +16,7 @@ describe("Episode", () => { content: "content", created_at: "created_at", processed: true, + relevance: 1.1, role: "role", role_type: "norole", score: 1.1, @@ -41,6 +42,7 @@ describe("Episode", () => { content: "content", createdAt: "created_at", processed: true, + relevance: 1.1, role: "role", roleType: "norole", score: 1.1, @@ -63,6 +65,7 @@ describe("Episode", () => { content: "content", created_at: "created_at", processed: true, + relevance: 1.1, role: "role", role_type: "norole", score: 1.1, @@ -88,6 +91,7 @@ describe("Episode", () => { content: "content", createdAt: "created_at", processed: true, + relevance: 1.1, role: "role", roleType: "norole", score: 1.1, @@ -108,6 +112,7 @@ describe("Episode", () => { content: "content", created_at: "created_at", processed: true, + relevance: 1.1, role: "role", role_type: "norole", score: 1.1, @@ -129,6 +134,7 @@ describe("Episode", () => { content: "content", createdAt: "created_at", processed: true, + relevance: 1.1, role: "role", roleType: "norole", score: 1.1, @@ -172,6 +178,7 @@ describe("Episode", () => { fact: "fact", invalid_at: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, source_node_uuid: "source_node_uuid", target_node_uuid: "target_node_uuid", @@ -185,6 +192,7 @@ describe("Episode", () => { created_at: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", @@ -212,6 +220,7 @@ describe("Episode", () => { fact: "fact", invalidAt: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, sourceNodeUuid: "source_node_uuid", targetNodeUuid: "target_node_uuid", @@ -227,6 +236,7 @@ describe("Episode", () => { createdAt: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", diff --git a/tests/wire/graph/node.test.ts b/tests/wire/graph/node.test.ts index b2e9a151..7dc8c640 100644 --- a/tests/wire/graph/node.test.ts +++ b/tests/wire/graph/node.test.ts @@ -17,6 +17,7 @@ describe("Node", () => { created_at: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", @@ -40,6 +41,7 @@ describe("Node", () => { createdAt: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", @@ -57,6 +59,7 @@ describe("Node", () => { created_at: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", @@ -80,6 +83,7 @@ describe("Node", () => { createdAt: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", @@ -100,6 +104,7 @@ describe("Node", () => { fact: "fact", invalid_at: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, source_node_uuid: "source_node_uuid", target_node_uuid: "target_node_uuid", @@ -127,6 +132,7 @@ describe("Node", () => { fact: "fact", invalidAt: "invalid_at", name: "name", + relevance: 1.1, score: 1.1, sourceNodeUuid: "source_node_uuid", targetNodeUuid: "target_node_uuid", @@ -146,6 +152,7 @@ describe("Node", () => { content: "content", created_at: "created_at", processed: true, + relevance: 1.1, role: "role", role_type: "norole", score: 1.1, @@ -171,6 +178,7 @@ describe("Node", () => { content: "content", createdAt: "created_at", processed: true, + relevance: 1.1, role: "role", roleType: "norole", score: 1.1, @@ -192,6 +200,7 @@ describe("Node", () => { created_at: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", @@ -206,6 +215,7 @@ describe("Node", () => { createdAt: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", diff --git a/tests/wire/user.test.ts b/tests/wire/user.test.ts index 46b216f0..31d287cb 100644 --- a/tests/wire/user.test.ts +++ b/tests/wire/user.test.ts @@ -249,6 +249,7 @@ describe("User", () => { created_at: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", @@ -265,6 +266,7 @@ describe("User", () => { createdAt: "created_at", labels: ["labels"], name: "name", + relevance: 1.1, score: 1.1, summary: "summary", uuid: "uuid", From 3fd76e08540f6b5ed44cc40c1fbc4e4877217825 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Tue, 21 Oct 2025 09:42:40 -0400 Subject: [PATCH 27/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e422cbb6..d2500a85 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.6.0", + "version": "3.7.0", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From 3d58d65f1d76b148df811cfdd2914287f16b915d Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 13:58:38 +0000 Subject: [PATCH 28/59] SDK regeneration --- reference.md | 77 +++++++++ src/Client.ts | 4 +- src/api/resources/thread/client/Client.ts | 6 + src/api/resources/thread/index.ts | 1 + src/api/resources/thread/resources/index.ts | 2 + .../thread/resources/message/client/Client.ts | 162 ++++++++++++++++++ .../thread/resources/message/client/index.ts | 2 + .../requests/ModelsThreadMessageUpdate.ts | 15 ++ .../message/client/requests/index.ts | 1 + .../thread/resources/message/index.ts | 1 + src/api/types/Episode.ts | 4 +- src/api/types/Message.ts | 2 + src/serialization/resources/thread/index.ts | 1 + .../resources/thread/resources/index.ts | 2 + .../thread/resources/message/client/index.ts | 1 + .../requests/ModelsThreadMessageUpdate.ts | 20 +++ .../message/client/requests/index.ts | 1 + .../thread/resources/message/index.ts | 1 + src/serialization/types/Episode.ts | 6 +- src/serialization/types/Message.ts | 2 + src/version.ts | 2 +- tests/wire/graph.test.ts | 24 ++- tests/wire/graph/episode.test.ts | 24 ++- tests/wire/graph/node.test.ts | 8 +- tests/wire/thread.test.ts | 4 + tests/wire/thread/message.test.ts | 48 ++++++ 26 files changed, 401 insertions(+), 20 deletions(-) create mode 100644 src/api/resources/thread/resources/index.ts create mode 100644 src/api/resources/thread/resources/message/client/Client.ts create mode 100644 src/api/resources/thread/resources/message/client/index.ts create mode 100644 src/api/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts create mode 100644 src/api/resources/thread/resources/message/client/requests/index.ts create mode 100644 src/api/resources/thread/resources/message/index.ts create mode 100644 src/serialization/resources/thread/resources/index.ts create mode 100644 src/serialization/resources/thread/resources/message/client/index.ts create mode 100644 src/serialization/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts create mode 100644 src/serialization/resources/thread/resources/message/client/requests/index.ts create mode 100644 src/serialization/resources/thread/resources/message/index.ts create mode 100644 tests/wire/thread/message.test.ts diff --git a/reference.md b/reference.md index c30aa335..87659e80 100644 --- a/reference.md +++ b/reference.md @@ -2727,3 +2727,80 @@ await client.graph.node.get("uuid");
+ +## Thread Message + +
client.thread.message.update(messageUuid, { ...params }) -> Zep.Message +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates a message. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.thread.message.update("messageUUID", { + metadata: { + key: "value", + }, +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**messageUuid:** `string` — The UUID of the message. + +
+
+ +
+
+ +**request:** `Zep.thread.ModelsThreadMessageUpdate` + +
+
+ +
+
+ +**requestOptions:** `Message.RequestOptions` + +
+
+
+
+ +
+
+
diff --git a/src/Client.ts b/src/Client.ts index ebf339ae..77dc18c7 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -45,8 +45,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.6.0", - "User-Agent": "zep-cloud/3.6.0", + "X-Fern-SDK-Version": "3.7.0", + "User-Agent": "zep-cloud/3.7.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/thread/client/Client.ts b/src/api/resources/thread/client/Client.ts index 1e2c43de..19448d02 100644 --- a/src/api/resources/thread/client/Client.ts +++ b/src/api/resources/thread/client/Client.ts @@ -8,6 +8,7 @@ import * as Zep from "../../../index.js"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; import * as serializers from "../../../../serialization/index.js"; import * as errors from "../../../../errors/index.js"; +import { Message } from "../resources/message/client/Client.js"; export declare namespace Thread { export interface Options { @@ -34,11 +35,16 @@ export declare namespace Thread { export class Thread { protected readonly _options: Thread.Options; + protected _message: Message | undefined; constructor(_options: Thread.Options = {}) { this._options = _options; } + public get message(): Message { + return (this._message ??= new Message(this._options)); + } + /** * Returns all threads. * diff --git a/src/api/resources/thread/index.ts b/src/api/resources/thread/index.ts index f095e147..31ac50ad 100644 --- a/src/api/resources/thread/index.ts +++ b/src/api/resources/thread/index.ts @@ -1,2 +1,3 @@ export * from "./types/index.js"; export * from "./client/index.js"; +export * from "./resources/index.js"; diff --git a/src/api/resources/thread/resources/index.ts b/src/api/resources/thread/resources/index.ts new file mode 100644 index 00000000..239756d4 --- /dev/null +++ b/src/api/resources/thread/resources/index.ts @@ -0,0 +1,2 @@ +export * as message from "./message/index.js"; +export * from "./message/client/requests/index.js"; diff --git a/src/api/resources/thread/resources/message/client/Client.ts b/src/api/resources/thread/resources/message/client/Client.ts new file mode 100644 index 00000000..a2c756f7 --- /dev/null +++ b/src/api/resources/thread/resources/message/client/Client.ts @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../../../environments.js"; +import * as core from "../../../../../../core/index.js"; +import * as Zep from "../../../../../index.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as errors from "../../../../../../errors/index.js"; + +export declare namespace Message { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + apiKey?: core.Supplier; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } + + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } +} + +export class Message { + protected readonly _options: Message.Options; + + constructor(_options: Message.Options = {}) { + this._options = _options; + } + + /** + * Updates a message. + * + * @param {string} messageUuid - The UUID of the message. + * @param {Zep.thread.ModelsThreadMessageUpdate} request + * @param {Message.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.NotFoundError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.thread.message.update("messageUUID", { + * metadata: { + * "key": "value" + * } + * }) + */ + public update( + messageUuid: string, + request: Zep.thread.ModelsThreadMessageUpdate, + requestOptions?: Message.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__update(messageUuid, request, requestOptions)); + } + + private async __update( + messageUuid: string, + request: Zep.thread.ModelsThreadMessageUpdate, + requestOptions?: Message.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + `messages/${encodeURIComponent(messageUuid)}`, + ), + method: "PATCH", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.thread.ModelsThreadMessageUpdate.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.Message.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 404: + throw new Zep.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling PATCH /messages/{messageUUID}."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + protected async _getCustomAuthorizationHeaders() { + const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["ZEP_API_KEY"]; + return { Authorization: `Api-Key ${apiKeyValue}` }; + } +} diff --git a/src/api/resources/thread/resources/message/client/index.ts b/src/api/resources/thread/resources/message/client/index.ts new file mode 100644 index 00000000..82648c6f --- /dev/null +++ b/src/api/resources/thread/resources/message/client/index.ts @@ -0,0 +1,2 @@ +export {}; +export * from "./requests/index.js"; diff --git a/src/api/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts b/src/api/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts new file mode 100644 index 00000000..eeff97fd --- /dev/null +++ b/src/api/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * metadata: { + * "key": "value" + * } + * } + */ +export interface ModelsThreadMessageUpdate { + metadata: Record; +} diff --git a/src/api/resources/thread/resources/message/client/requests/index.ts b/src/api/resources/thread/resources/message/client/requests/index.ts new file mode 100644 index 00000000..a0a9dd3b --- /dev/null +++ b/src/api/resources/thread/resources/message/client/requests/index.ts @@ -0,0 +1 @@ +export { type ModelsThreadMessageUpdate } from "./ModelsThreadMessageUpdate.js"; diff --git a/src/api/resources/thread/resources/message/index.ts b/src/api/resources/thread/resources/message/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/thread/resources/message/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/types/Episode.ts b/src/api/types/Episode.ts index 70b9ee68..ac59fe49 100644 --- a/src/api/types/Episode.ts +++ b/src/api/types/Episode.ts @@ -7,6 +7,7 @@ import * as Zep from "../index.js"; export interface Episode { content: string; createdAt: string; + metadata?: Record; processed?: boolean; /** * Relevance is an experimental rank-aligned score in [0,1] derived from Score via logit transformation. @@ -19,8 +20,9 @@ export interface Episode { roleType?: Zep.RoleType; /** Score is the reranker output: sigmoid-distributed logits [0,1] when using cross_encoder reranker, or RRF ordinal rank when using rrf reranker */ score?: number; - sessionId?: string; source?: Zep.GraphDataType; sourceDescription?: string; + /** Optional thread ID, will be present if the episode is part of a thread */ + threadId?: string; uuid: string; } diff --git a/src/api/types/Message.ts b/src/api/types/Message.ts index 4f7ae3a1..dedd35ce 100644 --- a/src/api/types/Message.ts +++ b/src/api/types/Message.ts @@ -9,6 +9,8 @@ export interface Message { content: string; /** The timestamp of when the message was created. */ createdAt?: string; + /** The metadata associated with the message. */ + metadata?: Record; /** Customizable name of the sender of the message (e.g., "john", "sales_agent"). */ name?: string; /** Whether the message has been processed. */ diff --git a/src/serialization/resources/thread/index.ts b/src/serialization/resources/thread/index.ts index f095e147..31ac50ad 100644 --- a/src/serialization/resources/thread/index.ts +++ b/src/serialization/resources/thread/index.ts @@ -1,2 +1,3 @@ export * from "./types/index.js"; export * from "./client/index.js"; +export * from "./resources/index.js"; diff --git a/src/serialization/resources/thread/resources/index.ts b/src/serialization/resources/thread/resources/index.ts new file mode 100644 index 00000000..239756d4 --- /dev/null +++ b/src/serialization/resources/thread/resources/index.ts @@ -0,0 +1,2 @@ +export * as message from "./message/index.js"; +export * from "./message/client/requests/index.js"; diff --git a/src/serialization/resources/thread/resources/message/client/index.ts b/src/serialization/resources/thread/resources/message/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/serialization/resources/thread/resources/message/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/serialization/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts b/src/serialization/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts new file mode 100644 index 00000000..a188bc67 --- /dev/null +++ b/src/serialization/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../../../index.js"; +import * as Zep from "../../../../../../../api/index.js"; +import * as core from "../../../../../../../core/index.js"; + +export const ModelsThreadMessageUpdate: core.serialization.Schema< + serializers.thread.ModelsThreadMessageUpdate.Raw, + Zep.thread.ModelsThreadMessageUpdate +> = core.serialization.object({ + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()), +}); + +export declare namespace ModelsThreadMessageUpdate { + export interface Raw { + metadata: Record; + } +} diff --git a/src/serialization/resources/thread/resources/message/client/requests/index.ts b/src/serialization/resources/thread/resources/message/client/requests/index.ts new file mode 100644 index 00000000..3d0cde2a --- /dev/null +++ b/src/serialization/resources/thread/resources/message/client/requests/index.ts @@ -0,0 +1 @@ +export { ModelsThreadMessageUpdate } from "./ModelsThreadMessageUpdate.js"; diff --git a/src/serialization/resources/thread/resources/message/index.ts b/src/serialization/resources/thread/resources/message/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/serialization/resources/thread/resources/message/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/serialization/types/Episode.ts b/src/serialization/types/Episode.ts index 6ccd0bdc..b2d9d58e 100644 --- a/src/serialization/types/Episode.ts +++ b/src/serialization/types/Episode.ts @@ -12,14 +12,15 @@ export const Episode: core.serialization.ObjectSchema | null; processed?: boolean | null; relevance?: number | null; role?: string | null; role_type?: RoleType.Raw | null; score?: number | null; - session_id?: string | null; source?: GraphDataType.Raw | null; source_description?: string | null; + thread_id?: string | null; uuid: string; } } diff --git a/src/serialization/types/Message.ts b/src/serialization/types/Message.ts index 05937bf3..88f8c1e0 100644 --- a/src/serialization/types/Message.ts +++ b/src/serialization/types/Message.ts @@ -11,6 +11,7 @@ export const Message: core.serialization.ObjectSchema | null; name?: string | null; processed?: boolean | null; role: RoleType.Raw; diff --git a/src/version.ts b/src/version.ts index a22de4a8..3388d64b 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.6.0"; +export const SDK_VERSION = "3.7.0"; diff --git a/tests/wire/graph.test.ts b/tests/wire/graph.test.ts index 7e8828dd..4949749e 100644 --- a/tests/wire/graph.test.ts +++ b/tests/wire/graph.test.ts @@ -88,14 +88,15 @@ describe("Graph", () => { const rawResponseBody = { content: "content", created_at: "created_at", + metadata: { key: "value" }, processed: true, relevance: 1.1, role: "role", role_type: "norole", score: 1.1, - session_id: "session_id", source: "text", source_description: "source_description", + thread_id: "thread_id", uuid: "uuid", }; server @@ -114,14 +115,17 @@ describe("Graph", () => { expect(response).toEqual({ content: "content", createdAt: "created_at", + metadata: { + key: "value", + }, processed: true, relevance: 1.1, role: "role", roleType: "norole", score: 1.1, - sessionId: "session_id", source: "text", sourceDescription: "source_description", + threadId: "thread_id", uuid: "uuid", }); }); @@ -134,14 +138,15 @@ describe("Graph", () => { { content: "content", created_at: "created_at", + metadata: { key: "value" }, processed: true, relevance: 1.1, role: "role", role_type: "norole", score: 1.1, - session_id: "session_id", source: "text", source_description: "source_description", + thread_id: "thread_id", uuid: "uuid", }, ]; @@ -166,14 +171,17 @@ describe("Graph", () => { { content: "content", createdAt: "created_at", + metadata: { + key: "value", + }, processed: true, relevance: 1.1, role: "role", roleType: "norole", score: 1.1, - sessionId: "session_id", source: "text", sourceDescription: "source_description", + threadId: "thread_id", uuid: "uuid", }, ]); @@ -413,14 +421,15 @@ describe("Graph", () => { { content: "content", created_at: "created_at", + metadata: { key: "value" }, processed: true, relevance: 1.1, role: "role", role_type: "norole", score: 1.1, - session_id: "session_id", source: "text", source_description: "source_description", + thread_id: "thread_id", uuid: "uuid", }, ], @@ -473,14 +482,17 @@ describe("Graph", () => { { content: "content", createdAt: "created_at", + metadata: { + key: "value", + }, processed: true, relevance: 1.1, role: "role", roleType: "norole", score: 1.1, - sessionId: "session_id", source: "text", sourceDescription: "source_description", + threadId: "thread_id", uuid: "uuid", }, ], diff --git a/tests/wire/graph/episode.test.ts b/tests/wire/graph/episode.test.ts index f3c3b008..fb57bd39 100644 --- a/tests/wire/graph/episode.test.ts +++ b/tests/wire/graph/episode.test.ts @@ -15,14 +15,15 @@ describe("Episode", () => { { content: "content", created_at: "created_at", + metadata: { key: "value" }, processed: true, relevance: 1.1, role: "role", role_type: "norole", score: 1.1, - session_id: "session_id", source: "text", source_description: "source_description", + thread_id: "thread_id", uuid: "uuid", }, ], @@ -41,14 +42,17 @@ describe("Episode", () => { { content: "content", createdAt: "created_at", + metadata: { + key: "value", + }, processed: true, relevance: 1.1, role: "role", roleType: "norole", score: 1.1, - sessionId: "session_id", source: "text", sourceDescription: "source_description", + threadId: "thread_id", uuid: "uuid", }, ], @@ -64,14 +68,15 @@ describe("Episode", () => { { content: "content", created_at: "created_at", + metadata: { key: "value" }, processed: true, relevance: 1.1, role: "role", role_type: "norole", score: 1.1, - session_id: "session_id", source: "text", source_description: "source_description", + thread_id: "thread_id", uuid: "uuid", }, ], @@ -90,14 +95,17 @@ describe("Episode", () => { { content: "content", createdAt: "created_at", + metadata: { + key: "value", + }, processed: true, relevance: 1.1, role: "role", roleType: "norole", score: 1.1, - sessionId: "session_id", source: "text", sourceDescription: "source_description", + threadId: "thread_id", uuid: "uuid", }, ], @@ -111,14 +119,15 @@ describe("Episode", () => { const rawResponseBody = { content: "content", created_at: "created_at", + metadata: { key: "value" }, processed: true, relevance: 1.1, role: "role", role_type: "norole", score: 1.1, - session_id: "session_id", source: "text", source_description: "source_description", + thread_id: "thread_id", uuid: "uuid", }; server @@ -133,14 +142,17 @@ describe("Episode", () => { expect(response).toEqual({ content: "content", createdAt: "created_at", + metadata: { + key: "value", + }, processed: true, relevance: 1.1, role: "role", roleType: "norole", score: 1.1, - sessionId: "session_id", source: "text", sourceDescription: "source_description", + threadId: "thread_id", uuid: "uuid", }); }); diff --git a/tests/wire/graph/node.test.ts b/tests/wire/graph/node.test.ts index 7dc8c640..9c8927a5 100644 --- a/tests/wire/graph/node.test.ts +++ b/tests/wire/graph/node.test.ts @@ -151,14 +151,15 @@ describe("Node", () => { { content: "content", created_at: "created_at", + metadata: { key: "value" }, processed: true, relevance: 1.1, role: "role", role_type: "norole", score: 1.1, - session_id: "session_id", source: "text", source_description: "source_description", + thread_id: "thread_id", uuid: "uuid", }, ], @@ -177,14 +178,17 @@ describe("Node", () => { { content: "content", createdAt: "created_at", + metadata: { + key: "value", + }, processed: true, relevance: 1.1, role: "role", roleType: "norole", score: 1.1, - sessionId: "session_id", source: "text", sourceDescription: "source_description", + threadId: "thread_id", uuid: "uuid", }, ], diff --git a/tests/wire/thread.test.ts b/tests/wire/thread.test.ts index 7adf65af..2321a472 100644 --- a/tests/wire/thread.test.ts +++ b/tests/wire/thread.test.ts @@ -121,6 +121,7 @@ describe("Thread", () => { { content: "content", created_at: "created_at", + metadata: { key: "value" }, name: "name", processed: true, role: "norole", @@ -144,6 +145,9 @@ describe("Thread", () => { { content: "content", createdAt: "created_at", + metadata: { + key: "value", + }, name: "name", processed: true, role: "norole", diff --git a/tests/wire/thread/message.test.ts b/tests/wire/thread/message.test.ts new file mode 100644 index 00000000..0aeb64d0 --- /dev/null +++ b/tests/wire/thread/message.test.ts @@ -0,0 +1,48 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { ZepClient } from "../../../src/Client"; + +describe("Message", () => { + test("update", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { metadata: { key: "value" } }; + const rawResponseBody = { + content: "content", + created_at: "created_at", + metadata: { key: "value" }, + name: "name", + processed: true, + role: "norole", + uuid: "uuid", + }; + server + .mockEndpoint() + .patch("/messages/messageUUID") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.thread.message.update("messageUUID", { + metadata: { + key: "value", + }, + }); + expect(response).toEqual({ + content: "content", + createdAt: "created_at", + metadata: { + key: "value", + }, + name: "name", + processed: true, + role: "norole", + uuid: "uuid", + }); + }); +}); From d295ffda08e915ab25d883a5b58ec1fc33a12d55 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 14:12:56 +0000 Subject: [PATCH 29/59] SDK regeneration --- reference.md | 2 +- .../resources/thread/resources/message/client/Client.ts | 8 ++++---- ...odelsThreadMessageUpdate.ts => ThreadMessageUpdate.ts} | 2 +- .../thread/resources/message/client/requests/index.ts | 2 +- ...odelsThreadMessageUpdate.ts => ThreadMessageUpdate.ts} | 8 ++++---- .../thread/resources/message/client/requests/index.ts | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) rename src/api/resources/thread/resources/message/client/requests/{ModelsThreadMessageUpdate.ts => ThreadMessageUpdate.ts} (82%) rename src/serialization/resources/thread/resources/message/client/requests/{ModelsThreadMessageUpdate.ts => ThreadMessageUpdate.ts} (68%) diff --git a/reference.md b/reference.md index 87659e80..4aadf44a 100644 --- a/reference.md +++ b/reference.md @@ -2786,7 +2786,7 @@ await client.thread.message.update("messageUUID", {
-**request:** `Zep.thread.ModelsThreadMessageUpdate` +**request:** `Zep.thread.ThreadMessageUpdate`
diff --git a/src/api/resources/thread/resources/message/client/Client.ts b/src/api/resources/thread/resources/message/client/Client.ts index a2c756f7..9a6ffb93 100644 --- a/src/api/resources/thread/resources/message/client/Client.ts +++ b/src/api/resources/thread/resources/message/client/Client.ts @@ -43,7 +43,7 @@ export class Message { * Updates a message. * * @param {string} messageUuid - The UUID of the message. - * @param {Zep.thread.ModelsThreadMessageUpdate} request + * @param {Zep.thread.ThreadMessageUpdate} request * @param {Message.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.NotFoundError} @@ -58,7 +58,7 @@ export class Message { */ public update( messageUuid: string, - request: Zep.thread.ModelsThreadMessageUpdate, + request: Zep.thread.ThreadMessageUpdate, requestOptions?: Message.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(messageUuid, request, requestOptions)); @@ -66,7 +66,7 @@ export class Message { private async __update( messageUuid: string, - request: Zep.thread.ModelsThreadMessageUpdate, + request: Zep.thread.ThreadMessageUpdate, requestOptions?: Message.RequestOptions, ): Promise> { const _response = await (this._options.fetcher ?? core.fetcher)({ @@ -84,7 +84,7 @@ export class Message { ), contentType: "application/json", requestType: "json", - body: serializers.thread.ModelsThreadMessageUpdate.jsonOrThrow(request, { + body: serializers.thread.ThreadMessageUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts b/src/api/resources/thread/resources/message/client/requests/ThreadMessageUpdate.ts similarity index 82% rename from src/api/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts rename to src/api/resources/thread/resources/message/client/requests/ThreadMessageUpdate.ts index eeff97fd..c808df6c 100644 --- a/src/api/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts +++ b/src/api/resources/thread/resources/message/client/requests/ThreadMessageUpdate.ts @@ -10,6 +10,6 @@ * } * } */ -export interface ModelsThreadMessageUpdate { +export interface ThreadMessageUpdate { metadata: Record; } diff --git a/src/api/resources/thread/resources/message/client/requests/index.ts b/src/api/resources/thread/resources/message/client/requests/index.ts index a0a9dd3b..aaf91ac4 100644 --- a/src/api/resources/thread/resources/message/client/requests/index.ts +++ b/src/api/resources/thread/resources/message/client/requests/index.ts @@ -1 +1 @@ -export { type ModelsThreadMessageUpdate } from "./ModelsThreadMessageUpdate.js"; +export { type ThreadMessageUpdate } from "./ThreadMessageUpdate.js"; diff --git a/src/serialization/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts b/src/serialization/resources/thread/resources/message/client/requests/ThreadMessageUpdate.ts similarity index 68% rename from src/serialization/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts rename to src/serialization/resources/thread/resources/message/client/requests/ThreadMessageUpdate.ts index a188bc67..30bf09fb 100644 --- a/src/serialization/resources/thread/resources/message/client/requests/ModelsThreadMessageUpdate.ts +++ b/src/serialization/resources/thread/resources/message/client/requests/ThreadMessageUpdate.ts @@ -6,14 +6,14 @@ import * as serializers from "../../../../../../index.js"; import * as Zep from "../../../../../../../api/index.js"; import * as core from "../../../../../../../core/index.js"; -export const ModelsThreadMessageUpdate: core.serialization.Schema< - serializers.thread.ModelsThreadMessageUpdate.Raw, - Zep.thread.ModelsThreadMessageUpdate +export const ThreadMessageUpdate: core.serialization.Schema< + serializers.thread.ThreadMessageUpdate.Raw, + Zep.thread.ThreadMessageUpdate > = core.serialization.object({ metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()), }); -export declare namespace ModelsThreadMessageUpdate { +export declare namespace ThreadMessageUpdate { export interface Raw { metadata: Record; } diff --git a/src/serialization/resources/thread/resources/message/client/requests/index.ts b/src/serialization/resources/thread/resources/message/client/requests/index.ts index 3d0cde2a..5bf4817a 100644 --- a/src/serialization/resources/thread/resources/message/client/requests/index.ts +++ b/src/serialization/resources/thread/resources/message/client/requests/index.ts @@ -1 +1 @@ -export { ModelsThreadMessageUpdate } from "./ModelsThreadMessageUpdate.js"; +export { ThreadMessageUpdate } from "./ThreadMessageUpdate.js"; From eea448b76d2ffb7a968f6ed324cb2705bad13ed6 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Tue, 21 Oct 2025 12:51:20 -0400 Subject: [PATCH 30/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d2500a85..cc0ef01c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.7.0", + "version": "3.8.0", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From 62cbf65d439539cc3b4db26aa53e3c4e580bdebc Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 16:54:25 +0000 Subject: [PATCH 31/59] SDK regeneration --- reference.md | 185 +++++--- src/Client.ts | 10 +- src/api/errors/index.ts | 2 +- src/api/resources/graph/client/Client.ts | 420 ++++++++---------- .../client/requests/EntityTypeRequest.ts | 16 - .../requests/GraphListEntityTypesRequest.ts | 18 - .../requests/GraphSetOntologyRequest.ts | 18 + .../resources/graph/client/requests/index.ts | 3 +- src/api/resources/index.ts | 1 + src/api/resources/project/client/Client.ts | 156 +++++++ src/api/resources/project/client/index.ts | 1 + src/api/resources/project/index.ts | 1 + src/api/types/ApidataProjectInfoResponse.ts | 9 + src/api/types/ProjectInfo.ts | 10 + src/api/types/index.ts | 2 + .../client/requests/EntityTypeRequest.ts | 32 -- .../requests/GraphSetOntologyRequest.ts | 26 ++ .../resources/graph/client/requests/index.ts | 2 +- .../types/ApidataProjectInfoResponse.ts | 21 + src/serialization/types/ProjectInfo.ts | 24 + src/serialization/types/index.ts | 2 + src/version.ts | 2 +- tests/wire/graph.test.ts | 156 +++---- tests/wire/project.test.ts | 28 ++ 24 files changed, 697 insertions(+), 448 deletions(-) delete mode 100644 src/api/resources/graph/client/requests/EntityTypeRequest.ts delete mode 100644 src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts create mode 100644 src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts create mode 100644 src/api/resources/project/client/Client.ts create mode 100644 src/api/resources/project/client/index.ts create mode 100644 src/api/resources/project/index.ts create mode 100644 src/api/types/ApidataProjectInfoResponse.ts create mode 100644 src/api/types/ProjectInfo.ts delete mode 100644 src/serialization/resources/graph/client/requests/EntityTypeRequest.ts create mode 100644 src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts create mode 100644 src/serialization/types/ApidataProjectInfoResponse.ts create mode 100644 src/serialization/types/ProjectInfo.ts create mode 100644 tests/wire/project.test.ts diff --git a/reference.md b/reference.md index 4aadf44a..0f3fddba 100644 --- a/reference.md +++ b/reference.md @@ -2,7 +2,7 @@ ## Graph -
client.graph.listEntityTypes({ ...params }) -> Zep.EntityTypeResponse +
client.graph.add({ ...params }) -> Zep.Episode
@@ -14,7 +14,7 @@
-Returns all entity types for a project, user, or graph. +Add data to the graph.
@@ -30,7 +30,10 @@ Returns all entity types for a project, user, or graph.
```typescript -await client.graph.listEntityTypes(); +await client.graph.add({ + data: "data", + type: "text", +}); ```
@@ -46,7 +49,7 @@ await client.graph.listEntityTypes();
-**request:** `Zep.GraphListEntityTypesRequest` +**request:** `Zep.AddDataRequest`
@@ -65,7 +68,7 @@ await client.graph.listEntityTypes();
-
client.graph.setEntityTypesInternal({ ...params }) -> Zep.SuccessResponse +
client.graph.addBatch({ ...params }) -> Zep.Episode[]
@@ -77,7 +80,7 @@ await client.graph.listEntityTypes();
-Sets the entity types for multiple users and graphs, replacing any existing ones. +Add data to the graph in batch mode, processing episodes concurrently. Use only for data that is insensitive to processing order.
@@ -93,7 +96,14 @@ Sets the entity types for multiple users and graphs, replacing any existing ones
```typescript -await client.graph.setEntityTypesInternal(); +await client.graph.addBatch({ + episodes: [ + { + data: "data", + type: "text", + }, + ], +}); ```
@@ -109,7 +119,7 @@ await client.graph.setEntityTypesInternal();
-**request:** `Zep.EntityTypeRequest` +**request:** `Zep.AddDataBatchRequest`
@@ -128,7 +138,7 @@ await client.graph.setEntityTypesInternal();
-
client.graph.add({ ...params }) -> Zep.Episode +
client.graph.addFactTriple({ ...params }) -> Zep.AddTripleResponse
@@ -140,7 +150,7 @@ await client.graph.setEntityTypesInternal();
-Add data to the graph. +Add a fact triple for a user or group
@@ -156,9 +166,10 @@ Add data to the graph.
```typescript -await client.graph.add({ - data: "data", - type: "text", +await client.graph.addFactTriple({ + fact: "fact", + factName: "fact_name", + targetNodeName: "target_node_name", }); ``` @@ -175,7 +186,7 @@ await client.graph.add({
-**request:** `Zep.AddDataRequest` +**request:** `Zep.AddTripleRequest`
@@ -194,7 +205,7 @@ await client.graph.add({
-
client.graph.addBatch({ ...params }) -> Zep.Episode[] +
client.graph.clone({ ...params }) -> Zep.CloneGraphResponse
@@ -206,7 +217,7 @@ await client.graph.add({
-Add data to the graph in batch mode, processing episodes concurrently. Use only for data that is insensitive to processing order. +Clone a user or group graph.
@@ -222,14 +233,7 @@ Add data to the graph in batch mode, processing episodes concurrently. Use only
```typescript -await client.graph.addBatch({ - episodes: [ - { - data: "data", - type: "text", - }, - ], -}); +await client.graph.clone(); ```
@@ -245,7 +249,7 @@ await client.graph.addBatch({
-**request:** `Zep.AddDataBatchRequest` +**request:** `Zep.CloneGraphRequest`
@@ -264,7 +268,7 @@ await client.graph.addBatch({
-
client.graph.addFactTriple({ ...params }) -> Zep.AddTripleResponse +
client.graph.create({ ...params }) -> Zep.Graph
@@ -276,7 +280,7 @@ await client.graph.addBatch({
-Add a fact triple for a user or group +Creates a new graph.
@@ -292,10 +296,8 @@ Add a fact triple for a user or group
```typescript -await client.graph.addFactTriple({ - fact: "fact", - factName: "fact_name", - targetNodeName: "target_node_name", +await client.graph.create({ + graphId: "graph_id", }); ``` @@ -312,7 +314,7 @@ await client.graph.addFactTriple({
-**request:** `Zep.AddTripleRequest` +**request:** `Zep.CreateGraphRequest`
@@ -331,7 +333,7 @@ await client.graph.addFactTriple({
-
client.graph.clone({ ...params }) -> Zep.CloneGraphResponse +
client.graph.listAll({ ...params }) -> Zep.GraphListResponse
@@ -343,7 +345,7 @@ await client.graph.addFactTriple({
-Clone a user or group graph. +Returns all graphs. In order to list users, use user.list_ordered instead
@@ -359,7 +361,7 @@ Clone a user or group graph.
```typescript -await client.graph.clone(); +await client.graph.listAll(); ```
@@ -375,7 +377,7 @@ await client.graph.clone();
-**request:** `Zep.CloneGraphRequest` +**request:** `Zep.GraphListAllRequest`
@@ -394,7 +396,7 @@ await client.graph.clone();
-
client.graph.create({ ...params }) -> Zep.Graph +
client.graph.search({ ...params }) -> Zep.GraphSearchResults
@@ -406,7 +408,7 @@ await client.graph.clone();
-Creates a new graph. +Perform a graph search query.
@@ -422,8 +424,8 @@ Creates a new graph.
```typescript -await client.graph.create({ - graphId: "graph_id", +await client.graph.search({ + query: "query", }); ``` @@ -440,7 +442,7 @@ await client.graph.create({
-**request:** `Zep.CreateGraphRequest` +**request:** `Zep.GraphSearchQuery`
@@ -459,7 +461,7 @@ await client.graph.create({
-
client.graph.listAll({ ...params }) -> Zep.GraphListResponse +
client.graph.get(graphId) -> Zep.Graph
@@ -471,7 +473,7 @@ await client.graph.create({
-Returns all graphs. In order to list users, use user.list_ordered instead +Returns a graph.
@@ -487,7 +489,7 @@ Returns all graphs. In order to list users, use user.list_ordered instead
```typescript -await client.graph.listAll(); +await client.graph.get("graphId"); ```
@@ -503,7 +505,7 @@ await client.graph.listAll();
-**request:** `Zep.GraphListAllRequest` +**graphId:** `string` — The graph_id of the graph to get.
@@ -522,7 +524,7 @@ await client.graph.listAll();
-
client.graph.search({ ...params }) -> Zep.GraphSearchResults +
client.graph.delete(graphId) -> Zep.SuccessResponse
@@ -534,7 +536,7 @@ await client.graph.listAll();
-Perform a graph search query. +Deletes a graph. If you would like to delete a user graph, make sure to use user.delete instead.
@@ -550,9 +552,7 @@ Perform a graph search query.
```typescript -await client.graph.search({ - query: "query", -}); +await client.graph.delete("graphId"); ```
@@ -568,7 +568,7 @@ await client.graph.search({
-**request:** `Zep.GraphSearchQuery` +**graphId:** `string` — Graph ID
@@ -587,7 +587,7 @@ await client.graph.search({
-
client.graph.get(graphId) -> Zep.Graph +
client.graph.update(graphId, { ...params }) -> Zep.Graph
@@ -599,7 +599,7 @@ await client.graph.search({
-Returns a graph. +Updates information about a graph.
@@ -615,7 +615,7 @@ Returns a graph.
```typescript -await client.graph.get("graphId"); +await client.graph.update("graphId"); ```
@@ -631,7 +631,15 @@ await client.graph.get("graphId");
-**graphId:** `string` — The graph_id of the graph to get. +**graphId:** `string` — Graph ID + +
+
+ +
+
+ +**request:** `Zep.UpdateGraphRequest`
@@ -650,7 +658,7 @@ await client.graph.get("graphId");
-
client.graph.delete(graphId) -> Zep.SuccessResponse +
client.graph.setOntology({ ...params }) -> Zep.SuccessResponse
@@ -662,7 +670,11 @@ await client.graph.get("graphId");
-Deletes a graph. If you would like to delete a user graph, make sure to use user.delete instead. +Sets custom entity and edge types for your graph. This wrapper method +provides a clean interface for defining your graph schema with custom +entity and edge types. + +See the [full documentation](/customizing-graph-structure#setting-entity-and-edge-types) for details.
@@ -678,7 +690,7 @@ Deletes a graph. If you would like to delete a user graph, make sure to use user
```typescript -await client.graph.delete("graphId"); +await client.graph.setOntology(); ```
@@ -694,7 +706,7 @@ await client.graph.delete("graphId");
-**graphId:** `string` — Graph ID +**request:** `Zep.GraphSetOntologyRequest`
@@ -713,7 +725,7 @@ await client.graph.delete("graphId");
-
client.graph.update(graphId, { ...params }) -> Zep.Graph +
client.graph.listOntology() -> Zep.EntityTypeResponse
@@ -725,7 +737,9 @@ await client.graph.delete("graphId");
-Updates information about a graph. +Retrieves the current entity and edge types configured for your graph. + +See the [full documentation](/customizing-graph-structure) for details.
@@ -741,7 +755,7 @@ Updates information about a graph.
```typescript -await client.graph.update("graphId"); +await client.graph.listOntology(); ```
@@ -757,23 +771,64 @@ await client.graph.update("graphId");
-**graphId:** `string` — Graph ID +**requestOptions:** `Graph.RequestOptions`
+ +
+ + + +
+ +## Project +
client.project.get() -> Zep.ApidataProjectInfoResponse
-**request:** `Zep.UpdateGraphRequest` +#### 📝 Description + +
+
+ +
+
+ +Retrieve project info based on the provided api key. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.project.get(); +```
+
+
+ +#### ⚙️ Parameters
-**requestOptions:** `Graph.RequestOptions` +
+
+ +**requestOptions:** `Project.RequestOptions`
diff --git a/src/Client.ts b/src/Client.ts index 77dc18c7..a67b0e78 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -6,6 +6,7 @@ import * as environments from "./environments.js"; import * as core from "./core/index.js"; import { mergeHeaders } from "./core/headers.js"; import { Graph } from "./api/resources/graph/client/Client.js"; +import { Project } from "./api/resources/project/client/Client.js"; import { Thread } from "./api/resources/thread/client/Client.js"; import { User } from "./api/resources/user/client/Client.js"; @@ -35,6 +36,7 @@ export declare namespace ZepClient { export class ZepClient { protected readonly _options: ZepClient.Options; protected _graph: Graph | undefined; + protected _project: Project | undefined; protected _thread: Thread | undefined; protected _user: User | undefined; @@ -45,8 +47,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.7.0", - "User-Agent": "zep-cloud/3.7.0", + "X-Fern-SDK-Version": "3.8.0", + "User-Agent": "zep-cloud/3.8.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -59,6 +61,10 @@ export class ZepClient { return (this._graph ??= new Graph(this._options)); } + public get project(): Project { + return (this._project ??= new Project(this._options)); + } + public get thread(): Thread { return (this._thread ??= new Thread(this._options)); } diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts index 70ff361a..bea874f4 100644 --- a/src/api/errors/index.ts +++ b/src/api/errors/index.ts @@ -1,3 +1,3 @@ export * from "./BadRequestError.js"; -export * from "./NotFoundError.js"; export * from "./InternalServerError.js"; +export * from "./NotFoundError.js"; diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index 43dff1a3..e43443a7 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -57,241 +57,6 @@ export class Graph { return (this._node ??= new Node(this._options)); } - /** - * Returns all entity types for a project, user, or graph. - * - * @param {Zep.GraphListEntityTypesRequest} request - * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Zep.BadRequestError} - * @throws {@link Zep.NotFoundError} - * @throws {@link Zep.InternalServerError} - * - * @example - * await client.graph.listEntityTypes() - */ - public listEntityTypes( - request: Zep.GraphListEntityTypesRequest = {}, - requestOptions?: Graph.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__listEntityTypes(request, requestOptions)); - } - - private async __listEntityTypes( - request: Zep.GraphListEntityTypesRequest = {}, - requestOptions?: Graph.RequestOptions, - ): Promise> { - const { userId, graphId } = request; - const _queryParams: Record = {}; - if (userId != null) { - _queryParams["user_id"] = userId; - } - - if (graphId != null) { - _queryParams["graph_id"] = graphId; - } - - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.ZepEnvironment.Default, - "entity-types", - ), - method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return { - data: serializers.EntityTypeResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Zep.BadRequestError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 404: - throw new Zep.NotFoundError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 500: - throw new Zep.InternalServerError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - default: - throw new errors.ZepError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.ZepError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /entity-types."); - case "unknown": - throw new errors.ZepError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - - /** - * Sets the entity types for multiple users and graphs, replacing any existing ones. - * - * @param {Zep.EntityTypeRequest} request - * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Zep.BadRequestError} - * @throws {@link Zep.InternalServerError} - * - * @example - * await client.graph.setEntityTypesInternal() - */ - public setEntityTypesInternal( - request: Zep.EntityTypeRequest = {}, - requestOptions?: Graph.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__setEntityTypesInternal(request, requestOptions)); - } - - private async __setEntityTypesInternal( - request: Zep.EntityTypeRequest = {}, - requestOptions?: Graph.RequestOptions, - ): Promise> { - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.ZepEnvironment.Default, - "entity-types", - ), - method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), - requestOptions?.headers, - ), - contentType: "application/json", - requestType: "json", - body: serializers.EntityTypeRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return { - data: serializers.SuccessResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Zep.BadRequestError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 500: - throw new Zep.InternalServerError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - default: - throw new errors.ZepError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.ZepError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.ZepTimeoutError("Timeout exceeded when calling PUT /entity-types."); - case "unknown": - throw new errors.ZepError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - /** * Add data to the graph. * @@ -1415,6 +1180,191 @@ export class Graph { } } + /** + * Sets custom entity and edge types for your graph. This wrapper method + * provides a clean interface for defining your graph schema with custom + * entity and edge types. + * + * See the [full documentation](/customizing-graph-structure#setting-entity-and-edge-types) for details. + * + * @param {Zep.GraphSetOntologyRequest} request + * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.graph.setOntology() + */ + public setOntology( + request: Zep.GraphSetOntologyRequest = {}, + requestOptions?: Graph.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__setOntology(request, requestOptions)); + } + + private async __setOntology( + request: Zep.GraphSetOntologyRequest = {}, + requestOptions?: Graph.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + "graph/set-ontology", + ), + method: "PUT", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.GraphSetOntologyRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.SuccessResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling PUT /graph/set-ontology."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Retrieves the current entity and edge types configured for your graph. + * + * See the [full documentation](/customizing-graph-structure) for details. + * + * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.NotFoundError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.graph.listOntology() + */ + public listOntology(requestOptions?: Graph.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__listOntology(requestOptions)); + } + + private async __listOntology( + requestOptions?: Graph.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + "graph/list-ontology", + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.EntityTypeResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 404: + throw new Zep.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /graph/list-ontology."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + protected async _getCustomAuthorizationHeaders() { const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["ZEP_API_KEY"]; return { Authorization: `Api-Key ${apiKeyValue}` }; diff --git a/src/api/resources/graph/client/requests/EntityTypeRequest.ts b/src/api/resources/graph/client/requests/EntityTypeRequest.ts deleted file mode 100644 index 261dfb2a..00000000 --- a/src/api/resources/graph/client/requests/EntityTypeRequest.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Zep from "../../../../index.js"; - -/** - * @example - * {} - */ -export interface EntityTypeRequest { - edgeTypes?: Zep.EdgeType[]; - entityTypes?: Zep.EntityType[]; - graphIds?: string[]; - userIds?: string[]; -} diff --git a/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts b/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts deleted file mode 100644 index 8fb0fdc2..00000000 --- a/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * @example - * {} - */ -export interface GraphListEntityTypesRequest { - /** - * User ID to get user-specific entity types - */ - userId?: string; - /** - * Graph ID to get graph-specific entity types - */ - graphId?: string; -} diff --git a/src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts b/src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts new file mode 100644 index 00000000..0e237eaa --- /dev/null +++ b/src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface GraphSetOntologyRequest { + /** Dictionary mapping entity type names to their definitions */ + entities?: Record; + /** Dictionary mapping edge type names to their definitions with source/target constraints */ + edges?: Record; + /** Optional list of user IDs to apply ontology to */ + userIds?: string[]; + /** Optional list of graph IDs to apply ontology to */ + graphIds?: string[]; +} diff --git a/src/api/resources/graph/client/requests/index.ts b/src/api/resources/graph/client/requests/index.ts index 54bc4fac..cc82a3e9 100644 --- a/src/api/resources/graph/client/requests/index.ts +++ b/src/api/resources/graph/client/requests/index.ts @@ -1,5 +1,3 @@ -export { type GraphListEntityTypesRequest } from "./GraphListEntityTypesRequest.js"; -export { type EntityTypeRequest } from "./EntityTypeRequest.js"; export { type AddDataRequest } from "./AddDataRequest.js"; export { type AddDataBatchRequest } from "./AddDataBatchRequest.js"; export { type AddTripleRequest } from "./AddTripleRequest.js"; @@ -8,3 +6,4 @@ export { type CreateGraphRequest } from "./CreateGraphRequest.js"; export { type GraphListAllRequest } from "./GraphListAllRequest.js"; export { type GraphSearchQuery } from "./GraphSearchQuery.js"; export { type UpdateGraphRequest } from "./UpdateGraphRequest.js"; +export { type GraphSetOntologyRequest } from "./GraphSetOntologyRequest.js"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 42b0d868..56455802 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,6 +1,7 @@ export * as thread from "./thread/index.js"; export * from "./thread/types/index.js"; export * as graph from "./graph/index.js"; +export * as project from "./project/index.js"; export * as user from "./user/index.js"; export * from "./graph/client/requests/index.js"; export * from "./thread/client/requests/index.js"; diff --git a/src/api/resources/project/client/Client.ts b/src/api/resources/project/client/Client.ts new file mode 100644 index 00000000..0361a0af --- /dev/null +++ b/src/api/resources/project/client/Client.ts @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments.js"; +import * as core from "../../../../core/index.js"; +import * as Zep from "../../../index.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import * as serializers from "../../../../serialization/index.js"; +import * as errors from "../../../../errors/index.js"; + +export declare namespace Project { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + apiKey?: core.Supplier; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } + + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } +} + +export class Project { + protected readonly _options: Project.Options; + + constructor(_options: Project.Options = {}) { + this._options = _options; + } + + /** + * Retrieve project info based on the provided api key. + * + * @param {Project.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.BadRequestError} + * @throws {@link Zep.NotFoundError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.project.get() + */ + public get(requestOptions?: Project.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(requestOptions)); + } + + private async __get( + requestOptions?: Project.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + "projects/info", + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.ApidataProjectInfoResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Zep.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Zep.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /projects/info."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + protected async _getCustomAuthorizationHeaders() { + const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["ZEP_API_KEY"]; + return { Authorization: `Api-Key ${apiKeyValue}` }; + } +} diff --git a/src/api/resources/project/client/index.ts b/src/api/resources/project/client/index.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/src/api/resources/project/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/api/resources/project/index.ts b/src/api/resources/project/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/project/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/types/ApidataProjectInfoResponse.ts b/src/api/types/ApidataProjectInfoResponse.ts new file mode 100644 index 00000000..b5ba66f6 --- /dev/null +++ b/src/api/types/ApidataProjectInfoResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Zep from "../index.js"; + +export interface ApidataProjectInfoResponse { + project?: Zep.ProjectInfo; +} diff --git a/src/api/types/ProjectInfo.ts b/src/api/types/ProjectInfo.ts new file mode 100644 index 00000000..ad7b1822 --- /dev/null +++ b/src/api/types/ProjectInfo.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ProjectInfo { + createdAt?: string; + description?: string; + name?: string; + uuid?: string; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index b6eaecfb..c4d05c63 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -18,6 +18,8 @@ export * from "./EpisodeResponse.js"; export * from "./GraphListResponse.js"; export * from "./GraphNodesRequest.js"; export * from "./GraphSearchResults.js"; +export * from "./ProjectInfo.js"; +export * from "./ApidataProjectInfoResponse.js"; export * from "./RoleType.js"; export * from "./SuccessResponse.js"; export * from "./Thread.js"; diff --git a/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts b/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts deleted file mode 100644 index 9de951ea..00000000 --- a/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../../index.js"; -import * as Zep from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; -import { EdgeType } from "../../../../types/EdgeType.js"; -import { EntityType } from "../../../../types/EntityType.js"; - -export const EntityTypeRequest: core.serialization.Schema = - core.serialization.object({ - edgeTypes: core.serialization.property("edge_types", core.serialization.list(EdgeType).optional()), - entityTypes: core.serialization.property("entity_types", core.serialization.list(EntityType).optional()), - graphIds: core.serialization.property( - "graph_ids", - core.serialization.list(core.serialization.string()).optional(), - ), - userIds: core.serialization.property( - "user_ids", - core.serialization.list(core.serialization.string()).optional(), - ), - }); - -export declare namespace EntityTypeRequest { - export interface Raw { - edge_types?: EdgeType.Raw[] | null; - entity_types?: EntityType.Raw[] | null; - graph_ids?: string[] | null; - user_ids?: string[] | null; - } -} diff --git a/src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts b/src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts new file mode 100644 index 00000000..a4eee424 --- /dev/null +++ b/src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index.js"; +import * as Zep from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; + +export const GraphSetOntologyRequest: core.serialization.Schema< + serializers.GraphSetOntologyRequest.Raw, + Zep.GraphSetOntologyRequest +> = core.serialization.object({ + entities: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + edges: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + userIds: core.serialization.property("user_ids", core.serialization.list(core.serialization.string()).optional()), + graphIds: core.serialization.property("graph_ids", core.serialization.list(core.serialization.string()).optional()), +}); + +export declare namespace GraphSetOntologyRequest { + export interface Raw { + entities?: Record | null; + edges?: Record | null; + user_ids?: string[] | null; + graph_ids?: string[] | null; + } +} diff --git a/src/serialization/resources/graph/client/requests/index.ts b/src/serialization/resources/graph/client/requests/index.ts index c0b93032..759b78d6 100644 --- a/src/serialization/resources/graph/client/requests/index.ts +++ b/src/serialization/resources/graph/client/requests/index.ts @@ -1,4 +1,3 @@ -export { EntityTypeRequest } from "./EntityTypeRequest.js"; export { AddDataRequest } from "./AddDataRequest.js"; export { AddDataBatchRequest } from "./AddDataBatchRequest.js"; export { AddTripleRequest } from "./AddTripleRequest.js"; @@ -6,3 +5,4 @@ export { CloneGraphRequest } from "./CloneGraphRequest.js"; export { CreateGraphRequest } from "./CreateGraphRequest.js"; export { GraphSearchQuery } from "./GraphSearchQuery.js"; export { UpdateGraphRequest } from "./UpdateGraphRequest.js"; +export { GraphSetOntologyRequest } from "./GraphSetOntologyRequest.js"; diff --git a/src/serialization/types/ApidataProjectInfoResponse.ts b/src/serialization/types/ApidataProjectInfoResponse.ts new file mode 100644 index 00000000..d8b138b2 --- /dev/null +++ b/src/serialization/types/ApidataProjectInfoResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { ProjectInfo } from "./ProjectInfo.js"; + +export const ApidataProjectInfoResponse: core.serialization.ObjectSchema< + serializers.ApidataProjectInfoResponse.Raw, + Zep.ApidataProjectInfoResponse +> = core.serialization.object({ + project: ProjectInfo.optional(), +}); + +export declare namespace ApidataProjectInfoResponse { + export interface Raw { + project?: ProjectInfo.Raw | null; + } +} diff --git a/src/serialization/types/ProjectInfo.ts b/src/serialization/types/ProjectInfo.ts new file mode 100644 index 00000000..939c26b7 --- /dev/null +++ b/src/serialization/types/ProjectInfo.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; + +export const ProjectInfo: core.serialization.ObjectSchema = + core.serialization.object({ + createdAt: core.serialization.property("created_at", core.serialization.string().optional()), + description: core.serialization.string().optional(), + name: core.serialization.string().optional(), + uuid: core.serialization.string().optional(), + }); + +export declare namespace ProjectInfo { + export interface Raw { + created_at?: string | null; + description?: string | null; + name?: string | null; + uuid?: string | null; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index b6eaecfb..c4d05c63 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -18,6 +18,8 @@ export * from "./EpisodeResponse.js"; export * from "./GraphListResponse.js"; export * from "./GraphNodesRequest.js"; export * from "./GraphSearchResults.js"; +export * from "./ProjectInfo.js"; +export * from "./ApidataProjectInfoResponse.js"; export * from "./RoleType.js"; export * from "./SuccessResponse.js"; export * from "./Thread.js"; diff --git a/src/version.ts b/src/version.ts index 3388d64b..4b356696 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.7.0"; +export const SDK_VERSION = "3.8.0"; diff --git a/tests/wire/graph.test.ts b/tests/wire/graph.test.ts index 4949749e..ef59166d 100644 --- a/tests/wire/graph.test.ts +++ b/tests/wire/graph.test.ts @@ -6,81 +6,6 @@ import { mockServerPool } from "../mock-server/MockServerPool"; import { ZepClient } from "../../src/Client"; describe("Graph", () => { - test("list_entity_types", async () => { - const server = mockServerPool.createServer(); - const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { - edge_types: [ - { - description: "description", - name: "name", - properties: [{ description: "description", name: "name", type: "Text" }], - source_targets: [{}], - }, - ], - entity_types: [ - { - description: "description", - name: "name", - properties: [{ description: "description", name: "name", type: "Text" }], - }, - ], - }; - server.mockEndpoint().get("/entity-types").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - - const response = await client.graph.listEntityTypes(); - expect(response).toEqual({ - edgeTypes: [ - { - description: "description", - name: "name", - properties: [ - { - description: "description", - name: "name", - type: "Text", - }, - ], - sourceTargets: [{}], - }, - ], - entityTypes: [ - { - description: "description", - name: "name", - properties: [ - { - description: "description", - name: "name", - type: "Text", - }, - ], - }, - ], - }); - }); - - test("set_entity_types_internal", async () => { - const server = mockServerPool.createServer(); - const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = {}; - const rawResponseBody = { message: "message" }; - server - .mockEndpoint() - .put("/entity-types") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.graph.setEntityTypesInternal(); - expect(response).toEqual({ - message: "message", - }); - }); - test("add", async () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); @@ -610,4 +535,85 @@ describe("Graph", () => { uuid: "uuid", }); }); + + test("set_ontology", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .put("/graph/set-ontology") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.graph.setOntology(); + expect(response).toEqual({ + message: "message", + }); + }); + + test("list_ontology", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + edge_types: [ + { + description: "description", + name: "name", + properties: [{ description: "description", name: "name", type: "Text" }], + source_targets: [{}], + }, + ], + entity_types: [ + { + description: "description", + name: "name", + properties: [{ description: "description", name: "name", type: "Text" }], + }, + ], + }; + server + .mockEndpoint() + .get("/graph/list-ontology") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.graph.listOntology(); + expect(response).toEqual({ + edgeTypes: [ + { + description: "description", + name: "name", + properties: [ + { + description: "description", + name: "name", + type: "Text", + }, + ], + sourceTargets: [{}], + }, + ], + entityTypes: [ + { + description: "description", + name: "name", + properties: [ + { + description: "description", + name: "name", + type: "Text", + }, + ], + }, + ], + }); + }); }); diff --git a/tests/wire/project.test.ts b/tests/wire/project.test.ts new file mode 100644 index 00000000..b98d4fb5 --- /dev/null +++ b/tests/wire/project.test.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import { mockServerPool } from "../mock-server/MockServerPool"; +import { ZepClient } from "../../src/Client"; + +describe("Project", () => { + test("get", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + project: { created_at: "created_at", description: "description", name: "name", uuid: "uuid" }, + }; + server.mockEndpoint().get("/projects/info").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.project.get(); + expect(response).toEqual({ + project: { + createdAt: "created_at", + description: "description", + name: "name", + uuid: "uuid", + }, + }); + }); +}); From 82f1bc34396ca3cbe6b89c50ce510dc474d4cc40 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 17:53:14 +0000 Subject: [PATCH 32/59] SDK regeneration --- reference.md | 124 ------------ src/api/resources/graph/client/Client.ts | 185 ------------------ .../requests/GraphSetOntologyRequest.ts | 18 -- .../resources/graph/client/requests/index.ts | 1 - src/api/types/EdgeType.ts | 12 -- src/api/types/EntityEdgeSourceTarget.ts | 10 - src/api/types/EntityProperty.ts | 11 -- src/api/types/EntityPropertyType.ts | 11 -- src/api/types/EntityType.ts | 11 -- src/api/types/EntityTypeResponse.ts | 10 - src/api/types/index.ts | 6 - .../requests/GraphSetOntologyRequest.ts | 26 --- .../resources/graph/client/requests/index.ts | 1 - src/serialization/types/EdgeType.ts | 29 --- .../types/EntityEdgeSourceTarget.ts | 22 --- src/serialization/types/EntityProperty.ts | 23 --- src/serialization/types/EntityPropertyType.ts | 14 -- src/serialization/types/EntityType.ts | 23 --- src/serialization/types/EntityTypeResponse.ts | 24 --- src/serialization/types/index.ts | 6 - tests/wire/graph.test.ts | 81 -------- 21 files changed, 648 deletions(-) delete mode 100644 src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts delete mode 100644 src/api/types/EdgeType.ts delete mode 100644 src/api/types/EntityEdgeSourceTarget.ts delete mode 100644 src/api/types/EntityProperty.ts delete mode 100644 src/api/types/EntityPropertyType.ts delete mode 100644 src/api/types/EntityType.ts delete mode 100644 src/api/types/EntityTypeResponse.ts delete mode 100644 src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts delete mode 100644 src/serialization/types/EdgeType.ts delete mode 100644 src/serialization/types/EntityEdgeSourceTarget.ts delete mode 100644 src/serialization/types/EntityProperty.ts delete mode 100644 src/serialization/types/EntityPropertyType.ts delete mode 100644 src/serialization/types/EntityType.ts delete mode 100644 src/serialization/types/EntityTypeResponse.ts diff --git a/reference.md b/reference.md index 0f3fddba..cdff45b1 100644 --- a/reference.md +++ b/reference.md @@ -658,130 +658,6 @@ await client.graph.update("graphId");
-
client.graph.setOntology({ ...params }) -> Zep.SuccessResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Sets custom entity and edge types for your graph. This wrapper method -provides a clean interface for defining your graph schema with custom -entity and edge types. - -See the [full documentation](/customizing-graph-structure#setting-entity-and-edge-types) for details. - -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.graph.setOntology(); -``` - -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Zep.GraphSetOntologyRequest` - -
-
- -
-
- -**requestOptions:** `Graph.RequestOptions` - -
-
-
-
- -
-
-
- -
client.graph.listOntology() -> Zep.EntityTypeResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves the current entity and edge types configured for your graph. - -See the [full documentation](/customizing-graph-structure) for details. - -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.graph.listOntology(); -``` - -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**requestOptions:** `Graph.RequestOptions` - -
-
-
-
- -
-
-
- ## Project
client.project.get() -> Zep.ApidataProjectInfoResponse diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index e43443a7..322cf171 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -1180,191 +1180,6 @@ export class Graph { } } - /** - * Sets custom entity and edge types for your graph. This wrapper method - * provides a clean interface for defining your graph schema with custom - * entity and edge types. - * - * See the [full documentation](/customizing-graph-structure#setting-entity-and-edge-types) for details. - * - * @param {Zep.GraphSetOntologyRequest} request - * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.graph.setOntology() - */ - public setOntology( - request: Zep.GraphSetOntologyRequest = {}, - requestOptions?: Graph.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__setOntology(request, requestOptions)); - } - - private async __setOntology( - request: Zep.GraphSetOntologyRequest = {}, - requestOptions?: Graph.RequestOptions, - ): Promise> { - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.ZepEnvironment.Default, - "graph/set-ontology", - ), - method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), - requestOptions?.headers, - ), - contentType: "application/json", - requestType: "json", - body: serializers.GraphSetOntologyRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return { - data: serializers.SuccessResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.ZepError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.ZepError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.ZepTimeoutError("Timeout exceeded when calling PUT /graph/set-ontology."); - case "unknown": - throw new errors.ZepError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - - /** - * Retrieves the current entity and edge types configured for your graph. - * - * See the [full documentation](/customizing-graph-structure) for details. - * - * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Zep.NotFoundError} - * @throws {@link Zep.InternalServerError} - * - * @example - * await client.graph.listOntology() - */ - public listOntology(requestOptions?: Graph.RequestOptions): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__listOntology(requestOptions)); - } - - private async __listOntology( - requestOptions?: Graph.RequestOptions, - ): Promise> { - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.ZepEnvironment.Default, - "graph/list-ontology", - ), - method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return { - data: serializers.EntityTypeResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 404: - throw new Zep.NotFoundError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 500: - throw new Zep.InternalServerError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - default: - throw new errors.ZepError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.ZepError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /graph/list-ontology."); - case "unknown": - throw new errors.ZepError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - protected async _getCustomAuthorizationHeaders() { const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["ZEP_API_KEY"]; return { Authorization: `Api-Key ${apiKeyValue}` }; diff --git a/src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts b/src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts deleted file mode 100644 index 0e237eaa..00000000 --- a/src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * @example - * {} - */ -export interface GraphSetOntologyRequest { - /** Dictionary mapping entity type names to their definitions */ - entities?: Record; - /** Dictionary mapping edge type names to their definitions with source/target constraints */ - edges?: Record; - /** Optional list of user IDs to apply ontology to */ - userIds?: string[]; - /** Optional list of graph IDs to apply ontology to */ - graphIds?: string[]; -} diff --git a/src/api/resources/graph/client/requests/index.ts b/src/api/resources/graph/client/requests/index.ts index cc82a3e9..6ce52238 100644 --- a/src/api/resources/graph/client/requests/index.ts +++ b/src/api/resources/graph/client/requests/index.ts @@ -6,4 +6,3 @@ export { type CreateGraphRequest } from "./CreateGraphRequest.js"; export { type GraphListAllRequest } from "./GraphListAllRequest.js"; export { type GraphSearchQuery } from "./GraphSearchQuery.js"; export { type UpdateGraphRequest } from "./UpdateGraphRequest.js"; -export { type GraphSetOntologyRequest } from "./GraphSetOntologyRequest.js"; diff --git a/src/api/types/EdgeType.ts b/src/api/types/EdgeType.ts deleted file mode 100644 index 21e328d6..00000000 --- a/src/api/types/EdgeType.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Zep from "../index.js"; - -export interface EdgeType { - description: string; - name: string; - properties?: Zep.EntityProperty[]; - sourceTargets?: Zep.EntityEdgeSourceTarget[]; -} diff --git a/src/api/types/EntityEdgeSourceTarget.ts b/src/api/types/EntityEdgeSourceTarget.ts deleted file mode 100644 index a2bd3062..00000000 --- a/src/api/types/EntityEdgeSourceTarget.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface EntityEdgeSourceTarget { - /** Source represents the originating node identifier in the edge type relationship. (optional) */ - source?: string; - /** Target represents the target node identifier in the edge type relationship. (optional) */ - target?: string; -} diff --git a/src/api/types/EntityProperty.ts b/src/api/types/EntityProperty.ts deleted file mode 100644 index d0c17d32..00000000 --- a/src/api/types/EntityProperty.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Zep from "../index.js"; - -export interface EntityProperty { - description: string; - name: string; - type: Zep.EntityPropertyType; -} diff --git a/src/api/types/EntityPropertyType.ts b/src/api/types/EntityPropertyType.ts deleted file mode 100644 index b7df34aa..00000000 --- a/src/api/types/EntityPropertyType.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export type EntityPropertyType = "Text" | "Int" | "Float" | "Boolean"; -export const EntityPropertyType = { - Text: "Text", - Int: "Int", - Float: "Float", - Boolean: "Boolean", -} as const; diff --git a/src/api/types/EntityType.ts b/src/api/types/EntityType.ts deleted file mode 100644 index 64dafc5c..00000000 --- a/src/api/types/EntityType.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Zep from "../index.js"; - -export interface EntityType { - description: string; - name: string; - properties?: Zep.EntityProperty[]; -} diff --git a/src/api/types/EntityTypeResponse.ts b/src/api/types/EntityTypeResponse.ts deleted file mode 100644 index d162abc8..00000000 --- a/src/api/types/EntityTypeResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Zep from "../index.js"; - -export interface EntityTypeResponse { - edgeTypes?: Zep.EdgeType[]; - entityTypes?: Zep.EntityType[]; -} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index c4d05c63..3fe4001a 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -2,11 +2,6 @@ export * from "./ApiError.js"; export * from "./AddThreadMessagesRequest.js"; export * from "./AddThreadMessagesResponse.js"; export * from "./CloneGraphResponse.js"; -export * from "./EdgeType.js"; -export * from "./EntityEdgeSourceTarget.js"; -export * from "./EntityProperty.js"; -export * from "./EntityType.js"; -export * from "./EntityTypeResponse.js"; export * from "./EpisodeData.js"; export * from "./EpisodeMentions.js"; export * from "./FactRatingExamples.js"; @@ -38,7 +33,6 @@ export * from "./EntityNode.js"; export * from "./GraphSearchScope.js"; export * from "./Reranker.js"; export * from "./SearchFilters.js"; -export * from "./EntityPropertyType.js"; export * from "./ModelsFactRatingExamples.js"; export * from "./ModelsFactRatingInstruction.js"; export * from "./GraphDataType.js"; diff --git a/src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts b/src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts deleted file mode 100644 index a4eee424..00000000 --- a/src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../../index.js"; -import * as Zep from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; - -export const GraphSetOntologyRequest: core.serialization.Schema< - serializers.GraphSetOntologyRequest.Raw, - Zep.GraphSetOntologyRequest -> = core.serialization.object({ - entities: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - edges: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - userIds: core.serialization.property("user_ids", core.serialization.list(core.serialization.string()).optional()), - graphIds: core.serialization.property("graph_ids", core.serialization.list(core.serialization.string()).optional()), -}); - -export declare namespace GraphSetOntologyRequest { - export interface Raw { - entities?: Record | null; - edges?: Record | null; - user_ids?: string[] | null; - graph_ids?: string[] | null; - } -} diff --git a/src/serialization/resources/graph/client/requests/index.ts b/src/serialization/resources/graph/client/requests/index.ts index 759b78d6..f02c812e 100644 --- a/src/serialization/resources/graph/client/requests/index.ts +++ b/src/serialization/resources/graph/client/requests/index.ts @@ -5,4 +5,3 @@ export { CloneGraphRequest } from "./CloneGraphRequest.js"; export { CreateGraphRequest } from "./CreateGraphRequest.js"; export { GraphSearchQuery } from "./GraphSearchQuery.js"; export { UpdateGraphRequest } from "./UpdateGraphRequest.js"; -export { GraphSetOntologyRequest } from "./GraphSetOntologyRequest.js"; diff --git a/src/serialization/types/EdgeType.ts b/src/serialization/types/EdgeType.ts deleted file mode 100644 index f16d3d1d..00000000 --- a/src/serialization/types/EdgeType.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Zep from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { EntityProperty } from "./EntityProperty.js"; -import { EntityEdgeSourceTarget } from "./EntityEdgeSourceTarget.js"; - -export const EdgeType: core.serialization.ObjectSchema = - core.serialization.object({ - description: core.serialization.string(), - name: core.serialization.string(), - properties: core.serialization.list(EntityProperty).optional(), - sourceTargets: core.serialization.property( - "source_targets", - core.serialization.list(EntityEdgeSourceTarget).optional(), - ), - }); - -export declare namespace EdgeType { - export interface Raw { - description: string; - name: string; - properties?: EntityProperty.Raw[] | null; - source_targets?: EntityEdgeSourceTarget.Raw[] | null; - } -} diff --git a/src/serialization/types/EntityEdgeSourceTarget.ts b/src/serialization/types/EntityEdgeSourceTarget.ts deleted file mode 100644 index 7f4c7a80..00000000 --- a/src/serialization/types/EntityEdgeSourceTarget.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Zep from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const EntityEdgeSourceTarget: core.serialization.ObjectSchema< - serializers.EntityEdgeSourceTarget.Raw, - Zep.EntityEdgeSourceTarget -> = core.serialization.object({ - source: core.serialization.string().optional(), - target: core.serialization.string().optional(), -}); - -export declare namespace EntityEdgeSourceTarget { - export interface Raw { - source?: string | null; - target?: string | null; - } -} diff --git a/src/serialization/types/EntityProperty.ts b/src/serialization/types/EntityProperty.ts deleted file mode 100644 index ea82eca0..00000000 --- a/src/serialization/types/EntityProperty.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Zep from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { EntityPropertyType } from "./EntityPropertyType.js"; - -export const EntityProperty: core.serialization.ObjectSchema = - core.serialization.object({ - description: core.serialization.string(), - name: core.serialization.string(), - type: EntityPropertyType, - }); - -export declare namespace EntityProperty { - export interface Raw { - description: string; - name: string; - type: EntityPropertyType.Raw; - } -} diff --git a/src/serialization/types/EntityPropertyType.ts b/src/serialization/types/EntityPropertyType.ts deleted file mode 100644 index 6c306450..00000000 --- a/src/serialization/types/EntityPropertyType.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Zep from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const EntityPropertyType: core.serialization.Schema = - core.serialization.enum_(["Text", "Int", "Float", "Boolean"]); - -export declare namespace EntityPropertyType { - export type Raw = "Text" | "Int" | "Float" | "Boolean"; -} diff --git a/src/serialization/types/EntityType.ts b/src/serialization/types/EntityType.ts deleted file mode 100644 index 031debea..00000000 --- a/src/serialization/types/EntityType.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Zep from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { EntityProperty } from "./EntityProperty.js"; - -export const EntityType: core.serialization.ObjectSchema = - core.serialization.object({ - description: core.serialization.string(), - name: core.serialization.string(), - properties: core.serialization.list(EntityProperty).optional(), - }); - -export declare namespace EntityType { - export interface Raw { - description: string; - name: string; - properties?: EntityProperty.Raw[] | null; - } -} diff --git a/src/serialization/types/EntityTypeResponse.ts b/src/serialization/types/EntityTypeResponse.ts deleted file mode 100644 index ef99965f..00000000 --- a/src/serialization/types/EntityTypeResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Zep from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { EdgeType } from "./EdgeType.js"; -import { EntityType } from "./EntityType.js"; - -export const EntityTypeResponse: core.serialization.ObjectSchema< - serializers.EntityTypeResponse.Raw, - Zep.EntityTypeResponse -> = core.serialization.object({ - edgeTypes: core.serialization.property("edge_types", core.serialization.list(EdgeType).optional()), - entityTypes: core.serialization.property("entity_types", core.serialization.list(EntityType).optional()), -}); - -export declare namespace EntityTypeResponse { - export interface Raw { - edge_types?: EdgeType.Raw[] | null; - entity_types?: EntityType.Raw[] | null; - } -} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index c4d05c63..3fe4001a 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -2,11 +2,6 @@ export * from "./ApiError.js"; export * from "./AddThreadMessagesRequest.js"; export * from "./AddThreadMessagesResponse.js"; export * from "./CloneGraphResponse.js"; -export * from "./EdgeType.js"; -export * from "./EntityEdgeSourceTarget.js"; -export * from "./EntityProperty.js"; -export * from "./EntityType.js"; -export * from "./EntityTypeResponse.js"; export * from "./EpisodeData.js"; export * from "./EpisodeMentions.js"; export * from "./FactRatingExamples.js"; @@ -38,7 +33,6 @@ export * from "./EntityNode.js"; export * from "./GraphSearchScope.js"; export * from "./Reranker.js"; export * from "./SearchFilters.js"; -export * from "./EntityPropertyType.js"; export * from "./ModelsFactRatingExamples.js"; export * from "./ModelsFactRatingInstruction.js"; export * from "./GraphDataType.js"; diff --git a/tests/wire/graph.test.ts b/tests/wire/graph.test.ts index ef59166d..ec6530c5 100644 --- a/tests/wire/graph.test.ts +++ b/tests/wire/graph.test.ts @@ -535,85 +535,4 @@ describe("Graph", () => { uuid: "uuid", }); }); - - test("set_ontology", async () => { - const server = mockServerPool.createServer(); - const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = {}; - const rawResponseBody = { message: "message" }; - server - .mockEndpoint() - .put("/graph/set-ontology") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.graph.setOntology(); - expect(response).toEqual({ - message: "message", - }); - }); - - test("list_ontology", async () => { - const server = mockServerPool.createServer(); - const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { - edge_types: [ - { - description: "description", - name: "name", - properties: [{ description: "description", name: "name", type: "Text" }], - source_targets: [{}], - }, - ], - entity_types: [ - { - description: "description", - name: "name", - properties: [{ description: "description", name: "name", type: "Text" }], - }, - ], - }; - server - .mockEndpoint() - .get("/graph/list-ontology") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.graph.listOntology(); - expect(response).toEqual({ - edgeTypes: [ - { - description: "description", - name: "name", - properties: [ - { - description: "description", - name: "name", - type: "Text", - }, - ], - sourceTargets: [{}], - }, - ], - entityTypes: [ - { - description: "description", - name: "name", - properties: [ - { - description: "description", - name: "name", - type: "Text", - }, - ], - }, - ], - }); - }); }); From 0689a6ba59a1f647e10b8d84ef0790c84b327f18 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 18:01:49 +0000 Subject: [PATCH 33/59] SDK regeneration --- reference.md | 126 ++++++++++ src/api/errors/index.ts | 2 +- src/api/resources/graph/client/Client.ts | 235 ++++++++++++++++++ .../client/requests/EntityTypeRequest.ts | 16 ++ .../requests/GraphListEntityTypesRequest.ts | 18 ++ .../resources/graph/client/requests/index.ts | 2 + src/api/types/EdgeType.ts | 12 + src/api/types/EntityEdgeSourceTarget.ts | 10 + src/api/types/EntityProperty.ts | 11 + src/api/types/EntityPropertyType.ts | 11 + src/api/types/EntityType.ts | 11 + src/api/types/EntityTypeResponse.ts | 10 + src/api/types/index.ts | 6 + .../client/requests/EntityTypeRequest.ts | 32 +++ .../resources/graph/client/requests/index.ts | 1 + src/serialization/types/EdgeType.ts | 29 +++ .../types/EntityEdgeSourceTarget.ts | 22 ++ src/serialization/types/EntityProperty.ts | 23 ++ src/serialization/types/EntityPropertyType.ts | 14 ++ src/serialization/types/EntityType.ts | 23 ++ src/serialization/types/EntityTypeResponse.ts | 24 ++ src/serialization/types/index.ts | 6 + tests/wire/graph.test.ts | 75 ++++++ 23 files changed, 718 insertions(+), 1 deletion(-) create mode 100644 src/api/resources/graph/client/requests/EntityTypeRequest.ts create mode 100644 src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts create mode 100644 src/api/types/EdgeType.ts create mode 100644 src/api/types/EntityEdgeSourceTarget.ts create mode 100644 src/api/types/EntityProperty.ts create mode 100644 src/api/types/EntityPropertyType.ts create mode 100644 src/api/types/EntityType.ts create mode 100644 src/api/types/EntityTypeResponse.ts create mode 100644 src/serialization/resources/graph/client/requests/EntityTypeRequest.ts create mode 100644 src/serialization/types/EdgeType.ts create mode 100644 src/serialization/types/EntityEdgeSourceTarget.ts create mode 100644 src/serialization/types/EntityProperty.ts create mode 100644 src/serialization/types/EntityPropertyType.ts create mode 100644 src/serialization/types/EntityType.ts create mode 100644 src/serialization/types/EntityTypeResponse.ts diff --git a/reference.md b/reference.md index cdff45b1..ed33a0a7 100644 --- a/reference.md +++ b/reference.md @@ -2,6 +2,132 @@ ## Graph +
client.graph.listEntityTypes({ ...params }) -> Zep.EntityTypeResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns all entity types for a project, user, or graph. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.graph.listEntityTypes(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Zep.GraphListEntityTypesRequest` + +
+
+ +
+
+ +**requestOptions:** `Graph.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.graph.setEntityTypesInternal({ ...params }) -> Zep.SuccessResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Sets the entity types for multiple users and graphs, replacing any existing ones. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.graph.setEntityTypesInternal(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Zep.EntityTypeRequest` + +
+
+ +
+
+ +**requestOptions:** `Graph.RequestOptions` + +
+
+
+
+ +
+
+
+
client.graph.add({ ...params }) -> Zep.Episode
diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts index bea874f4..70ff361a 100644 --- a/src/api/errors/index.ts +++ b/src/api/errors/index.ts @@ -1,3 +1,3 @@ export * from "./BadRequestError.js"; -export * from "./InternalServerError.js"; export * from "./NotFoundError.js"; +export * from "./InternalServerError.js"; diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index 322cf171..43dff1a3 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -57,6 +57,241 @@ export class Graph { return (this._node ??= new Node(this._options)); } + /** + * Returns all entity types for a project, user, or graph. + * + * @param {Zep.GraphListEntityTypesRequest} request + * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.BadRequestError} + * @throws {@link Zep.NotFoundError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.graph.listEntityTypes() + */ + public listEntityTypes( + request: Zep.GraphListEntityTypesRequest = {}, + requestOptions?: Graph.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__listEntityTypes(request, requestOptions)); + } + + private async __listEntityTypes( + request: Zep.GraphListEntityTypesRequest = {}, + requestOptions?: Graph.RequestOptions, + ): Promise> { + const { userId, graphId } = request; + const _queryParams: Record = {}; + if (userId != null) { + _queryParams["user_id"] = userId; + } + + if (graphId != null) { + _queryParams["graph_id"] = graphId; + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + "entity-types", + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.EntityTypeResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Zep.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Zep.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /entity-types."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Sets the entity types for multiple users and graphs, replacing any existing ones. + * + * @param {Zep.EntityTypeRequest} request + * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.BadRequestError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.graph.setEntityTypesInternal() + */ + public setEntityTypesInternal( + request: Zep.EntityTypeRequest = {}, + requestOptions?: Graph.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__setEntityTypesInternal(request, requestOptions)); + } + + private async __setEntityTypesInternal( + request: Zep.EntityTypeRequest = {}, + requestOptions?: Graph.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + "entity-types", + ), + method: "PUT", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.EntityTypeRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.SuccessResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Zep.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling PUT /entity-types."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + /** * Add data to the graph. * diff --git a/src/api/resources/graph/client/requests/EntityTypeRequest.ts b/src/api/resources/graph/client/requests/EntityTypeRequest.ts new file mode 100644 index 00000000..261dfb2a --- /dev/null +++ b/src/api/resources/graph/client/requests/EntityTypeRequest.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Zep from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface EntityTypeRequest { + edgeTypes?: Zep.EdgeType[]; + entityTypes?: Zep.EntityType[]; + graphIds?: string[]; + userIds?: string[]; +} diff --git a/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts b/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts new file mode 100644 index 00000000..8fb0fdc2 --- /dev/null +++ b/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface GraphListEntityTypesRequest { + /** + * User ID to get user-specific entity types + */ + userId?: string; + /** + * Graph ID to get graph-specific entity types + */ + graphId?: string; +} diff --git a/src/api/resources/graph/client/requests/index.ts b/src/api/resources/graph/client/requests/index.ts index 6ce52238..54bc4fac 100644 --- a/src/api/resources/graph/client/requests/index.ts +++ b/src/api/resources/graph/client/requests/index.ts @@ -1,3 +1,5 @@ +export { type GraphListEntityTypesRequest } from "./GraphListEntityTypesRequest.js"; +export { type EntityTypeRequest } from "./EntityTypeRequest.js"; export { type AddDataRequest } from "./AddDataRequest.js"; export { type AddDataBatchRequest } from "./AddDataBatchRequest.js"; export { type AddTripleRequest } from "./AddTripleRequest.js"; diff --git a/src/api/types/EdgeType.ts b/src/api/types/EdgeType.ts new file mode 100644 index 00000000..21e328d6 --- /dev/null +++ b/src/api/types/EdgeType.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Zep from "../index.js"; + +export interface EdgeType { + description: string; + name: string; + properties?: Zep.EntityProperty[]; + sourceTargets?: Zep.EntityEdgeSourceTarget[]; +} diff --git a/src/api/types/EntityEdgeSourceTarget.ts b/src/api/types/EntityEdgeSourceTarget.ts new file mode 100644 index 00000000..a2bd3062 --- /dev/null +++ b/src/api/types/EntityEdgeSourceTarget.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface EntityEdgeSourceTarget { + /** Source represents the originating node identifier in the edge type relationship. (optional) */ + source?: string; + /** Target represents the target node identifier in the edge type relationship. (optional) */ + target?: string; +} diff --git a/src/api/types/EntityProperty.ts b/src/api/types/EntityProperty.ts new file mode 100644 index 00000000..d0c17d32 --- /dev/null +++ b/src/api/types/EntityProperty.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Zep from "../index.js"; + +export interface EntityProperty { + description: string; + name: string; + type: Zep.EntityPropertyType; +} diff --git a/src/api/types/EntityPropertyType.ts b/src/api/types/EntityPropertyType.ts new file mode 100644 index 00000000..b7df34aa --- /dev/null +++ b/src/api/types/EntityPropertyType.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type EntityPropertyType = "Text" | "Int" | "Float" | "Boolean"; +export const EntityPropertyType = { + Text: "Text", + Int: "Int", + Float: "Float", + Boolean: "Boolean", +} as const; diff --git a/src/api/types/EntityType.ts b/src/api/types/EntityType.ts new file mode 100644 index 00000000..64dafc5c --- /dev/null +++ b/src/api/types/EntityType.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Zep from "../index.js"; + +export interface EntityType { + description: string; + name: string; + properties?: Zep.EntityProperty[]; +} diff --git a/src/api/types/EntityTypeResponse.ts b/src/api/types/EntityTypeResponse.ts new file mode 100644 index 00000000..d162abc8 --- /dev/null +++ b/src/api/types/EntityTypeResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Zep from "../index.js"; + +export interface EntityTypeResponse { + edgeTypes?: Zep.EdgeType[]; + entityTypes?: Zep.EntityType[]; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 3fe4001a..c4d05c63 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -2,6 +2,11 @@ export * from "./ApiError.js"; export * from "./AddThreadMessagesRequest.js"; export * from "./AddThreadMessagesResponse.js"; export * from "./CloneGraphResponse.js"; +export * from "./EdgeType.js"; +export * from "./EntityEdgeSourceTarget.js"; +export * from "./EntityProperty.js"; +export * from "./EntityType.js"; +export * from "./EntityTypeResponse.js"; export * from "./EpisodeData.js"; export * from "./EpisodeMentions.js"; export * from "./FactRatingExamples.js"; @@ -33,6 +38,7 @@ export * from "./EntityNode.js"; export * from "./GraphSearchScope.js"; export * from "./Reranker.js"; export * from "./SearchFilters.js"; +export * from "./EntityPropertyType.js"; export * from "./ModelsFactRatingExamples.js"; export * from "./ModelsFactRatingInstruction.js"; export * from "./GraphDataType.js"; diff --git a/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts b/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts new file mode 100644 index 00000000..9de951ea --- /dev/null +++ b/src/serialization/resources/graph/client/requests/EntityTypeRequest.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index.js"; +import * as Zep from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; +import { EdgeType } from "../../../../types/EdgeType.js"; +import { EntityType } from "../../../../types/EntityType.js"; + +export const EntityTypeRequest: core.serialization.Schema = + core.serialization.object({ + edgeTypes: core.serialization.property("edge_types", core.serialization.list(EdgeType).optional()), + entityTypes: core.serialization.property("entity_types", core.serialization.list(EntityType).optional()), + graphIds: core.serialization.property( + "graph_ids", + core.serialization.list(core.serialization.string()).optional(), + ), + userIds: core.serialization.property( + "user_ids", + core.serialization.list(core.serialization.string()).optional(), + ), + }); + +export declare namespace EntityTypeRequest { + export interface Raw { + edge_types?: EdgeType.Raw[] | null; + entity_types?: EntityType.Raw[] | null; + graph_ids?: string[] | null; + user_ids?: string[] | null; + } +} diff --git a/src/serialization/resources/graph/client/requests/index.ts b/src/serialization/resources/graph/client/requests/index.ts index f02c812e..c0b93032 100644 --- a/src/serialization/resources/graph/client/requests/index.ts +++ b/src/serialization/resources/graph/client/requests/index.ts @@ -1,3 +1,4 @@ +export { EntityTypeRequest } from "./EntityTypeRequest.js"; export { AddDataRequest } from "./AddDataRequest.js"; export { AddDataBatchRequest } from "./AddDataBatchRequest.js"; export { AddTripleRequest } from "./AddTripleRequest.js"; diff --git a/src/serialization/types/EdgeType.ts b/src/serialization/types/EdgeType.ts new file mode 100644 index 00000000..f16d3d1d --- /dev/null +++ b/src/serialization/types/EdgeType.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { EntityProperty } from "./EntityProperty.js"; +import { EntityEdgeSourceTarget } from "./EntityEdgeSourceTarget.js"; + +export const EdgeType: core.serialization.ObjectSchema = + core.serialization.object({ + description: core.serialization.string(), + name: core.serialization.string(), + properties: core.serialization.list(EntityProperty).optional(), + sourceTargets: core.serialization.property( + "source_targets", + core.serialization.list(EntityEdgeSourceTarget).optional(), + ), + }); + +export declare namespace EdgeType { + export interface Raw { + description: string; + name: string; + properties?: EntityProperty.Raw[] | null; + source_targets?: EntityEdgeSourceTarget.Raw[] | null; + } +} diff --git a/src/serialization/types/EntityEdgeSourceTarget.ts b/src/serialization/types/EntityEdgeSourceTarget.ts new file mode 100644 index 00000000..7f4c7a80 --- /dev/null +++ b/src/serialization/types/EntityEdgeSourceTarget.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; + +export const EntityEdgeSourceTarget: core.serialization.ObjectSchema< + serializers.EntityEdgeSourceTarget.Raw, + Zep.EntityEdgeSourceTarget +> = core.serialization.object({ + source: core.serialization.string().optional(), + target: core.serialization.string().optional(), +}); + +export declare namespace EntityEdgeSourceTarget { + export interface Raw { + source?: string | null; + target?: string | null; + } +} diff --git a/src/serialization/types/EntityProperty.ts b/src/serialization/types/EntityProperty.ts new file mode 100644 index 00000000..ea82eca0 --- /dev/null +++ b/src/serialization/types/EntityProperty.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { EntityPropertyType } from "./EntityPropertyType.js"; + +export const EntityProperty: core.serialization.ObjectSchema = + core.serialization.object({ + description: core.serialization.string(), + name: core.serialization.string(), + type: EntityPropertyType, + }); + +export declare namespace EntityProperty { + export interface Raw { + description: string; + name: string; + type: EntityPropertyType.Raw; + } +} diff --git a/src/serialization/types/EntityPropertyType.ts b/src/serialization/types/EntityPropertyType.ts new file mode 100644 index 00000000..6c306450 --- /dev/null +++ b/src/serialization/types/EntityPropertyType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; + +export const EntityPropertyType: core.serialization.Schema = + core.serialization.enum_(["Text", "Int", "Float", "Boolean"]); + +export declare namespace EntityPropertyType { + export type Raw = "Text" | "Int" | "Float" | "Boolean"; +} diff --git a/src/serialization/types/EntityType.ts b/src/serialization/types/EntityType.ts new file mode 100644 index 00000000..031debea --- /dev/null +++ b/src/serialization/types/EntityType.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { EntityProperty } from "./EntityProperty.js"; + +export const EntityType: core.serialization.ObjectSchema = + core.serialization.object({ + description: core.serialization.string(), + name: core.serialization.string(), + properties: core.serialization.list(EntityProperty).optional(), + }); + +export declare namespace EntityType { + export interface Raw { + description: string; + name: string; + properties?: EntityProperty.Raw[] | null; + } +} diff --git a/src/serialization/types/EntityTypeResponse.ts b/src/serialization/types/EntityTypeResponse.ts new file mode 100644 index 00000000..ef99965f --- /dev/null +++ b/src/serialization/types/EntityTypeResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { EdgeType } from "./EdgeType.js"; +import { EntityType } from "./EntityType.js"; + +export const EntityTypeResponse: core.serialization.ObjectSchema< + serializers.EntityTypeResponse.Raw, + Zep.EntityTypeResponse +> = core.serialization.object({ + edgeTypes: core.serialization.property("edge_types", core.serialization.list(EdgeType).optional()), + entityTypes: core.serialization.property("entity_types", core.serialization.list(EntityType).optional()), +}); + +export declare namespace EntityTypeResponse { + export interface Raw { + edge_types?: EdgeType.Raw[] | null; + entity_types?: EntityType.Raw[] | null; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 3fe4001a..c4d05c63 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -2,6 +2,11 @@ export * from "./ApiError.js"; export * from "./AddThreadMessagesRequest.js"; export * from "./AddThreadMessagesResponse.js"; export * from "./CloneGraphResponse.js"; +export * from "./EdgeType.js"; +export * from "./EntityEdgeSourceTarget.js"; +export * from "./EntityProperty.js"; +export * from "./EntityType.js"; +export * from "./EntityTypeResponse.js"; export * from "./EpisodeData.js"; export * from "./EpisodeMentions.js"; export * from "./FactRatingExamples.js"; @@ -33,6 +38,7 @@ export * from "./EntityNode.js"; export * from "./GraphSearchScope.js"; export * from "./Reranker.js"; export * from "./SearchFilters.js"; +export * from "./EntityPropertyType.js"; export * from "./ModelsFactRatingExamples.js"; export * from "./ModelsFactRatingInstruction.js"; export * from "./GraphDataType.js"; diff --git a/tests/wire/graph.test.ts b/tests/wire/graph.test.ts index ec6530c5..4949749e 100644 --- a/tests/wire/graph.test.ts +++ b/tests/wire/graph.test.ts @@ -6,6 +6,81 @@ import { mockServerPool } from "../mock-server/MockServerPool"; import { ZepClient } from "../../src/Client"; describe("Graph", () => { + test("list_entity_types", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + edge_types: [ + { + description: "description", + name: "name", + properties: [{ description: "description", name: "name", type: "Text" }], + source_targets: [{}], + }, + ], + entity_types: [ + { + description: "description", + name: "name", + properties: [{ description: "description", name: "name", type: "Text" }], + }, + ], + }; + server.mockEndpoint().get("/entity-types").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.graph.listEntityTypes(); + expect(response).toEqual({ + edgeTypes: [ + { + description: "description", + name: "name", + properties: [ + { + description: "description", + name: "name", + type: "Text", + }, + ], + sourceTargets: [{}], + }, + ], + entityTypes: [ + { + description: "description", + name: "name", + properties: [ + { + description: "description", + name: "name", + type: "Text", + }, + ], + }, + ], + }); + }); + + test("set_entity_types_internal", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .put("/entity-types") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.graph.setEntityTypesInternal(); + expect(response).toEqual({ + message: "message", + }); + }); + test("add", async () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); From 25a21dd5c26cc992058e684501700018e7b593e8 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 18:07:27 +0000 Subject: [PATCH 34/59] SDK regeneration From ad22d79005b239f567384fdb7677518e9498b1f3 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 18:11:45 +0000 Subject: [PATCH 35/59] SDK regeneration --- reference.md | 124 ++++++++++++ src/api/resources/graph/client/Client.ts | 185 ++++++++++++++++++ .../requests/GraphSetOntologyRequest.ts | 18 ++ .../resources/graph/client/requests/index.ts | 1 + .../requests/GraphSetOntologyRequest.ts | 26 +++ .../resources/graph/client/requests/index.ts | 1 + tests/wire/graph.test.ts | 81 ++++++++ 7 files changed, 436 insertions(+) create mode 100644 src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts create mode 100644 src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts diff --git a/reference.md b/reference.md index ed33a0a7..ed832415 100644 --- a/reference.md +++ b/reference.md @@ -784,6 +784,130 @@ await client.graph.update("graphId");
+
client.graph.setOntology({ ...params }) -> Zep.SuccessResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Sets custom entity and edge types for your graph. This wrapper method +provides a clean interface for defining your graph schema with custom +entity and edge types. + +See the [full documentation](/customizing-graph-structure#setting-entity-and-edge-types) for details. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.graph.setOntology(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Zep.GraphSetOntologyRequest` + +
+
+ +
+
+ +**requestOptions:** `Graph.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.graph.listOntology() -> Zep.EntityTypeResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves the current entity and edge types configured for your graph. + +See the [full documentation](/customizing-graph-structure) for details. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.graph.listOntology(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `Graph.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Project
client.project.get() -> Zep.ApidataProjectInfoResponse diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index 43dff1a3..d7cec3ff 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -1415,6 +1415,191 @@ export class Graph { } } + /** + * Sets custom entity and edge types for your graph. This wrapper method + * provides a clean interface for defining your graph schema with custom + * entity and edge types. + * + * See the [full documentation](/customizing-graph-structure#setting-entity-and-edge-types) for details. + * + * @param {Zep.GraphSetOntologyRequest} request + * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.graph.setOntology() + */ + public setOntology( + request: Zep.GraphSetOntologyRequest = {}, + requestOptions?: Graph.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__setOntology(request, requestOptions)); + } + + private async __setOntology( + request: Zep.GraphSetOntologyRequest = {}, + requestOptions?: Graph.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + "graph/set-ontology", + ), + method: "PUT", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.GraphSetOntologyRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.SuccessResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling PUT /graph/set-ontology."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Retrieves the current entity and edge types configured for your graph. + * + * See the [full documentation](/customizing-graph-structure) for details. + * + * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.NotFoundError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.graph.listOntology() + */ + public listOntology(requestOptions?: Graph.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__listOntology(requestOptions)); + } + + private async __listOntology( + requestOptions?: Graph.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + "graph/list-ontology", + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.EntityTypeResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 404: + throw new Zep.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /graph/list-ontology."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + protected async _getCustomAuthorizationHeaders() { const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["ZEP_API_KEY"]; return { Authorization: `Api-Key ${apiKeyValue}` }; diff --git a/src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts b/src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts new file mode 100644 index 00000000..0e237eaa --- /dev/null +++ b/src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface GraphSetOntologyRequest { + /** Dictionary mapping entity type names to their definitions */ + entities?: Record; + /** Dictionary mapping edge type names to their definitions with source/target constraints */ + edges?: Record; + /** Optional list of user IDs to apply ontology to */ + userIds?: string[]; + /** Optional list of graph IDs to apply ontology to */ + graphIds?: string[]; +} diff --git a/src/api/resources/graph/client/requests/index.ts b/src/api/resources/graph/client/requests/index.ts index 54bc4fac..99ac988b 100644 --- a/src/api/resources/graph/client/requests/index.ts +++ b/src/api/resources/graph/client/requests/index.ts @@ -8,3 +8,4 @@ export { type CreateGraphRequest } from "./CreateGraphRequest.js"; export { type GraphListAllRequest } from "./GraphListAllRequest.js"; export { type GraphSearchQuery } from "./GraphSearchQuery.js"; export { type UpdateGraphRequest } from "./UpdateGraphRequest.js"; +export { type GraphSetOntologyRequest } from "./GraphSetOntologyRequest.js"; diff --git a/src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts b/src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts new file mode 100644 index 00000000..a4eee424 --- /dev/null +++ b/src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index.js"; +import * as Zep from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; + +export const GraphSetOntologyRequest: core.serialization.Schema< + serializers.GraphSetOntologyRequest.Raw, + Zep.GraphSetOntologyRequest +> = core.serialization.object({ + entities: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + edges: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + userIds: core.serialization.property("user_ids", core.serialization.list(core.serialization.string()).optional()), + graphIds: core.serialization.property("graph_ids", core.serialization.list(core.serialization.string()).optional()), +}); + +export declare namespace GraphSetOntologyRequest { + export interface Raw { + entities?: Record | null; + edges?: Record | null; + user_ids?: string[] | null; + graph_ids?: string[] | null; + } +} diff --git a/src/serialization/resources/graph/client/requests/index.ts b/src/serialization/resources/graph/client/requests/index.ts index c0b93032..c9e48dac 100644 --- a/src/serialization/resources/graph/client/requests/index.ts +++ b/src/serialization/resources/graph/client/requests/index.ts @@ -6,3 +6,4 @@ export { CloneGraphRequest } from "./CloneGraphRequest.js"; export { CreateGraphRequest } from "./CreateGraphRequest.js"; export { GraphSearchQuery } from "./GraphSearchQuery.js"; export { UpdateGraphRequest } from "./UpdateGraphRequest.js"; +export { GraphSetOntologyRequest } from "./GraphSetOntologyRequest.js"; diff --git a/tests/wire/graph.test.ts b/tests/wire/graph.test.ts index 4949749e..e0135c74 100644 --- a/tests/wire/graph.test.ts +++ b/tests/wire/graph.test.ts @@ -610,4 +610,85 @@ describe("Graph", () => { uuid: "uuid", }); }); + + test("set_ontology", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .put("/graph/set-ontology") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.graph.setOntology(); + expect(response).toEqual({ + message: "message", + }); + }); + + test("list_ontology", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + edge_types: [ + { + description: "description", + name: "name", + properties: [{ description: "description", name: "name", type: "Text" }], + source_targets: [{}], + }, + ], + entity_types: [ + { + description: "description", + name: "name", + properties: [{ description: "description", name: "name", type: "Text" }], + }, + ], + }; + server + .mockEndpoint() + .get("/graph/list-ontology") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.graph.listOntology(); + expect(response).toEqual({ + edgeTypes: [ + { + description: "description", + name: "name", + properties: [ + { + description: "description", + name: "name", + type: "Text", + }, + ], + sourceTargets: [{}], + }, + ], + entityTypes: [ + { + description: "description", + name: "name", + properties: [ + { + description: "description", + name: "name", + type: "Text", + }, + ], + }, + ], + }); + }); }); From a9b3a668b49178e66db7a37e7423a06464e65148 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 18:14:28 +0000 Subject: [PATCH 36/59] SDK regeneration --- reference.md | 124 ------------ src/api/resources/graph/client/Client.ts | 185 ------------------ .../requests/GraphSetOntologyRequest.ts | 18 -- .../resources/graph/client/requests/index.ts | 1 - .../requests/GraphSetOntologyRequest.ts | 26 --- .../resources/graph/client/requests/index.ts | 1 - tests/wire/graph.test.ts | 81 -------- 7 files changed, 436 deletions(-) delete mode 100644 src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts delete mode 100644 src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts diff --git a/reference.md b/reference.md index ed832415..ed33a0a7 100644 --- a/reference.md +++ b/reference.md @@ -784,130 +784,6 @@ await client.graph.update("graphId");
-
client.graph.setOntology({ ...params }) -> Zep.SuccessResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Sets custom entity and edge types for your graph. This wrapper method -provides a clean interface for defining your graph schema with custom -entity and edge types. - -See the [full documentation](/customizing-graph-structure#setting-entity-and-edge-types) for details. - -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.graph.setOntology(); -``` - -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Zep.GraphSetOntologyRequest` - -
-
- -
-
- -**requestOptions:** `Graph.RequestOptions` - -
-
-
-
- -
-
-
- -
client.graph.listOntology() -> Zep.EntityTypeResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves the current entity and edge types configured for your graph. - -See the [full documentation](/customizing-graph-structure) for details. - -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.graph.listOntology(); -``` - -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**requestOptions:** `Graph.RequestOptions` - -
-
-
-
- -
-
-
- ## Project
client.project.get() -> Zep.ApidataProjectInfoResponse diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index d7cec3ff..43dff1a3 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -1415,191 +1415,6 @@ export class Graph { } } - /** - * Sets custom entity and edge types for your graph. This wrapper method - * provides a clean interface for defining your graph schema with custom - * entity and edge types. - * - * See the [full documentation](/customizing-graph-structure#setting-entity-and-edge-types) for details. - * - * @param {Zep.GraphSetOntologyRequest} request - * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.graph.setOntology() - */ - public setOntology( - request: Zep.GraphSetOntologyRequest = {}, - requestOptions?: Graph.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__setOntology(request, requestOptions)); - } - - private async __setOntology( - request: Zep.GraphSetOntologyRequest = {}, - requestOptions?: Graph.RequestOptions, - ): Promise> { - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.ZepEnvironment.Default, - "graph/set-ontology", - ), - method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), - requestOptions?.headers, - ), - contentType: "application/json", - requestType: "json", - body: serializers.GraphSetOntologyRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return { - data: serializers.SuccessResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.ZepError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.ZepError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.ZepTimeoutError("Timeout exceeded when calling PUT /graph/set-ontology."); - case "unknown": - throw new errors.ZepError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - - /** - * Retrieves the current entity and edge types configured for your graph. - * - * See the [full documentation](/customizing-graph-structure) for details. - * - * @param {Graph.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Zep.NotFoundError} - * @throws {@link Zep.InternalServerError} - * - * @example - * await client.graph.listOntology() - */ - public listOntology(requestOptions?: Graph.RequestOptions): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__listOntology(requestOptions)); - } - - private async __listOntology( - requestOptions?: Graph.RequestOptions, - ): Promise> { - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.ZepEnvironment.Default, - "graph/list-ontology", - ), - method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return { - data: serializers.EntityTypeResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 404: - throw new Zep.NotFoundError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 500: - throw new Zep.InternalServerError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - default: - throw new errors.ZepError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.ZepError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /graph/list-ontology."); - case "unknown": - throw new errors.ZepError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - protected async _getCustomAuthorizationHeaders() { const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["ZEP_API_KEY"]; return { Authorization: `Api-Key ${apiKeyValue}` }; diff --git a/src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts b/src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts deleted file mode 100644 index 0e237eaa..00000000 --- a/src/api/resources/graph/client/requests/GraphSetOntologyRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * @example - * {} - */ -export interface GraphSetOntologyRequest { - /** Dictionary mapping entity type names to their definitions */ - entities?: Record; - /** Dictionary mapping edge type names to their definitions with source/target constraints */ - edges?: Record; - /** Optional list of user IDs to apply ontology to */ - userIds?: string[]; - /** Optional list of graph IDs to apply ontology to */ - graphIds?: string[]; -} diff --git a/src/api/resources/graph/client/requests/index.ts b/src/api/resources/graph/client/requests/index.ts index 99ac988b..54bc4fac 100644 --- a/src/api/resources/graph/client/requests/index.ts +++ b/src/api/resources/graph/client/requests/index.ts @@ -8,4 +8,3 @@ export { type CreateGraphRequest } from "./CreateGraphRequest.js"; export { type GraphListAllRequest } from "./GraphListAllRequest.js"; export { type GraphSearchQuery } from "./GraphSearchQuery.js"; export { type UpdateGraphRequest } from "./UpdateGraphRequest.js"; -export { type GraphSetOntologyRequest } from "./GraphSetOntologyRequest.js"; diff --git a/src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts b/src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts deleted file mode 100644 index a4eee424..00000000 --- a/src/serialization/resources/graph/client/requests/GraphSetOntologyRequest.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../../index.js"; -import * as Zep from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; - -export const GraphSetOntologyRequest: core.serialization.Schema< - serializers.GraphSetOntologyRequest.Raw, - Zep.GraphSetOntologyRequest -> = core.serialization.object({ - entities: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - edges: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - userIds: core.serialization.property("user_ids", core.serialization.list(core.serialization.string()).optional()), - graphIds: core.serialization.property("graph_ids", core.serialization.list(core.serialization.string()).optional()), -}); - -export declare namespace GraphSetOntologyRequest { - export interface Raw { - entities?: Record | null; - edges?: Record | null; - user_ids?: string[] | null; - graph_ids?: string[] | null; - } -} diff --git a/src/serialization/resources/graph/client/requests/index.ts b/src/serialization/resources/graph/client/requests/index.ts index c9e48dac..c0b93032 100644 --- a/src/serialization/resources/graph/client/requests/index.ts +++ b/src/serialization/resources/graph/client/requests/index.ts @@ -6,4 +6,3 @@ export { CloneGraphRequest } from "./CloneGraphRequest.js"; export { CreateGraphRequest } from "./CreateGraphRequest.js"; export { GraphSearchQuery } from "./GraphSearchQuery.js"; export { UpdateGraphRequest } from "./UpdateGraphRequest.js"; -export { GraphSetOntologyRequest } from "./GraphSetOntologyRequest.js"; diff --git a/tests/wire/graph.test.ts b/tests/wire/graph.test.ts index e0135c74..4949749e 100644 --- a/tests/wire/graph.test.ts +++ b/tests/wire/graph.test.ts @@ -610,85 +610,4 @@ describe("Graph", () => { uuid: "uuid", }); }); - - test("set_ontology", async () => { - const server = mockServerPool.createServer(); - const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = {}; - const rawResponseBody = { message: "message" }; - server - .mockEndpoint() - .put("/graph/set-ontology") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.graph.setOntology(); - expect(response).toEqual({ - message: "message", - }); - }); - - test("list_ontology", async () => { - const server = mockServerPool.createServer(); - const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { - edge_types: [ - { - description: "description", - name: "name", - properties: [{ description: "description", name: "name", type: "Text" }], - source_targets: [{}], - }, - ], - entity_types: [ - { - description: "description", - name: "name", - properties: [{ description: "description", name: "name", type: "Text" }], - }, - ], - }; - server - .mockEndpoint() - .get("/graph/list-ontology") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.graph.listOntology(); - expect(response).toEqual({ - edgeTypes: [ - { - description: "description", - name: "name", - properties: [ - { - description: "description", - name: "name", - type: "Text", - }, - ], - sourceTargets: [{}], - }, - ], - entityTypes: [ - { - description: "description", - name: "name", - properties: [ - { - description: "description", - name: "name", - type: "Text", - }, - ], - }, - ], - }); - }); }); From fdc21f3504ee8940fa7816ec60c68287380b9397 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 18:20:22 +0000 Subject: [PATCH 37/59] SDK regeneration --- reference.md | 2 +- src/api/resources/project/client/Client.ts | 6 +++--- ...idataProjectInfoResponse.ts => ProjectInfoResponse.ts} | 2 +- src/api/types/index.ts | 2 +- ...idataProjectInfoResponse.ts => ProjectInfoResponse.ts} | 8 ++++---- src/serialization/types/index.ts | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) rename src/api/types/{ApidataProjectInfoResponse.ts => ProjectInfoResponse.ts} (75%) rename src/serialization/types/{ApidataProjectInfoResponse.ts => ProjectInfoResponse.ts} (65%) diff --git a/reference.md b/reference.md index ed33a0a7..c53a37f7 100644 --- a/reference.md +++ b/reference.md @@ -786,7 +786,7 @@ await client.graph.update("graphId"); ## Project -
client.project.get() -> Zep.ApidataProjectInfoResponse +
client.project.get() -> Zep.ProjectInfoResponse
diff --git a/src/api/resources/project/client/Client.ts b/src/api/resources/project/client/Client.ts index 0361a0af..61be093f 100644 --- a/src/api/resources/project/client/Client.ts +++ b/src/api/resources/project/client/Client.ts @@ -51,13 +51,13 @@ export class Project { * @example * await client.project.get() */ - public get(requestOptions?: Project.RequestOptions): core.HttpResponsePromise { + public get(requestOptions?: Project.RequestOptions): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(requestOptions)); } private async __get( requestOptions?: Project.RequestOptions, - ): Promise> { + ): Promise> { const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -77,7 +77,7 @@ export class Project { }); if (_response.ok) { return { - data: serializers.ApidataProjectInfoResponse.parseOrThrow(_response.body, { + data: serializers.ProjectInfoResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, diff --git a/src/api/types/ApidataProjectInfoResponse.ts b/src/api/types/ProjectInfoResponse.ts similarity index 75% rename from src/api/types/ApidataProjectInfoResponse.ts rename to src/api/types/ProjectInfoResponse.ts index b5ba66f6..47260914 100644 --- a/src/api/types/ApidataProjectInfoResponse.ts +++ b/src/api/types/ProjectInfoResponse.ts @@ -4,6 +4,6 @@ import * as Zep from "../index.js"; -export interface ApidataProjectInfoResponse { +export interface ProjectInfoResponse { project?: Zep.ProjectInfo; } diff --git a/src/api/types/index.ts b/src/api/types/index.ts index c4d05c63..cbbec764 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -19,7 +19,7 @@ export * from "./GraphListResponse.js"; export * from "./GraphNodesRequest.js"; export * from "./GraphSearchResults.js"; export * from "./ProjectInfo.js"; -export * from "./ApidataProjectInfoResponse.js"; +export * from "./ProjectInfoResponse.js"; export * from "./RoleType.js"; export * from "./SuccessResponse.js"; export * from "./Thread.js"; diff --git a/src/serialization/types/ApidataProjectInfoResponse.ts b/src/serialization/types/ProjectInfoResponse.ts similarity index 65% rename from src/serialization/types/ApidataProjectInfoResponse.ts rename to src/serialization/types/ProjectInfoResponse.ts index d8b138b2..a4b4a570 100644 --- a/src/serialization/types/ApidataProjectInfoResponse.ts +++ b/src/serialization/types/ProjectInfoResponse.ts @@ -7,14 +7,14 @@ import * as Zep from "../../api/index.js"; import * as core from "../../core/index.js"; import { ProjectInfo } from "./ProjectInfo.js"; -export const ApidataProjectInfoResponse: core.serialization.ObjectSchema< - serializers.ApidataProjectInfoResponse.Raw, - Zep.ApidataProjectInfoResponse +export const ProjectInfoResponse: core.serialization.ObjectSchema< + serializers.ProjectInfoResponse.Raw, + Zep.ProjectInfoResponse > = core.serialization.object({ project: ProjectInfo.optional(), }); -export declare namespace ApidataProjectInfoResponse { +export declare namespace ProjectInfoResponse { export interface Raw { project?: ProjectInfo.Raw | null; } diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index c4d05c63..cbbec764 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -19,7 +19,7 @@ export * from "./GraphListResponse.js"; export * from "./GraphNodesRequest.js"; export * from "./GraphSearchResults.js"; export * from "./ProjectInfo.js"; -export * from "./ApidataProjectInfoResponse.js"; +export * from "./ProjectInfoResponse.js"; export * from "./RoleType.js"; export * from "./SuccessResponse.js"; export * from "./Thread.js"; From be09141ac5046b83c0b8e22cca920462911089ac Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Thu, 30 Oct 2025 12:22:52 -0400 Subject: [PATCH 38/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cc0ef01c..eaf25e09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.8.0", + "version": "3.9.0", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From ef76ca43f5db1a72dc04c1dc876f0a09a80b9aaa Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 16:28:23 +0000 Subject: [PATCH 39/59] SDK regeneration --- reference.md | 41 +++++++++++++++---- src/Client.ts | 4 +- src/api/resources/graph/client/Client.ts | 10 ++++- .../client/requests/GraphListAllRequest.ts | 5 ++- .../requests/GraphListEntityTypesRequest.ts | 5 ++- .../graph/resources/episode/client/Client.ts | 8 +++- .../requests/EpisodeGetByGraphIdRequest.ts | 4 +- .../requests/EpisodeGetByUserIdRequest.ts | 4 +- src/api/resources/thread/client/Client.ts | 18 ++++++-- .../client/requests/ThreadGetRequest.ts | 6 ++- .../requests/ThreadGetUserContextRequest.ts | 5 ++- .../client/requests/ThreadListAllRequest.ts | 7 +++- src/api/resources/user/client/Client.ts | 5 ++- .../user/client/requests/CreateUserRequest.ts | 2 + .../user/client/requests/UpdateUserRequest.ts | 2 + .../client/requests/UserListOrderedRequest.ts | 5 ++- src/api/types/SearchFilters.ts | 4 ++ src/api/types/User.ts | 1 + .../user/client/requests/CreateUserRequest.ts | 5 +++ .../user/client/requests/UpdateUserRequest.ts | 5 +++ src/serialization/types/SearchFilters.ts | 10 +++++ src/serialization/types/User.ts | 5 +++ src/version.ts | 2 +- tests/wire/graph.test.ts | 10 ++++- tests/wire/graph/episode.test.ts | 8 +++- tests/wire/thread.test.ts | 18 ++++++-- tests/wire/user.test.ts | 13 +++++- 27 files changed, 177 insertions(+), 35 deletions(-) diff --git a/reference.md b/reference.md index c53a37f7..f33a0aa5 100644 --- a/reference.md +++ b/reference.md @@ -30,7 +30,10 @@ Returns all entity types for a project, user, or graph.
```typescript -await client.graph.listEntityTypes(); +await client.graph.listEntityTypes({ + userId: "user_id", + graphId: "graph_id", +}); ```
@@ -487,7 +490,10 @@ Returns all graphs. In order to list users, use user.list_ordered instead
```typescript -await client.graph.listAll(); +await client.graph.listAll({ + pageNumber: 1, + pageSize: 1, +}); ```
@@ -871,7 +877,12 @@ Returns all threads.
```typescript -await client.thread.listAll(); +await client.thread.listAll({ + pageNumber: 1, + pageSize: 1, + orderBy: "order_by", + asc: true, +}); ```
@@ -1063,7 +1074,10 @@ Returns most relevant context from the user graph (including memory from any/all
```typescript -await client.thread.getUserContext("threadId"); +await client.thread.getUserContext("threadId", { + minRating: 1.1, + mode: "basic", +}); ```
@@ -1134,7 +1148,11 @@ Returns messages for a thread.
```typescript -await client.thread.get("threadId"); +await client.thread.get("threadId", { + limit: 1, + cursor: 1, + lastn: 1, +}); ```
@@ -1428,7 +1446,10 @@ Returns all users.
```typescript -await client.user.listOrdered(); +await client.user.listOrdered({ + pageNumber: 1, + pageSize: 1, +}); ```
@@ -2149,7 +2170,9 @@ Returns episodes by graph id.
```typescript -await client.graph.episode.getByGraphId("graph_id"); +await client.graph.episode.getByGraphId("graph_id", { + lastn: 1, +}); ```
@@ -2220,7 +2243,9 @@ Returns episodes by user id.
```typescript -await client.graph.episode.getByUserId("user_id"); +await client.graph.episode.getByUserId("user_id", { + lastn: 1, +}); ```
diff --git a/src/Client.ts b/src/Client.ts index a67b0e78..66b67677 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -47,8 +47,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.8.0", - "User-Agent": "zep-cloud/3.8.0", + "X-Fern-SDK-Version": "3.9.0", + "User-Agent": "zep-cloud/3.9.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index 43dff1a3..07dd45d6 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -68,7 +68,10 @@ export class Graph { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.listEntityTypes() + * await client.graph.listEntityTypes({ + * userId: "user_id", + * graphId: "graph_id" + * }) */ public listEntityTypes( request: Zep.GraphListEntityTypesRequest = {}, @@ -861,7 +864,10 @@ export class Graph { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.listAll() + * await client.graph.listAll({ + * pageNumber: 1, + * pageSize: 1 + * }) */ public listAll( request: Zep.GraphListAllRequest = {}, diff --git a/src/api/resources/graph/client/requests/GraphListAllRequest.ts b/src/api/resources/graph/client/requests/GraphListAllRequest.ts index 791d5043..479ab286 100644 --- a/src/api/resources/graph/client/requests/GraphListAllRequest.ts +++ b/src/api/resources/graph/client/requests/GraphListAllRequest.ts @@ -4,7 +4,10 @@ /** * @example - * {} + * { + * pageNumber: 1, + * pageSize: 1 + * } */ export interface GraphListAllRequest { /** diff --git a/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts b/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts index 8fb0fdc2..6d00f137 100644 --- a/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts +++ b/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts @@ -4,7 +4,10 @@ /** * @example - * {} + * { + * userId: "user_id", + * graphId: "graph_id" + * } */ export interface GraphListEntityTypesRequest { /** diff --git a/src/api/resources/graph/resources/episode/client/Client.ts b/src/api/resources/graph/resources/episode/client/Client.ts index 54372ddf..635e650f 100644 --- a/src/api/resources/graph/resources/episode/client/Client.ts +++ b/src/api/resources/graph/resources/episode/client/Client.ts @@ -50,7 +50,9 @@ export class Episode { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.episode.getByGraphId("graph_id") + * await client.graph.episode.getByGraphId("graph_id", { + * lastn: 1 + * }) */ public getByGraphId( graphId: string, @@ -163,7 +165,9 @@ export class Episode { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.episode.getByUserId("user_id") + * await client.graph.episode.getByUserId("user_id", { + * lastn: 1 + * }) */ public getByUserId( userId: string, diff --git a/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.ts b/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.ts index caecc192..72918505 100644 --- a/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.ts +++ b/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.ts @@ -4,7 +4,9 @@ /** * @example - * {} + * { + * lastn: 1 + * } */ export interface EpisodeGetByGraphIdRequest { /** diff --git a/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.ts b/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.ts index 8b9290a6..3787ecb0 100644 --- a/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.ts +++ b/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.ts @@ -4,7 +4,9 @@ /** * @example - * {} + * { + * lastn: 1 + * } */ export interface EpisodeGetByUserIdRequest { /** diff --git a/src/api/resources/thread/client/Client.ts b/src/api/resources/thread/client/Client.ts index 19448d02..f1bfd4fb 100644 --- a/src/api/resources/thread/client/Client.ts +++ b/src/api/resources/thread/client/Client.ts @@ -55,7 +55,12 @@ export class Thread { * @throws {@link Zep.InternalServerError} * * @example - * await client.thread.listAll() + * await client.thread.listAll({ + * pageNumber: 1, + * pageSize: 1, + * orderBy: "order_by", + * asc: true + * }) */ public listAll( request: Zep.ThreadListAllRequest = {}, @@ -393,7 +398,10 @@ export class Thread { * @throws {@link Zep.InternalServerError} * * @example - * await client.thread.getUserContext("threadId") + * await client.thread.getUserContext("threadId", { + * minRating: 1.1, + * mode: "basic" + * }) */ public getUserContext( threadId: string, @@ -513,7 +521,11 @@ export class Thread { * @throws {@link Zep.InternalServerError} * * @example - * await client.thread.get("threadId") + * await client.thread.get("threadId", { + * limit: 1, + * cursor: 1, + * lastn: 1 + * }) */ public get( threadId: string, diff --git a/src/api/resources/thread/client/requests/ThreadGetRequest.ts b/src/api/resources/thread/client/requests/ThreadGetRequest.ts index d0e9a602..af33f506 100644 --- a/src/api/resources/thread/client/requests/ThreadGetRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadGetRequest.ts @@ -4,7 +4,11 @@ /** * @example - * {} + * { + * limit: 1, + * cursor: 1, + * lastn: 1 + * } */ export interface ThreadGetRequest { /** diff --git a/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts b/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts index 168143d5..859ef0a7 100644 --- a/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts @@ -6,7 +6,10 @@ import * as Zep from "../../../../index.js"; /** * @example - * {} + * { + * minRating: 1.1, + * mode: "basic" + * } */ export interface ThreadGetUserContextRequest { /** diff --git a/src/api/resources/thread/client/requests/ThreadListAllRequest.ts b/src/api/resources/thread/client/requests/ThreadListAllRequest.ts index 9a397cef..215c6a70 100644 --- a/src/api/resources/thread/client/requests/ThreadListAllRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadListAllRequest.ts @@ -4,7 +4,12 @@ /** * @example - * {} + * { + * pageNumber: 1, + * pageSize: 1, + * orderBy: "order_by", + * asc: true + * } */ export interface ThreadListAllRequest { /** diff --git a/src/api/resources/user/client/Client.ts b/src/api/resources/user/client/Client.ts index ee1811ca..610ecd4c 100644 --- a/src/api/resources/user/client/Client.ts +++ b/src/api/resources/user/client/Client.ts @@ -160,7 +160,10 @@ export class User { * @throws {@link Zep.InternalServerError} * * @example - * await client.user.listOrdered() + * await client.user.listOrdered({ + * pageNumber: 1, + * pageSize: 1 + * }) */ public listOrdered( request: Zep.UserListOrderedRequest = {}, diff --git a/src/api/resources/user/client/requests/CreateUserRequest.ts b/src/api/resources/user/client/requests/CreateUserRequest.ts index 1fad4959..86759c19 100644 --- a/src/api/resources/user/client/requests/CreateUserRequest.ts +++ b/src/api/resources/user/client/requests/CreateUserRequest.ts @@ -11,6 +11,8 @@ import * as Zep from "../../../../index.js"; * } */ export interface CreateUserRequest { + /** When true, disables the use of default/fallback ontology for the user's graph. */ + disableDefaultOntology?: boolean; /** The email address of the user. */ email?: string; /** Optional instruction to use for fact rating. */ diff --git a/src/api/resources/user/client/requests/UpdateUserRequest.ts b/src/api/resources/user/client/requests/UpdateUserRequest.ts index bc12e437..567dc1d1 100644 --- a/src/api/resources/user/client/requests/UpdateUserRequest.ts +++ b/src/api/resources/user/client/requests/UpdateUserRequest.ts @@ -9,6 +9,8 @@ import * as Zep from "../../../../index.js"; * {} */ export interface UpdateUserRequest { + /** When true, disables the use of default/fallback ontology for the user's graph. */ + disableDefaultOntology?: boolean; /** The email address of the user. */ email?: string; /** Optional instruction to use for fact rating. */ diff --git a/src/api/resources/user/client/requests/UserListOrderedRequest.ts b/src/api/resources/user/client/requests/UserListOrderedRequest.ts index 62c9469b..774dfb05 100644 --- a/src/api/resources/user/client/requests/UserListOrderedRequest.ts +++ b/src/api/resources/user/client/requests/UserListOrderedRequest.ts @@ -4,7 +4,10 @@ /** * @example - * {} + * { + * pageNumber: 1, + * pageSize: 1 + * } */ export interface UserListOrderedRequest { /** diff --git a/src/api/types/SearchFilters.ts b/src/api/types/SearchFilters.ts index 9b197a8f..565824f2 100644 --- a/src/api/types/SearchFilters.ts +++ b/src/api/types/SearchFilters.ts @@ -15,6 +15,10 @@ export interface SearchFilters { createdAt?: Zep.DateFilter[][]; /** List of edge types to filter on */ edgeTypes?: string[]; + /** List of edge types to exclude from results */ + excludeEdgeTypes?: string[]; + /** List of node labels to exclude from results */ + excludeNodeLabels?: string[]; /** * 2D array of date filters for the expired_at field. * The outer array elements are combined with OR logic. diff --git a/src/api/types/User.ts b/src/api/types/User.ts index b0c252ad..c4527d6a 100644 --- a/src/api/types/User.ts +++ b/src/api/types/User.ts @@ -7,6 +7,7 @@ import * as Zep from "../index.js"; export interface User { createdAt?: string; deletedAt?: string; + disableDefaultOntology?: boolean; email?: string; factRatingInstruction?: Zep.ModelsFactRatingInstruction; firstName?: string; diff --git a/src/serialization/resources/user/client/requests/CreateUserRequest.ts b/src/serialization/resources/user/client/requests/CreateUserRequest.ts index 68235f9b..07ce1149 100644 --- a/src/serialization/resources/user/client/requests/CreateUserRequest.ts +++ b/src/serialization/resources/user/client/requests/CreateUserRequest.ts @@ -9,6 +9,10 @@ import { FactRatingInstruction } from "../../../../types/FactRatingInstruction.j export const CreateUserRequest: core.serialization.Schema = core.serialization.object({ + disableDefaultOntology: core.serialization.property( + "disable_default_ontology", + core.serialization.boolean().optional(), + ), email: core.serialization.string().optional(), factRatingInstruction: core.serialization.property("fact_rating_instruction", FactRatingInstruction.optional()), firstName: core.serialization.property("first_name", core.serialization.string().optional()), @@ -19,6 +23,7 @@ export const CreateUserRequest: core.serialization.Schema = core.serialization.object({ + disableDefaultOntology: core.serialization.property( + "disable_default_ontology", + core.serialization.boolean().optional(), + ), email: core.serialization.string().optional(), factRatingInstruction: core.serialization.property("fact_rating_instruction", FactRatingInstruction.optional()), firstName: core.serialization.property("first_name", core.serialization.string().optional()), @@ -18,6 +22,7 @@ export const UpdateUserRequest: core.serialization.Schema = core.serialization.object({ createdAt: core.serialization.property("created_at", core.serialization.string().optional()), deletedAt: core.serialization.property("deleted_at", core.serialization.string().optional()), + disableDefaultOntology: core.serialization.property( + "disable_default_ontology", + core.serialization.boolean().optional(), + ), email: core.serialization.string().optional(), factRatingInstruction: core.serialization.property( "fact_rating_instruction", @@ -30,6 +34,7 @@ export declare namespace User { export interface Raw { created_at?: string | null; deleted_at?: string | null; + disable_default_ontology?: boolean | null; email?: string | null; fact_rating_instruction?: ModelsFactRatingInstruction.Raw | null; first_name?: string | null; diff --git a/src/version.ts b/src/version.ts index 4b356696..b8a07622 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.8.0"; +export const SDK_VERSION = "3.9.0"; diff --git a/tests/wire/graph.test.ts b/tests/wire/graph.test.ts index 4949749e..78044f2b 100644 --- a/tests/wire/graph.test.ts +++ b/tests/wire/graph.test.ts @@ -29,7 +29,10 @@ describe("Graph", () => { }; server.mockEndpoint().get("/entity-types").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.graph.listEntityTypes(); + const response = await client.graph.listEntityTypes({ + userId: "user_id", + graphId: "graph_id", + }); expect(response).toEqual({ edgeTypes: [ { @@ -377,7 +380,10 @@ describe("Graph", () => { }; server.mockEndpoint().get("/graph/list-all").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.graph.listAll(); + const response = await client.graph.listAll({ + pageNumber: 1, + pageSize: 1, + }); expect(response).toEqual({ graphs: [ { diff --git a/tests/wire/graph/episode.test.ts b/tests/wire/graph/episode.test.ts index fb57bd39..97f541a2 100644 --- a/tests/wire/graph/episode.test.ts +++ b/tests/wire/graph/episode.test.ts @@ -36,7 +36,9 @@ describe("Episode", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.graph.episode.getByGraphId("graph_id"); + const response = await client.graph.episode.getByGraphId("graph_id", { + lastn: 1, + }); expect(response).toEqual({ episodes: [ { @@ -89,7 +91,9 @@ describe("Episode", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.graph.episode.getByUserId("user_id"); + const response = await client.graph.episode.getByUserId("user_id", { + lastn: 1, + }); expect(response).toEqual({ episodes: [ { diff --git a/tests/wire/thread.test.ts b/tests/wire/thread.test.ts index 2321a472..39f10828 100644 --- a/tests/wire/thread.test.ts +++ b/tests/wire/thread.test.ts @@ -25,7 +25,12 @@ describe("Thread", () => { }; server.mockEndpoint().get("/threads").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.thread.listAll(); + const response = await client.thread.listAll({ + pageNumber: 1, + pageSize: 1, + orderBy: "order_by", + asc: true, + }); expect(response).toEqual({ responseCount: 1, threads: [ @@ -106,7 +111,10 @@ describe("Thread", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.thread.getUserContext("threadId"); + const response = await client.thread.getUserContext("threadId", { + minRating: 1.1, + mode: "basic", + }); expect(response).toEqual({ context: "context", }); @@ -139,7 +147,11 @@ describe("Thread", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.thread.get("threadId"); + const response = await client.thread.get("threadId", { + limit: 1, + cursor: 1, + lastn: 1, + }); expect(response).toEqual({ messages: [ { diff --git a/tests/wire/user.test.ts b/tests/wire/user.test.ts index 31d287cb..71cebb8c 100644 --- a/tests/wire/user.test.ts +++ b/tests/wire/user.test.ts @@ -13,6 +13,7 @@ describe("User", () => { const rawResponseBody = { created_at: "created_at", deleted_at: "deleted_at", + disable_default_ontology: true, email: "email", fact_rating_instruction: { examples: { high: "high", low: "low", medium: "medium" }, @@ -43,6 +44,7 @@ describe("User", () => { expect(response).toEqual({ createdAt: "created_at", deletedAt: "deleted_at", + disableDefaultOntology: true, email: "email", factRatingInstruction: { examples: { @@ -77,6 +79,7 @@ describe("User", () => { { created_at: "created_at", deleted_at: "deleted_at", + disable_default_ontology: true, email: "email", first_name: "first_name", id: 1, @@ -92,7 +95,10 @@ describe("User", () => { }; server.mockEndpoint().get("/users-ordered").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.user.listOrdered(); + const response = await client.user.listOrdered({ + pageNumber: 1, + pageSize: 1, + }); expect(response).toEqual({ rowCount: 1, totalCount: 1, @@ -100,6 +106,7 @@ describe("User", () => { { createdAt: "created_at", deletedAt: "deleted_at", + disableDefaultOntology: true, email: "email", firstName: "first_name", id: 1, @@ -124,6 +131,7 @@ describe("User", () => { const rawResponseBody = { created_at: "created_at", deleted_at: "deleted_at", + disable_default_ontology: true, email: "email", fact_rating_instruction: { examples: { high: "high", low: "low", medium: "medium" }, @@ -145,6 +153,7 @@ describe("User", () => { expect(response).toEqual({ createdAt: "created_at", deletedAt: "deleted_at", + disableDefaultOntology: true, email: "email", factRatingInstruction: { examples: { @@ -188,6 +197,7 @@ describe("User", () => { const rawResponseBody = { created_at: "created_at", deleted_at: "deleted_at", + disable_default_ontology: true, email: "email", fact_rating_instruction: { examples: { high: "high", low: "low", medium: "medium" }, @@ -216,6 +226,7 @@ describe("User", () => { expect(response).toEqual({ createdAt: "created_at", deletedAt: "deleted_at", + disableDefaultOntology: true, email: "email", factRatingInstruction: { examples: { From c10995231c1591e46e1551166dbfb0fa2e614381 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 19:03:57 +0000 Subject: [PATCH 40/59] SDK regeneration --- reference.md | 41 ++++--------------- src/api/resources/graph/client/Client.ts | 10 +---- .../client/requests/GraphListAllRequest.ts | 5 +-- .../requests/GraphListEntityTypesRequest.ts | 5 +-- .../graph/resources/episode/client/Client.ts | 8 +--- .../requests/EpisodeGetByGraphIdRequest.ts | 4 +- .../requests/EpisodeGetByUserIdRequest.ts | 4 +- src/api/resources/thread/client/Client.ts | 18 ++------ .../client/requests/ThreadGetRequest.ts | 6 +-- .../requests/ThreadGetUserContextRequest.ts | 5 +-- .../client/requests/ThreadListAllRequest.ts | 7 +--- src/api/resources/user/client/Client.ts | 5 +-- .../client/requests/UserListOrderedRequest.ts | 5 +-- tests/wire/graph.test.ts | 10 +---- tests/wire/graph/episode.test.ts | 8 +--- tests/wire/thread.test.ts | 18 ++------ tests/wire/user.test.ts | 5 +-- 17 files changed, 32 insertions(+), 132 deletions(-) diff --git a/reference.md b/reference.md index f33a0aa5..c53a37f7 100644 --- a/reference.md +++ b/reference.md @@ -30,10 +30,7 @@ Returns all entity types for a project, user, or graph.
```typescript -await client.graph.listEntityTypes({ - userId: "user_id", - graphId: "graph_id", -}); +await client.graph.listEntityTypes(); ```
@@ -490,10 +487,7 @@ Returns all graphs. In order to list users, use user.list_ordered instead
```typescript -await client.graph.listAll({ - pageNumber: 1, - pageSize: 1, -}); +await client.graph.listAll(); ```
@@ -877,12 +871,7 @@ Returns all threads.
```typescript -await client.thread.listAll({ - pageNumber: 1, - pageSize: 1, - orderBy: "order_by", - asc: true, -}); +await client.thread.listAll(); ```
@@ -1074,10 +1063,7 @@ Returns most relevant context from the user graph (including memory from any/all
```typescript -await client.thread.getUserContext("threadId", { - minRating: 1.1, - mode: "basic", -}); +await client.thread.getUserContext("threadId"); ```
@@ -1148,11 +1134,7 @@ Returns messages for a thread.
```typescript -await client.thread.get("threadId", { - limit: 1, - cursor: 1, - lastn: 1, -}); +await client.thread.get("threadId"); ```
@@ -1446,10 +1428,7 @@ Returns all users.
```typescript -await client.user.listOrdered({ - pageNumber: 1, - pageSize: 1, -}); +await client.user.listOrdered(); ```
@@ -2170,9 +2149,7 @@ Returns episodes by graph id.
```typescript -await client.graph.episode.getByGraphId("graph_id", { - lastn: 1, -}); +await client.graph.episode.getByGraphId("graph_id"); ```
@@ -2243,9 +2220,7 @@ Returns episodes by user id.
```typescript -await client.graph.episode.getByUserId("user_id", { - lastn: 1, -}); +await client.graph.episode.getByUserId("user_id"); ```
diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index 07dd45d6..43dff1a3 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -68,10 +68,7 @@ export class Graph { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.listEntityTypes({ - * userId: "user_id", - * graphId: "graph_id" - * }) + * await client.graph.listEntityTypes() */ public listEntityTypes( request: Zep.GraphListEntityTypesRequest = {}, @@ -864,10 +861,7 @@ export class Graph { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.listAll({ - * pageNumber: 1, - * pageSize: 1 - * }) + * await client.graph.listAll() */ public listAll( request: Zep.GraphListAllRequest = {}, diff --git a/src/api/resources/graph/client/requests/GraphListAllRequest.ts b/src/api/resources/graph/client/requests/GraphListAllRequest.ts index 479ab286..791d5043 100644 --- a/src/api/resources/graph/client/requests/GraphListAllRequest.ts +++ b/src/api/resources/graph/client/requests/GraphListAllRequest.ts @@ -4,10 +4,7 @@ /** * @example - * { - * pageNumber: 1, - * pageSize: 1 - * } + * {} */ export interface GraphListAllRequest { /** diff --git a/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts b/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts index 6d00f137..8fb0fdc2 100644 --- a/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts +++ b/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts @@ -4,10 +4,7 @@ /** * @example - * { - * userId: "user_id", - * graphId: "graph_id" - * } + * {} */ export interface GraphListEntityTypesRequest { /** diff --git a/src/api/resources/graph/resources/episode/client/Client.ts b/src/api/resources/graph/resources/episode/client/Client.ts index 635e650f..54372ddf 100644 --- a/src/api/resources/graph/resources/episode/client/Client.ts +++ b/src/api/resources/graph/resources/episode/client/Client.ts @@ -50,9 +50,7 @@ export class Episode { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.episode.getByGraphId("graph_id", { - * lastn: 1 - * }) + * await client.graph.episode.getByGraphId("graph_id") */ public getByGraphId( graphId: string, @@ -165,9 +163,7 @@ export class Episode { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.episode.getByUserId("user_id", { - * lastn: 1 - * }) + * await client.graph.episode.getByUserId("user_id") */ public getByUserId( userId: string, diff --git a/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.ts b/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.ts index 72918505..caecc192 100644 --- a/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.ts +++ b/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.ts @@ -4,9 +4,7 @@ /** * @example - * { - * lastn: 1 - * } + * {} */ export interface EpisodeGetByGraphIdRequest { /** diff --git a/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.ts b/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.ts index 3787ecb0..8b9290a6 100644 --- a/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.ts +++ b/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.ts @@ -4,9 +4,7 @@ /** * @example - * { - * lastn: 1 - * } + * {} */ export interface EpisodeGetByUserIdRequest { /** diff --git a/src/api/resources/thread/client/Client.ts b/src/api/resources/thread/client/Client.ts index f1bfd4fb..19448d02 100644 --- a/src/api/resources/thread/client/Client.ts +++ b/src/api/resources/thread/client/Client.ts @@ -55,12 +55,7 @@ export class Thread { * @throws {@link Zep.InternalServerError} * * @example - * await client.thread.listAll({ - * pageNumber: 1, - * pageSize: 1, - * orderBy: "order_by", - * asc: true - * }) + * await client.thread.listAll() */ public listAll( request: Zep.ThreadListAllRequest = {}, @@ -398,10 +393,7 @@ export class Thread { * @throws {@link Zep.InternalServerError} * * @example - * await client.thread.getUserContext("threadId", { - * minRating: 1.1, - * mode: "basic" - * }) + * await client.thread.getUserContext("threadId") */ public getUserContext( threadId: string, @@ -521,11 +513,7 @@ export class Thread { * @throws {@link Zep.InternalServerError} * * @example - * await client.thread.get("threadId", { - * limit: 1, - * cursor: 1, - * lastn: 1 - * }) + * await client.thread.get("threadId") */ public get( threadId: string, diff --git a/src/api/resources/thread/client/requests/ThreadGetRequest.ts b/src/api/resources/thread/client/requests/ThreadGetRequest.ts index af33f506..d0e9a602 100644 --- a/src/api/resources/thread/client/requests/ThreadGetRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadGetRequest.ts @@ -4,11 +4,7 @@ /** * @example - * { - * limit: 1, - * cursor: 1, - * lastn: 1 - * } + * {} */ export interface ThreadGetRequest { /** diff --git a/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts b/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts index 859ef0a7..168143d5 100644 --- a/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts @@ -6,10 +6,7 @@ import * as Zep from "../../../../index.js"; /** * @example - * { - * minRating: 1.1, - * mode: "basic" - * } + * {} */ export interface ThreadGetUserContextRequest { /** diff --git a/src/api/resources/thread/client/requests/ThreadListAllRequest.ts b/src/api/resources/thread/client/requests/ThreadListAllRequest.ts index 215c6a70..9a397cef 100644 --- a/src/api/resources/thread/client/requests/ThreadListAllRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadListAllRequest.ts @@ -4,12 +4,7 @@ /** * @example - * { - * pageNumber: 1, - * pageSize: 1, - * orderBy: "order_by", - * asc: true - * } + * {} */ export interface ThreadListAllRequest { /** diff --git a/src/api/resources/user/client/Client.ts b/src/api/resources/user/client/Client.ts index 610ecd4c..ee1811ca 100644 --- a/src/api/resources/user/client/Client.ts +++ b/src/api/resources/user/client/Client.ts @@ -160,10 +160,7 @@ export class User { * @throws {@link Zep.InternalServerError} * * @example - * await client.user.listOrdered({ - * pageNumber: 1, - * pageSize: 1 - * }) + * await client.user.listOrdered() */ public listOrdered( request: Zep.UserListOrderedRequest = {}, diff --git a/src/api/resources/user/client/requests/UserListOrderedRequest.ts b/src/api/resources/user/client/requests/UserListOrderedRequest.ts index 774dfb05..62c9469b 100644 --- a/src/api/resources/user/client/requests/UserListOrderedRequest.ts +++ b/src/api/resources/user/client/requests/UserListOrderedRequest.ts @@ -4,10 +4,7 @@ /** * @example - * { - * pageNumber: 1, - * pageSize: 1 - * } + * {} */ export interface UserListOrderedRequest { /** diff --git a/tests/wire/graph.test.ts b/tests/wire/graph.test.ts index 78044f2b..4949749e 100644 --- a/tests/wire/graph.test.ts +++ b/tests/wire/graph.test.ts @@ -29,10 +29,7 @@ describe("Graph", () => { }; server.mockEndpoint().get("/entity-types").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.graph.listEntityTypes({ - userId: "user_id", - graphId: "graph_id", - }); + const response = await client.graph.listEntityTypes(); expect(response).toEqual({ edgeTypes: [ { @@ -380,10 +377,7 @@ describe("Graph", () => { }; server.mockEndpoint().get("/graph/list-all").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.graph.listAll({ - pageNumber: 1, - pageSize: 1, - }); + const response = await client.graph.listAll(); expect(response).toEqual({ graphs: [ { diff --git a/tests/wire/graph/episode.test.ts b/tests/wire/graph/episode.test.ts index 97f541a2..fb57bd39 100644 --- a/tests/wire/graph/episode.test.ts +++ b/tests/wire/graph/episode.test.ts @@ -36,9 +36,7 @@ describe("Episode", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.graph.episode.getByGraphId("graph_id", { - lastn: 1, - }); + const response = await client.graph.episode.getByGraphId("graph_id"); expect(response).toEqual({ episodes: [ { @@ -91,9 +89,7 @@ describe("Episode", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.graph.episode.getByUserId("user_id", { - lastn: 1, - }); + const response = await client.graph.episode.getByUserId("user_id"); expect(response).toEqual({ episodes: [ { diff --git a/tests/wire/thread.test.ts b/tests/wire/thread.test.ts index 39f10828..2321a472 100644 --- a/tests/wire/thread.test.ts +++ b/tests/wire/thread.test.ts @@ -25,12 +25,7 @@ describe("Thread", () => { }; server.mockEndpoint().get("/threads").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.thread.listAll({ - pageNumber: 1, - pageSize: 1, - orderBy: "order_by", - asc: true, - }); + const response = await client.thread.listAll(); expect(response).toEqual({ responseCount: 1, threads: [ @@ -111,10 +106,7 @@ describe("Thread", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.thread.getUserContext("threadId", { - minRating: 1.1, - mode: "basic", - }); + const response = await client.thread.getUserContext("threadId"); expect(response).toEqual({ context: "context", }); @@ -147,11 +139,7 @@ describe("Thread", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.thread.get("threadId", { - limit: 1, - cursor: 1, - lastn: 1, - }); + const response = await client.thread.get("threadId"); expect(response).toEqual({ messages: [ { diff --git a/tests/wire/user.test.ts b/tests/wire/user.test.ts index 71cebb8c..30ae0fc0 100644 --- a/tests/wire/user.test.ts +++ b/tests/wire/user.test.ts @@ -95,10 +95,7 @@ describe("User", () => { }; server.mockEndpoint().get("/users-ordered").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.user.listOrdered({ - pageNumber: 1, - pageSize: 1, - }); + const response = await client.user.listOrdered(); expect(response).toEqual({ rowCount: 1, totalCount: 1, From 729543dd830d57593b343cfed7203d1f5d06bfd8 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Tue, 4 Nov 2025 12:26:39 -0500 Subject: [PATCH 41/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eaf25e09..d6219653 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.9.0", + "version": "3.10.0", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From 6ccad5c2cd97aac08520f81a395246ba50a7b904 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 17:28:08 +0000 Subject: [PATCH 42/59] SDK regeneration --- reference.md | 196 ++++++++++ src/Client.ts | 4 +- src/api/resources/user/client/Client.ts | 337 ++++++++++++++++++ .../ApidataAddUserInstructionsRequest.ts | 19 + .../ApidataDeleteUserInstructionsRequest.ts | 13 + .../UserListUserSummaryInstructionsRequest.ts | 18 + .../resources/user/client/requests/index.ts | 3 + src/api/types/ComparisonOperator.ts | 4 +- src/api/types/ListUserInstructionsResponse.ts | 9 + src/api/types/UserInstruction.ts | 8 + src/api/types/index.ts | 2 + .../ApidataAddUserInstructionsRequest.ts | 23 ++ .../ApidataDeleteUserInstructionsRequest.ts | 25 ++ .../resources/user/client/requests/index.ts | 2 + src/serialization/types/ComparisonOperator.ts | 4 +- .../types/ListUserInstructionsResponse.ts | 21 ++ src/serialization/types/UserInstruction.ts | 20 ++ src/serialization/types/index.ts | 2 + src/version.ts | 2 +- tests/wire/user.test.ts | 71 ++++ 20 files changed, 777 insertions(+), 6 deletions(-) create mode 100644 src/api/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts create mode 100644 src/api/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts create mode 100644 src/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.ts create mode 100644 src/api/types/ListUserInstructionsResponse.ts create mode 100644 src/api/types/UserInstruction.ts create mode 100644 src/serialization/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts create mode 100644 src/serialization/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts create mode 100644 src/serialization/types/ListUserInstructionsResponse.ts create mode 100644 src/serialization/types/UserInstruction.ts diff --git a/reference.md b/reference.md index c53a37f7..746333a7 100644 --- a/reference.md +++ b/reference.md @@ -1335,6 +1335,202 @@ await client.thread.addMessagesBatch("threadId", { ## User +
client.user.listUserSummaryInstructions({ ...params }) -> Zep.ListUserInstructionsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists all user summary/instructions for a project, user, or graph. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.user.listUserSummaryInstructions(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Zep.UserListUserSummaryInstructionsRequest` + +
+
+ +
+
+ +**requestOptions:** `User.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.user.addUserSummaryInstructions({ ...params }) -> Zep.SuccessResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Adds new summary/instructions for users and/or graphs without removing existing ones. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.user.addUserSummaryInstructions({ + instructions: [ + { + name: "name", + text: "text", + }, + ], +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Zep.ApidataAddUserInstructionsRequest` + +
+
+ +
+
+ +**requestOptions:** `User.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.user.deleteUserSummaryInstructions({ ...params }) -> Zep.SuccessResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes user summary/instructions for users and/or graphs. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.user.deleteUserSummaryInstructions(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Zep.ApidataDeleteUserInstructionsRequest` + +
+
+ +
+
+ +**requestOptions:** `User.RequestOptions` + +
+
+
+
+ +
+
+
+
client.user.add({ ...params }) -> Zep.User
diff --git a/src/Client.ts b/src/Client.ts index 66b67677..5300bc7f 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -47,8 +47,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.9.0", - "User-Agent": "zep-cloud/3.9.0", + "X-Fern-SDK-Version": "3.10.0", + "User-Agent": "zep-cloud/3.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/user/client/Client.ts b/src/api/resources/user/client/Client.ts index ee1811ca..423cd016 100644 --- a/src/api/resources/user/client/Client.ts +++ b/src/api/resources/user/client/Client.ts @@ -39,6 +39,343 @@ export class User { this._options = _options; } + /** + * Lists all user summary/instructions for a project, user, or graph. + * + * @param {Zep.UserListUserSummaryInstructionsRequest} request + * @param {User.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.BadRequestError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.user.listUserSummaryInstructions() + */ + public listUserSummaryInstructions( + request: Zep.UserListUserSummaryInstructionsRequest = {}, + requestOptions?: User.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__listUserSummaryInstructions(request, requestOptions)); + } + + private async __listUserSummaryInstructions( + request: Zep.UserListUserSummaryInstructionsRequest = {}, + requestOptions?: User.RequestOptions, + ): Promise> { + const { userId, graphId } = request; + const _queryParams: Record = {}; + if (userId != null) { + _queryParams["user_id"] = userId; + } + + if (graphId != null) { + _queryParams["graph_id"] = graphId; + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + "user-summary-instructions", + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.ListUserInstructionsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Zep.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /user-summary-instructions."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Adds new summary/instructions for users and/or graphs without removing existing ones. + * + * @param {Zep.ApidataAddUserInstructionsRequest} request + * @param {User.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.BadRequestError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.user.addUserSummaryInstructions({ + * instructions: [{ + * name: "name", + * text: "text" + * }] + * }) + */ + public addUserSummaryInstructions( + request: Zep.ApidataAddUserInstructionsRequest, + requestOptions?: User.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__addUserSummaryInstructions(request, requestOptions)); + } + + private async __addUserSummaryInstructions( + request: Zep.ApidataAddUserInstructionsRequest, + requestOptions?: User.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + "user-summary-instructions", + ), + method: "POST", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.ApidataAddUserInstructionsRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.SuccessResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Zep.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /user-summary-instructions."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Deletes user summary/instructions for users and/or graphs. + * + * @param {Zep.ApidataDeleteUserInstructionsRequest} request + * @param {User.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.BadRequestError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.user.deleteUserSummaryInstructions() + */ + public deleteUserSummaryInstructions( + request: Zep.ApidataDeleteUserInstructionsRequest = {}, + requestOptions?: User.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteUserSummaryInstructions(request, requestOptions)); + } + + private async __deleteUserSummaryInstructions( + request: Zep.ApidataDeleteUserInstructionsRequest = {}, + requestOptions?: User.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + "user-summary-instructions", + ), + method: "DELETE", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.ApidataDeleteUserInstructionsRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.SuccessResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Zep.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /user-summary-instructions."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + /** * Adds a user. * diff --git a/src/api/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts b/src/api/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts new file mode 100644 index 00000000..7552029c --- /dev/null +++ b/src/api/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Zep from "../../../../index.js"; + +/** + * @example + * { + * instructions: [{ + * name: "name", + * text: "text" + * }] + * } + */ +export interface ApidataAddUserInstructionsRequest { + instructions: Zep.UserInstruction[]; + userIds?: string[]; +} diff --git a/src/api/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts b/src/api/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts new file mode 100644 index 00000000..2794b857 --- /dev/null +++ b/src/api/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface ApidataDeleteUserInstructionsRequest { + /** If empty, deletes all */ + instructionNames?: string[]; + userIds?: string[]; +} diff --git a/src/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.ts b/src/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.ts new file mode 100644 index 00000000..de7caaca --- /dev/null +++ b/src/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface UserListUserSummaryInstructionsRequest { + /** + * User ID to get user-specific instructions + */ + userId?: string; + /** + * Graph ID to get graph-specific instructions + */ + graphId?: string; +} diff --git a/src/api/resources/user/client/requests/index.ts b/src/api/resources/user/client/requests/index.ts index c82307fb..211e1baf 100644 --- a/src/api/resources/user/client/requests/index.ts +++ b/src/api/resources/user/client/requests/index.ts @@ -1,3 +1,6 @@ +export { type UserListUserSummaryInstructionsRequest } from "./UserListUserSummaryInstructionsRequest.js"; +export { type ApidataAddUserInstructionsRequest } from "./ApidataAddUserInstructionsRequest.js"; +export { type ApidataDeleteUserInstructionsRequest } from "./ApidataDeleteUserInstructionsRequest.js"; export { type CreateUserRequest } from "./CreateUserRequest.js"; export { type UserListOrderedRequest } from "./UserListOrderedRequest.js"; export { type UpdateUserRequest } from "./UpdateUserRequest.js"; diff --git a/src/api/types/ComparisonOperator.ts b/src/api/types/ComparisonOperator.ts index 633d6c1d..30fbfdb2 100644 --- a/src/api/types/ComparisonOperator.ts +++ b/src/api/types/ComparisonOperator.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -export type ComparisonOperator = "=" | "<>" | ">" | "<" | ">=" | "<="; +export type ComparisonOperator = "=" | "<>" | ">" | "<" | ">=" | "<=" | "IS NULL" | "IS NOT NULL"; export const ComparisonOperator = { Equals: "=", NotEquals: "<>", @@ -10,4 +10,6 @@ export const ComparisonOperator = { LessThan: "<", GreaterThanEqual: ">=", LessThanEqual: "<=", + IsNull: "IS NULL", + IsNotNull: "IS NOT NULL", } as const; diff --git a/src/api/types/ListUserInstructionsResponse.ts b/src/api/types/ListUserInstructionsResponse.ts new file mode 100644 index 00000000..04f506da --- /dev/null +++ b/src/api/types/ListUserInstructionsResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Zep from "../index.js"; + +export interface ListUserInstructionsResponse { + instructions?: Zep.UserInstruction[]; +} diff --git a/src/api/types/UserInstruction.ts b/src/api/types/UserInstruction.ts new file mode 100644 index 00000000..ce57d6f1 --- /dev/null +++ b/src/api/types/UserInstruction.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface UserInstruction { + name: string; + text: string; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index cbbec764..2ba7e473 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -18,6 +18,7 @@ export * from "./EpisodeResponse.js"; export * from "./GraphListResponse.js"; export * from "./GraphNodesRequest.js"; export * from "./GraphSearchResults.js"; +export * from "./ListUserInstructionsResponse.js"; export * from "./ProjectInfo.js"; export * from "./ProjectInfoResponse.js"; export * from "./RoleType.js"; @@ -28,6 +29,7 @@ export * from "./ThreadListResponse.js"; export * from "./Message.js"; export * from "./MessageListResponse.js"; export * from "./User.js"; +export * from "./UserInstruction.js"; export * from "./UserListResponse.js"; export * from "./UserNodeResponse.js"; export * from "./AddTripleResponse.js"; diff --git a/src/serialization/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts b/src/serialization/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts new file mode 100644 index 00000000..3aedecc0 --- /dev/null +++ b/src/serialization/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index.js"; +import * as Zep from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; +import { UserInstruction } from "../../../../types/UserInstruction.js"; + +export const ApidataAddUserInstructionsRequest: core.serialization.Schema< + serializers.ApidataAddUserInstructionsRequest.Raw, + Zep.ApidataAddUserInstructionsRequest +> = core.serialization.object({ + instructions: core.serialization.list(UserInstruction), + userIds: core.serialization.property("user_ids", core.serialization.list(core.serialization.string()).optional()), +}); + +export declare namespace ApidataAddUserInstructionsRequest { + export interface Raw { + instructions: UserInstruction.Raw[]; + user_ids?: string[] | null; + } +} diff --git a/src/serialization/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts b/src/serialization/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts new file mode 100644 index 00000000..48ccd8f6 --- /dev/null +++ b/src/serialization/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index.js"; +import * as Zep from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; + +export const ApidataDeleteUserInstructionsRequest: core.serialization.Schema< + serializers.ApidataDeleteUserInstructionsRequest.Raw, + Zep.ApidataDeleteUserInstructionsRequest +> = core.serialization.object({ + instructionNames: core.serialization.property( + "instruction_names", + core.serialization.list(core.serialization.string()).optional(), + ), + userIds: core.serialization.property("user_ids", core.serialization.list(core.serialization.string()).optional()), +}); + +export declare namespace ApidataDeleteUserInstructionsRequest { + export interface Raw { + instruction_names?: string[] | null; + user_ids?: string[] | null; + } +} diff --git a/src/serialization/resources/user/client/requests/index.ts b/src/serialization/resources/user/client/requests/index.ts index 9369c1f3..238aa2b3 100644 --- a/src/serialization/resources/user/client/requests/index.ts +++ b/src/serialization/resources/user/client/requests/index.ts @@ -1,2 +1,4 @@ +export { ApidataAddUserInstructionsRequest } from "./ApidataAddUserInstructionsRequest.js"; +export { ApidataDeleteUserInstructionsRequest } from "./ApidataDeleteUserInstructionsRequest.js"; export { CreateUserRequest } from "./CreateUserRequest.js"; export { UpdateUserRequest } from "./UpdateUserRequest.js"; diff --git a/src/serialization/types/ComparisonOperator.ts b/src/serialization/types/ComparisonOperator.ts index 3157a6f6..57bda172 100644 --- a/src/serialization/types/ComparisonOperator.ts +++ b/src/serialization/types/ComparisonOperator.ts @@ -7,8 +7,8 @@ import * as Zep from "../../api/index.js"; import * as core from "../../core/index.js"; export const ComparisonOperator: core.serialization.Schema = - core.serialization.enum_(["=", "<>", ">", "<", ">=", "<="]); + core.serialization.enum_(["=", "<>", ">", "<", ">=", "<=", "IS NULL", "IS NOT NULL"]); export declare namespace ComparisonOperator { - export type Raw = "=" | "<>" | ">" | "<" | ">=" | "<="; + export type Raw = "=" | "<>" | ">" | "<" | ">=" | "<=" | "IS NULL" | "IS NOT NULL"; } diff --git a/src/serialization/types/ListUserInstructionsResponse.ts b/src/serialization/types/ListUserInstructionsResponse.ts new file mode 100644 index 00000000..3f90b1d9 --- /dev/null +++ b/src/serialization/types/ListUserInstructionsResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { UserInstruction } from "./UserInstruction.js"; + +export const ListUserInstructionsResponse: core.serialization.ObjectSchema< + serializers.ListUserInstructionsResponse.Raw, + Zep.ListUserInstructionsResponse +> = core.serialization.object({ + instructions: core.serialization.list(UserInstruction).optional(), +}); + +export declare namespace ListUserInstructionsResponse { + export interface Raw { + instructions?: UserInstruction.Raw[] | null; + } +} diff --git a/src/serialization/types/UserInstruction.ts b/src/serialization/types/UserInstruction.ts new file mode 100644 index 00000000..7e2dd538 --- /dev/null +++ b/src/serialization/types/UserInstruction.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; + +export const UserInstruction: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), + text: core.serialization.string(), + }); + +export declare namespace UserInstruction { + export interface Raw { + name: string; + text: string; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index cbbec764..2ba7e473 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -18,6 +18,7 @@ export * from "./EpisodeResponse.js"; export * from "./GraphListResponse.js"; export * from "./GraphNodesRequest.js"; export * from "./GraphSearchResults.js"; +export * from "./ListUserInstructionsResponse.js"; export * from "./ProjectInfo.js"; export * from "./ProjectInfoResponse.js"; export * from "./RoleType.js"; @@ -28,6 +29,7 @@ export * from "./ThreadListResponse.js"; export * from "./Message.js"; export * from "./MessageListResponse.js"; export * from "./User.js"; +export * from "./UserInstruction.js"; export * from "./UserListResponse.js"; export * from "./UserNodeResponse.js"; export * from "./AddTripleResponse.js"; diff --git a/src/version.ts b/src/version.ts index b8a07622..d13909b2 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.9.0"; +export const SDK_VERSION = "3.10.0"; diff --git a/tests/wire/user.test.ts b/tests/wire/user.test.ts index 30ae0fc0..cd2dcb71 100644 --- a/tests/wire/user.test.ts +++ b/tests/wire/user.test.ts @@ -6,6 +6,77 @@ import { mockServerPool } from "../mock-server/MockServerPool"; import { ZepClient } from "../../src/Client"; describe("User", () => { + test("list_user_summary_instructions", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { instructions: [{ name: "name", text: "text" }] }; + server + .mockEndpoint() + .get("/user-summary-instructions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.user.listUserSummaryInstructions(); + expect(response).toEqual({ + instructions: [ + { + name: "name", + text: "text", + }, + ], + }); + }); + + test("add_user_summary_instructions", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { instructions: [{ name: "name", text: "text" }] }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/user-summary-instructions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.user.addUserSummaryInstructions({ + instructions: [ + { + name: "name", + text: "text", + }, + ], + }); + expect(response).toEqual({ + message: "message", + }); + }); + + test("delete_user_summary_instructions", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .delete("/user-summary-instructions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.user.deleteUserSummaryInstructions(); + expect(response).toEqual({ + message: "message", + }); + }); + test("add", async () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); From 857037125e0ccd24001c139a62bcfe9c529d2560 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 21:41:31 +0000 Subject: [PATCH 43/59] SDK regeneration --- reference.md | 6 +++--- src/api/resources/user/client/Client.ts | 12 ++++-------- .../requests/ApidataAddUserInstructionsRequest.ts | 2 ++ .../requests/ApidataDeleteUserInstructionsRequest.ts | 3 ++- .../UserListUserSummaryInstructionsRequest.ts | 4 ---- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/reference.md b/reference.md index 746333a7..537ff763 100644 --- a/reference.md +++ b/reference.md @@ -1347,7 +1347,7 @@ await client.thread.addMessagesBatch("threadId", {
-Lists all user summary/instructions for a project, user, or graph. +Lists all user summary instructions for a project, user.
@@ -1410,7 +1410,7 @@ await client.user.listUserSummaryInstructions();
-Adds new summary/instructions for users and/or graphs without removing existing ones. +Adds new summary instructions for users graphs without removing existing ones. If user_ids is empty, adds to project-wide default instructions.
@@ -1480,7 +1480,7 @@ await client.user.addUserSummaryInstructions({
-Deletes user summary/instructions for users and/or graphs. +Deletes user summary/instructions for users or project wide defaults.
diff --git a/src/api/resources/user/client/Client.ts b/src/api/resources/user/client/Client.ts index 423cd016..e21c1e8c 100644 --- a/src/api/resources/user/client/Client.ts +++ b/src/api/resources/user/client/Client.ts @@ -40,7 +40,7 @@ export class User { } /** - * Lists all user summary/instructions for a project, user, or graph. + * Lists all user summary instructions for a project, user. * * @param {Zep.UserListUserSummaryInstructionsRequest} request * @param {User.RequestOptions} requestOptions - Request-specific configuration. @@ -62,16 +62,12 @@ export class User { request: Zep.UserListUserSummaryInstructionsRequest = {}, requestOptions?: User.RequestOptions, ): Promise> { - const { userId, graphId } = request; + const { userId } = request; const _queryParams: Record = {}; if (userId != null) { _queryParams["user_id"] = userId; } - if (graphId != null) { - _queryParams["graph_id"] = graphId; - } - const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -154,7 +150,7 @@ export class User { } /** - * Adds new summary/instructions for users and/or graphs without removing existing ones. + * Adds new summary instructions for users graphs without removing existing ones. If user_ids is empty, adds to project-wide default instructions. * * @param {Zep.ApidataAddUserInstructionsRequest} request * @param {User.RequestOptions} requestOptions - Request-specific configuration. @@ -268,7 +264,7 @@ export class User { } /** - * Deletes user summary/instructions for users and/or graphs. + * Deletes user summary/instructions for users or project wide defaults. * * @param {Zep.ApidataDeleteUserInstructionsRequest} request * @param {User.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts b/src/api/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts index 7552029c..0d1d4bb5 100644 --- a/src/api/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts +++ b/src/api/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts @@ -14,6 +14,8 @@ import * as Zep from "../../../../index.js"; * } */ export interface ApidataAddUserInstructionsRequest { + /** Instructions to add to the user summary generation. */ instructions: Zep.UserInstruction[]; + /** User IDs to add the instructions to. If empty, the instructions are added to the project-wide default. */ userIds?: string[]; } diff --git a/src/api/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts b/src/api/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts index 2794b857..f2b43df5 100644 --- a/src/api/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts +++ b/src/api/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts @@ -7,7 +7,8 @@ * {} */ export interface ApidataDeleteUserInstructionsRequest { - /** If empty, deletes all */ + /** Unique identifier for the instructions to be deleted. If empty deletes all instructions. */ instructionNames?: string[]; + /** Determines which users will have their custom instructions deleted. If no users are provided, the project-wide custom instructions will be effected. */ userIds?: string[]; } diff --git a/src/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.ts b/src/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.ts index de7caaca..433b2cb6 100644 --- a/src/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.ts +++ b/src/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.ts @@ -11,8 +11,4 @@ export interface UserListUserSummaryInstructionsRequest { * User ID to get user-specific instructions */ userId?: string; - /** - * Graph ID to get graph-specific instructions - */ - graphId?: string; } From 3aad03725eb49906cf58604b6ce4bf9f57df0e03 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 6 Nov 2025 19:32:33 +0000 Subject: [PATCH 44/59] SDK regeneration From 57fa1bef905ba2bab342e6cf819a05c9683a242d Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 6 Nov 2025 19:37:40 +0000 Subject: [PATCH 45/59] SDK regeneration --- reference.md | 4 ++-- src/api/resources/user/client/Client.ts | 16 ++++++++-------- ...sRequest.ts => AddUserInstructionsRequest.ts} | 2 +- ...quest.ts => DeleteUserInstructionsRequest.ts} | 2 +- src/api/resources/user/client/requests/index.ts | 4 ++-- ...sRequest.ts => AddUserInstructionsRequest.ts} | 8 ++++---- ...quest.ts => DeleteUserInstructionsRequest.ts} | 8 ++++---- .../resources/user/client/requests/index.ts | 4 ++-- 8 files changed, 24 insertions(+), 24 deletions(-) rename src/api/resources/user/client/requests/{ApidataAddUserInstructionsRequest.ts => AddUserInstructionsRequest.ts} (90%) rename src/api/resources/user/client/requests/{ApidataDeleteUserInstructionsRequest.ts => DeleteUserInstructionsRequest.ts} (88%) rename src/serialization/resources/user/client/requests/{ApidataAddUserInstructionsRequest.ts => AddUserInstructionsRequest.ts} (73%) rename src/serialization/resources/user/client/requests/{ApidataDeleteUserInstructionsRequest.ts => DeleteUserInstructionsRequest.ts} (73%) diff --git a/reference.md b/reference.md index 537ff763..0e58e986 100644 --- a/reference.md +++ b/reference.md @@ -1449,7 +1449,7 @@ await client.user.addUserSummaryInstructions({
-**request:** `Zep.ApidataAddUserInstructionsRequest` +**request:** `Zep.AddUserInstructionsRequest`
@@ -1512,7 +1512,7 @@ await client.user.deleteUserSummaryInstructions();
-**request:** `Zep.ApidataDeleteUserInstructionsRequest` +**request:** `Zep.DeleteUserInstructionsRequest`
diff --git a/src/api/resources/user/client/Client.ts b/src/api/resources/user/client/Client.ts index e21c1e8c..bf711769 100644 --- a/src/api/resources/user/client/Client.ts +++ b/src/api/resources/user/client/Client.ts @@ -152,7 +152,7 @@ export class User { /** * Adds new summary instructions for users graphs without removing existing ones. If user_ids is empty, adds to project-wide default instructions. * - * @param {Zep.ApidataAddUserInstructionsRequest} request + * @param {Zep.AddUserInstructionsRequest} request * @param {User.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} @@ -167,14 +167,14 @@ export class User { * }) */ public addUserSummaryInstructions( - request: Zep.ApidataAddUserInstructionsRequest, + request: Zep.AddUserInstructionsRequest, requestOptions?: User.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__addUserSummaryInstructions(request, requestOptions)); } private async __addUserSummaryInstructions( - request: Zep.ApidataAddUserInstructionsRequest, + request: Zep.AddUserInstructionsRequest, requestOptions?: User.RequestOptions, ): Promise> { const _response = await (this._options.fetcher ?? core.fetcher)({ @@ -192,7 +192,7 @@ export class User { ), contentType: "application/json", requestType: "json", - body: serializers.ApidataAddUserInstructionsRequest.jsonOrThrow(request, { + body: serializers.AddUserInstructionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -266,7 +266,7 @@ export class User { /** * Deletes user summary/instructions for users or project wide defaults. * - * @param {Zep.ApidataDeleteUserInstructionsRequest} request + * @param {Zep.DeleteUserInstructionsRequest} request * @param {User.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} @@ -276,14 +276,14 @@ export class User { * await client.user.deleteUserSummaryInstructions() */ public deleteUserSummaryInstructions( - request: Zep.ApidataDeleteUserInstructionsRequest = {}, + request: Zep.DeleteUserInstructionsRequest = {}, requestOptions?: User.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deleteUserSummaryInstructions(request, requestOptions)); } private async __deleteUserSummaryInstructions( - request: Zep.ApidataDeleteUserInstructionsRequest = {}, + request: Zep.DeleteUserInstructionsRequest = {}, requestOptions?: User.RequestOptions, ): Promise> { const _response = await (this._options.fetcher ?? core.fetcher)({ @@ -301,7 +301,7 @@ export class User { ), contentType: "application/json", requestType: "json", - body: serializers.ApidataDeleteUserInstructionsRequest.jsonOrThrow(request, { + body: serializers.DeleteUserInstructionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts b/src/api/resources/user/client/requests/AddUserInstructionsRequest.ts similarity index 90% rename from src/api/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts rename to src/api/resources/user/client/requests/AddUserInstructionsRequest.ts index 0d1d4bb5..6448f22c 100644 --- a/src/api/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts +++ b/src/api/resources/user/client/requests/AddUserInstructionsRequest.ts @@ -13,7 +13,7 @@ import * as Zep from "../../../../index.js"; * }] * } */ -export interface ApidataAddUserInstructionsRequest { +export interface AddUserInstructionsRequest { /** Instructions to add to the user summary generation. */ instructions: Zep.UserInstruction[]; /** User IDs to add the instructions to. If empty, the instructions are added to the project-wide default. */ diff --git a/src/api/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts b/src/api/resources/user/client/requests/DeleteUserInstructionsRequest.ts similarity index 88% rename from src/api/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts rename to src/api/resources/user/client/requests/DeleteUserInstructionsRequest.ts index f2b43df5..4a755dad 100644 --- a/src/api/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts +++ b/src/api/resources/user/client/requests/DeleteUserInstructionsRequest.ts @@ -6,7 +6,7 @@ * @example * {} */ -export interface ApidataDeleteUserInstructionsRequest { +export interface DeleteUserInstructionsRequest { /** Unique identifier for the instructions to be deleted. If empty deletes all instructions. */ instructionNames?: string[]; /** Determines which users will have their custom instructions deleted. If no users are provided, the project-wide custom instructions will be effected. */ diff --git a/src/api/resources/user/client/requests/index.ts b/src/api/resources/user/client/requests/index.ts index 211e1baf..5ae5bdd0 100644 --- a/src/api/resources/user/client/requests/index.ts +++ b/src/api/resources/user/client/requests/index.ts @@ -1,6 +1,6 @@ export { type UserListUserSummaryInstructionsRequest } from "./UserListUserSummaryInstructionsRequest.js"; -export { type ApidataAddUserInstructionsRequest } from "./ApidataAddUserInstructionsRequest.js"; -export { type ApidataDeleteUserInstructionsRequest } from "./ApidataDeleteUserInstructionsRequest.js"; +export { type AddUserInstructionsRequest } from "./AddUserInstructionsRequest.js"; +export { type DeleteUserInstructionsRequest } from "./DeleteUserInstructionsRequest.js"; export { type CreateUserRequest } from "./CreateUserRequest.js"; export { type UserListOrderedRequest } from "./UserListOrderedRequest.js"; export { type UpdateUserRequest } from "./UpdateUserRequest.js"; diff --git a/src/serialization/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts b/src/serialization/resources/user/client/requests/AddUserInstructionsRequest.ts similarity index 73% rename from src/serialization/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts rename to src/serialization/resources/user/client/requests/AddUserInstructionsRequest.ts index 3aedecc0..e6baa638 100644 --- a/src/serialization/resources/user/client/requests/ApidataAddUserInstructionsRequest.ts +++ b/src/serialization/resources/user/client/requests/AddUserInstructionsRequest.ts @@ -7,15 +7,15 @@ import * as Zep from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; import { UserInstruction } from "../../../../types/UserInstruction.js"; -export const ApidataAddUserInstructionsRequest: core.serialization.Schema< - serializers.ApidataAddUserInstructionsRequest.Raw, - Zep.ApidataAddUserInstructionsRequest +export const AddUserInstructionsRequest: core.serialization.Schema< + serializers.AddUserInstructionsRequest.Raw, + Zep.AddUserInstructionsRequest > = core.serialization.object({ instructions: core.serialization.list(UserInstruction), userIds: core.serialization.property("user_ids", core.serialization.list(core.serialization.string()).optional()), }); -export declare namespace ApidataAddUserInstructionsRequest { +export declare namespace AddUserInstructionsRequest { export interface Raw { instructions: UserInstruction.Raw[]; user_ids?: string[] | null; diff --git a/src/serialization/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts b/src/serialization/resources/user/client/requests/DeleteUserInstructionsRequest.ts similarity index 73% rename from src/serialization/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts rename to src/serialization/resources/user/client/requests/DeleteUserInstructionsRequest.ts index 48ccd8f6..4100d34e 100644 --- a/src/serialization/resources/user/client/requests/ApidataDeleteUserInstructionsRequest.ts +++ b/src/serialization/resources/user/client/requests/DeleteUserInstructionsRequest.ts @@ -6,9 +6,9 @@ import * as serializers from "../../../../index.js"; import * as Zep from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -export const ApidataDeleteUserInstructionsRequest: core.serialization.Schema< - serializers.ApidataDeleteUserInstructionsRequest.Raw, - Zep.ApidataDeleteUserInstructionsRequest +export const DeleteUserInstructionsRequest: core.serialization.Schema< + serializers.DeleteUserInstructionsRequest.Raw, + Zep.DeleteUserInstructionsRequest > = core.serialization.object({ instructionNames: core.serialization.property( "instruction_names", @@ -17,7 +17,7 @@ export const ApidataDeleteUserInstructionsRequest: core.serialization.Schema< userIds: core.serialization.property("user_ids", core.serialization.list(core.serialization.string()).optional()), }); -export declare namespace ApidataDeleteUserInstructionsRequest { +export declare namespace DeleteUserInstructionsRequest { export interface Raw { instruction_names?: string[] | null; user_ids?: string[] | null; diff --git a/src/serialization/resources/user/client/requests/index.ts b/src/serialization/resources/user/client/requests/index.ts index 238aa2b3..f1548afc 100644 --- a/src/serialization/resources/user/client/requests/index.ts +++ b/src/serialization/resources/user/client/requests/index.ts @@ -1,4 +1,4 @@ -export { ApidataAddUserInstructionsRequest } from "./ApidataAddUserInstructionsRequest.js"; -export { ApidataDeleteUserInstructionsRequest } from "./ApidataDeleteUserInstructionsRequest.js"; +export { AddUserInstructionsRequest } from "./AddUserInstructionsRequest.js"; +export { DeleteUserInstructionsRequest } from "./DeleteUserInstructionsRequest.js"; export { CreateUserRequest } from "./CreateUserRequest.js"; export { UpdateUserRequest } from "./UpdateUserRequest.js"; From 9bc025bbbbf463d0005d037759b9fcc47c81df78 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Mon, 17 Nov 2025 12:26:56 -0500 Subject: [PATCH 46/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d6219653..685f83d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.10.0", + "version": "3.11.0", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From f00a0b04be1cbbc97a82fd0ad8e6d336d9ee2222 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 17 Nov 2025 17:31:42 +0000 Subject: [PATCH 47/59] SDK regeneration --- reference.md | 45 +++++++++++++++---- src/Client.ts | 4 +- src/api/resources/graph/client/Client.ts | 10 ++++- .../client/requests/GraphListAllRequest.ts | 5 ++- .../requests/GraphListEntityTypesRequest.ts | 5 ++- .../graph/resources/episode/client/Client.ts | 8 +++- .../requests/EpisodeGetByGraphIdRequest.ts | 4 +- .../requests/EpisodeGetByUserIdRequest.ts | 4 +- src/api/resources/thread/client/Client.ts | 18 ++++++-- .../client/requests/ThreadGetRequest.ts | 6 ++- .../requests/ThreadGetUserContextRequest.ts | 7 ++- .../client/requests/ThreadListAllRequest.ts | 7 ++- src/api/resources/user/client/Client.ts | 9 +++- .../client/requests/UserListOrderedRequest.ts | 5 ++- .../UserListUserSummaryInstructionsRequest.ts | 4 +- src/version.ts | 2 +- tests/wire/graph.test.ts | 10 ++++- tests/wire/graph/episode.test.ts | 8 +++- tests/wire/thread.test.ts | 18 ++++++-- tests/wire/user.test.ts | 9 +++- 20 files changed, 148 insertions(+), 40 deletions(-) diff --git a/reference.md b/reference.md index 0e58e986..48a1f904 100644 --- a/reference.md +++ b/reference.md @@ -30,7 +30,10 @@ Returns all entity types for a project, user, or graph.
```typescript -await client.graph.listEntityTypes(); +await client.graph.listEntityTypes({ + userId: "user_id", + graphId: "graph_id", +}); ```
@@ -487,7 +490,10 @@ Returns all graphs. In order to list users, use user.list_ordered instead
```typescript -await client.graph.listAll(); +await client.graph.listAll({ + pageNumber: 1, + pageSize: 1, +}); ```
@@ -871,7 +877,12 @@ Returns all threads.
```typescript -await client.thread.listAll(); +await client.thread.listAll({ + pageNumber: 1, + pageSize: 1, + orderBy: "order_by", + asc: true, +}); ```
@@ -1063,7 +1074,10 @@ Returns most relevant context from the user graph (including memory from any/all
```typescript -await client.thread.getUserContext("threadId"); +await client.thread.getUserContext("threadId", { + minRating: 1.1, + mode: "basic", +}); ```
@@ -1134,7 +1148,11 @@ Returns messages for a thread.
```typescript -await client.thread.get("threadId"); +await client.thread.get("threadId", { + limit: 1, + cursor: 1000000, + lastn: 1, +}); ```
@@ -1363,7 +1381,9 @@ Lists all user summary instructions for a project, user.
```typescript -await client.user.listUserSummaryInstructions(); +await client.user.listUserSummaryInstructions({ + userId: "user_id", +}); ```
@@ -1624,7 +1644,10 @@ Returns all users.
```typescript -await client.user.listOrdered(); +await client.user.listOrdered({ + pageNumber: 1, + pageSize: 1, +}); ```
@@ -2345,7 +2368,9 @@ Returns episodes by graph id.
```typescript -await client.graph.episode.getByGraphId("graph_id"); +await client.graph.episode.getByGraphId("graph_id", { + lastn: 1, +}); ```
@@ -2416,7 +2441,9 @@ Returns episodes by user id.
```typescript -await client.graph.episode.getByUserId("user_id"); +await client.graph.episode.getByUserId("user_id", { + lastn: 1, +}); ```
diff --git a/src/Client.ts b/src/Client.ts index 5300bc7f..e505b5f8 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -47,8 +47,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.10.0", - "User-Agent": "zep-cloud/3.10.0", + "X-Fern-SDK-Version": "3.11.0", + "User-Agent": "zep-cloud/3.11.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index 43dff1a3..07dd45d6 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -68,7 +68,10 @@ export class Graph { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.listEntityTypes() + * await client.graph.listEntityTypes({ + * userId: "user_id", + * graphId: "graph_id" + * }) */ public listEntityTypes( request: Zep.GraphListEntityTypesRequest = {}, @@ -861,7 +864,10 @@ export class Graph { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.listAll() + * await client.graph.listAll({ + * pageNumber: 1, + * pageSize: 1 + * }) */ public listAll( request: Zep.GraphListAllRequest = {}, diff --git a/src/api/resources/graph/client/requests/GraphListAllRequest.ts b/src/api/resources/graph/client/requests/GraphListAllRequest.ts index 791d5043..479ab286 100644 --- a/src/api/resources/graph/client/requests/GraphListAllRequest.ts +++ b/src/api/resources/graph/client/requests/GraphListAllRequest.ts @@ -4,7 +4,10 @@ /** * @example - * {} + * { + * pageNumber: 1, + * pageSize: 1 + * } */ export interface GraphListAllRequest { /** diff --git a/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts b/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts index 8fb0fdc2..6d00f137 100644 --- a/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts +++ b/src/api/resources/graph/client/requests/GraphListEntityTypesRequest.ts @@ -4,7 +4,10 @@ /** * @example - * {} + * { + * userId: "user_id", + * graphId: "graph_id" + * } */ export interface GraphListEntityTypesRequest { /** diff --git a/src/api/resources/graph/resources/episode/client/Client.ts b/src/api/resources/graph/resources/episode/client/Client.ts index 54372ddf..635e650f 100644 --- a/src/api/resources/graph/resources/episode/client/Client.ts +++ b/src/api/resources/graph/resources/episode/client/Client.ts @@ -50,7 +50,9 @@ export class Episode { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.episode.getByGraphId("graph_id") + * await client.graph.episode.getByGraphId("graph_id", { + * lastn: 1 + * }) */ public getByGraphId( graphId: string, @@ -163,7 +165,9 @@ export class Episode { * @throws {@link Zep.InternalServerError} * * @example - * await client.graph.episode.getByUserId("user_id") + * await client.graph.episode.getByUserId("user_id", { + * lastn: 1 + * }) */ public getByUserId( userId: string, diff --git a/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.ts b/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.ts index caecc192..72918505 100644 --- a/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.ts +++ b/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByGraphIdRequest.ts @@ -4,7 +4,9 @@ /** * @example - * {} + * { + * lastn: 1 + * } */ export interface EpisodeGetByGraphIdRequest { /** diff --git a/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.ts b/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.ts index 8b9290a6..3787ecb0 100644 --- a/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.ts +++ b/src/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.ts @@ -4,7 +4,9 @@ /** * @example - * {} + * { + * lastn: 1 + * } */ export interface EpisodeGetByUserIdRequest { /** diff --git a/src/api/resources/thread/client/Client.ts b/src/api/resources/thread/client/Client.ts index 19448d02..e974ac43 100644 --- a/src/api/resources/thread/client/Client.ts +++ b/src/api/resources/thread/client/Client.ts @@ -55,7 +55,12 @@ export class Thread { * @throws {@link Zep.InternalServerError} * * @example - * await client.thread.listAll() + * await client.thread.listAll({ + * pageNumber: 1, + * pageSize: 1, + * orderBy: "order_by", + * asc: true + * }) */ public listAll( request: Zep.ThreadListAllRequest = {}, @@ -393,7 +398,10 @@ export class Thread { * @throws {@link Zep.InternalServerError} * * @example - * await client.thread.getUserContext("threadId") + * await client.thread.getUserContext("threadId", { + * minRating: 1.1, + * mode: "basic" + * }) */ public getUserContext( threadId: string, @@ -513,7 +521,11 @@ export class Thread { * @throws {@link Zep.InternalServerError} * * @example - * await client.thread.get("threadId") + * await client.thread.get("threadId", { + * limit: 1, + * cursor: 1000000, + * lastn: 1 + * }) */ public get( threadId: string, diff --git a/src/api/resources/thread/client/requests/ThreadGetRequest.ts b/src/api/resources/thread/client/requests/ThreadGetRequest.ts index d0e9a602..0f071024 100644 --- a/src/api/resources/thread/client/requests/ThreadGetRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadGetRequest.ts @@ -4,7 +4,11 @@ /** * @example - * {} + * { + * limit: 1, + * cursor: 1000000, + * lastn: 1 + * } */ export interface ThreadGetRequest { /** diff --git a/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts b/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts index 168143d5..38cf6f00 100644 --- a/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts @@ -6,7 +6,10 @@ import * as Zep from "../../../../index.js"; /** * @example - * {} + * { + * minRating: 1.1, + * mode: "basic" + * } */ export interface ThreadGetUserContextRequest { /** @@ -14,7 +17,7 @@ export interface ThreadGetUserContextRequest { */ minRating?: number; /** - * Defaults to summary mode. Use basic for lower latency + * Deprecated, this field will be removed in a future release. Defaults to summary mode. Use basic for lower latency */ mode?: Zep.ThreadGetUserContextRequestMode; } diff --git a/src/api/resources/thread/client/requests/ThreadListAllRequest.ts b/src/api/resources/thread/client/requests/ThreadListAllRequest.ts index 9a397cef..215c6a70 100644 --- a/src/api/resources/thread/client/requests/ThreadListAllRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadListAllRequest.ts @@ -4,7 +4,12 @@ /** * @example - * {} + * { + * pageNumber: 1, + * pageSize: 1, + * orderBy: "order_by", + * asc: true + * } */ export interface ThreadListAllRequest { /** diff --git a/src/api/resources/user/client/Client.ts b/src/api/resources/user/client/Client.ts index bf711769..30276628 100644 --- a/src/api/resources/user/client/Client.ts +++ b/src/api/resources/user/client/Client.ts @@ -49,7 +49,9 @@ export class User { * @throws {@link Zep.InternalServerError} * * @example - * await client.user.listUserSummaryInstructions() + * await client.user.listUserSummaryInstructions({ + * userId: "user_id" + * }) */ public listUserSummaryInstructions( request: Zep.UserListUserSummaryInstructionsRequest = {}, @@ -493,7 +495,10 @@ export class User { * @throws {@link Zep.InternalServerError} * * @example - * await client.user.listOrdered() + * await client.user.listOrdered({ + * pageNumber: 1, + * pageSize: 1 + * }) */ public listOrdered( request: Zep.UserListOrderedRequest = {}, diff --git a/src/api/resources/user/client/requests/UserListOrderedRequest.ts b/src/api/resources/user/client/requests/UserListOrderedRequest.ts index 62c9469b..774dfb05 100644 --- a/src/api/resources/user/client/requests/UserListOrderedRequest.ts +++ b/src/api/resources/user/client/requests/UserListOrderedRequest.ts @@ -4,7 +4,10 @@ /** * @example - * {} + * { + * pageNumber: 1, + * pageSize: 1 + * } */ export interface UserListOrderedRequest { /** diff --git a/src/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.ts b/src/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.ts index 433b2cb6..a9c32b1f 100644 --- a/src/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.ts +++ b/src/api/resources/user/client/requests/UserListUserSummaryInstructionsRequest.ts @@ -4,7 +4,9 @@ /** * @example - * {} + * { + * userId: "user_id" + * } */ export interface UserListUserSummaryInstructionsRequest { /** diff --git a/src/version.ts b/src/version.ts index d13909b2..07289abf 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.10.0"; +export const SDK_VERSION = "3.11.0"; diff --git a/tests/wire/graph.test.ts b/tests/wire/graph.test.ts index 4949749e..78044f2b 100644 --- a/tests/wire/graph.test.ts +++ b/tests/wire/graph.test.ts @@ -29,7 +29,10 @@ describe("Graph", () => { }; server.mockEndpoint().get("/entity-types").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.graph.listEntityTypes(); + const response = await client.graph.listEntityTypes({ + userId: "user_id", + graphId: "graph_id", + }); expect(response).toEqual({ edgeTypes: [ { @@ -377,7 +380,10 @@ describe("Graph", () => { }; server.mockEndpoint().get("/graph/list-all").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.graph.listAll(); + const response = await client.graph.listAll({ + pageNumber: 1, + pageSize: 1, + }); expect(response).toEqual({ graphs: [ { diff --git a/tests/wire/graph/episode.test.ts b/tests/wire/graph/episode.test.ts index fb57bd39..97f541a2 100644 --- a/tests/wire/graph/episode.test.ts +++ b/tests/wire/graph/episode.test.ts @@ -36,7 +36,9 @@ describe("Episode", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.graph.episode.getByGraphId("graph_id"); + const response = await client.graph.episode.getByGraphId("graph_id", { + lastn: 1, + }); expect(response).toEqual({ episodes: [ { @@ -89,7 +91,9 @@ describe("Episode", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.graph.episode.getByUserId("user_id"); + const response = await client.graph.episode.getByUserId("user_id", { + lastn: 1, + }); expect(response).toEqual({ episodes: [ { diff --git a/tests/wire/thread.test.ts b/tests/wire/thread.test.ts index 2321a472..9721a839 100644 --- a/tests/wire/thread.test.ts +++ b/tests/wire/thread.test.ts @@ -25,7 +25,12 @@ describe("Thread", () => { }; server.mockEndpoint().get("/threads").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.thread.listAll(); + const response = await client.thread.listAll({ + pageNumber: 1, + pageSize: 1, + orderBy: "order_by", + asc: true, + }); expect(response).toEqual({ responseCount: 1, threads: [ @@ -106,7 +111,10 @@ describe("Thread", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.thread.getUserContext("threadId"); + const response = await client.thread.getUserContext("threadId", { + minRating: 1.1, + mode: "basic", + }); expect(response).toEqual({ context: "context", }); @@ -139,7 +147,11 @@ describe("Thread", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.thread.get("threadId"); + const response = await client.thread.get("threadId", { + limit: 1, + cursor: 1000000, + lastn: 1, + }); expect(response).toEqual({ messages: [ { diff --git a/tests/wire/user.test.ts b/tests/wire/user.test.ts index cd2dcb71..b0d2dcb3 100644 --- a/tests/wire/user.test.ts +++ b/tests/wire/user.test.ts @@ -19,7 +19,9 @@ describe("User", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.user.listUserSummaryInstructions(); + const response = await client.user.listUserSummaryInstructions({ + userId: "user_id", + }); expect(response).toEqual({ instructions: [ { @@ -166,7 +168,10 @@ describe("User", () => { }; server.mockEndpoint().get("/users-ordered").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.user.listOrdered(); + const response = await client.user.listOrdered({ + pageNumber: 1, + pageSize: 1, + }); expect(response).toEqual({ rowCount: 1, totalCount: 1, From a716878ebc4b1d7d6fc6d7f82b68d14cb3d43183 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 17 Nov 2025 17:47:50 +0000 Subject: [PATCH 48/59] SDK regeneration --- reference.md | 2 +- src/api/resources/thread/client/Client.ts | 2 +- src/api/resources/thread/client/requests/ThreadGetRequest.ts | 2 +- .../thread/client/requests/ThreadGetUserContextRequest.ts | 2 +- tests/wire/thread.test.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference.md b/reference.md index 48a1f904..568506ff 100644 --- a/reference.md +++ b/reference.md @@ -1150,7 +1150,7 @@ Returns messages for a thread. ```typescript await client.thread.get("threadId", { limit: 1, - cursor: 1000000, + cursor: 1, lastn: 1, }); ``` diff --git a/src/api/resources/thread/client/Client.ts b/src/api/resources/thread/client/Client.ts index e974ac43..f1bfd4fb 100644 --- a/src/api/resources/thread/client/Client.ts +++ b/src/api/resources/thread/client/Client.ts @@ -523,7 +523,7 @@ export class Thread { * @example * await client.thread.get("threadId", { * limit: 1, - * cursor: 1000000, + * cursor: 1, * lastn: 1 * }) */ diff --git a/src/api/resources/thread/client/requests/ThreadGetRequest.ts b/src/api/resources/thread/client/requests/ThreadGetRequest.ts index 0f071024..af33f506 100644 --- a/src/api/resources/thread/client/requests/ThreadGetRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadGetRequest.ts @@ -6,7 +6,7 @@ * @example * { * limit: 1, - * cursor: 1000000, + * cursor: 1, * lastn: 1 * } */ diff --git a/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts b/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts index 38cf6f00..859ef0a7 100644 --- a/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts @@ -17,7 +17,7 @@ export interface ThreadGetUserContextRequest { */ minRating?: number; /** - * Deprecated, this field will be removed in a future release. Defaults to summary mode. Use basic for lower latency + * Defaults to summary mode. Use basic for lower latency */ mode?: Zep.ThreadGetUserContextRequestMode; } diff --git a/tests/wire/thread.test.ts b/tests/wire/thread.test.ts index 9721a839..39f10828 100644 --- a/tests/wire/thread.test.ts +++ b/tests/wire/thread.test.ts @@ -149,7 +149,7 @@ describe("Thread", () => { const response = await client.thread.get("threadId", { limit: 1, - cursor: 1000000, + cursor: 1, lastn: 1, }); expect(response).toEqual({ From 0bf30a0e0006fe92a2cf85eec167dfe5dfc5f15c Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 17 Nov 2025 19:49:44 +0000 Subject: [PATCH 49/59] SDK regeneration --- reference.md | 323 +++++++++ src/Client.ts | 6 + src/api/errors/index.ts | 2 +- src/api/resources/context/client/Client.ts | 616 ++++++++++++++++++ src/api/resources/context/client/index.ts | 2 + .../requests/CreateContextTemplateRequest.ts | 17 + .../requests/UpdateContextTemplateRequest.ts | 14 + .../context/client/requests/index.ts | 2 + src/api/resources/context/index.ts | 1 + src/api/resources/index.ts | 2 + src/api/resources/thread/client/Client.ts | 7 +- .../requests/ThreadGetUserContextRequest.ts | 7 +- src/api/types/ContextTemplateResponse.ts | 12 + src/api/types/ListContextTemplatesResponse.ts | 9 + src/api/types/index.ts | 2 + .../resources/context/client/index.ts | 1 + .../requests/CreateContextTemplateRequest.ts | 22 + .../requests/UpdateContextTemplateRequest.ts | 20 + .../context/client/requests/index.ts | 2 + src/serialization/resources/context/index.ts | 1 + src/serialization/resources/index.ts | 2 + .../types/ContextTemplateResponse.ts | 24 + .../types/ListContextTemplatesResponse.ts | 21 + src/serialization/types/index.ts | 2 + tests/wire/context.test.ts | 116 ++++ tests/wire/thread.test.ts | 1 + 26 files changed, 1231 insertions(+), 3 deletions(-) create mode 100644 src/api/resources/context/client/Client.ts create mode 100644 src/api/resources/context/client/index.ts create mode 100644 src/api/resources/context/client/requests/CreateContextTemplateRequest.ts create mode 100644 src/api/resources/context/client/requests/UpdateContextTemplateRequest.ts create mode 100644 src/api/resources/context/client/requests/index.ts create mode 100644 src/api/resources/context/index.ts create mode 100644 src/api/types/ContextTemplateResponse.ts create mode 100644 src/api/types/ListContextTemplatesResponse.ts create mode 100644 src/serialization/resources/context/client/index.ts create mode 100644 src/serialization/resources/context/client/requests/CreateContextTemplateRequest.ts create mode 100644 src/serialization/resources/context/client/requests/UpdateContextTemplateRequest.ts create mode 100644 src/serialization/resources/context/client/requests/index.ts create mode 100644 src/serialization/resources/context/index.ts create mode 100644 src/serialization/types/ContextTemplateResponse.ts create mode 100644 src/serialization/types/ListContextTemplatesResponse.ts create mode 100644 tests/wire/context.test.ts diff --git a/reference.md b/reference.md index 568506ff..f040ef0d 100644 --- a/reference.md +++ b/reference.md @@ -1,5 +1,327 @@ # Reference +## Context + +
client.context.listContextTemplates() -> Zep.ListContextTemplatesResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists all context templates. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.context.listContextTemplates(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `Context.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.context.createContextTemplate({ ...params }) -> Zep.ContextTemplateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new context template. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.context.createContextTemplate({ + template: "template", + templateId: "template_id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Zep.CreateContextTemplateRequest` + +
+
+ +
+
+ +**requestOptions:** `Context.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.context.getContextTemplate(templateId) -> Zep.ContextTemplateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves a context template by template_id. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.context.getContextTemplate("template_id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**templateId:** `string` — Template ID + +
+
+ +
+
+ +**requestOptions:** `Context.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.context.updateContextTemplate(templateId, { ...params }) -> Zep.ContextTemplateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an existing context template by template_id. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.context.updateContextTemplate("template_id", { + template: "template", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**templateId:** `string` — Template ID + +
+
+ +
+
+ +**request:** `Zep.UpdateContextTemplateRequest` + +
+
+ +
+
+ +**requestOptions:** `Context.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.context.deleteContextTemplate(templateId) -> Zep.SuccessResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes a context template by template_id. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.context.deleteContextTemplate("template_id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**templateId:** `string` — Template ID + +
+
+ +
+
+ +**requestOptions:** `Context.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Graph
client.graph.listEntityTypes({ ...params }) -> Zep.EntityTypeResponse @@ -1076,6 +1398,7 @@ Returns most relevant context from the user graph (including memory from any/all ```typescript await client.thread.getUserContext("threadId", { minRating: 1.1, + templateId: "template_id", mode: "basic", }); ``` diff --git a/src/Client.ts b/src/Client.ts index e505b5f8..9cd2409f 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -5,6 +5,7 @@ import * as environments from "./environments.js"; import * as core from "./core/index.js"; import { mergeHeaders } from "./core/headers.js"; +import { Context } from "./api/resources/context/client/Client.js"; import { Graph } from "./api/resources/graph/client/Client.js"; import { Project } from "./api/resources/project/client/Client.js"; import { Thread } from "./api/resources/thread/client/Client.js"; @@ -35,6 +36,7 @@ export declare namespace ZepClient { export class ZepClient { protected readonly _options: ZepClient.Options; + protected _context: Context | undefined; protected _graph: Graph | undefined; protected _project: Project | undefined; protected _thread: Thread | undefined; @@ -57,6 +59,10 @@ export class ZepClient { }; } + public get context(): Context { + return (this._context ??= new Context(this._options)); + } + public get graph(): Graph { return (this._graph ??= new Graph(this._options)); } diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts index 70ff361a..bea874f4 100644 --- a/src/api/errors/index.ts +++ b/src/api/errors/index.ts @@ -1,3 +1,3 @@ export * from "./BadRequestError.js"; -export * from "./NotFoundError.js"; export * from "./InternalServerError.js"; +export * from "./NotFoundError.js"; diff --git a/src/api/resources/context/client/Client.ts b/src/api/resources/context/client/Client.ts new file mode 100644 index 00000000..65130026 --- /dev/null +++ b/src/api/resources/context/client/Client.ts @@ -0,0 +1,616 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments.js"; +import * as core from "../../../../core/index.js"; +import * as Zep from "../../../index.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import * as serializers from "../../../../serialization/index.js"; +import * as errors from "../../../../errors/index.js"; + +export declare namespace Context { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + apiKey?: core.Supplier; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } + + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } +} + +export class Context { + protected readonly _options: Context.Options; + + constructor(_options: Context.Options = {}) { + this._options = _options; + } + + /** + * Lists all context templates. + * + * @param {Context.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.BadRequestError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.context.listContextTemplates() + */ + public listContextTemplates( + requestOptions?: Context.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__listContextTemplates(requestOptions)); + } + + private async __listContextTemplates( + requestOptions?: Context.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + "context-templates", + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.ListContextTemplatesResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Zep.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /context-templates."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Creates a new context template. + * + * @param {Zep.CreateContextTemplateRequest} request + * @param {Context.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.BadRequestError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.context.createContextTemplate({ + * template: "template", + * templateId: "template_id" + * }) + */ + public createContextTemplate( + request: Zep.CreateContextTemplateRequest, + requestOptions?: Context.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createContextTemplate(request, requestOptions)); + } + + private async __createContextTemplate( + request: Zep.CreateContextTemplateRequest, + requestOptions?: Context.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + "context-templates", + ), + method: "POST", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.CreateContextTemplateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.ContextTemplateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Zep.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /context-templates."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Retrieves a context template by template_id. + * + * @param {string} templateId - Template ID + * @param {Context.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.BadRequestError} + * @throws {@link Zep.NotFoundError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.context.getContextTemplate("template_id") + */ + public getContextTemplate( + templateId: string, + requestOptions?: Context.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getContextTemplate(templateId, requestOptions)); + } + + private async __getContextTemplate( + templateId: string, + requestOptions?: Context.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + `context-templates/${encodeURIComponent(templateId)}`, + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.ContextTemplateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Zep.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Zep.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /context-templates/{template_id}."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Updates an existing context template by template_id. + * + * @param {string} templateId - Template ID + * @param {Zep.UpdateContextTemplateRequest} request + * @param {Context.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.BadRequestError} + * @throws {@link Zep.NotFoundError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.context.updateContextTemplate("template_id", { + * template: "template" + * }) + */ + public updateContextTemplate( + templateId: string, + request: Zep.UpdateContextTemplateRequest, + requestOptions?: Context.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateContextTemplate(templateId, request, requestOptions)); + } + + private async __updateContextTemplate( + templateId: string, + request: Zep.UpdateContextTemplateRequest, + requestOptions?: Context.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + `context-templates/${encodeURIComponent(templateId)}`, + ), + method: "PUT", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.UpdateContextTemplateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.ContextTemplateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Zep.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Zep.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling PUT /context-templates/{template_id}."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Deletes a context template by template_id. + * + * @param {string} templateId - Template ID + * @param {Context.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.BadRequestError} + * @throws {@link Zep.NotFoundError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.context.deleteContextTemplate("template_id") + */ + public deleteContextTemplate( + templateId: string, + requestOptions?: Context.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteContextTemplate(templateId, requestOptions)); + } + + private async __deleteContextTemplate( + templateId: string, + requestOptions?: Context.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + `context-templates/${encodeURIComponent(templateId)}`, + ), + method: "DELETE", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.SuccessResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Zep.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Zep.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError( + "Timeout exceeded when calling DELETE /context-templates/{template_id}.", + ); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + protected async _getCustomAuthorizationHeaders() { + const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["ZEP_API_KEY"]; + return { Authorization: `Api-Key ${apiKeyValue}` }; + } +} diff --git a/src/api/resources/context/client/index.ts b/src/api/resources/context/client/index.ts new file mode 100644 index 00000000..82648c6f --- /dev/null +++ b/src/api/resources/context/client/index.ts @@ -0,0 +1,2 @@ +export {}; +export * from "./requests/index.js"; diff --git a/src/api/resources/context/client/requests/CreateContextTemplateRequest.ts b/src/api/resources/context/client/requests/CreateContextTemplateRequest.ts new file mode 100644 index 00000000..0806b5b7 --- /dev/null +++ b/src/api/resources/context/client/requests/CreateContextTemplateRequest.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * template: "template", + * templateId: "template_id" + * } + */ +export interface CreateContextTemplateRequest { + /** The template content (max 1200 characters). */ + template: string; + /** Unique identifier for the template (max 100 characters). */ + templateId: string; +} diff --git a/src/api/resources/context/client/requests/UpdateContextTemplateRequest.ts b/src/api/resources/context/client/requests/UpdateContextTemplateRequest.ts new file mode 100644 index 00000000..f541ad8f --- /dev/null +++ b/src/api/resources/context/client/requests/UpdateContextTemplateRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * template: "template" + * } + */ +export interface UpdateContextTemplateRequest { + /** The template content (max 1200 characters). */ + template: string; +} diff --git a/src/api/resources/context/client/requests/index.ts b/src/api/resources/context/client/requests/index.ts new file mode 100644 index 00000000..78348f7b --- /dev/null +++ b/src/api/resources/context/client/requests/index.ts @@ -0,0 +1,2 @@ +export { type CreateContextTemplateRequest } from "./CreateContextTemplateRequest.js"; +export { type UpdateContextTemplateRequest } from "./UpdateContextTemplateRequest.js"; diff --git a/src/api/resources/context/index.ts b/src/api/resources/context/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/context/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 56455802..580f1e22 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,8 +1,10 @@ export * as thread from "./thread/index.js"; export * from "./thread/types/index.js"; +export * as context from "./context/index.js"; export * as graph from "./graph/index.js"; export * as project from "./project/index.js"; export * as user from "./user/index.js"; +export * from "./context/client/requests/index.js"; export * from "./graph/client/requests/index.js"; export * from "./thread/client/requests/index.js"; export * from "./user/client/requests/index.js"; diff --git a/src/api/resources/thread/client/Client.ts b/src/api/resources/thread/client/Client.ts index f1bfd4fb..1129c765 100644 --- a/src/api/resources/thread/client/Client.ts +++ b/src/api/resources/thread/client/Client.ts @@ -400,6 +400,7 @@ export class Thread { * @example * await client.thread.getUserContext("threadId", { * minRating: 1.1, + * templateId: "template_id", * mode: "basic" * }) */ @@ -416,12 +417,16 @@ export class Thread { request: Zep.ThreadGetUserContextRequest = {}, requestOptions?: Thread.RequestOptions, ): Promise> { - const { minRating, mode } = request; + const { minRating, templateId, mode } = request; const _queryParams: Record = {}; if (minRating != null) { _queryParams["minRating"] = minRating.toString(); } + if (templateId != null) { + _queryParams["template_id"] = templateId; + } + if (mode != null) { _queryParams["mode"] = serializers.ThreadGetUserContextRequestMode.jsonOrThrow(mode, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts b/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts index 859ef0a7..6556c672 100644 --- a/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts @@ -8,6 +8,7 @@ import * as Zep from "../../../../index.js"; * @example * { * minRating: 1.1, + * templateId: "template_id", * mode: "basic" * } */ @@ -17,7 +18,11 @@ export interface ThreadGetUserContextRequest { */ minRating?: number; /** - * Defaults to summary mode. Use basic for lower latency + * Optional template ID to use for custom context rendering. + */ + templateId?: string; + /** + * Deprecated, this field will be removed in a future release. Defaults to summary mode. Use basic for lower latency */ mode?: Zep.ThreadGetUserContextRequestMode; } diff --git a/src/api/types/ContextTemplateResponse.ts b/src/api/types/ContextTemplateResponse.ts new file mode 100644 index 00000000..1fca782e --- /dev/null +++ b/src/api/types/ContextTemplateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ContextTemplateResponse { + /** The template content. */ + template?: string; + /** Unique identifier for the template (max 100 characters). */ + templateId?: string; + /** Unique identifier for the template. */ + uuid?: string; +} diff --git a/src/api/types/ListContextTemplatesResponse.ts b/src/api/types/ListContextTemplatesResponse.ts new file mode 100644 index 00000000..01026645 --- /dev/null +++ b/src/api/types/ListContextTemplatesResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Zep from "../index.js"; + +export interface ListContextTemplatesResponse { + templates?: Zep.ContextTemplateResponse[]; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 2ba7e473..71efede7 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -2,6 +2,7 @@ export * from "./ApiError.js"; export * from "./AddThreadMessagesRequest.js"; export * from "./AddThreadMessagesResponse.js"; export * from "./CloneGraphResponse.js"; +export * from "./ContextTemplateResponse.js"; export * from "./EdgeType.js"; export * from "./EntityEdgeSourceTarget.js"; export * from "./EntityProperty.js"; @@ -18,6 +19,7 @@ export * from "./EpisodeResponse.js"; export * from "./GraphListResponse.js"; export * from "./GraphNodesRequest.js"; export * from "./GraphSearchResults.js"; +export * from "./ListContextTemplatesResponse.js"; export * from "./ListUserInstructionsResponse.js"; export * from "./ProjectInfo.js"; export * from "./ProjectInfoResponse.js"; diff --git a/src/serialization/resources/context/client/index.ts b/src/serialization/resources/context/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/serialization/resources/context/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/serialization/resources/context/client/requests/CreateContextTemplateRequest.ts b/src/serialization/resources/context/client/requests/CreateContextTemplateRequest.ts new file mode 100644 index 00000000..7e9c80d7 --- /dev/null +++ b/src/serialization/resources/context/client/requests/CreateContextTemplateRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index.js"; +import * as Zep from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; + +export const CreateContextTemplateRequest: core.serialization.Schema< + serializers.CreateContextTemplateRequest.Raw, + Zep.CreateContextTemplateRequest +> = core.serialization.object({ + template: core.serialization.string(), + templateId: core.serialization.property("template_id", core.serialization.string()), +}); + +export declare namespace CreateContextTemplateRequest { + export interface Raw { + template: string; + template_id: string; + } +} diff --git a/src/serialization/resources/context/client/requests/UpdateContextTemplateRequest.ts b/src/serialization/resources/context/client/requests/UpdateContextTemplateRequest.ts new file mode 100644 index 00000000..61b69e74 --- /dev/null +++ b/src/serialization/resources/context/client/requests/UpdateContextTemplateRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index.js"; +import * as Zep from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; + +export const UpdateContextTemplateRequest: core.serialization.Schema< + serializers.UpdateContextTemplateRequest.Raw, + Zep.UpdateContextTemplateRequest +> = core.serialization.object({ + template: core.serialization.string(), +}); + +export declare namespace UpdateContextTemplateRequest { + export interface Raw { + template: string; + } +} diff --git a/src/serialization/resources/context/client/requests/index.ts b/src/serialization/resources/context/client/requests/index.ts new file mode 100644 index 00000000..da25886a --- /dev/null +++ b/src/serialization/resources/context/client/requests/index.ts @@ -0,0 +1,2 @@ +export { CreateContextTemplateRequest } from "./CreateContextTemplateRequest.js"; +export { UpdateContextTemplateRequest } from "./UpdateContextTemplateRequest.js"; diff --git a/src/serialization/resources/context/index.ts b/src/serialization/resources/context/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/serialization/resources/context/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index 42b0d868..296bbffd 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -2,6 +2,8 @@ export * as thread from "./thread/index.js"; export * from "./thread/types/index.js"; export * as graph from "./graph/index.js"; export * as user from "./user/index.js"; +export * as context from "./context/index.js"; +export * from "./context/client/requests/index.js"; export * from "./graph/client/requests/index.js"; export * from "./thread/client/requests/index.js"; export * from "./user/client/requests/index.js"; diff --git a/src/serialization/types/ContextTemplateResponse.ts b/src/serialization/types/ContextTemplateResponse.ts new file mode 100644 index 00000000..2a2aae54 --- /dev/null +++ b/src/serialization/types/ContextTemplateResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; + +export const ContextTemplateResponse: core.serialization.ObjectSchema< + serializers.ContextTemplateResponse.Raw, + Zep.ContextTemplateResponse +> = core.serialization.object({ + template: core.serialization.string().optional(), + templateId: core.serialization.property("template_id", core.serialization.string().optional()), + uuid: core.serialization.string().optional(), +}); + +export declare namespace ContextTemplateResponse { + export interface Raw { + template?: string | null; + template_id?: string | null; + uuid?: string | null; + } +} diff --git a/src/serialization/types/ListContextTemplatesResponse.ts b/src/serialization/types/ListContextTemplatesResponse.ts new file mode 100644 index 00000000..eeb3b3c1 --- /dev/null +++ b/src/serialization/types/ListContextTemplatesResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { ContextTemplateResponse } from "./ContextTemplateResponse.js"; + +export const ListContextTemplatesResponse: core.serialization.ObjectSchema< + serializers.ListContextTemplatesResponse.Raw, + Zep.ListContextTemplatesResponse +> = core.serialization.object({ + templates: core.serialization.list(ContextTemplateResponse).optional(), +}); + +export declare namespace ListContextTemplatesResponse { + export interface Raw { + templates?: ContextTemplateResponse.Raw[] | null; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 2ba7e473..71efede7 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -2,6 +2,7 @@ export * from "./ApiError.js"; export * from "./AddThreadMessagesRequest.js"; export * from "./AddThreadMessagesResponse.js"; export * from "./CloneGraphResponse.js"; +export * from "./ContextTemplateResponse.js"; export * from "./EdgeType.js"; export * from "./EntityEdgeSourceTarget.js"; export * from "./EntityProperty.js"; @@ -18,6 +19,7 @@ export * from "./EpisodeResponse.js"; export * from "./GraphListResponse.js"; export * from "./GraphNodesRequest.js"; export * from "./GraphSearchResults.js"; +export * from "./ListContextTemplatesResponse.js"; export * from "./ListUserInstructionsResponse.js"; export * from "./ProjectInfo.js"; export * from "./ProjectInfoResponse.js"; diff --git a/tests/wire/context.test.ts b/tests/wire/context.test.ts new file mode 100644 index 00000000..c3d4912a --- /dev/null +++ b/tests/wire/context.test.ts @@ -0,0 +1,116 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import { mockServerPool } from "../mock-server/MockServerPool"; +import { ZepClient } from "../../src/Client"; + +describe("Context", () => { + test("list_context_templates", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { templates: [{ template: "template", template_id: "template_id", uuid: "uuid" }] }; + server.mockEndpoint().get("/context-templates").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.context.listContextTemplates(); + expect(response).toEqual({ + templates: [ + { + template: "template", + templateId: "template_id", + uuid: "uuid", + }, + ], + }); + }); + + test("create_context_template", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { template: "template", template_id: "template_id" }; + const rawResponseBody = { template: "template", template_id: "template_id", uuid: "uuid" }; + server + .mockEndpoint() + .post("/context-templates") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.context.createContextTemplate({ + template: "template", + templateId: "template_id", + }); + expect(response).toEqual({ + template: "template", + templateId: "template_id", + uuid: "uuid", + }); + }); + + test("get_context_template", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { template: "template", template_id: "template_id", uuid: "uuid" }; + server + .mockEndpoint() + .get("/context-templates/template_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.context.getContextTemplate("template_id"); + expect(response).toEqual({ + template: "template", + templateId: "template_id", + uuid: "uuid", + }); + }); + + test("update_context_template", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { template: "template" }; + const rawResponseBody = { template: "template", template_id: "template_id", uuid: "uuid" }; + server + .mockEndpoint() + .put("/context-templates/template_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.context.updateContextTemplate("template_id", { + template: "template", + }); + expect(response).toEqual({ + template: "template", + templateId: "template_id", + uuid: "uuid", + }); + }); + + test("delete_context_template", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .delete("/context-templates/template_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.context.deleteContextTemplate("template_id"); + expect(response).toEqual({ + message: "message", + }); + }); +}); diff --git a/tests/wire/thread.test.ts b/tests/wire/thread.test.ts index 39f10828..f8823cc2 100644 --- a/tests/wire/thread.test.ts +++ b/tests/wire/thread.test.ts @@ -113,6 +113,7 @@ describe("Thread", () => { const response = await client.thread.getUserContext("threadId", { minRating: 1.1, + templateId: "template_id", mode: "basic", }); expect(response).toEqual({ From cfda1f40cdf086f7a45cda0c09e6f2e7a93bf107 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Tue, 18 Nov 2025 12:34:49 -0500 Subject: [PATCH 50/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 685f83d3..c687dcdb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.11.0", + "version": "3.12.0", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From 804283a748ff740e22267cb5048f7ec342d4dee1 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 18 Nov 2025 17:38:38 +0000 Subject: [PATCH 51/59] SDK regeneration --- src/Client.ts | 4 ++-- src/version.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Client.ts b/src/Client.ts index 9cd2409f..f211ac2e 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -49,8 +49,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.11.0", - "User-Agent": "zep-cloud/3.11.0", + "X-Fern-SDK-Version": "3.12.0", + "User-Agent": "zep-cloud/3.12.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/version.ts b/src/version.ts index 07289abf..7b0f95ff 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.11.0"; +export const SDK_VERSION = "3.12.0"; From e6657bd54471a0c2d5b7d5afb2a11167a3c65281 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 18 Nov 2025 18:49:11 +0000 Subject: [PATCH 52/59] SDK regeneration --- reference.md | 65 ++++++++ src/Client.ts | 10 +- src/api/resources/index.ts | 1 + src/api/resources/task/client/Client.ts | 149 ++++++++++++++++++ src/api/resources/task/client/index.ts | 1 + src/api/resources/task/index.ts | 1 + src/api/types/AddThreadMessagesResponse.ts | 1 + src/api/types/AddTripleResponse.ts | 2 + src/api/types/ApidataGetTaskResponse.ts | 17 ++ src/api/types/ApidataTaskErrorResponse.ts | 9 ++ src/api/types/ApidataTaskProgress.ts | 8 + src/api/types/CloneGraphResponse.ts | 2 + src/api/types/Episode.ts | 2 + src/api/types/index.ts | 3 + .../types/AddThreadMessagesResponse.ts | 2 + src/serialization/types/AddTripleResponse.ts | 2 + .../types/ApidataGetTaskResponse.ts | 38 +++++ .../types/ApidataTaskErrorResponse.ts | 24 +++ .../types/ApidataTaskProgress.ts | 22 +++ src/serialization/types/CloneGraphResponse.ts | 2 + src/serialization/types/Episode.ts | 2 + src/serialization/types/index.ts | 3 + src/version.ts | 2 +- tests/wire/graph.test.ts | 11 +- tests/wire/graph/episode.test.ts | 6 + tests/wire/graph/node.test.ts | 2 + tests/wire/task.test.ts | 48 ++++++ tests/wire/thread.test.ts | 6 +- 28 files changed, 435 insertions(+), 6 deletions(-) create mode 100644 src/api/resources/task/client/Client.ts create mode 100644 src/api/resources/task/client/index.ts create mode 100644 src/api/resources/task/index.ts create mode 100644 src/api/types/ApidataGetTaskResponse.ts create mode 100644 src/api/types/ApidataTaskErrorResponse.ts create mode 100644 src/api/types/ApidataTaskProgress.ts create mode 100644 src/serialization/types/ApidataGetTaskResponse.ts create mode 100644 src/serialization/types/ApidataTaskErrorResponse.ts create mode 100644 src/serialization/types/ApidataTaskProgress.ts create mode 100644 tests/wire/task.test.ts diff --git a/reference.md b/reference.md index f040ef0d..731c72a6 100644 --- a/reference.md +++ b/reference.md @@ -1169,6 +1169,71 @@ await client.project.get();
+## Task + +
client.task.get(taskId) -> Zep.ApidataGetTaskResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets a task by its ID + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.task.get("task_id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**taskId:** `string` — Task ID + +
+
+ +
+
+ +**requestOptions:** `Task.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Thread
client.thread.listAll({ ...params }) -> Zep.ThreadListResponse diff --git a/src/Client.ts b/src/Client.ts index f211ac2e..f1360bf6 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -8,6 +8,7 @@ import { mergeHeaders } from "./core/headers.js"; import { Context } from "./api/resources/context/client/Client.js"; import { Graph } from "./api/resources/graph/client/Client.js"; import { Project } from "./api/resources/project/client/Client.js"; +import { Task } from "./api/resources/task/client/Client.js"; import { Thread } from "./api/resources/thread/client/Client.js"; import { User } from "./api/resources/user/client/Client.js"; @@ -39,6 +40,7 @@ export class ZepClient { protected _context: Context | undefined; protected _graph: Graph | undefined; protected _project: Project | undefined; + protected _task: Task | undefined; protected _thread: Thread | undefined; protected _user: User | undefined; @@ -49,8 +51,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.12.0", - "User-Agent": "zep-cloud/3.12.0", + "X-Fern-SDK-Version": "3.13.0", + "User-Agent": "zep-cloud/3.13.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -71,6 +73,10 @@ export class ZepClient { return (this._project ??= new Project(this._options)); } + public get task(): Task { + return (this._task ??= new Task(this._options)); + } + public get thread(): Thread { return (this._thread ??= new Thread(this._options)); } diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 580f1e22..7cc08d8e 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -3,6 +3,7 @@ export * from "./thread/types/index.js"; export * as context from "./context/index.js"; export * as graph from "./graph/index.js"; export * as project from "./project/index.js"; +export * as task from "./task/index.js"; export * as user from "./user/index.js"; export * from "./context/client/requests/index.js"; export * from "./graph/client/requests/index.js"; diff --git a/src/api/resources/task/client/Client.ts b/src/api/resources/task/client/Client.ts new file mode 100644 index 00000000..7e1cf371 --- /dev/null +++ b/src/api/resources/task/client/Client.ts @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments.js"; +import * as core from "../../../../core/index.js"; +import * as Zep from "../../../index.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import * as serializers from "../../../../serialization/index.js"; +import * as errors from "../../../../errors/index.js"; + +export declare namespace Task { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + apiKey?: core.Supplier; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } + + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } +} + +export class Task { + protected readonly _options: Task.Options; + + constructor(_options: Task.Options = {}) { + this._options = _options; + } + + /** + * Gets a task by its ID + * + * @param {string} taskId - Task ID + * @param {Task.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.NotFoundError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.task.get("task_id") + */ + public get( + taskId: string, + requestOptions?: Task.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(taskId, requestOptions)); + } + + private async __get( + taskId: string, + requestOptions?: Task.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + `tasks/${encodeURIComponent(taskId)}`, + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.ApidataGetTaskResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 404: + throw new Zep.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /tasks/{task_id}."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + protected async _getCustomAuthorizationHeaders() { + const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["ZEP_API_KEY"]; + return { Authorization: `Api-Key ${apiKeyValue}` }; + } +} diff --git a/src/api/resources/task/client/index.ts b/src/api/resources/task/client/index.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/src/api/resources/task/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/api/resources/task/index.ts b/src/api/resources/task/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/task/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/types/AddThreadMessagesResponse.ts b/src/api/types/AddThreadMessagesResponse.ts index ba83c288..e03d3820 100644 --- a/src/api/types/AddThreadMessagesResponse.ts +++ b/src/api/types/AddThreadMessagesResponse.ts @@ -5,4 +5,5 @@ export interface AddThreadMessagesResponse { context?: string; messageUuids?: string[]; + taskId?: string; } diff --git a/src/api/types/AddTripleResponse.ts b/src/api/types/AddTripleResponse.ts index 48452b0b..cb8180d5 100644 --- a/src/api/types/AddTripleResponse.ts +++ b/src/api/types/AddTripleResponse.ts @@ -8,4 +8,6 @@ export interface AddTripleResponse { edge?: Zep.EntityEdge; sourceNode?: Zep.EntityNode; targetNode?: Zep.EntityNode; + /** Task ID of the add triple task */ + taskId?: string; } diff --git a/src/api/types/ApidataGetTaskResponse.ts b/src/api/types/ApidataGetTaskResponse.ts new file mode 100644 index 00000000..ef8effa6 --- /dev/null +++ b/src/api/types/ApidataGetTaskResponse.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Zep from "../index.js"; + +export interface ApidataGetTaskResponse { + completedAt?: string; + createdAt?: string; + error?: Zep.ApidataTaskErrorResponse; + progress?: Zep.ApidataTaskProgress; + startedAt?: string; + status?: string; + taskId?: string; + type?: string; + updatedAt?: string; +} diff --git a/src/api/types/ApidataTaskErrorResponse.ts b/src/api/types/ApidataTaskErrorResponse.ts new file mode 100644 index 00000000..f3574ccf --- /dev/null +++ b/src/api/types/ApidataTaskErrorResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ApidataTaskErrorResponse { + code?: string; + details?: Record; + message?: string; +} diff --git a/src/api/types/ApidataTaskProgress.ts b/src/api/types/ApidataTaskProgress.ts new file mode 100644 index 00000000..f94235d3 --- /dev/null +++ b/src/api/types/ApidataTaskProgress.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ApidataTaskProgress { + message?: string; + stage?: string; +} diff --git a/src/api/types/CloneGraphResponse.ts b/src/api/types/CloneGraphResponse.ts index 7dbd69e9..6cef7484 100644 --- a/src/api/types/CloneGraphResponse.ts +++ b/src/api/types/CloneGraphResponse.ts @@ -5,5 +5,7 @@ export interface CloneGraphResponse { /** graph_id is the ID of the cloned graph */ graphId?: string; + /** Task ID of the clone graph task */ + taskId?: string; userId?: string; } diff --git a/src/api/types/Episode.ts b/src/api/types/Episode.ts index ac59fe49..cbe861f0 100644 --- a/src/api/types/Episode.ts +++ b/src/api/types/Episode.ts @@ -22,6 +22,8 @@ export interface Episode { score?: number; source?: Zep.GraphDataType; sourceDescription?: string; + /** Optional task ID to poll episode processing status. Currently only available for batch ingestion. */ + taskId?: string; /** Optional thread ID, will be present if the episode is part of a thread */ threadId?: string; uuid: string; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 71efede7..4b5c68bf 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -12,6 +12,7 @@ export * from "./EpisodeData.js"; export * from "./EpisodeMentions.js"; export * from "./FactRatingExamples.js"; export * from "./FactRatingInstruction.js"; +export * from "./ApidataGetTaskResponse.js"; export * from "./Graph.js"; export * from "./GraphEdgesRequest.js"; export * from "./Episode.js"; @@ -25,6 +26,8 @@ export * from "./ProjectInfo.js"; export * from "./ProjectInfoResponse.js"; export * from "./RoleType.js"; export * from "./SuccessResponse.js"; +export * from "./ApidataTaskErrorResponse.js"; +export * from "./ApidataTaskProgress.js"; export * from "./Thread.js"; export * from "./ThreadContextResponse.js"; export * from "./ThreadListResponse.js"; diff --git a/src/serialization/types/AddThreadMessagesResponse.ts b/src/serialization/types/AddThreadMessagesResponse.ts index 7563a684..0ef85a19 100644 --- a/src/serialization/types/AddThreadMessagesResponse.ts +++ b/src/serialization/types/AddThreadMessagesResponse.ts @@ -15,11 +15,13 @@ export const AddThreadMessagesResponse: core.serialization.ObjectSchema< "message_uuids", core.serialization.list(core.serialization.string()).optional(), ), + taskId: core.serialization.property("task_id", core.serialization.string().optional()), }); export declare namespace AddThreadMessagesResponse { export interface Raw { context?: string | null; message_uuids?: string[] | null; + task_id?: string | null; } } diff --git a/src/serialization/types/AddTripleResponse.ts b/src/serialization/types/AddTripleResponse.ts index a77b42c1..c6029496 100644 --- a/src/serialization/types/AddTripleResponse.ts +++ b/src/serialization/types/AddTripleResponse.ts @@ -15,6 +15,7 @@ export const AddTripleResponse: core.serialization.ObjectSchema< edge: EntityEdge.optional(), sourceNode: core.serialization.property("source_node", EntityNode.optional()), targetNode: core.serialization.property("target_node", EntityNode.optional()), + taskId: core.serialization.property("task_id", core.serialization.string().optional()), }); export declare namespace AddTripleResponse { @@ -22,5 +23,6 @@ export declare namespace AddTripleResponse { edge?: EntityEdge.Raw | null; source_node?: EntityNode.Raw | null; target_node?: EntityNode.Raw | null; + task_id?: string | null; } } diff --git a/src/serialization/types/ApidataGetTaskResponse.ts b/src/serialization/types/ApidataGetTaskResponse.ts new file mode 100644 index 00000000..db103d56 --- /dev/null +++ b/src/serialization/types/ApidataGetTaskResponse.ts @@ -0,0 +1,38 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { ApidataTaskErrorResponse } from "./ApidataTaskErrorResponse.js"; +import { ApidataTaskProgress } from "./ApidataTaskProgress.js"; + +export const ApidataGetTaskResponse: core.serialization.ObjectSchema< + serializers.ApidataGetTaskResponse.Raw, + Zep.ApidataGetTaskResponse +> = core.serialization.object({ + completedAt: core.serialization.property("completed_at", core.serialization.string().optional()), + createdAt: core.serialization.property("created_at", core.serialization.string().optional()), + error: ApidataTaskErrorResponse.optional(), + progress: ApidataTaskProgress.optional(), + startedAt: core.serialization.property("started_at", core.serialization.string().optional()), + status: core.serialization.string().optional(), + taskId: core.serialization.property("task_id", core.serialization.string().optional()), + type: core.serialization.string().optional(), + updatedAt: core.serialization.property("updated_at", core.serialization.string().optional()), +}); + +export declare namespace ApidataGetTaskResponse { + export interface Raw { + completed_at?: string | null; + created_at?: string | null; + error?: ApidataTaskErrorResponse.Raw | null; + progress?: ApidataTaskProgress.Raw | null; + started_at?: string | null; + status?: string | null; + task_id?: string | null; + type?: string | null; + updated_at?: string | null; + } +} diff --git a/src/serialization/types/ApidataTaskErrorResponse.ts b/src/serialization/types/ApidataTaskErrorResponse.ts new file mode 100644 index 00000000..bd4ef25a --- /dev/null +++ b/src/serialization/types/ApidataTaskErrorResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; + +export const ApidataTaskErrorResponse: core.serialization.ObjectSchema< + serializers.ApidataTaskErrorResponse.Raw, + Zep.ApidataTaskErrorResponse +> = core.serialization.object({ + code: core.serialization.string().optional(), + details: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + message: core.serialization.string().optional(), +}); + +export declare namespace ApidataTaskErrorResponse { + export interface Raw { + code?: string | null; + details?: Record | null; + message?: string | null; + } +} diff --git a/src/serialization/types/ApidataTaskProgress.ts b/src/serialization/types/ApidataTaskProgress.ts new file mode 100644 index 00000000..43b3a521 --- /dev/null +++ b/src/serialization/types/ApidataTaskProgress.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; + +export const ApidataTaskProgress: core.serialization.ObjectSchema< + serializers.ApidataTaskProgress.Raw, + Zep.ApidataTaskProgress +> = core.serialization.object({ + message: core.serialization.string().optional(), + stage: core.serialization.string().optional(), +}); + +export declare namespace ApidataTaskProgress { + export interface Raw { + message?: string | null; + stage?: string | null; + } +} diff --git a/src/serialization/types/CloneGraphResponse.ts b/src/serialization/types/CloneGraphResponse.ts index 1d56f08c..ab98f075 100644 --- a/src/serialization/types/CloneGraphResponse.ts +++ b/src/serialization/types/CloneGraphResponse.ts @@ -11,12 +11,14 @@ export const CloneGraphResponse: core.serialization.ObjectSchema< Zep.CloneGraphResponse > = core.serialization.object({ graphId: core.serialization.property("graph_id", core.serialization.string().optional()), + taskId: core.serialization.property("task_id", core.serialization.string().optional()), userId: core.serialization.property("user_id", core.serialization.string().optional()), }); export declare namespace CloneGraphResponse { export interface Raw { graph_id?: string | null; + task_id?: string | null; user_id?: string | null; } } diff --git a/src/serialization/types/Episode.ts b/src/serialization/types/Episode.ts index b2d9d58e..04647abe 100644 --- a/src/serialization/types/Episode.ts +++ b/src/serialization/types/Episode.ts @@ -20,6 +20,7 @@ export const Episode: core.serialization.ObjectSchema { score: 1.1, source: "text", source_description: "source_description", + task_id: "task_id", thread_id: "thread_id", uuid: "uuid", }; @@ -128,6 +129,7 @@ describe("Graph", () => { score: 1.1, source: "text", sourceDescription: "source_description", + taskId: "task_id", threadId: "thread_id", uuid: "uuid", }); @@ -149,6 +151,7 @@ describe("Graph", () => { score: 1.1, source: "text", source_description: "source_description", + task_id: "task_id", thread_id: "thread_id", uuid: "uuid", }, @@ -184,6 +187,7 @@ describe("Graph", () => { score: 1.1, source: "text", sourceDescription: "source_description", + taskId: "task_id", threadId: "thread_id", uuid: "uuid", }, @@ -230,6 +234,7 @@ describe("Graph", () => { summary: "summary", uuid: "uuid", }, + task_id: "task_id", }; server .mockEndpoint() @@ -287,6 +292,7 @@ describe("Graph", () => { summary: "summary", uuid: "uuid", }, + taskId: "task_id", }); }); @@ -294,7 +300,7 @@ describe("Graph", () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; - const rawResponseBody = { graph_id: "graph_id", user_id: "user_id" }; + const rawResponseBody = { graph_id: "graph_id", task_id: "task_id", user_id: "user_id" }; server .mockEndpoint() .post("/graph/clone") @@ -307,6 +313,7 @@ describe("Graph", () => { const response = await client.graph.clone(); expect(response).toEqual({ graphId: "graph_id", + taskId: "task_id", userId: "user_id", }); }); @@ -435,6 +442,7 @@ describe("Graph", () => { score: 1.1, source: "text", source_description: "source_description", + task_id: "task_id", thread_id: "thread_id", uuid: "uuid", }, @@ -498,6 +506,7 @@ describe("Graph", () => { score: 1.1, source: "text", sourceDescription: "source_description", + taskId: "task_id", threadId: "thread_id", uuid: "uuid", }, diff --git a/tests/wire/graph/episode.test.ts b/tests/wire/graph/episode.test.ts index 97f541a2..eed93477 100644 --- a/tests/wire/graph/episode.test.ts +++ b/tests/wire/graph/episode.test.ts @@ -23,6 +23,7 @@ describe("Episode", () => { score: 1.1, source: "text", source_description: "source_description", + task_id: "task_id", thread_id: "thread_id", uuid: "uuid", }, @@ -54,6 +55,7 @@ describe("Episode", () => { score: 1.1, source: "text", sourceDescription: "source_description", + taskId: "task_id", threadId: "thread_id", uuid: "uuid", }, @@ -78,6 +80,7 @@ describe("Episode", () => { score: 1.1, source: "text", source_description: "source_description", + task_id: "task_id", thread_id: "thread_id", uuid: "uuid", }, @@ -109,6 +112,7 @@ describe("Episode", () => { score: 1.1, source: "text", sourceDescription: "source_description", + taskId: "task_id", threadId: "thread_id", uuid: "uuid", }, @@ -131,6 +135,7 @@ describe("Episode", () => { score: 1.1, source: "text", source_description: "source_description", + task_id: "task_id", thread_id: "thread_id", uuid: "uuid", }; @@ -156,6 +161,7 @@ describe("Episode", () => { score: 1.1, source: "text", sourceDescription: "source_description", + taskId: "task_id", threadId: "thread_id", uuid: "uuid", }); diff --git a/tests/wire/graph/node.test.ts b/tests/wire/graph/node.test.ts index 9c8927a5..dc926033 100644 --- a/tests/wire/graph/node.test.ts +++ b/tests/wire/graph/node.test.ts @@ -159,6 +159,7 @@ describe("Node", () => { score: 1.1, source: "text", source_description: "source_description", + task_id: "task_id", thread_id: "thread_id", uuid: "uuid", }, @@ -188,6 +189,7 @@ describe("Node", () => { score: 1.1, source: "text", sourceDescription: "source_description", + taskId: "task_id", threadId: "thread_id", uuid: "uuid", }, diff --git a/tests/wire/task.test.ts b/tests/wire/task.test.ts new file mode 100644 index 00000000..dcdcf141 --- /dev/null +++ b/tests/wire/task.test.ts @@ -0,0 +1,48 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import { mockServerPool } from "../mock-server/MockServerPool"; +import { ZepClient } from "../../src/Client"; + +describe("Task", () => { + test("get", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + completed_at: "completed_at", + created_at: "created_at", + error: { code: "code", details: { key: "value" }, message: "message" }, + progress: { message: "message", stage: "stage" }, + started_at: "started_at", + status: "status", + task_id: "task_id", + type: "type", + updated_at: "updated_at", + }; + server.mockEndpoint().get("/tasks/task_id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.task.get("task_id"); + expect(response).toEqual({ + completedAt: "completed_at", + createdAt: "created_at", + error: { + code: "code", + details: { + key: "value", + }, + message: "message", + }, + progress: { + message: "message", + stage: "stage", + }, + startedAt: "started_at", + status: "status", + taskId: "task_id", + type: "type", + updatedAt: "updated_at", + }); + }); +}); diff --git a/tests/wire/thread.test.ts b/tests/wire/thread.test.ts index f8823cc2..cd7f52cd 100644 --- a/tests/wire/thread.test.ts +++ b/tests/wire/thread.test.ts @@ -176,7 +176,7 @@ describe("Thread", () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { messages: [{ content: "content", role: "norole" }] }; - const rawResponseBody = { context: "context", message_uuids: ["message_uuids"] }; + const rawResponseBody = { context: "context", message_uuids: ["message_uuids"], task_id: "task_id" }; server .mockEndpoint() .post("/threads/threadId/messages") @@ -197,6 +197,7 @@ describe("Thread", () => { expect(response).toEqual({ context: "context", messageUuids: ["message_uuids"], + taskId: "task_id", }); }); @@ -204,7 +205,7 @@ describe("Thread", () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { messages: [{ content: "content", role: "norole" }] }; - const rawResponseBody = { context: "context", message_uuids: ["message_uuids"] }; + const rawResponseBody = { context: "context", message_uuids: ["message_uuids"], task_id: "task_id" }; server .mockEndpoint() .post("/threads/threadId/messages-batch") @@ -225,6 +226,7 @@ describe("Thread", () => { expect(response).toEqual({ context: "context", messageUuids: ["message_uuids"], + taskId: "task_id", }); }); }); From cab7d022b93dbc77d58bd331b502af1e2241ed78 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 14:57:50 +0000 Subject: [PATCH 53/59] SDK regeneration --- reference.md | 1 + src/api/resources/graph/client/Client.ts | 1 + .../resources/graph/client/requests/AddTripleRequest.ts | 3 ++- .../resources/graph/client/requests/AddTripleRequest.ts | 4 ++-- tests/wire/graph.test.ts | 8 +++++++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/reference.md b/reference.md index 731c72a6..f92fda8b 100644 --- a/reference.md +++ b/reference.md @@ -620,6 +620,7 @@ Add a fact triple for a user or group await client.graph.addFactTriple({ fact: "fact", factName: "fact_name", + sourceNodeName: "source_node_name", targetNodeName: "target_node_name", }); ``` diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index 07dd45d6..f31d3881 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -534,6 +534,7 @@ export class Graph { * await client.graph.addFactTriple({ * fact: "fact", * factName: "fact_name", + * sourceNodeName: "source_node_name", * targetNodeName: "target_node_name" * }) */ diff --git a/src/api/resources/graph/client/requests/AddTripleRequest.ts b/src/api/resources/graph/client/requests/AddTripleRequest.ts index a6e5f5fb..a6285210 100644 --- a/src/api/resources/graph/client/requests/AddTripleRequest.ts +++ b/src/api/resources/graph/client/requests/AddTripleRequest.ts @@ -7,6 +7,7 @@ * { * fact: "fact", * factName: "fact_name", + * sourceNodeName: "source_node_name", * targetNodeName: "target_node_name" * } */ @@ -25,7 +26,7 @@ export interface AddTripleRequest { /** The time (if any) at which the fact stops being true */ invalidAt?: string; /** The name of the source node to add */ - sourceNodeName?: string; + sourceNodeName: string; /** The summary of the source node to add */ sourceNodeSummary?: string; /** The source node uuid */ diff --git a/src/serialization/resources/graph/client/requests/AddTripleRequest.ts b/src/serialization/resources/graph/client/requests/AddTripleRequest.ts index 0824cb5d..5f2175dd 100644 --- a/src/serialization/resources/graph/client/requests/AddTripleRequest.ts +++ b/src/serialization/resources/graph/client/requests/AddTripleRequest.ts @@ -15,7 +15,7 @@ export const AddTripleRequest: core.serialization.Schema { test("add_fact_triple", async () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { fact: "fact", fact_name: "fact_name", target_node_name: "target_node_name" }; + const rawRequestBody = { + fact: "fact", + fact_name: "fact_name", + source_node_name: "source_node_name", + target_node_name: "target_node_name", + }; const rawResponseBody = { edge: { attributes: { key: "value" }, @@ -248,6 +253,7 @@ describe("Graph", () => { const response = await client.graph.addFactTriple({ fact: "fact", factName: "fact_name", + sourceNodeName: "source_node_name", targetNodeName: "target_node_name", }); expect(response).toEqual({ From edf7494481a68d89729d62de082fc06be26c00b9 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 15:04:05 +0000 Subject: [PATCH 54/59] SDK regeneration --- reference.md | 2 +- src/api/resources/task/client/Client.ts | 9 ++--- ...aGetTaskResponse.ts => GetTaskResponse.ts} | 6 +-- ...kErrorResponse.ts => TaskErrorResponse.ts} | 2 +- ...ApidataTaskProgress.ts => TaskProgress.ts} | 2 +- src/api/types/index.ts | 6 +-- .../types/ApidataGetTaskResponse.ts | 38 ------------------- .../types/ApidataTaskProgress.ts | 22 ----------- src/serialization/types/GetTaskResponse.ts | 36 ++++++++++++++++++ ...kErrorResponse.ts => TaskErrorResponse.ts} | 8 ++-- src/serialization/types/TaskProgress.ts | 20 ++++++++++ src/serialization/types/index.ts | 6 +-- 12 files changed, 75 insertions(+), 82 deletions(-) rename src/api/types/{ApidataGetTaskResponse.ts => GetTaskResponse.ts} (68%) rename src/api/types/{ApidataTaskErrorResponse.ts => TaskErrorResponse.ts} (78%) rename src/api/types/{ApidataTaskProgress.ts => TaskProgress.ts} (75%) delete mode 100644 src/serialization/types/ApidataGetTaskResponse.ts delete mode 100644 src/serialization/types/ApidataTaskProgress.ts create mode 100644 src/serialization/types/GetTaskResponse.ts rename src/serialization/types/{ApidataTaskErrorResponse.ts => TaskErrorResponse.ts} (74%) create mode 100644 src/serialization/types/TaskProgress.ts diff --git a/reference.md b/reference.md index f92fda8b..0645483a 100644 --- a/reference.md +++ b/reference.md @@ -1172,7 +1172,7 @@ await client.project.get(); ## Task -
client.task.get(taskId) -> Zep.ApidataGetTaskResponse +
client.task.get(taskId) -> Zep.GetTaskResponse
diff --git a/src/api/resources/task/client/Client.ts b/src/api/resources/task/client/Client.ts index 7e1cf371..8bbe6ff9 100644 --- a/src/api/resources/task/client/Client.ts +++ b/src/api/resources/task/client/Client.ts @@ -51,17 +51,14 @@ export class Task { * @example * await client.task.get("task_id") */ - public get( - taskId: string, - requestOptions?: Task.RequestOptions, - ): core.HttpResponsePromise { + public get(taskId: string, requestOptions?: Task.RequestOptions): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(taskId, requestOptions)); } private async __get( taskId: string, requestOptions?: Task.RequestOptions, - ): Promise> { + ): Promise> { const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -81,7 +78,7 @@ export class Task { }); if (_response.ok) { return { - data: serializers.ApidataGetTaskResponse.parseOrThrow(_response.body, { + data: serializers.GetTaskResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, diff --git a/src/api/types/ApidataGetTaskResponse.ts b/src/api/types/GetTaskResponse.ts similarity index 68% rename from src/api/types/ApidataGetTaskResponse.ts rename to src/api/types/GetTaskResponse.ts index ef8effa6..5e2a7eb9 100644 --- a/src/api/types/ApidataGetTaskResponse.ts +++ b/src/api/types/GetTaskResponse.ts @@ -4,11 +4,11 @@ import * as Zep from "../index.js"; -export interface ApidataGetTaskResponse { +export interface GetTaskResponse { completedAt?: string; createdAt?: string; - error?: Zep.ApidataTaskErrorResponse; - progress?: Zep.ApidataTaskProgress; + error?: Zep.TaskErrorResponse; + progress?: Zep.TaskProgress; startedAt?: string; status?: string; taskId?: string; diff --git a/src/api/types/ApidataTaskErrorResponse.ts b/src/api/types/TaskErrorResponse.ts similarity index 78% rename from src/api/types/ApidataTaskErrorResponse.ts rename to src/api/types/TaskErrorResponse.ts index f3574ccf..af053ab5 100644 --- a/src/api/types/ApidataTaskErrorResponse.ts +++ b/src/api/types/TaskErrorResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -export interface ApidataTaskErrorResponse { +export interface TaskErrorResponse { code?: string; details?: Record; message?: string; diff --git a/src/api/types/ApidataTaskProgress.ts b/src/api/types/TaskProgress.ts similarity index 75% rename from src/api/types/ApidataTaskProgress.ts rename to src/api/types/TaskProgress.ts index f94235d3..e49220ec 100644 --- a/src/api/types/ApidataTaskProgress.ts +++ b/src/api/types/TaskProgress.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -export interface ApidataTaskProgress { +export interface TaskProgress { message?: string; stage?: string; } diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 4b5c68bf..4e8579a8 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -12,7 +12,7 @@ export * from "./EpisodeData.js"; export * from "./EpisodeMentions.js"; export * from "./FactRatingExamples.js"; export * from "./FactRatingInstruction.js"; -export * from "./ApidataGetTaskResponse.js"; +export * from "./GetTaskResponse.js"; export * from "./Graph.js"; export * from "./GraphEdgesRequest.js"; export * from "./Episode.js"; @@ -26,8 +26,8 @@ export * from "./ProjectInfo.js"; export * from "./ProjectInfoResponse.js"; export * from "./RoleType.js"; export * from "./SuccessResponse.js"; -export * from "./ApidataTaskErrorResponse.js"; -export * from "./ApidataTaskProgress.js"; +export * from "./TaskErrorResponse.js"; +export * from "./TaskProgress.js"; export * from "./Thread.js"; export * from "./ThreadContextResponse.js"; export * from "./ThreadListResponse.js"; diff --git a/src/serialization/types/ApidataGetTaskResponse.ts b/src/serialization/types/ApidataGetTaskResponse.ts deleted file mode 100644 index db103d56..00000000 --- a/src/serialization/types/ApidataGetTaskResponse.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Zep from "../../api/index.js"; -import * as core from "../../core/index.js"; -import { ApidataTaskErrorResponse } from "./ApidataTaskErrorResponse.js"; -import { ApidataTaskProgress } from "./ApidataTaskProgress.js"; - -export const ApidataGetTaskResponse: core.serialization.ObjectSchema< - serializers.ApidataGetTaskResponse.Raw, - Zep.ApidataGetTaskResponse -> = core.serialization.object({ - completedAt: core.serialization.property("completed_at", core.serialization.string().optional()), - createdAt: core.serialization.property("created_at", core.serialization.string().optional()), - error: ApidataTaskErrorResponse.optional(), - progress: ApidataTaskProgress.optional(), - startedAt: core.serialization.property("started_at", core.serialization.string().optional()), - status: core.serialization.string().optional(), - taskId: core.serialization.property("task_id", core.serialization.string().optional()), - type: core.serialization.string().optional(), - updatedAt: core.serialization.property("updated_at", core.serialization.string().optional()), -}); - -export declare namespace ApidataGetTaskResponse { - export interface Raw { - completed_at?: string | null; - created_at?: string | null; - error?: ApidataTaskErrorResponse.Raw | null; - progress?: ApidataTaskProgress.Raw | null; - started_at?: string | null; - status?: string | null; - task_id?: string | null; - type?: string | null; - updated_at?: string | null; - } -} diff --git a/src/serialization/types/ApidataTaskProgress.ts b/src/serialization/types/ApidataTaskProgress.ts deleted file mode 100644 index 43b3a521..00000000 --- a/src/serialization/types/ApidataTaskProgress.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index.js"; -import * as Zep from "../../api/index.js"; -import * as core from "../../core/index.js"; - -export const ApidataTaskProgress: core.serialization.ObjectSchema< - serializers.ApidataTaskProgress.Raw, - Zep.ApidataTaskProgress -> = core.serialization.object({ - message: core.serialization.string().optional(), - stage: core.serialization.string().optional(), -}); - -export declare namespace ApidataTaskProgress { - export interface Raw { - message?: string | null; - stage?: string | null; - } -} diff --git a/src/serialization/types/GetTaskResponse.ts b/src/serialization/types/GetTaskResponse.ts new file mode 100644 index 00000000..400cc8ba --- /dev/null +++ b/src/serialization/types/GetTaskResponse.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { TaskErrorResponse } from "./TaskErrorResponse.js"; +import { TaskProgress } from "./TaskProgress.js"; + +export const GetTaskResponse: core.serialization.ObjectSchema = + core.serialization.object({ + completedAt: core.serialization.property("completed_at", core.serialization.string().optional()), + createdAt: core.serialization.property("created_at", core.serialization.string().optional()), + error: TaskErrorResponse.optional(), + progress: TaskProgress.optional(), + startedAt: core.serialization.property("started_at", core.serialization.string().optional()), + status: core.serialization.string().optional(), + taskId: core.serialization.property("task_id", core.serialization.string().optional()), + type: core.serialization.string().optional(), + updatedAt: core.serialization.property("updated_at", core.serialization.string().optional()), + }); + +export declare namespace GetTaskResponse { + export interface Raw { + completed_at?: string | null; + created_at?: string | null; + error?: TaskErrorResponse.Raw | null; + progress?: TaskProgress.Raw | null; + started_at?: string | null; + status?: string | null; + task_id?: string | null; + type?: string | null; + updated_at?: string | null; + } +} diff --git a/src/serialization/types/ApidataTaskErrorResponse.ts b/src/serialization/types/TaskErrorResponse.ts similarity index 74% rename from src/serialization/types/ApidataTaskErrorResponse.ts rename to src/serialization/types/TaskErrorResponse.ts index bd4ef25a..6bdcdfda 100644 --- a/src/serialization/types/ApidataTaskErrorResponse.ts +++ b/src/serialization/types/TaskErrorResponse.ts @@ -6,16 +6,16 @@ import * as serializers from "../index.js"; import * as Zep from "../../api/index.js"; import * as core from "../../core/index.js"; -export const ApidataTaskErrorResponse: core.serialization.ObjectSchema< - serializers.ApidataTaskErrorResponse.Raw, - Zep.ApidataTaskErrorResponse +export const TaskErrorResponse: core.serialization.ObjectSchema< + serializers.TaskErrorResponse.Raw, + Zep.TaskErrorResponse > = core.serialization.object({ code: core.serialization.string().optional(), details: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), message: core.serialization.string().optional(), }); -export declare namespace ApidataTaskErrorResponse { +export declare namespace TaskErrorResponse { export interface Raw { code?: string | null; details?: Record | null; diff --git a/src/serialization/types/TaskProgress.ts b/src/serialization/types/TaskProgress.ts new file mode 100644 index 00000000..7a576447 --- /dev/null +++ b/src/serialization/types/TaskProgress.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; + +export const TaskProgress: core.serialization.ObjectSchema = + core.serialization.object({ + message: core.serialization.string().optional(), + stage: core.serialization.string().optional(), + }); + +export declare namespace TaskProgress { + export interface Raw { + message?: string | null; + stage?: string | null; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 4b5c68bf..4e8579a8 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -12,7 +12,7 @@ export * from "./EpisodeData.js"; export * from "./EpisodeMentions.js"; export * from "./FactRatingExamples.js"; export * from "./FactRatingInstruction.js"; -export * from "./ApidataGetTaskResponse.js"; +export * from "./GetTaskResponse.js"; export * from "./Graph.js"; export * from "./GraphEdgesRequest.js"; export * from "./Episode.js"; @@ -26,8 +26,8 @@ export * from "./ProjectInfo.js"; export * from "./ProjectInfoResponse.js"; export * from "./RoleType.js"; export * from "./SuccessResponse.js"; -export * from "./ApidataTaskErrorResponse.js"; -export * from "./ApidataTaskProgress.js"; +export * from "./TaskErrorResponse.js"; +export * from "./TaskProgress.js"; export * from "./Thread.js"; export * from "./ThreadContextResponse.js"; export * from "./ThreadListResponse.js"; From 7cb48332c1cb50d8e5349a27f9bcfe750e30bb5c Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Thu, 20 Nov 2025 10:17:03 -0500 Subject: [PATCH 55/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c687dcdb..d43fc3aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.12.0", + "version": "3.13.0", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From 6938aefaed1aba899337013afd50884fbf1969bc Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 15:18:43 +0000 Subject: [PATCH 56/59] SDK regeneration From f4fb963db9c8fda454eae92de0ee54d8918c7f62 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Wed, 17 Dec 2025 16:48:40 -0500 Subject: [PATCH 57/59] chore: Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d43fc3aa..43449b48 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getzep/zep-cloud", - "version": "3.13.0", + "version": "3.14.0", "private": false, "repository": "https://github.com/getzep/zep-js", "description": "Zep: Fast, scalable building blocks for production LLM apps", From 245e885d99d84c075f5a6df6aa53f38aba56a061 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 21:54:37 +0000 Subject: [PATCH 58/59] SDK regeneration --- reference.md | 63 +++++++++++ src/Client.ts | 4 +- .../graph/client/requests/AddTripleRequest.ts | 15 +++ .../graph/resources/node/client/Client.ts | 100 ++++++++++++++++++ .../requests/ThreadGetUserContextRequest.ts | 2 +- .../user/client/requests/CreateUserRequest.ts | 2 +- .../user/client/requests/UpdateUserRequest.ts | 2 +- src/api/types/PropertyFilter.ts | 18 ++++ src/api/types/SearchFilters.ts | 4 + src/api/types/index.ts | 1 + .../graph/client/requests/AddTripleRequest.ts | 15 +++ src/serialization/types/PropertyFilter.ts | 23 ++++ src/serialization/types/SearchFilters.ts | 11 ++ src/serialization/types/index.ts | 1 + src/version.ts | 2 +- tests/wire/graph/node.test.ts | 19 ++++ 16 files changed, 276 insertions(+), 6 deletions(-) create mode 100644 src/api/types/PropertyFilter.ts create mode 100644 src/serialization/types/PropertyFilter.ts diff --git a/reference.md b/reference.md index 0645483a..07b6c627 100644 --- a/reference.md +++ b/reference.md @@ -3397,6 +3397,69 @@ await client.graph.node.get("uuid");
+
client.graph.node.delete(uuid) -> Zep.SuccessResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes a node by UUID. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.graph.node.delete("uuid"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**uuid:** `string` — Node UUID + +
+
+ +
+
+ +**requestOptions:** `Node.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Thread Message
client.thread.message.update(messageUuid, { ...params }) -> Zep.Message diff --git a/src/Client.ts b/src/Client.ts index f1360bf6..660af4dc 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -51,8 +51,8 @@ export class ZepClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.13.0", - "User-Agent": "zep-cloud/3.13.0", + "X-Fern-SDK-Version": "3.14.0", + "User-Agent": "zep-cloud/3.14.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/graph/client/requests/AddTripleRequest.ts b/src/api/resources/graph/client/requests/AddTripleRequest.ts index a6285210..a8bd81ea 100644 --- a/src/api/resources/graph/client/requests/AddTripleRequest.ts +++ b/src/api/resources/graph/client/requests/AddTripleRequest.ts @@ -14,6 +14,11 @@ export interface AddTripleRequest { /** The timestamp of the message */ createdAt?: string; + /** + * Additional attributes of the edge. Values must be scalar types (string, number, boolean, or null). + * Nested objects and arrays are not allowed. + */ + edgeAttributes?: Record; /** The time (if any) at which the edge expires */ expiredAt?: string; /** The fact relating the two nodes that this edge represents */ @@ -25,12 +30,22 @@ export interface AddTripleRequest { graphId?: string; /** The time (if any) at which the fact stops being true */ invalidAt?: string; + /** + * Additional attributes of the source node. Values must be scalar types (string, number, boolean, or null). + * Nested objects and arrays are not allowed. + */ + sourceNodeAttributes?: Record; /** The name of the source node to add */ sourceNodeName: string; /** The summary of the source node to add */ sourceNodeSummary?: string; /** The source node uuid */ sourceNodeUuid?: string; + /** + * Additional attributes of the target node. Values must be scalar types (string, number, boolean, or null). + * Nested objects and arrays are not allowed. + */ + targetNodeAttributes?: Record; /** The name of the target node to add */ targetNodeName: string; /** The summary of the target node to add */ diff --git a/src/api/resources/graph/resources/node/client/Client.ts b/src/api/resources/graph/resources/node/client/Client.ts index b46563e4..fb288afc 100644 --- a/src/api/resources/graph/resources/node/client/Client.ts +++ b/src/api/resources/graph/resources/node/client/Client.ts @@ -583,6 +583,106 @@ export class Node { } } + /** + * Deletes a node by UUID. + * + * @param {string} uuid - Node UUID + * @param {Node.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Zep.BadRequestError} + * @throws {@link Zep.InternalServerError} + * + * @example + * await client.graph.node.delete("uuid") + */ + public delete(uuid: string, requestOptions?: Node.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(uuid, requestOptions)); + } + + private async __delete( + uuid: string, + requestOptions?: Node.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.ZepEnvironment.Default, + `graph/node/${encodeURIComponent(uuid)}`, + ), + method: "DELETE", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.SuccessResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Zep.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Zep.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ZepError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /graph/node/{uuid}."); + case "unknown": + throw new errors.ZepError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + protected async _getCustomAuthorizationHeaders() { const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["ZEP_API_KEY"]; return { Authorization: `Api-Key ${apiKeyValue}` }; diff --git a/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts b/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts index 6556c672..68a0e234 100644 --- a/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts +++ b/src/api/resources/thread/client/requests/ThreadGetUserContextRequest.ts @@ -14,7 +14,7 @@ import * as Zep from "../../../../index.js"; */ export interface ThreadGetUserContextRequest { /** - * The minimum rating by which to filter relevant facts. + * Deprecated, this field will be removed in a future release. The minimum rating by which to filter relevant facts. */ minRating?: number; /** diff --git a/src/api/resources/user/client/requests/CreateUserRequest.ts b/src/api/resources/user/client/requests/CreateUserRequest.ts index 86759c19..ee106627 100644 --- a/src/api/resources/user/client/requests/CreateUserRequest.ts +++ b/src/api/resources/user/client/requests/CreateUserRequest.ts @@ -15,7 +15,7 @@ export interface CreateUserRequest { disableDefaultOntology?: boolean; /** The email address of the user. */ email?: string; - /** Optional instruction to use for fact rating. */ + /** Deprecated: this field will be removed in a future release. Optional instruction to use for fact rating. */ factRatingInstruction?: Zep.FactRatingInstruction; /** The first name of the user. */ firstName?: string; diff --git a/src/api/resources/user/client/requests/UpdateUserRequest.ts b/src/api/resources/user/client/requests/UpdateUserRequest.ts index 567dc1d1..394146df 100644 --- a/src/api/resources/user/client/requests/UpdateUserRequest.ts +++ b/src/api/resources/user/client/requests/UpdateUserRequest.ts @@ -13,7 +13,7 @@ export interface UpdateUserRequest { disableDefaultOntology?: boolean; /** The email address of the user. */ email?: string; - /** Optional instruction to use for fact rating. */ + /** Deprecated: this field will be removed in a future release. Optional instruction to use for fact rating. */ factRatingInstruction?: Zep.FactRatingInstruction; /** The first name of the user. */ firstName?: string; diff --git a/src/api/types/PropertyFilter.ts b/src/api/types/PropertyFilter.ts new file mode 100644 index 00000000..94d6b64e --- /dev/null +++ b/src/api/types/PropertyFilter.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Zep from "../index.js"; + +export interface PropertyFilter { + /** Comparison operator for property filter */ + comparisonOperator: Zep.ComparisonOperator; + /** Property name to filter on */ + propertyName: string; + /** + * Property value to match on. Accepted types: string, int, float64, bool, or nil. + * Invalid types (e.g., arrays, objects) will be rejected by validation. + * Must be non-nil for non-null operators (=, <>, >, <, >=, <=). + */ + propertyValue?: unknown; +} diff --git a/src/api/types/SearchFilters.ts b/src/api/types/SearchFilters.ts index 565824f2..a2dc3cd7 100644 --- a/src/api/types/SearchFilters.ts +++ b/src/api/types/SearchFilters.ts @@ -15,6 +15,8 @@ export interface SearchFilters { createdAt?: Zep.DateFilter[][]; /** List of edge types to filter on */ edgeTypes?: string[]; + /** List of edge UUIDs to filter on */ + edgeUuids?: string[]; /** List of edge types to exclude from results */ excludeEdgeTypes?: string[]; /** List of node labels to exclude from results */ @@ -37,6 +39,8 @@ export interface SearchFilters { invalidAt?: Zep.DateFilter[][]; /** List of node labels to filter on */ nodeLabels?: string[]; + /** List of property filters to apply to nodes and edges */ + propertyFilters?: Zep.PropertyFilter[]; /** * 2D array of date filters for the valid_at field. * The outer array elements are combined with OR logic. diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 4e8579a8..1bb735b8 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -43,6 +43,7 @@ export * from "./DateFilter.js"; export * from "./EntityEdge.js"; export * from "./EntityNode.js"; export * from "./GraphSearchScope.js"; +export * from "./PropertyFilter.js"; export * from "./Reranker.js"; export * from "./SearchFilters.js"; export * from "./EntityPropertyType.js"; diff --git a/src/serialization/resources/graph/client/requests/AddTripleRequest.ts b/src/serialization/resources/graph/client/requests/AddTripleRequest.ts index 5f2175dd..9cd57835 100644 --- a/src/serialization/resources/graph/client/requests/AddTripleRequest.ts +++ b/src/serialization/resources/graph/client/requests/AddTripleRequest.ts @@ -9,15 +9,27 @@ import * as core from "../../../../../core/index.js"; export const AddTripleRequest: core.serialization.Schema = core.serialization.object({ createdAt: core.serialization.property("created_at", core.serialization.string().optional()), + edgeAttributes: core.serialization.property( + "edge_attributes", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + ), expiredAt: core.serialization.property("expired_at", core.serialization.string().optional()), fact: core.serialization.string(), factName: core.serialization.property("fact_name", core.serialization.string()), factUuid: core.serialization.property("fact_uuid", core.serialization.string().optional()), graphId: core.serialization.property("graph_id", core.serialization.string().optional()), invalidAt: core.serialization.property("invalid_at", core.serialization.string().optional()), + sourceNodeAttributes: core.serialization.property( + "source_node_attributes", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + ), sourceNodeName: core.serialization.property("source_node_name", core.serialization.string()), sourceNodeSummary: core.serialization.property("source_node_summary", core.serialization.string().optional()), sourceNodeUuid: core.serialization.property("source_node_uuid", core.serialization.string().optional()), + targetNodeAttributes: core.serialization.property( + "target_node_attributes", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + ), targetNodeName: core.serialization.property("target_node_name", core.serialization.string()), targetNodeSummary: core.serialization.property("target_node_summary", core.serialization.string().optional()), targetNodeUuid: core.serialization.property("target_node_uuid", core.serialization.string().optional()), @@ -28,15 +40,18 @@ export const AddTripleRequest: core.serialization.Schema | null; expired_at?: string | null; fact: string; fact_name: string; fact_uuid?: string | null; graph_id?: string | null; invalid_at?: string | null; + source_node_attributes?: Record | null; source_node_name: string; source_node_summary?: string | null; source_node_uuid?: string | null; + target_node_attributes?: Record | null; target_node_name: string; target_node_summary?: string | null; target_node_uuid?: string | null; diff --git a/src/serialization/types/PropertyFilter.ts b/src/serialization/types/PropertyFilter.ts new file mode 100644 index 00000000..2ebed419 --- /dev/null +++ b/src/serialization/types/PropertyFilter.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Zep from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { ComparisonOperator } from "./ComparisonOperator.js"; + +export const PropertyFilter: core.serialization.ObjectSchema = + core.serialization.object({ + comparisonOperator: core.serialization.property("comparison_operator", ComparisonOperator), + propertyName: core.serialization.property("property_name", core.serialization.string()), + propertyValue: core.serialization.property("property_value", core.serialization.unknown().optional()), + }); + +export declare namespace PropertyFilter { + export interface Raw { + comparison_operator: ComparisonOperator.Raw; + property_name: string; + property_value?: unknown | null; + } +} diff --git a/src/serialization/types/SearchFilters.ts b/src/serialization/types/SearchFilters.ts index 6acc7204..37387f3a 100644 --- a/src/serialization/types/SearchFilters.ts +++ b/src/serialization/types/SearchFilters.ts @@ -6,6 +6,7 @@ import * as serializers from "../index.js"; import * as Zep from "../../api/index.js"; import * as core from "../../core/index.js"; import { DateFilter } from "./DateFilter.js"; +import { PropertyFilter } from "./PropertyFilter.js"; export const SearchFilters: core.serialization.ObjectSchema = core.serialization.object({ @@ -17,6 +18,10 @@ export const SearchFilters: core.serialization.ObjectSchema { uuid: "uuid", }); }); + + test("delete", async () => { + const server = mockServerPool.createServer(); + const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .delete("/graph/node/uuid") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.graph.node.delete("uuid"); + expect(response).toEqual({ + message: "message", + }); + }); }); From 3a5692a688b62bade76fa12be433b99e0013c883 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 7 Jan 2026 17:00:45 +0000 Subject: [PATCH 59/59] SDK regeneration --- reference.md | 2 -- src/api/resources/graph/client/Client.ts | 4 +--- .../resources/graph/client/requests/AddTripleRequest.ts | 8 +++----- src/api/types/DateFilter.ts | 7 +++++-- .../resources/graph/client/requests/AddTripleRequest.ts | 8 ++++---- src/serialization/types/DateFilter.ts | 4 ++-- tests/wire/graph.test.ts | 9 +-------- 7 files changed, 16 insertions(+), 26 deletions(-) diff --git a/reference.md b/reference.md index 07b6c627..43428daa 100644 --- a/reference.md +++ b/reference.md @@ -620,8 +620,6 @@ Add a fact triple for a user or group await client.graph.addFactTriple({ fact: "fact", factName: "fact_name", - sourceNodeName: "source_node_name", - targetNodeName: "target_node_name", }); ``` diff --git a/src/api/resources/graph/client/Client.ts b/src/api/resources/graph/client/Client.ts index f31d3881..8ed0cfb4 100644 --- a/src/api/resources/graph/client/Client.ts +++ b/src/api/resources/graph/client/Client.ts @@ -533,9 +533,7 @@ export class Graph { * @example * await client.graph.addFactTriple({ * fact: "fact", - * factName: "fact_name", - * sourceNodeName: "source_node_name", - * targetNodeName: "target_node_name" + * factName: "fact_name" * }) */ public addFactTriple( diff --git a/src/api/resources/graph/client/requests/AddTripleRequest.ts b/src/api/resources/graph/client/requests/AddTripleRequest.ts index a8bd81ea..dbc725f1 100644 --- a/src/api/resources/graph/client/requests/AddTripleRequest.ts +++ b/src/api/resources/graph/client/requests/AddTripleRequest.ts @@ -6,9 +6,7 @@ * @example * { * fact: "fact", - * factName: "fact_name", - * sourceNodeName: "source_node_name", - * targetNodeName: "target_node_name" + * factName: "fact_name" * } */ export interface AddTripleRequest { @@ -36,7 +34,7 @@ export interface AddTripleRequest { */ sourceNodeAttributes?: Record; /** The name of the source node to add */ - sourceNodeName: string; + sourceNodeName?: string; /** The summary of the source node to add */ sourceNodeSummary?: string; /** The source node uuid */ @@ -47,7 +45,7 @@ export interface AddTripleRequest { */ targetNodeAttributes?: Record; /** The name of the target node to add */ - targetNodeName: string; + targetNodeName?: string; /** The summary of the target node to add */ targetNodeSummary?: string; /** The target node uuid */ diff --git a/src/api/types/DateFilter.ts b/src/api/types/DateFilter.ts index 8c732d3e..a13b0247 100644 --- a/src/api/types/DateFilter.ts +++ b/src/api/types/DateFilter.ts @@ -7,6 +7,9 @@ import * as Zep from "../index.js"; export interface DateFilter { /** Comparison operator for date filter */ comparisonOperator: Zep.ComparisonOperator; - /** Date to filter on */ - date: string; + /** + * Date to filter on. Required for non-null operators (=, <>, >, <, >=, <=). + * Should be omitted for IS NULL and IS NOT NULL operators. + */ + date?: string; } diff --git a/src/serialization/resources/graph/client/requests/AddTripleRequest.ts b/src/serialization/resources/graph/client/requests/AddTripleRequest.ts index 9cd57835..bea6df30 100644 --- a/src/serialization/resources/graph/client/requests/AddTripleRequest.ts +++ b/src/serialization/resources/graph/client/requests/AddTripleRequest.ts @@ -23,14 +23,14 @@ export const AddTripleRequest: core.serialization.Schema | null; - source_node_name: string; + source_node_name?: string | null; source_node_summary?: string | null; source_node_uuid?: string | null; target_node_attributes?: Record | null; - target_node_name: string; + target_node_name?: string | null; target_node_summary?: string | null; target_node_uuid?: string | null; user_id?: string | null; diff --git a/src/serialization/types/DateFilter.ts b/src/serialization/types/DateFilter.ts index f6e6fa50..d344fca0 100644 --- a/src/serialization/types/DateFilter.ts +++ b/src/serialization/types/DateFilter.ts @@ -10,12 +10,12 @@ import { ComparisonOperator } from "./ComparisonOperator.js"; export const DateFilter: core.serialization.ObjectSchema = core.serialization.object({ comparisonOperator: core.serialization.property("comparison_operator", ComparisonOperator), - date: core.serialization.string(), + date: core.serialization.string().optional(), }); export declare namespace DateFilter { export interface Raw { comparison_operator: ComparisonOperator.Raw; - date: string; + date?: string | null; } } diff --git a/tests/wire/graph.test.ts b/tests/wire/graph.test.ts index 0e940f39..e6d6ebaf 100644 --- a/tests/wire/graph.test.ts +++ b/tests/wire/graph.test.ts @@ -197,12 +197,7 @@ describe("Graph", () => { test("add_fact_triple", async () => { const server = mockServerPool.createServer(); const client = new ZepClient({ apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { - fact: "fact", - fact_name: "fact_name", - source_node_name: "source_node_name", - target_node_name: "target_node_name", - }; + const rawRequestBody = { fact: "fact", fact_name: "fact_name" }; const rawResponseBody = { edge: { attributes: { key: "value" }, @@ -253,8 +248,6 @@ describe("Graph", () => { const response = await client.graph.addFactTriple({ fact: "fact", factName: "fact_name", - sourceNodeName: "source_node_name", - targetNodeName: "target_node_name", }); expect(response).toEqual({ edge: {