""" Input validation utilities """ from typing import Any from src.utils.logger import logger def validate_input(text: str, max_length: int = 10000) -> tuple[bool, str]: """ ✅ VALIDATE USER INPUT """ if not text or not text.strip(): return False, "Input cannot be empty" if len(text) > max_length: return False, f"Input exceeds maximum length of {max_length} characters" # XSS protection dangerous_patterns = ['