import type { BaseChatModel } from "@langchain/core/language_models/chat_models";
import { type CompletionAdapter } from "adminforth";
import { BaseCallbackHandler } from "@langchain/core/callbacks/base";
import type { LLMResult } from "@langchain/core/outputs";
import { createSequenceDebugMiddleware } from "./middleware/sequenceDebug.js";
export type AgentChatModel = BaseChatModel<any, any>;
export type AgentModelPurpose = "primary" | "summary";
export type AgentModeCompletionAdapter = CompletionAdapter & {
    getLangChainAgentSpec(params: {
        maxTokens: number;
        purpose: AgentModelPurpose;
    }): Promise<{
        model: unknown;
        middleware?: unknown[];
    }> | {
        model: unknown;
        middleware?: unknown[];
    };
};
export type AgentMiddleware = ReturnType<typeof createSequenceDebugMiddleware>;
type AgentChatModelSpec = {
    model: AgentChatModel;
    middleware: AgentMiddleware[];
};
declare class AgentLlmMetricsLogger extends BaseCallbackHandler {
    name: string;
    lc_prefer_streaming: boolean;
    private readonly pendingRuns;
    handleLLMStart(_llm: unknown, _prompts: string[], runId: string): Promise<void>;
    handleLLMNewToken(_token: string, _chunk: unknown, runId: string): Promise<void>;
    handleLLMEnd(output: LLMResult, runId: string): Promise<void>;
    handleLLMError(_error: unknown, runId: string): Promise<void>;
}
export declare function createAgentLlmMetricsLogger(): AgentLlmMetricsLogger;
export declare function createAgentChatModel(params: {
    adapter: CompletionAdapter;
    maxTokens: number;
    purpose: AgentModelPurpose;
}): Promise<AgentChatModelSpec>;
export {};
