import type { LLM } from "../llm/index.js";
import type { RefinePrompt, TextQaPrompt, TreeSummarizePrompt } from "../Prompt.js";
import type { PromptHelper } from "../PromptHelper.js";
import { PromptMixin } from "../prompts/Mixin.js";
import type { ServiceContext } from "../ServiceContext.js";
import type { ResponseBuilder, ResponseBuilderParamsNonStreaming, ResponseBuilderParamsStreaming } from "./types.js";
/**
 * Response modes of the response synthesizer
 */
declare enum ResponseMode {
    REFINE = "refine",
    COMPACT = "compact",
    TREE_SUMMARIZE = "tree_summarize",
    SIMPLE = "simple"
}
/**
 * A response builder that just concatenates responses.
 */
export declare class SimpleResponseBuilder implements ResponseBuilder {
    llm: LLM;
    textQATemplate: TextQaPrompt;
    constructor(serviceContext?: ServiceContext, textQATemplate?: TextQaPrompt);
    getResponse(params: ResponseBuilderParamsStreaming): Promise<AsyncIterable<string>>;
    getResponse(params: ResponseBuilderParamsNonStreaming): Promise<string>;
}
/**
 * A response builder that uses the query to ask the LLM generate a better response using multiple text chunks.
 */
export declare class Refine extends PromptMixin implements ResponseBuilder {
    llm: LLM;
    promptHelper: PromptHelper;
    textQATemplate: TextQaPrompt;
    refineTemplate: RefinePrompt;
    constructor(serviceContext?: ServiceContext, textQATemplate?: TextQaPrompt, refineTemplate?: RefinePrompt);
    protected _getPrompts(): {
        textQATemplate: RefinePrompt;
        refineTemplate: RefinePrompt;
    };
    protected _updatePrompts(prompts: {
        textQATemplate: RefinePrompt;
        refineTemplate: RefinePrompt;
    }): void;
    getResponse(params: ResponseBuilderParamsStreaming): Promise<AsyncIterable<string>>;
    getResponse(params: ResponseBuilderParamsNonStreaming): Promise<string>;
    private giveResponseSingle;
    private refineResponseSingle;
    complete(params: {
        prompt: string;
        stream: boolean;
    }): Promise<AsyncIterable<string> | string>;
}
/**
 * CompactAndRefine is a slight variation of Refine that first compacts the text chunks into the smallest possible number of chunks.
 */
export declare class CompactAndRefine extends Refine {
    getResponse(params: ResponseBuilderParamsStreaming): Promise<AsyncIterable<string>>;
    getResponse(params: ResponseBuilderParamsNonStreaming): Promise<string>;
}
/**
 * TreeSummarize repacks the text chunks into the smallest possible number of chunks and then summarizes them, then recursively does so until there's one chunk left.
 */
export declare class TreeSummarize extends PromptMixin implements ResponseBuilder {
    llm: LLM;
    promptHelper: PromptHelper;
    summaryTemplate: TreeSummarizePrompt;
    constructor(serviceContext?: ServiceContext, summaryTemplate?: TreeSummarizePrompt);
    protected _getPrompts(): {
        summaryTemplate: TreeSummarizePrompt;
    };
    protected _updatePrompts(prompts: {
        summaryTemplate: TreeSummarizePrompt;
    }): void;
    getResponse(params: ResponseBuilderParamsStreaming): Promise<AsyncIterable<string>>;
    getResponse(params: ResponseBuilderParamsNonStreaming): Promise<string>;
}
export declare function getResponseBuilder(serviceContext?: ServiceContext, responseMode?: ResponseMode): ResponseBuilder;
export type ResponseBuilderPrompts = TextQaPrompt | TreeSummarizePrompt | RefinePrompt;
export {};
