import { EmbeddingOptions, ExecutionOptions, LLMCache, LLMMeta, EmbeddingOutput, BaseLLMTokenizeOutput, GenerateOptions, StreamGenerateOptions, AsyncStream, BaseLLMEvents } from '../../llms/base.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 { OpenAI, AzureOpenAI, ClientOptions, AzureClientOptions } from 'openai';
import { GetRunContext } from '../../context.cjs';
import { ChatCompletionChunk, EmbeddingCreateParams, ChatCompletionCreateParams } from 'openai/resources/index';
import '../../errors.cjs';
import '../../internals/types.cjs';
import '../../internals/helpers/guards.cjs';
import '../../internals/serializable.cjs';
import '../../cache/base.cjs';
import 'promise-based-task';
import '../../internals/helpers/promise.cjs';

type Parameters = Omit<ChatCompletionCreateParams, "stream" | "messages" | "model">;
type Response = Omit<ChatCompletionChunk, "object">;
declare class OpenAIChatLLMOutput extends ChatLLMOutput {
    readonly responses: Response[];
    constructor(response: Response);
    get messages(): BaseMessage[];
    getTextContent(): string;
    merge(other: OpenAIChatLLMOutput): void;
    toString(): string;
    createSnapshot(): {
        responses: Response[];
    };
    loadSnapshot(snapshot: ReturnType<typeof this.createSnapshot>): void;
}
interface Input {
    modelId?: string;
    client?: OpenAI | AzureOpenAI;
    clientOptions?: ClientOptions | AzureClientOptions;
    parameters?: Partial<Parameters>;
    executionOptions?: ExecutionOptions;
    cache?: LLMCache<OpenAIChatLLMOutput>;
    azure?: boolean;
}
type OpenAIChatLLMEvents = ChatLLMGenerateEvents<OpenAIChatLLMOutput>;
interface OpenAIEmbeddingOptions extends EmbeddingOptions, Omit<EmbeddingCreateParams, "input" | "model"> {
}
declare class OpenAIChatLLM extends ChatLLM<OpenAIChatLLMOutput> {
    readonly emitter: Emitter<OpenAIChatLLMEvents>;
    readonly client: OpenAI | AzureOpenAI;
    readonly parameters: Partial<Parameters>;
    constructor({ client, modelId, parameters, executionOptions, clientOptions, cache, azure, }?: Input);
    meta(): Promise<LLMMeta>;
    embed(input: BaseMessage[][], options?: OpenAIEmbeddingOptions): Promise<EmbeddingOutput>;
    tokenize(input: BaseMessage[]): Promise<BaseLLMTokenizeOutput>;
    protected _prepareRequest(input: BaseMessage[], options?: GenerateOptions): ChatCompletionCreateParams;
    protected _generate(input: BaseMessage[], options: Partial<GenerateOptions>, run: GetRunContext<typeof this>): Promise<OpenAIChatLLMOutput>;
    protected _stream(input: BaseMessage[], options: StreamGenerateOptions | undefined, run: GetRunContext<typeof this>): AsyncStream<OpenAIChatLLMOutput>;
    createSnapshot(): {
        parameters: Partial<Parameters>;
        client: OpenAI | AzureOpenAI;
        modelId: string;
        executionOptions: ExecutionOptions;
        emitter: Emitter<BaseLLMEvents<unknown, OpenAIChatLLMOutput>>;
        cache: LLMCache<OpenAIChatLLMOutput>;
    };
}

export { OpenAIChatLLM, type OpenAIChatLLMEvents, OpenAIChatLLMOutput, type OpenAIEmbeddingOptions };
