Xiaomi MiMo Tool Use
Give the agent a web search tool and let it call tools while thinking mode is on (`use_thinking=True`).
Give the agent a web search tool and let it call tools while thinking mode is on (use_thinking=True). The model reasons about which tool to call, runs it, and folds the result into its answer.
"""
Xiaomi MiMo Tool Use
====================
Give the agent a web search tool and let it call tools while thinking mode is on
(`use_thinking=True`). The model reasons about which tool to call, runs it, and
folds the result into its answer.
Run `uv pip install ddgs` to install dependencies.
"""
from agno.agent import Agent
from agno.models.xiaomi import MiMo
from agno.tools.websearch import WebSearchTools
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(
model=MiMo(id="mimo-v2.5-pro", use_thinking=True),
tools=[WebSearchTools()],
markdown=True,
)
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
agent.print_response(
"What is happening in France?",
stream=True,
show_full_reasoning=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 Xiaomi MiMo API key
export MIMO_API_KEY="your_mimo_api_key_here"Run the example
Save the code above as tool_use.py, then run:
python tool_use.pyFull source: cookbook/90_models/xiaomi/tool_use.py