/** * 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 { Message } from "../resources/message/client/Client.js"; export declare namespace Thread { 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; } 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 declare class Thread { protected readonly _options: Thread.Options; protected _message: Message | undefined; constructor(_options?: Thread.Options); get message(): Message; /** * Returns all threads. * * @param {Zep.ThreadListAllRequest} request * @param {Thread.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} * @throws {@link Zep.InternalServerError} * * @example * await client.thread.listAll({ * pageNumber: 1, * pageSize: 1, * orderBy: "order_by", * asc: true * }) */ listAll(request?: Zep.ThreadListAllRequest, requestOptions?: Thread.RequestOptions): core.HttpResponsePromise; private __listAll; /** * Start a new thread. * * @param {Zep.CreateThreadRequest} request * @param {Thread.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.BadRequestError} * @throws {@link Zep.InternalServerError} * * @example * await client.thread.create({ * threadId: "thread_id", * userId: "user_id" * }) */ create(request: Zep.CreateThreadRequest, requestOptions?: Thread.RequestOptions): core.HttpResponsePromise; private __create; /** * Deletes a thread. * * @param {string} threadId - The ID of the thread for which memory should be deleted. * @param {Thread.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.NotFoundError} * @throws {@link Zep.InternalServerError} * * @example * await client.thread.delete("threadId") */ delete(threadId: string, requestOptions?: Thread.RequestOptions): core.HttpResponsePromise; private __delete; /** * 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 current thread (for which context is being retrieved). * @param {Zep.ThreadGetUserContextRequest} request * @param {Thread.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.NotFoundError} * @throws {@link Zep.InternalServerError} * * @example * await client.thread.getUserContext("threadId", { * templateId: "template_id" * }) */ getUserContext(threadId: string, request?: Zep.ThreadGetUserContextRequest, requestOptions?: Thread.RequestOptions): core.HttpResponsePromise; private __getUserContext; /** * Returns messages for a thread. * * @param {string} threadId - Thread ID * @param {Zep.ThreadGetRequest} request * @param {Thread.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Zep.NotFoundError} * @throws {@link Zep.InternalServerError} * * @example * await client.thread.get("threadId", { * limit: 1, * cursor: 1, * lastn: 1 * }) */ get(threadId: string, request?: Zep.ThreadGetRequest, requestOptions?: Thread.RequestOptions): core.HttpResponsePromise; private __get; /** * Add messages to a thread. * * @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.addMessages("threadId", { * messages: [{ * content: "content", * role: "norole" * }] * }) */ addMessages(threadId: string, request: Zep.AddThreadMessagesRequest, requestOptions?: Thread.RequestOptions): core.HttpResponsePromise; private __addMessages; /** * 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" * }] * }) */ addMessagesBatch(threadId: string, request: Zep.AddThreadMessagesRequest, requestOptions?: Thread.RequestOptions): core.HttpResponsePromise; private __addMessagesBatch; protected _getCustomAuthorizationHeaders(): Promise<{ Authorization: string; }>; }