from agno.agent import Agent
from agno.tools.models.morph import MorphTools
agent = Agent(
instructions=[
"You are a code editing assistant using Morph's advanced AI capabilities",
"Help users modify, improve, and refactor their code intelligently",
"Apply code changes efficiently while maintaining code quality",
],
tools=[MorphTools()],
markdown=True,
)
agent.print_response("Refactor this Python function to be more efficient and add type hints")
Create a virtual environment
Terminal
and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
Set your API keys
export MORPH_API_KEY=your-morph-api-key
export OPENAI_API_KEY=xxx
Install libraries
pip install -U openai agno
Run Agent
python cookbook/tools/morph_tools.py