import { ChatConfig, ConvTemplateConfig, Role } from "./config";
import { ChatCompletionRequest } from "./openai_api_protocols/index";
/**
 * Helper to keep track of history conversations.
 */
export declare class Conversation {
    messages: Array<[Role, string, string | undefined]>;
    readonly config: ConvTemplateConfig;
    /** Whether the Conversation object is for text completion with no conversation-style formatting */
    isTextCompletion: boolean;
    /** Used when isTextCompletion is true */
    prompt: string | undefined;
    function_string: string;
    use_function_calling: boolean;
    override_system_message?: string;
    constructor(config: ConvTemplateConfig, isTextCompletion?: boolean);
    private getPromptArrayInternal;
    /**
     * Get prompt arrays with the first one as system.
     *
     * @returns The prompt array.
     */
    getPromptArray(): Array<string>;
    /**
     * Get the last round of prompt has not been fed as input.
     *
     * @note This function needs to be used with the assumption that
     *       the caller call appendMessage then appendReplyHeader.
     *
     * @returns The prompt array.
     */
    getPromptArrayLastRound(): string[];
    /**
     * Return prompt in an array for non-conversation text completion.
     */
    getPromptArrayTextCompletion(): Array<string>;
    /**
     * Resets all states for this.conversation.
     */
    reset(): void;
    getStopStr(): string[];
    getStopTokens(): number[];
    appendMessage(role: Role, message: string, role_name?: string): void;
    appendReplyHeader(role: Role): void;
    finishReply(message: string): void;
}
export declare function getConversation(conv_template: ConvTemplateConfig, conv_config?: Partial<ConvTemplateConfig>, isTextCompletion?: boolean): Conversation;
/**
 * Compare the states of two conversation instances. Equality is defined as their getPromptArray()
 * should return the exact same things, which is determined by fields: messages, function_string,
 * use_function_calling, and override_system_message.
 *
 * @returns True if `convA` equals to `convB`
 * @note We assume convA and convB has the same `this.config`.
 */
export declare function compareConversationObject(convA: Conversation, convB: Conversation): boolean;
/**
 * Get a new Conversation object based on the chat completion request.
 *
 * @param request The incoming ChatCompletionRequest
 * @note `request.messages[-1]` is not included as it would be treated as a normal input to
 * `prefill()`.
 */
export declare function getConversationFromChatCompletionRequest(request: ChatCompletionRequest, config: ChatConfig): Conversation;
/**
 * Returns the function string based on the request.tools and request.tool_choice, raises erros if
 * encounter invalid request.
 *
 * @param request The chatCompletionRequest we are about to prefill for.
 * @returns The string used to set Conversatoin.function_string
 */
export declare function getFunctionCallUsage(request: ChatCompletionRequest): string;
//# sourceMappingURL=conversation.d.ts.map