import { BaseMessage } from '@langchain/core/messages'; import { DynamicStructuredTool } from '@langchain/core/tools'; import { Message } from '../../../backend/message.cjs'; import '../../../internals/serializable.cjs'; import '../../../internals/types.cjs'; import '../../../internals/helpers/guards.cjs'; import 'ai'; /** * Copyright 2025 © BeeAI a Series of LF Projects, LLC * SPDX-License-Identifier: Apache-2.0 */ /** * Converts BeeAI Messages to LangChain BaseMessage format. * Handles UserMessage, AssistantMessage, ToolMessage, and SystemMessage. * ToolMessages with multiple results are split into separate messages with ID suffixes. * Unknown types fallback to LCUserMessage. * @param messages - Array of BeeAI messages * @returns Array of LangChain BaseMessage objects */ declare function toLCMessages(messages: Message[]): BaseMessage[]; /** * Converts LangChain BaseMessages to BeeAI Message format. * Handles LCUserMessage, LCAIMessage, AIMessageChunk, LCSystemMessage, and LCToolMessage. * Throws ValueError for unknown message types. * @param messages - Array of LangChain messages * @returns Array of BeeAI Message objects */ declare function toBeeAIMessages(messages: BaseMessage[]): Message[]; /** * Converts a BeeAI Tool to LangChain DynamicStructuredTool. * Wraps the tool's run method and extracts text content from results. * @param tool - The BeeAI tool to convert * @returns Promise resolving to LangChain DynamicStructuredTool */ declare function beeaiToolToLCTool(tool: any): Promise; export { beeaiToolToLCTool, toBeeAIMessages, toLCMessages };