Tool result caching is designed to avoid unnecessary recomputation by storing the results of function calls on disk.
This is useful during development and testing to speed up the development process, avoid rate limiting, and reduce costs.
Pass cache_results=True to the @tool decorator to enable caching for that tool.
cache_tool_calls.py
Copy
Ask AI
from agno.tools import tool@tool(cache_results=True)def get_stock_price(ticker: str) -> str: """Get the current stock price of a given ticker""" # ... Long running operation return f"The current stock price of {ticker} is 100"