Code

cookbook/agent_concepts/tools/python_tools.py
from agno.agent import Agent
from agno.tools.python import PythonTools

agent = Agent(
    tools=[PythonTools()],
    show_tool_calls=True,
    markdown=True,
)
agent.print_response("Calculate the factorial of 5 using Python")

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.

2

Install libraries

pip install -U agno
3

Run Agent