langcode
Version:
A Plugin-Based Framework for Managing and Using LangChain
30 lines (29 loc) • 988 B
TypeScript
import { LogLevel, plugins, PluginTypeMap } from "../types";
import { EventEmitter } from "events";
interface HistoryItem {
timestamp?: string;
level: LogLevel;
phase: "init" | "run" | "expose";
pluginName?: string;
message: string;
data?: any;
elapsedMs?: number;
}
export declare class PluginRunner extends EventEmitter {
private activePlugins;
private logger;
private strict?;
private tag;
private histories;
private historyLimit;
constructor(debug?: boolean, logFile?: string | null, strict?: boolean);
private pushHistory;
history(): HistoryItem[];
initialize(configList: {
pluginName: plugins;
config: Record<string, any>;
}[]): Promise<void>;
run<T extends keyof PluginTypeMap>(pluginName: T, args: PluginTypeMap[T]["runArgs"]): Promise<PluginTypeMap[T]["return"]>;
getExpose<T extends keyof PluginTypeMap>(pluginName: T): Promise<PluginTypeMap[T]["expose"] | undefined>;
}
export {};