// app/api/telegram/lib/llm.ts
import { HumanMessage } from '@langchain/core/messages';
import { OpenRouterClient } from './openrouter-client';

export const createCustomLLM = (apiKey: string, model: string) => {
    const client = new OpenRouterClient(apiKey, model);
    return {
        async invoke(params: { prompt: string }) {
            return await client.invoke([new HumanMessage(params.prompt)]);
        },
        _llmType() { return "openrouter"; }
    };
};