/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments"; import * as core from "../../../../core"; import * as Vectara from "../../../index"; export declare namespace Chats { interface Options { environment?: core.Supplier; token?: core.Supplier; /** Override the x-api-key header */ apiKey?: core.Supplier; 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; /** Override the x-api-key header */ apiKey?: string | undefined; /** Additional headers to include in the request. */ headers?: Record; } } /** * Create, manage, and interact with chat sessions for conversational AI */ export declare class Chats { protected readonly _options: Chats.Options; constructor(_options?: Chats.Options); /** * Retrieve a list of previous chats in the Vectara account. * * @param {Vectara.ChatsListRequest} request * @param {Chats.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.ForbiddenError} * @throws {@link Vectara.NotFoundError} * * @example * await client.chats.list() */ list(request?: Vectara.ChatsListRequest, requestOptions?: Chats.RequestOptions): Promise>; /** * Get a chat summary to view what started the chat, but not subsequent turns. * * @param {string} chatId - The ID of the chat. * @param {Vectara.ChatsGetRequest} request * @param {Chats.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.ForbiddenError} * @throws {@link Vectara.NotFoundError} * * @example * await client.chats.get("chat_id") */ get(chatId: string, request?: Vectara.ChatsGetRequest, requestOptions?: Chats.RequestOptions): Promise; /** * Delete a chat and any turns it contains permanently. * * @param {string} chatId - The ID of the chat. * @param {Vectara.ChatsDeleteRequest} request * @param {Chats.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.ForbiddenError} * @throws {@link Vectara.NotFoundError} * * @example * await client.chats.delete("chat_id") */ delete(chatId: string, request?: Vectara.ChatsDeleteRequest, requestOptions?: Chats.RequestOptions): Promise; /** * List all turns in a chat to see all message and response pairs that make up the dialog. * * @param {string} chatId - The ID of the chat. * @param {Vectara.ChatsListTurnsRequest} request * @param {Chats.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.ForbiddenError} * @throws {@link Vectara.NotFoundError} * * @example * await client.chats.listTurns("chat_id") */ listTurns(chatId: string, request?: Vectara.ChatsListTurnsRequest, requestOptions?: Chats.RequestOptions): Promise; /** * Create a new turn in the chat. Each conversation has a series of `turn` objects, which are the sequence of message and response pairs that make up the dialog. */ createTurnsStream(chatId: string, request: Vectara.ChatsCreateTurnsStreamRequest, requestOptions?: Chats.RequestOptions): Promise>; /** * Create a new turn in the chat. Each conversation has a series of `turn` objects, which are the sequence of message and response pairs that make up the dialog. * * @param {string} chatId - The ID of the chat. * @param {Vectara.ChatsCreateTurnsRequest} request * @param {Chats.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.BadRequestError} * @throws {@link Vectara.ForbiddenError} * @throws {@link Vectara.NotFoundError} * * @example * await client.chats.createTurns("chat_id", { * query: "How can I use the Vectara platform?", * search: {} * }) */ createTurns(chatId: string, request: Vectara.ChatsCreateTurnsRequest, requestOptions?: Chats.RequestOptions): Promise; /** * Get a specific turn from a chat, which is a message and response pair from the conversation. * * @param {string} chatId - The ID of the chat. * @param {string} turnId - The ID of the turn. * @param {Vectara.ChatsGetTurnRequest} request * @param {Chats.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.ForbiddenError} * @throws {@link Vectara.NotFoundError} * * @example * await client.chats.getTurn("chat_id", "turn_id") */ getTurn(chatId: string, turnId: string, request?: Vectara.ChatsGetTurnRequest, requestOptions?: Chats.RequestOptions): Promise; /** * Delete a turn from a chat. This will delete all subsequent turns in the chat. * * @param {string} chatId - The ID of the chat. * @param {string} turnId - The ID of the turn. * @param {Vectara.ChatsDeleteTurnRequest} request * @param {Chats.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.ForbiddenError} * @throws {@link Vectara.NotFoundError} * * @example * await client.chats.deleteTurn("chat_id", "turn_id") */ deleteTurn(chatId: string, turnId: string, request?: Vectara.ChatsDeleteTurnRequest, requestOptions?: Chats.RequestOptions): Promise; /** * Update a turn; used to disable or enable a chat. * * @param {string} chatId - The ID of the chat. * @param {string} turnId - The ID of the turn. * @param {Vectara.UpdateTurnRequest} request * @param {Chats.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.ForbiddenError} * @throws {@link Vectara.NotFoundError} * * @example * await client.chats.updateTurn("chat_id", "turn_id") */ updateTurn(chatId: string, turnId: string, request?: Vectara.UpdateTurnRequest, requestOptions?: Chats.RequestOptions): Promise; protected _getAuthorizationHeader(): Promise; }