UNPKG

@dooor-ai/toolkit

Version:

Guards, Evals & Observability for AI applications - works seamlessly with LangChain/LangGraph

32 lines 900 B
import { GuardResult, GuardConfig } from "../core/types"; /** * Abstract base class for all guards */ export declare abstract class Guard { protected config: GuardConfig; constructor(config?: GuardConfig); /** * Get the name of this guard */ abstract get name(): string; /** * Validate the input * @param input - The input text to validate * @param metadata - Additional metadata (e.g., user info, session) * @returns GuardResult indicating if input passed */ abstract validate(input: string, metadata?: Record<string, any>): Promise<GuardResult> | GuardResult; /** * Check if this guard is enabled */ isEnabled(): boolean; /** * Check if guard should block on detection */ shouldBlock(): boolean; /** * Get the threshold */ getThreshold(): number; } //# sourceMappingURL=base.d.ts.map