MiniMax Tool Use
Equip a MiniMax M3 agent with WebSearchTools and stream a news query.
MiniMax requires complete reasoning history on tool follow-ups. This adapter strips inline thinking and does not restore separate reasoning details in subsequent requests. For this M3 example, use the thinking-disabled edit below. See MiniMax thinking control.
"""
MiniMax Tool Use
================
Cookbook example for `minimax/tool_use.py`.
"""
from agno.agent import Agent
from agno.models.minimax import MiniMax
from agno.tools.websearch import WebSearchTools
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(
model=MiniMax(id="MiniMax-M3"),
markdown=True,
tools=[WebSearchTools()],
)
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
agent.print_response("What is happening in France?", stream=True)Run the Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno ddgs openaiExport your MiniMax API key
export MINIMAX_API_KEY="your_minimax_api_key_here"Disable thinking for this tool example
Replace the model construction with MiniMax(id="MiniMax-M3", extra_body={"thinking": {"type": "disabled"}}). Keep the existing tools and streaming call. This setting is supported by M3; it does not disable thinking on M2 models.
Run the example
Save the code above as tool_use.py, then run:
python tool_use.pyFull source: cookbook/90_models/minimax/tool_use.py