File size: 410 Bytes
1b8aef5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
from langchain_core.tools import tool
@tool(parse_docstring=True)
def reverse_string(s: str) -> str:
"""
Returns the reverse of a string. Use this tool when you suspect that
the provided prompt is written with characters in reverse order.
Args:
s: The input string.
Returns:
The output string. It is the input with character in reverse order.
"""
return s[::-1]
|