import type { ImageType } from "../Node.js";
import type { LLM, LLMChat, MessageContent, MessageContentDetail } from "./types.js";
export declare function streamConverter<S, D>(stream: AsyncIterable<S>, converter: (s: S) => D | null): AsyncIterable<D>;
export declare function streamCallbacks<S>(stream: AsyncIterable<S>, callbacks: {
    finished?: (value?: S) => void;
}): AsyncIterable<S>;
export declare function streamReducer<S, D>(params: {
    stream: AsyncIterable<S>;
    reducer: (previousValue: D, currentValue: S) => D;
    initialValue: D;
    finished?: (value: D) => void;
}): AsyncIterable<S>;
/**
 * Extracts just the text from a multi-modal message or the message itself if it's just text.
 *
 * @param message The message to extract text from.
 * @returns The extracted text
 */
export declare function extractText(message: MessageContent): string;
/**
 * Extracts a single text from a multi-modal message content
 *
 * @param message The message to extract images from.
 * @returns The extracted images
 */
export declare function extractSingleText(message: MessageContentDetail): string | null;
/**
 * Extracts an image from a multi-modal message content
 *
 * @param message The message to extract images from.
 * @returns The extracted images
 */
export declare function extractImage(message: MessageContentDetail): ImageType | null;
export declare const extractDataUrlComponents: (dataUrl: string) => {
    mimeType: string;
    base64: string;
};
/**
 * @internal
 */
export declare function wrapLLMEvent<AdditionalChatOptions extends object = object, AdditionalMessageOptions extends object = object>(originalMethod: LLMChat<AdditionalChatOptions, AdditionalMessageOptions>["chat"], _context: ClassMethodDecoratorContext): (this: LLM<AdditionalChatOptions, AdditionalMessageOptions>, params: import("./types.js").LLMChatParamsStreaming<AdditionalChatOptions, object> | import("./types.js").LLMChatParamsNonStreaming<AdditionalChatOptions, object>) => ReturnType<LLMChat<AdditionalChatOptions, AdditionalMessageOptions>["chat"]>;
