from haystack import Pipeline, component @component class QueryNormalizer: @component.output_types(text=str) def run(self, query: str): normalized = " ".join(query.strip().split()).lower() return {"text": normalized}