/** * Content Moderation Types and Interfaces */ export declare enum ModerationSeverity { LOW = "low", MEDIUM = "medium", HIGH = "high", CRITICAL = "critical" } export declare enum ModerationCategory { HATE_SPEECH = "hate_speech", HARASSMENT = "harassment", VIOLENCE = "violence", SELF_HARM = "self_harm", SEXUAL_CONTENT = "sexual_content", ILLEGAL_ACTIVITY = "illegal_activity", PII = "pii", FINANCIAL_INFO = "financial_info", HEALTH_INFO = "health_info", CREDENTIALS = "credentials", SPAM = "spam", PROFANITY = "profanity", TOXIC = "toxic", CUSTOM = "custom" } export declare enum ModerationAction { ALLOW = "allow", FLAG = "flag", REDACT = "redact", BLOCK = "block", REVIEW = "review" } export declare enum PIIType { EMAIL = "email", PHONE = "phone", SSN = "ssn", CREDIT_CARD = "credit_card", IP_ADDRESS = "ip_address", NAME = "name", ADDRESS = "address", DATE_OF_BIRTH = "date_of_birth", PASSPORT = "passport", DRIVER_LICENSE = "driver_license", BANK_ACCOUNT = "bank_account", CUSTOM = "custom" } export interface ModerationResult { /** Is content safe? */ isSafe: boolean; /** Overall action to take */ action: ModerationAction; /** Detected issues */ flags: ModerationFlag[]; /** PII detections */ piiDetections?: PIIDetection[]; /** Confidence score (0-1) */ confidence: number; /** Processed/redacted content */ processedContent?: string; /** Processing time (ms) */ processingTimeMs: number; /** Metadata */ metadata?: Record; } export interface ModerationFlag { /** Flag category */ category: ModerationCategory; /** Severity level */ severity: ModerationSeverity; /** Confidence score (0-1) */ confidence: number; /** Specific reason/details */ reason?: string; /** Location in text (if applicable) */ location?: { start: number; end: number; text: string; }; /** Suggested action */ suggestedAction: ModerationAction; } export interface PIIDetection { /** Type of PII */ type: PIIType; /** Detected value */ value: string; /** Location in text */ location: { start: number; end: number; }; /** Confidence score (0-1) */ confidence: number; /** Redacted value (if redaction applied) */ redactedValue?: string; } export interface ModerationConfig { /** Categories to check */ categories: ModerationCategory[]; /** PII types to detect */ piiTypes?: PIIType[]; /** Minimum confidence threshold (0-1) */ minConfidence?: number; /** Action thresholds by severity */ actionThresholds?: { [key in ModerationSeverity]?: ModerationAction; }; /** Enable PII detection */ enablePIIDetection?: boolean; /** Enable PII redaction */ enablePIIRedaction?: boolean; /** Redaction placeholder */ redactionPlaceholder?: string; /** Custom rules */ customRules?: ModerationRule[]; /** Provider to use */ provider?: 'openai' | 'perspective' | 'aws' | 'azure' | 'custom'; /** Language code */ language?: string; } export interface ModerationRule { /** Rule ID */ id: string; /** Rule name */ name: string; /** Category */ category: ModerationCategory; /** Pattern to match (regex) */ pattern?: string; /** Keywords to match */ keywords?: string[]; /** Severity if matched */ severity: ModerationSeverity; /** Action if matched */ action: ModerationAction; /** Case sensitive */ caseSensitive?: boolean; /** Enabled */ enabled?: boolean; } export interface ToxicityScore { /** Overall toxicity (0-1) */ toxicity: number; /** Severe toxicity (0-1) */ severeToxicity: number; /** Identity attack (0-1) */ identityAttack: number; /** Insult (0-1) */ insult: number; /** Profanity (0-1) */ profanity: number; /** Threat (0-1) */ threat: number; /** Sexual explicit (0-1) */ sexuallyExplicit: number; } export interface ModerationStats { /** Total moderation requests */ totalRequests: number; /** Flagged content count */ flaggedCount: number; /** Blocked content count */ blockedCount: number; /** PII detections count */ piiDetectionsCount: number; /** Category breakdown */ categoryBreakdown: Record; /** Severity breakdown */ severityBreakdown: Record; /** Average confidence */ avgConfidence: number; /** Average processing time (ms) */ avgProcessingTime: number; } //# sourceMappingURL=types.d.ts.map