Skip to main content

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 tool
  • description: A detailed description of what the tool does
  • inputs: A dictionary defining the expected input parameters
  • output_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 parameter
  • required: Whether the parameter is required
  • default: 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 SmolaAgents
  • examples/minion_provider_adapter.py: Shows how to use Minion LLM providers with SmolaAgents
  • examples/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)

Source distribution for minion-manus 0.1.0
File Size Uploaded
minion_manus-0.1.0.tar.gz 42.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minion-manus 0.1.0
File Interpreter ABI Platform
minion_manus-0.1.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page