Skip to main content
MelleaTool.from_smolagents() wraps any smolagents Tool instance so it can be passed to any MelleaSession call. The HuggingFace ecosystem provides many pre-built tools — PythonInterpreterTool, DuckDuckGoSearchTool, WikipediaSearchTool, and others. Prerequisites: pip install 'mellea[smolagents]'

Using smolagents tools

from_smolagents() uses smolagents’ own JSON schema conversion, so the tool’s description and parameter types are preserved exactly.
Backend note: Tool calling requires a backend and model that support function calling (e.g., Ollama with granite4.1:3b, OpenAI with gpt-4o). The default Ollama setup supports this. Full example: docs/examples/tools/smolagents_example.py

Which approach to use


See also: Tools and Agents | Context and Sessions