import type { ImageType } from "../Node.js"; import type { LLM, LLMChat, MessageContent, MessageContentDetail } from "./types.js"; export declare function streamConverter(stream: AsyncIterable, converter: (s: S) => D | null): AsyncIterable; export declare function streamCallbacks(stream: AsyncIterable, callbacks: { finished?: (value?: S) => void; }): AsyncIterable; export declare function streamReducer(params: { stream: AsyncIterable; reducer: (previousValue: D, currentValue: S) => D; initialValue: D; finished?: (value: D) => void; }): AsyncIterable; /** * 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(originalMethod: LLMChat["chat"], _context: ClassMethodDecoratorContext): (this: LLM, params: import("./types.js").LLMChatParamsStreaming | import("./types.js").LLMChatParamsNonStreaming) => ReturnType["chat"]>;