A Python-based tool generator that creates custom tools for AI agents based on natural language descriptions.
- Generates complete Python tool classes based on text descriptions
- Automatically creates documentation for each tool
- Inherits from the
smolagents.Toolbase class - Generates proper initialization, forward methods, and error handling
- Creates README files for each generated tool
- Clone the repository:
git clone https://github.com/yourusername/ai-tool-generator.git
cd ai-tool-generator- Install the required dependencies:
pip install -r requirements.txt- Create a
.envfile in the root directory with your Azure OpenAI credentials:
AZURE_OPENAI_API_KEY=your_api_key
OPENAI_API_VERSION=your_api_version
AZURE_OPENAI_ENDPOINT=your_endpoint
Here's a simple example of how to use the tool generator:
from ToolGenerator import ToolGenerator
# Initialize the generator
generator = ToolGenerator()
# Generate a tool based on a description
description = "Create a tool that can send emails using SMTP"
code, filename, readme = generator.generate_tool(description)
# Save the generated tool and its documentation
generator.save_tool(code, filename, readme)ai-tool-generator/
├── ToolGenerator.py # Main tool generation class
├── requirements.txt # Project dependencies
├── .env # Environment variables (not tracked)
├── .gitignore # Git ignore rules
└── README.md # Project documentation
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.