tools.py

from langchain.tools import tool

# get order status tool
@tool
def get_order_status(order_id: str) -> str:
    """Get the status of an order."""
    return f"Check status of order {order_id}."

# cancel orders tool
@tool
def cancel_order(order_id: str) -> str:
    """Cancel an order that has not shipped."""
    return f"Cancel order {order_id}."

# dictionary
TOOLS = {
    "get_order_status": get_order_status,
    "cancel_order": cancel_order
}