import re def handle_text_input(text: str) -> dict: cleaned = text.strip() cleaned = re.sub(r"\s+", " ", cleaned) return { "text": cleaned, "confidence": 1.0, "input_type": "text", }