UNPKG

@dooor-ai/toolkit

Version:

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

26 lines 1.05 kB
import { Guard } from "./base"; import { GuardExecutionSummary } from "../core/types"; export interface RunGuardsOptions { /** * Arbitrary metadata passed down to guards (e.g. user/session info) */ metadata?: Record<string, any>; /** * When false, guards won't throw GuardBlockedException on failure. * Consumers can inspect the returned results to decide what to do. * Defaults to true (throws). */ throwOnBlock?: boolean; } /** * Executes a list of guards against a text input. * Useful for manual HTTP integrations outside of LangChain. * * @param guards Guards to run * @param inputText Text to validate (already preprocessed by the caller) * @param options Additional execution options * @returns Guard execution summaries (name/result/latency) * @throws GuardBlockedException if a guard blocks the request (configurable) */ export declare function runGuards(guards: Guard[], inputText: string, options?: RunGuardsOptions): Promise<GuardExecutionSummary[]>; //# sourceMappingURL=run.d.ts.map