Minion-Manus
A toolkit for implementing and managing tools for LLM agents.
Overview
Minion-Manus provides a flexible and extensible system for creating, managing, and using tools with Large Language Models (LLMs). It offers a standardized way to define tools, validate their inputs and outputs, and integrate them with various LLM frameworks.
Key features:
- Simple class-based API for defining tools
- Support for both synchronous and asynchronous execution
- Schema validation for inputs and outputs
- Adapters for integration with other tool frameworks
- Comprehensive type hints and documentation
Installation
pip install minion-manus
Basic Usage
Creating a Tool
from minion_manus.tools import Tool
class CalculatorTool(Tool):
name = "calculator"
description = "Perform mathematical calculations"
inputs = {
"expression": {
"type": "string",
"description": "Mathematical expression to evaluate",
"required": True
}
}
output_type = "number"
def _execute(self, expression: str) -> float:
return eval(expression)
# Create and use the tool
calculator = CalculatorTool()
result = calculator.execute(expression="2 + 2 * 3")
print(result) # 8.0
Creating an Async Tool
import asyncio
from minion_manus.tools import AsyncTool
class AsyncCalculatorTool(AsyncTool):
name = "async_calculator"
description = "Perform mathematical calculations asynchronously"
inputs = {
"expression": {
"type": "string",
"description": "Mathematical expression to evaluate",
"required": True
}
}
output_type = "number"
async def _aexecute(self, expression: str) -> float:
# Simulate async operation
await asyncio.sleep(0.1)
return eval(expression)
# Create and use the async tool
async def main():
calculator = AsyncCalculatorTool()
result = await calculator.aexecute(expression="2 + 2 * 3")
print(result) # 8.0
asyncio.run(main())
Tool Schema Definition
Tools are defined with the following schema attributes:
name: A unique identifier for the tooldescription: A detailed description of what the tool doesinputs: A dictionary defining the expected input parametersoutput_type: The type of the expected output
Input parameters can have the following attributes:
type: Data type (string, number, boolean, object, array)description: Description of the parameterrequired: Whether the parameter is requireddefault: Default value if not provided
Adapters
Minion-Manus provides adapters to convert tools between different frameworks. Currently supported:
SmolaAgents Adapter
Convert between Minion-Manus tools and SmolaAgents tools:
from minion_manus.tools.adapters import AdapterFactory, AdapterType
from smolagents import DuckDuckGoSearchTool
# Convert Minion tool to SmolaAgents tool
calculator = CalculatorTool()
smola_calculator = AdapterFactory.get_adapter(AdapterType.SMOLAGENTS).to_external(calculator)
# Convert SmolaAgents tool to Minion tool
ddg_tool = DuckDuckGoSearchTool()
minion_ddg_tool = AdapterFactory.get_adapter(AdapterType.SMOLAGENTS).to_internal(ddg_tool)
Examples
The repository contains several examples demonstrating different aspects of Minion-Manus:
examples/smolagents_adapter_example.py: Demonstrates how to convert tools between Minion-Manus and SmolaAgentsexamples/minion_provider_adapter.py: Shows how to use Minion LLM providers with SmolaAgentsexamples/database_tool_example.py: Illustrates creating database tools using SQLAlchemy
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for minion-manus 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| minion_manus-0.1.0.tar.gz | 42.4 kB | Without provenance | Details for minion_manus-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| minion_manus-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for minion_manus-0.1.0-py3-none-any.whl |
Total release size: 94.0 kB
Release files / minion_manus-0.1.0.tar.gz
| Download URL | minion_manus-0.1.0.tar.gz |
|---|---|
| Size | 42.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0c4444bbcd9834b280045d6aa87dcdc61bdffb1b5aba1499d92704e09ace0d3
|
|
BLAKE2b-256 checksum How to use checksums |
b8522e90e9c9352b3dabd82967b8b7cffd2a30b301d3a595748490215d924fab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.4
|
Release files / minion_manus-0.1.0-py3-none-any.whl
| Download URL | minion_manus-0.1.0-py3-none-any.whl |
|---|---|
| Size | 51.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e27768d3375b0c396c613f89576a12975bb326b1a1b2bdd9e9ac111e37aec939
|
|
BLAKE2b-256 checksum How to use checksums |
67408571a4a2a1af3fdf9969300197e30ed9b529703f279da390eb562dfe5435
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.4
|
Security for minion-manus 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.