UNPKG

@nullplatform/llm-gateway-sdk

Version:
34 lines 1.91 kB
import { Plugin, PluginPhase } from '../types/plugin.js'; import { PluginExecutionContext, RequestContext } from '../types/context.js'; export declare abstract class BasePlugin implements Plugin { abstract readonly metadata: PluginMetadata; abstract readonly phase: PluginPhase; abstract execute(context: PluginExecutionContext): Promise<RequestContext>; onLoad(): Promise<void>; onUnload(): Promise<void>; onConfigChange(newConfig: any): Promise<void>; healthCheck(): Promise<boolean>; protected shouldExecute(context: RequestContext): boolean; protected logDebug(context: PluginExecutionContext, message: string, extra?: any): void; protected logInfo(context: PluginExecutionContext, message: string, extra?: any): void; protected logWarn(context: PluginExecutionContext, message: string, extra?: any): void; protected logError(context: PluginExecutionContext, message: string, extra?: any): void; validateConfig(config: any): boolean | string; validateRequest(context: RequestContext): boolean | string; } export declare abstract class PreProcessorPlugin extends BasePlugin { readonly phase: PluginPhase; execute(context: PluginExecutionContext): Promise<RequestContext>; protected abstract preProcess(context: PluginExecutionContext): Promise<RequestContext>; } export declare abstract class PostProcessorPlugin extends BasePlugin { readonly phase: PluginPhase; execute(context: PluginExecutionContext): Promise<RequestContext>; protected abstract postProcess(context: PluginExecutionContext): Promise<RequestContext>; } export declare abstract class MainProcessorPlugin extends BasePlugin { readonly phase: PluginPhase; execute(context: PluginExecutionContext): Promise<RequestContext>; protected abstract process(context: PluginExecutionContext): Promise<RequestContext>; } //# sourceMappingURL=plugin.d.ts.map