import type { ChatCompletionResponse, ChatCompletionToolChoice } from './provider'; import type { BaseMessage } from '@langchain/core/messages'; import { AIMessage } from '@langchain/core/messages'; interface OpenAISystemMessage { role: 'system'; content: string | null; } interface OpenAIUserMessage { role: 'user'; content: string | null; } interface OpenAIAssistantMessage { role: 'assistant'; content: string | null; tool_calls?: Array<{ id: string; function: { name: string; arguments: string; }; }>; } interface OpenAIToolMessage { role: 'tool'; content: string | null; tool_call_id: string; } export type OpenAIMessage = OpenAISystemMessage | OpenAIUserMessage | OpenAIAssistantMessage | OpenAIToolMessage; export type LangChainToolChoice = 'auto' | 'any' | 'none' | { type: 'tool'; name: string; } | undefined; /** Handles generic format conversions between OpenAI and LangChain. */ export declare class LangChainAdapter { /** Convert OpenAI-format messages to LangChain messages. */ static convertMessages(messages: OpenAIMessage[]): BaseMessage[]; /** Convert a LangChain AIMessage to an OpenAI-compatible ChatCompletionResponse. */ static convertResponse(response: AIMessage, modelName: string | null): ChatCompletionResponse; /** Convert OpenAI tool_choice to LangChain format. */ static convertToolChoice(toolChoice: ChatCompletionToolChoice | undefined): LangChainToolChoice; private static extractTextContent; private static parseToolArguments; } export {}; //# sourceMappingURL=langchain-adapter.d.ts.map