def classify_query(query: str) -> str: prompt = f"""Classify the following query: - If it's factual/simple, return 'direct' - If it needs a tool (search, calculator, etc.), return 'tool' - If it needs reasoning and tool use, return 'react' : Query: {query} Classification:""" return llm.predict(prompt).strip().lower()