@n8n/n8n-nodes-langchain
Version:

32 lines (31 loc) • 1.46 kB
TypeScript
import { BaseCallbackHandler } from '@langchain/core/callbacks/base';
import type { SerializedFields } from '@langchain/core/dist/load/map_keys';
import type { Serialized, SerializedNotImplemented, SerializedSecret } from '@langchain/core/load/serializable';
import type { BaseMessage } from '@langchain/core/messages';
import type { LLMResult } from '@langchain/core/outputs';
import type { IDataObject, ISupplyDataFunctions } from 'n8n-workflow';
import { NodeError } from 'n8n-workflow';
type RunDetail = {
index: number;
messages: BaseMessage[] | string[] | string;
options: SerializedSecret | SerializedNotImplemented | SerializedFields;
};
export declare class N8nNonEstimatingTracing extends BaseCallbackHandler {
#private;
private executionFunctions;
name: string;
awaitHandlers: boolean;
connectionType: "ai_languageModel";
runsMap: Record<string, RunDetail>;
options: {
errorDescriptionMapper: (error: NodeError) => string | null | undefined;
};
constructor(executionFunctions: ISupplyDataFunctions, options?: {
errorDescriptionMapper?: (error: NodeError) => string;
});
handleLLMEnd(output: LLMResult, runId: string): Promise<void>;
handleLLMStart(llm: Serialized, prompts: string[], runId: string): Promise<void>;
handleLLMError(error: IDataObject | Error, runId: string, parentRunId?: string): Promise<void>;
setParentRunIndex(runIndex: number): void;
}
export {};