Skip to content
63 changes: 63 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1854,6 +1854,69 @@ await client.graph.update("graphId");
</dl>
</details>

<details><summary><code>client.graph.<a href="/src/api/resources/graph/client/Client.ts">warm</a>(graphId) -> Zep.SuccessResponse</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Hints Zep to warm a graph for low-latency search

</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```typescript
await client.graph.warm("graphId");
```

</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**graphId:** `string` — The graph_id of the graph to warm.

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `Graph.RequestOptions`

</dd>
</dl>
</dd>
</dl>

</dd>
</dl>
</details>

## Project

<details><summary><code>client.project.<a href="/src/api/resources/project/client/Client.ts">get</a>() -> Zep.ProjectInfoResponse</code></summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Zep from "../../../../index.js";

/**
* @example
* {}
*/
export interface ApidataCreateBatchRequest {
/**
* Optional list of message role types to skip during graph ingestion for
* thread_message items in this batch. The messages are still stored and
* retained as context, but no graph extraction is performed for them.
* Has no effect on graph_episode items.
*/
ignoreRoles?: Zep.RoleType[];
metadata?: Record<string, unknown>;
}
100 changes: 100 additions & 0 deletions src/api/resources/graph/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1838,6 +1838,106 @@ export class Graph {
}
}

/**
* Hints Zep to warm a graph for low-latency search
*
* @param {string} graphId - The graph_id of the graph to warm.
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Zep.NotFoundError}
* @throws {@link Zep.InternalServerError}
*
* @example
* await client.graph.warm("graphId")
*/
public warm(graphId: string, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.SuccessResponse> {
return core.HttpResponsePromise.fromPromise(this.__warm(graphId, requestOptions));
}

private async __warm(
graphId: string,
requestOptions?: Graph.RequestOptions,
): Promise<core.WithRawResponse<Zep.SuccessResponse>> {
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/${encodeURIComponent(graphId)}/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 /graph/{graphId}/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}` };
Expand Down
3 changes: 2 additions & 1 deletion src/api/types/BatchItemStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
* This file was auto-generated by Fern from our API Definition.
*/

export type BatchItemStatus = "pending" | "queued" | "processing" | "succeeded" | "failed" | "skipped";
export type BatchItemStatus = "pending" | "queued" | "processing" | "succeeded" | "failed" | "skipped" | "canceled";
export const BatchItemStatus = {
Pending: "pending",
Queued: "queued",
Processing: "processing",
Succeeded: "succeeded",
Failed: "failed",
Skipped: "skipped",
Canceled: "canceled",
} as const;
1 change: 1 addition & 0 deletions src/api/types/BatchProgress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

export interface BatchProgress {
canceledItems?: number;
failedItems?: number;
percentComplete?: number;
processingItems?: number;
Expand Down
11 changes: 10 additions & 1 deletion src/api/types/BatchStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
* This file was auto-generated by Fern from our API Definition.
*/

export type BatchStatus = "draft" | "invalid" | "queued" | "processing" | "succeeded" | "partial" | "failed";
export type BatchStatus =
| "draft"
| "invalid"
| "queued"
| "processing"
| "succeeded"
| "partial"
| "failed"
| "canceled";
export const BatchStatus = {
Draft: "draft",
Invalid: "invalid",
Expand All @@ -11,4 +19,5 @@ export const BatchStatus = {
Succeeded: "succeeded",
Partial: "partial",
Failed: "failed",
Canceled: "canceled",
} as const;
1 change: 1 addition & 0 deletions src/api/types/BatchSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface BatchSummary {
batchId?: string;
completedAt?: string;
createdAt?: string;
ignoreRoles?: Zep.RoleType[];
itemCount?: number;
metadata?: Record<string, unknown>;
processedAt?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@
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";

export const ApidataCreateBatchRequest: core.serialization.Schema<
serializers.ApidataCreateBatchRequest.Raw,
Zep.ApidataCreateBatchRequest
> = core.serialization.object({
ignoreRoles: core.serialization.property("ignore_roles", core.serialization.list(RoleType).optional()),
metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
});

export declare namespace ApidataCreateBatchRequest {
export interface Raw {
ignore_roles?: RoleType.Raw[] | null;
metadata?: Record<string, unknown> | null;
}
}
4 changes: 2 additions & 2 deletions src/serialization/types/BatchItemStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import * as Zep from "../../api/index.js";
import * as core from "../../core/index.js";

export const BatchItemStatus: core.serialization.Schema<serializers.BatchItemStatus.Raw, Zep.BatchItemStatus> =
core.serialization.enum_(["pending", "queued", "processing", "succeeded", "failed", "skipped"]);
core.serialization.enum_(["pending", "queued", "processing", "succeeded", "failed", "skipped", "canceled"]);

export declare namespace BatchItemStatus {
export type Raw = "pending" | "queued" | "processing" | "succeeded" | "failed" | "skipped";
export type Raw = "pending" | "queued" | "processing" | "succeeded" | "failed" | "skipped" | "canceled";
}
2 changes: 2 additions & 0 deletions src/serialization/types/BatchProgress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import * as core from "../../core/index.js";

export const BatchProgress: core.serialization.ObjectSchema<serializers.BatchProgress.Raw, Zep.BatchProgress> =
core.serialization.object({
canceledItems: core.serialization.property("canceled_items", core.serialization.number().optional()),
failedItems: core.serialization.property("failed_items", core.serialization.number().optional()),
percentComplete: core.serialization.property("percent_complete", core.serialization.number().optional()),
processingItems: core.serialization.property("processing_items", core.serialization.number().optional()),
Expand All @@ -19,6 +20,7 @@ export const BatchProgress: core.serialization.ObjectSchema<serializers.BatchPro

export declare namespace BatchProgress {
export interface Raw {
canceled_items?: number | null;
failed_items?: number | null;
percent_complete?: number | null;
processing_items?: number | null;
Expand Down
13 changes: 11 additions & 2 deletions src/serialization/types/BatchStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@ import * as Zep from "../../api/index.js";
import * as core from "../../core/index.js";

export const BatchStatus: core.serialization.Schema<serializers.BatchStatus.Raw, Zep.BatchStatus> =
core.serialization.enum_(["draft", "invalid", "queued", "processing", "succeeded", "partial", "failed"]);
core.serialization.enum_([
"draft",
"invalid",
"queued",
"processing",
"succeeded",
"partial",
"failed",
"canceled",
]);

export declare namespace BatchStatus {
export type Raw = "draft" | "invalid" | "queued" | "processing" | "succeeded" | "partial" | "failed";
export type Raw = "draft" | "invalid" | "queued" | "processing" | "succeeded" | "partial" | "failed" | "canceled";
}
3 changes: 3 additions & 0 deletions src/serialization/types/BatchSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
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 { BatchProgress } from "./BatchProgress.js";
import { BatchStatus } from "./BatchStatus.js";

Expand All @@ -13,6 +14,7 @@ export const BatchSummary: core.serialization.ObjectSchema<serializers.BatchSumm
batchId: core.serialization.property("batch_id", core.serialization.string().optional()),
completedAt: core.serialization.property("completed_at", core.serialization.string().optional()),
createdAt: core.serialization.property("created_at", core.serialization.string().optional()),
ignoreRoles: core.serialization.property("ignore_roles", core.serialization.list(RoleType).optional()),
itemCount: core.serialization.property("item_count", core.serialization.number().optional()),
metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
processedAt: core.serialization.property("processed_at", core.serialization.string().optional()),
Expand All @@ -26,6 +28,7 @@ export declare namespace BatchSummary {
batch_id?: string | null;
completed_at?: string | null;
created_at?: string | null;
ignore_roles?: RoleType.Raw[] | null;
item_count?: number | null;
metadata?: Record<string, unknown> | null;
processed_at?: string | null;
Expand Down
Loading
Loading