Excited to announce the initial release of tool-parse, a Python library designed to simplify LLM tool-calling!
🚀 What's New
- Replaces hypertion package which only supported regular functions
- Supports function registration (both synchronous and asynchronous)
- Compatible with `pydantic.BaseModel`, `typing.TypedDict`, and `typing.NamedTuple`
- Multiple ways to register tools: decorators, direct passing, and key-value pairs
- Schema generation in 'base' and 'claude' formats
- Tool invocation from call expressions or metadata
- Registry combination functionality
🔧 Installation
pip install tool-parse
🌟 Key Features
- Easy tool registration with optional docstring support
- Flexible schema generation for different LLM providers
- Simple tool invocation
- Support for various parameter types
- Registry combination for organizing tools
📚 Quick Start
python
from tool_parse import ToolRegistry
tr = ToolRegistry()
tr.register
def search_function(query: str, max_results: int = 10):
"""
Search the web for given query
:param query: The search query string
:param max_results: Maximum number of results to return
"""
...
Generate schema
tools = tr.marshal('base')
Invoke tool
result = tr.compile('search_function("Python programming", max_results=5)')
For more detailed usage examples and documentation, please refer to our [README](https://github.com/synacktraa/tool-parse#readme).
🤝 Contributing
contributions, issues, and feature requests are welcome! Feel free to check our [issues page](https://github.com/synacktraa/tool-parse/issues).
---
Thank you for your interest in tool-parse. Looking forward to seeing how you'll use it in your projects!