Spaces:
Sleeping
Sleeping
| from langchain_core.tools import tool | |
| def reverse_words(text: str) -> str: | |
| """ | |
| Reverses the input word. For example, "hello" becomes "olleh". | |
| This tool might be useful in enigmas or puzzles where the input query seems illogical and unreadable. | |
| To use this tool, you need to provide a word with at least a character, otherwise it will raise an error. | |
| """ | |
| if not text:raise ValueError("Cannot reverse empty words.") | |
| return text[::-1] |