Duplicated from agents-course/First_agent_template
1234567891011from smolagents import tool @tooldef count_words(text: str) -> str: """ Cuenta cuántas palabras hay en un texto. Args: text: El texto a analizar. """ num_words = len(text.split()) return f"El texto tiene {num_words} palabras."