import { LLMCache, LLMMeta, EmbeddingOptions, EmbeddingOutput, ExecutionOptions, BaseLLMEvents, BaseLLMTokenizeOutput, AsyncStream } from './llms/base.cjs';
import { WatsonXLLMInput, WatsonXLLMOutput, WatsonXLLM, WatsonXLLMParameters, WatsonXLLMGenerateOptions } from './adapters/watsonx/llm.cjs';
import { ChatLLMOutput, ChatLLMGenerateEvents, ChatLLM } from './llms/chat.cjs';
import { BaseMessage } from './llms/primitives/message.cjs';
import { E as Emitter } from './emitter-BWtGHYn0.cjs';
import { GetRunContext } from './context.cjs';

/**
 * Copyright 2025 IBM Corp.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

interface WatsonXChatLLMPreset {
    chat: WatsonXChatLLMInputConfig;
    base: Omit<WatsonXLLMInput, "client" | "modelId">;
}
declare const WatsonXChatLLMPreset: {
    readonly "meta-llama/llama-3-3-70b-instruct": () => WatsonXChatLLMPreset;
    readonly "ibm/granite-3-8b-instruct": () => WatsonXChatLLMPreset;
    readonly "ibm/granite-3-2b-instruct": () => WatsonXChatLLMPreset;
    readonly "meta-llama/llama-3-1-70b-instruct": () => WatsonXChatLLMPreset;
    readonly "meta-llama/llama-3-1-405b-instruct": () => WatsonXChatLLMPreset;
    readonly "meta-llama/llama-3-1-8b-instruct": () => WatsonXChatLLMPreset;
    readonly "meta-llama/llama-3-70b-instruct": () => WatsonXChatLLMPreset;
    readonly "meta-llama/llama-3-8b-instruct": () => WatsonXChatLLMPreset;
};
type WatsonXChatLLMPresetModel = keyof typeof WatsonXChatLLMPreset;

declare class WatsonXChatLLMOutput extends ChatLLMOutput {
    readonly raw: WatsonXLLMOutput;
    constructor(rawOutput: WatsonXLLMOutput);
    get messages(): BaseMessage[];
    merge(other: WatsonXChatLLMOutput): void;
    getTextContent(): string;
    toString(): string;
    createSnapshot(): {
        raw: WatsonXLLMOutput;
    };
    loadSnapshot(snapshot: ReturnType<typeof this.createSnapshot>): void;
}
interface WatsonXChatLLMInputConfig {
    messagesToPrompt: (messages: BaseMessage[]) => string;
}
interface WatsonXChatLLMInput {
    llm: WatsonXLLM;
    config: WatsonXChatLLMInputConfig;
    cache?: LLMCache<WatsonXChatLLMOutput>;
}
type WatsonXChatLLMEvents = ChatLLMGenerateEvents<WatsonXChatLLMOutput>;
declare class WatsonXChatLLM extends ChatLLM<WatsonXChatLLMOutput> {
    readonly emitter: Emitter<WatsonXChatLLMEvents>;
    readonly llm: WatsonXLLM;
    protected readonly config: WatsonXChatLLMInputConfig;
    readonly parameters: WatsonXLLMParameters;
    constructor({ llm, config, cache }: WatsonXChatLLMInput);
    meta(): Promise<LLMMeta>;
    embed(input: BaseMessage[][], options?: EmbeddingOptions): Promise<EmbeddingOutput>;
    createSnapshot(): {
        modelId: string;
        parameters: WatsonXLLMParameters;
        executionOptions: ExecutionOptions;
        llm: WatsonXLLM;
        config: WatsonXChatLLMInputConfig;
        emitter: Emitter<BaseLLMEvents<unknown, WatsonXChatLLMOutput>>;
        cache: LLMCache<WatsonXChatLLMOutput>;
    };
    loadSnapshot(data: ReturnType<typeof this.createSnapshot>): void;
    tokenize(messages: BaseMessage[]): Promise<BaseLLMTokenizeOutput>;
    protected _generate(messages: BaseMessage[], options: WatsonXLLMGenerateOptions | undefined, run: GetRunContext<this>): Promise<WatsonXChatLLMOutput>;
    protected _stream(messages: BaseMessage[], options: WatsonXLLMGenerateOptions | undefined, run: GetRunContext<this>): AsyncStream<WatsonXChatLLMOutput, void>;
    messagesToPrompt(messages: BaseMessage[]): string;
    static fromPreset(modelId: WatsonXChatLLMPresetModel, overrides: Omit<WatsonXLLMInput, "parameters" | "modelId"> & {
        parameters?: WatsonXLLMParameters | ((value: WatsonXLLMParameters) => WatsonXLLMParameters);
    }): WatsonXChatLLM;
}

export { WatsonXChatLLMPreset as W, type WatsonXChatLLMPresetModel as a, WatsonXChatLLMOutput as b, type WatsonXChatLLMInputConfig as c, type WatsonXChatLLMInput as d, type WatsonXChatLLMEvents as e, WatsonXChatLLM as f };
