import { type BaseMessage } from "@langchain/core/messages"; export interface RunningSummary { readonly summary: string; readonly coveredCount: number; } export type TokenCounter = (text: string) => number | Promise; export type SummarizeFn = (args: { readonly messages: readonly BaseMessage[]; readonly model: string; readonly previousSummary?: string; readonly signal: AbortSignal; /** * The route's `retry` as the summarizer model's `maxRetries` * (`maxAttempts - 1`). `defaultSummarize` passes it to the chat model it * builds; a custom summarizer may use or ignore it. */ readonly maxRetries?: number; }) => Promise; export interface ResolvedSummarizationConfig { readonly maxTokens: number; readonly keepRecentTurns: number; readonly model: string; readonly tokenCounter: TokenCounter; readonly summarize: SummarizeFn; } export interface PreModelHookState { readonly messages: BaseMessage[]; readonly runningSummary?: RunningSummary; } export interface PreModelHookResult { llmInputMessages?: BaseMessage[]; runningSummary?: RunningSummary; } /** * `options.maxRetries` is handed to every `summarize` call; see * {@link SummarizeFn}. */ export declare function buildSummarizationHook(cfg: ResolvedSummarizationConfig, options?: { readonly maxRetries?: number; }): (state: PreModelHookState, nodeConfig?: { readonly signal?: AbortSignal; }) => Promise; //# sourceMappingURL=hook.d.ts.map