export { C as CheckProfanityResult, F as FilterConfig, L as Language } from '../types-B9c_ik4k.js'; /** * LangChain Tool Integration for glin-profanity * * Provides ready-to-use tools for LangChain agents and chains. * Compatible with LangChain.js and Python (via equivalent API). * * @example * ```typescript * import { createAgent } from 'langchain'; * import { profanityCheckTool, censorTextTool, batchCheckTool } from 'glin-profanity/ai/langchain'; * * const agent = createAgent({ * model: 'gpt-4o', * tools: [profanityCheckTool, censorTextTool, batchCheckTool], * }); * * const result = await agent.invoke('Check if "Hello world" contains profanity'); * ``` * * @packageDocumentation * @module glin-profanity/ai/langchain */ /** * LangChain tool definition interface */ interface LangChainTool { name: string; description: string; schema: unknown; invoke: (input: T) => Promise; } /** * Tool input types */ interface CheckProfanityInput { text: string; languages?: string[]; detectLeetspeak?: boolean; normalizeUnicode?: boolean; } interface CensorTextInput { text: string; replacement?: string; languages?: string[]; } interface BatchCheckInput { texts: string[]; languages?: string[]; detectLeetspeak?: boolean; } interface AnalyzeContextInput { text: string; languages?: string[]; contextWindow?: number; confidenceThreshold?: number; } /** * Creates a profanity check tool for LangChain * * @example * ```typescript * import { tool } from '@langchain/core/tools'; * import { createProfanityCheckTool } from 'glin-profanity/ai/langchain'; * * const profanityTool = createProfanityCheckTool(); * const result = await profanityTool.invoke({ text: 'Hello world' }); * ``` */ declare function createProfanityCheckTool(): { name: string; description: string; schema: any; invoke: (input: CheckProfanityInput) => Promise; }; /** * Creates a censor text tool for LangChain */ declare function createCensorTextTool(): { name: string; description: string; schema: any; invoke: (input: CensorTextInput) => Promise; }; /** * Creates a batch check tool for LangChain */ declare function createBatchCheckTool(): { name: string; description: string; schema: any; invoke: (input: BatchCheckInput) => Promise; }; /** * Creates a context-aware analysis tool for LangChain */ declare function createContextAnalysisTool(): { name: string; description: string; schema: any; invoke: (input: AnalyzeContextInput) => Promise; }; /** * Creates a supported languages tool for LangChain */ declare function createSupportedLanguagesTool(): { name: string; description: string; schema: any; invoke: () => Promise; }; /** * Pre-built profanity check tool instance * Use directly with LangChain agents */ declare const profanityCheckTool: { name: string; description: string; schema: any; invoke: (input: CheckProfanityInput) => Promise; }; /** * Pre-built censor text tool instance */ declare const censorTextTool: { name: string; description: string; schema: any; invoke: (input: CensorTextInput) => Promise; }; /** * Pre-built batch check tool instance */ declare const batchCheckTool: { name: string; description: string; schema: any; invoke: (input: BatchCheckInput) => Promise; }; /** * Pre-built context analysis tool instance */ declare const contextAnalysisTool: { name: string; description: string; schema: any; invoke: (input: AnalyzeContextInput) => Promise; }; /** * Pre-built supported languages tool instance */ declare const supportedLanguagesTool: { name: string; description: string; schema: any; invoke: () => Promise; }; /** * All profanity tools bundled together * * @example * ```typescript * import { createAgent } from 'langchain'; * import { allProfanityTools } from 'glin-profanity/ai/langchain'; * * const agent = createAgent({ * model: 'gpt-4o', * tools: allProfanityTools, * }); * ``` */ declare const allProfanityTools: ({ name: string; description: string; schema: any; invoke: (input: CheckProfanityInput) => Promise; } | { name: string; description: string; schema: any; invoke: (input: CensorTextInput) => Promise; } | { name: string; description: string; schema: any; invoke: (input: BatchCheckInput) => Promise; } | { name: string; description: string; schema: any; invoke: (input: AnalyzeContextInput) => Promise; })[]; /** * Creates all profanity tools with custom configuration * * @param config - Optional filter configuration to apply to all tools * @returns Array of LangChain-compatible tools * * @example * ```typescript * const tools = createAllProfanityTools({ * languages: ['english', 'spanish'], * detectLeetspeak: true, * }); * ``` */ declare function createAllProfanityTools(): ({ name: string; description: string; schema: any; invoke: (input: CheckProfanityInput) => Promise; } | { name: string; description: string; schema: any; invoke: (input: CensorTextInput) => Promise; } | { name: string; description: string; schema: any; invoke: (input: BatchCheckInput) => Promise; } | { name: string; description: string; schema: any; invoke: (input: AnalyzeContextInput) => Promise; })[]; export { type AnalyzeContextInput, type BatchCheckInput, type CensorTextInput, type CheckProfanityInput, type LangChainTool, allProfanityTools, batchCheckTool, censorTextTool, contextAnalysisTool, createAllProfanityTools, createBatchCheckTool, createCensorTextTool, createContextAnalysisTool, createProfanityCheckTool, createSupportedLanguagesTool, profanityCheckTool, supportedLanguagesTool };