/** * Message conversion utilities between LangChain and AI SDK formats */ import { BaseMessage } from "@langchain/core/messages"; import { ChatResult, ChatGenerationChunk } from "@langchain/core/outputs"; import { type GenerateTextResult, type ToolSet, type ModelMessage, type StreamTextResult } from "ai"; /** * Convert LangChain messages to AI SDK ModelMessage format */ export declare function convertLangChainToModelMessages(messages: BaseMessage[]): ModelMessage[]; /** * Convert AI SDK generateText result to LangChain ChatResult */ export declare function convertGenerateTextResultToChatResult(result: GenerateTextResult): ChatResult; /** * Convert AI SDK streamText result to async generator of LangChain ChatGenerationChunk * * This function handles the TextStreamPart events from streamText's fullStream, * which provides normalized events across all providers. */ export declare function convertStreamTextResultToChunks(result: StreamTextResult): AsyncGenerator;